{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.LHWUtVm8/b1/dune-grid_2.10.0-1_amd64.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.LHWUtVm8/b2/dune-grid_2.10.0-1_amd64.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,4 +1,4 @@\n \n 84109b22d46971ef6d43a3726c8d0c18 8121520 debug optional libdune-grid-dev-dbgsym_2.10.0-1_amd64.deb\n e002145b0de80b153ff36c15f3f90dff 1060816 libdevel optional libdune-grid-dev_2.10.0-1_amd64.deb\n- ddc71dd86ccad87547a596ae90e881be 7892904 doc optional libdune-grid-doc_2.10.0-1_all.deb\n+ bd12496b85d17ffb07db8ccc2513d5d0 7892692 doc optional libdune-grid-doc_2.10.0-1_all.deb\n"}, {"source1": "libdune-grid-doc_2.10.0-1_all.deb", "source2": "libdune-grid-doc_2.10.0-1_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 2024-11-14 20:09:51.000000 debian-binary\n--rw-r--r-- 0 0 0 42032 2024-11-14 20:09:51.000000 control.tar.xz\n--rw-r--r-- 0 0 0 7850680 2024-11-14 20:09:51.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 41856 2024-11-14 20:09:51.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 7850644 2024-11-14 20:09:51.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,146 +1,146 @@\n usr/share/doc/libdune-grid-doc/changelog.Debian.gz\n usr/share/doc/libdune-grid-doc/changelog.gz\n usr/share/doc/libdune-grid-doc/copyright\n+usr/share/doc/libdune-grid-doc/doxygen/a00143.html\n usr/share/doc/libdune-grid-doc/doxygen/a00146.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00149.html\n usr/share/doc/libdune-grid-doc/doxygen/a00164.html\n usr/share/doc/libdune-grid-doc/doxygen/a00164_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00167.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00167_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00170.html\n usr/share/doc/libdune-grid-doc/doxygen/a00170_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00176.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00176_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00179.html\n usr/share/doc/libdune-grid-doc/doxygen/a00179_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00182.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00182_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00185.html\n usr/share/doc/libdune-grid-doc/doxygen/a00185_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00188.html\n usr/share/doc/libdune-grid-doc/doxygen/a00188_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00191.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00191_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00194.html\n usr/share/doc/libdune-grid-doc/doxygen/a00194_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00197.html\n usr/share/doc/libdune-grid-doc/doxygen/a00197_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00200.html\n usr/share/doc/libdune-grid-doc/doxygen/a00200_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00203.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00203_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00206.html\n usr/share/doc/libdune-grid-doc/doxygen/a00206_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00209.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00209_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00218.html\n usr/share/doc/libdune-grid-doc/doxygen/a00218_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00224.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00224_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00227.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00227_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00233.html\n usr/share/doc/libdune-grid-doc/doxygen/a00233_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00260.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00260_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00281.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00281_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00236.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00236_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00242.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00242_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00245.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00245_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00269.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00269_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00287.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00287_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00296.html\n usr/share/doc/libdune-grid-doc/doxygen/a00296_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00299.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00299_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00317.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00317_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00314.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00314_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00320.html\n usr/share/doc/libdune-grid-doc/doxygen/a00320_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00329.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00329_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00332.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00332_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00335.html\n usr/share/doc/libdune-grid-doc/doxygen/a00335_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00344.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00344_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00350.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00350_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00341.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00341_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00353.html\n usr/share/doc/libdune-grid-doc/doxygen/a00353_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00359.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00359_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00362.html\n usr/share/doc/libdune-grid-doc/doxygen/a00362_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00566.html\n usr/share/doc/libdune-grid-doc/doxygen/a00566_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00569.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00569_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00578.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00578_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00581.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00581_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00572.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00572_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00575.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00575_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00584.html\n usr/share/doc/libdune-grid-doc/doxygen/a00584_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00587.html\n usr/share/doc/libdune-grid-doc/doxygen/a00587_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00590.html\n usr/share/doc/libdune-grid-doc/doxygen/a00590_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00596.html\n usr/share/doc/libdune-grid-doc/doxygen/a00596_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00605.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00605_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00599.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00599_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00608.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00608_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00614.html\n usr/share/doc/libdune-grid-doc/doxygen/a00614_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00617.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00617_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00620.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00620_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00623.html\n usr/share/doc/libdune-grid-doc/doxygen/a00623_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00626.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00626_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00629.html\n usr/share/doc/libdune-grid-doc/doxygen/a00629_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00632.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00632_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00635.html\n usr/share/doc/libdune-grid-doc/doxygen/a00635_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00638.html\n usr/share/doc/libdune-grid-doc/doxygen/a00638_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00641.html\n usr/share/doc/libdune-grid-doc/doxygen/a00641_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00644.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00644_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00647.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00647_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00650.html\n usr/share/doc/libdune-grid-doc/doxygen/a00650_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00653.html\n usr/share/doc/libdune-grid-doc/doxygen/a00653_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00656.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00656_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00659.html\n usr/share/doc/libdune-grid-doc/doxygen/a00659_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00662.html\n usr/share/doc/libdune-grid-doc/doxygen/a00662_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00665.html\n usr/share/doc/libdune-grid-doc/doxygen/a00665_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00668.html\n usr/share/doc/libdune-grid-doc/doxygen/a00668_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00671.html\n usr/share/doc/libdune-grid-doc/doxygen/a00671_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00674.html\n usr/share/doc/libdune-grid-doc/doxygen/a00674_source.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00677.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00677_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00680.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00680_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00683.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00683_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00686.html\n usr/share/doc/libdune-grid-doc/doxygen/a00686_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00689.html\n usr/share/doc/libdune-grid-doc/doxygen/a00689_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00692.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00692_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00695.html\n usr/share/doc/libdune-grid-doc/doxygen/a00695_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00698.html\n usr/share/doc/libdune-grid-doc/doxygen/a00698_source.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00701.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00701_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00704.html\n usr/share/doc/libdune-grid-doc/doxygen/a00704_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00707.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00707_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00710.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00710_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00713.html\n usr/share/doc/libdune-grid-doc/doxygen/a00713_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00716.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00716_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00719.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00719_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00722.html\n usr/share/doc/libdune-grid-doc/doxygen/a00722_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00725.html\n usr/share/doc/libdune-grid-doc/doxygen/a00725_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00728.html\n usr/share/doc/libdune-grid-doc/doxygen/a00728_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00731.html\n@@ -182,101 +182,101 @@\n usr/share/doc/libdune-grid-doc/doxygen/a00785.html\n usr/share/doc/libdune-grid-doc/doxygen/a00785_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00788.html\n usr/share/doc/libdune-grid-doc/doxygen/a00788_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00791.html\n usr/share/doc/libdune-grid-doc/doxygen/a00791_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00794.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00794_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00797.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00797_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00800.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00800_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00803.html\n usr/share/doc/libdune-grid-doc/doxygen/a00803_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00806.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00806_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00809.html\n usr/share/doc/libdune-grid-doc/doxygen/a00809_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00812.html\n usr/share/doc/libdune-grid-doc/doxygen/a00812_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00815.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00815_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00818.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00818_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00821.html\n usr/share/doc/libdune-grid-doc/doxygen/a00821_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00824.html\n usr/share/doc/libdune-grid-doc/doxygen/a00824_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00827.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00827_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00830.html\n usr/share/doc/libdune-grid-doc/doxygen/a00830_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00833.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00833_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00836.html\n usr/share/doc/libdune-grid-doc/doxygen/a00836_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00839.html\n usr/share/doc/libdune-grid-doc/doxygen/a00839_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00842.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00842_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00845.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00845_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00848.html\n usr/share/doc/libdune-grid-doc/doxygen/a00851.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00851_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00854.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00854_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00857.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00857_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00860.html\n usr/share/doc/libdune-grid-doc/doxygen/a00860_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00863.html\n usr/share/doc/libdune-grid-doc/doxygen/a00863_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00866.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00866_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00869.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00869_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00872.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00872_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00875.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00875_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00878.html\n usr/share/doc/libdune-grid-doc/doxygen/a00881.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00881_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00884.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00884_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00887.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00887_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00890.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00890_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00893.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00893_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00896.html\n usr/share/doc/libdune-grid-doc/doxygen/a00896_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00899.html\n usr/share/doc/libdune-grid-doc/doxygen/a00899_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00902.html\n+usr/share/doc/libdune-grid-doc/doxygen/a00902_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00905.html\n usr/share/doc/libdune-grid-doc/doxygen/a00905_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00908.html\n usr/share/doc/libdune-grid-doc/doxygen/a00908_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00911.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00911_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00914.html\n usr/share/doc/libdune-grid-doc/doxygen/a00914_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00917.html\n usr/share/doc/libdune-grid-doc/doxygen/a00917_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00920.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00920_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00923.html\n usr/share/doc/libdune-grid-doc/doxygen/a00923_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00926.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00926_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00929.html\n usr/share/doc/libdune-grid-doc/doxygen/a00929_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00932.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00932_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00935.html\n usr/share/doc/libdune-grid-doc/doxygen/a00935_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00938.html\n usr/share/doc/libdune-grid-doc/doxygen/a00938_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00941.html\n usr/share/doc/libdune-grid-doc/doxygen/a00941_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00944.html\n usr/share/doc/libdune-grid-doc/doxygen/a00944_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00947.html\n-usr/share/doc/libdune-grid-doc/doxygen/a00947_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00950.html\n usr/share/doc/libdune-grid-doc/doxygen/a00950_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00953.html\n usr/share/doc/libdune-grid-doc/doxygen/a00953_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00956.html\n usr/share/doc/libdune-grid-doc/doxygen/a00956_source.html\n usr/share/doc/libdune-grid-doc/doxygen/a00959.html\n"}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -3,336 +3,336 @@\n drwxr-xr-x 0 root (0) root (0) 0 2024-11-14 20:09:51.000000 ./usr/share/\n drwxr-xr-x 0 root (0) root (0) 0 2024-11-14 20:09:51.000000 ./usr/share/doc/\n drwxr-xr-x 0 root (0) root (0) 0 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/\n -rw-r--r-- 0 root (0) root (0) 1388 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/changelog.Debian.gz\n -rw-r--r-- 0 root (0) root (0) 6138 2024-10-22 15:31:40.000000 ./usr/share/doc/libdune-grid-doc/changelog.gz\n -rw-r--r-- 0 root (0) root (0) 3525 2023-01-12 15:07:29.000000 ./usr/share/doc/libdune-grid-doc/copyright\n drwxr-xr-x 0 root (0) root (0) 0 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/\n--rw-r--r-- 0 root (0) root (0) 5804 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00146.html\n--rw-r--r-- 0 root (0) root (0) 5417 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00149.html\n--rw-r--r-- 0 root (0) root (0) 5384 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00164.html\n--rw-r--r-- 0 root (0) root (0) 20165 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00164_source.html\n--rw-r--r-- 0 root (0) root (0) 5198 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00170.html\n--rw-r--r-- 0 root (0) root (0) 23216 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00170_source.html\n--rw-r--r-- 0 root (0) root (0) 7353 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00176.html\n--rw-r--r-- 0 root (0) root (0) 32746 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00176_source.html\n--rw-r--r-- 0 root (0) root (0) 5062 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00179.html\n--rw-r--r-- 0 root (0) root (0) 17472 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00179_source.html\n--rw-r--r-- 0 root (0) root (0) 5308 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00185.html\n--rw-r--r-- 0 root (0) root (0) 68408 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00185_source.html\n--rw-r--r-- 0 root (0) root (0) 5119 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00188.html\n--rw-r--r-- 0 root (0) root (0) 17467 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00188_source.html\n--rw-r--r-- 0 root (0) root (0) 5195 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00191.html\n--rw-r--r-- 0 root (0) root (0) 31837 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00191_source.html\n--rw-r--r-- 0 root (0) root (0) 6608 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00194.html\n--rw-r--r-- 0 root (0) root (0) 18591 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00194_source.html\n--rw-r--r-- 0 root (0) root (0) 6660 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00197.html\n--rw-r--r-- 0 root (0) root (0) 210196 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00197_source.html\n--rw-r--r-- 0 root (0) root (0) 6090 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00200.html\n--rw-r--r-- 0 root (0) root (0) 30249 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00200_source.html\n+-rw-r--r-- 0 root (0) root (0) 5804 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00143.html\n+-rw-r--r-- 0 root (0) root (0) 5417 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00146.html\n+-rw-r--r-- 0 root (0) root (0) 5198 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00164.html\n+-rw-r--r-- 0 root (0) root (0) 23216 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00164_source.html\n+-rw-r--r-- 0 root (0) root (0) 5308 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00167.html\n+-rw-r--r-- 0 root (0) root (0) 68408 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00167_source.html\n+-rw-r--r-- 0 root (0) root (0) 6660 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00170.html\n+-rw-r--r-- 0 root (0) root (0) 210196 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00170_source.html\n+-rw-r--r-- 0 root (0) root (0) 5384 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00179.html\n+-rw-r--r-- 0 root (0) root (0) 20165 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00179_source.html\n+-rw-r--r-- 0 root (0) root (0) 9564 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00182.html\n+-rw-r--r-- 0 root (0) root (0) 63476 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00182_source.html\n+-rw-r--r-- 0 root (0) root (0) 6090 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00185.html\n+-rw-r--r-- 0 root (0) root (0) 30249 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00185_source.html\n+-rw-r--r-- 0 root (0) root (0) 5195 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00188.html\n+-rw-r--r-- 0 root (0) root (0) 31837 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00188_source.html\n+-rw-r--r-- 0 root (0) root (0) 4798 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00194.html\n+-rw-r--r-- 0 root (0) root (0) 16224 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00194_source.html\n+-rw-r--r-- 0 root (0) root (0) 6608 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00197.html\n+-rw-r--r-- 0 root (0) root (0) 18591 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00197_source.html\n+-rw-r--r-- 0 root (0) root (0) 7012 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00200.html\n+-rw-r--r-- 0 root (0) root (0) 103974 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00200_source.html\n+-rw-r--r-- 0 root (0) root (0) 7353 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00203.html\n+-rw-r--r-- 0 root (0) root (0) 32746 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00203_source.html\n -rw-r--r-- 0 root (0) root (0) 13227 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00206.html\n -rw-r--r-- 0 root (0) root (0) 196698 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00206_source.html\n--rw-r--r-- 0 root (0) root (0) 4798 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00218.html\n--rw-r--r-- 0 root (0) root (0) 16224 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00218_source.html\n--rw-r--r-- 0 root (0) root (0) 6299 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00224.html\n--rw-r--r-- 0 root (0) root (0) 23401 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00224_source.html\n--rw-r--r-- 0 root (0) root (0) 9564 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00227.html\n--rw-r--r-- 0 root (0) root (0) 63476 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00227_source.html\n--rw-r--r-- 0 root (0) root (0) 7012 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00233.html\n--rw-r--r-- 0 root (0) root (0) 103974 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00233_source.html\n--rw-r--r-- 0 root (0) root (0) 12859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00260.html\n--rw-r--r-- 0 root (0) root (0) 36323 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00260_source.html\n--rw-r--r-- 0 root (0) root (0) 5452 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00281.html\n--rw-r--r-- 0 root (0) root (0) 24835 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00281_source.html\n--rw-r--r-- 0 root (0) root (0) 6319 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00296.html\n--rw-r--r-- 0 root (0) root (0) 31787 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00296_source.html\n--rw-r--r-- 0 root (0) root (0) 5745 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00299.html\n--rw-r--r-- 0 root (0) root (0) 24811 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00299_source.html\n--rw-r--r-- 0 root (0) root (0) 5372 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00317.html\n--rw-r--r-- 0 root (0) root (0) 20331 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00317_source.html\n+-rw-r--r-- 0 root (0) root (0) 6299 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00209.html\n+-rw-r--r-- 0 root (0) root (0) 23401 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00209_source.html\n+-rw-r--r-- 0 root (0) root (0) 5119 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00218.html\n+-rw-r--r-- 0 root (0) root (0) 17467 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00218_source.html\n+-rw-r--r-- 0 root (0) root (0) 5062 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00233.html\n+-rw-r--r-- 0 root (0) root (0) 17472 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00233_source.html\n+-rw-r--r-- 0 root (0) root (0) 6319 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00236.html\n+-rw-r--r-- 0 root (0) root (0) 31787 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00236_source.html\n+-rw-r--r-- 0 root (0) root (0) 12859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00242.html\n+-rw-r--r-- 0 root (0) root (0) 36323 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00242_source.html\n+-rw-r--r-- 0 root (0) root (0) 8741 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00245.html\n+-rw-r--r-- 0 root (0) root (0) 106215 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00245_source.html\n+-rw-r--r-- 0 root (0) root (0) 19456 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00269.html\n+-rw-r--r-- 0 root (0) root (0) 47029 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00269_source.html\n+-rw-r--r-- 0 root (0) root (0) 5372 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00287.html\n+-rw-r--r-- 0 root (0) root (0) 20331 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00287_source.html\n+-rw-r--r-- 0 root (0) root (0) 5885 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00296.html\n+-rw-r--r-- 0 root (0) root (0) 61145 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00296_source.html\n+-rw-r--r-- 0 root (0) root (0) 6339 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00314.html\n+-rw-r--r-- 0 root (0) root (0) 65889 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00314_source.html\n -rw-r--r-- 0 root (0) root (0) 6588 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00320.html\n -rw-r--r-- 0 root (0) root (0) 24645 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00320_source.html\n--rw-r--r-- 0 root (0) root (0) 4571 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00329.html\n--rw-r--r-- 0 root (0) root (0) 56512 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00329_source.html\n--rw-r--r-- 0 root (0) root (0) 19456 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00332.html\n--rw-r--r-- 0 root (0) root (0) 47029 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00332_source.html\n--rw-r--r-- 0 root (0) root (0) 8741 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00335.html\n--rw-r--r-- 0 root (0) root (0) 106215 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00335_source.html\n--rw-r--r-- 0 root (0) root (0) 4950 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00344.html\n--rw-r--r-- 0 root (0) root (0) 7310 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00344_source.html\n--rw-r--r-- 0 root (0) root (0) 6339 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00350.html\n--rw-r--r-- 0 root (0) root (0) 65889 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00350_source.html\n--rw-r--r-- 0 root (0) root (0) 5885 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00353.html\n--rw-r--r-- 0 root (0) root (0) 61145 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00353_source.html\n--rw-r--r-- 0 root (0) root (0) 10013 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00362.html\n--rw-r--r-- 0 root (0) root (0) 54462 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00362_source.html\n--rw-r--r-- 0 root (0) root (0) 6304 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00566.html\n--rw-r--r-- 0 root (0) root (0) 45976 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00566_source.html\n--rw-r--r-- 0 root (0) root (0) 4123 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00569.html\n--rw-r--r-- 0 root (0) root (0) 6410 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00569_source.html\n--rw-r--r-- 0 root (0) root (0) 4783 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00578.html\n--rw-r--r-- 0 root (0) root (0) 12569 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00578_source.html\n--rw-r--r-- 0 root (0) root (0) 6162 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00581.html\n--rw-r--r-- 0 root (0) root (0) 44586 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00581_source.html\n--rw-r--r-- 0 root (0) root (0) 8578 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00584.html\n--rw-r--r-- 0 root (0) root (0) 70888 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00584_source.html\n+-rw-r--r-- 0 root (0) root (0) 5745 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00335.html\n+-rw-r--r-- 0 root (0) root (0) 24811 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00335_source.html\n+-rw-r--r-- 0 root (0) root (0) 5452 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00341.html\n+-rw-r--r-- 0 root (0) root (0) 24835 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00341_source.html\n+-rw-r--r-- 0 root (0) root (0) 4950 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00353.html\n+-rw-r--r-- 0 root (0) root (0) 7310 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00353_source.html\n+-rw-r--r-- 0 root (0) root (0) 10013 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00359.html\n+-rw-r--r-- 0 root (0) root (0) 54462 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00359_source.html\n+-rw-r--r-- 0 root (0) root (0) 4571 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00362.html\n+-rw-r--r-- 0 root (0) root (0) 56512 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00362_source.html\n+-rw-r--r-- 0 root (0) root (0) 4123 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00566.html\n+-rw-r--r-- 0 root (0) root (0) 6410 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00566_source.html\n+-rw-r--r-- 0 root (0) root (0) 5364 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00572.html\n+-rw-r--r-- 0 root (0) root (0) 14555 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00572_source.html\n+-rw-r--r-- 0 root (0) root (0) 8408 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00575.html\n+-rw-r--r-- 0 root (0) root (0) 117631 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00575_source.html\n+-rw-r--r-- 0 root (0) root (0) 4783 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00584.html\n+-rw-r--r-- 0 root (0) root (0) 12569 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00584_source.html\n -rw-r--r-- 0 root (0) root (0) 5297 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00587.html\n -rw-r--r-- 0 root (0) root (0) 22774 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00587_source.html\n--rw-r--r-- 0 root (0) root (0) 8408 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00590.html\n--rw-r--r-- 0 root (0) root (0) 117631 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00590_source.html\n--rw-r--r-- 0 root (0) root (0) 5364 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00596.html\n--rw-r--r-- 0 root (0) root (0) 14555 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00596_source.html\n--rw-r--r-- 0 root (0) root (0) 4938 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00605.html\n--rw-r--r-- 0 root (0) root (0) 20258 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00605_source.html\n--rw-r--r-- 0 root (0) root (0) 4918 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00614.html\n--rw-r--r-- 0 root (0) root (0) 35857 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00614_source.html\n--rw-r--r-- 0 root (0) root (0) 5592 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00617.html\n--rw-r--r-- 0 root (0) root (0) 65600 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00617_source.html\n--rw-r--r-- 0 root (0) root (0) 6561 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00620.html\n--rw-r--r-- 0 root (0) root (0) 206943 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00620_source.html\n--rw-r--r-- 0 root (0) root (0) 27808 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00623.html\n--rw-r--r-- 0 root (0) root (0) 144961 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00623_source.html\n--rw-r--r-- 0 root (0) root (0) 5241 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00626.html\n--rw-r--r-- 0 root (0) root (0) 28807 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00626_source.html\n--rw-r--r-- 0 root (0) root (0) 5259 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00629.html\n--rw-r--r-- 0 root (0) root (0) 84755 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00629_source.html\n--rw-r--r-- 0 root (0) root (0) 6019 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00635.html\n--rw-r--r-- 0 root (0) root (0) 55372 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00635_source.html\n+-rw-r--r-- 0 root (0) root (0) 6162 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00590.html\n+-rw-r--r-- 0 root (0) root (0) 44586 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00590_source.html\n+-rw-r--r-- 0 root (0) root (0) 6304 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00596.html\n+-rw-r--r-- 0 root (0) root (0) 45976 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00596_source.html\n+-rw-r--r-- 0 root (0) root (0) 4938 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00599.html\n+-rw-r--r-- 0 root (0) root (0) 20258 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00599_source.html\n+-rw-r--r-- 0 root (0) root (0) 8578 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00608.html\n+-rw-r--r-- 0 root (0) root (0) 70888 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00608_source.html\n+-rw-r--r-- 0 root (0) root (0) 5489 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00614.html\n+-rw-r--r-- 0 root (0) root (0) 47803 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00614_source.html\n+-rw-r--r-- 0 root (0) root (0) 6133 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00623.html\n+-rw-r--r-- 0 root (0) root (0) 105401 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00623_source.html\n+-rw-r--r-- 0 root (0) root (0) 4935 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00626.html\n+-rw-r--r-- 0 root (0) root (0) 3889 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00629.html\n+-rw-r--r-- 0 root (0) root (0) 67784 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00629_source.html\n+-rw-r--r-- 0 root (0) root (0) 5259 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00632.html\n+-rw-r--r-- 0 root (0) root (0) 84755 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00632_source.html\n+-rw-r--r-- 0 root (0) root (0) 5245 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00635.html\n+-rw-r--r-- 0 root (0) root (0) 28783 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00635_source.html\n -rw-r--r-- 0 root (0) root (0) 4822 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00638.html\n -rw-r--r-- 0 root (0) root (0) 22389 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00638_source.html\n -rw-r--r-- 0 root (0) root (0) 3889 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00641.html\n -rw-r--r-- 0 root (0) root (0) 128351 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00641_source.html\n--rw-r--r-- 0 root (0) root (0) 5325 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00644.html\n--rw-r--r-- 0 root (0) root (0) 40677 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00644_source.html\n--rw-r--r-- 0 root (0) root (0) 4483 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00647.html\n--rw-r--r-- 0 root (0) root (0) 6327 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00650.html\n--rw-r--r-- 0 root (0) root (0) 109813 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00650_source.html\n--rw-r--r-- 0 root (0) root (0) 5910 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00653.html\n--rw-r--r-- 0 root (0) root (0) 41406 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00653_source.html\n--rw-r--r-- 0 root (0) root (0) 13661 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00656.html\n--rw-r--r-- 0 root (0) root (0) 30513 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00656_source.html\n--rw-r--r-- 0 root (0) root (0) 9466 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00659.html\n--rw-r--r-- 0 root (0) root (0) 154753 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00659_source.html\n--rw-r--r-- 0 root (0) root (0) 5482 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00662.html\n--rw-r--r-- 0 root (0) root (0) 33202 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00662_source.html\n--rw-r--r-- 0 root (0) root (0) 5952 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00665.html\n--rw-r--r-- 0 root (0) root (0) 107207 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00665_source.html\n--rw-r--r-- 0 root (0) root (0) 8631 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00668.html\n--rw-r--r-- 0 root (0) root (0) 91920 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00668_source.html\n--rw-r--r-- 0 root (0) root (0) 6133 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00671.html\n--rw-r--r-- 0 root (0) root (0) 105401 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00671_source.html\n--rw-r--r-- 0 root (0) root (0) 5047 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00674.html\n--rw-r--r-- 0 root (0) root (0) 27135 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00674_source.html\n--rw-r--r-- 0 root (0) root (0) 6540 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00677.html\n--rw-r--r-- 0 root (0) root (0) 60301 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00677_source.html\n--rw-r--r-- 0 root (0) root (0) 4935 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00683.html\n--rw-r--r-- 0 root (0) root (0) 5065 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00686.html\n--rw-r--r-- 0 root (0) root (0) 18609 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00686_source.html\n--rw-r--r-- 0 root (0) root (0) 7361 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00689.html\n--rw-r--r-- 0 root (0) root (0) 123399 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00689_source.html\n--rw-r--r-- 0 root (0) root (0) 6061 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00695.html\n--rw-r--r-- 0 root (0) root (0) 86686 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00695_source.html\n--rw-r--r-- 0 root (0) root (0) 5489 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00698.html\n--rw-r--r-- 0 root (0) root (0) 47803 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00698_source.html\n--rw-r--r-- 0 root (0) root (0) 8065 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00704.html\n--rw-r--r-- 0 root (0) root (0) 75017 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00704_source.html\n--rw-r--r-- 0 root (0) root (0) 4296 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00707.html\n--rw-r--r-- 0 root (0) root (0) 3889 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00710.html\n--rw-r--r-- 0 root (0) root (0) 67784 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00710_source.html\n+-rw-r--r-- 0 root (0) root (0) 4296 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00644.html\n+-rw-r--r-- 0 root (0) root (0) 5482 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00647.html\n+-rw-r--r-- 0 root (0) root (0) 33202 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00647_source.html\n+-rw-r--r-- 0 root (0) root (0) 5592 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00650.html\n+-rw-r--r-- 0 root (0) root (0) 65600 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00650_source.html\n+-rw-r--r-- 0 root (0) root (0) 8065 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00653.html\n+-rw-r--r-- 0 root (0) root (0) 75017 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00653_source.html\n+-rw-r--r-- 0 root (0) root (0) 6561 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00659.html\n+-rw-r--r-- 0 root (0) root (0) 206943 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00659_source.html\n+-rw-r--r-- 0 root (0) root (0) 6061 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00662.html\n+-rw-r--r-- 0 root (0) root (0) 86686 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00662_source.html\n+-rw-r--r-- 0 root (0) root (0) 6540 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00665.html\n+-rw-r--r-- 0 root (0) root (0) 60301 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00665_source.html\n+-rw-r--r-- 0 root (0) root (0) 5047 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00668.html\n+-rw-r--r-- 0 root (0) root (0) 27135 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00668_source.html\n+-rw-r--r-- 0 root (0) root (0) 13661 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00671.html\n+-rw-r--r-- 0 root (0) root (0) 30513 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00671_source.html\n+-rw-r--r-- 0 root (0) root (0) 5325 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00674.html\n+-rw-r--r-- 0 root (0) root (0) 40677 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00674_source.html\n+-rw-r--r-- 0 root (0) root (0) 5241 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00680.html\n+-rw-r--r-- 0 root (0) root (0) 28807 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00680_source.html\n+-rw-r--r-- 0 root (0) root (0) 27808 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00683.html\n+-rw-r--r-- 0 root (0) root (0) 144961 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00683_source.html\n+-rw-r--r-- 0 root (0) root (0) 5910 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00686.html\n+-rw-r--r-- 0 root (0) root (0) 41406 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00686_source.html\n+-rw-r--r-- 0 root (0) root (0) 5952 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00689.html\n+-rw-r--r-- 0 root (0) root (0) 107207 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00689_source.html\n+-rw-r--r-- 0 root (0) root (0) 4918 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00692.html\n+-rw-r--r-- 0 root (0) root (0) 35857 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00692_source.html\n+-rw-r--r-- 0 root (0) root (0) 6327 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00695.html\n+-rw-r--r-- 0 root (0) root (0) 109813 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00695_source.html\n+-rw-r--r-- 0 root (0) root (0) 9466 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00698.html\n+-rw-r--r-- 0 root (0) root (0) 154753 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00698_source.html\n+-rw-r--r-- 0 root (0) root (0) 5065 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00701.html\n+-rw-r--r-- 0 root (0) root (0) 18609 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00701_source.html\n+-rw-r--r-- 0 root (0) root (0) 8631 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00704.html\n+-rw-r--r-- 0 root (0) root (0) 91920 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00704_source.html\n+-rw-r--r-- 0 root (0) root (0) 6019 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00707.html\n+-rw-r--r-- 0 root (0) root (0) 55372 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00707_source.html\n+-rw-r--r-- 0 root (0) root (0) 4483 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00710.html\n -rw-r--r-- 0 root (0) root (0) 9098 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00713.html\n -rw-r--r-- 0 root (0) root (0) 14878 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00713_source.html\n--rw-r--r-- 0 root (0) root (0) 5014 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00716.html\n--rw-r--r-- 0 root (0) root (0) 5245 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00719.html\n--rw-r--r-- 0 root (0) root (0) 28783 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00719_source.html\n+-rw-r--r-- 0 root (0) root (0) 7361 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00716.html\n+-rw-r--r-- 0 root (0) root (0) 123399 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00716_source.html\n+-rw-r--r-- 0 root (0) root (0) 5014 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00719.html\n -rw-r--r-- 0 root (0) root (0) 3856 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00722.html\n -rw-r--r-- 0 root (0) root (0) 6306 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00722_source.html\n -rw-r--r-- 0 root (0) root (0) 5175 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00725.html\n -rw-r--r-- 0 root (0) root (0) 8053 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00725_source.html\n -rw-r--r-- 0 root (0) root (0) 3639 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00728.html\n -rw-r--r-- 0 root (0) root (0) 5090 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00728_source.html\n -rw-r--r-- 0 root (0) root (0) 7064 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00731.html\n -rw-r--r-- 0 root (0) root (0) 115969 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00731_source.html\n--rw-r--r-- 0 root (0) root (0) 5261 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00734.html\n--rw-r--r-- 0 root (0) root (0) 17909 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00734_source.html\n--rw-r--r-- 0 root (0) root (0) 6249 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00737.html\n--rw-r--r-- 0 root (0) root (0) 75964 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00737_source.html\n--rw-r--r-- 0 root (0) root (0) 5776 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00740.html\n--rw-r--r-- 0 root (0) root (0) 97542 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00740_source.html\n--rw-r--r-- 0 root (0) root (0) 5365 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00743.html\n--rw-r--r-- 0 root (0) root (0) 17747 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00743_source.html\n--rw-r--r-- 0 root (0) root (0) 6397 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00746.html\n--rw-r--r-- 0 root (0) root (0) 30301 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00746_source.html\n--rw-r--r-- 0 root (0) root (0) 5313 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00749.html\n--rw-r--r-- 0 root (0) root (0) 15635 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00749_source.html\n--rw-r--r-- 0 root (0) root (0) 5266 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00752.html\n--rw-r--r-- 0 root (0) root (0) 17733 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00752_source.html\n--rw-r--r-- 0 root (0) root (0) 6009 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00755.html\n--rw-r--r-- 0 root (0) root (0) 67469 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00755_source.html\n--rw-r--r-- 0 root (0) root (0) 5204 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00758.html\n--rw-r--r-- 0 root (0) root (0) 32991 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00758_source.html\n--rw-r--r-- 0 root (0) root (0) 5775 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00761.html\n--rw-r--r-- 0 root (0) root (0) 39429 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00761_source.html\n--rw-r--r-- 0 root (0) root (0) 10478 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00764.html\n--rw-r--r-- 0 root (0) root (0) 208931 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00764_source.html\n--rw-r--r-- 0 root (0) root (0) 6754 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00767.html\n--rw-r--r-- 0 root (0) root (0) 24439 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00767_source.html\n--rw-r--r-- 0 root (0) root (0) 4391 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00770.html\n--rw-r--r-- 0 root (0) root (0) 7040 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00770_source.html\n--rw-r--r-- 0 root (0) root (0) 4772 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00773.html\n--rw-r--r-- 0 root (0) root (0) 21272 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00773_source.html\n--rw-r--r-- 0 root (0) root (0) 5560 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00776.html\n--rw-r--r-- 0 root (0) root (0) 44058 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00776_source.html\n--rw-r--r-- 0 root (0) root (0) 7173 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00779.html\n--rw-r--r-- 0 root (0) root (0) 181939 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00779_source.html\n--rw-r--r-- 0 root (0) root (0) 5427 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00782.html\n--rw-r--r-- 0 root (0) root (0) 35447 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00782_source.html\n--rw-r--r-- 0 root (0) root (0) 5875 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00785.html\n--rw-r--r-- 0 root (0) root (0) 50352 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00785_source.html\n--rw-r--r-- 0 root (0) root (0) 5484 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00788.html\n--rw-r--r-- 0 root (0) root (0) 16905 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00788_source.html\n--rw-r--r-- 0 root (0) root (0) 6510 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00791.html\n--rw-r--r-- 0 root (0) root (0) 38495 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00791_source.html\n--rw-r--r-- 0 root (0) root (0) 4778 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00794.html\n--rw-r--r-- 0 root (0) root (0) 4796 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00797.html\n--rw-r--r-- 0 root (0) root (0) 4760 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00800.html\n--rw-r--r-- 0 root (0) root (0) 5391 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00803.html\n--rw-r--r-- 0 root (0) root (0) 18251 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00803_source.html\n--rw-r--r-- 0 root (0) root (0) 4784 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00806.html\n--rw-r--r-- 0 root (0) root (0) 6877 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00809.html\n--rw-r--r-- 0 root (0) root (0) 30016 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00809_source.html\n--rw-r--r-- 0 root (0) root (0) 5366 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00812.html\n--rw-r--r-- 0 root (0) root (0) 12764 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00812_source.html\n--rw-r--r-- 0 root (0) root (0) 4754 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00815.html\n--rw-r--r-- 0 root (0) root (0) 4766 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00818.html\n--rw-r--r-- 0 root (0) root (0) 5421 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00821.html\n--rw-r--r-- 0 root (0) root (0) 16723 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00821_source.html\n--rw-r--r-- 0 root (0) root (0) 5418 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00824.html\n--rw-r--r-- 0 root (0) root (0) 14732 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00824_source.html\n--rw-r--r-- 0 root (0) root (0) 4778 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00827.html\n--rw-r--r-- 0 root (0) root (0) 5670 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00830.html\n--rw-r--r-- 0 root (0) root (0) 29281 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00830_source.html\n--rw-r--r-- 0 root (0) root (0) 4766 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00833.html\n--rw-r--r-- 0 root (0) root (0) 6144 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00836.html\n--rw-r--r-- 0 root (0) root (0) 67657 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00836_source.html\n--rw-r--r-- 0 root (0) root (0) 5421 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00839.html\n--rw-r--r-- 0 root (0) root (0) 15609 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00839_source.html\n--rw-r--r-- 0 root (0) root (0) 4796 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00842.html\n--rw-r--r-- 0 root (0) root (0) 4757 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00845.html\n--rw-r--r-- 0 root (0) root (0) 4769 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00848.html\n--rw-r--r-- 0 root (0) root (0) 5408 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00851.html\n--rw-r--r-- 0 root (0) root (0) 22811 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00851_source.html\n--rw-r--r-- 0 root (0) root (0) 5456 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00854.html\n--rw-r--r-- 0 root (0) root (0) 15221 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00854_source.html\n--rw-r--r-- 0 root (0) root (0) 10389 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00857.html\n--rw-r--r-- 0 root (0) root (0) 5678 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00860.html\n--rw-r--r-- 0 root (0) root (0) 20081 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00860_source.html\n--rw-r--r-- 0 root (0) root (0) 6378 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00863.html\n--rw-r--r-- 0 root (0) root (0) 27387 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00863_source.html\n--rw-r--r-- 0 root (0) root (0) 4763 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00866.html\n--rw-r--r-- 0 root (0) root (0) 5595 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00869.html\n--rw-r--r-- 0 root (0) root (0) 32468 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00869_source.html\n--rw-r--r-- 0 root (0) root (0) 6206 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00872.html\n--rw-r--r-- 0 root (0) root (0) 83435 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00872_source.html\n--rw-r--r-- 0 root (0) root (0) 6381 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00875.html\n--rw-r--r-- 0 root (0) root (0) 6652 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00878.html\n--rw-r--r-- 0 root (0) root (0) 5608 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00881.html\n--rw-r--r-- 0 root (0) root (0) 46922 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00881_source.html\n--rw-r--r-- 0 root (0) root (0) 5052 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00884.html\n--rw-r--r-- 0 root (0) root (0) 19581 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00884_source.html\n--rw-r--r-- 0 root (0) root (0) 7291 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00887.html\n--rw-r--r-- 0 root (0) root (0) 63572 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00887_source.html\n--rw-r--r-- 0 root (0) root (0) 4587 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00890.html\n--rw-r--r-- 0 root (0) root (0) 33394 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00890_source.html\n--rw-r--r-- 0 root (0) root (0) 8072 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00893.html\n--rw-r--r-- 0 root (0) root (0) 109305 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00893_source.html\n--rw-r--r-- 0 root (0) root (0) 5074 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00896.html\n--rw-r--r-- 0 root (0) root (0) 7072 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00896_source.html\n--rw-r--r-- 0 root (0) root (0) 6562 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00899.html\n--rw-r--r-- 0 root (0) root (0) 56957 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00899_source.html\n--rw-r--r-- 0 root (0) root (0) 4792 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00902.html\n--rw-r--r-- 0 root (0) root (0) 5726 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00905.html\n--rw-r--r-- 0 root (0) root (0) 49714 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00905_source.html\n--rw-r--r-- 0 root (0) root (0) 5281 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00908.html\n--rw-r--r-- 0 root (0) root (0) 29536 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00908_source.html\n--rw-r--r-- 0 root (0) root (0) 5652 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00911.html\n--rw-r--r-- 0 root (0) root (0) 25022 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00911_source.html\n--rw-r--r-- 0 root (0) root (0) 6275 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00914.html\n--rw-r--r-- 0 root (0) root (0) 22623 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00914_source.html\n--rw-r--r-- 0 root (0) root (0) 6970 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00917.html\n--rw-r--r-- 0 root (0) root (0) 53202 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00917_source.html\n--rw-r--r-- 0 root (0) root (0) 6045 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00920.html\n--rw-r--r-- 0 root (0) root (0) 49270 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00920_source.html\n--rw-r--r-- 0 root (0) root (0) 5925 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00923.html\n--rw-r--r-- 0 root (0) root (0) 75092 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00923_source.html\n--rw-r--r-- 0 root (0) root (0) 5575 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00926.html\n--rw-r--r-- 0 root (0) root (0) 20603 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00926_source.html\n--rw-r--r-- 0 root (0) root (0) 11343 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00929.html\n--rw-r--r-- 0 root (0) root (0) 295358 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00929_source.html\n--rw-r--r-- 0 root (0) root (0) 5680 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00932.html\n--rw-r--r-- 0 root (0) root (0) 31397 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00932_source.html\n--rw-r--r-- 0 root (0) root (0) 7113 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00935.html\n--rw-r--r-- 0 root (0) root (0) 52835 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00935_source.html\n--rw-r--r-- 0 root (0) root (0) 5404 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00938.html\n--rw-r--r-- 0 root (0) root (0) 16804 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00938_source.html\n--rw-r--r-- 0 root (0) root (0) 9038 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00941.html\n--rw-r--r-- 0 root (0) root (0) 93744 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00941_source.html\n--rw-r--r-- 0 root (0) root (0) 5774 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00944.html\n--rw-r--r-- 0 root (0) root (0) 26813 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00944_source.html\n--rw-r--r-- 0 root (0) root (0) 5727 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00947.html\n--rw-r--r-- 0 root (0) root (0) 59108 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00947_source.html\n--rw-r--r-- 0 root (0) root (0) 18467 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00950.html\n--rw-r--r-- 0 root (0) root (0) 70982 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00950_source.html\n--rw-r--r-- 0 root (0) root (0) 5461 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00953.html\n--rw-r--r-- 0 root (0) root (0) 19623 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00953_source.html\n--rw-r--r-- 0 root (0) root (0) 5629 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00956.html\n--rw-r--r-- 0 root (0) root (0) 35212 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00956_source.html\n--rw-r--r-- 0 root (0) root (0) 6100 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00959.html\n--rw-r--r-- 0 root (0) root (0) 90426 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00959_source.html\n--rw-r--r-- 0 root (0) root (0) 9680 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00962.html\n--rw-r--r-- 0 root (0) root (0) 93782 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00962_source.html\n--rw-r--r-- 0 root (0) root (0) 5594 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00965.html\n--rw-r--r-- 0 root (0) root (0) 20372 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00965_source.html\n--rw-r--r-- 0 root (0) root (0) 7166 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00968.html\n--rw-r--r-- 0 root (0) root (0) 37020 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00968_source.html\n--rw-r--r-- 0 root (0) root (0) 5609 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00971.html\n--rw-r--r-- 0 root (0) root (0) 34859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00971_source.html\n+-rw-r--r-- 0 root (0) root (0) 5776 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00734.html\n+-rw-r--r-- 0 root (0) root (0) 97542 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00734_source.html\n+-rw-r--r-- 0 root (0) root (0) 5365 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00737.html\n+-rw-r--r-- 0 root (0) root (0) 17747 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00737_source.html\n+-rw-r--r-- 0 root (0) root (0) 6397 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00740.html\n+-rw-r--r-- 0 root (0) root (0) 30301 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00740_source.html\n+-rw-r--r-- 0 root (0) root (0) 5261 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00743.html\n+-rw-r--r-- 0 root (0) root (0) 17909 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00743_source.html\n+-rw-r--r-- 0 root (0) root (0) 6009 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00746.html\n+-rw-r--r-- 0 root (0) root (0) 67469 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00746_source.html\n+-rw-r--r-- 0 root (0) root (0) 6249 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00749.html\n+-rw-r--r-- 0 root (0) root (0) 75964 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00749_source.html\n+-rw-r--r-- 0 root (0) root (0) 5313 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00752.html\n+-rw-r--r-- 0 root (0) root (0) 15635 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00752_source.html\n+-rw-r--r-- 0 root (0) root (0) 5204 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00755.html\n+-rw-r--r-- 0 root (0) root (0) 32991 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00755_source.html\n+-rw-r--r-- 0 root (0) root (0) 5266 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00758.html\n+-rw-r--r-- 0 root (0) root (0) 17733 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00758_source.html\n+-rw-r--r-- 0 root (0) root (0) 10478 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00761.html\n+-rw-r--r-- 0 root (0) root (0) 208931 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00761_source.html\n+-rw-r--r-- 0 root (0) root (0) 4772 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00764.html\n+-rw-r--r-- 0 root (0) root (0) 21272 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00764_source.html\n+-rw-r--r-- 0 root (0) root (0) 4391 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00767.html\n+-rw-r--r-- 0 root (0) root (0) 7040 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00767_source.html\n+-rw-r--r-- 0 root (0) root (0) 5281 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00770.html\n+-rw-r--r-- 0 root (0) root (0) 29536 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00770_source.html\n+-rw-r--r-- 0 root (0) root (0) 5680 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00773.html\n+-rw-r--r-- 0 root (0) root (0) 31397 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00773_source.html\n+-rw-r--r-- 0 root (0) root (0) 7166 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00776.html\n+-rw-r--r-- 0 root (0) root (0) 37020 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00776_source.html\n+-rw-r--r-- 0 root (0) root (0) 6275 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00779.html\n+-rw-r--r-- 0 root (0) root (0) 22623 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00779_source.html\n+-rw-r--r-- 0 root (0) root (0) 7113 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00782.html\n+-rw-r--r-- 0 root (0) root (0) 52835 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00782_source.html\n+-rw-r--r-- 0 root (0) root (0) 6100 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00785.html\n+-rw-r--r-- 0 root (0) root (0) 90426 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00785_source.html\n+-rw-r--r-- 0 root (0) root (0) 11343 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00788.html\n+-rw-r--r-- 0 root (0) root (0) 295358 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00788_source.html\n+-rw-r--r-- 0 root (0) root (0) 9680 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00791.html\n+-rw-r--r-- 0 root (0) root (0) 93782 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00791_source.html\n+-rw-r--r-- 0 root (0) root (0) 5774 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00794.html\n+-rw-r--r-- 0 root (0) root (0) 26813 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00794_source.html\n+-rw-r--r-- 0 root (0) root (0) 5727 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00797.html\n+-rw-r--r-- 0 root (0) root (0) 59108 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00797_source.html\n+-rw-r--r-- 0 root (0) root (0) 5461 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00800.html\n+-rw-r--r-- 0 root (0) root (0) 19623 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00800_source.html\n+-rw-r--r-- 0 root (0) root (0) 5594 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00803.html\n+-rw-r--r-- 0 root (0) root (0) 20372 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00803_source.html\n+-rw-r--r-- 0 root (0) root (0) 5609 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00806.html\n+-rw-r--r-- 0 root (0) root (0) 34859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00806_source.html\n+-rw-r--r-- 0 root (0) root (0) 5575 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00809.html\n+-rw-r--r-- 0 root (0) root (0) 20603 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00809_source.html\n+-rw-r--r-- 0 root (0) root (0) 9038 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00812.html\n+-rw-r--r-- 0 root (0) root (0) 93744 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00812_source.html\n+-rw-r--r-- 0 root (0) root (0) 6045 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00815.html\n+-rw-r--r-- 0 root (0) root (0) 49270 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00815_source.html\n+-rw-r--r-- 0 root (0) root (0) 5652 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00818.html\n+-rw-r--r-- 0 root (0) root (0) 25022 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00818_source.html\n+-rw-r--r-- 0 root (0) root (0) 18467 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00821.html\n+-rw-r--r-- 0 root (0) root (0) 70982 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00821_source.html\n+-rw-r--r-- 0 root (0) root (0) 6970 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00824.html\n+-rw-r--r-- 0 root (0) root (0) 53202 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00824_source.html\n+-rw-r--r-- 0 root (0) root (0) 5404 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00827.html\n+-rw-r--r-- 0 root (0) root (0) 16804 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00827_source.html\n+-rw-r--r-- 0 root (0) root (0) 5925 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00830.html\n+-rw-r--r-- 0 root (0) root (0) 75092 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00830_source.html\n+-rw-r--r-- 0 root (0) root (0) 5629 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00833.html\n+-rw-r--r-- 0 root (0) root (0) 35212 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00833_source.html\n+-rw-r--r-- 0 root (0) root (0) 5560 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00836.html\n+-rw-r--r-- 0 root (0) root (0) 44058 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00836_source.html\n+-rw-r--r-- 0 root (0) root (0) 5775 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00839.html\n+-rw-r--r-- 0 root (0) root (0) 39429 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00839_source.html\n+-rw-r--r-- 0 root (0) root (0) 5608 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00842.html\n+-rw-r--r-- 0 root (0) root (0) 46922 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00842_source.html\n+-rw-r--r-- 0 root (0) root (0) 6562 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00845.html\n+-rw-r--r-- 0 root (0) root (0) 56957 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00845_source.html\n+-rw-r--r-- 0 root (0) root (0) 6381 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00848.html\n+-rw-r--r-- 0 root (0) root (0) 6652 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00851.html\n+-rw-r--r-- 0 root (0) root (0) 4796 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00854.html\n+-rw-r--r-- 0 root (0) root (0) 5421 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00857.html\n+-rw-r--r-- 0 root (0) root (0) 16723 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00857_source.html\n+-rw-r--r-- 0 root (0) root (0) 6378 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00860.html\n+-rw-r--r-- 0 root (0) root (0) 27387 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00860_source.html\n+-rw-r--r-- 0 root (0) root (0) 5418 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00863.html\n+-rw-r--r-- 0 root (0) root (0) 14732 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00863_source.html\n+-rw-r--r-- 0 root (0) root (0) 5670 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00866.html\n+-rw-r--r-- 0 root (0) root (0) 29281 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00866_source.html\n+-rw-r--r-- 0 root (0) root (0) 4784 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00869.html\n+-rw-r--r-- 0 root (0) root (0) 10389 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00872.html\n+-rw-r--r-- 0 root (0) root (0) 5366 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00875.html\n+-rw-r--r-- 0 root (0) root (0) 12764 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00875_source.html\n+-rw-r--r-- 0 root (0) root (0) 4763 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00878.html\n+-rw-r--r-- 0 root (0) root (0) 4778 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00881.html\n+-rw-r--r-- 0 root (0) root (0) 4760 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00884.html\n+-rw-r--r-- 0 root (0) root (0) 4778 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00887.html\n+-rw-r--r-- 0 root (0) root (0) 4757 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00890.html\n+-rw-r--r-- 0 root (0) root (0) 4766 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00893.html\n+-rw-r--r-- 0 root (0) root (0) 5408 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00896.html\n+-rw-r--r-- 0 root (0) root (0) 22811 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00896_source.html\n+-rw-r--r-- 0 root (0) root (0) 5421 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00899.html\n+-rw-r--r-- 0 root (0) root (0) 15609 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00899_source.html\n+-rw-r--r-- 0 root (0) root (0) 6510 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00902.html\n+-rw-r--r-- 0 root (0) root (0) 38495 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00902_source.html\n+-rw-r--r-- 0 root (0) root (0) 5678 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00905.html\n+-rw-r--r-- 0 root (0) root (0) 20081 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00905_source.html\n+-rw-r--r-- 0 root (0) root (0) 5456 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00908.html\n+-rw-r--r-- 0 root (0) root (0) 15221 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00908_source.html\n+-rw-r--r-- 0 root (0) root (0) 4796 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00911.html\n+-rw-r--r-- 0 root (0) root (0) 6877 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00914.html\n+-rw-r--r-- 0 root (0) root (0) 30016 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00914_source.html\n+-rw-r--r-- 0 root (0) root (0) 5391 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00917.html\n+-rw-r--r-- 0 root (0) root (0) 18251 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00917_source.html\n+-rw-r--r-- 0 root (0) root (0) 4769 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00920.html\n+-rw-r--r-- 0 root (0) root (0) 5484 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00923.html\n+-rw-r--r-- 0 root (0) root (0) 16905 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00923_source.html\n+-rw-r--r-- 0 root (0) root (0) 4754 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00926.html\n+-rw-r--r-- 0 root (0) root (0) 6144 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00929.html\n+-rw-r--r-- 0 root (0) root (0) 67657 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00929_source.html\n+-rw-r--r-- 0 root (0) root (0) 4766 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00932.html\n+-rw-r--r-- 0 root (0) root (0) 5726 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00935.html\n+-rw-r--r-- 0 root (0) root (0) 49714 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00935_source.html\n+-rw-r--r-- 0 root (0) root (0) 7173 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00938.html\n+-rw-r--r-- 0 root (0) root (0) 181939 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00938_source.html\n+-rw-r--r-- 0 root (0) root (0) 5074 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00941.html\n+-rw-r--r-- 0 root (0) root (0) 7072 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00941_source.html\n+-rw-r--r-- 0 root (0) root (0) 5875 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00944.html\n+-rw-r--r-- 0 root (0) root (0) 50352 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00944_source.html\n+-rw-r--r-- 0 root (0) root (0) 4792 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00947.html\n+-rw-r--r-- 0 root (0) root (0) 5595 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00950.html\n+-rw-r--r-- 0 root (0) root (0) 32468 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00950_source.html\n+-rw-r--r-- 0 root (0) root (0) 5427 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00953.html\n+-rw-r--r-- 0 root (0) root (0) 35447 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00953_source.html\n+-rw-r--r-- 0 root (0) root (0) 4587 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00956.html\n+-rw-r--r-- 0 root (0) root (0) 33394 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00956_source.html\n+-rw-r--r-- 0 root (0) root (0) 5052 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00959.html\n+-rw-r--r-- 0 root (0) root (0) 19581 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00959_source.html\n+-rw-r--r-- 0 root (0) root (0) 6206 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00962.html\n+-rw-r--r-- 0 root (0) root (0) 83435 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00962_source.html\n+-rw-r--r-- 0 root (0) root (0) 8072 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00965.html\n+-rw-r--r-- 0 root (0) root (0) 109305 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00965_source.html\n+-rw-r--r-- 0 root (0) root (0) 7291 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00968.html\n+-rw-r--r-- 0 root (0) root (0) 63572 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00968_source.html\n+-rw-r--r-- 0 root (0) root (0) 6754 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00971.html\n+-rw-r--r-- 0 root (0) root (0) 24439 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00971_source.html\n -rw-r--r-- 0 root (0) root (0) 11083 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00974.html\n -rw-r--r-- 0 root (0) root (0) 90537 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00974_source.html\n -rw-r--r-- 0 root (0) root (0) 21156 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00977.html\n -rw-r--r-- 0 root (0) root (0) 133682 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00977_source.html\n -rw-r--r-- 0 root (0) root (0) 6266 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00980.html\n -rw-r--r-- 0 root (0) root (0) 35094 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00980_source.html\n--rw-r--r-- 0 root (0) root (0) 6273 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00983.html\n--rw-r--r-- 0 root (0) root (0) 45890 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00983_source.html\n--rw-r--r-- 0 root (0) root (0) 5083 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00986.html\n--rw-r--r-- 0 root (0) root (0) 41589 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00986_source.html\n--rw-r--r-- 0 root (0) root (0) 6975 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00989.html\n--rw-r--r-- 0 root (0) root (0) 72067 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00989_source.html\n--rw-r--r-- 0 root (0) root (0) 5393 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00992.html\n--rw-r--r-- 0 root (0) root (0) 13064 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00992_source.html\n--rw-r--r-- 0 root (0) root (0) 8465 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00995.html\n--rw-r--r-- 0 root (0) root (0) 90164 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00995_source.html\n--rw-r--r-- 0 root (0) root (0) 5912 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00998.html\n--rw-r--r-- 0 root (0) root (0) 35730 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00998_source.html\n--rw-r--r-- 0 root (0) root (0) 6478 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01001.html\n--rw-r--r-- 0 root (0) root (0) 35420 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01001_source.html\n--rw-r--r-- 0 root (0) root (0) 6056 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01004.html\n--rw-r--r-- 0 root (0) root (0) 31607 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01004_source.html\n--rw-r--r-- 0 root (0) root (0) 4859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01007.html\n--rw-r--r-- 0 root (0) root (0) 28012 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01007_source.html\n--rw-r--r-- 0 root (0) root (0) 5747 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01010.html\n--rw-r--r-- 0 root (0) root (0) 75427 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01010_source.html\n--rw-r--r-- 0 root (0) root (0) 4585 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01013.html\n--rw-r--r-- 0 root (0) root (0) 36098 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01013_source.html\n--rw-r--r-- 0 root (0) root (0) 3985 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01016.html\n--rw-r--r-- 0 root (0) root (0) 7771 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01016_source.html\n--rw-r--r-- 0 root (0) root (0) 5796 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01019.html\n--rw-r--r-- 0 root (0) root (0) 15189 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01019_source.html\n--rw-r--r-- 0 root (0) root (0) 4929 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01022.html\n--rw-r--r-- 0 root (0) root (0) 35763 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01022_source.html\n+-rw-r--r-- 0 root (0) root (0) 4859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00983.html\n+-rw-r--r-- 0 root (0) root (0) 28012 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00983_source.html\n+-rw-r--r-- 0 root (0) root (0) 6478 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00986.html\n+-rw-r--r-- 0 root (0) root (0) 35420 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00986_source.html\n+-rw-r--r-- 0 root (0) root (0) 4929 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00989.html\n+-rw-r--r-- 0 root (0) root (0) 35763 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00989_source.html\n+-rw-r--r-- 0 root (0) root (0) 5747 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00992.html\n+-rw-r--r-- 0 root (0) root (0) 75427 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00992_source.html\n+-rw-r--r-- 0 root (0) root (0) 5912 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00995.html\n+-rw-r--r-- 0 root (0) root (0) 35730 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00995_source.html\n+-rw-r--r-- 0 root (0) root (0) 6056 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00998.html\n+-rw-r--r-- 0 root (0) root (0) 31607 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a00998_source.html\n+-rw-r--r-- 0 root (0) root (0) 5393 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01001.html\n+-rw-r--r-- 0 root (0) root (0) 13064 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01001_source.html\n+-rw-r--r-- 0 root (0) root (0) 3985 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01004.html\n+-rw-r--r-- 0 root (0) root (0) 7771 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01004_source.html\n+-rw-r--r-- 0 root (0) root (0) 6975 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01007.html\n+-rw-r--r-- 0 root (0) root (0) 72067 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01007_source.html\n+-rw-r--r-- 0 root (0) root (0) 6273 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01010.html\n+-rw-r--r-- 0 root (0) root (0) 45890 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01010_source.html\n+-rw-r--r-- 0 root (0) root (0) 5796 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01013.html\n+-rw-r--r-- 0 root (0) root (0) 15189 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01013_source.html\n+-rw-r--r-- 0 root (0) root (0) 8465 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01016.html\n+-rw-r--r-- 0 root (0) root (0) 90164 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01016_source.html\n+-rw-r--r-- 0 root (0) root (0) 5083 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01019.html\n+-rw-r--r-- 0 root (0) root (0) 41589 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01019_source.html\n+-rw-r--r-- 0 root (0) root (0) 4585 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01022.html\n+-rw-r--r-- 0 root (0) root (0) 36098 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01022_source.html\n -rw-r--r-- 0 root (0) root (0) 16257 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01025.html\n -rw-r--r-- 0 root (0) root (0) 423167 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01025_source.html\n -rw-r--r-- 0 root (0) root (0) 11823 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01028.html\n -rw-r--r-- 0 root (0) root (0) 4145 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01029.html\n -rw-r--r-- 0 root (0) root (0) 3566 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01030.html\n -rw-r--r-- 0 root (0) root (0) 12404 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01031.html\n -rw-r--r-- 0 root (0) root (0) 16742 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/a01031.png\n@@ -1940,15 +1940,15 @@\n -rw-r--r-- 0 root (0) root (0) 15163 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dir_e674d52c20e1458e445f655f7f65f7ce.html\n -rw-r--r-- 0 root (0) root (0) 3025 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dir_e674d52c20e1458e445f655f7f65f7ce_dep.png\n -rw-r--r-- 0 root (0) root (0) 4975 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dir_e68e8157741866f444e17edd764ebbae.html\n -rw-r--r-- 0 root (0) root (0) 4837 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dir_e68e8157741866f444e17edd764ebbae_dep.png\n -rw-r--r-- 0 root (0) root (0) 5859 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dir_fefaa8b4cd9d9058a23d89b9cab78ebc.html\n -rw-r--r-- 0 root (0) root (0) 4696 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dir_fefaa8b4cd9d9058a23d89b9cab78ebc_dep.png\n -rw-r--r-- 0 root (0) root (0) 45631 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/doxygen.css\n--rw-r--r-- 0 root (0) root (0) 218390 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dune-grid.tag.gz\n+-rw-r--r-- 0 root (0) root (0) 218396 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dune-grid.tag.gz\n -rw-r--r-- 0 root (0) root (0) 7704 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/dynsections.js\n -rw-r--r-- 0 root (0) root (0) 1265 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/examplegrid1c.png\n -rw-r--r-- 0 root (0) root (0) 1949 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/examplegrid1cs.png\n -rw-r--r-- 0 root (0) root (0) 2042 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/examplegrid1gen.png\n -rw-r--r-- 0 root (0) root (0) 2422 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/examplegrid1genangle.png\n -rw-r--r-- 0 root (0) root (0) 2247 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/examplegrid1s.png\n -rw-r--r-- 0 root (0) root (0) 5575 2024-11-14 20:09:51.000000 ./usr/share/doc/libdune-grid-doc/doxygen/examplegrid2a.png\n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00146.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00146.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: recipe-integration.cc File Reference\n+dune-grid: recipe-iterate-over-grid.cc File Reference\n \n \n \n \n \n \n \n@@ -71,24 +71,22 @@\n \n \n \n
\n
\n Functions
\n-
recipe-integration.cc File Reference
\n+
recipe-iterate-over-grid.cc File Reference
\n
\n
\n
#include <math.h>
\n #include <iostream>
\n #include <dune/common/parallel/mpihelper.hh>
\n #include <dune/common/parametertreeparser.hh>
\n #include <dune/common/timer.hh>
\n-#include <dune/geometry/referenceelements.hh>
\n-#include <dune/geometry/quadraturerules.hh>
\n #include <dune/grid/yaspgrid.hh>
\n
\n \n \n \n

\n Functions

int main (int argc, char **argv)
 
\n@@ -115,21 +113,18 @@\n \n )\n \n \n \n
\n

[set up grid]

\n-

[small vectors and matrices]

\n-

[a function to integrate]

\n-

[integration with midpoint rule]

\n-

[integration with quadrature rule]

\n-

[integrating a flux]

\n-
Examples
recipe-integration.cc, and recipe-iterate-over-grid.cc.
\n-
\n+

[extract gridview]

\n+

[iterate over codim]

\n+

[iterate over grid view]

\n+

[access to subentities]

\n \n
\n \n \n \n
\n Generated by \"doxygen\"/ 1.9.8\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,34 +1,29 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * doc\n * recipes\n Functions\n-recipe-integration.cc File Reference\n+recipe-iterate-over-grid.cc File Reference\n #include \n #include \n #include \n #include \n #include \n-#include \n-#include \n #include \n Functions\n int\u00a0 main (int argc, char **argv)\n \u00a0\n ***** Function Documentation *****\n ***** \u25c6\u00a0main() *****\n int main ( int\u00a0 argc,\n char **\u00a0 argv\u00a0\n )\n [set up grid]\n-[small vectors and matrices]\n-[a function to integrate]\n-[integration with midpoint rule]\n-[integration with quadrature rule]\n-[integrating a flux]\n- Examples\n- recipe-integration.cc, and recipe-iterate-over-grid.cc.\n+[extract gridview]\n+[iterate over codim]\n+[iterate over grid view]\n+[access to subentities]\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00164.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00164.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridintersectioniterator.hh File Reference\n+dune-grid: yaspgridindexsets.hh File Reference\n \n \n \n \n \n \n \n@@ -72,38 +72,37 @@\n
  • dune
  • grid
  • yaspgrid
  • \n \n \n
    \n \n-
    yaspgridintersectioniterator.hh File Reference
    \n+
    yaspgridindexsets.hh File Reference
    \n
    \n
    \n \n-

    The YaspIntersectionIterator class. \n+

    level-wise, non-persistent, consecutive indices for YaspGrid \n More...

    \n \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspIntersectionIterator< GridImp >
     YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities. More...
    class  Dune::YaspIndexSet< GridImp, isLeafIndexSet >
     Implementation of Level- and LeafIndexSets for YaspGrid. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The YaspIntersectionIterator class.

    \n-

    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.

    \n+

    level-wise, non-persistent, consecutive indices for YaspGrid

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,25 +2,22 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridintersectioniterator.hh File Reference\n-The YaspIntersectionIterator class. More...\n+yaspgridindexsets.hh File Reference\n+level-wise, non-persistent, consecutive indices for YaspGrid More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspIntersectionIterator<_GridImp_>\n-\u00a0 YaspIntersectionIterator enables iteration over intersections with\n- neighboring codim 0 entities. More...\n+class \u00a0 Dune::YaspIndexSet<_GridImp,_isLeafIndexSet_>\n+\u00a0 Implementation of Level- and LeafIndexSets for YaspGrid. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The YaspIntersectionIterator class.\n-YaspIntersectionIterator enables iteration over intersections with neighboring\n-codim 0 entities.\n+level-wise, non-persistent, consecutive indices for YaspGrid\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00164_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00164_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridintersectioniterator.hh Source File\n+dune-grid: yaspgridindexsets.hh Source File\n \n \n \n \n \n \n \n@@ -74,107 +74,131 @@\n \n \n
    \n
    \n-
    yaspgridintersectioniterator.hh
    \n+
    yaspgridindexsets.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
    \n-
    6#define DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDINDEXSET_HH
    \n+
    6#define DUNE_GRID_YASPGRIDINDEXSET_HH
    \n
    7
    \n-
    15namespace Dune {
    \n-
    16
    \n-
    20 template<class GridImp>
    \n-
    \n-\n-
    22 {
    \n-
    23 constexpr static int dim = GridImp::dimension;
    \n-
    24 public:
    \n-
    25 // types used from grids
    \n-\n-\n+
    14namespace Dune {
    \n+
    15
    \n+
    22 template<class GridImp, bool isLeafIndexSet>
    \n+
    \n+\n+
    24 : public IndexSet< GridImp, YaspIndexSet< GridImp, isLeafIndexSet >, unsigned int, std::array<GeometryType, 1> >
    \n+
    25 {
    \n+\n+\n
    28
    \n-
    \n-
    30 void increment()
    \n-
    31 {
    \n-
    32 intersection_.impl()._count += (intersection_.impl()._count < 2*dim);
    \n-
    33 }
    \n-
    \n-
    34
    \n-
    \n-
    36 bool equals (const YaspIntersectionIterator& other) const
    \n-
    37 {
    \n-
    38 return intersection_ == other.intersection_;
    \n-
    39 }
    \n-
    \n-
    40
    \n-
    \n-
    42 const Intersection & dereference() const
    \n-
    43 {
    \n-
    44 intersection_.impl().update();
    \n-
    45 return intersection_;
    \n-
    46 }
    \n-
    \n-
    47
    \n-
    \n-\n-
    49 {}
    \n-
    \n-
    50
    \n-
    \n-\n-
    53 : intersection_(IntersectionImp(myself, toend))
    \n-
    54 {}
    \n+
    29 public:
    \n+
    30 typedef typename Base::IndexType IndexType;
    \n+
    31
    \n+
    32 using Base::subIndex;
    \n+
    33
    \n+
    \n+
    35 YaspIndexSet ( const GridImp &g, int l )
    \n+
    36 : grid( g ),
    \n+
    37 level( l )
    \n+
    38 {
    \n+
    39 assert(not isLeafIndexSet);
    \n+
    40 }
    \n+
    \n+
    41
    \n+
    \n+
    43 YaspIndexSet ( const GridImp &g )
    \n+
    44 : grid( g )
    \n+
    45 {
    \n+
    46 assert(isLeafIndexSet);
    \n+
    47 }
    \n+
    \n+
    48
    \n+
    50 template<int cc>
    \n+
    \n+
    51 IndexType index (const typename std::remove_const<GridImp>::type::Traits::template Codim<cc>::Entity& e) const
    \n+
    52 {
    \n+
    53 return e.impl().compressedIndex();
    \n+
    54 }
    \n
    \n
    55
    \n-
    \n-\n-
    58 : intersection_(other.intersection_)
    \n-
    59 {}
    \n-
    \n-
    60
    \n-
    \n-\n-
    63 {
    \n-
    64 intersection_ = other.intersection_;
    \n-
    65 return *this;
    \n-
    66 }
    \n-
    \n-
    67
    \n-
    68 private:
    \n-
    69 // The intersection this iterator points to
    \n-
    70 mutable Intersection intersection_;
    \n-
    71 };
    \n-
    \n-
    72
    \n-
    73} // namespace Dune
    \n-
    74
    \n-
    75#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
    \n+
    57 template< int cc >
    \n+
    \n+
    58 IndexType subIndex ( const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e,
    \n+
    59 int i, unsigned int codim ) const
    \n+
    60 {
    \n+
    61 return e.impl().subCompressedIndex(i, codim);
    \n+
    62 }
    \n+
    \n+
    63
    \n+
    \n+
    65 std::size_t size (GeometryType type) const
    \n+
    66 {
    \n+
    67 return (isLeafIndexSet)
    \n+
    68 ? grid.size( type )
    \n+
    69 : grid.size( level, type );
    \n+
    70 }
    \n+
    \n+
    71
    \n+
    \n+
    73 std::size_t size (int codim) const
    \n+
    74 {
    \n+
    75 return (isLeafIndexSet)
    \n+
    76 ? grid.size( codim )
    \n+
    77 : grid.size( level, codim );
    \n+
    78 }
    \n+
    \n+
    79
    \n+
    81 template<class EntityType>
    \n+
    \n+
    82 bool contains (const EntityType& e) const
    \n+
    83 {
    \n+
    84 return (isLeafIndexSet)
    \n+
    85 ? e.level() == grid.maxLevel()
    \n+
    86 : e.level() == level;
    \n+
    87 }
    \n+
    \n+
    88
    \n+
    \n+
    90 static constexpr std::array<GeometryType, 1> types (int codim)
    \n+
    91 {
    \n+
    92 return { GeometryTypes::cube(GridImp::dimension - codim) };
    \n+
    93 }
    \n+
    \n+
    94
    \n+
    95 private:
    \n+
    96 const GridImp& grid;
    \n+
    97 int level;
    \n+
    98 };
    \n+
    \n+
    99
    \n+
    100} // namespace Dune
    \n+
    101
    \n+
    102#endif // DUNE_GRID_YASPGRIDINDEXSET_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Implementation & impl()
    access to the underlying implementation
    Definition common/intersection.hh:178
    \n-
    Definition yaspgridentity.hh:242
    \n-
    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
    Definition yaspgridintersectioniterator.hh:22
    \n-
    const Intersection & dereference() const
    dereferencing
    Definition yaspgridintersectioniterator.hh:42
    \n-
    YaspIntersectionIterator(const YaspIntersectionIterator &other)
    copy constructor
    Definition yaspgridintersectioniterator.hh:57
    \n-
    Dune::YaspIntersection< GridImp > IntersectionImp
    Definition yaspgridintersectioniterator.hh:26
    \n-
    Dune::Intersection< GridImp, IntersectionImp > Intersection
    Definition yaspgridintersectioniterator.hh:27
    \n-
    void increment()
    increment
    Definition yaspgridintersectioniterator.hh:30
    \n-
    YaspIntersectionIterator & operator=(const YaspIntersectionIterator &other)
    assignment
    Definition yaspgridintersectioniterator.hh:62
    \n-
    YaspIntersectionIterator(const YaspEntity< 0, dim, GridImp > &myself, bool toend)
    make intersection iterator from entity
    Definition yaspgridintersectioniterator.hh:52
    \n-
    bool equals(const YaspIntersectionIterator &other) const
    equality
    Definition yaspgridintersectioniterator.hh:36
    \n-
    YaspIntersectionIterator()
    Definition yaspgridintersectioniterator.hh:48
    \n-
    YaspIntersection provides data about intersection with neighboring codim 0 entities.
    Definition yaspgridintersection.hh:22
    \n+
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n+
    IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition common/indexidset.hh:153
    \n+
    Export the type of the entity used as parameter in the index(...) method.
    Definition common/indexidset.hh:87
    \n+
    Implementation of Level- and LeafIndexSets for YaspGrid.
    Definition yaspgridindexsets.hh:25
    \n+
    YaspIndexSet(const GridImp &g)
    Level grid view constructor stores reference to a grid and level.
    Definition yaspgridindexsets.hh:43
    \n+
    YaspIndexSet(const GridImp &g, int l)
    Level grid view constructor stores reference to a grid and level.
    Definition yaspgridindexsets.hh:35
    \n+
    IndexType index(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e) const
    get index of an entity
    Definition yaspgridindexsets.hh:51
    \n+
    bool contains(const EntityType &e) const
    return true if the given entity is contained in .
    Definition yaspgridindexsets.hh:82
    \n+
    std::size_t size(GeometryType type) const
    get number of entities of given type and level (the level is known to the object)
    Definition yaspgridindexsets.hh:65
    \n+
    IndexType subIndex(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    get index of subentity of an entity
    Definition yaspgridindexsets.hh:58
    \n+
    static constexpr std::array< GeometryType, 1 > types(int codim)
    obtain all geometry types of entities in domain
    Definition yaspgridindexsets.hh:90
    \n+
    std::size_t size(int codim) const
    return size of set for a given codim
    Definition yaspgridindexsets.hh:73
    \n+
    Base::IndexType IndexType
    Definition yaspgridindexsets.hh:30
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,128 +1,153 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridintersectioniterator.hh\n+yaspgridindexsets.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH\n-6#define DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH\n+5#ifndef DUNE_GRID_YASPGRIDINDEXSET_HH\n+6#define DUNE_GRID_YASPGRIDINDEXSET_HH\n 7\n-15namespace Dune {\n-16\n-20 template\n-21 class YaspIntersectionIterator\n-22 {\n-23 constexpr static int dim = GridImp::dimension;\n-24 public:\n-25 // types used from grids\n-26 typedef Dune::YaspIntersection<_GridImp_> IntersectionImp;\n-27 typedef Dune::Intersection<_GridImp,_IntersectionImp_> Intersection;\n+14namespace Dune {\n+15\n+22 template\n+23 class YaspIndexSet\n+24 : public IndexSet< GridImp, YaspIndexSet< GridImp, isLeafIndexSet >,\n+unsigned int, std::array >\n+25 {\n+26 typedef YaspIndexSet<_GridImp,_isLeafIndexSet_> This;\n+27 typedef IndexSet<_GridImp,_This,_unsigned_int,_std::array >\n+Base;\n 28\n-30 void increment()\n-31 {\n-32 intersection_.impl()._count += (intersection_.impl()._count < 2*dim);\n-33 }\n-34\n-36 bool equals (const YaspIntersectionIterator& other) const\n-37 {\n-38 return intersection_ == other.intersection_;\n-39 }\n-40\n-42 const Intersection & dereference() const\n-43 {\n-44 intersection_.impl().update();\n-45 return intersection_;\n-46 }\n-47\n-48 YaspIntersectionIterator()\n-49 {}\n-50\n-52 YaspIntersectionIterator (const YaspEntity<0,dim,GridImp>& myself, bool\n-toend)\n-53 : intersection_(IntersectionImp(myself, toend))\n-54 {}\n+29 public:\n+30 typedef typename Base::IndexType IndexType;\n+31\n+32 using Base::subIndex;\n+33\n+35 YaspIndexSet ( const GridImp &g, int l )\n+36 : grid( g ),\n+37 level( l )\n+38 {\n+39 assert(not isLeafIndexSet);\n+40 }\n+41\n+43 YaspIndexSet ( const GridImp &g )\n+44 : grid( g )\n+45 {\n+46 assert(isLeafIndexSet);\n+47 }\n+48\n+50 template\n+51 IndexType index (const typename std::remove_const::type::Traits::\n+template Codim::Entity& e) const\n+52 {\n+53 return e.impl().compressedIndex();\n+54 }\n 55\n-57 YaspIntersectionIterator (const YaspIntersectionIterator& other)\n-58 : intersection_(other.intersection_)\n-59 {}\n-60\n-62 YaspIntersectionIterator & operator_=_(const YaspIntersectionIterator&\n-other)\n-63 {\n-64 intersection_ = other.intersection_;\n-65 return *this;\n-66 }\n-67\n-68 private:\n-69 // The intersection this iterator points to\n-70 mutable Intersection intersection_;\n-71 };\n-72\n-73} // namespace Dune\n-74\n-75#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH\n+57 template< int cc >\n+58 IndexType subIndex ( const typename std::remove_const< GridImp >::type::\n+Traits::template Codim< cc >::Entity &e,\n+59 int i, unsigned int codim ) const\n+60 {\n+61 return e.impl().subCompressedIndex(i, codim);\n+62 }\n+63\n+65 std::size_t size (GeometryType type) const\n+66 {\n+67 return (isLeafIndexSet)\n+68 ? grid.size( type )\n+69 : grid.size( level, type );\n+70 }\n+71\n+73 std::size_t size (int codim) const\n+74 {\n+75 return (isLeafIndexSet)\n+76 ? grid.size( codim )\n+77 : grid.size( level, codim );\n+78 }\n+79\n+81 template\n+82 bool contains (const EntityType& e) const\n+83 {\n+84 return (isLeafIndexSet)\n+85 ? e.level() == grid.maxLevel()\n+86 : e.level() == level;\n+87 }\n+88\n+90 static constexpr std::array types (int codim)\n+91 {\n+92 return { GeometryTypes::cube(GridImp::dimension - codim) };\n+93 }\n+94\n+95 private:\n+96 const GridImp& grid;\n+97 int level;\n+98 };\n+99\n+100} // namespace Dune\n+101\n+102#endif // DUNE_GRID_YASPGRIDINDEXSET_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::impl\n-Implementation & impl()\n-access to the underlying implementation\n-Definition common/intersection.hh:178\n-Dune::YaspEntity\n-Definition yaspgridentity.hh:242\n-Dune::YaspIntersectionIterator\n-YaspIntersectionIterator enables iteration over intersections with neighboring\n-codim 0 entities.\n-Definition yaspgridintersectioniterator.hh:22\n-Dune::YaspIntersectionIterator::dereference\n-const Intersection & dereference() const\n-dereferencing\n-Definition yaspgridintersectioniterator.hh:42\n-Dune::YaspIntersectionIterator::YaspIntersectionIterator\n-YaspIntersectionIterator(const YaspIntersectionIterator &other)\n-copy constructor\n-Definition yaspgridintersectioniterator.hh:57\n-Dune::YaspIntersectionIterator::IntersectionImp\n-Dune::YaspIntersection< GridImp > IntersectionImp\n-Definition yaspgridintersectioniterator.hh:26\n-Dune::YaspIntersectionIterator::Intersection\n-Dune::Intersection< GridImp, IntersectionImp > Intersection\n-Definition yaspgridintersectioniterator.hh:27\n-Dune::YaspIntersectionIterator::increment\n-void increment()\n-increment\n-Definition yaspgridintersectioniterator.hh:30\n-Dune::YaspIntersectionIterator::operator=\n-YaspIntersectionIterator & operator=(const YaspIntersectionIterator &other)\n-assignment\n-Definition yaspgridintersectioniterator.hh:62\n-Dune::YaspIntersectionIterator::YaspIntersectionIterator\n-YaspIntersectionIterator(const YaspEntity< 0, dim, GridImp > &myself, bool\n-toend)\n-make intersection iterator from entity\n-Definition yaspgridintersectioniterator.hh:52\n-Dune::YaspIntersectionIterator::equals\n-bool equals(const YaspIntersectionIterator &other) const\n-equality\n-Definition yaspgridintersectioniterator.hh:36\n-Dune::YaspIntersectionIterator::YaspIntersectionIterator\n-YaspIntersectionIterator()\n-Definition yaspgridintersectioniterator.hh:48\n-Dune::YaspIntersection\n-YaspIntersection provides data about intersection with neighboring codim 0\n-entities.\n-Definition yaspgridintersection.hh:22\n+Dune::IndexSet\n+Index Set Interface base class.\n+Definition common/indexidset.hh:78\n+Dune::IndexSet::subIndex\n+IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int\n+i, unsigned int codim) const\n+Map a subentity to an index.\n+Definition common/indexidset.hh:153\n+Dune::IndexSet::Codim\n+Export the type of the entity used as parameter in the index(...) method.\n+Definition common/indexidset.hh:87\n+Dune::YaspIndexSet\n+Implementation of Level- and LeafIndexSets for YaspGrid.\n+Definition yaspgridindexsets.hh:25\n+Dune::YaspIndexSet::YaspIndexSet\n+YaspIndexSet(const GridImp &g)\n+Level grid view constructor stores reference to a grid and level.\n+Definition yaspgridindexsets.hh:43\n+Dune::YaspIndexSet::YaspIndexSet\n+YaspIndexSet(const GridImp &g, int l)\n+Level grid view constructor stores reference to a grid and level.\n+Definition yaspgridindexsets.hh:35\n+Dune::YaspIndexSet::index\n+IndexType index(const typename std::remove_const< GridImp >::type::Traits::\n+template Codim< cc >::Entity &e) const\n+get index of an entity\n+Definition yaspgridindexsets.hh:51\n+Dune::YaspIndexSet::contains\n+bool contains(const EntityType &e) const\n+return true if the given entity is contained in .\n+Definition yaspgridindexsets.hh:82\n+Dune::YaspIndexSet::size\n+std::size_t size(GeometryType type) const\n+get number of entities of given type and level (the level is known to the\n+object)\n+Definition yaspgridindexsets.hh:65\n+Dune::YaspIndexSet::subIndex\n+IndexType subIndex(const typename std::remove_const< GridImp >::type::Traits::\n+template Codim< cc >::Entity &e, int i, unsigned int codim) const\n+get index of subentity of an entity\n+Definition yaspgridindexsets.hh:58\n+Dune::YaspIndexSet::types\n+static constexpr std::array< GeometryType, 1 > types(int codim)\n+obtain all geometry types of entities in domain\n+Definition yaspgridindexsets.hh:90\n+Dune::YaspIndexSet::size\n+std::size_t size(int codim) const\n+return size of set for a given codim\n+Definition yaspgridindexsets.hh:73\n+Dune::YaspIndexSet::IndexType\n+Base::IndexType IndexType\n+Definition yaspgridindexsets.hh:30\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00170.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00170.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridindexsets.hh File Reference\n+dune-grid: yaspgridentity.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,52 @@\n
  • dune
  • grid
  • yaspgrid
  • \n
    \n \n
    \n \n-
    yaspgridindexsets.hh File Reference
    \n+
    yaspgridentity.hh File Reference
    \n
    \n
    \n \n-

    level-wise, non-persistent, consecutive indices for YaspGrid \n+

    the YaspEntity class and its specializations \n More...

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

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspIndexSet< GridImp, isLeafIndexSet >
     Implementation of Level- and LeafIndexSets for YaspGrid. More...
    class  Dune::YaspEntity< codim, dim, GridImp >
     
    class  Dune::YaspEntity< 0, dim, GridImp >
     
    struct  Dune::YaspEntity< 0, dim, GridImp >::Codim< cd >
     
    class  Dune::YaspEntity< dim, dim, GridImp >
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Yasp
     
    \n

    Detailed Description

    \n-

    level-wise, non-persistent, consecutive indices for YaspGrid

    \n+

    the YaspEntity class and its specializations

    \n+

    YaspEntity realizes the concept a mesh entity.

    \n+

    We have specializations for

      \n+
    • codim==0 (elements), because they have an extended interface
    • \n+
    • codim==dim (vertices), because they use a special constructor of the AxisAlignedCubeGeometry and are the only entities in a globally refined grid, that may also exist on another level.
    • \n+
    \n+

    The general version implements all other codimensions.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,22 +2,38 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridindexsets.hh File Reference\n-level-wise, non-persistent, consecutive indices for YaspGrid More...\n+yaspgridentity.hh File Reference\n+the YaspEntity class and its specializations More...\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspIndexSet<_GridImp,_isLeafIndexSet_>\n-\u00a0 Implementation of Level- and LeafIndexSets for YaspGrid. More...\n+ class \u00a0 Dune::YaspEntity<_codim,_dim,_GridImp_>\n+\u00a0\n+ class \u00a0 Dune::YaspEntity<_0,_dim,_GridImp_>\n+\u00a0\n+struct \u00a0 Dune::YaspEntity<_0,_dim,_GridImp_>::Codim<_cd_>\n+\u00a0\n+ class \u00a0 Dune::YaspEntity<_dim,_dim,_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::Yasp\n+\u00a0\n ***** Detailed Description *****\n-level-wise, non-persistent, consecutive indices for YaspGrid\n+the YaspEntity class and its specializations\n+YaspEntity realizes the concept a mesh entity.\n+We have specializations for\n+ * codim==0 (elements), because they have an extended interface\n+ * codim==dim (vertices), because they use a special constructor of the\n+ AxisAlignedCubeGeometry and are the only entities in a globally refined\n+ grid, that may also exist on another level.\n+The general version implements all other codimensions.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00170_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00170_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridindexsets.hh Source File\n+dune-grid: yaspgridentity.hh Source File\n \n \n \n \n \n \n \n@@ -74,131 +74,1064 @@\n \n \n
    \n
    \n-
    yaspgridindexsets.hh
    \n+
    yaspgridentity.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDINDEXSET_HH
    \n-
    6#define DUNE_GRID_YASPGRIDINDEXSET_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDENTITY_HH
    \n+
    6#define DUNE_GRID_YASPGRIDENTITY_HH
    \n
    7
    \n-
    14namespace Dune {
    \n-
    15
    \n-
    22 template<class GridImp, bool isLeafIndexSet>
    \n-
    \n-\n-
    24 : public IndexSet< GridImp, YaspIndexSet< GridImp, isLeafIndexSet >, unsigned int, std::array<GeometryType, 1> >
    \n-
    25 {
    \n-\n-\n+
    8#include <dune/common/math.hh>
    \n+
    9#include <dune/geometry/type.hh>
    \n+
    10
    \n+
    24//========================================================================
    \n+
    25
    \n+
    26
    \n+
    27
    \n
    28
    \n-
    29 public:
    \n-
    30 typedef typename Base::IndexType IndexType;
    \n-
    31
    \n-
    32 using Base::subIndex;
    \n-
    33
    \n-
    \n-
    35 YaspIndexSet ( const GridImp &g, int l )
    \n-
    36 : grid( g ),
    \n-
    37 level( l )
    \n+
    29namespace Dune {
    \n+
    30
    \n+
    31 namespace Yasp {
    \n+
    32
    \n+
    33#ifndef DOXYGEN
    \n+
    34
    \n+
    35 // table for quick evaluation of binomial coefficients
    \n+
    36 template<int n>
    \n+
    37 struct BinomialTable
    \n
    38 {
    \n-
    39 assert(not isLeafIndexSet);
    \n-
    40 }
    \n+
    39 // evaluation - note that in general d!=n, n is only the
    \n+
    40 // maximum value of d (in our case dimworld)
    \n+
    41 static constexpr int evaluate(int d, int c)
    \n+
    42 {
    \n+
    43 return _values[_offsets[d] + c];
    \n+
    44 }
    \n+
    45
    \n+
    46 private:
    \n+
    47 // prevent construction
    \n+
    48 BinomialTable() = delete;
    \n+
    49
    \n+
    50 // compute binomial(r, c) and advance row `r` and column `c`
    \n+
    51 static constexpr int nextValue(int& r, int& c)
    \n+
    52 {
    \n+
    53 const auto result = Dune::binomial(r, c);
    \n+
    54
    \n+
    55 c += 1;
    \n+
    56 if (c > r) {
    \n+
    57 r += 1;
    \n+
    58 c = 0;
    \n+
    59 }
    \n+
    60
    \n+
    61 return result;
    \n+
    62 }
    \n+
    63
    \n+
    64 template<std::size_t... I>
    \n+
    65 static constexpr std::array<int, sizeof...(I)> computeValues(std::index_sequence<I...>)
    \n+
    66 {
    \n+
    67 int r = 0, c = 0;
    \n+
    68 return {{ ((void)I, nextValue(r, c))... }};
    \n+
    69 }
    \n+
    70
    \n+
    71 template<std::size_t... I>
    \n+
    72 static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>)
    \n+
    73 { return {{ (I*(I+1)/2)... }}; }
    \n+
    74
    \n+
    75 static constexpr std::array<int,(n+1)*(n+2)/2> _values = computeValues(std::make_index_sequence<(n+1)*(n+2)/2>{});
    \n+
    76 static constexpr std::array<int,n+1> _offsets = computeOffsets(std::make_index_sequence<n+1>{});
    \n+
    77 };
    \n+
    78
    \n+
    85 template<int dimworld>
    \n+
    86 constexpr int subEnt(int d, int c)
    \n+
    87 {
    \n+
    88 return (d < c ? 0 : BinomialTable<dimworld>::evaluate(d,c) << c);
    \n+
    89 }
    \n+
    90
    \n+
    91 // Make a table mapping all subentities of a codim 0 entity to a value.
    \n+
    92 // F is the functor to be evaluated.
    \n+
    93 template<typename F, int dim>
    \n+
    94 struct EntityShiftTable
    \n+
    95 {
    \n+
    96 typedef std::bitset<dim> value_type;
    \n+
    97
    \n+
    98 static value_type evaluate(int i, int codim)
    \n+
    99 {
    \n+
    100 return {_values[_offsets[codim] + i]};
    \n+
    101 }
    \n+
    102
    \n+
    103 private:
    \n+
    104
    \n+
    105 // prevent construction
    \n+
    106 EntityShiftTable() = delete;
    \n+
    107
    \n+
    108 // compute offset of codimension `codim` entities and advance `offset`
    \n+
    109 static constexpr int nextOffset(int& offset, int codim)
    \n+
    110 {
    \n+
    111 if (codim == 0) {
    \n+
    112 offset = 0;
    \n+
    113 return 0;
    \n+
    114 }
    \n+
    115
    \n+
    116 offset += subEnt<dim>(dim, codim-1);
    \n+
    117 return offset;
    \n+
    118 }
    \n+
    119
    \n+
    120 template<std::size_t... I>
    \n+
    121 static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>)
    \n+
    122 {
    \n+
    123 int offset = 0;
    \n+
    124 return {{ (nextOffset(offset, I))... }};
    \n+
    125 }
    \n+
    126
    \n+
    127 // compute shift table entry for (`codim`, `i`) and advance `codim`, `i`
    \n+
    128 static constexpr unsigned char nextValue(int& codim, int& i)
    \n+
    129 {
    \n+
    130 const auto result = F::evaluate(i, codim);
    \n+
    131
    \n+
    132 i += 1;
    \n+
    133 if (i >= subEnt<dim>(dim, codim)) {
    \n+
    134 codim += 1;
    \n+
    135 i = 0;
    \n+
    136 }
    \n+
    137
    \n+
    138 return result;
    \n+
    139 }
    \n+
    140
    \n+
    141 template<std::size_t... I>
    \n+
    142 static constexpr std::array<unsigned char, sizeof...(I)> computeValues(std::index_sequence<I...>)
    \n+
    143 {
    \n+
    144 int codim = 0, i = 0;
    \n+
    145 return {{ ((void)I, nextValue(codim, i))... }};
    \n+
    146 }
    \n+
    147
    \n+
    148 static constexpr std::array<int,dim+1> _offsets = computeOffsets(std::make_index_sequence<dim+1>{});
    \n+
    149 static constexpr std::array<unsigned char,Dune::power(3,dim)> _values = computeValues(std::make_index_sequence<Dune::power(3,dim)>{});
    \n+
    150
    \n+
    151 };
    \n+
    152
    \n+
    153 // functor for doing the actual entity shift calculation
    \n+
    154 template<int dim>
    \n+
    155 struct calculate_entity_shift
    \n+
    156 {
    \n+
    157 static constexpr unsigned long long evaluate(int index, int cc)
    \n+
    158 {
    \n+
    159 auto result = 0ull;
    \n+
    160 for (int d = dim; d>0; d--)
    \n+
    161 {
    \n+
    162 if (cc == d)
    \n+
    163 return result;
    \n+
    164 if (index < subEnt<dim>(d-1,cc))
    \n+
    165 result |= 1ull << (d-1);
    \n+
    166 else
    \n+
    167 {
    \n+
    168 index = (index - subEnt<dim>(d-1, cc)) % subEnt<dim>(d-1,cc-1);
    \n+
    169 cc--;
    \n+
    170 }
    \n+
    171 }
    \n+
    172 return result;
    \n+
    173 }
    \n+
    174 };
    \n+
    175
    \n+
    184 template<int dim>
    \n+
    185 std::bitset<dim> entityShift(int index, int cc)
    \n+
    186 {
    \n+
    187 return EntityShiftTable<calculate_entity_shift<dim>,dim>::evaluate(index,cc);
    \n+
    188 }
    \n+
    189
    \n+
    190 // functor for doing the actual entity move calculation
    \n+
    191 template<int dim>
    \n+
    192 struct calculate_entity_move
    \n+
    193 {
    \n+
    194 static constexpr unsigned long long evaluate(int index, int cc)
    \n+
    195 {
    \n+
    196 auto result = 0ull;
    \n+
    197 for (int d = dim; d>0; d--)
    \n+
    198 {
    \n+
    199 if (d == cc)
    \n+
    200 {
    \n+
    201 // result[d-1] = index & (1<<(d-1));
    \n+
    202 result &= ~(1ull << (d-1));
    \n+
    203 result |= index & (1ull << (d-1));
    \n+
    204
    \n+
    205 index &= ~(1<<(d-1));
    \n+
    206 }
    \n+
    207 if (index >= subEnt<dim>(d-1,cc))
    \n+
    208 {
    \n+
    209 if ((index - subEnt<dim>(d-1,cc)) / subEnt<dim>(d-1,cc-1) == 1)
    \n+
    210 {
    \n+
    211 result |= 1ull << (d-1);
    \n+
    212 }
    \n+
    213 index = (index - subEnt<dim>(d-1, cc)) % subEnt<dim>(d-1,cc-1);
    \n+
    214 cc--;
    \n+
    215 }
    \n+
    216 }
    \n+
    217 return result;
    \n+
    218 }
    \n+
    219
    \n+
    220 };
    \n+
    221
    \n+
    229 template<int dim>
    \n+
    230 std::bitset<dim> entityMove(int index, int cc)
    \n+
    231 {
    \n+
    232 return EntityShiftTable<calculate_entity_move<dim>,dim>::evaluate(index,cc);
    \n+
    233 }
    \n+
    234
    \n+
    235#endif //DOXYGEN
    \n+
    236
    \n+
    237 } // namespace Yasp.
    \n+
    238
    \n+
    239 template<int codim, int dim, class GridImp>
    \n+
    \n+\n+
    241 : public EntityDefaultImplementation <codim,dim,GridImp,YaspEntity>
    \n+
    242 {
    \n+
    243
    \n+
    244 template<int, PartitionIteratorType, typename>
    \n+
    245 friend class YaspLevelIterator;
    \n+
    246
    \n+
    247 public:
    \n+
    248 typedef typename GridImp::ctype ctype;
    \n+
    249
    \n+
    250 typedef typename GridImp::template Codim<codim>::Geometry Geometry;
    \n+
    251 typedef typename GridImp::Traits::template Codim<codim>::GeometryImpl GeometryImpl;
    \n+
    252
    \n+
    253 typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;
    \n+
    254
    \n+
    \n+
    256 int level () const
    \n+
    257 {
    \n+
    258 return _g->level();
    \n+
    259 }
    \n
    \n-
    41
    \n-
    \n-
    43 YaspIndexSet ( const GridImp &g )
    \n-
    44 : grid( g )
    \n-
    45 {
    \n-
    46 assert(isLeafIndexSet);
    \n-
    47 }
    \n-
    \n-
    48
    \n-
    50 template<int cc>
    \n-
    \n-
    51 IndexType index (const typename std::remove_const<GridImp>::type::Traits::template Codim<cc>::Entity& e) const
    \n-
    52 {
    \n-
    53 return e.impl().compressedIndex();
    \n-
    54 }
    \n-
    \n-
    55
    \n-
    57 template< int cc >
    \n-
    \n-
    58 IndexType subIndex ( const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e,
    \n-
    59 int i, unsigned int codim ) const
    \n-
    60 {
    \n-
    61 return e.impl().subCompressedIndex(i, codim);
    \n-
    62 }
    \n+
    260
    \n+
    \n+\n+
    265 {
    \n+
    266 return EntitySeed(YaspEntitySeed<codim,GridImp>(_g->level(), _it.coord(), _it.which()));
    \n+
    267 }
    \n
    \n-
    63
    \n-
    \n-
    65 std::size_t size (GeometryType type) const
    \n-
    66 {
    \n-
    67 return (isLeafIndexSet)
    \n-
    68 ? grid.size( type )
    \n-
    69 : grid.size( level, type );
    \n-
    70 }
    \n-
    \n-
    71
    \n-
    \n-
    73 std::size_t size (int codim) const
    \n-
    74 {
    \n-
    75 return (isLeafIndexSet)
    \n-
    76 ? grid.size( codim )
    \n-
    77 : grid.size( level, codim );
    \n-
    78 }
    \n-
    \n-
    79
    \n-
    81 template<class EntityType>
    \n-
    \n-
    82 bool contains (const EntityType& e) const
    \n-
    83 {
    \n-
    84 return (isLeafIndexSet)
    \n-
    85 ? e.level() == grid.maxLevel()
    \n-
    86 : e.level() == level;
    \n-
    87 }
    \n-
    \n-
    88
    \n-
    \n-
    90 static constexpr std::array<GeometryType, 1> types (int codim)
    \n-
    91 {
    \n-
    92 return { GeometryTypes::cube(GridImp::dimension - codim) };
    \n-
    93 }
    \n-
    \n-
    94
    \n-
    95 private:
    \n-
    96 const GridImp& grid;
    \n-
    97 int level;
    \n-
    98 };
    \n-
    \n-
    99
    \n-
    100} // namespace Dune
    \n-
    101
    \n-
    102#endif // DUNE_GRID_YASPGRIDINDEXSET_HH
    \n+
    268
    \n+
    \n+\n+
    271 {
    \n+
    272 GeometryImpl _geometry(_it.lowerleft(),_it.upperright(),_it.shift());
    \n+
    273 return Geometry(_geometry);
    \n+
    274 }
    \n+
    \n+
    275
    \n+
    \n+
    279 constexpr GeometryType type () const
    \n+
    280 {
    \n+
    281 return GeometryTypes::cube(Geometry::mydimension);
    \n+
    282 }
    \n+
    \n+
    283
    \n+
    \n+
    288 unsigned int subEntities (unsigned int cc) const
    \n+
    289 {
    \n+
    290 return Dune::Yasp::subEnt<dim>(dim-codim,cc-codim);
    \n+
    291 }
    \n+
    \n+
    292
    \n+
    \n+\n+
    295 {
    \n+
    296 if (_g->interior[codim].inside(_it.coord(),_it.shift()))
    \n+
    297 return InteriorEntity;
    \n+
    298 if (_g->interiorborder[codim].inside(_it.coord(),_it.shift()))
    \n+
    299 return BorderEntity;
    \n+
    300 if (_g->overlap[codim].inside(_it.coord(),_it.shift()))
    \n+
    301 return OverlapEntity;
    \n+
    302 if (_g->overlapfront[codim].inside(_it.coord(),_it.shift()))
    \n+
    303 return FrontEntity;
    \n+
    304 return GhostEntity;
    \n+
    305 }
    \n+
    \n+
    306
    \n+
    307 typedef typename GridImp::YGridLevelIterator YGLI;
    \n+
    308 typedef typename GridImp::YGrid::Iterator I;
    \n+
    \n+\n+
    310 {}
    \n+
    \n+
    311
    \n+
    \n+
    312 YaspEntity (const YGLI& g, const I& it)
    \n+
    313 : _it(it), _g(g)
    \n+
    314 {}
    \n+
    \n+
    315
    \n+
    \n+
    316 YaspEntity (YGLI&& g, const I&& it)
    \n+
    317 : _it(std::move(it)), _g(std::move(g))
    \n+
    318 {}
    \n+
    \n+
    319
    \n+
    321 bool equals (const YaspEntity& e) const
    \n+
    322 {
    \n+
    323 return _it == e._it && _g == e._g;
    \n+
    324 }
    \n+
    325
    \n+
    326 // IndexSets needs access to the private index methods
    \n+
    327 friend class Dune::YaspIndexSet<GridImp,true>;
    \n+
    328 friend class Dune::YaspIndexSet<GridImp,false>;
    \n+
    329 friend class Dune::YaspGlobalIdSet<GridImp>;
    \n+
    330 typedef typename GridImp::PersistentIndexType PersistentIndexType;
    \n+
    331
    \n+
    \n+\n+
    334 {
    \n+
    335 // get size of global grid (in elements)
    \n+
    336 std::array<int,dim> size;
    \n+
    337
    \n+
    338 for (int i=0; i<dim; i++)
    \n+
    339 {
    \n+
    340 // correct size according to shift
    \n+
    341 size[i] = _g->mg->levelSize(_g->level(), i);
    \n+
    342 if (!_it.shift(i))
    \n+
    343 size[i]++;
    \n+
    344 }
    \n+
    345
    \n+
    346 // encode codim
    \n+
    347 PersistentIndexType id(_it.shift().to_ulong());
    \n+
    348
    \n+
    349 // encode level
    \n+
    350 id = id << yaspgrid_level_bits;
    \n+
    351 id = id+PersistentIndexType(_g->level());
    \n+
    352
    \n+
    353 // encode coordinates
    \n+
    354 for (int i=dim-1; i>=0; i--)
    \n+
    355 {
    \n+
    356 id = id << yaspgrid_dim_bits;
    \n+
    357 id = id+PersistentIndexType(_it.coord(i));
    \n+
    358 }
    \n+
    359
    \n+
    360 return id;
    \n+
    361 }
    \n+
    \n+
    362
    \n+
    \n+
    364 int compressedIndex () const
    \n+
    365 {
    \n+
    366 return _it.superindex();
    \n+
    367 }
    \n+
    \n+
    368
    \n+
    \n+
    370 int subCompressedIndex (int i, unsigned int cc) const
    \n+
    371 {
    \n+
    372 // get the shift of the entity and the subentity
    \n+
    373 // the subentity shift is only available in the space spanned by the entity
    \n+
    374 std::bitset<dim-codim> subent_shift = Dune::Yasp::entityShift<dim-codim>(i,cc-codim);
    \n+
    375 std::bitset<dim-codim> subent_move = Dune::Yasp::entityMove<dim-codim>(i,cc-codim);
    \n+
    376
    \n+
    377 std::bitset<dim> shift = _it.shift();
    \n+
    378 std::array<int, dim> coord = _it.coord();
    \n+
    379 for (int j=0, k=0; j<dim; j++)
    \n+
    380 {
    \n+
    381 if (!shift[j])
    \n+
    382 continue;
    \n+
    383
    \n+
    384 coord[j] += subent_move[k];
    \n+
    385 shift[j] = subent_shift[k];
    \n+
    386 k++;
    \n+
    387 }
    \n+
    388
    \n+
    389 int which = _g->overlapfront[cc].shiftmapping(shift);
    \n+
    390 return _g->overlapfront[cc].superindex(coord,which);
    \n+
    391 }
    \n+
    \n+
    392 public:
    \n+
    393 const I& transformingsubiterator() const { return _it; }
    \n+
    394 const YGLI& gridlevel() const { return _g; }
    \n+\n+
    396 YGLI& gridlevel() { return _g; }
    \n+
    397 const GridImp * yaspgrid() const { return _g->mg; }
    \n+
    398 protected:
    \n+
    399 I _it = {}; // position in the grid level
    \n+
    400 YGLI _g = {}; // access to grid level
    \n+
    401 };
    \n+
    \n+
    402
    \n+
    403
    \n+
    404 // specialization for codim=0
    \n+
    405 template<int dim, class GridImp>
    \n+
    \n+
    406 class YaspEntity<0,dim,GridImp>
    \n+
    407 : public EntityDefaultImplementation <0,dim,GridImp,YaspEntity>
    \n+
    408 {
    \n+
    409 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    410
    \n+
    411 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
    \n+
    412
    \n+
    413 template<int, PartitionIteratorType, typename>
    \n+
    414 friend class YaspLevelIterator;
    \n+
    415
    \n+
    416 template<typename>
    \n+\n+
    418
    \n+
    419 public:
    \n+
    420 typedef typename GridImp::ctype ctype;
    \n+
    421
    \n+
    422 typedef typename GridImp::YGridLevelIterator YGLI;
    \n+
    423 typedef typename GridImp::YGrid::Iterator I;
    \n+
    424
    \n+
    425 typedef typename GridImp::template Codim< 0 >::Geometry Geometry;
    \n+
    426 typedef typename GridImp::template Codim< 0 >::LocalGeometry LocalGeometry;
    \n+
    427
    \n+
    428 template <int cd>
    \n+
    \n+
    429 struct Codim
    \n+
    430 {
    \n+
    431 typedef typename GridImp::template Codim<cd>::Entity Entity;
    \n+
    432 };
    \n+
    \n+
    433
    \n+
    434 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n+
    435 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
    \n+
    436 typedef typename GridImp::LevelIntersectionIterator IntersectionIterator;
    \n+
    437 typedef typename GridImp::LevelIntersectionIterator LevelIntersectionIterator;
    \n+
    438 typedef typename GridImp::LeafIntersectionIterator LeafIntersectionIterator;
    \n+
    439 typedef typename GridImp::HierarchicIterator HierarchicIterator;
    \n+
    440
    \n+
    442 typedef typename GridImp::PersistentIndexType PersistentIndexType;
    \n+
    443
    \n+
    445 typedef typename GridImp::YGrid::iTupel iTupel;
    \n+
    446
    \n+
    447 // constructor
    \n+
    \n+\n+
    449 {}
    \n+
    \n+
    450
    \n+
    \n+
    451 YaspEntity (const YGLI& g, const I& it)
    \n+
    452 : _it(it), _g(g)
    \n+
    453 {}
    \n+
    \n+
    454
    \n+
    \n+
    455 YaspEntity (const YGLI& g, I&& it)
    \n+
    456 : _it(std::move(it)), _g(g)
    \n+
    457 {}
    \n+
    \n+
    458
    \n+
    \n+
    459 YaspEntity (YGLI&& g, I&& it)
    \n+
    460 : _it(std::move(it)), _g(std::move(g))
    \n+
    461 {}
    \n+
    \n+
    462
    \n+
    \n+
    464 bool equals (const YaspEntity& e) const
    \n+
    465 {
    \n+
    466 return _it == e._it && _g == e._g;
    \n+
    467 }
    \n+
    \n+
    468
    \n+
    470 int level () const { return _g->level(); }
    \n+
    471
    \n+
    \n+
    475 EntitySeed seed () const {
    \n+
    476 return EntitySeed(YaspEntitySeed<0,GridImp>(_g->level(), _it.coord()));
    \n+
    477 }
    \n+
    \n+
    478
    \n+
    \n+\n+
    481 {
    \n+
    482 if (_g->interior[0].inside(_it.coord(),_it.shift()))
    \n+
    483 return InteriorEntity;
    \n+
    484 if (_g->overlap[0].inside(_it.coord(),_it.shift()))
    \n+
    485 return OverlapEntity;
    \n+
    486 DUNE_THROW(GridError, "Impossible GhostEntity");
    \n+
    487 return GhostEntity;
    \n+
    488 }
    \n+
    \n+
    489
    \n+
    \n+\n+
    492 // the element geometry
    \n+
    493 auto ll = _it.lowerleft();
    \n+
    494 auto ur = _it.upperright();
    \n+
    495
    \n+
    496 // If on periodic overlap, transform coordinates by domain size
    \n+
    497 for (int i=0; i<dimworld; i++) {
    \n+
    498 if (gridlevel()->mg->isPeriodic(i)) {
    \n+
    499 int coord = transformingsubiterator().coord(i);
    \n+
    500 if (coord < 0) {
    \n+
    501 auto size = _g->mg->domainSize()[i];
    \n+
    502 ll[i] += size;
    \n+
    503 ur[i] += size;
    \n+
    504 } else if (coord + 1 > gridlevel()->mg->levelSize(gridlevel()->level(),i)) {
    \n+
    505 auto size = _g->mg->domainSize()[i];
    \n+
    506 ll[i] -= size;
    \n+
    507 ur[i] -= size;
    \n+
    508 }
    \n+
    509 }
    \n+
    510 }
    \n+
    511
    \n+
    512 GeometryImpl _geometry(ll,ur);
    \n+
    513 return Geometry( _geometry );
    \n+
    514 }
    \n+
    \n+
    515
    \n+
    \n+
    519 constexpr GeometryType type () const
    \n+
    520 {
    \n+
    521 return GeometryTypes::cube(Geometry::mydimension);
    \n+
    522 }
    \n+
    \n+
    523
    \n+
    \n+
    528 template<int cc> int count () const
    \n+
    529 {
    \n+
    530 return Dune::Yasp::subEnt<dim>(dim,cc);
    \n+
    531 }
    \n+
    \n+
    532
    \n+
    \n+
    537 unsigned int subEntities (unsigned int codim) const
    \n+
    538 {
    \n+
    539 return Dune::Yasp::subEnt<dim>(dim,codim);
    \n+
    540 }
    \n+
    \n+
    541
    \n+
    544 template<int cc>
    \n+
    \n+
    545 typename Codim<cc>::Entity subEntity (int i) const
    \n+
    546 {
    \n+
    547 // calculate move bitset
    \n+
    548 std::bitset<dim> move = Dune::Yasp::entityMove<dim>(i,cc);
    \n+
    549
    \n+
    550 // get the coordinate and modify it
    \n+
    551 iTupel coord = _it.coord();
    \n+
    552 for (int j=0; j<dim; j++)
    \n+
    553 if (move[j])
    \n+
    554 coord[j]++;
    \n+
    555
    \n+
    556 int which = _g->overlapfront[cc].shiftmapping(Dune::Yasp::entityShift<dim>(i,cc));
    \n+
    557 return typename Codim<cc>::Entity(YaspEntity<cc,GridImp::dimension,GridImp>(_g,_g->overlapfront[cc].begin(coord, which)));
    \n+
    558 }
    \n+
    \n+
    559
    \n+
    \n+
    561 Entity father () const
    \n+
    562 {
    \n+
    563 // check if coarse level exists
    \n+
    564 if (_g->level()<=0)
    \n+
    565 DUNE_THROW(GridError, "tried to call father on level 0");
    \n+
    566
    \n+
    567 // yes, get iterator to it
    \n+
    568 YGLI cg(_g);
    \n+
    569 --cg;
    \n+
    570
    \n+
    571 // coordinates of the cell
    \n+
    572 iTupel coord = _it.coord();
    \n+
    573
    \n+
    574 // get coordinates on next coarser level
    \n+
    575 for (int k=0; k<dim; k++) coord[k] = coord[k]/2;
    \n+
    576
    \n+
    577 return Entity(YaspEntity<0,GridImp::dimension,GridImp>(cg,cg->overlap[0].begin(coord)));
    \n+
    578 }
    \n+
    \n+
    579
    \n+
    \n+
    581 bool hasFather () const
    \n+
    582 {
    \n+
    583 return (_g->level()>0);
    \n+
    584 }
    \n+
    \n+
    585
    \n+
    \n+\n+
    589 {
    \n+
    590 // configure one of the 2^dim transformations
    \n+
    591 FieldVector<ctype,dim> ll(0.0),ur(0.5);
    \n+
    592
    \n+
    593 for (int k=0; k<dim; k++)
    \n+
    594 {
    \n+
    595 if (_it.coord(k)%2)
    \n+
    596 {
    \n+
    597 ll[k] = 0.5;
    \n+
    598 ur[k] = 1.0;
    \n+
    599 }
    \n+
    600 }
    \n+
    601
    \n+\n+
    603 }
    \n+
    \n+
    604
    \n+
    605 const I& transformingsubiterator () const { return _it; }
    \n+
    606 const YGLI& gridlevel () const { return _g; }
    \n+\n+
    608 YGLI& gridlevel() { return _g; }
    \n+
    609 const GridImp* yaspgrid () const { return _g->mg; }
    \n+
    610
    \n+
    \n+
    611 bool isLeaf() const
    \n+
    612 {
    \n+
    613 return (_g->level() == yaspgrid()->maxLevel());
    \n+
    614 }
    \n+
    \n+
    615
    \n+
    618 bool isNew () const { return yaspgrid()->adaptRefCount > 0 && yaspgrid()->maxLevel() < _g->level() + yaspgrid()->adaptRefCount; }
    \n+
    619
    \n+
    622 bool mightVanish () const { return false; }
    \n+
    623
    \n+
    \n+\n+
    626 {
    \n+
    627 return YaspIntersectionIterator<GridImp>(*this,false);
    \n+
    628 }
    \n+
    \n+
    629
    \n+
    \n+\n+
    632 {
    \n+
    633 // only if entity is leaf this iterator delivers intersections
    \n+
    634 return YaspIntersectionIterator<GridImp>(*this, ! isLeaf() );
    \n+
    635 }
    \n+
    \n+
    636
    \n+
    \n+\n+
    639 {
    \n+
    640 return ibegin();
    \n+
    641 }
    \n+
    \n+
    642
    \n+
    \n+\n+
    645 {
    \n+
    646 return YaspIntersectionIterator<GridImp>(*this,true);
    \n+
    647 }
    \n+
    \n+
    648
    \n+
    \n+\n+
    651 {
    \n+
    652 return iend();
    \n+
    653 }
    \n+
    \n+
    654
    \n+
    \n+\n+
    657 {
    \n+
    658 return iend();
    \n+
    659 }
    \n+
    \n+
    660
    \n+
    \n+
    665 HierarchicIterator hbegin (int maxlevel) const
    \n+
    666 {
    \n+
    667 return YaspHierarchicIterator<GridImp>(_g,_it,maxlevel);
    \n+
    668 }
    \n+
    \n+
    669
    \n+
    671 HierarchicIterator hend (int /* maxlevel */) const
    \n+
    672 {
    \n+
    673 return YaspHierarchicIterator<GridImp>(_g,_it,_g->level());
    \n+
    674 }
    \n+
    675
    \n+
    676 private:
    \n+
    677 // IndexSets needs access to the private index methods
    \n+
    678 friend class Dune::YaspIndexSet<GridImp,true>;
    \n+
    679 friend class Dune::YaspIndexSet<GridImp,false>;
    \n+
    680 friend class Dune::YaspGlobalIdSet<GridImp>;
    \n+
    681
    \n+\n+
    684 {
    \n+
    685 // encode codim
    \n+
    686 PersistentIndexType id(_it.shift().to_ulong());
    \n+
    687
    \n+
    688 // encode level
    \n+
    689 id = id << yaspgrid_level_bits;
    \n+
    690 id = id+PersistentIndexType(_g->level());
    \n+
    691
    \n+
    692
    \n+
    693 // encode coordinates
    \n+
    694 for (int i=dim-1; i>=0; i--)
    \n+
    695 {
    \n+
    696 id = id << yaspgrid_dim_bits;
    \n+
    697 id = id+PersistentIndexType(_it.coord(i));
    \n+
    698 }
    \n+
    699
    \n+
    700 return id;
    \n+
    701 }
    \n+
    702
    \n+
    704 int compressedIndex () const
    \n+
    705 {
    \n+
    706 return _it.superindex();
    \n+
    707 }
    \n+
    708
    \n+
    710 PersistentIndexType subPersistentIndex (int i, int cc) const
    \n+
    711 {
    \n+
    712 // calculate shift and move bitsets
    \n+
    713 std::bitset<dim> shift = Dune::Yasp::entityShift<dim>(i,cc);
    \n+
    714 std::bitset<dim> move = Dune::Yasp::entityMove<dim>(i,cc);
    \n+
    715
    \n+
    716 int trailing = (cc == dim) ? 1000 : 0;
    \n+
    717
    \n+
    718 std::array<int,dim> size = _g->mg->levelSize(_g->level());
    \n+
    719 std::array<int, dim> coord = _it.coord();
    \n+
    720 for (int j=0; j<dim; j++)
    \n+
    721 {
    \n+
    722 // correct size according to shift
    \n+
    723 if (!shift[j])
    \n+
    724 size[j]++;
    \n+
    725
    \n+
    726 // move the coordinates to the cell on which the entity lives
    \n+
    727 if (move[j])
    \n+
    728 coord[j]++;
    \n+
    729 }
    \n+
    730
    \n+
    731 for (int j=0; j<dim; j++)
    \n+
    732 {
    \n+
    733 // in the codim==dim case, count trailing zeroes.
    \n+
    734 if (cc == dim)
    \n+
    735 {
    \n+
    736 int zeroes = 0;
    \n+
    737 for (int k=0; k<_g->level(); k++)
    \n+
    738 if (coord[j] & (1<<k))
    \n+
    739 break;
    \n+
    740 else
    \n+
    741 zeroes++;
    \n+
    742 trailing = std::min(trailing,zeroes);
    \n+
    743 }
    \n+
    744 }
    \n+
    745
    \n+
    746 // encode codim
    \n+
    747 PersistentIndexType id(shift.to_ulong());
    \n+
    748
    \n+
    749 // encode level
    \n+
    750 id = id << yaspgrid_level_bits;
    \n+
    751 id = id+PersistentIndexType(_g->level()-trailing);
    \n+
    752
    \n+
    753 // encode coordinates
    \n+
    754 for (int j=dim-1; j>=0; j--)
    \n+
    755 {
    \n+
    756 id = id << yaspgrid_dim_bits;
    \n+
    757 id = id+PersistentIndexType(coord[j]>>trailing);
    \n+
    758 }
    \n+
    759
    \n+
    760 return id;
    \n+
    761 }
    \n+
    762
    \n+
    764 int subCompressedIndex (int i, int cc) const
    \n+
    765 {
    \n+
    766 // get shift and move of the subentity in question
    \n+
    767 std::bitset<dim> shift = Dune::Yasp::entityShift<dim>(i,cc);
    \n+
    768 std::bitset<dim> move = Dune::Yasp::entityMove<dim>(i,cc);
    \n+
    769
    \n+
    770 std::array<int, dim> coord = _it.coord();
    \n+
    771 for (int j=0; j<dim; j++)
    \n+
    772 coord[j] += move[j];
    \n+
    773
    \n+
    774 int which = _g->overlapfront[cc].shiftmapping(shift);
    \n+
    775 return _g->overlapfront[cc].superindex(coord,which);
    \n+
    776 }
    \n+
    777
    \n+
    778 I _it = {}; // position in the grid level
    \n+
    779 YGLI _g = {}; // access to grid level
    \n+
    780 };
    \n+
    \n+
    781
    \n+
    782
    \n+
    783 // specialization for codim=dim (vertex)
    \n+
    784 template<int dim, class GridImp>
    \n+
    \n+
    785 class YaspEntity<dim,dim,GridImp>
    \n+
    786 : public EntityDefaultImplementation <dim,dim,GridImp,YaspEntity>
    \n+
    787 {
    \n+
    788 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    789
    \n+
    790 template<int, PartitionIteratorType, typename>
    \n+
    791 friend class YaspLevelIterator;
    \n+
    792
    \n+
    793 typedef typename GridImp::Traits::template Codim<dim>::GeometryImpl GeometryImpl;
    \n+
    794
    \n+
    795 public:
    \n+
    796 typedef typename GridImp::ctype ctype;
    \n+
    797
    \n+
    798 typedef typename GridImp::YGridLevelIterator YGLI;
    \n+
    799 typedef typename GridImp::YGrid::Iterator I;
    \n+
    800
    \n+
    801 typedef typename GridImp::template Codim<dim>::Geometry Geometry;
    \n+
    802
    \n+
    803 typedef typename GridImp::template Codim<dim>::EntitySeed EntitySeed;
    \n+
    804
    \n+
    806 typedef typename GridImp::PersistentIndexType PersistentIndexType;
    \n+
    807
    \n+
    809 typedef typename GridImp::YGrid::iTupel iTupel;
    \n+
    810
    \n+
    811 // constructor
    \n+
    \n+\n+
    813 {}
    \n+
    \n+
    814
    \n+
    \n+
    815 YaspEntity (const YGLI& g, const I& it)
    \n+
    816 : _it(it), _g(g)
    \n+
    817 {}
    \n+
    \n+
    818
    \n+
    \n+
    819 YaspEntity (YGLI&& g, I&& it)
    \n+
    820 : _it(std::move(it)), _g(std::move(g))
    \n+
    821 {}
    \n+
    \n+
    822
    \n+
    \n+
    824 bool equals (const YaspEntity& e) const
    \n+
    825 {
    \n+
    826 return _it == e._it && _g == e._g;
    \n+
    827 }
    \n+
    \n+
    828
    \n+
    830 int level () const {return _g->level();}
    \n+
    831
    \n+
    \n+
    835 EntitySeed seed () const {
    \n+
    836 return EntitySeed(YaspEntitySeed<dim,GridImp>(_g->level(), _it.coord(), _it.which()));
    \n+
    837 }
    \n+
    \n+
    838
    \n+
    \n+
    843 unsigned int subEntities (unsigned int cc) const
    \n+
    844 {
    \n+
    845 return Dune::Yasp::subEnt<dim>(dim-dim,cc-dim);
    \n+
    846 }
    \n+
    \n+
    847
    \n+
    \n+\n+
    850 GeometryImpl _geometry((_it).lowerleft());
    \n+
    851 return Geometry( _geometry );
    \n+
    852 }
    \n+
    \n+
    853
    \n+
    \n+
    857 constexpr GeometryType type () const
    \n+
    858 {
    \n+
    859 return GeometryTypes::cube(Geometry::mydimension);
    \n+
    860 }
    \n+
    \n+
    861
    \n+
    \n+\n+
    864 {
    \n+
    865 if (_g->interior[dim].inside(_it.coord(),_it.shift()))
    \n+
    866 return InteriorEntity;
    \n+
    867 if (_g->interiorborder[dim].inside(_it.coord(),_it.shift()))
    \n+
    868 return BorderEntity;
    \n+
    869 if (_g->overlap[dim].inside(_it.coord(),_it.shift()))
    \n+
    870 return OverlapEntity;
    \n+
    871 if (_g->overlapfront[dim].inside(_it.coord(),_it.shift()))
    \n+
    872 return FrontEntity;
    \n+
    873 return GhostEntity;
    \n+
    874 }
    \n+
    \n+
    875
    \n+
    877 int subCompressedIndex (int, unsigned int ) const
    \n+
    878 {
    \n+
    879 return compressedIndex();
    \n+
    880 }
    \n+
    881
    \n+
    882 private:
    \n+
    883 // IndexSets needs access to the private index methods
    \n+
    884 friend class Dune::YaspIndexSet<GridImp,true>;
    \n+
    885 friend class Dune::YaspIndexSet<GridImp,false>;
    \n+
    886 friend class Dune::YaspGlobalIdSet<GridImp>;
    \n+
    887
    \n+\n+
    890 {
    \n+
    891 // get coordinate and size of global grid
    \n+
    892 iTupel size = _g->mg->levelSize(_g->level());
    \n+
    893
    \n+
    894 for (int i=0; i<dim; i++)
    \n+
    895 {
    \n+
    896 // we have vertices, add 1 size to all directions
    \n+
    897 size[i]++;
    \n+
    898 }
    \n+
    899
    \n+
    900 // determine min number of trailing zeroes
    \n+
    901 int trailing = 1000;
    \n+
    902 for (int i=0; i<dim; i++)
    \n+
    903 {
    \n+
    904 // count trailing zeros
    \n+
    905 int zeros = 0;
    \n+
    906 for (int j=0; j<_g->level(); j++)
    \n+
    907 if (_it.coord(i)&(1<<j))
    \n+
    908 break;
    \n+
    909 else
    \n+
    910 zeros++;
    \n+
    911 trailing = std::min(trailing,zeros);
    \n+
    912 }
    \n+
    913
    \n+
    914 // determine the level of this vertex
    \n+
    915 int level = _g->level()-trailing;
    \n+
    916
    \n+
    917 // encode codim: shift vector of vertices is 0.
    \n+\n+
    919
    \n+
    920 // encode level
    \n+
    921 id = id << yaspgrid_level_bits;
    \n+
    922 id = id+PersistentIndexType(level);
    \n+
    923
    \n+
    924 // encode coordinates
    \n+
    925 for (int i=dim-1; i>=0; i--)
    \n+
    926 {
    \n+
    927 id = id << yaspgrid_dim_bits;
    \n+
    928 id = id+PersistentIndexType(_it.coord(i)>>trailing);
    \n+
    929 }
    \n+
    930
    \n+
    931 return id;
    \n+
    932 }
    \n+
    933
    \n+
    935 int compressedIndex () const { return _it.superindex();}
    \n+
    936
    \n+
    937 public:
    \n+
    938 const I& transformingsubiterator() const { return _it; }
    \n+
    939 const YGLI& gridlevel() const { return _g; }
    \n+\n+
    941 YGLI& gridlevel() { return _g; }
    \n+
    942
    \n+
    943 const GridImp * yaspgrid() const { return _g->mg; }
    \n+
    944 protected:
    \n+
    945 I _it = {}; // position in the grid level
    \n+
    946 YGLI _g = {}; // access to grid level
    \n+
    947 };
    \n+
    \n+
    948
    \n+
    949} // namespace Dune
    \n+
    950
    \n+
    951#endif // DUNE_GRID_YASPGRIDENTITY_HH
    \n+
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n+
    @ FrontEntity
    on boundary between overlap and ghost
    Definition gridenums.hh:34
    \n+
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n+
    @ GhostEntity
    ghost entities
    Definition gridenums.hh:35
    \n+
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n+
    @ OverlapEntity
    all entities lying in the overlap zone
    Definition gridenums.hh:33
    \n+
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n-
    IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition common/indexidset.hh:153
    \n-
    Export the type of the entity used as parameter in the index(...) method.
    Definition common/indexidset.hh:87
    \n+
    const int yaspgrid_level_bits
    Definition yaspgrid.hh:48
    \n+
    const int yaspgrid_dim_bits
    Definition yaspgrid.hh:47
    \n+
    Default Implementations for EntityImp.
    Definition common/entity.hh:542
    \n+
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n+
    static constexpr int mydimension
    geometry dimension
    Definition common/geometry.hh:94
    \n+
    The general version that handles all codimensions but 0 and dim.
    Definition yaspgridgeometry.hh:31
    \n+
    Definition yaspgridentity.hh:242
    \n+
    int level() const
    level of this element
    Definition yaspgridentity.hh:256
    \n+
    Geometry geometry() const
    geometry of this entity
    Definition yaspgridentity.hh:270
    \n+
    GridImp::ctype ctype
    Definition yaspgridentity.hh:248
    \n+
    constexpr GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition yaspgridentity.hh:279
    \n+
    PersistentIndexType persistentIndex() const
    globally unique, persistent index
    Definition yaspgridentity.hh:333
    \n+
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:394
    \n+
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:393
    \n+
    YGLI _g
    Definition yaspgridentity.hh:400
    \n+
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:321
    \n+
    PartitionType partitionType() const
    return partition type attribute
    Definition yaspgridentity.hh:294
    \n+
    GridImp::Traits::template Codim< codim >::GeometryImpl GeometryImpl
    Definition yaspgridentity.hh:251
    \n+
    YGLI & gridlevel()
    Definition yaspgridentity.hh:396
    \n+
    int subCompressedIndex(int i, unsigned int cc) const
    subentity compressed index
    Definition yaspgridentity.hh:370
    \n+
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridentity.hh:307
    \n+
    GridImp::YGrid::Iterator I
    Definition yaspgridentity.hh:308
    \n+
    const GridImp * yaspgrid() const
    Definition yaspgridentity.hh:397
    \n+
    GridImp::template Codim< codim >::EntitySeed EntitySeed
    Definition yaspgridentity.hh:253
    \n+
    YaspEntity(YGLI &&g, const I &&it)
    Definition yaspgridentity.hh:316
    \n+
    EntitySeed seed() const
    Return the entity seed which contains sufficient information to generate the entity again and uses as...
    Definition yaspgridentity.hh:264
    \n+
    int compressedIndex() const
    consecutive, codim-wise, level-wise index
    Definition yaspgridentity.hh:364
    \n+
    YaspEntity(const YGLI &g, const I &it)
    Definition yaspgridentity.hh:312
    \n+
    I _it
    Definition yaspgridentity.hh:399
    \n+
    YaspEntity()
    Definition yaspgridentity.hh:309
    \n+
    GridImp::template Codim< codim >::Geometry Geometry
    Definition yaspgridentity.hh:250
    \n+
    GridImp::PersistentIndexType PersistentIndexType
    Definition yaspgridentity.hh:330
    \n+
    unsigned int subEntities(unsigned int cc) const
    Definition yaspgridentity.hh:288
    \n+
    I & transformingsubiterator()
    Definition yaspgridentity.hh:395
    \n+
    Describes the minimal information necessary to create a fully functional YaspEntity.
    Definition yaspgridentityseed.hh:18
    \n+
    Iterates over entities of one grid level.
    Definition yaspgridleveliterator.hh:19
    \n+
    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
    Definition yaspgridintersectioniterator.hh:22
    \n+
    YaspHierarchicIterator enables iteration over son entities of codim 0.
    Definition yaspgridhierarchiciterator.hh:20
    \n
    Implementation of Level- and LeafIndexSets for YaspGrid.
    Definition yaspgridindexsets.hh:25
    \n-
    YaspIndexSet(const GridImp &g)
    Level grid view constructor stores reference to a grid and level.
    Definition yaspgridindexsets.hh:43
    \n-
    YaspIndexSet(const GridImp &g, int l)
    Level grid view constructor stores reference to a grid and level.
    Definition yaspgridindexsets.hh:35
    \n-
    IndexType index(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e) const
    get index of an entity
    Definition yaspgridindexsets.hh:51
    \n-
    bool contains(const EntityType &e) const
    return true if the given entity is contained in .
    Definition yaspgridindexsets.hh:82
    \n-
    std::size_t size(GeometryType type) const
    get number of entities of given type and level (the level is known to the object)
    Definition yaspgridindexsets.hh:65
    \n-
    IndexType subIndex(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    get index of subentity of an entity
    Definition yaspgridindexsets.hh:58
    \n-
    static constexpr std::array< GeometryType, 1 > types(int codim)
    obtain all geometry types of entities in domain
    Definition yaspgridindexsets.hh:90
    \n-
    std::size_t size(int codim) const
    return size of set for a given codim
    Definition yaspgridindexsets.hh:73
    \n-
    Base::IndexType IndexType
    Definition yaspgridindexsets.hh:30
    \n+
    persistent, globally unique Ids
    Definition yaspgrididset.hh:25
    \n+
    LeafIntersectionIterator ileafbegin() const
    returns intersection iterator for first intersection
    Definition yaspgridentity.hh:631
    \n+
    GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
    Definition yaspgridentity.hh:426
    \n+
    Codim< cc >::Entity subEntity(int i) const
    Definition yaspgridentity.hh:545
    \n+
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:464
    \n+
    YaspEntity(const YGLI &g, I &&it)
    Definition yaspgridentity.hh:455
    \n+
    int count() const
    Definition yaspgridentity.hh:528
    \n+
    GridImp::template Codim< 0 >::EntitySeed EntitySeed
    Definition yaspgridentity.hh:435
    \n+
    GridImp::PersistentIndexType PersistentIndexType
    define the type used for persistent indices
    Definition yaspgridentity.hh:442
    \n+
    GridImp::YGrid::iTupel iTupel
    define type used for coordinates in grid module
    Definition yaspgridentity.hh:445
    \n+
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:606
    \n+
    IntersectionIterator iend() const
    Reference to one past the last neighbor.
    Definition yaspgridentity.hh:644
    \n+
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:605
    \n+
    GridImp::ctype ctype
    Definition yaspgridentity.hh:420
    \n+
    YGLI & gridlevel()
    Definition yaspgridentity.hh:608
    \n+
    YaspEntity(const YGLI &g, const I &it)
    Definition yaspgridentity.hh:451
    \n+
    const GridImp * yaspgrid() const
    Definition yaspgridentity.hh:609
    \n+
    int level() const
    level of this element
    Definition yaspgridentity.hh:470
    \n+
    GridImp::LeafIntersectionIterator LeafIntersectionIterator
    Definition yaspgridentity.hh:438
    \n+
    YaspEntity(YGLI &&g, I &&it)
    Definition yaspgridentity.hh:459
    \n+
    PartitionType partitionType() const
    return partition type attribute
    Definition yaspgridentity.hh:480
    \n+
    LevelIntersectionIterator ilevelend() const
    Reference to one past the last neighbor.
    Definition yaspgridentity.hh:656
    \n+
    bool mightVanish() const
    Returns true, if entity might disappear during the next call to adapt()
    Definition yaspgridentity.hh:622
    \n+
    GridImp::HierarchicIterator HierarchicIterator
    Definition yaspgridentity.hh:439
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Definition yaspgridentity.hh:434
    \n+
    LevelIntersectionIterator ilevelbegin() const
    returns intersection iterator for first intersection
    Definition yaspgridentity.hh:638
    \n+
    LeafIntersectionIterator ileafend() const
    Reference to one past the last neighbor.
    Definition yaspgridentity.hh:650
    \n+
    YaspEntity()
    Definition yaspgridentity.hh:448
    \n+
    GridImp::YGrid::Iterator I
    Definition yaspgridentity.hh:423
    \n+
    GridImp::template Codim< 0 >::Geometry Geometry
    Definition yaspgridentity.hh:425
    \n+
    Geometry geometry() const
    geometry of this entity
    Definition yaspgridentity.hh:491
    \n+
    Entity father() const
    Inter-level access to father element on coarser grid. Assumes that meshes are nested.
    Definition yaspgridentity.hh:561
    \n+
    bool isNew() const
    Returns true, if the entity has been created during the last call to adapt()
    Definition yaspgridentity.hh:618
    \n+
    constexpr GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition yaspgridentity.hh:519
    \n+
    EntitySeed seed() const
    Return the entity seed which contains sufficient information to generate the entity again and uses as...
    Definition yaspgridentity.hh:475
    \n+
    HierarchicIterator hbegin(int maxlevel) const
    Definition yaspgridentity.hh:665
    \n+
    IntersectionIterator ibegin() const
    returns intersection iterator for first intersection
    Definition yaspgridentity.hh:625
    \n+
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridentity.hh:422
    \n+
    unsigned int subEntities(unsigned int codim) const
    Definition yaspgridentity.hh:537
    \n+
    LocalGeometry geometryInFather() const
    Definition yaspgridentity.hh:588
    \n+
    GridImp::LevelIntersectionIterator IntersectionIterator
    Definition yaspgridentity.hh:436
    \n+
    GridImp::LevelIntersectionIterator LevelIntersectionIterator
    Definition yaspgridentity.hh:437
    \n+
    I & transformingsubiterator()
    Definition yaspgridentity.hh:607
    \n+
    bool isLeaf() const
    Definition yaspgridentity.hh:611
    \n+
    bool hasFather() const
    returns true if father entity exists
    Definition yaspgridentity.hh:581
    \n+
    GridImp::template Codim< cd >::Entity Entity
    Definition yaspgridentity.hh:431
    \n+
    int level() const
    level of this element
    Definition yaspgridentity.hh:830
    \n+
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:824
    \n+
    YGLI & gridlevel()
    Definition yaspgridentity.hh:941
    \n+
    Geometry geometry() const
    geometry of this entity
    Definition yaspgridentity.hh:849
    \n+
    YaspEntity(const YGLI &g, const I &it)
    Definition yaspgridentity.hh:815
    \n+
    unsigned int subEntities(unsigned int cc) const
    Definition yaspgridentity.hh:843
    \n+
    PartitionType partitionType() const
    return partition type attribute
    Definition yaspgridentity.hh:863
    \n+
    GridImp::ctype ctype
    Definition yaspgridentity.hh:796
    \n+
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridentity.hh:798
    \n+
    GridImp::PersistentIndexType PersistentIndexType
    define the type used for persistent indices
    Definition yaspgridentity.hh:806
    \n+
    EntitySeed seed() const
    Return the entity seed which contains sufficient information to generate the entity again and uses as...
    Definition yaspgridentity.hh:835
    \n+
    const GridImp * yaspgrid() const
    Definition yaspgridentity.hh:943
    \n+
    constexpr GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition yaspgridentity.hh:857
    \n+
    GridImp::YGrid::Iterator I
    Definition yaspgridentity.hh:799
    \n+
    I & transformingsubiterator()
    Definition yaspgridentity.hh:940
    \n+
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:938
    \n+
    GridImp::YGrid::iTupel iTupel
    define type used for coordinates in grid module
    Definition yaspgridentity.hh:809
    \n+
    GridImp::template Codim< dim >::Geometry Geometry
    Definition yaspgridentity.hh:801
    \n+
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:939
    \n+
    YaspEntity(YGLI &&g, I &&it)
    Definition yaspgridentity.hh:819
    \n+
    YaspEntity()
    Definition yaspgridentity.hh:812
    \n+
    GridImp::template Codim< dim >::EntitySeed EntitySeed
    Definition yaspgridentity.hh:803
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,153 +1,1266 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridindexsets.hh\n+yaspgridentity.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDINDEXSET_HH\n-6#define DUNE_GRID_YASPGRIDINDEXSET_HH\n+5#ifndef DUNE_GRID_YASPGRIDENTITY_HH\n+6#define DUNE_GRID_YASPGRIDENTITY_HH\n 7\n-14namespace Dune {\n-15\n-22 template\n-23 class YaspIndexSet\n-24 : public IndexSet< GridImp, YaspIndexSet< GridImp, isLeafIndexSet >,\n-unsigned int, std::array >\n-25 {\n-26 typedef YaspIndexSet<_GridImp,_isLeafIndexSet_> This;\n-27 typedef IndexSet<_GridImp,_This,_unsigned_int,_std::array >\n-Base;\n+8#include \n+9#include \n+10\n+24//========================================================================\n+25\n+26\n+27\n 28\n-29 public:\n-30 typedef typename Base::IndexType IndexType;\n-31\n-32 using Base::subIndex;\n-33\n-35 YaspIndexSet ( const GridImp &g, int l )\n-36 : grid( g ),\n-37 level( l )\n+29namespace Dune {\n+30\n+31 namespace Yasp {\n+32\n+33#ifndef DOXYGEN\n+34\n+35 // table for quick evaluation of binomial coefficients\n+36 template\n+37 struct BinomialTable\n 38 {\n-39 assert(not isLeafIndexSet);\n-40 }\n-41\n-43 YaspIndexSet ( const GridImp &g )\n-44 : grid( g )\n-45 {\n-46 assert(isLeafIndexSet);\n-47 }\n-48\n-50 template\n-51 IndexType index (const typename std::remove_const::type::Traits::\n-template Codim::Entity& e) const\n+39 // evaluation - note that in general d!=n, n is only the\n+40 // maximum value of d (in our case dimworld)\n+41 static constexpr int evaluate(int d, int c)\n+42 {\n+43 return _values[_offsets[d] + c];\n+44 }\n+45\n+46 private:\n+47 // prevent construction\n+48 BinomialTable() = delete;\n+49\n+50 // compute binomial(r, c) and advance row `r` and column `c`\n+51 static constexpr int nextValue(int& r, int& c)\n 52 {\n-53 return e.impl().compressedIndex();\n-54 }\n-55\n-57 template< int cc >\n-58 IndexType subIndex ( const typename std::remove_const< GridImp >::type::\n-Traits::template Codim< cc >::Entity &e,\n-59 int i, unsigned int codim ) const\n-60 {\n-61 return e.impl().subCompressedIndex(i, codim);\n+53 const auto result = Dune::binomial(r, c);\n+54\n+55 c += 1;\n+56 if (c > r) {\n+57 r += 1;\n+58 c = 0;\n+59 }\n+60\n+61 return result;\n 62 }\n 63\n-65 std::size_t size (GeometryType type) const\n+64 template\n+65 static constexpr std::array computeValues(std::index_\n+sequence)\n 66 {\n-67 return (isLeafIndexSet)\n-68 ? grid.size( type )\n-69 : grid.size( level, type );\n-70 }\n-71\n-73 std::size_t size (int codim) const\n-74 {\n-75 return (isLeafIndexSet)\n-76 ? grid.size( codim )\n-77 : grid.size( level, codim );\n-78 }\n-79\n-81 template\n-82 bool contains (const EntityType& e) const\n-83 {\n-84 return (isLeafIndexSet)\n-85 ? e.level() == grid.maxLevel()\n-86 : e.level() == level;\n-87 }\n-88\n-90 static constexpr std::array types (int codim)\n-91 {\n-92 return { GeometryTypes::cube(GridImp::dimension - codim) };\n-93 }\n-94\n-95 private:\n-96 const GridImp& grid;\n-97 int level;\n-98 };\n-99\n-100} // namespace Dune\n-101\n-102#endif // DUNE_GRID_YASPGRIDINDEXSET_HH\n+67 int r = 0, c = 0;\n+68 return {{ ((void)I, nextValue(r, c))... }};\n+69 }\n+70\n+71 template\n+72 static constexpr std::array computeOffsets(std::index_\n+sequence)\n+73 { return {{ (I*(I+1)/2)... }}; }\n+74\n+75 static constexpr std::array _values = computeValues(std::\n+make_index_sequence<(n+1)*(n+2)/2>{});\n+76 static constexpr std::array _offsets = computeOffsets(std::make_\n+index_sequence{});\n+77 };\n+78\n+85 template\n+86 constexpr int subEnt(int d, int c)\n+87 {\n+88 return (d < c ? 0 : BinomialTable::evaluate(d,c) << c);\n+89 }\n+90\n+91 // Make a table mapping all subentities of a codim 0 entity to a value.\n+92 // F is the functor to be evaluated.\n+93 template\n+94 struct EntityShiftTable\n+95 {\n+96 typedef std::bitset value_type;\n+97\n+98 static value_type evaluate(int i, int codim)\n+99 {\n+100 return {_values[_offsets[codim] + i]};\n+101 }\n+102\n+103 private:\n+104\n+105 // prevent construction\n+106 EntityShiftTable() = delete;\n+107\n+108 // compute offset of codimension `codim` entities and advance `offset`\n+109 static constexpr int nextOffset(int& offset, int codim)\n+110 {\n+111 if (codim == 0) {\n+112 offset = 0;\n+113 return 0;\n+114 }\n+115\n+116 offset += subEnt(dim, codim-1);\n+117 return offset;\n+118 }\n+119\n+120 template\n+121 static constexpr std::array computeOffsets(std::index_\n+sequence)\n+122 {\n+123 int offset = 0;\n+124 return {{ (nextOffset(offset, I))... }};\n+125 }\n+126\n+127 // compute shift table entry for (`codim`, `i`) and advance `codim`, `i`\n+128 static constexpr unsigned char nextValue(int& codim, int& i)\n+129 {\n+130 const auto result = F::evaluate(i, codim);\n+131\n+132 i += 1;\n+133 if (i >= subEnt(dim, codim)) {\n+134 codim += 1;\n+135 i = 0;\n+136 }\n+137\n+138 return result;\n+139 }\n+140\n+141 template\n+142 static constexpr std::array computeValues\n+(std::index_sequence)\n+143 {\n+144 int codim = 0, i = 0;\n+145 return {{ ((void)I, nextValue(codim, i))... }};\n+146 }\n+147\n+148 static constexpr std::array _offsets = computeOffsets(std::make_\n+index_sequence{});\n+149 static constexpr std::array _values =\n+computeValues(std::make_index_sequence{});\n+150\n+151 };\n+152\n+153 // functor for doing the actual entity shift calculation\n+154 template\n+155 struct calculate_entity_shift\n+156 {\n+157 static constexpr unsigned long long evaluate(int index, int cc)\n+158 {\n+159 auto result = 0ull;\n+160 for (int d = dim; d>0; d--)\n+161 {\n+162 if (cc == d)\n+163 return result;\n+164 if (index < subEnt(d-1,cc))\n+165 result |= 1ull << (d-1);\n+166 else\n+167 {\n+168 index = (index - subEnt(d-1, cc)) % subEnt(d-1,cc-1);\n+169 cc--;\n+170 }\n+171 }\n+172 return result;\n+173 }\n+174 };\n+175\n+184 template\n+185 std::bitset entityShift(int index, int cc)\n+186 {\n+187 return EntityShiftTable,dim>::evaluate\n+(index,cc);\n+188 }\n+189\n+190 // functor for doing the actual entity move calculation\n+191 template\n+192 struct calculate_entity_move\n+193 {\n+194 static constexpr unsigned long long evaluate(int index, int cc)\n+195 {\n+196 auto result = 0ull;\n+197 for (int d = dim; d>0; d--)\n+198 {\n+199 if (d == cc)\n+200 {\n+201 // result[d-1] = index & (1<<(d-1));\n+202 result &= ~(1ull << (d-1));\n+203 result |= index & (1ull << (d-1));\n+204\n+205 index &= ~(1<<(d-1));\n+206 }\n+207 if (index >= subEnt(d-1,cc))\n+208 {\n+209 if ((index - subEnt(d-1,cc)) / subEnt(d-1,cc-1) == 1)\n+210 {\n+211 result |= 1ull << (d-1);\n+212 }\n+213 index = (index - subEnt(d-1, cc)) % subEnt(d-1,cc-1);\n+214 cc--;\n+215 }\n+216 }\n+217 return result;\n+218 }\n+219\n+220 };\n+221\n+229 template\n+230 std::bitset entityMove(int index, int cc)\n+231 {\n+232 return EntityShiftTable,dim>::evaluate\n+(index,cc);\n+233 }\n+234\n+235#endif //DOXYGEN\n+236\n+237 } // namespace Yasp.\n+238\n+239 template\n+240 class YaspEntity\n+241 : public EntityDefaultImplementation \n+242 {\n+243\n+244 template\n+245 friend class YaspLevelIterator;\n+246\n+247 public:\n+248 typedef typename GridImp::ctype ctype;\n+249\n+250 typedef typename GridImp::template Codim::Geometry Geometry;\n+251 typedef typename GridImp::Traits::template Codim::GeometryImpl\n+GeometryImpl;\n+252\n+253 typedef typename GridImp::template Codim::EntitySeed EntitySeed;\n+254\n+256 int level () const\n+257 {\n+258 return _g->level();\n+259 }\n+260\n+264 EntitySeed seed() const\n+265 {\n+266 return EntitySeed(YaspEntitySeed(_g->level(), _it.coord(), _\n+it.which()));\n+267 }\n+268\n+270 Geometry geometry () const\n+271 {\n+272 GeometryImpl _geometry(_it.lowerleft(),_it.upperright(),_it.shift());\n+273 return Geometry(_geometry);\n+274 }\n+275\n+279 constexpr GeometryType type () const\n+280 {\n+281 return GeometryTypes::cube(Geometry::mydimension);\n+282 }\n+283\n+288 unsigned int subEntities (unsigned int cc) const\n+289 {\n+290 return Dune::Yasp::subEnt(dim-codim,cc-codim);\n+291 }\n+292\n+294 PartitionType partitionType () const\n+295 {\n+296 if (_g->interior[codim].inside(_it.coord(),_it.shift()))\n+297 return InteriorEntity;\n+298 if (_g->interiorborder[codim].inside(_it.coord(),_it.shift()))\n+299 return BorderEntity;\n+300 if (_g->overlap[codim].inside(_it.coord(),_it.shift()))\n+301 return OverlapEntity;\n+302 if (_g->overlapfront[codim].inside(_it.coord(),_it.shift()))\n+303 return FrontEntity;\n+304 return GhostEntity;\n+305 }\n+306\n+307 typedef typename GridImp::YGridLevelIterator YGLI;\n+308 typedef typename GridImp::YGrid::Iterator I;\n+309 YaspEntity ()\n+310 {}\n+311\n+312 YaspEntity (const YGLI& g, const I& it)\n+313 : _it(it), _g(g)\n+314 {}\n+315\n+316 YaspEntity (YGLI&& g, const I&& it)\n+317 : _it(std::move(it)), _g(std::move(g))\n+318 {}\n+319\n+321 bool equals (const YaspEntity& e) const\n+322 {\n+323 return _it == e._it && _g == e._g;\n+324 }\n+325\n+326 // IndexSets needs access to the private index methods\n+327 friend class Dune::YaspIndexSet;\n+328 friend class Dune::YaspIndexSet;\n+329 friend class Dune::YaspGlobalIdSet;\n+330 typedef typename GridImp::PersistentIndexType PersistentIndexType;\n+331\n+333 PersistentIndexType persistentIndex () const\n+334 {\n+335 // get size of global grid (in elements)\n+336 std::array size;\n+337\n+338 for (int i=0; img->levelSize(_g->level(), i);\n+342 if (!_it.shift(i))\n+343 size[i]++;\n+344 }\n+345\n+346 // encode codim\n+347 PersistentIndexType id(_it.shift().to_ulong());\n+348\n+349 // encode level\n+350 id = id << yaspgrid_level_bits;\n+351 id = id+PersistentIndexType(_g->level());\n+352\n+353 // encode coordinates\n+354 for (int i=dim-1; i>=0; i--)\n+355 {\n+356 id = id << yaspgrid_dim_bits;\n+357 id = id+PersistentIndexType(_it.coord(i));\n+358 }\n+359\n+360 return id;\n+361 }\n+362\n+364 int compressedIndex () const\n+365 {\n+366 return _it.superindex();\n+367 }\n+368\n+370 int subCompressedIndex (int i, unsigned int cc) const\n+371 {\n+372 // get the shift of the entity and the subentity\n+373 // the subentity shift is only available in the space spanned by the entity\n+374 std::bitset subent_shift = Dune::Yasp::entityShift\n+(i,cc-codim);\n+375 std::bitset subent_move = Dune::Yasp::entityMove\n+(i,cc-codim);\n+376\n+377 std::bitset shift = _it.shift();\n+378 std::array coord = _it.coord();\n+379 for (int j=0, k=0; joverlapfront[cc].shiftmapping(shift);\n+390 return _g->overlapfront[cc].superindex(coord,which);\n+391 }\n+392 public:\n+393 const I& transformingsubiterator() const { return _it; }\n+394 const YGLI& gridlevel() const { return _g; }\n+395 I& transformingsubiterator() { return _it; }\n+396 YGLI& gridlevel() { return _g; }\n+397 const GridImp * yaspgrid() const { return _g->mg; }\n+398 protected:\n+399 I _it = {}; // position in the grid level\n+400 YGLI _g = {}; // access to grid level\n+401 };\n+402\n+403\n+404 // specialization for codim=0\n+405 template\n+406 class YaspEntity<0,dim,GridImp>\n+407 : public EntityDefaultImplementation <0,dim,GridImp,YaspEntity>\n+408 {\n+409 constexpr static int dimworld = GridImp::dimensionworld;\n+410\n+411 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl\n+GeometryImpl;\n+412\n+413 template\n+414 friend class YaspLevelIterator;\n+415\n+416 template\n+417 friend class YaspHierarchicIterator;\n+418\n+419 public:\n+420 typedef typename GridImp::ctype ctype;\n+421\n+422 typedef typename GridImp::YGridLevelIterator YGLI;\n+423 typedef typename GridImp::YGrid::Iterator I;\n+424\n+425 typedef typename GridImp::template Codim< 0 >::Geometry Geometry;\n+426 typedef typename GridImp::template Codim< 0 >::LocalGeometry LocalGeometry;\n+427\n+428 template \n+429 struct Codim\n+430 {\n+431 typedef typename GridImp::template Codim::Entity Entity;\n+432 };\n+433\n+434 typedef typename GridImp::template Codim<0>::Entity Entity;\n+435 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;\n+436 typedef typename GridImp::LevelIntersectionIterator IntersectionIterator;\n+437 typedef typename GridImp::LevelIntersectionIterator\n+LevelIntersectionIterator;\n+438 typedef typename GridImp::LeafIntersectionIterator\n+LeafIntersectionIterator;\n+439 typedef typename GridImp::HierarchicIterator HierarchicIterator;\n+440\n+442 typedef typename GridImp::PersistentIndexType PersistentIndexType;\n+443\n+445 typedef typename GridImp::YGrid::iTupel iTupel;\n+446\n+447 // constructor\n+448 YaspEntity ()\n+449 {}\n+450\n+451 YaspEntity (const YGLI& g, const I& it)\n+452 : _it(it), _g(g)\n+453 {}\n+454\n+455 YaspEntity (const YGLI& g, I&& it)\n+456 : _it(std::move(it)), _g(g)\n+457 {}\n+458\n+459 YaspEntity (YGLI&& g, I&& it)\n+460 : _it(std::move(it)), _g(std::move(g))\n+461 {}\n+462\n+464 bool equals (const YaspEntity& e) const\n+465 {\n+466 return _it == e._it && _g == e._g;\n+467 }\n+468\n+470 int level () const { return _g->level(); }\n+471\n+475 EntitySeed seed () const {\n+476 return EntitySeed(YaspEntitySeed<0,GridImp>(_g->level(), _it.coord()));\n+477 }\n+478\n+480 PartitionType partitionType () const\n+481 {\n+482 if (_g->interior[0].inside(_it.coord(),_it.shift()))\n+483 return InteriorEntity;\n+484 if (_g->overlap[0].inside(_it.coord(),_it.shift()))\n+485 return OverlapEntity;\n+486 DUNE_THROW(GridError, \"Impossible GhostEntity\");\n+487 return GhostEntity;\n+488 }\n+489\n+491 Geometry geometry () const {\n+492 // the element geometry\n+493 auto ll = _it.lowerleft();\n+494 auto ur = _it.upperright();\n+495\n+496 // If on periodic overlap, transform coordinates by domain size\n+497 for (int i=0; img->isPeriodic(i)) {\n+499 int coord = transformingsubiterator().coord(i);\n+500 if (coord < 0) {\n+501 auto size = _g->mg->domainSize()[i];\n+502 ll[i] += size;\n+503 ur[i] += size;\n+504 } else if (coord + 1 > gridlevel()->mg->levelSize(gridlevel()->level(),i))\n+{\n+505 auto size = _g->mg->domainSize()[i];\n+506 ll[i] -= size;\n+507 ur[i] -= size;\n+508 }\n+509 }\n+510 }\n+511\n+512 GeometryImpl _geometry(ll,ur);\n+513 return Geometry( _geometry );\n+514 }\n+515\n+519 constexpr GeometryType type () const\n+520 {\n+521 return GeometryTypes::cube(Geometry::mydimension);\n+522 }\n+523\n+528 template int count () const\n+529 {\n+530 return Dune::Yasp::subEnt(dim,cc);\n+531 }\n+532\n+537 unsigned int subEntities (unsigned int codim) const\n+538 {\n+539 return Dune::Yasp::subEnt(dim,codim);\n+540 }\n+541\n+544 template\n+545 typename Codim::Entity subEntity (int i) const\n+546 {\n+547 // calculate move bitset\n+548 std::bitset move = Dune::Yasp::entityMove(i,cc);\n+549\n+550 // get the coordinate and modify it\n+551 iTupel coord = _it.coord();\n+552 for (int j=0; joverlapfront[cc].shiftmapping(Dune::Yasp::entityShift\n+(i,cc));\n+557 return typename Codim::Entity(YaspEntity\n+(_g,_g->overlapfront[cc].begin(coord, which)));\n+558 }\n+559\n+561 Entity father () const\n+562 {\n+563 // check if coarse level exists\n+564 if (_g->level()<=0)\n+565 DUNE_THROW(GridError, \"tried to call father on level 0\");\n+566\n+567 // yes, get iterator to it\n+568 YGLI cg(_g);\n+569 --cg;\n+570\n+571 // coordinates of the cell\n+572 iTupel coord = _it.coord();\n+573\n+574 // get coordinates on next coarser level\n+575 for (int k=0; k(cg,cg->overlap\n+[0].begin(coord)));\n+578 }\n+579\n+581 bool hasFather () const\n+582 {\n+583 return (_g->level()>0);\n+584 }\n+585\n+588 LocalGeometry geometryInFather () const\n+589 {\n+590 // configure one of the 2^dim transformations\n+591 FieldVector ll(0.0),ur(0.5);\n+592\n+593 for (int k=0; k(ll,ur) );\n+603 }\n+604\n+605 const I& transformingsubiterator () const { return _it; }\n+606 const YGLI& gridlevel () const { return _g; }\n+607 I& transformingsubiterator() { return _it; }\n+608 YGLI& gridlevel() { return _g; }\n+609 const GridImp* yaspgrid () const { return _g->mg; }\n+610\n+611 bool isLeaf() const\n+612 {\n+613 return (_g->level() == yaspgrid()->maxLevel());\n+614 }\n+615\n+618 bool isNew () const { return yaspgrid()->adaptRefCount > 0 && yaspgrid()-\n+>maxLevel() < _g->level() + yaspgrid()->adaptRefCount; }\n+619\n+622 bool mightVanish () const { return false; }\n+623\n+625 IntersectionIterator ibegin () const\n+626 {\n+627 return YaspIntersectionIterator(*this,false);\n+628 }\n+629\n+631 LeafIntersectionIterator ileafbegin () const\n+632 {\n+633 // only if entity is leaf this iterator delivers intersections\n+634 return YaspIntersectionIterator(*this, ! isLeaf() );\n+635 }\n+636\n+638 LevelIntersectionIterator ilevelbegin () const\n+639 {\n+640 return ibegin();\n+641 }\n+642\n+644 IntersectionIterator iend () const\n+645 {\n+646 return YaspIntersectionIterator(*this,true);\n+647 }\n+648\n+650 LeafIntersectionIterator ileafend () const\n+651 {\n+652 return iend();\n+653 }\n+654\n+656 LevelIntersectionIterator ilevelend () const\n+657 {\n+658 return iend();\n+659 }\n+660\n+665 HierarchicIterator hbegin (int maxlevel) const\n+666 {\n+667 return YaspHierarchicIterator(_g,_it,maxlevel);\n+668 }\n+669\n+671 HierarchicIterator hend (int /* maxlevel */) const\n+672 {\n+673 return YaspHierarchicIterator(_g,_it,_g->level());\n+674 }\n+675\n+676 private:\n+677 // IndexSets needs access to the private index methods\n+678 friend class Dune::YaspIndexSet;\n+679 friend class Dune::YaspIndexSet;\n+680 friend class Dune::YaspGlobalIdSet;\n+681\n+683 PersistentIndexType persistentIndex () const\n+684 {\n+685 // encode codim\n+686 PersistentIndexType id(_it.shift().to_ulong());\n+687\n+688 // encode level\n+689 id = id << yaspgrid_level_bits;\n+690 id = id+PersistentIndexType(_g->level());\n+691\n+692\n+693 // encode coordinates\n+694 for (int i=dim-1; i>=0; i--)\n+695 {\n+696 id = id << yaspgrid_dim_bits;\n+697 id = id+PersistentIndexType(_it.coord(i));\n+698 }\n+699\n+700 return id;\n+701 }\n+702\n+704 int compressedIndex () const\n+705 {\n+706 return _it.superindex();\n+707 }\n+708\n+710 PersistentIndexType subPersistentIndex (int i, int cc) const\n+711 {\n+712 // calculate shift and move bitsets\n+713 std::bitset shift = Dune::Yasp::entityShift(i,cc);\n+714 std::bitset move = Dune::Yasp::entityMove(i,cc);\n+715\n+716 int trailing = (cc == dim) ? 1000 : 0;\n+717\n+718 std::array size = _g->mg->levelSize(_g->level());\n+719 std::array coord = _it.coord();\n+720 for (int j=0; jlevel(); k++)\n+738 if (coord[j] & (1<level()-trailing);\n+752\n+753 // encode coordinates\n+754 for (int j=dim-1; j>=0; j--)\n+755 {\n+756 id = id << yaspgrid_dim_bits;\n+757 id = id+PersistentIndexType(coord[j]>>trailing);\n+758 }\n+759\n+760 return id;\n+761 }\n+762\n+764 int subCompressedIndex (int i, int cc) const\n+765 {\n+766 // get shift and move of the subentity in question\n+767 std::bitset shift = Dune::Yasp::entityShift(i,cc);\n+768 std::bitset move = Dune::Yasp::entityMove(i,cc);\n+769\n+770 std::array coord = _it.coord();\n+771 for (int j=0; joverlapfront[cc].shiftmapping(shift);\n+775 return _g->overlapfront[cc].superindex(coord,which);\n+776 }\n+777\n+778 I _it = {}; // position in the grid level\n+779 YGLI _g = {}; // access to grid level\n+780 };\n+781\n+782\n+783 // specialization for codim=dim (vertex)\n+784 template\n+785 class YaspEntity\n+786 : public EntityDefaultImplementation \n+787 {\n+788 constexpr static int dimworld = GridImp::dimensionworld;\n+789\n+790 template\n+791 friend class YaspLevelIterator;\n+792\n+793 typedef typename GridImp::Traits::template Codim::GeometryImpl\n+GeometryImpl;\n+794\n+795 public:\n+796 typedef typename GridImp::ctype ctype;\n+797\n+798 typedef typename GridImp::YGridLevelIterator YGLI;\n+799 typedef typename GridImp::YGrid::Iterator I;\n+800\n+801 typedef typename GridImp::template Codim::Geometry Geometry;\n+802\n+803 typedef typename GridImp::template Codim::EntitySeed EntitySeed;\n+804\n+806 typedef typename GridImp::PersistentIndexType PersistentIndexType;\n+807\n+809 typedef typename GridImp::YGrid::iTupel iTupel;\n+810\n+811 // constructor\n+812 YaspEntity ()\n+813 {}\n+814\n+815 YaspEntity (const YGLI& g, const I& it)\n+816 : _it(it), _g(g)\n+817 {}\n+818\n+819 YaspEntity (YGLI&& g, I&& it)\n+820 : _it(std::move(it)), _g(std::move(g))\n+821 {}\n+822\n+824 bool equals (const YaspEntity& e) const\n+825 {\n+826 return _it == e._it && _g == e._g;\n+827 }\n+828\n+830 int level () const {return _g->level();}\n+831\n+835 EntitySeed seed () const {\n+836 return EntitySeed(YaspEntitySeed(_g->level(), _it.coord(), _\n+it.which()));\n+837 }\n+838\n+843 unsigned int subEntities (unsigned int cc) const\n+844 {\n+845 return Dune::Yasp::subEnt(dim-dim,cc-dim);\n+846 }\n+847\n+849 Geometry geometry () const {\n+850 GeometryImpl _geometry((_it).lowerleft());\n+851 return Geometry( _geometry );\n+852 }\n+853\n+857 constexpr GeometryType type () const\n+858 {\n+859 return GeometryTypes::cube(Geometry::mydimension);\n+860 }\n+861\n+863 PartitionType partitionType () const\n+864 {\n+865 if (_g->interior[dim].inside(_it.coord(),_it.shift()))\n+866 return InteriorEntity;\n+867 if (_g->interiorborder[dim].inside(_it.coord(),_it.shift()))\n+868 return BorderEntity;\n+869 if (_g->overlap[dim].inside(_it.coord(),_it.shift()))\n+870 return OverlapEntity;\n+871 if (_g->overlapfront[dim].inside(_it.coord(),_it.shift()))\n+872 return FrontEntity;\n+873 return GhostEntity;\n+874 }\n+875\n+877 int subCompressedIndex (int, unsigned int ) const\n+878 {\n+879 return compressedIndex();\n+880 }\n+881\n+882 private:\n+883 // IndexSets needs access to the private index methods\n+884 friend class Dune::YaspIndexSet;\n+885 friend class Dune::YaspIndexSet;\n+886 friend class Dune::YaspGlobalIdSet;\n+887\n+889 PersistentIndexType persistentIndex () const\n+890 {\n+891 // get coordinate and size of global grid\n+892 iTupel size = _g->mg->levelSize(_g->level());\n+893\n+894 for (int i=0; ilevel(); j++)\n+907 if (_it.coord(i)&(1<level()-trailing;\n+916\n+917 // encode codim: shift vector of vertices is 0.\n+918 PersistentIndexType id(0);\n+919\n+920 // encode level\n+921 id = id << yaspgrid_level_bits;\n+922 id = id+PersistentIndexType(level);\n+923\n+924 // encode coordinates\n+925 for (int i=dim-1; i>=0; i--)\n+926 {\n+927 id = id << yaspgrid_dim_bits;\n+928 id = id+PersistentIndexType(_it.coord(i)>>trailing);\n+929 }\n+930\n+931 return id;\n+932 }\n+933\n+935 int compressedIndex () const { return _it.superindex();}\n+936\n+937 public:\n+938 const I& transformingsubiterator() const { return _it; }\n+939 const YGLI& gridlevel() const { return _g; }\n+940 I& transformingsubiterator() { return _it; }\n+941 YGLI& gridlevel() { return _g; }\n+942\n+943 const GridImp * yaspgrid() const { return _g->mg; }\n+944 protected:\n+945 I _it = {}; // position in the grid level\n+946 YGLI _g = {}; // access to grid level\n+947 };\n+948\n+949} // namespace Dune\n+950\n+951#endif // DUNE_GRID_YASPGRIDENTITY_HH\n+Dune::PartitionType\n+PartitionType\n+Attributes used in the generic overlap model.\n+Definition gridenums.hh:30\n+Dune::FrontEntity\n+@ FrontEntity\n+on boundary between overlap and ghost\n+Definition gridenums.hh:34\n+Dune::InteriorEntity\n+@ InteriorEntity\n+all interior entities\n+Definition gridenums.hh:31\n+Dune::GhostEntity\n+@ GhostEntity\n+ghost entities\n+Definition gridenums.hh:35\n+Dune::BorderEntity\n+@ BorderEntity\n+on boundary between interior and overlap\n+Definition gridenums.hh:32\n+Dune::OverlapEntity\n+@ OverlapEntity\n+all entities lying in the overlap zone\n+Definition gridenums.hh:33\n+std\n+STL namespace.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IndexSet\n-Index Set Interface base class.\n-Definition common/indexidset.hh:78\n-Dune::IndexSet::subIndex\n-IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int\n-i, unsigned int codim) const\n-Map a subentity to an index.\n-Definition common/indexidset.hh:153\n-Dune::IndexSet::Codim\n-Export the type of the entity used as parameter in the index(...) method.\n-Definition common/indexidset.hh:87\n+Dune::yaspgrid_level_bits\n+const int yaspgrid_level_bits\n+Definition yaspgrid.hh:48\n+Dune::yaspgrid_dim_bits\n+const int yaspgrid_dim_bits\n+Definition yaspgrid.hh:47\n+Dune::EntityDefaultImplementation\n+Default Implementations for EntityImp.\n+Definition common/entity.hh:542\n+Dune::GridError\n+Base class for exceptions in Dune grid modules.\n+Definition exceptions.hh:20\n+Dune::Geometry::mydimension\n+static constexpr int mydimension\n+geometry dimension\n+Definition common/geometry.hh:94\n+Dune::YaspGeometry\n+The general version that handles all codimensions but 0 and dim.\n+Definition yaspgridgeometry.hh:31\n+Dune::YaspEntity\n+Definition yaspgridentity.hh:242\n+Dune::YaspEntity::level\n+int level() const\n+level of this element\n+Definition yaspgridentity.hh:256\n+Dune::YaspEntity::geometry\n+Geometry geometry() const\n+geometry of this entity\n+Definition yaspgridentity.hh:270\n+Dune::YaspEntity::ctype\n+GridImp::ctype ctype\n+Definition yaspgridentity.hh:248\n+Dune::YaspEntity::type\n+constexpr GeometryType type() const\n+Return the name of the reference element. The type can be used to access the\n+Dune::ReferenceElement.\n+Definition yaspgridentity.hh:279\n+Dune::YaspEntity::persistentIndex\n+PersistentIndexType persistentIndex() const\n+globally unique, persistent index\n+Definition yaspgridentity.hh:333\n+Dune::YaspEntity::gridlevel\n+const YGLI & gridlevel() const\n+Definition yaspgridentity.hh:394\n+Dune::YaspEntity::transformingsubiterator\n+const I & transformingsubiterator() const\n+Definition yaspgridentity.hh:393\n+Dune::YaspEntity::_g\n+YGLI _g\n+Definition yaspgridentity.hh:400\n+Dune::YaspEntity::equals\n+bool equals(const YaspEntity &e) const\n+Return true when two iterators over the same grid are equal (!).\n+Definition yaspgridentity.hh:321\n+Dune::YaspEntity::partitionType\n+PartitionType partitionType() const\n+return partition type attribute\n+Definition yaspgridentity.hh:294\n+Dune::YaspEntity::GeometryImpl\n+GridImp::Traits::template Codim< codim >::GeometryImpl GeometryImpl\n+Definition yaspgridentity.hh:251\n+Dune::YaspEntity::gridlevel\n+YGLI & gridlevel()\n+Definition yaspgridentity.hh:396\n+Dune::YaspEntity::subCompressedIndex\n+int subCompressedIndex(int i, unsigned int cc) const\n+subentity compressed index\n+Definition yaspgridentity.hh:370\n+Dune::YaspEntity::YGLI\n+GridImp::YGridLevelIterator YGLI\n+Definition yaspgridentity.hh:307\n+Dune::YaspEntity::I\n+GridImp::YGrid::Iterator I\n+Definition yaspgridentity.hh:308\n+Dune::YaspEntity::yaspgrid\n+const GridImp * yaspgrid() const\n+Definition yaspgridentity.hh:397\n+Dune::YaspEntity::EntitySeed\n+GridImp::template Codim< codim >::EntitySeed EntitySeed\n+Definition yaspgridentity.hh:253\n+Dune::YaspEntity::YaspEntity\n+YaspEntity(YGLI &&g, const I &&it)\n+Definition yaspgridentity.hh:316\n+Dune::YaspEntity::seed\n+EntitySeed seed() const\n+Return the entity seed which contains sufficient information to generate the\n+entity again and uses as...\n+Definition yaspgridentity.hh:264\n+Dune::YaspEntity::compressedIndex\n+int compressedIndex() const\n+consecutive, codim-wise, level-wise index\n+Definition yaspgridentity.hh:364\n+Dune::YaspEntity::YaspEntity\n+YaspEntity(const YGLI &g, const I &it)\n+Definition yaspgridentity.hh:312\n+Dune::YaspEntity::_it\n+I _it\n+Definition yaspgridentity.hh:399\n+Dune::YaspEntity::YaspEntity\n+YaspEntity()\n+Definition yaspgridentity.hh:309\n+Dune::YaspEntity::Geometry\n+GridImp::template Codim< codim >::Geometry Geometry\n+Definition yaspgridentity.hh:250\n+Dune::YaspEntity::PersistentIndexType\n+GridImp::PersistentIndexType PersistentIndexType\n+Definition yaspgridentity.hh:330\n+Dune::YaspEntity::subEntities\n+unsigned int subEntities(unsigned int cc) const\n+Definition yaspgridentity.hh:288\n+Dune::YaspEntity::transformingsubiterator\n+I & transformingsubiterator()\n+Definition yaspgridentity.hh:395\n+Dune::YaspEntitySeed\n+Describes the minimal information necessary to create a fully functional\n+YaspEntity.\n+Definition yaspgridentityseed.hh:18\n+Dune::YaspLevelIterator\n+Iterates over entities of one grid level.\n+Definition yaspgridleveliterator.hh:19\n+Dune::YaspIntersectionIterator\n+YaspIntersectionIterator enables iteration over intersections with neighboring\n+codim 0 entities.\n+Definition yaspgridintersectioniterator.hh:22\n+Dune::YaspHierarchicIterator\n+YaspHierarchicIterator enables iteration over son entities of codim 0.\n+Definition yaspgridhierarchiciterator.hh:20\n Dune::YaspIndexSet\n Implementation of Level- and LeafIndexSets for YaspGrid.\n Definition yaspgridindexsets.hh:25\n-Dune::YaspIndexSet::YaspIndexSet\n-YaspIndexSet(const GridImp &g)\n-Level grid view constructor stores reference to a grid and level.\n-Definition yaspgridindexsets.hh:43\n-Dune::YaspIndexSet::YaspIndexSet\n-YaspIndexSet(const GridImp &g, int l)\n-Level grid view constructor stores reference to a grid and level.\n-Definition yaspgridindexsets.hh:35\n-Dune::YaspIndexSet::index\n-IndexType index(const typename std::remove_const< GridImp >::type::Traits::\n-template Codim< cc >::Entity &e) const\n-get index of an entity\n-Definition yaspgridindexsets.hh:51\n-Dune::YaspIndexSet::contains\n-bool contains(const EntityType &e) const\n-return true if the given entity is contained in .\n-Definition yaspgridindexsets.hh:82\n-Dune::YaspIndexSet::size\n-std::size_t size(GeometryType type) const\n-get number of entities of given type and level (the level is known to the\n-object)\n-Definition yaspgridindexsets.hh:65\n-Dune::YaspIndexSet::subIndex\n-IndexType subIndex(const typename std::remove_const< GridImp >::type::Traits::\n-template Codim< cc >::Entity &e, int i, unsigned int codim) const\n-get index of subentity of an entity\n-Definition yaspgridindexsets.hh:58\n-Dune::YaspIndexSet::types\n-static constexpr std::array< GeometryType, 1 > types(int codim)\n-obtain all geometry types of entities in domain\n-Definition yaspgridindexsets.hh:90\n-Dune::YaspIndexSet::size\n-std::size_t size(int codim) const\n-return size of set for a given codim\n-Definition yaspgridindexsets.hh:73\n-Dune::YaspIndexSet::IndexType\n-Base::IndexType IndexType\n-Definition yaspgridindexsets.hh:30\n+Dune::YaspGlobalIdSet\n+persistent, globally unique Ids\n+Definition yaspgrididset.hh:25\n+Dune::YaspEntity<_0,_dim,_GridImp_>::ileafbegin\n+LeafIntersectionIterator ileafbegin() const\n+returns intersection iterator for first intersection\n+Definition yaspgridentity.hh:631\n+Dune::YaspEntity<_0,_dim,_GridImp_>::LocalGeometry\n+GridImp::template Codim< 0 >::LocalGeometry LocalGeometry\n+Definition yaspgridentity.hh:426\n+Dune::YaspEntity<_0,_dim,_GridImp_>::subEntity\n+Codim< cc >::Entity subEntity(int i) const\n+Definition yaspgridentity.hh:545\n+Dune::YaspEntity<_0,_dim,_GridImp_>::equals\n+bool equals(const YaspEntity &e) const\n+Return true when two iterators over the same grid are equal (!).\n+Definition yaspgridentity.hh:464\n+Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n+YaspEntity(const YGLI &g, I &&it)\n+Definition yaspgridentity.hh:455\n+Dune::YaspEntity<_0,_dim,_GridImp_>::count\n+int count() const\n+Definition yaspgridentity.hh:528\n+Dune::YaspEntity<_0,_dim,_GridImp_>::EntitySeed\n+GridImp::template Codim< 0 >::EntitySeed EntitySeed\n+Definition yaspgridentity.hh:435\n+Dune::YaspEntity<_0,_dim,_GridImp_>::PersistentIndexType\n+GridImp::PersistentIndexType PersistentIndexType\n+define the type used for persistent indices\n+Definition yaspgridentity.hh:442\n+Dune::YaspEntity<_0,_dim,_GridImp_>::iTupel\n+GridImp::YGrid::iTupel iTupel\n+define type used for coordinates in grid module\n+Definition yaspgridentity.hh:445\n+Dune::YaspEntity<_0,_dim,_GridImp_>::gridlevel\n+const YGLI & gridlevel() const\n+Definition yaspgridentity.hh:606\n+Dune::YaspEntity<_0,_dim,_GridImp_>::iend\n+IntersectionIterator iend() const\n+Reference to one past the last neighbor.\n+Definition yaspgridentity.hh:644\n+Dune::YaspEntity<_0,_dim,_GridImp_>::transformingsubiterator\n+const I & transformingsubiterator() const\n+Definition yaspgridentity.hh:605\n+Dune::YaspEntity<_0,_dim,_GridImp_>::ctype\n+GridImp::ctype ctype\n+Definition yaspgridentity.hh:420\n+Dune::YaspEntity<_0,_dim,_GridImp_>::gridlevel\n+YGLI & gridlevel()\n+Definition yaspgridentity.hh:608\n+Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n+YaspEntity(const YGLI &g, const I &it)\n+Definition yaspgridentity.hh:451\n+Dune::YaspEntity<_0,_dim,_GridImp_>::yaspgrid\n+const GridImp * yaspgrid() const\n+Definition yaspgridentity.hh:609\n+Dune::YaspEntity<_0,_dim,_GridImp_>::level\n+int level() const\n+level of this element\n+Definition yaspgridentity.hh:470\n+Dune::YaspEntity<_0,_dim,_GridImp_>::LeafIntersectionIterator\n+GridImp::LeafIntersectionIterator LeafIntersectionIterator\n+Definition yaspgridentity.hh:438\n+Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n+YaspEntity(YGLI &&g, I &&it)\n+Definition yaspgridentity.hh:459\n+Dune::YaspEntity<_0,_dim,_GridImp_>::partitionType\n+PartitionType partitionType() const\n+return partition type attribute\n+Definition yaspgridentity.hh:480\n+Dune::YaspEntity<_0,_dim,_GridImp_>::ilevelend\n+LevelIntersectionIterator ilevelend() const\n+Reference to one past the last neighbor.\n+Definition yaspgridentity.hh:656\n+Dune::YaspEntity<_0,_dim,_GridImp_>::mightVanish\n+bool mightVanish() const\n+Returns true, if entity might disappear during the next call to adapt()\n+Definition yaspgridentity.hh:622\n+Dune::YaspEntity<_0,_dim,_GridImp_>::HierarchicIterator\n+GridImp::HierarchicIterator HierarchicIterator\n+Definition yaspgridentity.hh:439\n+Dune::YaspEntity<_0,_dim,_GridImp_>::Entity\n+GridImp::template Codim< 0 >::Entity Entity\n+Definition yaspgridentity.hh:434\n+Dune::YaspEntity<_0,_dim,_GridImp_>::ilevelbegin\n+LevelIntersectionIterator ilevelbegin() const\n+returns intersection iterator for first intersection\n+Definition yaspgridentity.hh:638\n+Dune::YaspEntity<_0,_dim,_GridImp_>::ileafend\n+LeafIntersectionIterator ileafend() const\n+Reference to one past the last neighbor.\n+Definition yaspgridentity.hh:650\n+Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n+YaspEntity()\n+Definition yaspgridentity.hh:448\n+Dune::YaspEntity<_0,_dim,_GridImp_>::I\n+GridImp::YGrid::Iterator I\n+Definition yaspgridentity.hh:423\n+Dune::YaspEntity<_0,_dim,_GridImp_>::Geometry\n+GridImp::template Codim< 0 >::Geometry Geometry\n+Definition yaspgridentity.hh:425\n+Dune::YaspEntity<_0,_dim,_GridImp_>::geometry\n+Geometry geometry() const\n+geometry of this entity\n+Definition yaspgridentity.hh:491\n+Dune::YaspEntity<_0,_dim,_GridImp_>::father\n+Entity father() const\n+Inter-level access to father element on coarser grid. Assumes that meshes are\n+nested.\n+Definition yaspgridentity.hh:561\n+Dune::YaspEntity<_0,_dim,_GridImp_>::isNew\n+bool isNew() const\n+Returns true, if the entity has been created during the last call to adapt()\n+Definition yaspgridentity.hh:618\n+Dune::YaspEntity<_0,_dim,_GridImp_>::type\n+constexpr GeometryType type() const\n+Return the name of the reference element. The type can be used to access the\n+Dune::ReferenceElement.\n+Definition yaspgridentity.hh:519\n+Dune::YaspEntity<_0,_dim,_GridImp_>::seed\n+EntitySeed seed() const\n+Return the entity seed which contains sufficient information to generate the\n+entity again and uses as...\n+Definition yaspgridentity.hh:475\n+Dune::YaspEntity<_0,_dim,_GridImp_>::hbegin\n+HierarchicIterator hbegin(int maxlevel) const\n+Definition yaspgridentity.hh:665\n+Dune::YaspEntity<_0,_dim,_GridImp_>::ibegin\n+IntersectionIterator ibegin() const\n+returns intersection iterator for first intersection\n+Definition yaspgridentity.hh:625\n+Dune::YaspEntity<_0,_dim,_GridImp_>::YGLI\n+GridImp::YGridLevelIterator YGLI\n+Definition yaspgridentity.hh:422\n+Dune::YaspEntity<_0,_dim,_GridImp_>::subEntities\n+unsigned int subEntities(unsigned int codim) const\n+Definition yaspgridentity.hh:537\n+Dune::YaspEntity<_0,_dim,_GridImp_>::geometryInFather\n+LocalGeometry geometryInFather() const\n+Definition yaspgridentity.hh:588\n+Dune::YaspEntity<_0,_dim,_GridImp_>::IntersectionIterator\n+GridImp::LevelIntersectionIterator IntersectionIterator\n+Definition yaspgridentity.hh:436\n+Dune::YaspEntity<_0,_dim,_GridImp_>::LevelIntersectionIterator\n+GridImp::LevelIntersectionIterator LevelIntersectionIterator\n+Definition yaspgridentity.hh:437\n+Dune::YaspEntity<_0,_dim,_GridImp_>::transformingsubiterator\n+I & transformingsubiterator()\n+Definition yaspgridentity.hh:607\n+Dune::YaspEntity<_0,_dim,_GridImp_>::isLeaf\n+bool isLeaf() const\n+Definition yaspgridentity.hh:611\n+Dune::YaspEntity<_0,_dim,_GridImp_>::hasFather\n+bool hasFather() const\n+returns true if father entity exists\n+Definition yaspgridentity.hh:581\n+Dune::YaspEntity<_0,_dim,_GridImp_>::Codim::Entity\n+GridImp::template Codim< cd >::Entity Entity\n+Definition yaspgridentity.hh:431\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::level\n+int level() const\n+level of this element\n+Definition yaspgridentity.hh:830\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::equals\n+bool equals(const YaspEntity &e) const\n+Return true when two iterators over the same grid are equal (!).\n+Definition yaspgridentity.hh:824\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::gridlevel\n+YGLI & gridlevel()\n+Definition yaspgridentity.hh:941\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::geometry\n+Geometry geometry() const\n+geometry of this entity\n+Definition yaspgridentity.hh:849\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::YaspEntity\n+YaspEntity(const YGLI &g, const I &it)\n+Definition yaspgridentity.hh:815\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::subEntities\n+unsigned int subEntities(unsigned int cc) const\n+Definition yaspgridentity.hh:843\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::partitionType\n+PartitionType partitionType() const\n+return partition type attribute\n+Definition yaspgridentity.hh:863\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::ctype\n+GridImp::ctype ctype\n+Definition yaspgridentity.hh:796\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::YGLI\n+GridImp::YGridLevelIterator YGLI\n+Definition yaspgridentity.hh:798\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::PersistentIndexType\n+GridImp::PersistentIndexType PersistentIndexType\n+define the type used for persistent indices\n+Definition yaspgridentity.hh:806\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::seed\n+EntitySeed seed() const\n+Return the entity seed which contains sufficient information to generate the\n+entity again and uses as...\n+Definition yaspgridentity.hh:835\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::yaspgrid\n+const GridImp * yaspgrid() const\n+Definition yaspgridentity.hh:943\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::type\n+constexpr GeometryType type() const\n+Return the name of the reference element. The type can be used to access the\n+Dune::ReferenceElement.\n+Definition yaspgridentity.hh:857\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::I\n+GridImp::YGrid::Iterator I\n+Definition yaspgridentity.hh:799\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::transformingsubiterator\n+I & transformingsubiterator()\n+Definition yaspgridentity.hh:940\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::transformingsubiterator\n+const I & transformingsubiterator() const\n+Definition yaspgridentity.hh:938\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::iTupel\n+GridImp::YGrid::iTupel iTupel\n+define type used for coordinates in grid module\n+Definition yaspgridentity.hh:809\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::Geometry\n+GridImp::template Codim< dim >::Geometry Geometry\n+Definition yaspgridentity.hh:801\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::gridlevel\n+const YGLI & gridlevel() const\n+Definition yaspgridentity.hh:939\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::YaspEntity\n+YaspEntity(YGLI &&g, I &&it)\n+Definition yaspgridentity.hh:819\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::YaspEntity\n+YaspEntity()\n+Definition yaspgridentity.hh:812\n+Dune::YaspEntity<_dim,_dim,_GridImp_>::EntitySeed\n+GridImp::template Codim< dim >::EntitySeed EntitySeed\n+Definition yaspgridentity.hh:803\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00179.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00179.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridleveliterator.hh File Reference\n+dune-grid: yaspgridintersectioniterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,38 @@\n
  • dune
  • grid
  • yaspgrid
  • \n
    \n
    \n
    \n \n-
    yaspgridleveliterator.hh File Reference
    \n+
    yaspgridintersectioniterator.hh File Reference
    \n
    \n
    \n \n-

    The YaspLevelIterator class. \n+

    The YaspIntersectionIterator class. \n More...

    \n \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspLevelIterator< codim, pitype, GridImp >
     Iterates over entities of one grid level. More...
    class  Dune::YaspIntersectionIterator< GridImp >
     YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The YaspLevelIterator class.

    \n+

    The YaspIntersectionIterator class.

    \n+

    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,22 +2,25 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridleveliterator.hh File Reference\n-The YaspLevelIterator class. More...\n+yaspgridintersectioniterator.hh File Reference\n+The YaspIntersectionIterator class. More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspLevelIterator<_codim,_pitype,_GridImp_>\n-\u00a0 Iterates over entities of one grid level. More...\n+class \u00a0 Dune::YaspIntersectionIterator<_GridImp_>\n+\u00a0 YaspIntersectionIterator enables iteration over intersections with\n+ neighboring codim 0 entities. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The YaspLevelIterator class.\n+The YaspIntersectionIterator class.\n+YaspIntersectionIterator enables iteration over intersections with neighboring\n+codim 0 entities.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00179_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00179_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridleveliterator.hh Source File\n+dune-grid: yaspgridintersectioniterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,91 +74,107 @@\n \n \n
    \n
    \n-
    yaspgridleveliterator.hh
    \n+
    yaspgridintersectioniterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDLEVELITERATOR_HH
    \n-
    6#define DUNE_GRID_YASPGRIDLEVELITERATOR_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
    \n+
    6#define DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
    \n
    7
    \n-
    12namespace Dune {
    \n-
    13
    \n-
    14
    \n-
    17 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n-
    \n-\n-
    19 {
    \n-
    21 constexpr static int dim = GridImp::dimension;
    \n-
    23 constexpr static int dimworld = GridImp::dimensionworld;
    \n-
    24 typedef typename GridImp::ctype ctype;
    \n-
    25 public:
    \n-
    26 typedef typename GridImp::template Codim<codim>::Entity Entity;
    \n-
    27 typedef typename GridImp::YGridLevelIterator YGLI;
    \n-
    28 typedef typename GridImp::YGrid::Iterator I;
    \n-
    29
    \n-
    \n-\n-
    32 {}
    \n-
    \n-
    33
    \n-
    \n-
    35 YaspLevelIterator (const YGLI & g, const I& it)
    \n-
    36 : _entity(YaspEntity<codim, dim, GridImp>(g,it))
    \n-
    37 {}
    \n-
    \n-
    38
    \n-
    \n-
    40 void increment()
    \n-
    41 {
    \n-
    42 ++(_entity.impl()._it);
    \n-
    43 }
    \n-
    \n-
    44
    \n-
    \n-
    46 bool equals (const YaspLevelIterator& rhs) const
    \n-
    47 {
    \n-
    48 return (_entity == rhs._entity);
    \n-
    49 }
    \n+
    15namespace Dune {
    \n+
    16
    \n+
    20 template<class GridImp>
    \n+
    \n+\n+
    22 {
    \n+
    23 constexpr static int dim = GridImp::dimension;
    \n+
    24 public:
    \n+
    25 // types used from grids
    \n+\n+\n+
    28
    \n+
    \n+
    30 void increment()
    \n+
    31 {
    \n+
    32 intersection_.impl()._count += (intersection_.impl()._count < 2*dim);
    \n+
    33 }
    \n+
    \n+
    34
    \n+
    \n+
    36 bool equals (const YaspIntersectionIterator& other) const
    \n+
    37 {
    \n+
    38 return intersection_ == other.intersection_;
    \n+
    39 }
    \n+
    \n+
    40
    \n+
    \n+
    42 const Intersection & dereference() const
    \n+
    43 {
    \n+
    44 intersection_.impl().update();
    \n+
    45 return intersection_;
    \n+
    46 }
    \n+
    \n+
    47
    \n+
    \n+\n+
    49 {}
    \n
    \n
    50
    \n
    \n-
    52 const Entity& dereference() const
    \n-
    53 {
    \n-
    54 return _entity;
    \n-
    55 }
    \n-
    \n-
    56
    \n-
    57 protected:
    \n-\n-
    59 };
    \n+\n+
    53 : intersection_(IntersectionImp(myself, toend))
    \n+
    54 {}
    \n+
    \n+
    55
    \n+
    \n+\n+
    58 : intersection_(other.intersection_)
    \n+
    59 {}
    \n
    \n
    60
    \n-
    61}
    \n-
    62
    \n-
    63#endif // DUNE_GRID_YASPGRIDLEVELITERATOR_HH
    \n+
    \n+\n+
    63 {
    \n+
    64 intersection_ = other.intersection_;
    \n+
    65 return *this;
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    68 private:
    \n+
    69 // The intersection this iterator points to
    \n+
    70 mutable Intersection intersection_;
    \n+
    71 };
    \n+
    \n+
    72
    \n+
    73} // namespace Dune
    \n+
    74
    \n+
    75#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    Implementation & impl()
    access to the underlying implementation
    Definition common/intersection.hh:178
    \n
    Definition yaspgridentity.hh:242
    \n-
    Iterates over entities of one grid level.
    Definition yaspgridleveliterator.hh:19
    \n-
    Entity _entity
    entity
    Definition yaspgridleveliterator.hh:58
    \n-
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridleveliterator.hh:27
    \n-
    GridImp::template Codim< codim >::Entity Entity
    Definition yaspgridleveliterator.hh:26
    \n-
    void increment()
    increment
    Definition yaspgridleveliterator.hh:40
    \n-
    GridImp::YGrid::Iterator I
    Definition yaspgridleveliterator.hh:28
    \n-
    YaspLevelIterator(const YGLI &g, const I &it)
    constructor
    Definition yaspgridleveliterator.hh:35
    \n-
    bool equals(const YaspLevelIterator &rhs) const
    equality
    Definition yaspgridleveliterator.hh:46
    \n-
    YaspLevelIterator()
    default constructor
    Definition yaspgridleveliterator.hh:31
    \n-
    const Entity & dereference() const
    dereferencing
    Definition yaspgridleveliterator.hh:52
    \n+
    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
    Definition yaspgridintersectioniterator.hh:22
    \n+
    const Intersection & dereference() const
    dereferencing
    Definition yaspgridintersectioniterator.hh:42
    \n+
    YaspIntersectionIterator(const YaspIntersectionIterator &other)
    copy constructor
    Definition yaspgridintersectioniterator.hh:57
    \n+
    Dune::YaspIntersection< GridImp > IntersectionImp
    Definition yaspgridintersectioniterator.hh:26
    \n+
    Dune::Intersection< GridImp, IntersectionImp > Intersection
    Definition yaspgridintersectioniterator.hh:27
    \n+
    void increment()
    increment
    Definition yaspgridintersectioniterator.hh:30
    \n+
    YaspIntersectionIterator & operator=(const YaspIntersectionIterator &other)
    assignment
    Definition yaspgridintersectioniterator.hh:62
    \n+
    YaspIntersectionIterator(const YaspEntity< 0, dim, GridImp > &myself, bool toend)
    make intersection iterator from entity
    Definition yaspgridintersectioniterator.hh:52
    \n+
    bool equals(const YaspIntersectionIterator &other) const
    equality
    Definition yaspgridintersectioniterator.hh:36
    \n+
    YaspIntersectionIterator()
    Definition yaspgridintersectioniterator.hh:48
    \n+
    YaspIntersection provides data about intersection with neighboring codim 0 entities.
    Definition yaspgridintersection.hh:22
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,103 +1,128 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridleveliterator.hh\n+yaspgridintersectioniterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDLEVELITERATOR_HH\n-6#define DUNE_GRID_YASPGRIDLEVELITERATOR_HH\n+5#ifndef DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH\n+6#define DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH\n 7\n-12namespace Dune {\n-13\n-14\n-17 template\n-18 class YaspLevelIterator\n-19 {\n-21 constexpr static int dim = GridImp::dimension;\n-23 constexpr static int dimworld = GridImp::dimensionworld;\n-24 typedef typename GridImp::ctype ctype;\n-25 public:\n-26 typedef typename GridImp::template Codim::Entity Entity;\n-27 typedef typename GridImp::YGridLevelIterator YGLI;\n-28 typedef typename GridImp::YGrid::Iterator I;\n-29\n-31 YaspLevelIterator ()\n-32 {}\n-33\n-35 YaspLevelIterator (const YGLI & g, const I& it)\n-36 : _entity(YaspEntity(g,it))\n-37 {}\n-38\n-40 void increment()\n-41 {\n-42 ++(_entity.impl()._it);\n-43 }\n-44\n-46 bool equals (const YaspLevelIterator& rhs) const\n-47 {\n-48 return (_entity == rhs._entity);\n-49 }\n+15namespace Dune {\n+16\n+20 template\n+21 class YaspIntersectionIterator\n+22 {\n+23 constexpr static int dim = GridImp::dimension;\n+24 public:\n+25 // types used from grids\n+26 typedef Dune::YaspIntersection<_GridImp_> IntersectionImp;\n+27 typedef Dune::Intersection<_GridImp,_IntersectionImp_> Intersection;\n+28\n+30 void increment()\n+31 {\n+32 intersection_.impl()._count += (intersection_.impl()._count < 2*dim);\n+33 }\n+34\n+36 bool equals (const YaspIntersectionIterator& other) const\n+37 {\n+38 return intersection_ == other.intersection_;\n+39 }\n+40\n+42 const Intersection & dereference() const\n+43 {\n+44 intersection_.impl().update();\n+45 return intersection_;\n+46 }\n+47\n+48 YaspIntersectionIterator()\n+49 {}\n 50\n-52 const Entity& dereference() const\n-53 {\n-54 return _entity;\n-55 }\n-56\n-57 protected:\n-58 Entity _entity;\n-59 };\n+52 YaspIntersectionIterator (const YaspEntity<0,dim,GridImp>& myself, bool\n+toend)\n+53 : intersection_(IntersectionImp(myself, toend))\n+54 {}\n+55\n+57 YaspIntersectionIterator (const YaspIntersectionIterator& other)\n+58 : intersection_(other.intersection_)\n+59 {}\n 60\n-61}\n-62\n-63#endif // DUNE_GRID_YASPGRIDLEVELITERATOR_HH\n+62 YaspIntersectionIterator & operator_=_(const YaspIntersectionIterator&\n+other)\n+63 {\n+64 intersection_ = other.intersection_;\n+65 return *this;\n+66 }\n+67\n+68 private:\n+69 // The intersection this iterator points to\n+70 mutable Intersection intersection_;\n+71 };\n+72\n+73} // namespace Dune\n+74\n+75#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::impl\n+Implementation & impl()\n+access to the underlying implementation\n+Definition common/intersection.hh:178\n Dune::YaspEntity\n Definition yaspgridentity.hh:242\n-Dune::YaspLevelIterator\n-Iterates over entities of one grid level.\n-Definition yaspgridleveliterator.hh:19\n-Dune::YaspLevelIterator::_entity\n-Entity _entity\n-entity\n-Definition yaspgridleveliterator.hh:58\n-Dune::YaspLevelIterator::YGLI\n-GridImp::YGridLevelIterator YGLI\n-Definition yaspgridleveliterator.hh:27\n-Dune::YaspLevelIterator::Entity\n-GridImp::template Codim< codim >::Entity Entity\n-Definition yaspgridleveliterator.hh:26\n-Dune::YaspLevelIterator::increment\n+Dune::YaspIntersectionIterator\n+YaspIntersectionIterator enables iteration over intersections with neighboring\n+codim 0 entities.\n+Definition yaspgridintersectioniterator.hh:22\n+Dune::YaspIntersectionIterator::dereference\n+const Intersection & dereference() const\n+dereferencing\n+Definition yaspgridintersectioniterator.hh:42\n+Dune::YaspIntersectionIterator::YaspIntersectionIterator\n+YaspIntersectionIterator(const YaspIntersectionIterator &other)\n+copy constructor\n+Definition yaspgridintersectioniterator.hh:57\n+Dune::YaspIntersectionIterator::IntersectionImp\n+Dune::YaspIntersection< GridImp > IntersectionImp\n+Definition yaspgridintersectioniterator.hh:26\n+Dune::YaspIntersectionIterator::Intersection\n+Dune::Intersection< GridImp, IntersectionImp > Intersection\n+Definition yaspgridintersectioniterator.hh:27\n+Dune::YaspIntersectionIterator::increment\n void increment()\n increment\n-Definition yaspgridleveliterator.hh:40\n-Dune::YaspLevelIterator::I\n-GridImp::YGrid::Iterator I\n-Definition yaspgridleveliterator.hh:28\n-Dune::YaspLevelIterator::YaspLevelIterator\n-YaspLevelIterator(const YGLI &g, const I &it)\n-constructor\n-Definition yaspgridleveliterator.hh:35\n-Dune::YaspLevelIterator::equals\n-bool equals(const YaspLevelIterator &rhs) const\n+Definition yaspgridintersectioniterator.hh:30\n+Dune::YaspIntersectionIterator::operator=\n+YaspIntersectionIterator & operator=(const YaspIntersectionIterator &other)\n+assignment\n+Definition yaspgridintersectioniterator.hh:62\n+Dune::YaspIntersectionIterator::YaspIntersectionIterator\n+YaspIntersectionIterator(const YaspEntity< 0, dim, GridImp > &myself, bool\n+toend)\n+make intersection iterator from entity\n+Definition yaspgridintersectioniterator.hh:52\n+Dune::YaspIntersectionIterator::equals\n+bool equals(const YaspIntersectionIterator &other) const\n equality\n-Definition yaspgridleveliterator.hh:46\n-Dune::YaspLevelIterator::YaspLevelIterator\n-YaspLevelIterator()\n-default constructor\n-Definition yaspgridleveliterator.hh:31\n-Dune::YaspLevelIterator::dereference\n-const Entity & dereference() const\n-dereferencing\n-Definition yaspgridleveliterator.hh:52\n+Definition yaspgridintersectioniterator.hh:36\n+Dune::YaspIntersectionIterator::YaspIntersectionIterator\n+YaspIntersectionIterator()\n+Definition yaspgridintersectioniterator.hh:48\n+Dune::YaspIntersection\n+YaspIntersection provides data about intersection with neighboring codim 0\n+entities.\n+Definition yaspgridintersection.hh:22\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00185.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00185.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridintersection.hh File Reference\n+dune-grid: yaspgridpersistentcontainer.hh File Reference\n \n \n \n \n \n \n \n@@ -72,38 +72,44 @@\n
  • dune
  • grid
  • yaspgrid
  • \n
    \n \n
    \n \n-
    yaspgridintersection.hh File Reference
    \n+
    yaspgridpersistentcontainer.hh File Reference
    \n
    \n
    \n \n-

    The YaspIntersection class. \n+

    Specialization of the PersistentContainer for YaspGrid. \n More...

    \n-\n+
    #include <cassert>
    \n+#include <vector>
    \n+#include <dune/grid/utility/persistentcontainer.hh>
    \n+#include <dune/grid/utility/persistentcontainervector.hh>
    \n+#include "../yaspgrid.hh"
    \n+
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspIntersection< GridImp >
     YaspIntersection provides data about intersection with neighboring codim 0 entities. More...
    class  Dune::YaspPersistentContainerIndex< Grid >
     
    class  Dune::PersistentContainer< YaspGrid< dim, CoordCont >, T >
     Specialization of the PersistentContainer for YaspGrid. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The YaspIntersection class.

    \n-

    YaspIntersection provides data about intersection with neighboring codim 0 entities.

    \n+

    Specialization of the PersistentContainer for YaspGrid.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,25 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridintersection.hh File Reference\n-The YaspIntersection class. More...\n+yaspgridpersistentcontainer.hh File Reference\n+Specialization of the PersistentContainer for YaspGrid. More...\n+#include \n+#include \n+#include \n+#include \n+#include \"../yaspgrid.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspIntersection<_GridImp_>\n-\u00a0 YaspIntersection provides data about intersection with neighboring\n- codim 0 entities. More...\n+class \u00a0 Dune::YaspPersistentContainerIndex<_Grid_>\n+\u00a0\n+class \u00a0 Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>\n+\u00a0 Specialization of the PersistentContainer for YaspGrid. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The YaspIntersection class.\n-YaspIntersection provides data about intersection with neighboring codim 0\n-entities.\n+Specialization of the PersistentContainer for YaspGrid.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00185_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00185_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridintersection.hh Source File\n+dune-grid: yaspgridpersistentcontainer.hh Source File\n \n \n \n \n \n \n \n@@ -74,401 +74,153 @@\n \n \n
    \n
    \n-
    yaspgridintersection.hh
    \n+
    yaspgridpersistentcontainer.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDINTERSECTION_HH
    \n-
    6#define DUNE_GRID_YASPGRIDINTERSECTION_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH
    \n+
    6#define DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH
    \n
    7
    \n-
    15namespace Dune {
    \n-
    16
    \n-
    20 template<class GridImp>
    \n-
    \n-\n-
    22 {
    \n-
    23 constexpr static int dim = GridImp::dimension;
    \n-
    24 constexpr static int dimworld = GridImp::dimensionworld;
    \n-
    25 typedef typename GridImp::ctype ctype;
    \n-
    26
    \n-
    27 typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
    \n-
    28 typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
    \n-
    29
    \n-
    30 friend class YaspIntersectionIterator<GridImp>;
    \n-
    31
    \n-
    32 public:
    \n-
    33 // types used from grids
    \n-
    34 typedef typename GridImp::YGridLevelIterator YGLI;
    \n-
    35 typedef typename GridImp::YGrid::Iterator I;
    \n-
    36 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    37 typedef typename GridImp::template Codim<1>::Geometry Geometry;
    \n-
    38 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
    \n-
    39
    \n-
    \n-
    40 void update() {
    \n-
    41
    \n-
    42 // vector with per-direction movements
    \n-
    43 std::array<int,dim> dist{{0}};
    \n-
    44
    \n-
    45 // first move: back to center
    \n-
    46 dist[_dir] = 1 - 2*_face;
    \n-
    47
    \n-
    48 // update face info
    \n-
    49 _dir = _count / 2;
    \n-
    50 _face = _count % 2;
    \n-
    51
    \n-
    52 // second move: to new neighbor
    \n-
    53 dist[_dir] += -1 + 2*_face;
    \n-
    54
    \n-
    55 // move transforming iterator
    \n-
    56 _outside.transformingsubiterator().move(dist);
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    \n-
    62 bool boundary () const
    \n-
    63 {
    \n-
    64 // Coordinate of intersection in its direction
    \n-
    65 int coord = _inside.transformingsubiterator().coord(_dir) + _face;
    \n-
    66 if (_inside.gridlevel()->mg->isPeriodic(_dir))
    \n-
    67 return false;
    \n-
    68 else
    \n-
    69 return coord == 0
    \n-
    70 ||
    \n-
    71 coord == _inside.gridlevel()->mg->levelSize(_inside.gridlevel()->level(),_dir);
    \n+
    12#include <cassert>
    \n+
    13#include <vector>
    \n+
    14
    \n+\n+\n+
    17#include "../yaspgrid.hh"
    \n+
    18
    \n+
    19namespace Dune
    \n+
    20{
    \n+
    21
    \n+
    33 template<typename Grid>
    \n+
    \n+\n+
    35 {
    \n+
    36
    \n+
    37 public:
    \n+
    \n+
    38 YaspPersistentContainerIndex(const Grid & grid, int codim)
    \n+
    39 : _grid(grid), _codim(codim)
    \n+
    40 {
    \n+
    41 recomputeOffsets();
    \n+
    42 }
    \n+
    \n+
    43
    \n+
    45 typedef std::size_t IndexType;
    \n+
    46
    \n+
    48 template<class Entity>
    \n+
    \n+
    49 IndexType index (const Entity& e) const
    \n+
    50 {
    \n+
    51 static const int cc = Entity::codimension;
    \n+
    52 std::size_t level = e.level();
    \n+
    53 return _grid.indexsets[level]->template index<cc>(e) + _offsets[level];
    \n+
    54 }
    \n+
    \n+
    55
    \n+
    57 template< class Entity >
    \n+
    \n+
    58 IndexType subIndex ( const Entity &e, int i, unsigned int codim ) const
    \n+
    59 {
    \n+
    60
    \n+
    61 static const int cc = Entity::codimension;
    \n+
    62 std::size_t level = e.level();
    \n+
    63 return _grid.indexsets[level]->template subIndex<cc>(e,i,codim) + _offsets[level];
    \n+
    64 }
    \n+
    \n+
    65
    \n+
    \n+
    67 std::size_t size (int /* codim */) const
    \n+
    68 {
    \n+
    69 if (_grid.indexsets.size()+1 != _offsets.size())
    \n+
    70 recomputeOffsets();
    \n+
    71 return _offsets.back();
    \n
    72 }
    \n
    \n
    73
    \n-
    \n-
    75 bool neighbor () const
    \n+
    74 private:
    \n+
    75 void recomputeOffsets() const
    \n
    76 {
    \n-
    77 // Coordinate of intersection in its direction
    \n-
    78 int coord = _inside.transformingsubiterator().coord(_dir) + _face;
    \n-
    79 return coord > _inside.gridlevel()->overlap[0].dataBegin()->min(_dir)
    \n-
    80 &&
    \n-
    81 coord <= _inside.gridlevel()->overlap[0].dataBegin()->max(_dir);
    \n-
    82 }
    \n-
    \n-
    83
    \n-
    \n-
    85 bool conforming () const
    \n-
    86 {
    \n-
    87 return true;
    \n-
    88 }
    \n-
    \n-
    89
    \n-
    \n-
    92 Entity inside() const
    \n-
    93 {
    \n-
    94 return Entity(_inside);
    \n-
    95 }
    \n-
    \n-
    96
    \n-
    \n-\n-
    99 {
    \n-
    100 return Entity(_outside);
    \n-
    101 }
    \n-
    \n-
    102
    \n-
    \n-\n-
    106 {
    \n-
    107 if(! boundary())
    \n-
    108 DUNE_THROW(GridError, "called boundarySegmentIndex while boundary() == false");
    \n-
    109 // size of local macro grid
    \n-
    110 const std::array<int, dim> & size = _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->size();
    \n-
    111 const std::array<int, dim> & origin = _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin();
    \n-
    112 std::array<int, dim> sides;
    \n-
    113 {
    \n-
    114 for (int i=0; i<dim; i++)
    \n-
    115 {
    \n-
    116 sides[i] =
    \n-
    117 ((_inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin(i)
    \n-
    118 == 0)+
    \n-
    119 (_inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin(i) +
    \n-
    120 _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->size(i)
    \n-
    121 ==
    \n-
    122 _inside.gridlevel()->mg->levelSize(0,i)));
    \n-
    123
    \n-
    124 }
    \n-
    125 }
    \n-
    126 // global position of the cell on macro grid
    \n-
    127 std::array<int, dim> pos = _inside.transformingsubiterator().coord();
    \n-
    128 for(int i=0; i<dim; i++)
    \n-
    129 {
    \n-
    130 pos[i] = pos[i] / (1<<_inside.level());
    \n-
    131 pos[i] = pos[i] - origin[i];
    \n-
    132 }
    \n-
    133 // compute unit-cube-face-sizes
    \n-
    134 std::array<int, dim> fsize;
    \n-
    135 {
    \n-
    136 int vol = 1;
    \n-
    137 for (int k=0; k<dim; k++)
    \n-
    138 vol *= size[k];
    \n-
    139 for (int k=0; k<dim; k++)
    \n-
    140 fsize[k] = vol/size[k];
    \n-
    141 }
    \n-
    142 // compute index in the unit-cube-face
    \n-
    143 int index = 0;
    \n-
    144 {
    \n-
    145 int localoffset = 1;
    \n-
    146 for (int k=dim-1; k>=0; k--)
    \n-
    147 {
    \n-
    148 if (k == _dir) continue;
    \n-
    149 index += (pos[k]) * localoffset;
    \n-
    150 localoffset *= size[k];
    \n-
    151 }
    \n-
    152 }
    \n-
    153 // add unit-cube-face-offsets
    \n-
    154 {
    \n-
    155 for (int k=0; k<_dir; k++)
    \n-
    156 index += sides[k] * fsize[k];
    \n-
    157 // add fsize if we are on the right face and there is a left-face-boundary on this processor
    \n-
    158 index += _face * (sides[_dir]>1) * fsize[_dir];
    \n-
    159 }
    \n-
    160
    \n-
    161 return index;
    \n-
    162 }
    \n-
    \n-
    163
    \n-
    \n-
    165 FieldVector<ctype, dimworld> outerNormal (const FieldVector<ctype, dim-1>& /* local */) const
    \n-
    166 {
    \n-
    167 return centerUnitOuterNormal();
    \n-
    168 }
    \n-
    \n-
    169
    \n-
    \n-
    171 FieldVector<ctype, dimworld> unitOuterNormal (const FieldVector<ctype, dim-1>& /* local */) const
    \n-
    172 {
    \n-
    173 return centerUnitOuterNormal();
    \n-
    174 }
    \n-
    \n-
    175
    \n-
    \n-
    177 FieldVector<ctype, dimworld> centerUnitOuterNormal () const
    \n-
    178 {
    \n-
    179 FieldVector<ctype, dimworld> normal(0);
    \n-
    180 normal[_dir] = (_face==0) ? -1.0 : 1.0;
    \n-
    181 return normal;
    \n-
    182 }
    \n-
    \n-
    183
    \n-
    \n-
    187 FieldVector<ctype, dimworld> integrationOuterNormal ([[maybe_unused]] const FieldVector<ctype, dim-1>& local) const
    \n-
    188 {
    \n-
    189 return geometry().volume() * centerUnitOuterNormal();
    \n-
    190 }
    \n-
    \n-
    191
    \n-
    \n-\n-
    196 {
    \n-
    197 // set of dimensions that span the intersection
    \n-
    198 std::bitset<dim> s;
    \n-
    199 s.set();
    \n-
    200 s[_dir] = false;
    \n-
    201
    \n-
    202 // lower-left and upper-right corners
    \n-
    203 Dune::FieldVector<ctype, dim> ll(0.0);
    \n-
    204 Dune::FieldVector<ctype, dim> ur(1.0);
    \n-
    205
    \n-
    206 ll[_dir] = ur[_dir] = (_face==0) ? 0.0 : 1.0;
    \n-
    207
    \n-
    208 return LocalGeometry(LocalGeometryImpl(ll,ur,s));
    \n-
    209 }
    \n-
    \n-
    210
    \n-
    \n-\n-
    215 {
    \n-
    216 // set of dimensions that span the intersection
    \n-
    217 std::bitset<dim> s;
    \n-
    218 s.set();
    \n-
    219 s[_dir] = false;
    \n-
    220
    \n-
    221 // lower-left and upper-right corners
    \n-
    222 Dune::FieldVector<ctype, dim> ll(0.0);
    \n-
    223 Dune::FieldVector<ctype, dim> ur(1.0);
    \n-
    224
    \n-
    225 ll[_dir] = ur[_dir] = (_face==1) ? 0.0 : 1.0;
    \n-
    226
    \n-
    227 return LocalGeometry(LocalGeometryImpl(ll,ur,s));
    \n-
    228 }
    \n-
    \n-
    229
    \n-
    \n-\n-
    233 {
    \n-
    234
    \n-
    235 std::bitset<dim> shift;
    \n-
    236 shift.set();
    \n-
    237 shift[_dir] = false;
    \n-
    238
    \n-
    239 Dune::FieldVector<ctype,dimworld> ll, ur;
    \n-
    240 for (int i=0; i<dimworld; i++)
    \n-
    241 {
    \n-
    242 int coord = _inside.transformingsubiterator().coord(i);
    \n-
    243
    \n-
    244 if ((i == _dir) and (_face))
    \n-
    245 coord++;
    \n-
    246
    \n-
    247 ll[i] = _inside.transformingsubiterator().coordCont()->coordinate(i,coord);
    \n-
    248 if (i != _dir)
    \n-
    249 coord++;
    \n-
    250 ur[i] = _inside.transformingsubiterator().coordCont()->coordinate(i,coord);
    \n-
    251
    \n-
    252 // If on periodic overlap, transform coordinates by domain size
    \n-
    253 if (_inside.gridlevel()->mg->isPeriodic(i)) {
    \n-
    254 int coordPeriodic = _inside.transformingsubiterator().coord(i);
    \n-
    255 if (coordPeriodic < 0) {
    \n-
    256 auto size = _inside.gridlevel()->mg->domainSize()[i];
    \n-
    257 ll[i] += size;
    \n-
    258 ur[i] += size;
    \n-
    259 } else if (coordPeriodic + 1 > _inside.gridlevel()->mg->levelSize(_inside.gridlevel()->level(),i)) {
    \n-
    260 auto size = _inside.gridlevel()->mg->domainSize()[i];
    \n-
    261 ll[i] -= size;
    \n-
    262 ur[i] -= size;
    \n-
    263 }
    \n-
    264 }
    \n-
    265 }
    \n-
    266
    \n-
    267 GeometryImpl _is_global(ll,ur,shift);
    \n-
    268 return Geometry( _is_global );
    \n-
    269 }
    \n-
    \n-
    270
    \n-
    \n-
    272 GeometryType type () const
    \n-
    273 {
    \n-
    274 return GeometryTypes::cube(dim-1);
    \n-
    275 }
    \n-
    \n-
    276
    \n-
    \n-
    278 int indexInInside () const
    \n-
    279 {
    \n-
    280 return _count;
    \n-
    281 }
    \n-
    \n-
    282
    \n-
    \n-
    284 int indexInOutside () const
    \n-
    285 {
    \n-
    286 // flip the last bit
    \n-
    287 return _count^1;
    \n-
    288 }
    \n-
    \n-
    289
    \n-
    \n-\n-
    291 : _count(~std::uint8_t(0)) // Use as marker for invalid intersection
    \n-
    292 , _dir(0)
    \n-
    293 , _face(0)
    \n-
    294 {}
    \n-
    \n-
    295
    \n-
    \n-
    297 YaspIntersection (const YaspEntity<0,dim,GridImp>& myself, bool toend) :
    \n-
    298 _inside(myself.gridlevel(),
    \n-
    299 myself.transformingsubiterator()),
    \n-
    300 _outside(myself.gridlevel(),
    \n-
    301 myself.transformingsubiterator()),
    \n-
    302 // initialize to first neighbor
    \n-
    303 _count(0),
    \n-
    304 _dir(0),
    \n-
    305 _face(0)
    \n-
    306 {
    \n-
    307 if (toend)
    \n-
    308 {
    \n-
    309 // initialize end iterator
    \n-
    310 _count = 2*dim;
    \n-
    311 return;
    \n-
    312 }
    \n-
    313 _count = 0;
    \n-
    314
    \n-
    315 // move transforming iterator
    \n-
    316 _outside.transformingsubiterator().move(_dir,-1);
    \n-
    317 }
    \n-
    \n-
    318
    \n-
    320
    \n-
    \n-
    322 void assign (const YaspIntersection& it)
    \n-
    323 {
    \n-
    324 *this = it;
    \n-
    325 }
    \n-
    \n-
    326
    \n-
    \n-
    327 bool equals(const YaspIntersection& other) const
    \n-
    328 {
    \n-
    329 // compare counts first -- that's cheaper if the test fails
    \n-
    330 return _count == other._count && _inside.equals(other._inside);
    \n-
    331 }
    \n-
    \n-
    332
    \n-
    333 private:
    \n-
    334 /* The two entities that make up the intersection */
    \n-\n-\n-
    337 /* current position */
    \n-
    338 std::uint8_t _count;
    \n-
    339 std::uint8_t _dir;
    \n-
    340 std::uint8_t _face;
    \n-
    341 };
    \n-
    \n-
    342} // namespace Dune
    \n-
    343
    \n-
    344#endif // DUNE_GRID_YASPGRIDINTERSECTION_HH
    \n-
    STL namespace.
    \n+
    77 _offsets.resize(_grid.indexsets.size()+1,0);
    \n+
    78 _offsets[0] = 0;
    \n+
    79 for (std::size_t i=0; i<_grid.indexsets.size(); i++)
    \n+
    80 _offsets[i+1] = _offsets[i] + _grid.indexsets[i]->size(_codim);
    \n+
    81 }
    \n+
    82
    \n+
    83 const Grid& _grid;
    \n+
    84 int _codim;
    \n+
    85 mutable std::vector<std::size_t> _offsets;
    \n+
    86 };
    \n+
    \n+
    87
    \n+
    94 template<int dim, class CoordCont, class T>
    \n+
    \n+
    95 class PersistentContainer< YaspGrid<dim, CoordCont>, T >
    \n+
    96 /* We have to pass the reference to the IndexSet to the constructor
    \n+
    97 of the PersistentContainerVector. In order to have a valid
    \n+
    98 indexset available, we inherit from a private indexset
    \n+
    99 */
    \n+
    100 : private YaspPersistentContainerIndex< const YaspGrid<dim, CoordCont> >,
    \n+
    101 public PersistentContainerVector< YaspGrid<dim, CoordCont>,
    \n+
    102 YaspPersistentContainerIndex< const YaspGrid<dim, CoordCont> >,
    \n+
    103 std::vector<T> >
    \n+
    104 {
    \n+\n+\n+
    107
    \n+
    108 public:
    \n+
    109 typedef typename Base::Grid Grid;
    \n+
    110 typedef typename Base::Value Value;
    \n+
    111
    \n+
    112 using Base::size;
    \n+
    113
    \n+
    \n+
    114 PersistentContainer ( const Grid &grid, int codim, const Value &value = Value() )
    \n+
    115 : IndexSet(grid, codim),
    \n+
    116 Base(*this, codim, value)
    \n+
    117 {}
    \n+
    \n+
    118 };
    \n+
    \n+
    119
    \n+
    120} // end namespace Dune
    \n+
    121
    \n+
    122#endif // end DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n-
    Definition yaspgridentity.hh:242
    \n-
    int level() const
    level of this element
    Definition yaspgridentity.hh:256
    \n-
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:394
    \n-
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:393
    \n-
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:321
    \n-
    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
    Definition yaspgridintersectioniterator.hh:22
    \n-
    YaspIntersection provides data about intersection with neighboring codim 0 entities.
    Definition yaspgridintersection.hh:22
    \n-
    FieldVector< ctype, dimworld > centerUnitOuterNormal() const
    return unit outer normal at center of intersection geometry
    Definition yaspgridintersection.hh:177
    \n-
    bool equals(const YaspIntersection &other) const
    Definition yaspgridintersection.hh:327
    \n-
    Entity inside() const
    Definition yaspgridintersection.hh:92
    \n-
    Geometry geometry() const
    Definition yaspgridintersection.hh:232
    \n-
    GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
    Definition yaspgridintersection.hh:38
    \n-
    YaspIntersection()
    Definition yaspgridintersection.hh:290
    \n-
    int indexInOutside() const
    local index of codim 1 entity in neighbor where intersection is contained in
    Definition yaspgridintersection.hh:284
    \n-
    LocalGeometry geometryInInside() const
    Definition yaspgridintersection.hh:195
    \n-
    int boundarySegmentIndex() const
    Definition yaspgridintersection.hh:105
    \n-
    GridImp::template Codim< 1 >::Geometry Geometry
    Definition yaspgridintersection.hh:37
    \n-
    bool conforming() const
    Yasp is always conform.
    Definition yaspgridintersection.hh:85
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition yaspgridintersection.hh:36
    \n-
    bool neighbor() const
    return true if neighbor across intersection exists in this processor
    Definition yaspgridintersection.hh:75
    \n-
    FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &) const
    return unit outer normal, this should be dependent on local coordinates for higher order boundary
    Definition yaspgridintersection.hh:165
    \n-
    YaspIntersection(const YaspEntity< 0, dim, GridImp > &myself, bool toend)
    make intersection iterator from entity, initialize to first neighbor
    Definition yaspgridintersection.hh:297
    \n-
    GeometryType type() const
    obtain the type of reference element for this intersection
    Definition yaspgridintersection.hh:272
    \n-
    void assign(const YaspIntersection &it)
    copy constructor \u2013 use default
    Definition yaspgridintersection.hh:322
    \n-
    int indexInInside() const
    local index of codim 1 entity in self where intersection is contained in
    Definition yaspgridintersection.hh:278
    \n-
    FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
    Definition yaspgridintersection.hh:187
    \n-
    GridImp::YGrid::Iterator I
    Definition yaspgridintersection.hh:35
    \n-
    LocalGeometry geometryInOutside() const
    Definition yaspgridintersection.hh:214
    \n-
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridintersection.hh:34
    \n-
    Entity outside() const
    return Entity on the outside of this intersection
    Definition yaspgridintersection.hh:98
    \n-
    bool boundary() const
    Definition yaspgridintersection.hh:62
    \n-
    FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &) const
    return unit outer normal, this should be dependent on local coordinates for higher order boundary
    Definition yaspgridintersection.hh:171
    \n-
    void update()
    Definition yaspgridintersection.hh:40
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    int level() const
    The level of this entity.
    Definition common/entity.hh:124
    \n+
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    int size(int level, int codim) const
    Return number of grid entities of a given codim on a given level in this process.
    Definition common/grid.hh:538
    \n+
    A class for storing data during an adaptation cycle.
    Definition utility/persistentcontainer.hh:22
    \n+
    Base::Value Value
    Definition utility/persistentcontainer.hh:27
    \n+
    const Grid & grid() const
    Definition persistentcontainermap.hh:114
    \n+
    Size size() const
    Definition persistentcontainermap.hh:85
    \n+
    vector-based implementation of the PersistentContainer
    Definition persistentcontainervector.hh:51
    \n+
    Vector::value_type Value
    Definition persistentcontainervector.hh:57
    \n+
    G Grid
    Definition persistentcontainervector.hh:55
    \n+
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n+
    Definition yaspgridpersistentcontainer.hh:35
    \n+
    IndexType index(const Entity &e) const
    Map entity to index. The result of calling this method with an entity that is not in the index set is...
    Definition yaspgridpersistentcontainer.hh:49
    \n+
    std::size_t size(int) const
    Return total number of entities of given geometry type in entity set .
    Definition yaspgridpersistentcontainer.hh:67
    \n+
    IndexType subIndex(const Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition yaspgridpersistentcontainer.hh:58
    \n+
    YaspPersistentContainerIndex(const Grid &grid, int codim)
    Definition yaspgridpersistentcontainer.hh:38
    \n+
    std::size_t IndexType
    The type used for the indices.
    Definition yaspgridpersistentcontainer.hh:45
    \n+
    Base::Grid Grid
    Definition yaspgridpersistentcontainer.hh:109
    \n+
    Base::Value Value
    Definition yaspgridpersistentcontainer.hh:110
    \n+
    PersistentContainer(const Grid &grid, int codim, const Value &value=Value())
    Definition yaspgridpersistentcontainer.hh:114
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,453 +1,193 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridintersection.hh\n+yaspgridpersistentcontainer.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDINTERSECTION_HH\n-6#define DUNE_GRID_YASPGRIDINTERSECTION_HH\n+5#ifndef DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH\n+6#define DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH\n 7\n-15namespace Dune {\n-16\n-20 template\n-21 class YaspIntersection\n-22 {\n-23 constexpr static int dim = GridImp::dimension;\n-24 constexpr static int dimworld = GridImp::dimensionworld;\n-25 typedef typename GridImp::ctype ctype;\n-26\n-27 typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl\n-GeometryImpl;\n-28 typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl\n-LocalGeometryImpl;\n-29\n-30 friend class YaspIntersectionIterator;\n-31\n-32 public:\n-33 // types used from grids\n-34 typedef typename GridImp::YGridLevelIterator YGLI;\n-35 typedef typename GridImp::YGrid::Iterator I;\n-36 typedef typename GridImp::template Codim<0>::Entity Entity;\n-37 typedef typename GridImp::template Codim<1>::Geometry Geometry;\n-38 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;\n-39\n-40 void update() {\n-41\n-42 // vector with per-direction movements\n-43 std::array dist{{0}};\n-44\n-45 // first move: back to center\n-46 dist[_dir] = 1 - 2*_face;\n-47\n-48 // update face info\n-49 _dir = _count / 2;\n-50 _face = _count % 2;\n-51\n-52 // second move: to new neighbor\n-53 dist[_dir] += -1 + 2*_face;\n-54\n-55 // move transforming iterator\n-56 _outside.transformingsubiterator().move(dist);\n-57 }\n-58\n-62 bool boundary () const\n-63 {\n-64 // Coordinate of intersection in its direction\n-65 int coord = _inside.transformingsubiterator().coord(_dir) + _face;\n-66 if (_inside.gridlevel()->mg->isPeriodic(_dir))\n-67 return false;\n-68 else\n-69 return coord == 0\n-70 ||\n-71 coord == _inside.gridlevel()->mg->levelSize(_inside.gridlevel()->level(),_\n-dir);\n+12#include \n+13#include \n+14\n+15#include \n+16#include \n+17#include \"../yaspgrid.hh\"\n+18\n+19namespace Dune\n+20{\n+21\n+33 template\n+34 class YaspPersistentContainerIndex\n+35 {\n+36\n+37 public:\n+38 YaspPersistentContainerIndex(const Grid & grid, int codim)\n+39 : _grid(grid), _codim(codim)\n+40 {\n+41 recomputeOffsets();\n+42 }\n+43\n+45 typedef std::size_t IndexType;\n+46\n+48 template\n+49 IndexType index (const Entity& e) const\n+50 {\n+51 static const int cc = Entity::codimension;\n+52 std::size_t level = e.level();\n+53 return _grid.indexsets[level]->template index(e) + _offsets[level];\n+54 }\n+55\n+57 template< class Entity >\n+58 IndexType subIndex ( const Entity &e, int i, unsigned int codim ) const\n+59 {\n+60\n+61 static const int cc = Entity::codimension;\n+62 std::size_t level = e.level();\n+63 return _grid.indexsets[level]->template subIndex(e,i,codim) + _offsets\n+[level];\n+64 }\n+65\n+67 std::size_t size (int /* codim */) const\n+68 {\n+69 if (_grid.indexsets.size()+1 != _offsets.size())\n+70 recomputeOffsets();\n+71 return _offsets.back();\n 72 }\n 73\n-75 bool neighbor () const\n+74 private:\n+75 void recomputeOffsets() const\n 76 {\n-77 // Coordinate of intersection in its direction\n-78 int coord = _inside.transformingsubiterator().coord(_dir) + _face;\n-79 return coord > _inside.gridlevel()->overlap[0].dataBegin()->min(_dir)\n-80 &&\n-81 coord <= _inside.gridlevel()->overlap[0].dataBegin()->max(_dir);\n-82 }\n-83\n-85 bool conforming () const\n-86 {\n-87 return true;\n-88 }\n-89\n-92 Entity inside() const\n-93 {\n-94 return Entity(_inside);\n-95 }\n-96\n-98 Entity outside() const\n-99 {\n-100 return Entity(_outside);\n-101 }\n-102\n-105 int boundarySegmentIndex() const\n-106 {\n-107 if(! boundary())\n-108 DUNE_THROW(GridError, \"called boundarySegmentIndex while boundary() ==\n-false\");\n-109 // size of local macro grid\n-110 const std::array & size = _inside.gridlevel()->mg->begin()-\n->overlap[0].dataBegin()->size();\n-111 const std::array & origin = _inside.gridlevel()->mg->begin()-\n->overlap[0].dataBegin()->origin();\n-112 std::array sides;\n-113 {\n-114 for (int i=0; img->begin()->overlap[0].dataBegin()->origin(i)\n-118 == 0)+\n-119 (_inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin(i) +\n-120 _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->size(i)\n-121 ==\n-122 _inside.gridlevel()->mg->levelSize(0,i)));\n-123\n-124 }\n-125 }\n-126 // global position of the cell on macro grid\n-127 std::array pos = _inside.transformingsubiterator().coord();\n-128 for(int i=0; i fsize;\n-135 {\n-136 int vol = 1;\n-137 for (int k=0; k=0; k--)\n-147 {\n-148 if (k == _dir) continue;\n-149 index += (pos[k]) * localoffset;\n-150 localoffset *= size[k];\n-151 }\n-152 }\n-153 // add unit-cube-face-offsets\n-154 {\n-155 for (int k=0; k<_dir; k++)\n-156 index += sides[k] * fsize[k];\n-157 // add fsize if we are on the right face and there is a left-face-boundary\n-on this processor\n-158 index += _face * (sides[_dir]>1) * fsize[_dir];\n-159 }\n-160\n-161 return index;\n-162 }\n-163\n-165 FieldVector outerNormal (const FieldVector&\n-/* local */) const\n-166 {\n-167 return centerUnitOuterNormal();\n-168 }\n-169\n-171 FieldVector unitOuterNormal (const FieldVector& /* local */) const\n-172 {\n-173 return centerUnitOuterNormal();\n-174 }\n-175\n-177 FieldVector centerUnitOuterNormal () const\n-178 {\n-179 FieldVector normal(0);\n-180 normal[_dir] = (_face==0) ? -1.0 : 1.0;\n-181 return normal;\n-182 }\n-183\n-187 FieldVector integrationOuterNormal ([[maybe_unused]] const\n-FieldVector& local) const\n-188 {\n-189 return geometry().volume() * centerUnitOuterNormal();\n-190 }\n-191\n-195 LocalGeometry geometryInInside () const\n-196 {\n-197 // set of dimensions that span the intersection\n-198 std::bitset s;\n-199 s.set();\n-200 s[_dir] = false;\n-201\n-202 // lower-left and upper-right corners\n-203 Dune::FieldVector ll(0.0);\n-204 Dune::FieldVector ur(1.0);\n-205\n-206 ll[_dir] = ur[_dir] = (_face==0) ? 0.0 : 1.0;\n-207\n-208 return LocalGeometry(LocalGeometryImpl(ll,ur,s));\n-209 }\n-210\n-214 LocalGeometry geometryInOutside () const\n-215 {\n-216 // set of dimensions that span the intersection\n-217 std::bitset s;\n-218 s.set();\n-219 s[_dir] = false;\n-220\n-221 // lower-left and upper-right corners\n-222 Dune::FieldVector ll(0.0);\n-223 Dune::FieldVector ur(1.0);\n-224\n-225 ll[_dir] = ur[_dir] = (_face==1) ? 0.0 : 1.0;\n-226\n-227 return LocalGeometry(LocalGeometryImpl(ll,ur,s));\n-228 }\n-229\n-232 Geometry geometry () const\n-233 {\n-234\n-235 std::bitset shift;\n-236 shift.set();\n-237 shift[_dir] = false;\n-238\n-239 Dune::FieldVector ll, ur;\n-240 for (int i=0; icoordinate(i,coord);\n-248 if (i != _dir)\n-249 coord++;\n-250 ur[i] = _inside.transformingsubiterator().coordCont()->coordinate(i,coord);\n-251\n-252 // If on periodic overlap, transform coordinates by domain size\n-253 if (_inside.gridlevel()->mg->isPeriodic(i)) {\n-254 int coordPeriodic = _inside.transformingsubiterator().coord(i);\n-255 if (coordPeriodic < 0) {\n-256 auto size = _inside.gridlevel()->mg->domainSize()[i];\n-257 ll[i] += size;\n-258 ur[i] += size;\n-259 } else if (coordPeriodic + 1 > _inside.gridlevel()->mg->levelSize(_\n-inside.gridlevel()->level(),i)) {\n-260 auto size = _inside.gridlevel()->mg->domainSize()[i];\n-261 ll[i] -= size;\n-262 ur[i] -= size;\n-263 }\n-264 }\n-265 }\n-266\n-267 GeometryImpl _is_global(ll,ur,shift);\n-268 return Geometry( _is_global );\n-269 }\n-270\n-272 GeometryType type () const\n-273 {\n-274 return GeometryTypes::cube(dim-1);\n-275 }\n-276\n-278 int indexInInside () const\n-279 {\n-280 return _count;\n-281 }\n-282\n-284 int indexInOutside () const\n-285 {\n-286 // flip the last bit\n-287 return _count^1;\n-288 }\n-289\n-290 YaspIntersection()\n-291 : _count(~std::uint8_t(0)) // Use as marker for invalid intersection\n-292 , _dir(0)\n-293 , _face(0)\n-294 {}\n-295\n-297 YaspIntersection (const YaspEntity<0,dim,GridImp>& myself, bool toend) :\n-298 _inside(myself.gridlevel(),\n-299 myself.transformingsubiterator()),\n-300 _outside(myself.gridlevel(),\n-301 myself.transformingsubiterator()),\n-302 // initialize to first neighbor\n-303 _count(0),\n-304 _dir(0),\n-305 _face(0)\n-306 {\n-307 if (toend)\n-308 {\n-309 // initialize end iterator\n-310 _count = 2*dim;\n-311 return;\n-312 }\n-313 _count = 0;\n-314\n-315 // move transforming iterator\n-316 _outside.transformingsubiterator().move(_dir,-1);\n-317 }\n-318\n-320\n-322 void assign (const YaspIntersection& it)\n-323 {\n-324 *this = it;\n-325 }\n-326\n-327 bool equals(const YaspIntersection& other) const\n-328 {\n-329 // compare counts first -- that's cheaper if the test fails\n-330 return _count == other._count && _inside.equals(other._inside);\n-331 }\n-332\n-333 private:\n-334 /* The two entities that make up the intersection */\n-335 YaspEntity<0,GridImp::dimension,GridImp> _inside;\n-336 YaspEntity<0,GridImp::dimension,GridImp> _outside;\n-337 /* current position */\n-338 std::uint8_t _count;\n-339 std::uint8_t _dir;\n-340 std::uint8_t _face;\n-341 };\n-342} // namespace Dune\n-343\n-344#endif // DUNE_GRID_YASPGRIDINTERSECTION_HH\n-std\n-STL namespace.\n+77 _offsets.resize(_grid.indexsets.size()+1,0);\n+78 _offsets[0] = 0;\n+79 for (std::size_t i=0; i<_grid.indexsets.size(); i++)\n+80 _offsets[i+1] = _offsets[i] + _grid.indexsets[i]->size(_codim);\n+81 }\n+82\n+83 const Grid& _grid;\n+84 int _codim;\n+85 mutable std::vector _offsets;\n+86 };\n+87\n+94 template\n+95 class PersistentContainer< YaspGrid, T >\n+96 /* We have to pass the reference to the IndexSet to the constructor\n+97 of the PersistentContainerVector. In order to have a valid\n+98 indexset available, we inherit from a private indexset\n+99 */\n+100 : private YaspPersistentContainerIndex< const YaspGrid >,\n+101 public PersistentContainerVector< YaspGrid,\n+102 YaspPersistentContainerIndex< const YaspGrid >,\n+103 std::vector >\n+104 {\n+105 typedef YaspPersistentContainerIndex<_const_YaspGrid >\n+IndexSet;\n+106 typedef PersistentContainerVector<_YaspGrid, IndexSet,\n+std::vector > Base;\n+107\n+108 public:\n+109 typedef typename Base::Grid Grid;\n+110 typedef typename Base::Value Value;\n+111\n+112 using Base::size;\n+113\n+114 PersistentContainer ( const Grid &grid, int codim, const Value &value =\n+Value() )\n+115 : IndexSet(grid, codim),\n+116 Base(*this, codim, value)\n+117 {}\n+118 };\n+119\n+120} // end namespace Dune\n+121\n+122#endif // end DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH\n+persistentcontainervector.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::GridError\n-Base class for exceptions in Dune grid modules.\n-Definition exceptions.hh:20\n-Dune::YaspEntity\n-Definition yaspgridentity.hh:242\n-Dune::YaspEntity::level\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::level\n int level() const\n-level of this element\n-Definition yaspgridentity.hh:256\n-Dune::YaspEntity::gridlevel\n-const YGLI & gridlevel() const\n-Definition yaspgridentity.hh:394\n-Dune::YaspEntity::transformingsubiterator\n-const I & transformingsubiterator() const\n-Definition yaspgridentity.hh:393\n-Dune::YaspEntity::equals\n-bool equals(const YaspEntity &e) const\n-Return true when two iterators over the same grid are equal (!).\n-Definition yaspgridentity.hh:321\n-Dune::YaspIntersectionIterator\n-YaspIntersectionIterator enables iteration over intersections with neighboring\n-codim 0 entities.\n-Definition yaspgridintersectioniterator.hh:22\n-Dune::YaspIntersection\n-YaspIntersection provides data about intersection with neighboring codim 0\n-entities.\n-Definition yaspgridintersection.hh:22\n-Dune::YaspIntersection::centerUnitOuterNormal\n-FieldVector< ctype, dimworld > centerUnitOuterNormal() const\n-return unit outer normal at center of intersection geometry\n-Definition yaspgridintersection.hh:177\n-Dune::YaspIntersection::equals\n-bool equals(const YaspIntersection &other) const\n-Definition yaspgridintersection.hh:327\n-Dune::YaspIntersection::inside\n-Entity inside() const\n-Definition yaspgridintersection.hh:92\n-Dune::YaspIntersection::geometry\n-Geometry geometry() const\n-Definition yaspgridintersection.hh:232\n-Dune::YaspIntersection::LocalGeometry\n-GridImp::template Codim< 1 >::LocalGeometry LocalGeometry\n-Definition yaspgridintersection.hh:38\n-Dune::YaspIntersection::YaspIntersection\n-YaspIntersection()\n-Definition yaspgridintersection.hh:290\n-Dune::YaspIntersection::indexInOutside\n-int indexInOutside() const\n-local index of codim 1 entity in neighbor where intersection is contained in\n-Definition yaspgridintersection.hh:284\n-Dune::YaspIntersection::geometryInInside\n-LocalGeometry geometryInInside() const\n-Definition yaspgridintersection.hh:195\n-Dune::YaspIntersection::boundarySegmentIndex\n-int boundarySegmentIndex() const\n-Definition yaspgridintersection.hh:105\n-Dune::YaspIntersection::Geometry\n-GridImp::template Codim< 1 >::Geometry Geometry\n-Definition yaspgridintersection.hh:37\n-Dune::YaspIntersection::conforming\n-bool conforming() const\n-Yasp is always conform.\n-Definition yaspgridintersection.hh:85\n-Dune::YaspIntersection::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Definition yaspgridintersection.hh:36\n-Dune::YaspIntersection::neighbor\n-bool neighbor() const\n-return true if neighbor across intersection exists in this processor\n-Definition yaspgridintersection.hh:75\n-Dune::YaspIntersection::outerNormal\n-FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &)\n-const\n-return unit outer normal, this should be dependent on local coordinates for\n-higher order boundary\n-Definition yaspgridintersection.hh:165\n-Dune::YaspIntersection::YaspIntersection\n-YaspIntersection(const YaspEntity< 0, dim, GridImp > &myself, bool toend)\n-make intersection iterator from entity, initialize to first neighbor\n-Definition yaspgridintersection.hh:297\n-Dune::YaspIntersection::type\n-GeometryType type() const\n-obtain the type of reference element for this intersection\n-Definition yaspgridintersection.hh:272\n-Dune::YaspIntersection::assign\n-void assign(const YaspIntersection &it)\n-copy constructor \u00e2\u0080\u0093 use default\n-Definition yaspgridintersection.hh:322\n-Dune::YaspIntersection::indexInInside\n-int indexInInside() const\n-local index of codim 1 entity in self where intersection is contained in\n-Definition yaspgridintersection.hh:278\n-Dune::YaspIntersection::integrationOuterNormal\n-FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype,\n-dim-1 > &local) const\n-Definition yaspgridintersection.hh:187\n-Dune::YaspIntersection::I\n-GridImp::YGrid::Iterator I\n-Definition yaspgridintersection.hh:35\n-Dune::YaspIntersection::geometryInOutside\n-LocalGeometry geometryInOutside() const\n-Definition yaspgridintersection.hh:214\n-Dune::YaspIntersection::YGLI\n-GridImp::YGridLevelIterator YGLI\n-Definition yaspgridintersection.hh:34\n-Dune::YaspIntersection::outside\n-Entity outside() const\n-return Entity on the outside of this intersection\n-Definition yaspgridintersection.hh:98\n-Dune::YaspIntersection::boundary\n-bool boundary() const\n-Definition yaspgridintersection.hh:62\n-Dune::YaspIntersection::unitOuterNormal\n-FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-\n-1 > &) const\n-return unit outer normal, this should be dependent on local coordinates for\n-higher order boundary\n-Definition yaspgridintersection.hh:171\n-Dune::YaspIntersection::update\n-void update()\n-Definition yaspgridintersection.hh:40\n+The level of this entity.\n+Definition common/entity.hh:124\n+Dune::Entity::codimension\n+static constexpr int codimension\n+Know your own codimension.\n+Definition common/entity.hh:106\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::size\n+int size(int level, int codim) const\n+Return number of grid entities of a given codim on a given level in this\n+process.\n+Definition common/grid.hh:538\n+Dune::PersistentContainer\n+A class for storing data during an adaptation cycle.\n+Definition utility/persistentcontainer.hh:22\n+Dune::PersistentContainer::Value\n+Base::Value Value\n+Definition utility/persistentcontainer.hh:27\n+Dune::PersistentContainerMap<_G,_G::LocalIdSet,_std::map<_G::LocalIdSet::\n+IdType,_T_>_>::grid\n+const Grid & grid() const\n+Definition persistentcontainermap.hh:114\n+Dune::PersistentContainerMap::size\n+Size size() const\n+Definition persistentcontainermap.hh:85\n+Dune::PersistentContainerVector\n+vector-based implementation of the PersistentContainer\n+Definition persistentcontainervector.hh:51\n+Dune::PersistentContainerVector::Value\n+Vector::value_type Value\n+Definition persistentcontainervector.hh:57\n+Dune::PersistentContainerVector::Grid\n+G Grid\n+Definition persistentcontainervector.hh:55\n+Dune::YaspGrid\n+[ provides Dune::Grid ]\n+Definition yaspgrid.hh:166\n+Dune::YaspPersistentContainerIndex\n+Definition yaspgridpersistentcontainer.hh:35\n+Dune::YaspPersistentContainerIndex::index\n+IndexType index(const Entity &e) const\n+Map entity to index. The result of calling this method with an entity that is\n+not in the index set is...\n+Definition yaspgridpersistentcontainer.hh:49\n+Dune::YaspPersistentContainerIndex::size\n+std::size_t size(int) const\n+Return total number of entities of given geometry type in entity set .\n+Definition yaspgridpersistentcontainer.hh:67\n+Dune::YaspPersistentContainerIndex::subIndex\n+IndexType subIndex(const Entity &e, int i, unsigned int codim) const\n+Map a subentity to an index.\n+Definition yaspgridpersistentcontainer.hh:58\n+Dune::YaspPersistentContainerIndex::YaspPersistentContainerIndex\n+YaspPersistentContainerIndex(const Grid &grid, int codim)\n+Definition yaspgridpersistentcontainer.hh:38\n+Dune::YaspPersistentContainerIndex::IndexType\n+std::size_t IndexType\n+The type used for the indices.\n+Definition yaspgridpersistentcontainer.hh:45\n+Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>::Grid\n+Base::Grid Grid\n+Definition yaspgridpersistentcontainer.hh:109\n+Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>::Value\n+Base::Value Value\n+Definition yaspgridpersistentcontainer.hh:110\n+Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>::PersistentContainer\n+PersistentContainer(const Grid &grid, int codim, const Value &value=Value())\n+Definition yaspgridpersistentcontainer.hh:114\n+persistentcontainer.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00188.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00188.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridentityseed.hh File Reference\n+dune-grid: yaspgridhierarchiciterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,35 @@\n
  • dune
  • grid
  • yaspgrid
  • \n
    \n \n
    \n \n-
    yaspgridentityseed.hh File Reference
    \n+
    yaspgridhierarchiciterator.hh File Reference
    \n
    \n
    \n \n-

    The YaspEntitySeed class. \n-More...

    \n-\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspEntitySeed< codim, GridImp >
     Describes the minimal information necessary to create a fully functional YaspEntity. More...
    class  Dune::YaspHierarchicIterator< GridImp >
     YaspHierarchicIterator enables iteration over son entities of codim 0. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The YaspEntitySeed class.

    \n+

    The YaspHierarchicIterator class

    \n+

    Enables iteration over son entities of codim 0

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,23 +2,23 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridentityseed.hh File Reference\n-The YaspEntitySeed class. More...\n+yaspgridhierarchiciterator.hh File Reference\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspEntitySeed<_codim,_GridImp_>\n-\u00a0 Describes the minimal information necessary to create a fully\n- functional YaspEntity. More...\n+class \u00a0 Dune::YaspHierarchicIterator<_GridImp_>\n+\u00a0 YaspHierarchicIterator enables iteration over son entities of codim 0.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The YaspEntitySeed class.\n+The YaspHierarchicIterator class\n+Enables iteration over son entities of codim 0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00188_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00188_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridentityseed.hh Source File\n+dune-grid: yaspgridhierarchiciterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,82 +74,181 @@\n \n \n
    \n
    \n-
    yaspgridentityseed.hh
    \n+
    yaspgridhierarchiciterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDENTITYSEED_HH
    \n-
    6#define DUNE_GRID_YASPGRIDENTITYSEED_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH
    \n+
    6#define DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH
    \n
    7
    \n-
    12namespace Dune {
    \n-
    13
    \n-
    16 template<int codim, class GridImp>
    \n-
    \n-\n-
    18 {
    \n-
    20 constexpr static int dim = GridImp::dimension;
    \n-
    21
    \n-
    22 public:
    \n-
    24 constexpr static int codimension = codim;
    \n-
    25
    \n-
    \n-\n-
    28 : _l(-1), _o(0)
    \n-
    29 {
    \n-
    30 std::fill(_c.begin(),_c.end(),0);
    \n-
    31 }
    \n-
    \n-
    32
    \n-
    \n-
    34 YaspEntitySeed (int level, std::array<int, dim> coord, int o = 0)
    \n-
    35 : _l(level), _c(coord), _o(o)
    \n-
    36 {}
    \n-
    \n-
    37
    \n-
    \n-
    39 bool isValid() const
    \n-
    40 {
    \n-
    41 return _l != -1;
    \n-
    42 }
    \n-
    \n-
    43
    \n-
    44 int level () const { return _l; }
    \n-
    45 const std::array<int, dim> & coord() const { return _c; }
    \n-
    46 int offset () const { return _o; }
    \n+
    14namespace Dune {
    \n+
    15
    \n+
    18 template<class GridImp>
    \n+
    \n+\n+
    20 {
    \n+
    21 constexpr static int dim = GridImp::dimension;
    \n+
    22
    \n+\n+
    24
    \n+
    25 public:
    \n+
    26 // types used from grids
    \n+
    27 typedef typename GridImp::YGridLevelIterator YGLI;
    \n+
    28 typedef typename GridImp::YGrid::Iterator I;
    \n+
    29 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n+
    30
    \n+
    32 YaspHierarchicIterator () : _entity(), _maxlevel(-1), stack() {}
    \n+
    33
    \n+
    \n+
    35 YaspHierarchicIterator (const YGLI& g, const I& it, int maxlevel) :
    \n+
    36 _entity(YaspEntity<0, dim, GridImp>(g,it))
    \n+
    37 {
    \n+
    38 // store reference to entity implementation for better readability
    \n+
    39 YaspEntityImp& entity = _entity.impl();
    \n+
    40 // now iterator points to current cell
    \n+
    41 StackElem se(entity._g);
    \n+
    42 std::copy(entity._it.coord().begin(), entity._it.coord().end(), se.coord.begin());
    \n+
    43 stack.push(se);
    \n+
    44
    \n+
    45 // determine maximum level
    \n+
    46 _maxlevel = std::min(maxlevel,entity._g->mg->maxLevel());
    \n
    47
    \n-
    48 protected:
    \n-
    49 int _l; // grid level
    \n-
    50 std::array<int, dim> _c; // coord in the global grid
    \n-
    51 int _o; // the offset: which YGridComponent, does the entity belong to
    \n-
    52 };
    \n-
    \n+
    48 // if maxlevel not reached then push yourself and sons
    \n+
    49 if (entity._g->level()<_maxlevel)
    \n+
    50 {
    \n+
    51 push_sons();
    \n+
    52 }
    \n
    53
    \n-
    54} // namespace Dune
    \n-
    55
    \n-
    56#endif // DUNE_GRID_YASPGRIDENTITYSEED_HH
    \n+
    54 // and make iterator point to first son if stack is not empty
    \n+
    55 if (!stack.empty())
    \n+
    56 pop_tos();
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    \n+
    60 void increment ()
    \n+
    61 {
    \n+
    62 // sanity check: do nothing when stack is empty
    \n+
    63 if (stack.empty()) return;
    \n+
    64
    \n+
    65 // if maxlevel not reached then push sons
    \n+
    66 if (_entity.impl()._g->level()<_maxlevel)
    \n+
    67 push_sons();
    \n+
    68
    \n+
    69 // in any case pop one element
    \n+
    70 pop_tos();
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    \n+
    74 bool equals (const YaspHierarchicIterator& rhs) const
    \n+
    75 {
    \n+
    76 return (_entity == rhs._entity);
    \n+
    77 }
    \n+
    \n+
    78
    \n+
    \n+
    80 const Entity& dereference() const
    \n+
    81 {
    \n+
    82 return _entity;
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    \n+
    85 void print (std::ostream& s) const
    \n+
    86 {
    \n+
    87 // store reference to entity implementation for better readability
    \n+
    88 YaspEntityImp& entity = _entity.impl();
    \n+
    89 s << "HIER: " << "level=" << entity._g.level()
    \n+
    90 << " position=" << entity._it.coord()
    \n+
    91 << " superindex=" << entity._it.superindex()
    \n+
    92 << " maxlevel=" << entity._maxlevel
    \n+
    93 << " stacksize=" << stack.size()
    \n+
    94 << std::endl;
    \n+
    95 }
    \n+
    \n+
    96
    \n+
    97 private:
    \n+
    98 Entity _entity;
    \n+
    99
    \n+
    100 int _maxlevel;
    \n+
    101
    \n+
    102 struct StackElem {
    \n+
    103 YGLI g; // grid level of the element
    \n+
    104 std::array<int,dim> coord; // and the coordinates
    \n+
    105 StackElem(YGLI gg) : g(gg) {}
    \n+
    106 };
    \n+
    107 std::stack<StackElem> stack;
    \n+
    108
    \n+
    109 // push sons of current element on the stack
    \n+
    110 void push_sons ()
    \n+
    111 {
    \n+
    112 // store reference to entity implementation for better readability
    \n+
    113 YaspEntityImp& entity = _entity.impl();
    \n+
    114
    \n+
    115 // yes, process all 1<<dim sons
    \n+
    116 YGLI finer = entity._g;
    \n+
    117 ++finer;
    \n+
    118 StackElem se(finer);
    \n+
    119 for (int i=0; i<(1<<dim); i++)
    \n+
    120 {
    \n+
    121 for (int k=0; k<dim; k++)
    \n+
    122 if (i&(1<<k))
    \n+
    123 se.coord[k] = entity._it.coord(k)*2+1;
    \n+
    124 else
    \n+
    125 se.coord[k] = entity._it.coord(k)*2;
    \n+
    126 // not all entities have 2^d subentities due to refineOptions with keep_ovlp==false
    \n+
    127 bool exists = true;
    \n+
    128 for (int k=0; k<dim; k++)
    \n+
    129 if ((se.coord[k] < finer->overlap[0].dataBegin()->origin(k)) || (se.coord[k] >= finer->overlap[0].dataBegin()->origin(k)+finer->overlap[0].dataBegin()->size(k)))
    \n+
    130 exists = false;
    \n+
    131 if (exists)
    \n+
    132 stack.push(se);
    \n+
    133 }
    \n+
    134 }
    \n+
    135
    \n+
    136 // make TOS the current element
    \n+
    137 void pop_tos ()
    \n+
    138 {
    \n+
    139 StackElem se = stack.top();
    \n+
    140 stack.pop();
    \n+
    141 YaspEntityImp& entity = _entity.impl();
    \n+
    142 entity._g = se.g;
    \n+
    143 entity._it.reinit(entity._g->overlap[0],se.coord);
    \n+
    144 }
    \n+
    145 };
    \n+
    \n+
    146
    \n+
    147} // namespace Dune
    \n+
    148
    \n+
    149#endif // DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Describes the minimal information necessary to create a fully functional YaspEntity.
    Definition yaspgridentityseed.hh:18
    \n-
    int _o
    Definition yaspgridentityseed.hh:51
    \n-
    std::array< int, dim > _c
    Definition yaspgridentityseed.hh:50
    \n-
    int _l
    Definition yaspgridentityseed.hh:49
    \n-
    int level() const
    Definition yaspgridentityseed.hh:44
    \n-
    YaspEntitySeed()
    default construct an invalid entity seed
    Definition yaspgridentityseed.hh:27
    \n-
    YaspEntitySeed(int level, std::array< int, dim > coord, int o=0)
    constructor
    Definition yaspgridentityseed.hh:34
    \n-
    int offset() const
    Definition yaspgridentityseed.hh:46
    \n-
    static constexpr int codimension
    codimension of entity
    Definition yaspgridentityseed.hh:24
    \n-
    const std::array< int, dim > & coord() const
    Definition yaspgridentityseed.hh:45
    \n-
    bool isValid() const
    check whether the EntitySeed refers to a valid Entity
    Definition yaspgridentityseed.hh:39
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Implementation & impl()
    access to the underlying implementation
    Definition common/entity.hh:80
    \n+
    Definition yaspgridentity.hh:242
    \n+
    YGLI _g
    Definition yaspgridentity.hh:400
    \n+
    I _it
    Definition yaspgridentity.hh:399
    \n+
    YaspHierarchicIterator enables iteration over son entities of codim 0.
    Definition yaspgridhierarchiciterator.hh:20
    \n+
    YaspHierarchicIterator()
    default constructor creating empty iterator
    Definition yaspgridhierarchiciterator.hh:32
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Definition yaspgridhierarchiciterator.hh:29
    \n+
    void print(std::ostream &s) const
    Definition yaspgridhierarchiciterator.hh:85
    \n+
    GridImp::YGrid::Iterator I
    Definition yaspgridhierarchiciterator.hh:28
    \n+
    const Entity & dereference() const
    dereferencing
    Definition yaspgridhierarchiciterator.hh:80
    \n+
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridhierarchiciterator.hh:27
    \n+
    void increment()
    increment
    Definition yaspgridhierarchiciterator.hh:60
    \n+
    bool equals(const YaspHierarchicIterator &rhs) const
    equality
    Definition yaspgridhierarchiciterator.hh:74
    \n+
    YaspHierarchicIterator(const YGLI &g, const I &it, int maxlevel)
    constructor
    Definition yaspgridhierarchiciterator.hh:35
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,98 +1,205 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridentityseed.hh\n+yaspgridhierarchiciterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDENTITYSEED_HH\n-6#define DUNE_GRID_YASPGRIDENTITYSEED_HH\n+5#ifndef DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH\n+6#define DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH\n 7\n-12namespace Dune {\n-13\n-16 template\n-17 class YaspEntitySeed\n-18 {\n-20 constexpr static int dim = GridImp::dimension;\n-21\n-22 public:\n-24 constexpr static int codimension = codim;\n-25\n-27 YaspEntitySeed ()\n-28 : _l(-1), _o(0)\n-29 {\n-30 std::fill(_c.begin(),_c.end(),0);\n-31 }\n-32\n-34 YaspEntitySeed (int level, std::array coord, int o = 0)\n-35 : _l(level), _c(coord), _o(o)\n-36 {}\n-37\n-39 bool isValid() const\n-40 {\n-41 return _l != -1;\n-42 }\n-43\n-44 int level () const { return _l; }\n-45 const std::array & coord() const { return _c; }\n-46 int offset () const { return _o; }\n+14namespace Dune {\n+15\n+18 template\n+19 class YaspHierarchicIterator\n+20 {\n+21 constexpr static int dim = GridImp::dimension;\n+22\n+23 typedef YaspEntity<0,GridImp::dimension,GridImp> YaspEntityImp;\n+24\n+25 public:\n+26 // types used from grids\n+27 typedef typename GridImp::YGridLevelIterator YGLI;\n+28 typedef typename GridImp::YGrid::Iterator I;\n+29 typedef typename GridImp::template Codim<0>::Entity Entity;\n+30\n+32 YaspHierarchicIterator () : _entity(), _maxlevel(-1), stack() {}\n+33\n+35 YaspHierarchicIterator (const YGLI& g, const I& it, int maxlevel) :\n+36 _entity(YaspEntity<0, dim, GridImp>(g,it))\n+37 {\n+38 // store reference to entity implementation for better readability\n+39 YaspEntityImp& entity = _entity.impl();\n+40 // now iterator points to current cell\n+41 StackElem se(entity._g);\n+42 std::copy(entity._it.coord().begin(), entity._it.coord().end(),\n+se.coord.begin());\n+43 stack.push(se);\n+44\n+45 // determine maximum level\n+46 _maxlevel = std::min(maxlevel,entity._g->mg->maxLevel());\n 47\n-48 protected:\n-49 int _l; // grid level\n-50 std::array _c; // coord in the global grid\n-51 int _o; // the offset: which YGridComponent, does the entity belong to\n-52 };\n+48 // if maxlevel not reached then push yourself and sons\n+49 if (entity._g->level()<_maxlevel)\n+50 {\n+51 push_sons();\n+52 }\n 53\n-54} // namespace Dune\n-55\n-56#endif // DUNE_GRID_YASPGRIDENTITYSEED_HH\n+54 // and make iterator point to first son if stack is not empty\n+55 if (!stack.empty())\n+56 pop_tos();\n+57 }\n+58\n+60 void increment ()\n+61 {\n+62 // sanity check: do nothing when stack is empty\n+63 if (stack.empty()) return;\n+64\n+65 // if maxlevel not reached then push sons\n+66 if (_entity.impl()._g->level()<_maxlevel)\n+67 push_sons();\n+68\n+69 // in any case pop one element\n+70 pop_tos();\n+71 }\n+72\n+74 bool equals (const YaspHierarchicIterator& rhs) const\n+75 {\n+76 return (_entity == rhs._entity);\n+77 }\n+78\n+80 const Entity& dereference() const\n+81 {\n+82 return _entity;\n+83 }\n+84\n+85 void print (std::ostream& s) const\n+86 {\n+87 // store reference to entity implementation for better readability\n+88 YaspEntityImp& entity = _entity.impl();\n+89 s << \"HIER: \" << \"level=\" << entity._g.level()\n+90 << \" position=\" << entity._it.coord()\n+91 << \" superindex=\" << entity._it.superindex()\n+92 << \" maxlevel=\" << entity._maxlevel\n+93 << \" stacksize=\" << stack.size()\n+94 << std::endl;\n+95 }\n+96\n+97 private:\n+98 Entity _entity;\n+99\n+100 int _maxlevel;\n+101\n+102 struct StackElem {\n+103 YGLI g; // grid level of the element\n+104 std::array coord; // and the coordinates\n+105 StackElem(YGLI gg) : g(gg) {}\n+106 };\n+107 std::stack stack;\n+108\n+109 // push sons of current element on the stack\n+110 void push_sons ()\n+111 {\n+112 // store reference to entity implementation for better readability\n+113 YaspEntityImp& entity = _entity.impl();\n+114\n+115 // yes, process all 1<overlap[0].dataBegin()->origin(k)) || (se.coord\n+[k] >= finer->overlap[0].dataBegin()->origin(k)+finer->overlap[0].dataBegin()-\n+>size(k)))\n+130 exists = false;\n+131 if (exists)\n+132 stack.push(se);\n+133 }\n+134 }\n+135\n+136 // make TOS the current element\n+137 void pop_tos ()\n+138 {\n+139 StackElem se = stack.top();\n+140 stack.pop();\n+141 YaspEntityImp& entity = _entity.impl();\n+142 entity._g = se.g;\n+143 entity._it.reinit(entity._g->overlap[0],se.coord);\n+144 }\n+145 };\n+146\n+147} // namespace Dune\n+148\n+149#endif // DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::YaspEntitySeed\n-Describes the minimal information necessary to create a fully functional\n-YaspEntity.\n-Definition yaspgridentityseed.hh:18\n-Dune::YaspEntitySeed::_o\n-int _o\n-Definition yaspgridentityseed.hh:51\n-Dune::YaspEntitySeed::_c\n-std::array< int, dim > _c\n-Definition yaspgridentityseed.hh:50\n-Dune::YaspEntitySeed::_l\n-int _l\n-Definition yaspgridentityseed.hh:49\n-Dune::YaspEntitySeed::level\n-int level() const\n-Definition yaspgridentityseed.hh:44\n-Dune::YaspEntitySeed::YaspEntitySeed\n-YaspEntitySeed()\n-default construct an invalid entity seed\n-Definition yaspgridentityseed.hh:27\n-Dune::YaspEntitySeed::YaspEntitySeed\n-YaspEntitySeed(int level, std::array< int, dim > coord, int o=0)\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::impl\n+Implementation & impl()\n+access to the underlying implementation\n+Definition common/entity.hh:80\n+Dune::YaspEntity\n+Definition yaspgridentity.hh:242\n+Dune::YaspEntity::_g\n+YGLI _g\n+Definition yaspgridentity.hh:400\n+Dune::YaspEntity::_it\n+I _it\n+Definition yaspgridentity.hh:399\n+Dune::YaspHierarchicIterator\n+YaspHierarchicIterator enables iteration over son entities of codim 0.\n+Definition yaspgridhierarchiciterator.hh:20\n+Dune::YaspHierarchicIterator::YaspHierarchicIterator\n+YaspHierarchicIterator()\n+default constructor creating empty iterator\n+Definition yaspgridhierarchiciterator.hh:32\n+Dune::YaspHierarchicIterator::Entity\n+GridImp::template Codim< 0 >::Entity Entity\n+Definition yaspgridhierarchiciterator.hh:29\n+Dune::YaspHierarchicIterator::print\n+void print(std::ostream &s) const\n+Definition yaspgridhierarchiciterator.hh:85\n+Dune::YaspHierarchicIterator::I\n+GridImp::YGrid::Iterator I\n+Definition yaspgridhierarchiciterator.hh:28\n+Dune::YaspHierarchicIterator::dereference\n+const Entity & dereference() const\n+dereferencing\n+Definition yaspgridhierarchiciterator.hh:80\n+Dune::YaspHierarchicIterator::YGLI\n+GridImp::YGridLevelIterator YGLI\n+Definition yaspgridhierarchiciterator.hh:27\n+Dune::YaspHierarchicIterator::increment\n+void increment()\n+increment\n+Definition yaspgridhierarchiciterator.hh:60\n+Dune::YaspHierarchicIterator::equals\n+bool equals(const YaspHierarchicIterator &rhs) const\n+equality\n+Definition yaspgridhierarchiciterator.hh:74\n+Dune::YaspHierarchicIterator::YaspHierarchicIterator\n+YaspHierarchicIterator(const YGLI &g, const I &it, int maxlevel)\n constructor\n-Definition yaspgridentityseed.hh:34\n-Dune::YaspEntitySeed::offset\n-int offset() const\n-Definition yaspgridentityseed.hh:46\n-Dune::YaspEntitySeed::codimension\n-static constexpr int codimension\n-codimension of entity\n-Definition yaspgridentityseed.hh:24\n-Dune::YaspEntitySeed::coord\n-const std::array< int, dim > & coord() const\n-Definition yaspgridentityseed.hh:45\n-Dune::YaspEntitySeed::isValid\n-bool isValid() const\n-check whether the EntitySeed refers to a valid Entity\n-Definition yaspgridentityseed.hh:39\n+Definition yaspgridhierarchiciterator.hh:35\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00194.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00194.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridgeometry.hh File Reference\n+dune-grid: yaspgrididset.hh File Reference\n \n \n \n \n \n \n \n@@ -72,46 +72,32 @@\n
  • dune
  • grid
  • yaspgrid
  • \n \n \n
    \n \n-
    yaspgridgeometry.hh File Reference
    \n+
    yaspgrididset.hh File Reference
    \n
    \n
    \n \n-

    The YaspGeometry class and its specializations. \n-More...

    \n-\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspGeometry< mydim, cdim, GridImp >
     The general version that handles all codimensions but 0 and dim. More...
     
    class  Dune::YaspGeometry< mydim, mydim, GridImp >
     specialize for dim=dimworld, i.e. a volume element More...
     
    class  Dune::YaspGeometry< 0, cdim, GridImp >
     specialization for dim=0, this is a vertex More...
    class  Dune::YaspGlobalIdSet< GridImp >
     persistent, globally unique Ids More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-

    Detailed Description

    \n-

    The YaspGeometry class and its specializations.

    \n-

    YaspGeometry realizes the concept of the geometric part of a mesh entity.

    \n-

    We have specializations for dim == dimworld (elements) and dim == 0 (vertices). The general version implements all other codimensions.

    \n-

    As of September 2014, the functionality of YaspGeometry is identical to that of AxisAlignedCubeGeometry. The latter cannot be used directly due to the grid interface facade construction (it isn't templated to the GridImp). As soon as template aliases are available, this header boils down to one line.

    \n-
    \n+\n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,36 +2,19 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridgeometry.hh File Reference\n-The YaspGeometry class and its specializations. More...\n+yaspgrididset.hh File Reference\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspGeometry<_mydim,_cdim,_GridImp_>\n-\u00a0 The general version that handles all codimensions but 0 and dim.\n- More...\n-\u00a0\n-class \u00a0 Dune::YaspGeometry<_mydim,_mydim,_GridImp_>\n-\u00a0 specialize for dim=dimworld, i.e. a volume element More...\n-\u00a0\n-class \u00a0 Dune::YaspGeometry<_0,_cdim,_GridImp_>\n-\u00a0 specialization for dim=0, this is a vertex More...\n+class \u00a0 Dune::YaspGlobalIdSet<_GridImp_>\n+\u00a0 persistent, globally unique Ids More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-The YaspGeometry class and its specializations.\n-YaspGeometry realizes the concept of the geometric part of a mesh entity.\n-We have specializations for dim == dimworld (elements) and dim == 0 (vertices).\n-The general version implements all other codimensions.\n-As of September 2014, the functionality of YaspGeometry is identical to that of\n-AxisAlignedCubeGeometry. The latter cannot be used directly due to the grid\n-interface facade construction (it isn't templated to the GridImp). As soon as\n-template aliases are available, this header boils down to one line.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00194_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00194_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridgeometry.hh Source File\n+dune-grid: yaspgrididset.hh Source File\n \n \n \n \n \n \n \n@@ -74,97 +74,88 @@\n \n \n \n
    \n-
    yaspgridgeometry.hh
    \n+
    yaspgrididset.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDGEOMETRY_HH
    \n-
    6#define DUNE_GRID_YASPGRIDGEOMETRY_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDIDSET_HH
    \n+
    6#define DUNE_GRID_YASPGRIDIDSET_HH
    \n
    7
    \n-
    23namespace Dune {
    \n-
    24
    \n-
    29 template<int mydim,int cdim, class GridImp>
    \n-
    \n-
    30 class YaspGeometry : public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,cdim>
    \n-
    31 {
    \n-
    32 public:
    \n-
    34 typedef typename GridImp::ctype ctype;
    \n-
    35
    \n-
    \n-
    37 YaspGeometry (const FieldVector<ctype, cdim>& ll, const FieldVector<ctype, cdim>& ur, const std::bitset<cdim>& shift)
    \n-
    38 : AxisAlignedCubeGeometry<ctype,mydim,cdim>(ll,ur,shift)
    \n-
    39 {
    \n-
    40 assert(mydim == shift.count());
    \n-
    41 }
    \n-
    \n-
    42 };
    \n-
    \n-
    43
    \n-
    45 template<int mydim, class GridImp>
    \n-
    \n-
    46 class YaspGeometry<mydim,mydim,GridImp> : public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,mydim>
    \n-
    47 {
    \n-
    48 public:
    \n-
    49 typedef typename GridImp::ctype ctype;
    \n-
    50
    \n-
    \n-
    52 YaspGeometry (const FieldVector<ctype, mydim>& ll, const FieldVector<ctype, mydim>& ur)
    \n-
    53 : AxisAlignedCubeGeometry<ctype,mydim,mydim>(ll,ur)
    \n-
    54 {}
    \n-
    \n-
    55
    \n-
    \n-\n-
    58 : AxisAlignedCubeGeometry<ctype,mydim,mydim>(other)
    \n-
    59 {}
    \n+
    8
    \n+
    9namespace Dune {
    \n+
    10
    \n+
    11 //========================================================================
    \n+
    16 //========================================================================
    \n+
    17
    \n+
    18 template<class GridImp>
    \n+
    \n+
    19 class YaspGlobalIdSet : public IdSet<GridImp,YaspGlobalIdSet<GridImp>,
    \n+
    20 typename std::remove_const<GridImp>::type::PersistentIndexType >
    \n+
    21 /*
    \n+
    22 We used the remove_const to extract the Type from the mutable class,
    \n+
    23 because the const class is not instantiated yet.
    \n+
    24 */
    \n+
    25 {
    \n+\n+
    27
    \n+
    28 public:
    \n+
    30 typedef typename std::remove_const<GridImp>::type::PersistentIndexType IdType;
    \n+
    31
    \n+
    32 using IdSet<GridImp, This, IdType>::subId;
    \n+
    33
    \n+
    \n+\n+
    36 {}
    \n+
    \n+
    37
    \n+
    39 /*
    \n+
    40 We use the remove_const to extract the Type from the mutable class,
    \n+
    41 because the const class is not instantiated yet.
    \n+
    42 */
    \n+
    43 template<int cd>
    \n+
    \n+
    44 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
    \n+
    45 {
    \n+
    46 return e.impl().persistentIndex();
    \n+
    47 }
    \n+
    \n+
    48
    \n+
    50 /*
    \n+
    51 We use the remove_const to extract the Type from the mutable class,
    \n+
    52 because the const class is not instantiated yet.
    \n+
    53 */
    \n+
    \n+
    54 IdType subId (const typename std::remove_const<GridImp>::type::Traits::template Codim< 0 >::Entity &e,
    \n+
    55 int i, unsigned int codim ) const
    \n+
    56 {
    \n+
    57 return e.impl().subPersistentIndex(i,codim);
    \n+
    58 }
    \n
    \n+
    59
    \n
    60 };
    \n
    \n
    61
    \n-
    63 template<int cdim, class GridImp>
    \n-
    \n-
    64 class YaspGeometry<0,cdim,GridImp> : public AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>
    \n-
    65 {
    \n-
    66 public:
    \n-
    67 typedef typename GridImp::ctype ctype;
    \n-
    68
    \n-
    \n-
    70 explicit YaspGeometry ( const FieldVector< ctype, cdim > &p )
    \n-
    71 : AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>( p )
    \n-
    72 {}
    \n-
    \n-
    73
    \n-
    \n-
    74 YaspGeometry ( const FieldVector< ctype, cdim > &p, const FieldVector< ctype, cdim > &, const std::bitset<cdim> &)
    \n-
    75 : AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>( p )
    \n-
    76 {}
    \n-
    \n-
    77 };
    \n-
    \n-
    78} // namespace Dune
    \n-
    79
    \n-
    80#endif // DUNE_GRID_YASPGRIDGEOMETRY_HH
    \n+
    62} // namespace Dune
    \n+
    63
    \n+
    64#endif // DUNE_GRID_YASPGRIDIDSET_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    The general version that handles all codimensions but 0 and dim.
    Definition yaspgridgeometry.hh:31
    \n-
    YaspGeometry(const FieldVector< ctype, cdim > &ll, const FieldVector< ctype, cdim > &ur, const std::bitset< cdim > &shift)
    constructor from midpoint and extension and a bitset defining which unit vectors span the entity
    Definition yaspgridgeometry.hh:37
    \n-
    GridImp::ctype ctype
    define type used for coordinates in grid module
    Definition yaspgridgeometry.hh:34
    \n-
    YaspGeometry(const YaspGeometry &other)
    copy constructor (skipping temporary variables)
    Definition yaspgridgeometry.hh:57
    \n-
    GridImp::ctype ctype
    Definition yaspgridgeometry.hh:49
    \n-
    YaspGeometry(const FieldVector< ctype, mydim > &ll, const FieldVector< ctype, mydim > &ur)
    constructor from midpoint and extension
    Definition yaspgridgeometry.hh:52
    \n-
    YaspGeometry(const FieldVector< ctype, cdim > &p, const FieldVector< ctype, cdim > &, const std::bitset< cdim > &)
    Definition yaspgridgeometry.hh:74
    \n-
    YaspGeometry(const FieldVector< ctype, cdim > &p)
    constructor
    Definition yaspgridgeometry.hh:70
    \n-
    GridImp::ctype ctype
    Definition yaspgridgeometry.hh:67
    \n+
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n+
    persistent, globally unique Ids
    Definition yaspgrididset.hh:25
    \n+
    IdType subId(const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    get id of subentity
    Definition yaspgrididset.hh:54
    \n+
    std::remove_const< GridImp >::type::PersistentIndexType IdType
    define the type used for persistent indices
    Definition yaspgrididset.hh:30
    \n+
    YaspGlobalIdSet()
    Only default-constructible.
    Definition yaspgrididset.hh:35
    \n+
    IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
    get id of an entity
    Definition yaspgrididset.hh:44
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,111 +1,98 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridgeometry.hh\n+yaspgrididset.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDGEOMETRY_HH\n-6#define DUNE_GRID_YASPGRIDGEOMETRY_HH\n+5#ifndef DUNE_GRID_YASPGRIDIDSET_HH\n+6#define DUNE_GRID_YASPGRIDIDSET_HH\n 7\n-23namespace Dune {\n-24\n-29 template\n-30 class YaspGeometry : public AxisAlignedCubeGeometry\n-31 {\n-32 public:\n-34 typedef typename GridImp::ctype ctype;\n-35\n-37 YaspGeometry (const FieldVector& ll, const FieldVector& ur, const std::bitset& shift)\n-38 : AxisAlignedCubeGeometry(ll,ur,shift)\n-39 {\n-40 assert(mydim == shift.count());\n-41 }\n-42 };\n-43\n-45 template\n-46 class YaspGeometry : public\n-AxisAlignedCubeGeometry\n-47 {\n-48 public:\n-49 typedef typename GridImp::ctype ctype;\n-50\n-52 YaspGeometry (const FieldVector& ll, const FieldVector& ur)\n-53 : AxisAlignedCubeGeometry(ll,ur)\n-54 {}\n-55\n-57 YaspGeometry (const YaspGeometry& other)\n-58 : AxisAlignedCubeGeometry(other)\n-59 {}\n+8\n+9namespace Dune {\n+10\n+11 //========================================================================\n+16 //========================================================================\n+17\n+18 template\n+19 class YaspGlobalIdSet : public IdSet,\n+20 typename std::remove_const::type::PersistentIndexType >\n+21 /*\n+22 We used the remove_const to extract the Type from the mutable class,\n+23 because the const class is not instantiated yet.\n+24 */\n+25 {\n+26 typedef YaspGlobalIdSet<_GridImp_> This;\n+27\n+28 public:\n+30 typedef typename std::remove_const::type::PersistentIndexType\n+IdType;\n+31\n+32 using IdSet::subId;\n+33\n+35 YaspGlobalIdSet()\n+36 {}\n+37\n+39 /*\n+40 We use the remove_const to extract the Type from the mutable class,\n+41 because the const class is not instantiated yet.\n+42 */\n+43 template\n+44 IdType id (const typename std::remove_const::type::Traits::template\n+Codim::Entity& e) const\n+45 {\n+46 return e.impl().persistentIndex();\n+47 }\n+48\n+50 /*\n+51 We use the remove_const to extract the Type from the mutable class,\n+52 because the const class is not instantiated yet.\n+53 */\n+54 IdType subId (const typename std::remove_const::type::Traits::\n+template Codim< 0 >::Entity &e,\n+55 int i, unsigned int codim ) const\n+56 {\n+57 return e.impl().subPersistentIndex(i,codim);\n+58 }\n+59\n 60 };\n 61\n-63 template\n-64 class YaspGeometry<0,cdim,GridImp> : public AxisAlignedCubeGeometry\n-65 {\n-66 public:\n-67 typedef typename GridImp::ctype ctype;\n-68\n-70 explicit YaspGeometry ( const FieldVector< ctype, cdim > &p )\n-71 : AxisAlignedCubeGeometry( p )\n-72 {}\n-73\n-74 YaspGeometry ( const FieldVector< ctype, cdim > &p, const FieldVector<\n-ctype, cdim > &, const std::bitset &)\n-75 : AxisAlignedCubeGeometry( p )\n-76 {}\n-77 };\n-78} // namespace Dune\n-79\n-80#endif // DUNE_GRID_YASPGRIDGEOMETRY_HH\n+62} // namespace Dune\n+63\n+64#endif // DUNE_GRID_YASPGRIDIDSET_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::YaspGeometry\n-The general version that handles all codimensions but 0 and dim.\n-Definition yaspgridgeometry.hh:31\n-Dune::YaspGeometry::YaspGeometry\n-YaspGeometry(const FieldVector< ctype, cdim > &ll, const FieldVector< ctype,\n-cdim > &ur, const std::bitset< cdim > &shift)\n-constructor from midpoint and extension and a bitset defining which unit\n-vectors span the entity\n-Definition yaspgridgeometry.hh:37\n-Dune::YaspGeometry::ctype\n-GridImp::ctype ctype\n-define type used for coordinates in grid module\n-Definition yaspgridgeometry.hh:34\n-Dune::YaspGeometry<_mydim,_mydim,_GridImp_>::YaspGeometry\n-YaspGeometry(const YaspGeometry &other)\n-copy constructor (skipping temporary variables)\n-Definition yaspgridgeometry.hh:57\n-Dune::YaspGeometry<_mydim,_mydim,_GridImp_>::ctype\n-GridImp::ctype ctype\n-Definition yaspgridgeometry.hh:49\n-Dune::YaspGeometry<_mydim,_mydim,_GridImp_>::YaspGeometry\n-YaspGeometry(const FieldVector< ctype, mydim > &ll, const FieldVector< ctype,\n-mydim > &ur)\n-constructor from midpoint and extension\n-Definition yaspgridgeometry.hh:52\n-Dune::YaspGeometry<_0,_cdim,_GridImp_>::YaspGeometry\n-YaspGeometry(const FieldVector< ctype, cdim > &p, const FieldVector< ctype,\n-cdim > &, const std::bitset< cdim > &)\n-Definition yaspgridgeometry.hh:74\n-Dune::YaspGeometry<_0,_cdim,_GridImp_>::YaspGeometry\n-YaspGeometry(const FieldVector< ctype, cdim > &p)\n-constructor\n-Definition yaspgridgeometry.hh:70\n-Dune::YaspGeometry<_0,_cdim,_GridImp_>::ctype\n-GridImp::ctype ctype\n-Definition yaspgridgeometry.hh:67\n+Dune::IdSet\n+Id Set Interface.\n+Definition common/indexidset.hh:447\n+Dune::YaspGlobalIdSet\n+persistent, globally unique Ids\n+Definition yaspgrididset.hh:25\n+Dune::YaspGlobalIdSet::subId\n+IdType subId(const typename std::remove_const< GridImp >::type::Traits::\n+template Codim< 0 >::Entity &e, int i, unsigned int codim) const\n+get id of subentity\n+Definition yaspgrididset.hh:54\n+Dune::YaspGlobalIdSet::IdType\n+std::remove_const< GridImp >::type::PersistentIndexType IdType\n+define the type used for persistent indices\n+Definition yaspgrididset.hh:30\n+Dune::YaspGlobalIdSet::YaspGlobalIdSet\n+YaspGlobalIdSet()\n+Only default-constructible.\n+Definition yaspgrididset.hh:35\n+Dune::YaspGlobalIdSet::id\n+IdType id(const typename std::remove_const< GridImp >::type::Traits::template\n+Codim< cd >::Entity &e) const\n+get id of an entity\n+Definition yaspgrididset.hh:44\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00197.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00197.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridentity.hh File Reference\n+dune-grid: yaspgridgeometry.hh File Reference\n \n \n \n \n \n \n \n@@ -72,52 +72,46 @@\n
  • dune
  • grid
  • yaspgrid
  • \n
    \n
    \n
    \n \n-
    yaspgridentity.hh File Reference
    \n+
    yaspgridgeometry.hh File Reference
    \n
    \n
    \n \n-

    the YaspEntity class and its specializations \n+

    The YaspGeometry class and its specializations. \n More...

    \n-
    #include <dune/common/math.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+\n \n-\n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::YaspEntity< codim, dim, GridImp >
    class  Dune::YaspGeometry< mydim, cdim, GridImp >
     The general version that handles all codimensions but 0 and dim. More...
     
    class  Dune::YaspEntity< 0, dim, GridImp >
    class  Dune::YaspGeometry< mydim, mydim, GridImp >
     specialize for dim=dimworld, i.e. a volume element More...
     
    struct  Dune::YaspEntity< 0, dim, GridImp >::Codim< cd >
     
    class  Dune::YaspEntity< dim, dim, GridImp >
    class  Dune::YaspGeometry< 0, cdim, GridImp >
     specialization for dim=0, this is a vertex More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Yasp
     
    \n

    Detailed Description

    \n-

    the YaspEntity class and its specializations

    \n-

    YaspEntity realizes the concept a mesh entity.

    \n-

    We have specializations for

      \n-
    • codim==0 (elements), because they have an extended interface
    • \n-
    • codim==dim (vertices), because they use a special constructor of the AxisAlignedCubeGeometry and are the only entities in a globally refined grid, that may also exist on another level.
    • \n-
    \n-

    The general version implements all other codimensions.

    \n+

    The YaspGeometry class and its specializations.

    \n+

    YaspGeometry realizes the concept of the geometric part of a mesh entity.

    \n+

    We have specializations for dim == dimworld (elements) and dim == 0 (vertices). The general version implements all other codimensions.

    \n+

    As of September 2014, the functionality of YaspGeometry is identical to that of AxisAlignedCubeGeometry. The latter cannot be used directly due to the grid interface facade construction (it isn't templated to the GridImp). As soon as template aliases are available, this header boils down to one line.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,38 +2,36 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgridentity.hh File Reference\n-the YaspEntity class and its specializations More...\n-#include \n-#include \n+yaspgridgeometry.hh File Reference\n+The YaspGeometry class and its specializations. More...\n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::YaspEntity<_codim,_dim,_GridImp_>\n+class \u00a0 Dune::YaspGeometry<_mydim,_cdim,_GridImp_>\n+\u00a0 The general version that handles all codimensions but 0 and dim.\n+ More...\n \u00a0\n- class \u00a0 Dune::YaspEntity<_0,_dim,_GridImp_>\n+class \u00a0 Dune::YaspGeometry<_mydim,_mydim,_GridImp_>\n+\u00a0 specialize for dim=dimworld, i.e. a volume element More...\n \u00a0\n-struct \u00a0 Dune::YaspEntity<_0,_dim,_GridImp_>::Codim<_cd_>\n-\u00a0\n- class \u00a0 Dune::YaspEntity<_dim,_dim,_GridImp_>\n+class \u00a0 Dune::YaspGeometry<_0,_cdim,_GridImp_>\n+\u00a0 specialization for dim=0, this is a vertex More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::Yasp\n-\u00a0\n ***** Detailed Description *****\n-the YaspEntity class and its specializations\n-YaspEntity realizes the concept a mesh entity.\n-We have specializations for\n- * codim==0 (elements), because they have an extended interface\n- * codim==dim (vertices), because they use a special constructor of the\n- AxisAlignedCubeGeometry and are the only entities in a globally refined\n- grid, that may also exist on another level.\n+The YaspGeometry class and its specializations.\n+YaspGeometry realizes the concept of the geometric part of a mesh entity.\n+We have specializations for dim == dimworld (elements) and dim == 0 (vertices).\n The general version implements all other codimensions.\n+As of September 2014, the functionality of YaspGeometry is identical to that of\n+AxisAlignedCubeGeometry. The latter cannot be used directly due to the grid\n+interface facade construction (it isn't templated to the GridImp). As soon as\n+template aliases are available, this header boils down to one line.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00197_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00197_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridentity.hh Source File\n+dune-grid: yaspgridgeometry.hh Source File\n \n \n \n \n \n \n \n@@ -74,1064 +74,97 @@\n \n \n
    \n
    \n-
    yaspgridentity.hh
    \n+
    yaspgridgeometry.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDENTITY_HH
    \n-
    6#define DUNE_GRID_YASPGRIDENTITY_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDGEOMETRY_HH
    \n+
    6#define DUNE_GRID_YASPGRIDGEOMETRY_HH
    \n
    7
    \n-
    8#include <dune/common/math.hh>
    \n-
    9#include <dune/geometry/type.hh>
    \n-
    10
    \n-
    24//========================================================================
    \n-
    25
    \n-
    26
    \n-
    27
    \n-
    28
    \n-
    29namespace Dune {
    \n-
    30
    \n-
    31 namespace Yasp {
    \n-
    32
    \n-
    33#ifndef DOXYGEN
    \n-
    34
    \n-
    35 // table for quick evaluation of binomial coefficients
    \n-
    36 template<int n>
    \n-
    37 struct BinomialTable
    \n-
    38 {
    \n-
    39 // evaluation - note that in general d!=n, n is only the
    \n-
    40 // maximum value of d (in our case dimworld)
    \n-
    41 static constexpr int evaluate(int d, int c)
    \n-
    42 {
    \n-
    43 return _values[_offsets[d] + c];
    \n-
    44 }
    \n-
    45
    \n-
    46 private:
    \n-
    47 // prevent construction
    \n-
    48 BinomialTable() = delete;
    \n-
    49
    \n-
    50 // compute binomial(r, c) and advance row `r` and column `c`
    \n-
    51 static constexpr int nextValue(int& r, int& c)
    \n-
    52 {
    \n-
    53 const auto result = Dune::binomial(r, c);
    \n-
    54
    \n-
    55 c += 1;
    \n-
    56 if (c > r) {
    \n-
    57 r += 1;
    \n-
    58 c = 0;
    \n-
    59 }
    \n-
    60
    \n-
    61 return result;
    \n-
    62 }
    \n-
    63
    \n-
    64 template<std::size_t... I>
    \n-
    65 static constexpr std::array<int, sizeof...(I)> computeValues(std::index_sequence<I...>)
    \n-
    66 {
    \n-
    67 int r = 0, c = 0;
    \n-
    68 return {{ ((void)I, nextValue(r, c))... }};
    \n-
    69 }
    \n-
    70
    \n-
    71 template<std::size_t... I>
    \n-
    72 static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>)
    \n-
    73 { return {{ (I*(I+1)/2)... }}; }
    \n-
    74
    \n-
    75 static constexpr std::array<int,(n+1)*(n+2)/2> _values = computeValues(std::make_index_sequence<(n+1)*(n+2)/2>{});
    \n-
    76 static constexpr std::array<int,n+1> _offsets = computeOffsets(std::make_index_sequence<n+1>{});
    \n-
    77 };
    \n-
    78
    \n-
    85 template<int dimworld>
    \n-
    86 constexpr int subEnt(int d, int c)
    \n-
    87 {
    \n-
    88 return (d < c ? 0 : BinomialTable<dimworld>::evaluate(d,c) << c);
    \n-
    89 }
    \n-
    90
    \n-
    91 // Make a table mapping all subentities of a codim 0 entity to a value.
    \n-
    92 // F is the functor to be evaluated.
    \n-
    93 template<typename F, int dim>
    \n-
    94 struct EntityShiftTable
    \n-
    95 {
    \n-
    96 typedef std::bitset<dim> value_type;
    \n-
    97
    \n-
    98 static value_type evaluate(int i, int codim)
    \n-
    99 {
    \n-
    100 return {_values[_offsets[codim] + i]};
    \n-
    101 }
    \n-
    102
    \n-
    103 private:
    \n-
    104
    \n-
    105 // prevent construction
    \n-
    106 EntityShiftTable() = delete;
    \n-
    107
    \n-
    108 // compute offset of codimension `codim` entities and advance `offset`
    \n-
    109 static constexpr int nextOffset(int& offset, int codim)
    \n-
    110 {
    \n-
    111 if (codim == 0) {
    \n-
    112 offset = 0;
    \n-
    113 return 0;
    \n-
    114 }
    \n-
    115
    \n-
    116 offset += subEnt<dim>(dim, codim-1);
    \n-
    117 return offset;
    \n-
    118 }
    \n-
    119
    \n-
    120 template<std::size_t... I>
    \n-
    121 static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>)
    \n-
    122 {
    \n-
    123 int offset = 0;
    \n-
    124 return {{ (nextOffset(offset, I))... }};
    \n-
    125 }
    \n-
    126
    \n-
    127 // compute shift table entry for (`codim`, `i`) and advance `codim`, `i`
    \n-
    128 static constexpr unsigned char nextValue(int& codim, int& i)
    \n-
    129 {
    \n-
    130 const auto result = F::evaluate(i, codim);
    \n-
    131
    \n-
    132 i += 1;
    \n-
    133 if (i >= subEnt<dim>(dim, codim)) {
    \n-
    134 codim += 1;
    \n-
    135 i = 0;
    \n-
    136 }
    \n-
    137
    \n-
    138 return result;
    \n-
    139 }
    \n-
    140
    \n-
    141 template<std::size_t... I>
    \n-
    142 static constexpr std::array<unsigned char, sizeof...(I)> computeValues(std::index_sequence<I...>)
    \n-
    143 {
    \n-
    144 int codim = 0, i = 0;
    \n-
    145 return {{ ((void)I, nextValue(codim, i))... }};
    \n-
    146 }
    \n-
    147
    \n-
    148 static constexpr std::array<int,dim+1> _offsets = computeOffsets(std::make_index_sequence<dim+1>{});
    \n-
    149 static constexpr std::array<unsigned char,Dune::power(3,dim)> _values = computeValues(std::make_index_sequence<Dune::power(3,dim)>{});
    \n-
    150
    \n-
    151 };
    \n-
    152
    \n-
    153 // functor for doing the actual entity shift calculation
    \n-
    154 template<int dim>
    \n-
    155 struct calculate_entity_shift
    \n-
    156 {
    \n-
    157 static constexpr unsigned long long evaluate(int index, int cc)
    \n-
    158 {
    \n-
    159 auto result = 0ull;
    \n-
    160 for (int d = dim; d>0; d--)
    \n-
    161 {
    \n-
    162 if (cc == d)
    \n-
    163 return result;
    \n-
    164 if (index < subEnt<dim>(d-1,cc))
    \n-
    165 result |= 1ull << (d-1);
    \n-
    166 else
    \n-
    167 {
    \n-
    168 index = (index - subEnt<dim>(d-1, cc)) % subEnt<dim>(d-1,cc-1);
    \n-
    169 cc--;
    \n-
    170 }
    \n-
    171 }
    \n-
    172 return result;
    \n-
    173 }
    \n-
    174 };
    \n-
    175
    \n-
    184 template<int dim>
    \n-
    185 std::bitset<dim> entityShift(int index, int cc)
    \n-
    186 {
    \n-
    187 return EntityShiftTable<calculate_entity_shift<dim>,dim>::evaluate(index,cc);
    \n-
    188 }
    \n-
    189
    \n-
    190 // functor for doing the actual entity move calculation
    \n-
    191 template<int dim>
    \n-
    192 struct calculate_entity_move
    \n-
    193 {
    \n-
    194 static constexpr unsigned long long evaluate(int index, int cc)
    \n-
    195 {
    \n-
    196 auto result = 0ull;
    \n-
    197 for (int d = dim; d>0; d--)
    \n-
    198 {
    \n-
    199 if (d == cc)
    \n-
    200 {
    \n-
    201 // result[d-1] = index & (1<<(d-1));
    \n-
    202 result &= ~(1ull << (d-1));
    \n-
    203 result |= index & (1ull << (d-1));
    \n-
    204
    \n-
    205 index &= ~(1<<(d-1));
    \n-
    206 }
    \n-
    207 if (index >= subEnt<dim>(d-1,cc))
    \n-
    208 {
    \n-
    209 if ((index - subEnt<dim>(d-1,cc)) / subEnt<dim>(d-1,cc-1) == 1)
    \n-
    210 {
    \n-
    211 result |= 1ull << (d-1);
    \n-
    212 }
    \n-
    213 index = (index - subEnt<dim>(d-1, cc)) % subEnt<dim>(d-1,cc-1);
    \n-
    214 cc--;
    \n-
    215 }
    \n-
    216 }
    \n-
    217 return result;
    \n-
    218 }
    \n-
    219
    \n-
    220 };
    \n-
    221
    \n-
    229 template<int dim>
    \n-
    230 std::bitset<dim> entityMove(int index, int cc)
    \n-
    231 {
    \n-
    232 return EntityShiftTable<calculate_entity_move<dim>,dim>::evaluate(index,cc);
    \n-
    233 }
    \n-
    234
    \n-
    235#endif //DOXYGEN
    \n-
    236
    \n-
    237 } // namespace Yasp.
    \n-
    238
    \n-
    239 template<int codim, int dim, class GridImp>
    \n-
    \n-\n-
    241 : public EntityDefaultImplementation <codim,dim,GridImp,YaspEntity>
    \n-
    242 {
    \n-
    243
    \n-
    244 template<int, PartitionIteratorType, typename>
    \n-
    245 friend class YaspLevelIterator;
    \n-
    246
    \n-
    247 public:
    \n-
    248 typedef typename GridImp::ctype ctype;
    \n-
    249
    \n-
    250 typedef typename GridImp::template Codim<codim>::Geometry Geometry;
    \n-
    251 typedef typename GridImp::Traits::template Codim<codim>::GeometryImpl GeometryImpl;
    \n-
    252
    \n-
    253 typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;
    \n-
    254
    \n-
    \n-
    256 int level () const
    \n-
    257 {
    \n-
    258 return _g->level();
    \n-
    259 }
    \n-
    \n-
    260
    \n-
    \n-\n-
    265 {
    \n-
    266 return EntitySeed(YaspEntitySeed<codim,GridImp>(_g->level(), _it.coord(), _it.which()));
    \n-
    267 }
    \n-
    \n-
    268
    \n-
    \n-\n-
    271 {
    \n-
    272 GeometryImpl _geometry(_it.lowerleft(),_it.upperright(),_it.shift());
    \n-
    273 return Geometry(_geometry);
    \n-
    274 }
    \n-
    \n-
    275
    \n-
    \n-
    279 constexpr GeometryType type () const
    \n-
    280 {
    \n-
    281 return GeometryTypes::cube(Geometry::mydimension);
    \n-
    282 }
    \n-
    \n-
    283
    \n-
    \n-
    288 unsigned int subEntities (unsigned int cc) const
    \n-
    289 {
    \n-
    290 return Dune::Yasp::subEnt<dim>(dim-codim,cc-codim);
    \n-
    291 }
    \n-
    \n-
    292
    \n-
    \n-\n-
    295 {
    \n-
    296 if (_g->interior[codim].inside(_it.coord(),_it.shift()))
    \n-
    297 return InteriorEntity;
    \n-
    298 if (_g->interiorborder[codim].inside(_it.coord(),_it.shift()))
    \n-
    299 return BorderEntity;
    \n-
    300 if (_g->overlap[codim].inside(_it.coord(),_it.shift()))
    \n-
    301 return OverlapEntity;
    \n-
    302 if (_g->overlapfront[codim].inside(_it.coord(),_it.shift()))
    \n-
    303 return FrontEntity;
    \n-
    304 return GhostEntity;
    \n-
    305 }
    \n-
    \n-
    306
    \n-
    307 typedef typename GridImp::YGridLevelIterator YGLI;
    \n-
    308 typedef typename GridImp::YGrid::Iterator I;
    \n-
    \n-\n-
    310 {}
    \n-
    \n-
    311
    \n-
    \n-
    312 YaspEntity (const YGLI& g, const I& it)
    \n-
    313 : _it(it), _g(g)
    \n-
    314 {}
    \n-
    \n-
    315
    \n-
    \n-
    316 YaspEntity (YGLI&& g, const I&& it)
    \n-
    317 : _it(std::move(it)), _g(std::move(g))
    \n-
    318 {}
    \n-
    \n-
    319
    \n-
    321 bool equals (const YaspEntity& e) const
    \n-
    322 {
    \n-
    323 return _it == e._it && _g == e._g;
    \n-
    324 }
    \n-
    325
    \n-
    326 // IndexSets needs access to the private index methods
    \n-
    327 friend class Dune::YaspIndexSet<GridImp,true>;
    \n-
    328 friend class Dune::YaspIndexSet<GridImp,false>;
    \n-
    329 friend class Dune::YaspGlobalIdSet<GridImp>;
    \n-
    330 typedef typename GridImp::PersistentIndexType PersistentIndexType;
    \n-
    331
    \n-
    \n-\n-
    334 {
    \n-
    335 // get size of global grid (in elements)
    \n-
    336 std::array<int,dim> size;
    \n-
    337
    \n-
    338 for (int i=0; i<dim; i++)
    \n-
    339 {
    \n-
    340 // correct size according to shift
    \n-
    341 size[i] = _g->mg->levelSize(_g->level(), i);
    \n-
    342 if (!_it.shift(i))
    \n-
    343 size[i]++;
    \n-
    344 }
    \n-
    345
    \n-
    346 // encode codim
    \n-
    347 PersistentIndexType id(_it.shift().to_ulong());
    \n-
    348
    \n-
    349 // encode level
    \n-
    350 id = id << yaspgrid_level_bits;
    \n-
    351 id = id+PersistentIndexType(_g->level());
    \n-
    352
    \n-
    353 // encode coordinates
    \n-
    354 for (int i=dim-1; i>=0; i--)
    \n-
    355 {
    \n-
    356 id = id << yaspgrid_dim_bits;
    \n-
    357 id = id+PersistentIndexType(_it.coord(i));
    \n-
    358 }
    \n-
    359
    \n-
    360 return id;
    \n-
    361 }
    \n-
    \n-
    362
    \n-
    \n-
    364 int compressedIndex () const
    \n-
    365 {
    \n-
    366 return _it.superindex();
    \n-
    367 }
    \n-
    \n-
    368
    \n-
    \n-
    370 int subCompressedIndex (int i, unsigned int cc) const
    \n-
    371 {
    \n-
    372 // get the shift of the entity and the subentity
    \n-
    373 // the subentity shift is only available in the space spanned by the entity
    \n-
    374 std::bitset<dim-codim> subent_shift = Dune::Yasp::entityShift<dim-codim>(i,cc-codim);
    \n-
    375 std::bitset<dim-codim> subent_move = Dune::Yasp::entityMove<dim-codim>(i,cc-codim);
    \n-
    376
    \n-
    377 std::bitset<dim> shift = _it.shift();
    \n-
    378 std::array<int, dim> coord = _it.coord();
    \n-
    379 for (int j=0, k=0; j<dim; j++)
    \n-
    380 {
    \n-
    381 if (!shift[j])
    \n-
    382 continue;
    \n-
    383
    \n-
    384 coord[j] += subent_move[k];
    \n-
    385 shift[j] = subent_shift[k];
    \n-
    386 k++;
    \n-
    387 }
    \n-
    388
    \n-
    389 int which = _g->overlapfront[cc].shiftmapping(shift);
    \n-
    390 return _g->overlapfront[cc].superindex(coord,which);
    \n-
    391 }
    \n-
    \n-
    392 public:
    \n-
    393 const I& transformingsubiterator() const { return _it; }
    \n-
    394 const YGLI& gridlevel() const { return _g; }
    \n-\n-
    396 YGLI& gridlevel() { return _g; }
    \n-
    397 const GridImp * yaspgrid() const { return _g->mg; }
    \n-
    398 protected:
    \n-
    399 I _it = {}; // position in the grid level
    \n-
    400 YGLI _g = {}; // access to grid level
    \n-
    401 };
    \n-
    \n-
    402
    \n-
    403
    \n-
    404 // specialization for codim=0
    \n-
    405 template<int dim, class GridImp>
    \n-
    \n-
    406 class YaspEntity<0,dim,GridImp>
    \n-
    407 : public EntityDefaultImplementation <0,dim,GridImp,YaspEntity>
    \n-
    408 {
    \n-
    409 constexpr static int dimworld = GridImp::dimensionworld;
    \n-
    410
    \n-
    411 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
    \n-
    412
    \n-
    413 template<int, PartitionIteratorType, typename>
    \n-
    414 friend class YaspLevelIterator;
    \n-
    415
    \n-
    416 template<typename>
    \n-\n-
    418
    \n-
    419 public:
    \n-
    420 typedef typename GridImp::ctype ctype;
    \n-
    421
    \n-
    422 typedef typename GridImp::YGridLevelIterator YGLI;
    \n-
    423 typedef typename GridImp::YGrid::Iterator I;
    \n-
    424
    \n-
    425 typedef typename GridImp::template Codim< 0 >::Geometry Geometry;
    \n-
    426 typedef typename GridImp::template Codim< 0 >::LocalGeometry LocalGeometry;
    \n-
    427
    \n-
    428 template <int cd>
    \n-
    \n-
    429 struct Codim
    \n-
    430 {
    \n-
    431 typedef typename GridImp::template Codim<cd>::Entity Entity;
    \n-
    432 };
    \n-
    \n-
    433
    \n-
    434 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    435 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
    \n-
    436 typedef typename GridImp::LevelIntersectionIterator IntersectionIterator;
    \n-
    437 typedef typename GridImp::LevelIntersectionIterator LevelIntersectionIterator;
    \n-
    438 typedef typename GridImp::LeafIntersectionIterator LeafIntersectionIterator;
    \n-
    439 typedef typename GridImp::HierarchicIterator HierarchicIterator;
    \n-
    440
    \n-
    442 typedef typename GridImp::PersistentIndexType PersistentIndexType;
    \n-
    443
    \n-
    445 typedef typename GridImp::YGrid::iTupel iTupel;
    \n-
    446
    \n-
    447 // constructor
    \n-
    \n-\n-
    449 {}
    \n-
    \n-
    450
    \n-
    \n-
    451 YaspEntity (const YGLI& g, const I& it)
    \n-
    452 : _it(it), _g(g)
    \n-
    453 {}
    \n-
    \n-
    454
    \n-
    \n-
    455 YaspEntity (const YGLI& g, I&& it)
    \n-
    456 : _it(std::move(it)), _g(g)
    \n-
    457 {}
    \n-
    \n-
    458
    \n-
    \n-
    459 YaspEntity (YGLI&& g, I&& it)
    \n-
    460 : _it(std::move(it)), _g(std::move(g))
    \n-
    461 {}
    \n-
    \n-
    462
    \n-
    \n-
    464 bool equals (const YaspEntity& e) const
    \n-
    465 {
    \n-
    466 return _it == e._it && _g == e._g;
    \n-
    467 }
    \n-
    \n-
    468
    \n-
    470 int level () const { return _g->level(); }
    \n-
    471
    \n-
    \n-
    475 EntitySeed seed () const {
    \n-
    476 return EntitySeed(YaspEntitySeed<0,GridImp>(_g->level(), _it.coord()));
    \n-
    477 }
    \n-
    \n-
    478
    \n-
    \n-\n-
    481 {
    \n-
    482 if (_g->interior[0].inside(_it.coord(),_it.shift()))
    \n-
    483 return InteriorEntity;
    \n-
    484 if (_g->overlap[0].inside(_it.coord(),_it.shift()))
    \n-
    485 return OverlapEntity;
    \n-
    486 DUNE_THROW(GridError, "Impossible GhostEntity");
    \n-
    487 return GhostEntity;
    \n-
    488 }
    \n-
    \n-
    489
    \n-
    \n-\n-
    492 // the element geometry
    \n-
    493 auto ll = _it.lowerleft();
    \n-
    494 auto ur = _it.upperright();
    \n-
    495
    \n-
    496 // If on periodic overlap, transform coordinates by domain size
    \n-
    497 for (int i=0; i<dimworld; i++) {
    \n-
    498 if (gridlevel()->mg->isPeriodic(i)) {
    \n-
    499 int coord = transformingsubiterator().coord(i);
    \n-
    500 if (coord < 0) {
    \n-
    501 auto size = _g->mg->domainSize()[i];
    \n-
    502 ll[i] += size;
    \n-
    503 ur[i] += size;
    \n-
    504 } else if (coord + 1 > gridlevel()->mg->levelSize(gridlevel()->level(),i)) {
    \n-
    505 auto size = _g->mg->domainSize()[i];
    \n-
    506 ll[i] -= size;
    \n-
    507 ur[i] -= size;
    \n-
    508 }
    \n-
    509 }
    \n-
    510 }
    \n-
    511
    \n-
    512 GeometryImpl _geometry(ll,ur);
    \n-
    513 return Geometry( _geometry );
    \n-
    514 }
    \n-
    \n-
    515
    \n-
    \n-
    519 constexpr GeometryType type () const
    \n-
    520 {
    \n-
    521 return GeometryTypes::cube(Geometry::mydimension);
    \n-
    522 }
    \n-
    \n-
    523
    \n-
    \n-
    528 template<int cc> int count () const
    \n-
    529 {
    \n-
    530 return Dune::Yasp::subEnt<dim>(dim,cc);
    \n-
    531 }
    \n-
    \n-
    532
    \n-
    \n-
    537 unsigned int subEntities (unsigned int codim) const
    \n-
    538 {
    \n-
    539 return Dune::Yasp::subEnt<dim>(dim,codim);
    \n-
    540 }
    \n-
    \n-
    541
    \n-
    544 template<int cc>
    \n-
    \n-
    545 typename Codim<cc>::Entity subEntity (int i) const
    \n-
    546 {
    \n-
    547 // calculate move bitset
    \n-
    548 std::bitset<dim> move = Dune::Yasp::entityMove<dim>(i,cc);
    \n-
    549
    \n-
    550 // get the coordinate and modify it
    \n-
    551 iTupel coord = _it.coord();
    \n-
    552 for (int j=0; j<dim; j++)
    \n-
    553 if (move[j])
    \n-
    554 coord[j]++;
    \n-
    555
    \n-
    556 int which = _g->overlapfront[cc].shiftmapping(Dune::Yasp::entityShift<dim>(i,cc));
    \n-
    557 return typename Codim<cc>::Entity(YaspEntity<cc,GridImp::dimension,GridImp>(_g,_g->overlapfront[cc].begin(coord, which)));
    \n-
    558 }
    \n-
    \n-
    559
    \n-
    \n-
    561 Entity father () const
    \n-
    562 {
    \n-
    563 // check if coarse level exists
    \n-
    564 if (_g->level()<=0)
    \n-
    565 DUNE_THROW(GridError, "tried to call father on level 0");
    \n-
    566
    \n-
    567 // yes, get iterator to it
    \n-
    568 YGLI cg(_g);
    \n-
    569 --cg;
    \n-
    570
    \n-
    571 // coordinates of the cell
    \n-
    572 iTupel coord = _it.coord();
    \n-
    573
    \n-
    574 // get coordinates on next coarser level
    \n-
    575 for (int k=0; k<dim; k++) coord[k] = coord[k]/2;
    \n-
    576
    \n-
    577 return Entity(YaspEntity<0,GridImp::dimension,GridImp>(cg,cg->overlap[0].begin(coord)));
    \n-
    578 }
    \n-
    \n-
    579
    \n-
    \n-
    581 bool hasFather () const
    \n-
    582 {
    \n-
    583 return (_g->level()>0);
    \n-
    584 }
    \n-
    \n-
    585
    \n-
    \n-\n-
    589 {
    \n-
    590 // configure one of the 2^dim transformations
    \n-
    591 FieldVector<ctype,dim> ll(0.0),ur(0.5);
    \n-
    592
    \n-
    593 for (int k=0; k<dim; k++)
    \n-
    594 {
    \n-
    595 if (_it.coord(k)%2)
    \n-
    596 {
    \n-
    597 ll[k] = 0.5;
    \n-
    598 ur[k] = 1.0;
    \n-
    599 }
    \n-
    600 }
    \n-
    601
    \n-\n-
    603 }
    \n-
    \n-
    604
    \n-
    605 const I& transformingsubiterator () const { return _it; }
    \n-
    606 const YGLI& gridlevel () const { return _g; }
    \n-\n-
    608 YGLI& gridlevel() { return _g; }
    \n-
    609 const GridImp* yaspgrid () const { return _g->mg; }
    \n-
    610
    \n-
    \n-
    611 bool isLeaf() const
    \n-
    612 {
    \n-
    613 return (_g->level() == yaspgrid()->maxLevel());
    \n-
    614 }
    \n-
    \n-
    615
    \n-
    618 bool isNew () const { return yaspgrid()->adaptRefCount > 0 && yaspgrid()->maxLevel() < _g->level() + yaspgrid()->adaptRefCount; }
    \n-
    619
    \n-
    622 bool mightVanish () const { return false; }
    \n-
    623
    \n-
    \n-\n-
    626 {
    \n-
    627 return YaspIntersectionIterator<GridImp>(*this,false);
    \n-
    628 }
    \n-
    \n-
    629
    \n-
    \n-\n-
    632 {
    \n-
    633 // only if entity is leaf this iterator delivers intersections
    \n-
    634 return YaspIntersectionIterator<GridImp>(*this, ! isLeaf() );
    \n-
    635 }
    \n-
    \n-
    636
    \n-
    \n-\n-
    639 {
    \n-
    640 return ibegin();
    \n-
    641 }
    \n-
    \n-
    642
    \n-
    \n-\n-
    645 {
    \n-
    646 return YaspIntersectionIterator<GridImp>(*this,true);
    \n-
    647 }
    \n-
    \n-
    648
    \n-
    \n-\n-
    651 {
    \n-
    652 return iend();
    \n-
    653 }
    \n-
    \n-
    654
    \n-
    \n-\n-
    657 {
    \n-
    658 return iend();
    \n-
    659 }
    \n-
    \n-
    660
    \n-
    \n-
    665 HierarchicIterator hbegin (int maxlevel) const
    \n-
    666 {
    \n-
    667 return YaspHierarchicIterator<GridImp>(_g,_it,maxlevel);
    \n-
    668 }
    \n-
    \n-
    669
    \n-
    671 HierarchicIterator hend (int /* maxlevel */) const
    \n-
    672 {
    \n-
    673 return YaspHierarchicIterator<GridImp>(_g,_it,_g->level());
    \n-
    674 }
    \n-
    675
    \n-
    676 private:
    \n-
    677 // IndexSets needs access to the private index methods
    \n-
    678 friend class Dune::YaspIndexSet<GridImp,true>;
    \n-
    679 friend class Dune::YaspIndexSet<GridImp,false>;
    \n-
    680 friend class Dune::YaspGlobalIdSet<GridImp>;
    \n-
    681
    \n-\n-
    684 {
    \n-
    685 // encode codim
    \n-
    686 PersistentIndexType id(_it.shift().to_ulong());
    \n-
    687
    \n-
    688 // encode level
    \n-
    689 id = id << yaspgrid_level_bits;
    \n-
    690 id = id+PersistentIndexType(_g->level());
    \n-
    691
    \n-
    692
    \n-
    693 // encode coordinates
    \n-
    694 for (int i=dim-1; i>=0; i--)
    \n-
    695 {
    \n-
    696 id = id << yaspgrid_dim_bits;
    \n-
    697 id = id+PersistentIndexType(_it.coord(i));
    \n-
    698 }
    \n-
    699
    \n-
    700 return id;
    \n-
    701 }
    \n-
    702
    \n-
    704 int compressedIndex () const
    \n-
    705 {
    \n-
    706 return _it.superindex();
    \n-
    707 }
    \n-
    708
    \n-
    710 PersistentIndexType subPersistentIndex (int i, int cc) const
    \n-
    711 {
    \n-
    712 // calculate shift and move bitsets
    \n-
    713 std::bitset<dim> shift = Dune::Yasp::entityShift<dim>(i,cc);
    \n-
    714 std::bitset<dim> move = Dune::Yasp::entityMove<dim>(i,cc);
    \n-
    715
    \n-
    716 int trailing = (cc == dim) ? 1000 : 0;
    \n-
    717
    \n-
    718 std::array<int,dim> size = _g->mg->levelSize(_g->level());
    \n-
    719 std::array<int, dim> coord = _it.coord();
    \n-
    720 for (int j=0; j<dim; j++)
    \n-
    721 {
    \n-
    722 // correct size according to shift
    \n-
    723 if (!shift[j])
    \n-
    724 size[j]++;
    \n-
    725
    \n-
    726 // move the coordinates to the cell on which the entity lives
    \n-
    727 if (move[j])
    \n-
    728 coord[j]++;
    \n-
    729 }
    \n-
    730
    \n-
    731 for (int j=0; j<dim; j++)
    \n-
    732 {
    \n-
    733 // in the codim==dim case, count trailing zeroes.
    \n-
    734 if (cc == dim)
    \n-
    735 {
    \n-
    736 int zeroes = 0;
    \n-
    737 for (int k=0; k<_g->level(); k++)
    \n-
    738 if (coord[j] & (1<<k))
    \n-
    739 break;
    \n-
    740 else
    \n-
    741 zeroes++;
    \n-
    742 trailing = std::min(trailing,zeroes);
    \n-
    743 }
    \n-
    744 }
    \n-
    745
    \n-
    746 // encode codim
    \n-
    747 PersistentIndexType id(shift.to_ulong());
    \n-
    748
    \n-
    749 // encode level
    \n-
    750 id = id << yaspgrid_level_bits;
    \n-
    751 id = id+PersistentIndexType(_g->level()-trailing);
    \n-
    752
    \n-
    753 // encode coordinates
    \n-
    754 for (int j=dim-1; j>=0; j--)
    \n-
    755 {
    \n-
    756 id = id << yaspgrid_dim_bits;
    \n-
    757 id = id+PersistentIndexType(coord[j]>>trailing);
    \n-
    758 }
    \n-
    759
    \n-
    760 return id;
    \n-
    761 }
    \n-
    762
    \n-
    764 int subCompressedIndex (int i, int cc) const
    \n-
    765 {
    \n-
    766 // get shift and move of the subentity in question
    \n-
    767 std::bitset<dim> shift = Dune::Yasp::entityShift<dim>(i,cc);
    \n-
    768 std::bitset<dim> move = Dune::Yasp::entityMove<dim>(i,cc);
    \n-
    769
    \n-
    770 std::array<int, dim> coord = _it.coord();
    \n-
    771 for (int j=0; j<dim; j++)
    \n-
    772 coord[j] += move[j];
    \n-
    773
    \n-
    774 int which = _g->overlapfront[cc].shiftmapping(shift);
    \n-
    775 return _g->overlapfront[cc].superindex(coord,which);
    \n-
    776 }
    \n-
    777
    \n-
    778 I _it = {}; // position in the grid level
    \n-
    779 YGLI _g = {}; // access to grid level
    \n-
    780 };
    \n-
    \n-
    781
    \n-
    782
    \n-
    783 // specialization for codim=dim (vertex)
    \n-
    784 template<int dim, class GridImp>
    \n-
    \n-
    785 class YaspEntity<dim,dim,GridImp>
    \n-
    786 : public EntityDefaultImplementation <dim,dim,GridImp,YaspEntity>
    \n-
    787 {
    \n-
    788 constexpr static int dimworld = GridImp::dimensionworld;
    \n-
    789
    \n-
    790 template<int, PartitionIteratorType, typename>
    \n-
    791 friend class YaspLevelIterator;
    \n-
    792
    \n-
    793 typedef typename GridImp::Traits::template Codim<dim>::GeometryImpl GeometryImpl;
    \n-
    794
    \n-
    795 public:
    \n-
    796 typedef typename GridImp::ctype ctype;
    \n-
    797
    \n-
    798 typedef typename GridImp::YGridLevelIterator YGLI;
    \n-
    799 typedef typename GridImp::YGrid::Iterator I;
    \n-
    800
    \n-
    801 typedef typename GridImp::template Codim<dim>::Geometry Geometry;
    \n-
    802
    \n-
    803 typedef typename GridImp::template Codim<dim>::EntitySeed EntitySeed;
    \n-
    804
    \n-
    806 typedef typename GridImp::PersistentIndexType PersistentIndexType;
    \n-
    807
    \n-
    809 typedef typename GridImp::YGrid::iTupel iTupel;
    \n-
    810
    \n-
    811 // constructor
    \n-
    \n-\n-
    813 {}
    \n-
    \n-
    814
    \n-
    \n-
    815 YaspEntity (const YGLI& g, const I& it)
    \n-
    816 : _it(it), _g(g)
    \n-
    817 {}
    \n-
    \n-
    818
    \n-
    \n-
    819 YaspEntity (YGLI&& g, I&& it)
    \n-
    820 : _it(std::move(it)), _g(std::move(g))
    \n-
    821 {}
    \n-
    \n-
    822
    \n-
    \n-
    824 bool equals (const YaspEntity& e) const
    \n-
    825 {
    \n-
    826 return _it == e._it && _g == e._g;
    \n-
    827 }
    \n-
    \n-
    828
    \n-
    830 int level () const {return _g->level();}
    \n-
    831
    \n-
    \n-
    835 EntitySeed seed () const {
    \n-
    836 return EntitySeed(YaspEntitySeed<dim,GridImp>(_g->level(), _it.coord(), _it.which()));
    \n-
    837 }
    \n-
    \n-
    838
    \n-
    \n-
    843 unsigned int subEntities (unsigned int cc) const
    \n-
    844 {
    \n-
    845 return Dune::Yasp::subEnt<dim>(dim-dim,cc-dim);
    \n-
    846 }
    \n-
    \n-
    847
    \n-
    \n-\n-
    850 GeometryImpl _geometry((_it).lowerleft());
    \n-
    851 return Geometry( _geometry );
    \n-
    852 }
    \n-
    \n-
    853
    \n-
    \n-
    857 constexpr GeometryType type () const
    \n-
    858 {
    \n-
    859 return GeometryTypes::cube(Geometry::mydimension);
    \n-
    860 }
    \n-
    \n-
    861
    \n-
    \n-\n-
    864 {
    \n-
    865 if (_g->interior[dim].inside(_it.coord(),_it.shift()))
    \n-
    866 return InteriorEntity;
    \n-
    867 if (_g->interiorborder[dim].inside(_it.coord(),_it.shift()))
    \n-
    868 return BorderEntity;
    \n-
    869 if (_g->overlap[dim].inside(_it.coord(),_it.shift()))
    \n-
    870 return OverlapEntity;
    \n-
    871 if (_g->overlapfront[dim].inside(_it.coord(),_it.shift()))
    \n-
    872 return FrontEntity;
    \n-
    873 return GhostEntity;
    \n-
    874 }
    \n-
    \n-
    875
    \n-
    877 int subCompressedIndex (int, unsigned int ) const
    \n-
    878 {
    \n-
    879 return compressedIndex();
    \n-
    880 }
    \n-
    881
    \n-
    882 private:
    \n-
    883 // IndexSets needs access to the private index methods
    \n-
    884 friend class Dune::YaspIndexSet<GridImp,true>;
    \n-
    885 friend class Dune::YaspIndexSet<GridImp,false>;
    \n-
    886 friend class Dune::YaspGlobalIdSet<GridImp>;
    \n-
    887
    \n-\n-
    890 {
    \n-
    891 // get coordinate and size of global grid
    \n-
    892 iTupel size = _g->mg->levelSize(_g->level());
    \n-
    893
    \n-
    894 for (int i=0; i<dim; i++)
    \n-
    895 {
    \n-
    896 // we have vertices, add 1 size to all directions
    \n-
    897 size[i]++;
    \n-
    898 }
    \n-
    899
    \n-
    900 // determine min number of trailing zeroes
    \n-
    901 int trailing = 1000;
    \n-
    902 for (int i=0; i<dim; i++)
    \n-
    903 {
    \n-
    904 // count trailing zeros
    \n-
    905 int zeros = 0;
    \n-
    906 for (int j=0; j<_g->level(); j++)
    \n-
    907 if (_it.coord(i)&(1<<j))
    \n-
    908 break;
    \n-
    909 else
    \n-
    910 zeros++;
    \n-
    911 trailing = std::min(trailing,zeros);
    \n-
    912 }
    \n-
    913
    \n-
    914 // determine the level of this vertex
    \n-
    915 int level = _g->level()-trailing;
    \n-
    916
    \n-
    917 // encode codim: shift vector of vertices is 0.
    \n-\n-
    919
    \n-
    920 // encode level
    \n-
    921 id = id << yaspgrid_level_bits;
    \n-
    922 id = id+PersistentIndexType(level);
    \n-
    923
    \n-
    924 // encode coordinates
    \n-
    925 for (int i=dim-1; i>=0; i--)
    \n-
    926 {
    \n-
    927 id = id << yaspgrid_dim_bits;
    \n-
    928 id = id+PersistentIndexType(_it.coord(i)>>trailing);
    \n-
    929 }
    \n-
    930
    \n-
    931 return id;
    \n-
    932 }
    \n-
    933
    \n-
    935 int compressedIndex () const { return _it.superindex();}
    \n-
    936
    \n-
    937 public:
    \n-
    938 const I& transformingsubiterator() const { return _it; }
    \n-
    939 const YGLI& gridlevel() const { return _g; }
    \n-\n-
    941 YGLI& gridlevel() { return _g; }
    \n-
    942
    \n-
    943 const GridImp * yaspgrid() const { return _g->mg; }
    \n-
    944 protected:
    \n-
    945 I _it = {}; // position in the grid level
    \n-
    946 YGLI _g = {}; // access to grid level
    \n-
    947 };
    \n-
    \n-
    948
    \n-
    949} // namespace Dune
    \n-
    950
    \n-
    951#endif // DUNE_GRID_YASPGRIDENTITY_HH
    \n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    @ FrontEntity
    on boundary between overlap and ghost
    Definition gridenums.hh:34
    \n-
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n-
    @ GhostEntity
    ghost entities
    Definition gridenums.hh:35
    \n-
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n-
    @ OverlapEntity
    all entities lying in the overlap zone
    Definition gridenums.hh:33
    \n-
    STL namespace.
    \n+
    23namespace Dune {
    \n+
    24
    \n+
    29 template<int mydim,int cdim, class GridImp>
    \n+
    \n+
    30 class YaspGeometry : public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,cdim>
    \n+
    31 {
    \n+
    32 public:
    \n+
    34 typedef typename GridImp::ctype ctype;
    \n+
    35
    \n+
    \n+
    37 YaspGeometry (const FieldVector<ctype, cdim>& ll, const FieldVector<ctype, cdim>& ur, const std::bitset<cdim>& shift)
    \n+
    38 : AxisAlignedCubeGeometry<ctype,mydim,cdim>(ll,ur,shift)
    \n+
    39 {
    \n+
    40 assert(mydim == shift.count());
    \n+
    41 }
    \n+
    \n+
    42 };
    \n+
    \n+
    43
    \n+
    45 template<int mydim, class GridImp>
    \n+
    \n+
    46 class YaspGeometry<mydim,mydim,GridImp> : public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,mydim>
    \n+
    47 {
    \n+
    48 public:
    \n+
    49 typedef typename GridImp::ctype ctype;
    \n+
    50
    \n+
    \n+
    52 YaspGeometry (const FieldVector<ctype, mydim>& ll, const FieldVector<ctype, mydim>& ur)
    \n+
    53 : AxisAlignedCubeGeometry<ctype,mydim,mydim>(ll,ur)
    \n+
    54 {}
    \n+
    \n+
    55
    \n+
    \n+\n+
    58 : AxisAlignedCubeGeometry<ctype,mydim,mydim>(other)
    \n+
    59 {}
    \n+
    \n+
    60 };
    \n+
    \n+
    61
    \n+
    63 template<int cdim, class GridImp>
    \n+
    \n+
    64 class YaspGeometry<0,cdim,GridImp> : public AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>
    \n+
    65 {
    \n+
    66 public:
    \n+
    67 typedef typename GridImp::ctype ctype;
    \n+
    68
    \n+
    \n+
    70 explicit YaspGeometry ( const FieldVector< ctype, cdim > &p )
    \n+
    71 : AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>( p )
    \n+
    72 {}
    \n+
    \n+
    73
    \n+
    \n+
    74 YaspGeometry ( const FieldVector< ctype, cdim > &p, const FieldVector< ctype, cdim > &, const std::bitset<cdim> &)
    \n+
    75 : AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>( p )
    \n+
    76 {}
    \n+
    \n+
    77 };
    \n+
    \n+
    78} // namespace Dune
    \n+
    79
    \n+
    80#endif // DUNE_GRID_YASPGRIDGEOMETRY_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    const int yaspgrid_level_bits
    Definition yaspgrid.hh:48
    \n-
    const int yaspgrid_dim_bits
    Definition yaspgrid.hh:47
    \n-
    Default Implementations for EntityImp.
    Definition common/entity.hh:542
    \n-
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n-
    static constexpr int mydimension
    geometry dimension
    Definition common/geometry.hh:94
    \n
    The general version that handles all codimensions but 0 and dim.
    Definition yaspgridgeometry.hh:31
    \n-
    Definition yaspgridentity.hh:242
    \n-
    int level() const
    level of this element
    Definition yaspgridentity.hh:256
    \n-
    Geometry geometry() const
    geometry of this entity
    Definition yaspgridentity.hh:270
    \n-
    GridImp::ctype ctype
    Definition yaspgridentity.hh:248
    \n-
    constexpr GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition yaspgridentity.hh:279
    \n-
    PersistentIndexType persistentIndex() const
    globally unique, persistent index
    Definition yaspgridentity.hh:333
    \n-
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:394
    \n-
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:393
    \n-
    YGLI _g
    Definition yaspgridentity.hh:400
    \n-
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:321
    \n-
    PartitionType partitionType() const
    return partition type attribute
    Definition yaspgridentity.hh:294
    \n-
    GridImp::Traits::template Codim< codim >::GeometryImpl GeometryImpl
    Definition yaspgridentity.hh:251
    \n-
    YGLI & gridlevel()
    Definition yaspgridentity.hh:396
    \n-
    int subCompressedIndex(int i, unsigned int cc) const
    subentity compressed index
    Definition yaspgridentity.hh:370
    \n-
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridentity.hh:307
    \n-
    GridImp::YGrid::Iterator I
    Definition yaspgridentity.hh:308
    \n-
    const GridImp * yaspgrid() const
    Definition yaspgridentity.hh:397
    \n-
    GridImp::template Codim< codim >::EntitySeed EntitySeed
    Definition yaspgridentity.hh:253
    \n-
    YaspEntity(YGLI &&g, const I &&it)
    Definition yaspgridentity.hh:316
    \n-
    EntitySeed seed() const
    Return the entity seed which contains sufficient information to generate the entity again and uses as...
    Definition yaspgridentity.hh:264
    \n-
    int compressedIndex() const
    consecutive, codim-wise, level-wise index
    Definition yaspgridentity.hh:364
    \n-
    YaspEntity(const YGLI &g, const I &it)
    Definition yaspgridentity.hh:312
    \n-
    I _it
    Definition yaspgridentity.hh:399
    \n-
    YaspEntity()
    Definition yaspgridentity.hh:309
    \n-
    GridImp::template Codim< codim >::Geometry Geometry
    Definition yaspgridentity.hh:250
    \n-
    GridImp::PersistentIndexType PersistentIndexType
    Definition yaspgridentity.hh:330
    \n-
    unsigned int subEntities(unsigned int cc) const
    Definition yaspgridentity.hh:288
    \n-
    I & transformingsubiterator()
    Definition yaspgridentity.hh:395
    \n-
    Describes the minimal information necessary to create a fully functional YaspEntity.
    Definition yaspgridentityseed.hh:18
    \n-
    Iterates over entities of one grid level.
    Definition yaspgridleveliterator.hh:19
    \n-
    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
    Definition yaspgridintersectioniterator.hh:22
    \n-
    YaspHierarchicIterator enables iteration over son entities of codim 0.
    Definition yaspgridhierarchiciterator.hh:20
    \n-
    Implementation of Level- and LeafIndexSets for YaspGrid.
    Definition yaspgridindexsets.hh:25
    \n-
    persistent, globally unique Ids
    Definition yaspgrididset.hh:25
    \n-
    LeafIntersectionIterator ileafbegin() const
    returns intersection iterator for first intersection
    Definition yaspgridentity.hh:631
    \n-
    GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
    Definition yaspgridentity.hh:426
    \n-
    Codim< cc >::Entity subEntity(int i) const
    Definition yaspgridentity.hh:545
    \n-
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:464
    \n-
    YaspEntity(const YGLI &g, I &&it)
    Definition yaspgridentity.hh:455
    \n-
    int count() const
    Definition yaspgridentity.hh:528
    \n-
    GridImp::template Codim< 0 >::EntitySeed EntitySeed
    Definition yaspgridentity.hh:435
    \n-
    GridImp::PersistentIndexType PersistentIndexType
    define the type used for persistent indices
    Definition yaspgridentity.hh:442
    \n-
    GridImp::YGrid::iTupel iTupel
    define type used for coordinates in grid module
    Definition yaspgridentity.hh:445
    \n-
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:606
    \n-
    IntersectionIterator iend() const
    Reference to one past the last neighbor.
    Definition yaspgridentity.hh:644
    \n-
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:605
    \n-
    GridImp::ctype ctype
    Definition yaspgridentity.hh:420
    \n-
    YGLI & gridlevel()
    Definition yaspgridentity.hh:608
    \n-
    YaspEntity(const YGLI &g, const I &it)
    Definition yaspgridentity.hh:451
    \n-
    const GridImp * yaspgrid() const
    Definition yaspgridentity.hh:609
    \n-
    int level() const
    level of this element
    Definition yaspgridentity.hh:470
    \n-
    GridImp::LeafIntersectionIterator LeafIntersectionIterator
    Definition yaspgridentity.hh:438
    \n-
    YaspEntity(YGLI &&g, I &&it)
    Definition yaspgridentity.hh:459
    \n-
    PartitionType partitionType() const
    return partition type attribute
    Definition yaspgridentity.hh:480
    \n-
    LevelIntersectionIterator ilevelend() const
    Reference to one past the last neighbor.
    Definition yaspgridentity.hh:656
    \n-
    bool mightVanish() const
    Returns true, if entity might disappear during the next call to adapt()
    Definition yaspgridentity.hh:622
    \n-
    GridImp::HierarchicIterator HierarchicIterator
    Definition yaspgridentity.hh:439
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition yaspgridentity.hh:434
    \n-
    LevelIntersectionIterator ilevelbegin() const
    returns intersection iterator for first intersection
    Definition yaspgridentity.hh:638
    \n-
    LeafIntersectionIterator ileafend() const
    Reference to one past the last neighbor.
    Definition yaspgridentity.hh:650
    \n-
    YaspEntity()
    Definition yaspgridentity.hh:448
    \n-
    GridImp::YGrid::Iterator I
    Definition yaspgridentity.hh:423
    \n-
    GridImp::template Codim< 0 >::Geometry Geometry
    Definition yaspgridentity.hh:425
    \n-
    Geometry geometry() const
    geometry of this entity
    Definition yaspgridentity.hh:491
    \n-
    Entity father() const
    Inter-level access to father element on coarser grid. Assumes that meshes are nested.
    Definition yaspgridentity.hh:561
    \n-
    bool isNew() const
    Returns true, if the entity has been created during the last call to adapt()
    Definition yaspgridentity.hh:618
    \n-
    constexpr GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition yaspgridentity.hh:519
    \n-
    EntitySeed seed() const
    Return the entity seed which contains sufficient information to generate the entity again and uses as...
    Definition yaspgridentity.hh:475
    \n-
    HierarchicIterator hbegin(int maxlevel) const
    Definition yaspgridentity.hh:665
    \n-
    IntersectionIterator ibegin() const
    returns intersection iterator for first intersection
    Definition yaspgridentity.hh:625
    \n-
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridentity.hh:422
    \n-
    unsigned int subEntities(unsigned int codim) const
    Definition yaspgridentity.hh:537
    \n-
    LocalGeometry geometryInFather() const
    Definition yaspgridentity.hh:588
    \n-
    GridImp::LevelIntersectionIterator IntersectionIterator
    Definition yaspgridentity.hh:436
    \n-
    GridImp::LevelIntersectionIterator LevelIntersectionIterator
    Definition yaspgridentity.hh:437
    \n-
    I & transformingsubiterator()
    Definition yaspgridentity.hh:607
    \n-
    bool isLeaf() const
    Definition yaspgridentity.hh:611
    \n-
    bool hasFather() const
    returns true if father entity exists
    Definition yaspgridentity.hh:581
    \n-
    GridImp::template Codim< cd >::Entity Entity
    Definition yaspgridentity.hh:431
    \n-
    int level() const
    level of this element
    Definition yaspgridentity.hh:830
    \n-
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:824
    \n-
    YGLI & gridlevel()
    Definition yaspgridentity.hh:941
    \n-
    Geometry geometry() const
    geometry of this entity
    Definition yaspgridentity.hh:849
    \n-
    YaspEntity(const YGLI &g, const I &it)
    Definition yaspgridentity.hh:815
    \n-
    unsigned int subEntities(unsigned int cc) const
    Definition yaspgridentity.hh:843
    \n-
    PartitionType partitionType() const
    return partition type attribute
    Definition yaspgridentity.hh:863
    \n-
    GridImp::ctype ctype
    Definition yaspgridentity.hh:796
    \n-
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridentity.hh:798
    \n-
    GridImp::PersistentIndexType PersistentIndexType
    define the type used for persistent indices
    Definition yaspgridentity.hh:806
    \n-
    EntitySeed seed() const
    Return the entity seed which contains sufficient information to generate the entity again and uses as...
    Definition yaspgridentity.hh:835
    \n-
    const GridImp * yaspgrid() const
    Definition yaspgridentity.hh:943
    \n-
    constexpr GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition yaspgridentity.hh:857
    \n-
    GridImp::YGrid::Iterator I
    Definition yaspgridentity.hh:799
    \n-
    I & transformingsubiterator()
    Definition yaspgridentity.hh:940
    \n-
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:938
    \n-
    GridImp::YGrid::iTupel iTupel
    define type used for coordinates in grid module
    Definition yaspgridentity.hh:809
    \n-
    GridImp::template Codim< dim >::Geometry Geometry
    Definition yaspgridentity.hh:801
    \n-
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:939
    \n-
    YaspEntity(YGLI &&g, I &&it)
    Definition yaspgridentity.hh:819
    \n-
    YaspEntity()
    Definition yaspgridentity.hh:812
    \n-
    GridImp::template Codim< dim >::EntitySeed EntitySeed
    Definition yaspgridentity.hh:803
    \n+
    YaspGeometry(const FieldVector< ctype, cdim > &ll, const FieldVector< ctype, cdim > &ur, const std::bitset< cdim > &shift)
    constructor from midpoint and extension and a bitset defining which unit vectors span the entity
    Definition yaspgridgeometry.hh:37
    \n+
    GridImp::ctype ctype
    define type used for coordinates in grid module
    Definition yaspgridgeometry.hh:34
    \n+
    YaspGeometry(const YaspGeometry &other)
    copy constructor (skipping temporary variables)
    Definition yaspgridgeometry.hh:57
    \n+
    GridImp::ctype ctype
    Definition yaspgridgeometry.hh:49
    \n+
    YaspGeometry(const FieldVector< ctype, mydim > &ll, const FieldVector< ctype, mydim > &ur)
    constructor from midpoint and extension
    Definition yaspgridgeometry.hh:52
    \n+
    YaspGeometry(const FieldVector< ctype, cdim > &p, const FieldVector< ctype, cdim > &, const std::bitset< cdim > &)
    Definition yaspgridgeometry.hh:74
    \n+
    YaspGeometry(const FieldVector< ctype, cdim > &p)
    constructor
    Definition yaspgridgeometry.hh:70
    \n+
    GridImp::ctype ctype
    Definition yaspgridgeometry.hh:67
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,1266 +1,111 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridentity.hh\n+yaspgridgeometry.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDENTITY_HH\n-6#define DUNE_GRID_YASPGRIDENTITY_HH\n+5#ifndef DUNE_GRID_YASPGRIDGEOMETRY_HH\n+6#define DUNE_GRID_YASPGRIDGEOMETRY_HH\n 7\n-8#include \n-9#include \n-10\n-24//========================================================================\n-25\n-26\n-27\n-28\n-29namespace Dune {\n-30\n-31 namespace Yasp {\n-32\n-33#ifndef DOXYGEN\n-34\n-35 // table for quick evaluation of binomial coefficients\n-36 template\n-37 struct BinomialTable\n-38 {\n-39 // evaluation - note that in general d!=n, n is only the\n-40 // maximum value of d (in our case dimworld)\n-41 static constexpr int evaluate(int d, int c)\n-42 {\n-43 return _values[_offsets[d] + c];\n-44 }\n-45\n-46 private:\n-47 // prevent construction\n-48 BinomialTable() = delete;\n-49\n-50 // compute binomial(r, c) and advance row `r` and column `c`\n-51 static constexpr int nextValue(int& r, int& c)\n-52 {\n-53 const auto result = Dune::binomial(r, c);\n-54\n-55 c += 1;\n-56 if (c > r) {\n-57 r += 1;\n-58 c = 0;\n-59 }\n-60\n-61 return result;\n-62 }\n-63\n-64 template\n-65 static constexpr std::array computeValues(std::index_\n-sequence)\n-66 {\n-67 int r = 0, c = 0;\n-68 return {{ ((void)I, nextValue(r, c))... }};\n-69 }\n-70\n-71 template\n-72 static constexpr std::array computeOffsets(std::index_\n-sequence)\n-73 { return {{ (I*(I+1)/2)... }}; }\n-74\n-75 static constexpr std::array _values = computeValues(std::\n-make_index_sequence<(n+1)*(n+2)/2>{});\n-76 static constexpr std::array _offsets = computeOffsets(std::make_\n-index_sequence{});\n+23namespace Dune {\n+24\n+29 template\n+30 class YaspGeometry : public AxisAlignedCubeGeometry\n+31 {\n+32 public:\n+34 typedef typename GridImp::ctype ctype;\n+35\n+37 YaspGeometry (const FieldVector& ll, const FieldVector& ur, const std::bitset& shift)\n+38 : AxisAlignedCubeGeometry(ll,ur,shift)\n+39 {\n+40 assert(mydim == shift.count());\n+41 }\n+42 };\n+43\n+45 template\n+46 class YaspGeometry : public\n+AxisAlignedCubeGeometry\n+47 {\n+48 public:\n+49 typedef typename GridImp::ctype ctype;\n+50\n+52 YaspGeometry (const FieldVector& ll, const FieldVector& ur)\n+53 : AxisAlignedCubeGeometry(ll,ur)\n+54 {}\n+55\n+57 YaspGeometry (const YaspGeometry& other)\n+58 : AxisAlignedCubeGeometry(other)\n+59 {}\n+60 };\n+61\n+63 template\n+64 class YaspGeometry<0,cdim,GridImp> : public AxisAlignedCubeGeometry\n+65 {\n+66 public:\n+67 typedef typename GridImp::ctype ctype;\n+68\n+70 explicit YaspGeometry ( const FieldVector< ctype, cdim > &p )\n+71 : AxisAlignedCubeGeometry( p )\n+72 {}\n+73\n+74 YaspGeometry ( const FieldVector< ctype, cdim > &p, const FieldVector<\n+ctype, cdim > &, const std::bitset &)\n+75 : AxisAlignedCubeGeometry( p )\n+76 {}\n 77 };\n-78\n-85 template\n-86 constexpr int subEnt(int d, int c)\n-87 {\n-88 return (d < c ? 0 : BinomialTable::evaluate(d,c) << c);\n-89 }\n-90\n-91 // Make a table mapping all subentities of a codim 0 entity to a value.\n-92 // F is the functor to be evaluated.\n-93 template\n-94 struct EntityShiftTable\n-95 {\n-96 typedef std::bitset value_type;\n-97\n-98 static value_type evaluate(int i, int codim)\n-99 {\n-100 return {_values[_offsets[codim] + i]};\n-101 }\n-102\n-103 private:\n-104\n-105 // prevent construction\n-106 EntityShiftTable() = delete;\n-107\n-108 // compute offset of codimension `codim` entities and advance `offset`\n-109 static constexpr int nextOffset(int& offset, int codim)\n-110 {\n-111 if (codim == 0) {\n-112 offset = 0;\n-113 return 0;\n-114 }\n-115\n-116 offset += subEnt(dim, codim-1);\n-117 return offset;\n-118 }\n-119\n-120 template\n-121 static constexpr std::array computeOffsets(std::index_\n-sequence)\n-122 {\n-123 int offset = 0;\n-124 return {{ (nextOffset(offset, I))... }};\n-125 }\n-126\n-127 // compute shift table entry for (`codim`, `i`) and advance `codim`, `i`\n-128 static constexpr unsigned char nextValue(int& codim, int& i)\n-129 {\n-130 const auto result = F::evaluate(i, codim);\n-131\n-132 i += 1;\n-133 if (i >= subEnt(dim, codim)) {\n-134 codim += 1;\n-135 i = 0;\n-136 }\n-137\n-138 return result;\n-139 }\n-140\n-141 template\n-142 static constexpr std::array computeValues\n-(std::index_sequence)\n-143 {\n-144 int codim = 0, i = 0;\n-145 return {{ ((void)I, nextValue(codim, i))... }};\n-146 }\n-147\n-148 static constexpr std::array _offsets = computeOffsets(std::make_\n-index_sequence{});\n-149 static constexpr std::array _values =\n-computeValues(std::make_index_sequence{});\n-150\n-151 };\n-152\n-153 // functor for doing the actual entity shift calculation\n-154 template\n-155 struct calculate_entity_shift\n-156 {\n-157 static constexpr unsigned long long evaluate(int index, int cc)\n-158 {\n-159 auto result = 0ull;\n-160 for (int d = dim; d>0; d--)\n-161 {\n-162 if (cc == d)\n-163 return result;\n-164 if (index < subEnt(d-1,cc))\n-165 result |= 1ull << (d-1);\n-166 else\n-167 {\n-168 index = (index - subEnt(d-1, cc)) % subEnt(d-1,cc-1);\n-169 cc--;\n-170 }\n-171 }\n-172 return result;\n-173 }\n-174 };\n-175\n-184 template\n-185 std::bitset entityShift(int index, int cc)\n-186 {\n-187 return EntityShiftTable,dim>::evaluate\n-(index,cc);\n-188 }\n-189\n-190 // functor for doing the actual entity move calculation\n-191 template\n-192 struct calculate_entity_move\n-193 {\n-194 static constexpr unsigned long long evaluate(int index, int cc)\n-195 {\n-196 auto result = 0ull;\n-197 for (int d = dim; d>0; d--)\n-198 {\n-199 if (d == cc)\n-200 {\n-201 // result[d-1] = index & (1<<(d-1));\n-202 result &= ~(1ull << (d-1));\n-203 result |= index & (1ull << (d-1));\n-204\n-205 index &= ~(1<<(d-1));\n-206 }\n-207 if (index >= subEnt(d-1,cc))\n-208 {\n-209 if ((index - subEnt(d-1,cc)) / subEnt(d-1,cc-1) == 1)\n-210 {\n-211 result |= 1ull << (d-1);\n-212 }\n-213 index = (index - subEnt(d-1, cc)) % subEnt(d-1,cc-1);\n-214 cc--;\n-215 }\n-216 }\n-217 return result;\n-218 }\n-219\n-220 };\n-221\n-229 template\n-230 std::bitset entityMove(int index, int cc)\n-231 {\n-232 return EntityShiftTable,dim>::evaluate\n-(index,cc);\n-233 }\n-234\n-235#endif //DOXYGEN\n-236\n-237 } // namespace Yasp.\n-238\n-239 template\n-240 class YaspEntity\n-241 : public EntityDefaultImplementation \n-242 {\n-243\n-244 template\n-245 friend class YaspLevelIterator;\n-246\n-247 public:\n-248 typedef typename GridImp::ctype ctype;\n-249\n-250 typedef typename GridImp::template Codim::Geometry Geometry;\n-251 typedef typename GridImp::Traits::template Codim::GeometryImpl\n-GeometryImpl;\n-252\n-253 typedef typename GridImp::template Codim::EntitySeed EntitySeed;\n-254\n-256 int level () const\n-257 {\n-258 return _g->level();\n-259 }\n-260\n-264 EntitySeed seed() const\n-265 {\n-266 return EntitySeed(YaspEntitySeed(_g->level(), _it.coord(), _\n-it.which()));\n-267 }\n-268\n-270 Geometry geometry () const\n-271 {\n-272 GeometryImpl _geometry(_it.lowerleft(),_it.upperright(),_it.shift());\n-273 return Geometry(_geometry);\n-274 }\n-275\n-279 constexpr GeometryType type () const\n-280 {\n-281 return GeometryTypes::cube(Geometry::mydimension);\n-282 }\n-283\n-288 unsigned int subEntities (unsigned int cc) const\n-289 {\n-290 return Dune::Yasp::subEnt(dim-codim,cc-codim);\n-291 }\n-292\n-294 PartitionType partitionType () const\n-295 {\n-296 if (_g->interior[codim].inside(_it.coord(),_it.shift()))\n-297 return InteriorEntity;\n-298 if (_g->interiorborder[codim].inside(_it.coord(),_it.shift()))\n-299 return BorderEntity;\n-300 if (_g->overlap[codim].inside(_it.coord(),_it.shift()))\n-301 return OverlapEntity;\n-302 if (_g->overlapfront[codim].inside(_it.coord(),_it.shift()))\n-303 return FrontEntity;\n-304 return GhostEntity;\n-305 }\n-306\n-307 typedef typename GridImp::YGridLevelIterator YGLI;\n-308 typedef typename GridImp::YGrid::Iterator I;\n-309 YaspEntity ()\n-310 {}\n-311\n-312 YaspEntity (const YGLI& g, const I& it)\n-313 : _it(it), _g(g)\n-314 {}\n-315\n-316 YaspEntity (YGLI&& g, const I&& it)\n-317 : _it(std::move(it)), _g(std::move(g))\n-318 {}\n-319\n-321 bool equals (const YaspEntity& e) const\n-322 {\n-323 return _it == e._it && _g == e._g;\n-324 }\n-325\n-326 // IndexSets needs access to the private index methods\n-327 friend class Dune::YaspIndexSet;\n-328 friend class Dune::YaspIndexSet;\n-329 friend class Dune::YaspGlobalIdSet;\n-330 typedef typename GridImp::PersistentIndexType PersistentIndexType;\n-331\n-333 PersistentIndexType persistentIndex () const\n-334 {\n-335 // get size of global grid (in elements)\n-336 std::array size;\n-337\n-338 for (int i=0; img->levelSize(_g->level(), i);\n-342 if (!_it.shift(i))\n-343 size[i]++;\n-344 }\n-345\n-346 // encode codim\n-347 PersistentIndexType id(_it.shift().to_ulong());\n-348\n-349 // encode level\n-350 id = id << yaspgrid_level_bits;\n-351 id = id+PersistentIndexType(_g->level());\n-352\n-353 // encode coordinates\n-354 for (int i=dim-1; i>=0; i--)\n-355 {\n-356 id = id << yaspgrid_dim_bits;\n-357 id = id+PersistentIndexType(_it.coord(i));\n-358 }\n-359\n-360 return id;\n-361 }\n-362\n-364 int compressedIndex () const\n-365 {\n-366 return _it.superindex();\n-367 }\n-368\n-370 int subCompressedIndex (int i, unsigned int cc) const\n-371 {\n-372 // get the shift of the entity and the subentity\n-373 // the subentity shift is only available in the space spanned by the entity\n-374 std::bitset subent_shift = Dune::Yasp::entityShift\n-(i,cc-codim);\n-375 std::bitset subent_move = Dune::Yasp::entityMove\n-(i,cc-codim);\n-376\n-377 std::bitset shift = _it.shift();\n-378 std::array coord = _it.coord();\n-379 for (int j=0, k=0; joverlapfront[cc].shiftmapping(shift);\n-390 return _g->overlapfront[cc].superindex(coord,which);\n-391 }\n-392 public:\n-393 const I& transformingsubiterator() const { return _it; }\n-394 const YGLI& gridlevel() const { return _g; }\n-395 I& transformingsubiterator() { return _it; }\n-396 YGLI& gridlevel() { return _g; }\n-397 const GridImp * yaspgrid() const { return _g->mg; }\n-398 protected:\n-399 I _it = {}; // position in the grid level\n-400 YGLI _g = {}; // access to grid level\n-401 };\n-402\n-403\n-404 // specialization for codim=0\n-405 template\n-406 class YaspEntity<0,dim,GridImp>\n-407 : public EntityDefaultImplementation <0,dim,GridImp,YaspEntity>\n-408 {\n-409 constexpr static int dimworld = GridImp::dimensionworld;\n-410\n-411 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl\n-GeometryImpl;\n-412\n-413 template\n-414 friend class YaspLevelIterator;\n-415\n-416 template\n-417 friend class YaspHierarchicIterator;\n-418\n-419 public:\n-420 typedef typename GridImp::ctype ctype;\n-421\n-422 typedef typename GridImp::YGridLevelIterator YGLI;\n-423 typedef typename GridImp::YGrid::Iterator I;\n-424\n-425 typedef typename GridImp::template Codim< 0 >::Geometry Geometry;\n-426 typedef typename GridImp::template Codim< 0 >::LocalGeometry LocalGeometry;\n-427\n-428 template \n-429 struct Codim\n-430 {\n-431 typedef typename GridImp::template Codim::Entity Entity;\n-432 };\n-433\n-434 typedef typename GridImp::template Codim<0>::Entity Entity;\n-435 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;\n-436 typedef typename GridImp::LevelIntersectionIterator IntersectionIterator;\n-437 typedef typename GridImp::LevelIntersectionIterator\n-LevelIntersectionIterator;\n-438 typedef typename GridImp::LeafIntersectionIterator\n-LeafIntersectionIterator;\n-439 typedef typename GridImp::HierarchicIterator HierarchicIterator;\n-440\n-442 typedef typename GridImp::PersistentIndexType PersistentIndexType;\n-443\n-445 typedef typename GridImp::YGrid::iTupel iTupel;\n-446\n-447 // constructor\n-448 YaspEntity ()\n-449 {}\n-450\n-451 YaspEntity (const YGLI& g, const I& it)\n-452 : _it(it), _g(g)\n-453 {}\n-454\n-455 YaspEntity (const YGLI& g, I&& it)\n-456 : _it(std::move(it)), _g(g)\n-457 {}\n-458\n-459 YaspEntity (YGLI&& g, I&& it)\n-460 : _it(std::move(it)), _g(std::move(g))\n-461 {}\n-462\n-464 bool equals (const YaspEntity& e) const\n-465 {\n-466 return _it == e._it && _g == e._g;\n-467 }\n-468\n-470 int level () const { return _g->level(); }\n-471\n-475 EntitySeed seed () const {\n-476 return EntitySeed(YaspEntitySeed<0,GridImp>(_g->level(), _it.coord()));\n-477 }\n-478\n-480 PartitionType partitionType () const\n-481 {\n-482 if (_g->interior[0].inside(_it.coord(),_it.shift()))\n-483 return InteriorEntity;\n-484 if (_g->overlap[0].inside(_it.coord(),_it.shift()))\n-485 return OverlapEntity;\n-486 DUNE_THROW(GridError, \"Impossible GhostEntity\");\n-487 return GhostEntity;\n-488 }\n-489\n-491 Geometry geometry () const {\n-492 // the element geometry\n-493 auto ll = _it.lowerleft();\n-494 auto ur = _it.upperright();\n-495\n-496 // If on periodic overlap, transform coordinates by domain size\n-497 for (int i=0; img->isPeriodic(i)) {\n-499 int coord = transformingsubiterator().coord(i);\n-500 if (coord < 0) {\n-501 auto size = _g->mg->domainSize()[i];\n-502 ll[i] += size;\n-503 ur[i] += size;\n-504 } else if (coord + 1 > gridlevel()->mg->levelSize(gridlevel()->level(),i))\n-{\n-505 auto size = _g->mg->domainSize()[i];\n-506 ll[i] -= size;\n-507 ur[i] -= size;\n-508 }\n-509 }\n-510 }\n-511\n-512 GeometryImpl _geometry(ll,ur);\n-513 return Geometry( _geometry );\n-514 }\n-515\n-519 constexpr GeometryType type () const\n-520 {\n-521 return GeometryTypes::cube(Geometry::mydimension);\n-522 }\n-523\n-528 template int count () const\n-529 {\n-530 return Dune::Yasp::subEnt(dim,cc);\n-531 }\n-532\n-537 unsigned int subEntities (unsigned int codim) const\n-538 {\n-539 return Dune::Yasp::subEnt(dim,codim);\n-540 }\n-541\n-544 template\n-545 typename Codim::Entity subEntity (int i) const\n-546 {\n-547 // calculate move bitset\n-548 std::bitset move = Dune::Yasp::entityMove(i,cc);\n-549\n-550 // get the coordinate and modify it\n-551 iTupel coord = _it.coord();\n-552 for (int j=0; joverlapfront[cc].shiftmapping(Dune::Yasp::entityShift\n-(i,cc));\n-557 return typename Codim::Entity(YaspEntity\n-(_g,_g->overlapfront[cc].begin(coord, which)));\n-558 }\n-559\n-561 Entity father () const\n-562 {\n-563 // check if coarse level exists\n-564 if (_g->level()<=0)\n-565 DUNE_THROW(GridError, \"tried to call father on level 0\");\n-566\n-567 // yes, get iterator to it\n-568 YGLI cg(_g);\n-569 --cg;\n-570\n-571 // coordinates of the cell\n-572 iTupel coord = _it.coord();\n-573\n-574 // get coordinates on next coarser level\n-575 for (int k=0; k(cg,cg->overlap\n-[0].begin(coord)));\n-578 }\n-579\n-581 bool hasFather () const\n-582 {\n-583 return (_g->level()>0);\n-584 }\n-585\n-588 LocalGeometry geometryInFather () const\n-589 {\n-590 // configure one of the 2^dim transformations\n-591 FieldVector ll(0.0),ur(0.5);\n-592\n-593 for (int k=0; k(ll,ur) );\n-603 }\n-604\n-605 const I& transformingsubiterator () const { return _it; }\n-606 const YGLI& gridlevel () const { return _g; }\n-607 I& transformingsubiterator() { return _it; }\n-608 YGLI& gridlevel() { return _g; }\n-609 const GridImp* yaspgrid () const { return _g->mg; }\n-610\n-611 bool isLeaf() const\n-612 {\n-613 return (_g->level() == yaspgrid()->maxLevel());\n-614 }\n-615\n-618 bool isNew () const { return yaspgrid()->adaptRefCount > 0 && yaspgrid()-\n->maxLevel() < _g->level() + yaspgrid()->adaptRefCount; }\n-619\n-622 bool mightVanish () const { return false; }\n-623\n-625 IntersectionIterator ibegin () const\n-626 {\n-627 return YaspIntersectionIterator(*this,false);\n-628 }\n-629\n-631 LeafIntersectionIterator ileafbegin () const\n-632 {\n-633 // only if entity is leaf this iterator delivers intersections\n-634 return YaspIntersectionIterator(*this, ! isLeaf() );\n-635 }\n-636\n-638 LevelIntersectionIterator ilevelbegin () const\n-639 {\n-640 return ibegin();\n-641 }\n-642\n-644 IntersectionIterator iend () const\n-645 {\n-646 return YaspIntersectionIterator(*this,true);\n-647 }\n-648\n-650 LeafIntersectionIterator ileafend () const\n-651 {\n-652 return iend();\n-653 }\n-654\n-656 LevelIntersectionIterator ilevelend () const\n-657 {\n-658 return iend();\n-659 }\n-660\n-665 HierarchicIterator hbegin (int maxlevel) const\n-666 {\n-667 return YaspHierarchicIterator(_g,_it,maxlevel);\n-668 }\n-669\n-671 HierarchicIterator hend (int /* maxlevel */) const\n-672 {\n-673 return YaspHierarchicIterator(_g,_it,_g->level());\n-674 }\n-675\n-676 private:\n-677 // IndexSets needs access to the private index methods\n-678 friend class Dune::YaspIndexSet;\n-679 friend class Dune::YaspIndexSet;\n-680 friend class Dune::YaspGlobalIdSet;\n-681\n-683 PersistentIndexType persistentIndex () const\n-684 {\n-685 // encode codim\n-686 PersistentIndexType id(_it.shift().to_ulong());\n-687\n-688 // encode level\n-689 id = id << yaspgrid_level_bits;\n-690 id = id+PersistentIndexType(_g->level());\n-691\n-692\n-693 // encode coordinates\n-694 for (int i=dim-1; i>=0; i--)\n-695 {\n-696 id = id << yaspgrid_dim_bits;\n-697 id = id+PersistentIndexType(_it.coord(i));\n-698 }\n-699\n-700 return id;\n-701 }\n-702\n-704 int compressedIndex () const\n-705 {\n-706 return _it.superindex();\n-707 }\n-708\n-710 PersistentIndexType subPersistentIndex (int i, int cc) const\n-711 {\n-712 // calculate shift and move bitsets\n-713 std::bitset shift = Dune::Yasp::entityShift(i,cc);\n-714 std::bitset move = Dune::Yasp::entityMove(i,cc);\n-715\n-716 int trailing = (cc == dim) ? 1000 : 0;\n-717\n-718 std::array size = _g->mg->levelSize(_g->level());\n-719 std::array coord = _it.coord();\n-720 for (int j=0; jlevel(); k++)\n-738 if (coord[j] & (1<level()-trailing);\n-752\n-753 // encode coordinates\n-754 for (int j=dim-1; j>=0; j--)\n-755 {\n-756 id = id << yaspgrid_dim_bits;\n-757 id = id+PersistentIndexType(coord[j]>>trailing);\n-758 }\n-759\n-760 return id;\n-761 }\n-762\n-764 int subCompressedIndex (int i, int cc) const\n-765 {\n-766 // get shift and move of the subentity in question\n-767 std::bitset shift = Dune::Yasp::entityShift(i,cc);\n-768 std::bitset move = Dune::Yasp::entityMove(i,cc);\n-769\n-770 std::array coord = _it.coord();\n-771 for (int j=0; joverlapfront[cc].shiftmapping(shift);\n-775 return _g->overlapfront[cc].superindex(coord,which);\n-776 }\n-777\n-778 I _it = {}; // position in the grid level\n-779 YGLI _g = {}; // access to grid level\n-780 };\n-781\n-782\n-783 // specialization for codim=dim (vertex)\n-784 template\n-785 class YaspEntity\n-786 : public EntityDefaultImplementation \n-787 {\n-788 constexpr static int dimworld = GridImp::dimensionworld;\n-789\n-790 template\n-791 friend class YaspLevelIterator;\n-792\n-793 typedef typename GridImp::Traits::template Codim::GeometryImpl\n-GeometryImpl;\n-794\n-795 public:\n-796 typedef typename GridImp::ctype ctype;\n-797\n-798 typedef typename GridImp::YGridLevelIterator YGLI;\n-799 typedef typename GridImp::YGrid::Iterator I;\n-800\n-801 typedef typename GridImp::template Codim::Geometry Geometry;\n-802\n-803 typedef typename GridImp::template Codim::EntitySeed EntitySeed;\n-804\n-806 typedef typename GridImp::PersistentIndexType PersistentIndexType;\n-807\n-809 typedef typename GridImp::YGrid::iTupel iTupel;\n-810\n-811 // constructor\n-812 YaspEntity ()\n-813 {}\n-814\n-815 YaspEntity (const YGLI& g, const I& it)\n-816 : _it(it), _g(g)\n-817 {}\n-818\n-819 YaspEntity (YGLI&& g, I&& it)\n-820 : _it(std::move(it)), _g(std::move(g))\n-821 {}\n-822\n-824 bool equals (const YaspEntity& e) const\n-825 {\n-826 return _it == e._it && _g == e._g;\n-827 }\n-828\n-830 int level () const {return _g->level();}\n-831\n-835 EntitySeed seed () const {\n-836 return EntitySeed(YaspEntitySeed(_g->level(), _it.coord(), _\n-it.which()));\n-837 }\n-838\n-843 unsigned int subEntities (unsigned int cc) const\n-844 {\n-845 return Dune::Yasp::subEnt(dim-dim,cc-dim);\n-846 }\n-847\n-849 Geometry geometry () const {\n-850 GeometryImpl _geometry((_it).lowerleft());\n-851 return Geometry( _geometry );\n-852 }\n-853\n-857 constexpr GeometryType type () const\n-858 {\n-859 return GeometryTypes::cube(Geometry::mydimension);\n-860 }\n-861\n-863 PartitionType partitionType () const\n-864 {\n-865 if (_g->interior[dim].inside(_it.coord(),_it.shift()))\n-866 return InteriorEntity;\n-867 if (_g->interiorborder[dim].inside(_it.coord(),_it.shift()))\n-868 return BorderEntity;\n-869 if (_g->overlap[dim].inside(_it.coord(),_it.shift()))\n-870 return OverlapEntity;\n-871 if (_g->overlapfront[dim].inside(_it.coord(),_it.shift()))\n-872 return FrontEntity;\n-873 return GhostEntity;\n-874 }\n-875\n-877 int subCompressedIndex (int, unsigned int ) const\n-878 {\n-879 return compressedIndex();\n-880 }\n-881\n-882 private:\n-883 // IndexSets needs access to the private index methods\n-884 friend class Dune::YaspIndexSet;\n-885 friend class Dune::YaspIndexSet;\n-886 friend class Dune::YaspGlobalIdSet;\n-887\n-889 PersistentIndexType persistentIndex () const\n-890 {\n-891 // get coordinate and size of global grid\n-892 iTupel size = _g->mg->levelSize(_g->level());\n-893\n-894 for (int i=0; ilevel(); j++)\n-907 if (_it.coord(i)&(1<level()-trailing;\n-916\n-917 // encode codim: shift vector of vertices is 0.\n-918 PersistentIndexType id(0);\n-919\n-920 // encode level\n-921 id = id << yaspgrid_level_bits;\n-922 id = id+PersistentIndexType(level);\n-923\n-924 // encode coordinates\n-925 for (int i=dim-1; i>=0; i--)\n-926 {\n-927 id = id << yaspgrid_dim_bits;\n-928 id = id+PersistentIndexType(_it.coord(i)>>trailing);\n-929 }\n-930\n-931 return id;\n-932 }\n-933\n-935 int compressedIndex () const { return _it.superindex();}\n-936\n-937 public:\n-938 const I& transformingsubiterator() const { return _it; }\n-939 const YGLI& gridlevel() const { return _g; }\n-940 I& transformingsubiterator() { return _it; }\n-941 YGLI& gridlevel() { return _g; }\n-942\n-943 const GridImp * yaspgrid() const { return _g->mg; }\n-944 protected:\n-945 I _it = {}; // position in the grid level\n-946 YGLI _g = {}; // access to grid level\n-947 };\n-948\n-949} // namespace Dune\n-950\n-951#endif // DUNE_GRID_YASPGRIDENTITY_HH\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-Dune::FrontEntity\n-@ FrontEntity\n-on boundary between overlap and ghost\n-Definition gridenums.hh:34\n-Dune::InteriorEntity\n-@ InteriorEntity\n-all interior entities\n-Definition gridenums.hh:31\n-Dune::GhostEntity\n-@ GhostEntity\n-ghost entities\n-Definition gridenums.hh:35\n-Dune::BorderEntity\n-@ BorderEntity\n-on boundary between interior and overlap\n-Definition gridenums.hh:32\n-Dune::OverlapEntity\n-@ OverlapEntity\n-all entities lying in the overlap zone\n-Definition gridenums.hh:33\n-std\n-STL namespace.\n+78} // namespace Dune\n+79\n+80#endif // DUNE_GRID_YASPGRIDGEOMETRY_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::yaspgrid_level_bits\n-const int yaspgrid_level_bits\n-Definition yaspgrid.hh:48\n-Dune::yaspgrid_dim_bits\n-const int yaspgrid_dim_bits\n-Definition yaspgrid.hh:47\n-Dune::EntityDefaultImplementation\n-Default Implementations for EntityImp.\n-Definition common/entity.hh:542\n-Dune::GridError\n-Base class for exceptions in Dune grid modules.\n-Definition exceptions.hh:20\n-Dune::Geometry::mydimension\n-static constexpr int mydimension\n-geometry dimension\n-Definition common/geometry.hh:94\n Dune::YaspGeometry\n The general version that handles all codimensions but 0 and dim.\n Definition yaspgridgeometry.hh:31\n-Dune::YaspEntity\n-Definition yaspgridentity.hh:242\n-Dune::YaspEntity::level\n-int level() const\n-level of this element\n-Definition yaspgridentity.hh:256\n-Dune::YaspEntity::geometry\n-Geometry geometry() const\n-geometry of this entity\n-Definition yaspgridentity.hh:270\n-Dune::YaspEntity::ctype\n+Dune::YaspGeometry::YaspGeometry\n+YaspGeometry(const FieldVector< ctype, cdim > &ll, const FieldVector< ctype,\n+cdim > &ur, const std::bitset< cdim > &shift)\n+constructor from midpoint and extension and a bitset defining which unit\n+vectors span the entity\n+Definition yaspgridgeometry.hh:37\n+Dune::YaspGeometry::ctype\n GridImp::ctype ctype\n-Definition yaspgridentity.hh:248\n-Dune::YaspEntity::type\n-constexpr GeometryType type() const\n-Return the name of the reference element. The type can be used to access the\n-Dune::ReferenceElement.\n-Definition yaspgridentity.hh:279\n-Dune::YaspEntity::persistentIndex\n-PersistentIndexType persistentIndex() const\n-globally unique, persistent index\n-Definition yaspgridentity.hh:333\n-Dune::YaspEntity::gridlevel\n-const YGLI & gridlevel() const\n-Definition yaspgridentity.hh:394\n-Dune::YaspEntity::transformingsubiterator\n-const I & transformingsubiterator() const\n-Definition yaspgridentity.hh:393\n-Dune::YaspEntity::_g\n-YGLI _g\n-Definition yaspgridentity.hh:400\n-Dune::YaspEntity::equals\n-bool equals(const YaspEntity &e) const\n-Return true when two iterators over the same grid are equal (!).\n-Definition yaspgridentity.hh:321\n-Dune::YaspEntity::partitionType\n-PartitionType partitionType() const\n-return partition type attribute\n-Definition yaspgridentity.hh:294\n-Dune::YaspEntity::GeometryImpl\n-GridImp::Traits::template Codim< codim >::GeometryImpl GeometryImpl\n-Definition yaspgridentity.hh:251\n-Dune::YaspEntity::gridlevel\n-YGLI & gridlevel()\n-Definition yaspgridentity.hh:396\n-Dune::YaspEntity::subCompressedIndex\n-int subCompressedIndex(int i, unsigned int cc) const\n-subentity compressed index\n-Definition yaspgridentity.hh:370\n-Dune::YaspEntity::YGLI\n-GridImp::YGridLevelIterator YGLI\n-Definition yaspgridentity.hh:307\n-Dune::YaspEntity::I\n-GridImp::YGrid::Iterator I\n-Definition yaspgridentity.hh:308\n-Dune::YaspEntity::yaspgrid\n-const GridImp * yaspgrid() const\n-Definition yaspgridentity.hh:397\n-Dune::YaspEntity::EntitySeed\n-GridImp::template Codim< codim >::EntitySeed EntitySeed\n-Definition yaspgridentity.hh:253\n-Dune::YaspEntity::YaspEntity\n-YaspEntity(YGLI &&g, const I &&it)\n-Definition yaspgridentity.hh:316\n-Dune::YaspEntity::seed\n-EntitySeed seed() const\n-Return the entity seed which contains sufficient information to generate the\n-entity again and uses as...\n-Definition yaspgridentity.hh:264\n-Dune::YaspEntity::compressedIndex\n-int compressedIndex() const\n-consecutive, codim-wise, level-wise index\n-Definition yaspgridentity.hh:364\n-Dune::YaspEntity::YaspEntity\n-YaspEntity(const YGLI &g, const I &it)\n-Definition yaspgridentity.hh:312\n-Dune::YaspEntity::_it\n-I _it\n-Definition yaspgridentity.hh:399\n-Dune::YaspEntity::YaspEntity\n-YaspEntity()\n-Definition yaspgridentity.hh:309\n-Dune::YaspEntity::Geometry\n-GridImp::template Codim< codim >::Geometry Geometry\n-Definition yaspgridentity.hh:250\n-Dune::YaspEntity::PersistentIndexType\n-GridImp::PersistentIndexType PersistentIndexType\n-Definition yaspgridentity.hh:330\n-Dune::YaspEntity::subEntities\n-unsigned int subEntities(unsigned int cc) const\n-Definition yaspgridentity.hh:288\n-Dune::YaspEntity::transformingsubiterator\n-I & transformingsubiterator()\n-Definition yaspgridentity.hh:395\n-Dune::YaspEntitySeed\n-Describes the minimal information necessary to create a fully functional\n-YaspEntity.\n-Definition yaspgridentityseed.hh:18\n-Dune::YaspLevelIterator\n-Iterates over entities of one grid level.\n-Definition yaspgridleveliterator.hh:19\n-Dune::YaspIntersectionIterator\n-YaspIntersectionIterator enables iteration over intersections with neighboring\n-codim 0 entities.\n-Definition yaspgridintersectioniterator.hh:22\n-Dune::YaspHierarchicIterator\n-YaspHierarchicIterator enables iteration over son entities of codim 0.\n-Definition yaspgridhierarchiciterator.hh:20\n-Dune::YaspIndexSet\n-Implementation of Level- and LeafIndexSets for YaspGrid.\n-Definition yaspgridindexsets.hh:25\n-Dune::YaspGlobalIdSet\n-persistent, globally unique Ids\n-Definition yaspgrididset.hh:25\n-Dune::YaspEntity<_0,_dim,_GridImp_>::ileafbegin\n-LeafIntersectionIterator ileafbegin() const\n-returns intersection iterator for first intersection\n-Definition yaspgridentity.hh:631\n-Dune::YaspEntity<_0,_dim,_GridImp_>::LocalGeometry\n-GridImp::template Codim< 0 >::LocalGeometry LocalGeometry\n-Definition yaspgridentity.hh:426\n-Dune::YaspEntity<_0,_dim,_GridImp_>::subEntity\n-Codim< cc >::Entity subEntity(int i) const\n-Definition yaspgridentity.hh:545\n-Dune::YaspEntity<_0,_dim,_GridImp_>::equals\n-bool equals(const YaspEntity &e) const\n-Return true when two iterators over the same grid are equal (!).\n-Definition yaspgridentity.hh:464\n-Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n-YaspEntity(const YGLI &g, I &&it)\n-Definition yaspgridentity.hh:455\n-Dune::YaspEntity<_0,_dim,_GridImp_>::count\n-int count() const\n-Definition yaspgridentity.hh:528\n-Dune::YaspEntity<_0,_dim,_GridImp_>::EntitySeed\n-GridImp::template Codim< 0 >::EntitySeed EntitySeed\n-Definition yaspgridentity.hh:435\n-Dune::YaspEntity<_0,_dim,_GridImp_>::PersistentIndexType\n-GridImp::PersistentIndexType PersistentIndexType\n-define the type used for persistent indices\n-Definition yaspgridentity.hh:442\n-Dune::YaspEntity<_0,_dim,_GridImp_>::iTupel\n-GridImp::YGrid::iTupel iTupel\n define type used for coordinates in grid module\n-Definition yaspgridentity.hh:445\n-Dune::YaspEntity<_0,_dim,_GridImp_>::gridlevel\n-const YGLI & gridlevel() const\n-Definition yaspgridentity.hh:606\n-Dune::YaspEntity<_0,_dim,_GridImp_>::iend\n-IntersectionIterator iend() const\n-Reference to one past the last neighbor.\n-Definition yaspgridentity.hh:644\n-Dune::YaspEntity<_0,_dim,_GridImp_>::transformingsubiterator\n-const I & transformingsubiterator() const\n-Definition yaspgridentity.hh:605\n-Dune::YaspEntity<_0,_dim,_GridImp_>::ctype\n+Definition yaspgridgeometry.hh:34\n+Dune::YaspGeometry<_mydim,_mydim,_GridImp_>::YaspGeometry\n+YaspGeometry(const YaspGeometry &other)\n+copy constructor (skipping temporary variables)\n+Definition yaspgridgeometry.hh:57\n+Dune::YaspGeometry<_mydim,_mydim,_GridImp_>::ctype\n GridImp::ctype ctype\n-Definition yaspgridentity.hh:420\n-Dune::YaspEntity<_0,_dim,_GridImp_>::gridlevel\n-YGLI & gridlevel()\n-Definition yaspgridentity.hh:608\n-Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n-YaspEntity(const YGLI &g, const I &it)\n-Definition yaspgridentity.hh:451\n-Dune::YaspEntity<_0,_dim,_GridImp_>::yaspgrid\n-const GridImp * yaspgrid() const\n-Definition yaspgridentity.hh:609\n-Dune::YaspEntity<_0,_dim,_GridImp_>::level\n-int level() const\n-level of this element\n-Definition yaspgridentity.hh:470\n-Dune::YaspEntity<_0,_dim,_GridImp_>::LeafIntersectionIterator\n-GridImp::LeafIntersectionIterator LeafIntersectionIterator\n-Definition yaspgridentity.hh:438\n-Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n-YaspEntity(YGLI &&g, I &&it)\n-Definition yaspgridentity.hh:459\n-Dune::YaspEntity<_0,_dim,_GridImp_>::partitionType\n-PartitionType partitionType() const\n-return partition type attribute\n-Definition yaspgridentity.hh:480\n-Dune::YaspEntity<_0,_dim,_GridImp_>::ilevelend\n-LevelIntersectionIterator ilevelend() const\n-Reference to one past the last neighbor.\n-Definition yaspgridentity.hh:656\n-Dune::YaspEntity<_0,_dim,_GridImp_>::mightVanish\n-bool mightVanish() const\n-Returns true, if entity might disappear during the next call to adapt()\n-Definition yaspgridentity.hh:622\n-Dune::YaspEntity<_0,_dim,_GridImp_>::HierarchicIterator\n-GridImp::HierarchicIterator HierarchicIterator\n-Definition yaspgridentity.hh:439\n-Dune::YaspEntity<_0,_dim,_GridImp_>::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Definition yaspgridentity.hh:434\n-Dune::YaspEntity<_0,_dim,_GridImp_>::ilevelbegin\n-LevelIntersectionIterator ilevelbegin() const\n-returns intersection iterator for first intersection\n-Definition yaspgridentity.hh:638\n-Dune::YaspEntity<_0,_dim,_GridImp_>::ileafend\n-LeafIntersectionIterator ileafend() const\n-Reference to one past the last neighbor.\n-Definition yaspgridentity.hh:650\n-Dune::YaspEntity<_0,_dim,_GridImp_>::YaspEntity\n-YaspEntity()\n-Definition yaspgridentity.hh:448\n-Dune::YaspEntity<_0,_dim,_GridImp_>::I\n-GridImp::YGrid::Iterator I\n-Definition yaspgridentity.hh:423\n-Dune::YaspEntity<_0,_dim,_GridImp_>::Geometry\n-GridImp::template Codim< 0 >::Geometry Geometry\n-Definition yaspgridentity.hh:425\n-Dune::YaspEntity<_0,_dim,_GridImp_>::geometry\n-Geometry geometry() const\n-geometry of this entity\n-Definition yaspgridentity.hh:491\n-Dune::YaspEntity<_0,_dim,_GridImp_>::father\n-Entity father() const\n-Inter-level access to father element on coarser grid. Assumes that meshes are\n-nested.\n-Definition yaspgridentity.hh:561\n-Dune::YaspEntity<_0,_dim,_GridImp_>::isNew\n-bool isNew() const\n-Returns true, if the entity has been created during the last call to adapt()\n-Definition yaspgridentity.hh:618\n-Dune::YaspEntity<_0,_dim,_GridImp_>::type\n-constexpr GeometryType type() const\n-Return the name of the reference element. The type can be used to access the\n-Dune::ReferenceElement.\n-Definition yaspgridentity.hh:519\n-Dune::YaspEntity<_0,_dim,_GridImp_>::seed\n-EntitySeed seed() const\n-Return the entity seed which contains sufficient information to generate the\n-entity again and uses as...\n-Definition yaspgridentity.hh:475\n-Dune::YaspEntity<_0,_dim,_GridImp_>::hbegin\n-HierarchicIterator hbegin(int maxlevel) const\n-Definition yaspgridentity.hh:665\n-Dune::YaspEntity<_0,_dim,_GridImp_>::ibegin\n-IntersectionIterator ibegin() const\n-returns intersection iterator for first intersection\n-Definition yaspgridentity.hh:625\n-Dune::YaspEntity<_0,_dim,_GridImp_>::YGLI\n-GridImp::YGridLevelIterator YGLI\n-Definition yaspgridentity.hh:422\n-Dune::YaspEntity<_0,_dim,_GridImp_>::subEntities\n-unsigned int subEntities(unsigned int codim) const\n-Definition yaspgridentity.hh:537\n-Dune::YaspEntity<_0,_dim,_GridImp_>::geometryInFather\n-LocalGeometry geometryInFather() const\n-Definition yaspgridentity.hh:588\n-Dune::YaspEntity<_0,_dim,_GridImp_>::IntersectionIterator\n-GridImp::LevelIntersectionIterator IntersectionIterator\n-Definition yaspgridentity.hh:436\n-Dune::YaspEntity<_0,_dim,_GridImp_>::LevelIntersectionIterator\n-GridImp::LevelIntersectionIterator LevelIntersectionIterator\n-Definition yaspgridentity.hh:437\n-Dune::YaspEntity<_0,_dim,_GridImp_>::transformingsubiterator\n-I & transformingsubiterator()\n-Definition yaspgridentity.hh:607\n-Dune::YaspEntity<_0,_dim,_GridImp_>::isLeaf\n-bool isLeaf() const\n-Definition yaspgridentity.hh:611\n-Dune::YaspEntity<_0,_dim,_GridImp_>::hasFather\n-bool hasFather() const\n-returns true if father entity exists\n-Definition yaspgridentity.hh:581\n-Dune::YaspEntity<_0,_dim,_GridImp_>::Codim::Entity\n-GridImp::template Codim< cd >::Entity Entity\n-Definition yaspgridentity.hh:431\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::level\n-int level() const\n-level of this element\n-Definition yaspgridentity.hh:830\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::equals\n-bool equals(const YaspEntity &e) const\n-Return true when two iterators over the same grid are equal (!).\n-Definition yaspgridentity.hh:824\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::gridlevel\n-YGLI & gridlevel()\n-Definition yaspgridentity.hh:941\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::geometry\n-Geometry geometry() const\n-geometry of this entity\n-Definition yaspgridentity.hh:849\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::YaspEntity\n-YaspEntity(const YGLI &g, const I &it)\n-Definition yaspgridentity.hh:815\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::subEntities\n-unsigned int subEntities(unsigned int cc) const\n-Definition yaspgridentity.hh:843\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::partitionType\n-PartitionType partitionType() const\n-return partition type attribute\n-Definition yaspgridentity.hh:863\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::ctype\n+Definition yaspgridgeometry.hh:49\n+Dune::YaspGeometry<_mydim,_mydim,_GridImp_>::YaspGeometry\n+YaspGeometry(const FieldVector< ctype, mydim > &ll, const FieldVector< ctype,\n+mydim > &ur)\n+constructor from midpoint and extension\n+Definition yaspgridgeometry.hh:52\n+Dune::YaspGeometry<_0,_cdim,_GridImp_>::YaspGeometry\n+YaspGeometry(const FieldVector< ctype, cdim > &p, const FieldVector< ctype,\n+cdim > &, const std::bitset< cdim > &)\n+Definition yaspgridgeometry.hh:74\n+Dune::YaspGeometry<_0,_cdim,_GridImp_>::YaspGeometry\n+YaspGeometry(const FieldVector< ctype, cdim > &p)\n+constructor\n+Definition yaspgridgeometry.hh:70\n+Dune::YaspGeometry<_0,_cdim,_GridImp_>::ctype\n GridImp::ctype ctype\n-Definition yaspgridentity.hh:796\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::YGLI\n-GridImp::YGridLevelIterator YGLI\n-Definition yaspgridentity.hh:798\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::PersistentIndexType\n-GridImp::PersistentIndexType PersistentIndexType\n-define the type used for persistent indices\n-Definition yaspgridentity.hh:806\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::seed\n-EntitySeed seed() const\n-Return the entity seed which contains sufficient information to generate the\n-entity again and uses as...\n-Definition yaspgridentity.hh:835\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::yaspgrid\n-const GridImp * yaspgrid() const\n-Definition yaspgridentity.hh:943\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::type\n-constexpr GeometryType type() const\n-Return the name of the reference element. The type can be used to access the\n-Dune::ReferenceElement.\n-Definition yaspgridentity.hh:857\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::I\n-GridImp::YGrid::Iterator I\n-Definition yaspgridentity.hh:799\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::transformingsubiterator\n-I & transformingsubiterator()\n-Definition yaspgridentity.hh:940\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::transformingsubiterator\n-const I & transformingsubiterator() const\n-Definition yaspgridentity.hh:938\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::iTupel\n-GridImp::YGrid::iTupel iTupel\n-define type used for coordinates in grid module\n-Definition yaspgridentity.hh:809\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::Geometry\n-GridImp::template Codim< dim >::Geometry Geometry\n-Definition yaspgridentity.hh:801\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::gridlevel\n-const YGLI & gridlevel() const\n-Definition yaspgridentity.hh:939\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::YaspEntity\n-YaspEntity(YGLI &&g, I &&it)\n-Definition yaspgridentity.hh:819\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::YaspEntity\n-YaspEntity()\n-Definition yaspgridentity.hh:812\n-Dune::YaspEntity<_dim,_dim,_GridImp_>::EntitySeed\n-GridImp::template Codim< dim >::EntitySeed EntitySeed\n-Definition yaspgridentity.hh:803\n+Definition yaspgridgeometry.hh:67\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00200.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00200.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridpersistentcontainer.hh File Reference\n+dune-grid: torus.hh File Reference\n \n \n \n \n \n \n \n@@ -71,45 +71,58 @@\n \n \n \n
    \n \n-
    yaspgridpersistentcontainer.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    torus.hh File Reference
    \n \n
    \n \n-

    Specialization of the PersistentContainer for YaspGrid. \n+

    This file provides the infrastructure for toroidal communication in YaspGrid. \n More...

    \n-
    #include <cassert>
    \n+
    #include <array>
    \n+#include <bitset>
    \n+#include <cmath>
    \n+#include <deque>
    \n+#include <iostream>
    \n #include <vector>
    \n-#include <dune/grid/utility/persistentcontainer.hh>
    \n-#include <dune/grid/utility/persistentcontainervector.hh>
    \n-#include "../yaspgrid.hh"
    \n+#include <mpi.h>
    \n+#include <dune/common/binaryfunctions.hh>
    \n+#include <dune/common/streamoperators.hh>
    \n+#include <dune/grid/common/exceptions.hh>
    \n+#include "partitioning.hh"
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspPersistentContainerIndex< Grid >
    class  Dune::Torus< Communication, d >
     
    class  Dune::PersistentContainer< YaspGrid< dim, CoordCont >, T >
     Specialization of the PersistentContainer for YaspGrid. More...
    class  Dune::Torus< Communication, d >::ProcListIterator
     
    \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n+\n+\n

    \n+Functions

    template<class Communication , int d>
    std::ostream & Dune::operator<< (std::ostream &s, const Torus< Communication, d > &t)
     Output operator for Torus.
     
    \n

    Detailed Description

    \n-

    Specialization of the PersistentContainer for YaspGrid.

    \n+

    This file provides the infrastructure for toroidal communication in YaspGrid.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,30 +1,42 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-Classes | Namespaces\n-yaspgridpersistentcontainer.hh File Reference\n-Specialization of the PersistentContainer for YaspGrid. More...\n-#include \n+Classes | Namespaces | Functions\n+torus.hh File Reference\n+This file provides the infrastructure for toroidal communication in YaspGrid.\n+More...\n+#include \n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n-#include \n-#include \"../yaspgrid.hh\"\n+#include \n+#include \n+#include \n+#include \n+#include \"partitioning.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspPersistentContainerIndex<_Grid_>\n+class \u00a0 Dune::Torus<_Communication,_d_>\n \u00a0\n-class \u00a0 Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>\n-\u00a0 Specialization of the PersistentContainer for YaspGrid. More...\n+class \u00a0 Dune::Torus<_Communication,_d_>::ProcListIterator\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+Functions\n+template\n+std::ostream &\u00a0 Dune::operator<< (std::ostream &s, const Torus< Communication,\n+ d > &t)\n+\u00a0 Output operator for Torus.\n+\u00a0\n ***** Detailed Description *****\n-Specialization of the PersistentContainer for YaspGrid.\n+This file provides the infrastructure for toroidal communication in YaspGrid.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00200_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00200_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridpersistentcontainer.hh Source File\n+dune-grid: torus.hh Source File\n \n \n \n \n \n \n \n@@ -74,153 +74,619 @@\n \n \n
    \n
    \n-
    yaspgridpersistentcontainer.hh
    \n+
    torus.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH
    \n-
    6#define DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRID_TORUS_HH
    \n+
    6#define DUNE_GRID_YASPGRID_TORUS_HH
    \n
    7
    \n-
    12#include <cassert>
    \n+
    8#include <array>
    \n+
    9#include <bitset>
    \n+
    10#include <cmath>
    \n+
    11#include <deque>
    \n+
    12#include <iostream>
    \n
    13#include <vector>
    \n
    14
    \n-\n-\n-
    17#include "../yaspgrid.hh"
    \n+
    15#if HAVE_MPI
    \n+
    16#include <mpi.h>
    \n+
    17#endif
    \n
    18
    \n-
    19namespace Dune
    \n-
    20{
    \n-
    21
    \n-
    33 template<typename Grid>
    \n-
    \n-\n-
    35 {
    \n-
    36
    \n-
    37 public:
    \n-
    \n-
    38 YaspPersistentContainerIndex(const Grid & grid, int codim)
    \n-
    39 : _grid(grid), _codim(codim)
    \n-
    40 {
    \n-
    41 recomputeOffsets();
    \n-
    42 }
    \n-
    \n-
    43
    \n-
    45 typedef std::size_t IndexType;
    \n-
    46
    \n-
    48 template<class Entity>
    \n-
    \n-
    49 IndexType index (const Entity& e) const
    \n-
    50 {
    \n-
    51 static const int cc = Entity::codimension;
    \n-
    52 std::size_t level = e.level();
    \n-
    53 return _grid.indexsets[level]->template index<cc>(e) + _offsets[level];
    \n-
    54 }
    \n-
    \n-
    55
    \n-
    57 template< class Entity >
    \n-
    \n-
    58 IndexType subIndex ( const Entity &e, int i, unsigned int codim ) const
    \n-
    59 {
    \n-
    60
    \n-
    61 static const int cc = Entity::codimension;
    \n-
    62 std::size_t level = e.level();
    \n-
    63 return _grid.indexsets[level]->template subIndex<cc>(e,i,codim) + _offsets[level];
    \n-
    64 }
    \n-
    \n-
    65
    \n+
    19#include <dune/common/binaryfunctions.hh>
    \n+
    20#include <dune/common/streamoperators.hh>
    \n+\n+
    22
    \n+
    23#include "partitioning.hh"
    \n+
    24
    \n+
    29namespace Dune
    \n+
    30{
    \n+
    31
    \n+
    45 template<class Communication, int d>
    \n+
    \n+
    46 class Torus {
    \n+
    47 public:
    \n+
    49 typedef std::array<int, d> iTupel;
    \n+
    50
    \n+
    51
    \n+
    52 private:
    \n+
    53 struct CommPartner {
    \n+
    54 int rank;
    \n+
    55 iTupel delta;
    \n+
    56 int index;
    \n+
    57 };
    \n+
    58
    \n+
    59 struct CommTask {
    \n+
    60 int rank; // process to send to / receive from
    \n+
    61 int size; // size of buffer
    \n+
    62 void *buffer; // buffer to send / receive
    \n+
    63 };
    \n+
    64
    \n+
    65 public:
    \n
    \n-
    67 std::size_t size (int /* codim */) const
    \n-
    68 {
    \n-
    69 if (_grid.indexsets.size()+1 != _offsets.size())
    \n-
    70 recomputeOffsets();
    \n-
    71 return _offsets.back();
    \n-
    72 }
    \n-
    \n-
    73
    \n-
    74 private:
    \n-
    75 void recomputeOffsets() const
    \n-
    76 {
    \n-
    77 _offsets.resize(_grid.indexsets.size()+1,0);
    \n-
    78 _offsets[0] = 0;
    \n-
    79 for (std::size_t i=0; i<_grid.indexsets.size(); i++)
    \n-
    80 _offsets[i+1] = _offsets[i] + _grid.indexsets[i]->size(_codim);
    \n-
    81 }
    \n-
    82
    \n-
    83 const Grid& _grid;
    \n-
    84 int _codim;
    \n-
    85 mutable std::vector<std::size_t> _offsets;
    \n-
    86 };
    \n-
    \n-
    87
    \n-
    94 template<int dim, class CoordCont, class T>
    \n-
    \n-
    95 class PersistentContainer< YaspGrid<dim, CoordCont>, T >
    \n-
    96 /* We have to pass the reference to the IndexSet to the constructor
    \n-
    97 of the PersistentContainerVector. In order to have a valid
    \n-
    98 indexset available, we inherit from a private indexset
    \n-
    99 */
    \n-
    100 : private YaspPersistentContainerIndex< const YaspGrid<dim, CoordCont> >,
    \n-
    101 public PersistentContainerVector< YaspGrid<dim, CoordCont>,
    \n-
    102 YaspPersistentContainerIndex< const YaspGrid<dim, CoordCont> >,
    \n-
    103 std::vector<T> >
    \n-
    104 {
    \n-\n-\n-
    107
    \n-
    108 public:
    \n-
    109 typedef typename Base::Grid Grid;
    \n-
    110 typedef typename Base::Value Value;
    \n-
    111
    \n-
    112 using Base::size;
    \n-
    113
    \n-
    \n-
    114 PersistentContainer ( const Grid &grid, int codim, const Value &value = Value() )
    \n-
    115 : IndexSet(grid, codim),
    \n-
    116 Base(*this, codim, value)
    \n-
    117 {}
    \n-
    \n-
    118 };
    \n-
    \n-
    119
    \n-
    120} // end namespace Dune
    \n-
    121
    \n-
    122#endif // end DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH
    \n-\n+\n+
    68 {}
    \n+
    \n+
    69
    \n+
    \n+
    71 Torus (Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning<d>* partitioner)
    \n+
    72 : _comm(comm), _tag(tag)
    \n+
    73 {
    \n+
    74 // determine dimensions
    \n+
    75 partitioner->partition(size, _comm.size(), _dims, overlap);
    \n+
    76
    \n+
    77 // compute increments for lexicographic ordering
    \n+
    78 int inc = 1;
    \n+
    79 for (int i=0; i<d; i++)
    \n+
    80 {
    \n+
    81 _increment[i] = inc;
    \n+
    82 inc *= _dims[i];
    \n+
    83 }
    \n+
    84
    \n+
    85 // check whether the load balancing matches the size of the communicator
    \n+
    86 if (inc != _comm.size())
    \n+
    87 DUNE_THROW(Dune::Exception, "Communicator size and result of the given load balancer do not match!");
    \n+
    88
    \n+
    89 // make full schedule
    \n+
    90 proclists();
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    \n+
    94 int rank () const
    \n+
    95 {
    \n+
    96 return _comm.rank();
    \n+
    97 }
    \n+
    \n+
    98
    \n+
    \n+
    100 iTupel coord () const
    \n+
    101 {
    \n+
    102 return rank_to_coord(_comm.rank());
    \n+
    103 }
    \n+
    \n+
    104
    \n+
    \n+
    106 int procs () const
    \n+
    107 {
    \n+
    108 return _comm.size();
    \n+
    109 }
    \n+
    \n+
    110
    \n+
    \n+
    112 const iTupel & dims () const
    \n+
    113 {
    \n+
    114 return _dims;
    \n+
    115 }
    \n+
    \n+
    116
    \n+
    \n+
    118 int dims (int i) const
    \n+
    119 {
    \n+
    120 return _dims[i];
    \n+
    121 }
    \n+
    \n+
    122
    \n+
    \n+
    124 Communication comm () const
    \n+
    125 {
    \n+
    126 return _comm;
    \n+
    127 }
    \n+
    \n+
    128
    \n+
    \n+
    130 int tag () const
    \n+
    131 {
    \n+
    132 return _tag;
    \n+
    133 }
    \n+
    \n+
    134
    \n+
    \n+
    136 bool inside (iTupel c) const
    \n+
    137 {
    \n+
    138 for (int i=d-1; i>=0; i--)
    \n+
    139 if (c[i]<0 || c[i]>=_dims[i]) return false;
    \n+
    140 return true;
    \n+
    141 }
    \n+
    \n+
    142
    \n+
    \n+\n+
    145 {
    \n+\n+
    147 rank = rank%_comm.size();
    \n+
    148 for (int i=d-1; i>=0; i--)
    \n+
    149 {
    \n+
    150 coord[i] = rank/_increment[i];
    \n+
    151 rank = rank%_increment[i];
    \n+
    152 }
    \n+
    153 return coord;
    \n+
    154 }
    \n+
    \n+
    155
    \n+
    \n+\n+
    158 {
    \n+
    159 for (int i=0; i<d; i++) coord[i] = coord[i]%_dims[i];
    \n+
    160 int rank = 0;
    \n+
    161 for (int i=0; i<d; i++) rank += coord[i]*_increment[i];
    \n+
    162 return rank;
    \n+
    163 }
    \n+
    \n+
    164
    \n+
    \n+
    166 int rank_relative (int rank, int dir, int cnt) const
    \n+
    167 {
    \n+\n+
    169 coord[dir] = (coord[dir]+_dims[dir]+cnt)%_dims[dir];
    \n+
    170 return coord_to_rank(coord);
    \n+
    171 }
    \n+
    \n+
    172
    \n+
    \n+
    174 int color (const iTupel & coord) const
    \n+
    175 {
    \n+
    176 int c = 0;
    \n+
    177 int power = 1;
    \n+
    178
    \n+
    179 // interior coloring
    \n+
    180 for (int i=0; i<d; i++)
    \n+
    181 {
    \n+
    182 if (coord[i]%2==1) c += power;
    \n+
    183 power *= 2;
    \n+
    184 }
    \n+
    185
    \n+
    186 // extra colors for boundary processes
    \n+
    187 for (int i=0; i<d; i++)
    \n+
    188 {
    \n+
    189 if (_dims[i]>1 && coord[i]==_dims[i]-1) c += power;
    \n+
    190 power *= 2;
    \n+
    191 }
    \n+
    192
    \n+
    193 return c;
    \n+
    194 }
    \n+
    \n+
    195
    \n+
    \n+
    197 int color (int rank) const
    \n+
    198 {
    \n+
    199 return color(rank_to_coord(rank));
    \n+
    200 }
    \n+
    \n+
    201
    \n+
    \n+
    203 int neighbors () const
    \n+
    204 {
    \n+
    205 int n=1;
    \n+
    206 for (int i=0; i<d; ++i)
    \n+
    207 n *= 3;
    \n+
    208 return n-1;
    \n+
    209 }
    \n+
    \n+
    210
    \n+
    \n+
    212 bool is_neighbor (iTupel delta, std::bitset<d> periodic) const
    \n+
    213 {
    \n+
    214 iTupel coord = rank_to_coord(_comm.rank()); // my own coordinate with 0 <= c_i < dims_i
    \n+
    215
    \n+
    216 for (int i=0; i<d; i++)
    \n+
    217 {
    \n+
    218 if (delta[i]<0)
    \n+
    219 {
    \n+
    220 // if I am on the boundary and domain is not periodic => no neighbor
    \n+
    221 if (coord[i]==0 && periodic[i]==false) return false;
    \n+
    222 }
    \n+
    223 if (delta[i]>0)
    \n+
    224 {
    \n+
    225 // if I am on the boundary and domain is not periodic => no neighbor
    \n+
    226 if (coord[i]==_dims[i]-1 && periodic[i]==false) return false;
    \n+
    227 }
    \n+
    228 }
    \n+
    229 return true;
    \n+
    230 }
    \n+
    \n+
    231
    \n+
    \n+
    239 double partition (int rank, iTupel origin_in, iTupel size_in, iTupel& origin_out, iTupel& size_out) const
    \n+
    240 {
    \n+\n+
    242 double maxsize = 1;
    \n+
    243 double sz = 1;
    \n+
    244
    \n+
    245 // make a tensor product partition
    \n+
    246 for (int i=0; i<d; i++)
    \n+
    247 {
    \n+
    248 // determine
    \n+
    249 int m = size_in[i]/_dims[i];
    \n+
    250 int r = size_in[i]%_dims[i];
    \n+
    251
    \n+
    252 sz *= size_in[i];
    \n+
    253
    \n+
    254 if (coord[i]<_dims[i]-r)
    \n+
    255 {
    \n+
    256 origin_out[i] = origin_in[i] + coord[i]*m;
    \n+
    257 size_out[i] = m;
    \n+
    258 maxsize *= m;
    \n+
    259 }
    \n+
    260 else
    \n+
    261 {
    \n+
    262 origin_out[i] = origin_in[i] + (_dims[i]-r)*m + (coord[i]-(_dims[i]-r))*(m+1);
    \n+
    263 size_out[i] = m+1;
    \n+
    264 maxsize *= m+1;
    \n+
    265 }
    \n+
    266 }
    \n+
    267 return maxsize/(sz/_comm.size());
    \n+
    268 }
    \n+
    \n+
    269
    \n+
    \n+\n+
    277 public:
    \n+
    \n+
    279 ProcListIterator (typename std::deque<CommPartner>::const_iterator iter)
    \n+
    280 {
    \n+
    281 i = iter;
    \n+
    282 }
    \n+
    \n+
    283
    \n+
    \n+
    285 int rank () const
    \n+
    286 {
    \n+
    287 return i->rank;
    \n+
    288 }
    \n+
    \n+
    289
    \n+
    \n+
    291 iTupel delta () const
    \n+
    292 {
    \n+
    293 return i->delta;
    \n+
    294 }
    \n+
    \n+
    295
    \n+
    \n+
    297 int index () const
    \n+
    298 {
    \n+
    299 return i->index;
    \n+
    300 }
    \n+
    \n+
    301
    \n+
    \n+
    303 int distance () const
    \n+
    304 {
    \n+
    305 int dist = 0;
    \n+
    306 iTupel delta=i->delta;
    \n+
    307 for (int j=0; j<d; ++j)
    \n+
    308 dist += std::abs(delta[j]);
    \n+
    309 return dist;
    \n+
    310 }
    \n+
    \n+
    311
    \n+
    \n+
    313 bool operator== (const ProcListIterator& iter) const
    \n+
    314 {
    \n+
    315 return i == iter.i;
    \n+
    316 }
    \n+
    \n+
    317
    \n+
    318
    \n+
    \n+
    320 bool operator!= (const ProcListIterator& iter) const
    \n+
    321 {
    \n+
    322 return i != iter.i;
    \n+
    323 }
    \n+
    \n+
    324
    \n+
    \n+\n+
    327 {
    \n+
    328 ++i;
    \n+
    329 return *this;
    \n+
    330 }
    \n+
    \n+
    331
    \n+
    332 private:
    \n+
    333 typename std::deque<CommPartner>::const_iterator i;
    \n+
    334 };
    \n+
    \n+
    335
    \n+
    \n+\n+
    338 {
    \n+
    339 return ProcListIterator(_sendlist.begin());
    \n+
    340 }
    \n+
    \n+
    341
    \n+
    \n+\n+
    344 {
    \n+
    345 return ProcListIterator(_sendlist.end());
    \n+
    346 }
    \n+
    \n+
    347
    \n+
    \n+\n+
    350 {
    \n+
    351 return ProcListIterator(_recvlist.begin());
    \n+
    352 }
    \n+
    \n+
    353
    \n+
    \n+\n+
    356 {
    \n+
    357 return ProcListIterator(_recvlist.end());
    \n+
    358 }
    \n+
    \n+
    359
    \n+
    \n+
    361 void send (int rank, void* buffer, int size) const
    \n+
    362 {
    \n+
    363 CommTask task;
    \n+
    364 task.rank = rank;
    \n+
    365 task.buffer = buffer;
    \n+
    366 task.size = size;
    \n+
    367 if (rank!=_comm.rank())
    \n+
    368 _sendrequests.push_back(task);
    \n+
    369 else
    \n+
    370 _localsendrequests.push_back(task);
    \n+
    371 }
    \n+
    \n+
    372
    \n+
    \n+
    374 void recv (int rank, void* buffer, int size) const
    \n+
    375 {
    \n+
    376 CommTask task;
    \n+
    377 task.rank = rank;
    \n+
    378 task.buffer = buffer;
    \n+
    379 task.size = size;
    \n+
    380 if (rank!=_comm.rank())
    \n+
    381 _recvrequests.push_back(task);
    \n+
    382 else
    \n+
    383 _localrecvrequests.push_back(task);
    \n+
    384 }
    \n+
    \n+
    385
    \n+
    \n+
    387 void exchange () const
    \n+
    388 {
    \n+
    389 // handle local requests first
    \n+
    390 if (_localsendrequests.size()!=_localrecvrequests.size())
    \n+
    391 {
    \n+
    392 std::cout << "[" << rank() << "]: ERROR: local sends/receives do not match in exchange!" << std::endl;
    \n+
    393 return;
    \n+
    394 }
    \n+
    395 for (unsigned int i=0; i<_localsendrequests.size(); i++)
    \n+
    396 {
    \n+
    397 if (_localsendrequests[i].size!=_localrecvrequests[i].size)
    \n+
    398 {
    \n+
    399 std::cout << "[" << rank() << "]: ERROR: size in local sends/receive does not match in exchange!" << std::endl;
    \n+
    400 return;
    \n+
    401 }
    \n+
    402 memcpy(_localrecvrequests[i].buffer,_localsendrequests[i].buffer,_localsendrequests[i].size);
    \n+
    403 }
    \n+
    404 _localsendrequests.clear();
    \n+
    405 _localrecvrequests.clear();
    \n+
    406
    \n+
    407#if HAVE_MPI
    \n+
    408 // handle foreign requests
    \n+
    409
    \n+
    410 std::vector<MPI_Request> requests(_sendrequests.size() + _recvrequests.size());
    \n+
    411 MPI_Request* req = requests.data();
    \n+
    412
    \n+
    413 // issue sends to foreign processes
    \n+
    414 for (unsigned int i=0; i<_sendrequests.size(); i++)
    \n+
    415 if (_sendrequests[i].rank!=rank())
    \n+
    416 {
    \n+
    417 // std::cout << "[" << rank() << "]" << " send " << _sendrequests[i].size << " bytes "
    \n+
    418 // << "to " << _sendrequests[i].rank << " p=" << _sendrequests[i].buffer << std::endl;
    \n+
    419 MPI_Isend(_sendrequests[i].buffer, _sendrequests[i].size, MPI_BYTE,
    \n+
    420 _sendrequests[i].rank, _tag, _comm, req++);
    \n+
    421 }
    \n+
    422
    \n+
    423 // issue receives from foreign processes
    \n+
    424 for (unsigned int i=0; i<_recvrequests.size(); i++)
    \n+
    425 if (_recvrequests[i].rank!=rank())
    \n+
    426 {
    \n+
    427 // std::cout << "[" << rank() << "]" << " recv " << _recvrequests[i].size << " bytes "
    \n+
    428 // << "fm " << _recvrequests[i].rank << " p=" << _recvrequests[i].buffer << std::endl;
    \n+
    429 MPI_Irecv(_recvrequests[i].buffer, _recvrequests[i].size, MPI_BYTE,
    \n+
    430 _recvrequests[i].rank, _tag, _comm, req++);
    \n+
    431 }
    \n+
    432
    \n+
    433 // Wait for communication to complete
    \n+
    434 MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
    \n+
    435
    \n+
    436 // clear request buffers
    \n+
    437 _sendrequests.clear();
    \n+
    438 _recvrequests.clear();
    \n+
    439#endif
    \n+
    440 }
    \n+
    \n+
    441
    \n+
    \n+
    443 double global_max (double x) const
    \n+
    444 {
    \n+
    445 double res = 0.0;
    \n+
    446 _comm.template allreduce<Dune::Max<double>,double>(&x, &res, 1);
    \n+
    447 return res;
    \n+
    448 }
    \n+
    \n+
    449
    \n+
    \n+
    451 void print (std::ostream& s) const
    \n+
    452 {
    \n+
    453 s << "[" << rank() << "]: Torus " << procs() << " processor(s) arranged as " << dims() << std::endl;
    \n+
    454 for (ProcListIterator i=sendbegin(); i!=sendend(); ++i)
    \n+
    455 {
    \n+
    456 s << "[" << rank() << "]: send to "
    \n+
    457 << "rank=" << i.rank()
    \n+
    458 << " index=" << i.index()
    \n+
    459 << " delta=" << i.delta() << " dist=" << i.distance() << std::endl;
    \n+
    460 }
    \n+
    461 for (ProcListIterator i=recvbegin(); i!=recvend(); ++i)
    \n+
    462 {
    \n+
    463 s << "[" << rank() << "]: recv from "
    \n+
    464 << "rank=" << i.rank()
    \n+
    465 << " index=" << i.index()
    \n+
    466 << " delta=" << i.delta() << " dist=" << i.distance() << std::endl;
    \n+
    467 }
    \n+
    468 }
    \n+
    \n+
    469
    \n+
    470 private:
    \n+
    471
    \n+
    472 void proclists ()
    \n+
    473 {
    \n+
    474 // compile the full neighbor list
    \n+
    475 CommPartner cp;
    \n+
    476 iTupel delta;
    \n+
    477
    \n+
    478 std::fill(delta.begin(), delta.end(), -1);
    \n+
    479 bool ready = false;
    \n+
    480 iTupel me, nb;
    \n+
    481 me = rank_to_coord(_comm.rank());
    \n+
    482 int index = 0;
    \n+
    483 int last = neighbors()-1;
    \n+
    484 while (!ready)
    \n+
    485 {
    \n+
    486 // find neighbors coordinates
    \n+
    487 for (int i=0; i<d; i++)
    \n+
    488 nb[i] = ( me[i]+_dims[i]+delta[i] ) % _dims[i];
    \n+
    489
    \n+
    490 // find neighbors rank
    \n+
    491 int nbrank = coord_to_rank(nb);
    \n+
    492
    \n+
    493 // check if delta is not zero
    \n+
    494 for (int i=0; i<d; i++)
    \n+
    495 if (delta[i]!=0)
    \n+
    496 {
    \n+
    497 cp.rank = nbrank;
    \n+
    498 cp.delta = delta;
    \n+
    499 cp.index = index;
    \n+
    500 _recvlist.push_back(cp);
    \n+
    501 cp.index = last-index;
    \n+
    502 _sendlist.push_front(cp);
    \n+
    503 index++;
    \n+
    504 break;
    \n+
    505 }
    \n+
    506
    \n+
    507 // next neighbor
    \n+
    508 ready = true;
    \n+
    509 for (int i=0; i<d; i++)
    \n+
    510 if (delta[i]<1)
    \n+
    511 {
    \n+
    512 (delta[i])++;
    \n+
    513 ready=false;
    \n+
    514 break;
    \n+
    515 }
    \n+
    516 else
    \n+
    517 {
    \n+
    518 delta[i] = -1;
    \n+
    519 }
    \n+
    520 }
    \n+
    521
    \n+
    522 }
    \n+
    523
    \n+
    524 Communication _comm;
    \n+
    525
    \n+
    526 iTupel _dims;
    \n+
    527 iTupel _increment;
    \n+
    528 int _tag;
    \n+
    529 std::deque<CommPartner> _sendlist;
    \n+
    530 std::deque<CommPartner> _recvlist;
    \n+
    531
    \n+
    532 mutable std::vector<CommTask> _sendrequests;
    \n+
    533 mutable std::vector<CommTask> _recvrequests;
    \n+
    534 mutable std::vector<CommTask> _localsendrequests;
    \n+
    535 mutable std::vector<CommTask> _localrecvrequests;
    \n+
    536
    \n+
    537 };
    \n+
    \n+
    538
    \n+
    540 template <class Communication, int d>
    \n+
    \n+
    541 inline std::ostream& operator<< (std::ostream& s, const Torus<Communication, d> & t)
    \n+
    542 {
    \n+
    543 t.print(s);
    \n+
    544 return s;
    \n+
    545 }
    \n+
    \n+
    546}
    \n+
    547
    \n+
    548#endif
    \n+
    This file provides tools to partition YaspGrids. If you want to write your own partitioner,...
    \n+\n+
    std::ostream & operator<<(std::ostream &out, const PartitionType &type)
    write a PartitionType to a stream
    Definition gridenums.hh:72
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    int level() const
    The level of this entity.
    Definition common/entity.hh:124
    \n-
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    int size(int level, int codim) const
    Return number of grid entities of a given codim on a given level in this process.
    Definition common/grid.hh:538
    \n-
    A class for storing data during an adaptation cycle.
    Definition utility/persistentcontainer.hh:22
    \n-
    Base::Value Value
    Definition utility/persistentcontainer.hh:27
    \n-
    const Grid & grid() const
    Definition persistentcontainermap.hh:114
    \n-
    Size size() const
    Definition persistentcontainermap.hh:85
    \n-
    vector-based implementation of the PersistentContainer
    Definition persistentcontainervector.hh:51
    \n-
    Vector::value_type Value
    Definition persistentcontainervector.hh:57
    \n-
    G Grid
    Definition persistentcontainervector.hh:55
    \n-
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n-
    Definition yaspgridpersistentcontainer.hh:35
    \n-
    IndexType index(const Entity &e) const
    Map entity to index. The result of calling this method with an entity that is not in the index set is...
    Definition yaspgridpersistentcontainer.hh:49
    \n-
    std::size_t size(int) const
    Return total number of entities of given geometry type in entity set .
    Definition yaspgridpersistentcontainer.hh:67
    \n-
    IndexType subIndex(const Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition yaspgridpersistentcontainer.hh:58
    \n-
    YaspPersistentContainerIndex(const Grid &grid, int codim)
    Definition yaspgridpersistentcontainer.hh:38
    \n-
    std::size_t IndexType
    The type used for the indices.
    Definition yaspgridpersistentcontainer.hh:45
    \n-
    Base::Grid Grid
    Definition yaspgridpersistentcontainer.hh:109
    \n-
    Base::Value Value
    Definition yaspgridpersistentcontainer.hh:110
    \n-
    PersistentContainer(const Grid &grid, int codim, const Value &value=Value())
    Definition yaspgridpersistentcontainer.hh:114
    \n-\n+
    a base class for the yaspgrid partitioning strategy
    Definition partitioning.hh:38
    \n+
    virtual void partition(const iTupel &, int, iTupel &, int) const =0
    \n+
    Definition torus.hh:46
    \n+
    Torus()
    constructor making uninitialized object
    Definition torus.hh:67
    \n+
    int color(int rank) const
    assign color to given rank
    Definition torus.hh:197
    \n+
    double partition(int rank, iTupel origin_in, iTupel size_in, iTupel &origin_out, iTupel &size_out) const
    partition the given grid onto the torus and return the piece of the process with given rank; returns ...
    Definition torus.hh:239
    \n+
    int dims(int i) const
    return dimensions of torus in direction i
    Definition torus.hh:118
    \n+
    iTupel coord() const
    return own coordinates
    Definition torus.hh:100
    \n+
    int rank() const
    return own rank
    Definition torus.hh:94
    \n+
    const iTupel & dims() const
    return dimensions of torus
    Definition torus.hh:112
    \n+
    int rank_relative(int rank, int dir, int cnt) const
    return rank of process where its coordinate in direction dir has offset cnt (handles periodic case)
    Definition torus.hh:166
    \n+
    void recv(int rank, void *buffer, int size) const
    store a receive request; buffers are received in order; handles also local requests with memcpy
    Definition torus.hh:374
    \n+
    void send(int rank, void *buffer, int size) const
    store a send request; buffers are sent in order; handles also local requests with memcpy
    Definition torus.hh:361
    \n+
    Torus(Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning< d > *partitioner)
    make partitioner from communicator and coarse mesh size
    Definition torus.hh:71
    \n+
    int neighbors() const
    return the number of neighbors, which is
    Definition torus.hh:203
    \n+
    void print(std::ostream &s) const
    print contents of torus object
    Definition torus.hh:451
    \n+
    double global_max(double x) const
    global max
    Definition torus.hh:443
    \n+
    Communication comm() const
    return communicator
    Definition torus.hh:124
    \n+
    int color(const iTupel &coord) const
    assign color to given coordinate
    Definition torus.hh:174
    \n+
    ProcListIterator recvend() const
    last process in receive list
    Definition torus.hh:355
    \n+
    bool is_neighbor(iTupel delta, std::bitset< d > periodic) const
    return true if neighbor with given delta is a neighbor under the given periodicity
    Definition torus.hh:212
    \n+
    ProcListIterator sendend() const
    end of send list
    Definition torus.hh:343
    \n+
    int procs() const
    return number of processes
    Definition torus.hh:106
    \n+
    iTupel rank_to_coord(int rank) const
    map rank to coordinate in torus using lexicographic ordering
    Definition torus.hh:144
    \n+
    std::array< int, d > iTupel
    type used to pass tupels in and out
    Definition torus.hh:49
    \n+
    ProcListIterator sendbegin() const
    first process in send list
    Definition torus.hh:337
    \n+
    void exchange() const
    exchange messages stored in request buffers; clear request buffers afterwards
    Definition torus.hh:387
    \n+
    ProcListIterator recvbegin() const
    first process in receive list
    Definition torus.hh:349
    \n+
    int coord_to_rank(iTupel coord) const
    map coordinate in torus to rank using lexicographic ordering
    Definition torus.hh:157
    \n+
    bool inside(iTupel c) const
    return true if coordinate is inside torus
    Definition torus.hh:136
    \n+
    int tag() const
    return tag used by torus
    Definition torus.hh:130
    \n+
    Definition torus.hh:276
    \n+
    iTupel delta() const
    return distance vector
    Definition torus.hh:291
    \n+
    bool operator==(const ProcListIterator &iter) const
    Return true when two iterators point to same member.
    Definition torus.hh:313
    \n+
    bool operator!=(const ProcListIterator &iter) const
    Return true when two iterators do not point to same member.
    Definition torus.hh:320
    \n+
    int rank() const
    return rank of neighboring process
    Definition torus.hh:285
    \n+
    ProcListIterator(typename std::deque< CommPartner >::const_iterator iter)
    make an iterator
    Definition torus.hh:279
    \n+
    ProcListIterator & operator++()
    Increment iterator to next cell.
    Definition torus.hh:326
    \n+
    int index() const
    return index in proclist
    Definition torus.hh:297
    \n+
    int distance() const
    return 1-norm of distance vector
    Definition torus.hh:303
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,193 +1,680 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgridpersistentcontainer.hh\n+torus.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH\n-6#define DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH\n+5#ifndef DUNE_GRID_YASPGRID_TORUS_HH\n+6#define DUNE_GRID_YASPGRID_TORUS_HH\n 7\n-12#include \n+8#include \n+9#include \n+10#include \n+11#include \n+12#include \n 13#include \n 14\n-15#include \n-16#include \n-17#include \"../yaspgrid.hh\"\n+15#if HAVE_MPI\n+16#include \n+17#endif\n 18\n-19namespace Dune\n-20{\n-21\n-33 template\n-34 class YaspPersistentContainerIndex\n-35 {\n-36\n-37 public:\n-38 YaspPersistentContainerIndex(const Grid & grid, int codim)\n-39 : _grid(grid), _codim(codim)\n-40 {\n-41 recomputeOffsets();\n-42 }\n-43\n-45 typedef std::size_t IndexType;\n-46\n-48 template\n-49 IndexType index (const Entity& e) const\n-50 {\n-51 static const int cc = Entity::codimension;\n-52 std::size_t level = e.level();\n-53 return _grid.indexsets[level]->template index(e) + _offsets[level];\n-54 }\n-55\n-57 template< class Entity >\n-58 IndexType subIndex ( const Entity &e, int i, unsigned int codim ) const\n-59 {\n-60\n-61 static const int cc = Entity::codimension;\n-62 std::size_t level = e.level();\n-63 return _grid.indexsets[level]->template subIndex(e,i,codim) + _offsets\n-[level];\n-64 }\n-65\n-67 std::size_t size (int /* codim */) const\n-68 {\n-69 if (_grid.indexsets.size()+1 != _offsets.size())\n-70 recomputeOffsets();\n-71 return _offsets.back();\n-72 }\n-73\n-74 private:\n-75 void recomputeOffsets() const\n-76 {\n-77 _offsets.resize(_grid.indexsets.size()+1,0);\n-78 _offsets[0] = 0;\n-79 for (std::size_t i=0; i<_grid.indexsets.size(); i++)\n-80 _offsets[i+1] = _offsets[i] + _grid.indexsets[i]->size(_codim);\n-81 }\n-82\n-83 const Grid& _grid;\n-84 int _codim;\n-85 mutable std::vector _offsets;\n-86 };\n-87\n-94 template\n-95 class PersistentContainer< YaspGrid, T >\n-96 /* We have to pass the reference to the IndexSet to the constructor\n-97 of the PersistentContainerVector. In order to have a valid\n-98 indexset available, we inherit from a private indexset\n-99 */\n-100 : private YaspPersistentContainerIndex< const YaspGrid >,\n-101 public PersistentContainerVector< YaspGrid,\n-102 YaspPersistentContainerIndex< const YaspGrid >,\n-103 std::vector >\n-104 {\n-105 typedef YaspPersistentContainerIndex<_const_YaspGrid >\n-IndexSet;\n-106 typedef PersistentContainerVector<_YaspGrid, IndexSet,\n-std::vector > Base;\n-107\n-108 public:\n-109 typedef typename Base::Grid Grid;\n-110 typedef typename Base::Value Value;\n-111\n-112 using Base::size;\n-113\n-114 PersistentContainer ( const Grid &grid, int codim, const Value &value =\n-Value() )\n-115 : IndexSet(grid, codim),\n-116 Base(*this, codim, value)\n-117 {}\n-118 };\n-119\n-120} // end namespace Dune\n-121\n-122#endif // end DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH\n-persistentcontainervector.hh\n+19#include \n+20#include \n+21#include \n+22\n+23#include \"partitioning.hh\"\n+24\n+29namespace Dune\n+30{\n+31\n+45 template\n+46 class Torus {\n+47 public:\n+49 typedef std::array iTupel;\n+50\n+51\n+52 private:\n+53 struct CommPartner {\n+54 int rank;\n+55 iTupel delta;\n+56 int index;\n+57 };\n+58\n+59 struct CommTask {\n+60 int rank; // process to send to / receive from\n+61 int size; // size of buffer\n+62 void *buffer; // buffer to send / receive\n+63 };\n+64\n+65 public:\n+67 Torus ()\n+68 {}\n+69\n+71 Torus (Communication comm, int tag, iTupel size, int overlap, const Yasp::\n+Partitioning* partitioner)\n+72 : _comm(comm), _tag(tag)\n+73 {\n+74 // determine dimensions\n+75 partitioner->partition(size, _comm.size(), _dims, overlap);\n+76\n+77 // compute increments for lexicographic ordering\n+78 int inc = 1;\n+79 for (int i=0; i=0; i--)\n+139 if (c[i]<0 || c[i]>=_dims[i]) return false;\n+140 return true;\n+141 }\n+142\n+144 iTupel rank_to_coord (int rank) const\n+145 {\n+146 iTupel coord;\n+147 rank = rank%_comm.size();\n+148 for (int i=d-1; i>=0; i--)\n+149 {\n+150 coord[i] = rank/_increment[i];\n+151 rank = rank%_increment[i];\n+152 }\n+153 return coord;\n+154 }\n+155\n+157 int coord_to_rank (iTupel coord) const\n+158 {\n+159 for (int i=0; i1 && coord[i]==_dims[i]-1) c += power;\n+190 power *= 2;\n+191 }\n+192\n+193 return c;\n+194 }\n+195\n+197 int color (int rank) const\n+198 {\n+199 return color(rank_to_coord(rank));\n+200 }\n+201\n+203 int neighbors () const\n+204 {\n+205 int n=1;\n+206 for (int i=0; i periodic) const\n+213 {\n+214 iTupel coord = rank_to_coord(_comm.rank()); // my own coordinate with 0 <=\n+c_i < dims_i\n+215\n+216 for (int i=0; i no neighbor\n+221 if (coord[i]==0 && periodic[i]==false) return false;\n+222 }\n+223 if (delta[i]>0)\n+224 {\n+225 // if I am on the boundary and domain is not periodic => no neighbor\n+226 if (coord[i]==_dims[i]-1 && periodic[i]==false) return false;\n+227 }\n+228 }\n+229 return true;\n+230 }\n+231\n+239 double partition (int rank, iTupel origin_in, iTupel size_in, iTupel&\n+origin_out, iTupel& size_out) const\n+240 {\n+241 iTupel coord = rank_to_coord(rank);\n+242 double maxsize = 1;\n+243 double sz = 1;\n+244\n+245 // make a tensor product partition\n+246 for (int i=0; i::const_iterator iter)\n+280 {\n+281 i = iter;\n+282 }\n+283\n+285 int rank () const\n+286 {\n+287 return i->rank;\n+288 }\n+289\n+291 iTupel delta () const\n+292 {\n+293 return i->delta;\n+294 }\n+295\n+297 int index () const\n+298 {\n+299 return i->index;\n+300 }\n+301\n+303 int distance () const\n+304 {\n+305 int dist = 0;\n+306 iTupel delta=i->delta;\n+307 for (int j=0; j::const_iterator i;\n+334 };\n+335\n+337 ProcListIterator sendbegin () const\n+338 {\n+339 return ProcListIterator(_sendlist.begin());\n+340 }\n+341\n+343 ProcListIterator sendend () const\n+344 {\n+345 return ProcListIterator(_sendlist.end());\n+346 }\n+347\n+349 ProcListIterator recvbegin () const\n+350 {\n+351 return ProcListIterator(_recvlist.begin());\n+352 }\n+353\n+355 ProcListIterator recvend () const\n+356 {\n+357 return ProcListIterator(_recvlist.end());\n+358 }\n+359\n+361 void send (int rank, void* buffer, int size) const\n+362 {\n+363 CommTask task;\n+364 task.rank = rank;\n+365 task.buffer = buffer;\n+366 task.size = size;\n+367 if (rank!=_comm.rank())\n+368 _sendrequests.push_back(task);\n+369 else\n+370 _localsendrequests.push_back(task);\n+371 }\n+372\n+374 void recv (int rank, void* buffer, int size) const\n+375 {\n+376 CommTask task;\n+377 task.rank = rank;\n+378 task.buffer = buffer;\n+379 task.size = size;\n+380 if (rank!=_comm.rank())\n+381 _recvrequests.push_back(task);\n+382 else\n+383 _localrecvrequests.push_back(task);\n+384 }\n+385\n+387 void exchange () const\n+388 {\n+389 // handle local requests first\n+390 if (_localsendrequests.size()!=_localrecvrequests.size())\n+391 {\n+392 std::cout << \"[\" << rank() << \"]: ERROR: local sends/receives do not match\n+in exchange!\" << std::endl;\n+393 return;\n+394 }\n+395 for (unsigned int i=0; i<_localsendrequests.size(); i++)\n+396 {\n+397 if (_localsendrequests[i].size!=_localrecvrequests[i].size)\n+398 {\n+399 std::cout << \"[\" << rank() << \"]: ERROR: size in local sends/receive does\n+not match in exchange!\" << std::endl;\n+400 return;\n+401 }\n+402 memcpy(_localrecvrequests[i].buffer,_localsendrequests[i].buffer,_\n+localsendrequests[i].size);\n+403 }\n+404 _localsendrequests.clear();\n+405 _localrecvrequests.clear();\n+406\n+407#if HAVE_MPI\n+408 // handle foreign requests\n+409\n+410 std::vector requests(_sendrequests.size() + _recvrequests.size\n+());\n+411 MPI_Request* req = requests.data();\n+412\n+413 // issue sends to foreign processes\n+414 for (unsigned int i=0; i<_sendrequests.size(); i++)\n+415 if (_sendrequests[i].rank!=rank())\n+416 {\n+417 // std::cout << \"[\" << rank() << \"]\" << \" send \" << _sendrequests[i].size\n+<< \" bytes \"\n+418 // << \"to \" << _sendrequests[i].rank << \" p=\" << _sendrequests[i].buffer <<\n+std::endl;\n+419 MPI_Isend(_sendrequests[i].buffer, _sendrequests[i].size, MPI_BYTE,\n+420 _sendrequests[i].rank, _tag, _comm, req++);\n+421 }\n+422\n+423 // issue receives from foreign processes\n+424 for (unsigned int i=0; i<_recvrequests.size(); i++)\n+425 if (_recvrequests[i].rank!=rank())\n+426 {\n+427 // std::cout << \"[\" << rank() << \"]\" << \" recv \" << _recvrequests[i].size\n+<< \" bytes \"\n+428 // << \"fm \" << _recvrequests[i].rank << \" p=\" << _recvrequests[i].buffer <<\n+std::endl;\n+429 MPI_Irecv(_recvrequests[i].buffer, _recvrequests[i].size, MPI_BYTE,\n+430 _recvrequests[i].rank, _tag, _comm, req++);\n+431 }\n+432\n+433 // Wait for communication to complete\n+434 MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);\n+435\n+436 // clear request buffers\n+437 _sendrequests.clear();\n+438 _recvrequests.clear();\n+439#endif\n+440 }\n+441\n+443 double global_max (double x) const\n+444 {\n+445 double res = 0.0;\n+446 _comm.template allreduce,double>(&x, &res, 1);\n+447 return res;\n+448 }\n+449\n+451 void print (std::ostream& s) const\n+452 {\n+453 s << \"[\" << rank() << \"]: Torus \" << procs() << \" processor(s) arranged as\n+\" << dims() << std::endl;\n+454 for (ProcListIterator i=sendbegin(); i!=sendend(); ++i)\n+455 {\n+456 s << \"[\" << rank() << \"]: send to \"\n+457 << \"rank=\" << i.rank()\n+458 << \" index=\" << i.index()\n+459 << \" delta=\" << i.delta() << \" dist=\" << i.distance() << std::endl;\n+460 }\n+461 for (ProcListIterator i=recvbegin(); i!=recvend(); ++i)\n+462 {\n+463 s << \"[\" << rank() << \"]: recv from \"\n+464 << \"rank=\" << i.rank()\n+465 << \" index=\" << i.index()\n+466 << \" delta=\" << i.delta() << \" dist=\" << i.distance() << std::endl;\n+467 }\n+468 }\n+469\n+470 private:\n+471\n+472 void proclists ()\n+473 {\n+474 // compile the full neighbor list\n+475 CommPartner cp;\n+476 iTupel delta;\n+477\n+478 std::fill(delta.begin(), delta.end(), -1);\n+479 bool ready = false;\n+480 iTupel me, nb;\n+481 me = rank_to_coord(_comm.rank());\n+482 int index = 0;\n+483 int last = neighbors()-1;\n+484 while (!ready)\n+485 {\n+486 // find neighbors coordinates\n+487 for (int i=0; i _sendlist;\n+530 std::deque _recvlist;\n+531\n+532 mutable std::vector _sendrequests;\n+533 mutable std::vector _recvrequests;\n+534 mutable std::vector _localsendrequests;\n+535 mutable std::vector _localrecvrequests;\n+536\n+537 };\n+538\n+540 template \n+541 inline std::ostream& operator<<_(std::ostream& s, const\n+Torus & t)\n+542 {\n+543 t.print(s);\n+544 return s;\n+545 }\n+546}\n+547\n+548#endif\n+partitioning.hh\n+This file provides tools to partition YaspGrids. If you want to write your own\n+partitioner,...\n+exceptions.hh\n+Dune::operator<<\n+std::ostream & operator<<(std::ostream &out, const PartitionType &type)\n+write a PartitionType to a stream\n+Definition gridenums.hh:72\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Entity::level\n-int level() const\n-The level of this entity.\n-Definition common/entity.hh:124\n-Dune::Entity::codimension\n-static constexpr int codimension\n-Know your own codimension.\n-Definition common/entity.hh:106\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::size\n-int size(int level, int codim) const\n-Return number of grid entities of a given codim on a given level in this\n-process.\n-Definition common/grid.hh:538\n-Dune::PersistentContainer\n-A class for storing data during an adaptation cycle.\n-Definition utility/persistentcontainer.hh:22\n-Dune::PersistentContainer::Value\n-Base::Value Value\n-Definition utility/persistentcontainer.hh:27\n-Dune::PersistentContainerMap<_G,_G::LocalIdSet,_std::map<_G::LocalIdSet::\n-IdType,_T_>_>::grid\n-const Grid & grid() const\n-Definition persistentcontainermap.hh:114\n-Dune::PersistentContainerMap::size\n-Size size() const\n-Definition persistentcontainermap.hh:85\n-Dune::PersistentContainerVector\n-vector-based implementation of the PersistentContainer\n-Definition persistentcontainervector.hh:51\n-Dune::PersistentContainerVector::Value\n-Vector::value_type Value\n-Definition persistentcontainervector.hh:57\n-Dune::PersistentContainerVector::Grid\n-G Grid\n-Definition persistentcontainervector.hh:55\n-Dune::YaspGrid\n-[ provides Dune::Grid ]\n-Definition yaspgrid.hh:166\n-Dune::YaspPersistentContainerIndex\n-Definition yaspgridpersistentcontainer.hh:35\n-Dune::YaspPersistentContainerIndex::index\n-IndexType index(const Entity &e) const\n-Map entity to index. The result of calling this method with an entity that is\n-not in the index set is...\n-Definition yaspgridpersistentcontainer.hh:49\n-Dune::YaspPersistentContainerIndex::size\n-std::size_t size(int) const\n-Return total number of entities of given geometry type in entity set .\n-Definition yaspgridpersistentcontainer.hh:67\n-Dune::YaspPersistentContainerIndex::subIndex\n-IndexType subIndex(const Entity &e, int i, unsigned int codim) const\n-Map a subentity to an index.\n-Definition yaspgridpersistentcontainer.hh:58\n-Dune::YaspPersistentContainerIndex::YaspPersistentContainerIndex\n-YaspPersistentContainerIndex(const Grid &grid, int codim)\n-Definition yaspgridpersistentcontainer.hh:38\n-Dune::YaspPersistentContainerIndex::IndexType\n-std::size_t IndexType\n-The type used for the indices.\n-Definition yaspgridpersistentcontainer.hh:45\n-Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>::Grid\n-Base::Grid Grid\n-Definition yaspgridpersistentcontainer.hh:109\n-Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>::Value\n-Base::Value Value\n-Definition yaspgridpersistentcontainer.hh:110\n-Dune::PersistentContainer<_YaspGrid<_dim,_CoordCont_>,_T_>::PersistentContainer\n-PersistentContainer(const Grid &grid, int codim, const Value &value=Value())\n-Definition yaspgridpersistentcontainer.hh:114\n-persistentcontainer.hh\n+Dune::Yasp::Partitioning\n+a base class for the yaspgrid partitioning strategy\n+Definition partitioning.hh:38\n+Dune::Yasp::Partitioning::partition\n+virtual void partition(const iTupel &, int, iTupel &, int) const =0\n+Dune::Torus\n+Definition torus.hh:46\n+Dune::Torus::Torus\n+Torus()\n+constructor making uninitialized object\n+Definition torus.hh:67\n+Dune::Torus::color\n+int color(int rank) const\n+assign color to given rank\n+Definition torus.hh:197\n+Dune::Torus::partition\n+double partition(int rank, iTupel origin_in, iTupel size_in, iTupel &origin_\n+out, iTupel &size_out) const\n+partition the given grid onto the torus and return the piece of the process\n+with given rank; returns ...\n+Definition torus.hh:239\n+Dune::Torus::dims\n+int dims(int i) const\n+return dimensions of torus in direction i\n+Definition torus.hh:118\n+Dune::Torus::coord\n+iTupel coord() const\n+return own coordinates\n+Definition torus.hh:100\n+Dune::Torus::rank\n+int rank() const\n+return own rank\n+Definition torus.hh:94\n+Dune::Torus::dims\n+const iTupel & dims() const\n+return dimensions of torus\n+Definition torus.hh:112\n+Dune::Torus::rank_relative\n+int rank_relative(int rank, int dir, int cnt) const\n+return rank of process where its coordinate in direction dir has offset cnt\n+(handles periodic case)\n+Definition torus.hh:166\n+Dune::Torus::recv\n+void recv(int rank, void *buffer, int size) const\n+store a receive request; buffers are received in order; handles also local\n+requests with memcpy\n+Definition torus.hh:374\n+Dune::Torus::send\n+void send(int rank, void *buffer, int size) const\n+store a send request; buffers are sent in order; handles also local requests\n+with memcpy\n+Definition torus.hh:361\n+Dune::Torus::Torus\n+Torus(Communication comm, int tag, iTupel size, int overlap, const Yasp::\n+Partitioning< d > *partitioner)\n+make partitioner from communicator and coarse mesh size\n+Definition torus.hh:71\n+Dune::Torus::neighbors\n+int neighbors() const\n+return the number of neighbors, which is\n+Definition torus.hh:203\n+Dune::Torus::print\n+void print(std::ostream &s) const\n+print contents of torus object\n+Definition torus.hh:451\n+Dune::Torus::global_max\n+double global_max(double x) const\n+global max\n+Definition torus.hh:443\n+Dune::Torus::comm\n+Communication comm() const\n+return communicator\n+Definition torus.hh:124\n+Dune::Torus::color\n+int color(const iTupel &coord) const\n+assign color to given coordinate\n+Definition torus.hh:174\n+Dune::Torus::recvend\n+ProcListIterator recvend() const\n+last process in receive list\n+Definition torus.hh:355\n+Dune::Torus::is_neighbor\n+bool is_neighbor(iTupel delta, std::bitset< d > periodic) const\n+return true if neighbor with given delta is a neighbor under the given\n+periodicity\n+Definition torus.hh:212\n+Dune::Torus::sendend\n+ProcListIterator sendend() const\n+end of send list\n+Definition torus.hh:343\n+Dune::Torus::procs\n+int procs() const\n+return number of processes\n+Definition torus.hh:106\n+Dune::Torus::rank_to_coord\n+iTupel rank_to_coord(int rank) const\n+map rank to coordinate in torus using lexicographic ordering\n+Definition torus.hh:144\n+Dune::Torus::iTupel\n+std::array< int, d > iTupel\n+type used to pass tupels in and out\n+Definition torus.hh:49\n+Dune::Torus::sendbegin\n+ProcListIterator sendbegin() const\n+first process in send list\n+Definition torus.hh:337\n+Dune::Torus::exchange\n+void exchange() const\n+exchange messages stored in request buffers; clear request buffers afterwards\n+Definition torus.hh:387\n+Dune::Torus::recvbegin\n+ProcListIterator recvbegin() const\n+first process in receive list\n+Definition torus.hh:349\n+Dune::Torus::coord_to_rank\n+int coord_to_rank(iTupel coord) const\n+map coordinate in torus to rank using lexicographic ordering\n+Definition torus.hh:157\n+Dune::Torus::inside\n+bool inside(iTupel c) const\n+return true if coordinate is inside torus\n+Definition torus.hh:136\n+Dune::Torus::tag\n+int tag() const\n+return tag used by torus\n+Definition torus.hh:130\n+Dune::Torus::ProcListIterator\n+Definition torus.hh:276\n+Dune::Torus::ProcListIterator::delta\n+iTupel delta() const\n+return distance vector\n+Definition torus.hh:291\n+Dune::Torus::ProcListIterator::operator==\n+bool operator==(const ProcListIterator &iter) const\n+Return true when two iterators point to same member.\n+Definition torus.hh:313\n+Dune::Torus::ProcListIterator::operator!=\n+bool operator!=(const ProcListIterator &iter) const\n+Return true when two iterators do not point to same member.\n+Definition torus.hh:320\n+Dune::Torus::ProcListIterator::rank\n+int rank() const\n+return rank of neighboring process\n+Definition torus.hh:285\n+Dune::Torus::ProcListIterator::ProcListIterator\n+ProcListIterator(typename std::deque< CommPartner >::const_iterator iter)\n+make an iterator\n+Definition torus.hh:279\n+Dune::Torus::ProcListIterator::operator++\n+ProcListIterator & operator++()\n+Increment iterator to next cell.\n+Definition torus.hh:326\n+Dune::Torus::ProcListIterator::index\n+int index() const\n+return index in proclist\n+Definition torus.hh:297\n+Dune::Torus::ProcListIterator::distance\n+int distance() const\n+return 1-norm of distance vector\n+Definition torus.hh:303\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00218.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00218.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgrididset.hh File Reference\n+dune-grid: yaspgridentityseed.hh File Reference\n \n \n \n \n \n \n \n@@ -72,32 +72,37 @@\n
  • dune
  • grid
  • yaspgrid
  • \n \n \n
    \n \n-
    yaspgrididset.hh File Reference
    \n+
    yaspgridentityseed.hh File Reference
    \n
    \n
    \n \n+

    The YaspEntitySeed class. \n+More...

    \n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::YaspGlobalIdSet< GridImp >
     persistent, globally unique Ids More...
    class  Dune::YaspEntitySeed< codim, GridImp >
     Describes the minimal information necessary to create a fully functional YaspEntity. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    The YaspEntitySeed class.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,19 +2,23 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n Classes | Namespaces\n-yaspgrididset.hh File Reference\n+yaspgridentityseed.hh File Reference\n+The YaspEntitySeed class. More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspGlobalIdSet<_GridImp_>\n-\u00a0 persistent, globally unique Ids More...\n+class \u00a0 Dune::YaspEntitySeed<_codim,_GridImp_>\n+\u00a0 Describes the minimal information necessary to create a fully\n+ functional YaspEntity. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+***** Detailed Description *****\n+The YaspEntitySeed class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00218_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00218_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgrididset.hh Source File\n+dune-grid: yaspgridentityseed.hh Source File\n \n \n \n \n \n \n \n@@ -74,88 +74,82 @@\n \n \n \n
    \n-
    yaspgrididset.hh
    \n+
    yaspgridentityseed.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDIDSET_HH
    \n-
    6#define DUNE_GRID_YASPGRIDIDSET_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDENTITYSEED_HH
    \n+
    6#define DUNE_GRID_YASPGRIDENTITYSEED_HH
    \n
    7
    \n-
    8
    \n-
    9namespace Dune {
    \n-
    10
    \n-
    11 //========================================================================
    \n-
    16 //========================================================================
    \n-
    17
    \n-
    18 template<class GridImp>
    \n-
    \n-
    19 class YaspGlobalIdSet : public IdSet<GridImp,YaspGlobalIdSet<GridImp>,
    \n-
    20 typename std::remove_const<GridImp>::type::PersistentIndexType >
    \n-
    21 /*
    \n-
    22 We used the remove_const to extract the Type from the mutable class,
    \n-
    23 because the const class is not instantiated yet.
    \n-
    24 */
    \n-
    25 {
    \n-\n-
    27
    \n-
    28 public:
    \n-
    30 typedef typename std::remove_const<GridImp>::type::PersistentIndexType IdType;
    \n-
    31
    \n-
    32 using IdSet<GridImp, This, IdType>::subId;
    \n-
    33
    \n-
    \n-\n+
    12namespace Dune {
    \n+
    13
    \n+
    16 template<int codim, class GridImp>
    \n+
    \n+\n+
    18 {
    \n+
    20 constexpr static int dim = GridImp::dimension;
    \n+
    21
    \n+
    22 public:
    \n+
    24 constexpr static int codimension = codim;
    \n+
    25
    \n+
    \n+\n+
    28 : _l(-1), _o(0)
    \n+
    29 {
    \n+
    30 std::fill(_c.begin(),_c.end(),0);
    \n+
    31 }
    \n+
    \n+
    32
    \n+
    \n+
    34 YaspEntitySeed (int level, std::array<int, dim> coord, int o = 0)
    \n+
    35 : _l(level), _c(coord), _o(o)
    \n
    36 {}
    \n
    \n
    37
    \n-
    39 /*
    \n-
    40 We use the remove_const to extract the Type from the mutable class,
    \n-
    41 because the const class is not instantiated yet.
    \n-
    42 */
    \n-
    43 template<int cd>
    \n-
    \n-
    44 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
    \n-
    45 {
    \n-
    46 return e.impl().persistentIndex();
    \n-
    47 }
    \n-
    \n-
    48
    \n-
    50 /*
    \n-
    51 We use the remove_const to extract the Type from the mutable class,
    \n-
    52 because the const class is not instantiated yet.
    \n-
    53 */
    \n-
    \n-
    54 IdType subId (const typename std::remove_const<GridImp>::type::Traits::template Codim< 0 >::Entity &e,
    \n-
    55 int i, unsigned int codim ) const
    \n-
    56 {
    \n-
    57 return e.impl().subPersistentIndex(i,codim);
    \n-
    58 }
    \n-
    \n-
    59
    \n-
    60 };
    \n-
    \n-
    61
    \n-
    62} // namespace Dune
    \n-
    63
    \n-
    64#endif // DUNE_GRID_YASPGRIDIDSET_HH
    \n+
    \n+
    39 bool isValid() const
    \n+
    40 {
    \n+
    41 return _l != -1;
    \n+
    42 }
    \n+
    \n+
    43
    \n+
    44 int level () const { return _l; }
    \n+
    45 const std::array<int, dim> & coord() const { return _c; }
    \n+
    46 int offset () const { return _o; }
    \n+
    47
    \n+
    48 protected:
    \n+
    49 int _l; // grid level
    \n+
    50 std::array<int, dim> _c; // coord in the global grid
    \n+
    51 int _o; // the offset: which YGridComponent, does the entity belong to
    \n+
    52 };
    \n+
    \n+
    53
    \n+
    54} // namespace Dune
    \n+
    55
    \n+
    56#endif // DUNE_GRID_YASPGRIDENTITYSEED_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n-
    persistent, globally unique Ids
    Definition yaspgrididset.hh:25
    \n-
    IdType subId(const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    get id of subentity
    Definition yaspgrididset.hh:54
    \n-
    std::remove_const< GridImp >::type::PersistentIndexType IdType
    define the type used for persistent indices
    Definition yaspgrididset.hh:30
    \n-
    YaspGlobalIdSet()
    Only default-constructible.
    Definition yaspgrididset.hh:35
    \n-
    IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
    get id of an entity
    Definition yaspgrididset.hh:44
    \n+
    Describes the minimal information necessary to create a fully functional YaspEntity.
    Definition yaspgridentityseed.hh:18
    \n+
    int _o
    Definition yaspgridentityseed.hh:51
    \n+
    std::array< int, dim > _c
    Definition yaspgridentityseed.hh:50
    \n+
    int _l
    Definition yaspgridentityseed.hh:49
    \n+
    int level() const
    Definition yaspgridentityseed.hh:44
    \n+
    YaspEntitySeed()
    default construct an invalid entity seed
    Definition yaspgridentityseed.hh:27
    \n+
    YaspEntitySeed(int level, std::array< int, dim > coord, int o=0)
    constructor
    Definition yaspgridentityseed.hh:34
    \n+
    int offset() const
    Definition yaspgridentityseed.hh:46
    \n+
    static constexpr int codimension
    codimension of entity
    Definition yaspgridentityseed.hh:24
    \n+
    const std::array< int, dim > & coord() const
    Definition yaspgridentityseed.hh:45
    \n+
    bool isValid() const
    check whether the EntitySeed refers to a valid Entity
    Definition yaspgridentityseed.hh:39
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,98 +1,98 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-yaspgrididset.hh\n+yaspgridentityseed.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDIDSET_HH\n-6#define DUNE_GRID_YASPGRIDIDSET_HH\n+5#ifndef DUNE_GRID_YASPGRIDENTITYSEED_HH\n+6#define DUNE_GRID_YASPGRIDENTITYSEED_HH\n 7\n-8\n-9namespace Dune {\n-10\n-11 //========================================================================\n-16 //========================================================================\n-17\n-18 template\n-19 class YaspGlobalIdSet : public IdSet,\n-20 typename std::remove_const::type::PersistentIndexType >\n-21 /*\n-22 We used the remove_const to extract the Type from the mutable class,\n-23 because the const class is not instantiated yet.\n-24 */\n-25 {\n-26 typedef YaspGlobalIdSet<_GridImp_> This;\n-27\n-28 public:\n-30 typedef typename std::remove_const::type::PersistentIndexType\n-IdType;\n-31\n-32 using IdSet::subId;\n-33\n-35 YaspGlobalIdSet()\n+12namespace Dune {\n+13\n+16 template\n+17 class YaspEntitySeed\n+18 {\n+20 constexpr static int dim = GridImp::dimension;\n+21\n+22 public:\n+24 constexpr static int codimension = codim;\n+25\n+27 YaspEntitySeed ()\n+28 : _l(-1), _o(0)\n+29 {\n+30 std::fill(_c.begin(),_c.end(),0);\n+31 }\n+32\n+34 YaspEntitySeed (int level, std::array coord, int o = 0)\n+35 : _l(level), _c(coord), _o(o)\n 36 {}\n 37\n-39 /*\n-40 We use the remove_const to extract the Type from the mutable class,\n-41 because the const class is not instantiated yet.\n-42 */\n-43 template\n-44 IdType id (const typename std::remove_const::type::Traits::template\n-Codim::Entity& e) const\n-45 {\n-46 return e.impl().persistentIndex();\n-47 }\n-48\n-50 /*\n-51 We use the remove_const to extract the Type from the mutable class,\n-52 because the const class is not instantiated yet.\n-53 */\n-54 IdType subId (const typename std::remove_const::type::Traits::\n-template Codim< 0 >::Entity &e,\n-55 int i, unsigned int codim ) const\n-56 {\n-57 return e.impl().subPersistentIndex(i,codim);\n-58 }\n-59\n-60 };\n-61\n-62} // namespace Dune\n-63\n-64#endif // DUNE_GRID_YASPGRIDIDSET_HH\n+39 bool isValid() const\n+40 {\n+41 return _l != -1;\n+42 }\n+43\n+44 int level () const { return _l; }\n+45 const std::array & coord() const { return _c; }\n+46 int offset () const { return _o; }\n+47\n+48 protected:\n+49 int _l; // grid level\n+50 std::array _c; // coord in the global grid\n+51 int _o; // the offset: which YGridComponent, does the entity belong to\n+52 };\n+53\n+54} // namespace Dune\n+55\n+56#endif // DUNE_GRID_YASPGRIDENTITYSEED_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IdSet\n-Id Set Interface.\n-Definition common/indexidset.hh:447\n-Dune::YaspGlobalIdSet\n-persistent, globally unique Ids\n-Definition yaspgrididset.hh:25\n-Dune::YaspGlobalIdSet::subId\n-IdType subId(const typename std::remove_const< GridImp >::type::Traits::\n-template Codim< 0 >::Entity &e, int i, unsigned int codim) const\n-get id of subentity\n-Definition yaspgrididset.hh:54\n-Dune::YaspGlobalIdSet::IdType\n-std::remove_const< GridImp >::type::PersistentIndexType IdType\n-define the type used for persistent indices\n-Definition yaspgrididset.hh:30\n-Dune::YaspGlobalIdSet::YaspGlobalIdSet\n-YaspGlobalIdSet()\n-Only default-constructible.\n-Definition yaspgrididset.hh:35\n-Dune::YaspGlobalIdSet::id\n-IdType id(const typename std::remove_const< GridImp >::type::Traits::template\n-Codim< cd >::Entity &e) const\n-get id of an entity\n-Definition yaspgrididset.hh:44\n+Dune::YaspEntitySeed\n+Describes the minimal information necessary to create a fully functional\n+YaspEntity.\n+Definition yaspgridentityseed.hh:18\n+Dune::YaspEntitySeed::_o\n+int _o\n+Definition yaspgridentityseed.hh:51\n+Dune::YaspEntitySeed::_c\n+std::array< int, dim > _c\n+Definition yaspgridentityseed.hh:50\n+Dune::YaspEntitySeed::_l\n+int _l\n+Definition yaspgridentityseed.hh:49\n+Dune::YaspEntitySeed::level\n+int level() const\n+Definition yaspgridentityseed.hh:44\n+Dune::YaspEntitySeed::YaspEntitySeed\n+YaspEntitySeed()\n+default construct an invalid entity seed\n+Definition yaspgridentityseed.hh:27\n+Dune::YaspEntitySeed::YaspEntitySeed\n+YaspEntitySeed(int level, std::array< int, dim > coord, int o=0)\n+constructor\n+Definition yaspgridentityseed.hh:34\n+Dune::YaspEntitySeed::offset\n+int offset() const\n+Definition yaspgridentityseed.hh:46\n+Dune::YaspEntitySeed::codimension\n+static constexpr int codimension\n+codimension of entity\n+Definition yaspgridentityseed.hh:24\n+Dune::YaspEntitySeed::coord\n+const std::array< int, dim > & coord() const\n+Definition yaspgridentityseed.hh:45\n+Dune::YaspEntitySeed::isValid\n+bool isValid() const\n+check whether the EntitySeed refers to a valid Entity\n+Definition yaspgridentityseed.hh:39\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00233.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00233.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: torus.hh File Reference\n+dune-grid: yaspgridleveliterator.hh File Reference\n \n \n \n \n \n \n \n@@ -71,58 +71,38 @@\n \n
    \n \n
    \n \n-
    torus.hh File Reference
    \n+Namespaces
    \n+
    yaspgridleveliterator.hh File Reference
    \n \n
    \n \n-

    This file provides the infrastructure for toroidal communication in YaspGrid. \n+

    The YaspLevelIterator class. \n More...

    \n-
    #include <array>
    \n-#include <bitset>
    \n-#include <cmath>
    \n-#include <deque>
    \n-#include <iostream>
    \n-#include <vector>
    \n-#include <mpi.h>
    \n-#include <dune/common/binaryfunctions.hh>
    \n-#include <dune/common/streamoperators.hh>
    \n-#include <dune/grid/common/exceptions.hh>
    \n-#include "partitioning.hh"
    \n-
    \n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::Torus< Communication, d >
     
    class  Dune::Torus< Communication, d >::ProcListIterator
    class  Dune::YaspLevelIterator< codim, pitype, GridImp >
     Iterates over entities of one grid level. More...
     
    \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n-\n-\n

    \n-Functions

    template<class Communication , int d>
    std::ostream & Dune::operator<< (std::ostream &s, const Torus< Communication, d > &t)
     Output operator for Torus.
     
    \n

    Detailed Description

    \n-

    This file provides the infrastructure for toroidal communication in YaspGrid.

    \n+

    The YaspLevelIterator class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,42 +1,23 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-Classes | Namespaces | Functions\n-torus.hh File Reference\n-This file provides the infrastructure for toroidal communication in YaspGrid.\n-More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \"partitioning.hh\"\n+Classes | Namespaces\n+yaspgridleveliterator.hh File Reference\n+The YaspLevelIterator class. More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::Torus<_Communication,_d_>\n-\u00a0\n-class \u00a0 Dune::Torus<_Communication,_d_>::ProcListIterator\n+class \u00a0 Dune::YaspLevelIterator<_codim,_pitype,_GridImp_>\n+\u00a0 Iterates over entities of one grid level. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-Functions\n-template\n-std::ostream &\u00a0 Dune::operator<< (std::ostream &s, const Torus< Communication,\n- d > &t)\n-\u00a0 Output operator for Torus.\n-\u00a0\n ***** Detailed Description *****\n-This file provides the infrastructure for toroidal communication in YaspGrid.\n+The YaspLevelIterator class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00233_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00233_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: torus.hh Source File\n+dune-grid: yaspgridleveliterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,619 +74,91 @@\n \n \n
    \n
    \n-
    torus.hh
    \n+
    yaspgridleveliterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRID_TORUS_HH
    \n-
    6#define DUNE_GRID_YASPGRID_TORUS_HH
    \n+
    5#ifndef DUNE_GRID_YASPGRIDLEVELITERATOR_HH
    \n+
    6#define DUNE_GRID_YASPGRIDLEVELITERATOR_HH
    \n
    7
    \n-
    8#include <array>
    \n-
    9#include <bitset>
    \n-
    10#include <cmath>
    \n-
    11#include <deque>
    \n-
    12#include <iostream>
    \n-
    13#include <vector>
    \n+
    12namespace Dune {
    \n+
    13
    \n
    14
    \n-
    15#if HAVE_MPI
    \n-
    16#include <mpi.h>
    \n-
    17#endif
    \n-
    18
    \n-
    19#include <dune/common/binaryfunctions.hh>
    \n-
    20#include <dune/common/streamoperators.hh>
    \n-\n-
    22
    \n-
    23#include "partitioning.hh"
    \n-
    24
    \n-
    29namespace Dune
    \n-
    30{
    \n-
    31
    \n-
    45 template<class Communication, int d>
    \n-
    \n-
    46 class Torus {
    \n-
    47 public:
    \n-
    49 typedef std::array<int, d> iTupel;
    \n+
    17 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n+
    \n+\n+
    19 {
    \n+
    21 constexpr static int dim = GridImp::dimension;
    \n+
    23 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    24 typedef typename GridImp::ctype ctype;
    \n+
    25 public:
    \n+
    26 typedef typename GridImp::template Codim<codim>::Entity Entity;
    \n+
    27 typedef typename GridImp::YGridLevelIterator YGLI;
    \n+
    28 typedef typename GridImp::YGrid::Iterator I;
    \n+
    29
    \n+
    \n+\n+
    32 {}
    \n+
    \n+
    33
    \n+
    \n+
    35 YaspLevelIterator (const YGLI & g, const I& it)
    \n+
    36 : _entity(YaspEntity<codim, dim, GridImp>(g,it))
    \n+
    37 {}
    \n+
    \n+
    38
    \n+
    \n+
    40 void increment()
    \n+
    41 {
    \n+
    42 ++(_entity.impl()._it);
    \n+
    43 }
    \n+
    \n+
    44
    \n+
    \n+
    46 bool equals (const YaspLevelIterator& rhs) const
    \n+
    47 {
    \n+
    48 return (_entity == rhs._entity);
    \n+
    49 }
    \n+
    \n
    50
    \n-
    51
    \n-
    52 private:
    \n-
    53 struct CommPartner {
    \n-
    54 int rank;
    \n-
    55 iTupel delta;
    \n-
    56 int index;
    \n-
    57 };
    \n-
    58
    \n-
    59 struct CommTask {
    \n-
    60 int rank; // process to send to / receive from
    \n-
    61 int size; // size of buffer
    \n-
    62 void *buffer; // buffer to send / receive
    \n-
    63 };
    \n-
    64
    \n-
    65 public:
    \n-
    \n-\n-
    68 {}
    \n-
    \n-
    69
    \n-
    \n-
    71 Torus (Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning<d>* partitioner)
    \n-
    72 : _comm(comm), _tag(tag)
    \n-
    73 {
    \n-
    74 // determine dimensions
    \n-
    75 partitioner->partition(size, _comm.size(), _dims, overlap);
    \n-
    76
    \n-
    77 // compute increments for lexicographic ordering
    \n-
    78 int inc = 1;
    \n-
    79 for (int i=0; i<d; i++)
    \n-
    80 {
    \n-
    81 _increment[i] = inc;
    \n-
    82 inc *= _dims[i];
    \n-
    83 }
    \n-
    84
    \n-
    85 // check whether the load balancing matches the size of the communicator
    \n-
    86 if (inc != _comm.size())
    \n-
    87 DUNE_THROW(Dune::Exception, "Communicator size and result of the given load balancer do not match!");
    \n-
    88
    \n-
    89 // make full schedule
    \n-
    90 proclists();
    \n-
    91 }
    \n-
    \n-
    92
    \n-
    \n-
    94 int rank () const
    \n-
    95 {
    \n-
    96 return _comm.rank();
    \n-
    97 }
    \n-
    \n-
    98
    \n-
    \n-
    100 iTupel coord () const
    \n-
    101 {
    \n-
    102 return rank_to_coord(_comm.rank());
    \n-
    103 }
    \n-
    \n-
    104
    \n-
    \n-
    106 int procs () const
    \n-
    107 {
    \n-
    108 return _comm.size();
    \n-
    109 }
    \n-
    \n-
    110
    \n-
    \n-
    112 const iTupel & dims () const
    \n-
    113 {
    \n-
    114 return _dims;
    \n-
    115 }
    \n-
    \n-
    116
    \n-
    \n-
    118 int dims (int i) const
    \n-
    119 {
    \n-
    120 return _dims[i];
    \n-
    121 }
    \n-
    \n-
    122
    \n-
    \n-
    124 Communication comm () const
    \n-
    125 {
    \n-
    126 return _comm;
    \n-
    127 }
    \n-
    \n-
    128
    \n-
    \n-
    130 int tag () const
    \n-
    131 {
    \n-
    132 return _tag;
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    \n-
    136 bool inside (iTupel c) const
    \n-
    137 {
    \n-
    138 for (int i=d-1; i>=0; i--)
    \n-
    139 if (c[i]<0 || c[i]>=_dims[i]) return false;
    \n-
    140 return true;
    \n-
    141 }
    \n-
    \n-
    142
    \n-
    \n-\n-
    145 {
    \n-\n-
    147 rank = rank%_comm.size();
    \n-
    148 for (int i=d-1; i>=0; i--)
    \n-
    149 {
    \n-
    150 coord[i] = rank/_increment[i];
    \n-
    151 rank = rank%_increment[i];
    \n-
    152 }
    \n-
    153 return coord;
    \n-
    154 }
    \n-
    \n-
    155
    \n-
    \n-\n-
    158 {
    \n-
    159 for (int i=0; i<d; i++) coord[i] = coord[i]%_dims[i];
    \n-
    160 int rank = 0;
    \n-
    161 for (int i=0; i<d; i++) rank += coord[i]*_increment[i];
    \n-
    162 return rank;
    \n-
    163 }
    \n-
    \n-
    164
    \n-
    \n-
    166 int rank_relative (int rank, int dir, int cnt) const
    \n-
    167 {
    \n-\n-
    169 coord[dir] = (coord[dir]+_dims[dir]+cnt)%_dims[dir];
    \n-
    170 return coord_to_rank(coord);
    \n-
    171 }
    \n-
    \n-
    172
    \n-
    \n-
    174 int color (const iTupel & coord) const
    \n-
    175 {
    \n-
    176 int c = 0;
    \n-
    177 int power = 1;
    \n-
    178
    \n-
    179 // interior coloring
    \n-
    180 for (int i=0; i<d; i++)
    \n-
    181 {
    \n-
    182 if (coord[i]%2==1) c += power;
    \n-
    183 power *= 2;
    \n-
    184 }
    \n-
    185
    \n-
    186 // extra colors for boundary processes
    \n-
    187 for (int i=0; i<d; i++)
    \n-
    188 {
    \n-
    189 if (_dims[i]>1 && coord[i]==_dims[i]-1) c += power;
    \n-
    190 power *= 2;
    \n-
    191 }
    \n-
    192
    \n-
    193 return c;
    \n-
    194 }
    \n-
    \n-
    195
    \n-
    \n-
    197 int color (int rank) const
    \n-
    198 {
    \n-
    199 return color(rank_to_coord(rank));
    \n-
    200 }
    \n-
    \n-
    201
    \n-
    \n-
    203 int neighbors () const
    \n-
    204 {
    \n-
    205 int n=1;
    \n-
    206 for (int i=0; i<d; ++i)
    \n-
    207 n *= 3;
    \n-
    208 return n-1;
    \n-
    209 }
    \n-
    \n-
    210
    \n-
    \n-
    212 bool is_neighbor (iTupel delta, std::bitset<d> periodic) const
    \n-
    213 {
    \n-
    214 iTupel coord = rank_to_coord(_comm.rank()); // my own coordinate with 0 <= c_i < dims_i
    \n-
    215
    \n-
    216 for (int i=0; i<d; i++)
    \n-
    217 {
    \n-
    218 if (delta[i]<0)
    \n-
    219 {
    \n-
    220 // if I am on the boundary and domain is not periodic => no neighbor
    \n-
    221 if (coord[i]==0 && periodic[i]==false) return false;
    \n-
    222 }
    \n-
    223 if (delta[i]>0)
    \n-
    224 {
    \n-
    225 // if I am on the boundary and domain is not periodic => no neighbor
    \n-
    226 if (coord[i]==_dims[i]-1 && periodic[i]==false) return false;
    \n-
    227 }
    \n-
    228 }
    \n-
    229 return true;
    \n-
    230 }
    \n-
    \n-
    231
    \n-
    \n-
    239 double partition (int rank, iTupel origin_in, iTupel size_in, iTupel& origin_out, iTupel& size_out) const
    \n-
    240 {
    \n-\n-
    242 double maxsize = 1;
    \n-
    243 double sz = 1;
    \n-
    244
    \n-
    245 // make a tensor product partition
    \n-
    246 for (int i=0; i<d; i++)
    \n-
    247 {
    \n-
    248 // determine
    \n-
    249 int m = size_in[i]/_dims[i];
    \n-
    250 int r = size_in[i]%_dims[i];
    \n-
    251
    \n-
    252 sz *= size_in[i];
    \n-
    253
    \n-
    254 if (coord[i]<_dims[i]-r)
    \n-
    255 {
    \n-
    256 origin_out[i] = origin_in[i] + coord[i]*m;
    \n-
    257 size_out[i] = m;
    \n-
    258 maxsize *= m;
    \n-
    259 }
    \n-
    260 else
    \n-
    261 {
    \n-
    262 origin_out[i] = origin_in[i] + (_dims[i]-r)*m + (coord[i]-(_dims[i]-r))*(m+1);
    \n-
    263 size_out[i] = m+1;
    \n-
    264 maxsize *= m+1;
    \n-
    265 }
    \n-
    266 }
    \n-
    267 return maxsize/(sz/_comm.size());
    \n-
    268 }
    \n-
    \n-
    269
    \n-
    \n-\n-
    277 public:
    \n-
    \n-
    279 ProcListIterator (typename std::deque<CommPartner>::const_iterator iter)
    \n-
    280 {
    \n-
    281 i = iter;
    \n-
    282 }
    \n-
    \n-
    283
    \n-
    \n-
    285 int rank () const
    \n-
    286 {
    \n-
    287 return i->rank;
    \n-
    288 }
    \n-
    \n-
    289
    \n-
    \n-
    291 iTupel delta () const
    \n-
    292 {
    \n-
    293 return i->delta;
    \n-
    294 }
    \n-
    \n-
    295
    \n-
    \n-
    297 int index () const
    \n-
    298 {
    \n-
    299 return i->index;
    \n-
    300 }
    \n-
    \n-
    301
    \n-
    \n-
    303 int distance () const
    \n-
    304 {
    \n-
    305 int dist = 0;
    \n-
    306 iTupel delta=i->delta;
    \n-
    307 for (int j=0; j<d; ++j)
    \n-
    308 dist += std::abs(delta[j]);
    \n-
    309 return dist;
    \n-
    310 }
    \n-
    \n-
    311
    \n-
    \n-
    313 bool operator== (const ProcListIterator& iter) const
    \n-
    314 {
    \n-
    315 return i == iter.i;
    \n-
    316 }
    \n-
    \n-
    317
    \n-
    318
    \n-
    \n-
    320 bool operator!= (const ProcListIterator& iter) const
    \n-
    321 {
    \n-
    322 return i != iter.i;
    \n-
    323 }
    \n-
    \n-
    324
    \n-
    \n-\n-
    327 {
    \n-
    328 ++i;
    \n-
    329 return *this;
    \n-
    330 }
    \n-
    \n-
    331
    \n-
    332 private:
    \n-
    333 typename std::deque<CommPartner>::const_iterator i;
    \n-
    334 };
    \n-
    \n-
    335
    \n-
    \n-\n-
    338 {
    \n-
    339 return ProcListIterator(_sendlist.begin());
    \n-
    340 }
    \n-
    \n-
    341
    \n-
    \n-\n-
    344 {
    \n-
    345 return ProcListIterator(_sendlist.end());
    \n-
    346 }
    \n-
    \n-
    347
    \n-
    \n-\n-
    350 {
    \n-
    351 return ProcListIterator(_recvlist.begin());
    \n-
    352 }
    \n-
    \n-
    353
    \n-
    \n-\n-
    356 {
    \n-
    357 return ProcListIterator(_recvlist.end());
    \n-
    358 }
    \n-
    \n-
    359
    \n-
    \n-
    361 void send (int rank, void* buffer, int size) const
    \n-
    362 {
    \n-
    363 CommTask task;
    \n-
    364 task.rank = rank;
    \n-
    365 task.buffer = buffer;
    \n-
    366 task.size = size;
    \n-
    367 if (rank!=_comm.rank())
    \n-
    368 _sendrequests.push_back(task);
    \n-
    369 else
    \n-
    370 _localsendrequests.push_back(task);
    \n-
    371 }
    \n-
    \n-
    372
    \n-
    \n-
    374 void recv (int rank, void* buffer, int size) const
    \n-
    375 {
    \n-
    376 CommTask task;
    \n-
    377 task.rank = rank;
    \n-
    378 task.buffer = buffer;
    \n-
    379 task.size = size;
    \n-
    380 if (rank!=_comm.rank())
    \n-
    381 _recvrequests.push_back(task);
    \n-
    382 else
    \n-
    383 _localrecvrequests.push_back(task);
    \n-
    384 }
    \n-
    \n-
    385
    \n-
    \n-
    387 void exchange () const
    \n-
    388 {
    \n-
    389 // handle local requests first
    \n-
    390 if (_localsendrequests.size()!=_localrecvrequests.size())
    \n-
    391 {
    \n-
    392 std::cout << "[" << rank() << "]: ERROR: local sends/receives do not match in exchange!" << std::endl;
    \n-
    393 return;
    \n-
    394 }
    \n-
    395 for (unsigned int i=0; i<_localsendrequests.size(); i++)
    \n-
    396 {
    \n-
    397 if (_localsendrequests[i].size!=_localrecvrequests[i].size)
    \n-
    398 {
    \n-
    399 std::cout << "[" << rank() << "]: ERROR: size in local sends/receive does not match in exchange!" << std::endl;
    \n-
    400 return;
    \n-
    401 }
    \n-
    402 memcpy(_localrecvrequests[i].buffer,_localsendrequests[i].buffer,_localsendrequests[i].size);
    \n-
    403 }
    \n-
    404 _localsendrequests.clear();
    \n-
    405 _localrecvrequests.clear();
    \n-
    406
    \n-
    407#if HAVE_MPI
    \n-
    408 // handle foreign requests
    \n-
    409
    \n-
    410 std::vector<MPI_Request> requests(_sendrequests.size() + _recvrequests.size());
    \n-
    411 MPI_Request* req = requests.data();
    \n-
    412
    \n-
    413 // issue sends to foreign processes
    \n-
    414 for (unsigned int i=0; i<_sendrequests.size(); i++)
    \n-
    415 if (_sendrequests[i].rank!=rank())
    \n-
    416 {
    \n-
    417 // std::cout << "[" << rank() << "]" << " send " << _sendrequests[i].size << " bytes "
    \n-
    418 // << "to " << _sendrequests[i].rank << " p=" << _sendrequests[i].buffer << std::endl;
    \n-
    419 MPI_Isend(_sendrequests[i].buffer, _sendrequests[i].size, MPI_BYTE,
    \n-
    420 _sendrequests[i].rank, _tag, _comm, req++);
    \n-
    421 }
    \n-
    422
    \n-
    423 // issue receives from foreign processes
    \n-
    424 for (unsigned int i=0; i<_recvrequests.size(); i++)
    \n-
    425 if (_recvrequests[i].rank!=rank())
    \n-
    426 {
    \n-
    427 // std::cout << "[" << rank() << "]" << " recv " << _recvrequests[i].size << " bytes "
    \n-
    428 // << "fm " << _recvrequests[i].rank << " p=" << _recvrequests[i].buffer << std::endl;
    \n-
    429 MPI_Irecv(_recvrequests[i].buffer, _recvrequests[i].size, MPI_BYTE,
    \n-
    430 _recvrequests[i].rank, _tag, _comm, req++);
    \n-
    431 }
    \n-
    432
    \n-
    433 // Wait for communication to complete
    \n-
    434 MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
    \n-
    435
    \n-
    436 // clear request buffers
    \n-
    437 _sendrequests.clear();
    \n-
    438 _recvrequests.clear();
    \n-
    439#endif
    \n-
    440 }
    \n-
    \n-
    441
    \n-
    \n-
    443 double global_max (double x) const
    \n-
    444 {
    \n-
    445 double res = 0.0;
    \n-
    446 _comm.template allreduce<Dune::Max<double>,double>(&x, &res, 1);
    \n-
    447 return res;
    \n-
    448 }
    \n-
    \n-
    449
    \n-
    \n-
    451 void print (std::ostream& s) const
    \n-
    452 {
    \n-
    453 s << "[" << rank() << "]: Torus " << procs() << " processor(s) arranged as " << dims() << std::endl;
    \n-
    454 for (ProcListIterator i=sendbegin(); i!=sendend(); ++i)
    \n-
    455 {
    \n-
    456 s << "[" << rank() << "]: send to "
    \n-
    457 << "rank=" << i.rank()
    \n-
    458 << " index=" << i.index()
    \n-
    459 << " delta=" << i.delta() << " dist=" << i.distance() << std::endl;
    \n-
    460 }
    \n-
    461 for (ProcListIterator i=recvbegin(); i!=recvend(); ++i)
    \n-
    462 {
    \n-
    463 s << "[" << rank() << "]: recv from "
    \n-
    464 << "rank=" << i.rank()
    \n-
    465 << " index=" << i.index()
    \n-
    466 << " delta=" << i.delta() << " dist=" << i.distance() << std::endl;
    \n-
    467 }
    \n-
    468 }
    \n-
    \n-
    469
    \n-
    470 private:
    \n-
    471
    \n-
    472 void proclists ()
    \n-
    473 {
    \n-
    474 // compile the full neighbor list
    \n-
    475 CommPartner cp;
    \n-
    476 iTupel delta;
    \n-
    477
    \n-
    478 std::fill(delta.begin(), delta.end(), -1);
    \n-
    479 bool ready = false;
    \n-
    480 iTupel me, nb;
    \n-
    481 me = rank_to_coord(_comm.rank());
    \n-
    482 int index = 0;
    \n-
    483 int last = neighbors()-1;
    \n-
    484 while (!ready)
    \n-
    485 {
    \n-
    486 // find neighbors coordinates
    \n-
    487 for (int i=0; i<d; i++)
    \n-
    488 nb[i] = ( me[i]+_dims[i]+delta[i] ) % _dims[i];
    \n-
    489
    \n-
    490 // find neighbors rank
    \n-
    491 int nbrank = coord_to_rank(nb);
    \n-
    492
    \n-
    493 // check if delta is not zero
    \n-
    494 for (int i=0; i<d; i++)
    \n-
    495 if (delta[i]!=0)
    \n-
    496 {
    \n-
    497 cp.rank = nbrank;
    \n-
    498 cp.delta = delta;
    \n-
    499 cp.index = index;
    \n-
    500 _recvlist.push_back(cp);
    \n-
    501 cp.index = last-index;
    \n-
    502 _sendlist.push_front(cp);
    \n-
    503 index++;
    \n-
    504 break;
    \n-
    505 }
    \n-
    506
    \n-
    507 // next neighbor
    \n-
    508 ready = true;
    \n-
    509 for (int i=0; i<d; i++)
    \n-
    510 if (delta[i]<1)
    \n-
    511 {
    \n-
    512 (delta[i])++;
    \n-
    513 ready=false;
    \n-
    514 break;
    \n-
    515 }
    \n-
    516 else
    \n-
    517 {
    \n-
    518 delta[i] = -1;
    \n-
    519 }
    \n-
    520 }
    \n-
    521
    \n-
    522 }
    \n-
    523
    \n-
    524 Communication _comm;
    \n-
    525
    \n-
    526 iTupel _dims;
    \n-
    527 iTupel _increment;
    \n-
    528 int _tag;
    \n-
    529 std::deque<CommPartner> _sendlist;
    \n-
    530 std::deque<CommPartner> _recvlist;
    \n-
    531
    \n-
    532 mutable std::vector<CommTask> _sendrequests;
    \n-
    533 mutable std::vector<CommTask> _recvrequests;
    \n-
    534 mutable std::vector<CommTask> _localsendrequests;
    \n-
    535 mutable std::vector<CommTask> _localrecvrequests;
    \n-
    536
    \n-
    537 };
    \n-
    \n-
    538
    \n-
    540 template <class Communication, int d>
    \n-
    \n-
    541 inline std::ostream& operator<< (std::ostream& s, const Torus<Communication, d> & t)
    \n-
    542 {
    \n-
    543 t.print(s);
    \n-
    544 return s;
    \n-
    545 }
    \n-
    \n-
    546}
    \n-
    547
    \n-
    548#endif
    \n-
    This file provides tools to partition YaspGrids. If you want to write your own partitioner,...
    \n-\n-
    std::ostream & operator<<(std::ostream &out, const PartitionType &type)
    write a PartitionType to a stream
    Definition gridenums.hh:72
    \n+
    \n+
    52 const Entity& dereference() const
    \n+
    53 {
    \n+
    54 return _entity;
    \n+
    55 }
    \n+
    \n+
    56
    \n+
    57 protected:
    \n+\n+
    59 };
    \n+
    \n+
    60
    \n+
    61}
    \n+
    62
    \n+
    63#endif // DUNE_GRID_YASPGRIDLEVELITERATOR_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    a base class for the yaspgrid partitioning strategy
    Definition partitioning.hh:38
    \n-
    virtual void partition(const iTupel &, int, iTupel &, int) const =0
    \n-
    Definition torus.hh:46
    \n-
    Torus()
    constructor making uninitialized object
    Definition torus.hh:67
    \n-
    int color(int rank) const
    assign color to given rank
    Definition torus.hh:197
    \n-
    double partition(int rank, iTupel origin_in, iTupel size_in, iTupel &origin_out, iTupel &size_out) const
    partition the given grid onto the torus and return the piece of the process with given rank; returns ...
    Definition torus.hh:239
    \n-
    int dims(int i) const
    return dimensions of torus in direction i
    Definition torus.hh:118
    \n-
    iTupel coord() const
    return own coordinates
    Definition torus.hh:100
    \n-
    int rank() const
    return own rank
    Definition torus.hh:94
    \n-
    const iTupel & dims() const
    return dimensions of torus
    Definition torus.hh:112
    \n-
    int rank_relative(int rank, int dir, int cnt) const
    return rank of process where its coordinate in direction dir has offset cnt (handles periodic case)
    Definition torus.hh:166
    \n-
    void recv(int rank, void *buffer, int size) const
    store a receive request; buffers are received in order; handles also local requests with memcpy
    Definition torus.hh:374
    \n-
    void send(int rank, void *buffer, int size) const
    store a send request; buffers are sent in order; handles also local requests with memcpy
    Definition torus.hh:361
    \n-
    Torus(Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning< d > *partitioner)
    make partitioner from communicator and coarse mesh size
    Definition torus.hh:71
    \n-
    int neighbors() const
    return the number of neighbors, which is
    Definition torus.hh:203
    \n-
    void print(std::ostream &s) const
    print contents of torus object
    Definition torus.hh:451
    \n-
    double global_max(double x) const
    global max
    Definition torus.hh:443
    \n-
    Communication comm() const
    return communicator
    Definition torus.hh:124
    \n-
    int color(const iTupel &coord) const
    assign color to given coordinate
    Definition torus.hh:174
    \n-
    ProcListIterator recvend() const
    last process in receive list
    Definition torus.hh:355
    \n-
    bool is_neighbor(iTupel delta, std::bitset< d > periodic) const
    return true if neighbor with given delta is a neighbor under the given periodicity
    Definition torus.hh:212
    \n-
    ProcListIterator sendend() const
    end of send list
    Definition torus.hh:343
    \n-
    int procs() const
    return number of processes
    Definition torus.hh:106
    \n-
    iTupel rank_to_coord(int rank) const
    map rank to coordinate in torus using lexicographic ordering
    Definition torus.hh:144
    \n-
    std::array< int, d > iTupel
    type used to pass tupels in and out
    Definition torus.hh:49
    \n-
    ProcListIterator sendbegin() const
    first process in send list
    Definition torus.hh:337
    \n-
    void exchange() const
    exchange messages stored in request buffers; clear request buffers afterwards
    Definition torus.hh:387
    \n-
    ProcListIterator recvbegin() const
    first process in receive list
    Definition torus.hh:349
    \n-
    int coord_to_rank(iTupel coord) const
    map coordinate in torus to rank using lexicographic ordering
    Definition torus.hh:157
    \n-
    bool inside(iTupel c) const
    return true if coordinate is inside torus
    Definition torus.hh:136
    \n-
    int tag() const
    return tag used by torus
    Definition torus.hh:130
    \n-
    Definition torus.hh:276
    \n-
    iTupel delta() const
    return distance vector
    Definition torus.hh:291
    \n-
    bool operator==(const ProcListIterator &iter) const
    Return true when two iterators point to same member.
    Definition torus.hh:313
    \n-
    bool operator!=(const ProcListIterator &iter) const
    Return true when two iterators do not point to same member.
    Definition torus.hh:320
    \n-
    int rank() const
    return rank of neighboring process
    Definition torus.hh:285
    \n-
    ProcListIterator(typename std::deque< CommPartner >::const_iterator iter)
    make an iterator
    Definition torus.hh:279
    \n-
    ProcListIterator & operator++()
    Increment iterator to next cell.
    Definition torus.hh:326
    \n-
    int index() const
    return index in proclist
    Definition torus.hh:297
    \n-
    int distance() const
    return 1-norm of distance vector
    Definition torus.hh:303
    \n+
    Definition yaspgridentity.hh:242
    \n+
    Iterates over entities of one grid level.
    Definition yaspgridleveliterator.hh:19
    \n+
    Entity _entity
    entity
    Definition yaspgridleveliterator.hh:58
    \n+
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridleveliterator.hh:27
    \n+
    GridImp::template Codim< codim >::Entity Entity
    Definition yaspgridleveliterator.hh:26
    \n+
    void increment()
    increment
    Definition yaspgridleveliterator.hh:40
    \n+
    GridImp::YGrid::Iterator I
    Definition yaspgridleveliterator.hh:28
    \n+
    YaspLevelIterator(const YGLI &g, const I &it)
    constructor
    Definition yaspgridleveliterator.hh:35
    \n+
    bool equals(const YaspLevelIterator &rhs) const
    equality
    Definition yaspgridleveliterator.hh:46
    \n+
    YaspLevelIterator()
    default constructor
    Definition yaspgridleveliterator.hh:31
    \n+
    const Entity & dereference() const
    dereferencing
    Definition yaspgridleveliterator.hh:52
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,680 +1,103 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * yaspgrid\n-torus.hh\n+yaspgridleveliterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRID_TORUS_HH\n-6#define DUNE_GRID_YASPGRID_TORUS_HH\n+5#ifndef DUNE_GRID_YASPGRIDLEVELITERATOR_HH\n+6#define DUNE_GRID_YASPGRIDLEVELITERATOR_HH\n 7\n-8#include \n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n+12namespace Dune {\n+13\n 14\n-15#if HAVE_MPI\n-16#include \n-17#endif\n-18\n-19#include \n-20#include \n-21#include \n-22\n-23#include \"partitioning.hh\"\n-24\n-29namespace Dune\n-30{\n-31\n-45 template\n-46 class Torus {\n-47 public:\n-49 typedef std::array iTupel;\n+17 template\n+18 class YaspLevelIterator\n+19 {\n+21 constexpr static int dim = GridImp::dimension;\n+23 constexpr static int dimworld = GridImp::dimensionworld;\n+24 typedef typename GridImp::ctype ctype;\n+25 public:\n+26 typedef typename GridImp::template Codim::Entity Entity;\n+27 typedef typename GridImp::YGridLevelIterator YGLI;\n+28 typedef typename GridImp::YGrid::Iterator I;\n+29\n+31 YaspLevelIterator ()\n+32 {}\n+33\n+35 YaspLevelIterator (const YGLI & g, const I& it)\n+36 : _entity(YaspEntity(g,it))\n+37 {}\n+38\n+40 void increment()\n+41 {\n+42 ++(_entity.impl()._it);\n+43 }\n+44\n+46 bool equals (const YaspLevelIterator& rhs) const\n+47 {\n+48 return (_entity == rhs._entity);\n+49 }\n 50\n-51\n-52 private:\n-53 struct CommPartner {\n-54 int rank;\n-55 iTupel delta;\n-56 int index;\n-57 };\n-58\n-59 struct CommTask {\n-60 int rank; // process to send to / receive from\n-61 int size; // size of buffer\n-62 void *buffer; // buffer to send / receive\n-63 };\n-64\n-65 public:\n-67 Torus ()\n-68 {}\n-69\n-71 Torus (Communication comm, int tag, iTupel size, int overlap, const Yasp::\n-Partitioning* partitioner)\n-72 : _comm(comm), _tag(tag)\n-73 {\n-74 // determine dimensions\n-75 partitioner->partition(size, _comm.size(), _dims, overlap);\n-76\n-77 // compute increments for lexicographic ordering\n-78 int inc = 1;\n-79 for (int i=0; i=0; i--)\n-139 if (c[i]<0 || c[i]>=_dims[i]) return false;\n-140 return true;\n-141 }\n-142\n-144 iTupel rank_to_coord (int rank) const\n-145 {\n-146 iTupel coord;\n-147 rank = rank%_comm.size();\n-148 for (int i=d-1; i>=0; i--)\n-149 {\n-150 coord[i] = rank/_increment[i];\n-151 rank = rank%_increment[i];\n-152 }\n-153 return coord;\n-154 }\n-155\n-157 int coord_to_rank (iTupel coord) const\n-158 {\n-159 for (int i=0; i1 && coord[i]==_dims[i]-1) c += power;\n-190 power *= 2;\n-191 }\n-192\n-193 return c;\n-194 }\n-195\n-197 int color (int rank) const\n-198 {\n-199 return color(rank_to_coord(rank));\n-200 }\n-201\n-203 int neighbors () const\n-204 {\n-205 int n=1;\n-206 for (int i=0; i periodic) const\n-213 {\n-214 iTupel coord = rank_to_coord(_comm.rank()); // my own coordinate with 0 <=\n-c_i < dims_i\n-215\n-216 for (int i=0; i no neighbor\n-221 if (coord[i]==0 && periodic[i]==false) return false;\n-222 }\n-223 if (delta[i]>0)\n-224 {\n-225 // if I am on the boundary and domain is not periodic => no neighbor\n-226 if (coord[i]==_dims[i]-1 && periodic[i]==false) return false;\n-227 }\n-228 }\n-229 return true;\n-230 }\n-231\n-239 double partition (int rank, iTupel origin_in, iTupel size_in, iTupel&\n-origin_out, iTupel& size_out) const\n-240 {\n-241 iTupel coord = rank_to_coord(rank);\n-242 double maxsize = 1;\n-243 double sz = 1;\n-244\n-245 // make a tensor product partition\n-246 for (int i=0; i::const_iterator iter)\n-280 {\n-281 i = iter;\n-282 }\n-283\n-285 int rank () const\n-286 {\n-287 return i->rank;\n-288 }\n-289\n-291 iTupel delta () const\n-292 {\n-293 return i->delta;\n-294 }\n-295\n-297 int index () const\n-298 {\n-299 return i->index;\n-300 }\n-301\n-303 int distance () const\n-304 {\n-305 int dist = 0;\n-306 iTupel delta=i->delta;\n-307 for (int j=0; j::const_iterator i;\n-334 };\n-335\n-337 ProcListIterator sendbegin () const\n-338 {\n-339 return ProcListIterator(_sendlist.begin());\n-340 }\n-341\n-343 ProcListIterator sendend () const\n-344 {\n-345 return ProcListIterator(_sendlist.end());\n-346 }\n-347\n-349 ProcListIterator recvbegin () const\n-350 {\n-351 return ProcListIterator(_recvlist.begin());\n-352 }\n-353\n-355 ProcListIterator recvend () const\n-356 {\n-357 return ProcListIterator(_recvlist.end());\n-358 }\n-359\n-361 void send (int rank, void* buffer, int size) const\n-362 {\n-363 CommTask task;\n-364 task.rank = rank;\n-365 task.buffer = buffer;\n-366 task.size = size;\n-367 if (rank!=_comm.rank())\n-368 _sendrequests.push_back(task);\n-369 else\n-370 _localsendrequests.push_back(task);\n-371 }\n-372\n-374 void recv (int rank, void* buffer, int size) const\n-375 {\n-376 CommTask task;\n-377 task.rank = rank;\n-378 task.buffer = buffer;\n-379 task.size = size;\n-380 if (rank!=_comm.rank())\n-381 _recvrequests.push_back(task);\n-382 else\n-383 _localrecvrequests.push_back(task);\n-384 }\n-385\n-387 void exchange () const\n-388 {\n-389 // handle local requests first\n-390 if (_localsendrequests.size()!=_localrecvrequests.size())\n-391 {\n-392 std::cout << \"[\" << rank() << \"]: ERROR: local sends/receives do not match\n-in exchange!\" << std::endl;\n-393 return;\n-394 }\n-395 for (unsigned int i=0; i<_localsendrequests.size(); i++)\n-396 {\n-397 if (_localsendrequests[i].size!=_localrecvrequests[i].size)\n-398 {\n-399 std::cout << \"[\" << rank() << \"]: ERROR: size in local sends/receive does\n-not match in exchange!\" << std::endl;\n-400 return;\n-401 }\n-402 memcpy(_localrecvrequests[i].buffer,_localsendrequests[i].buffer,_\n-localsendrequests[i].size);\n-403 }\n-404 _localsendrequests.clear();\n-405 _localrecvrequests.clear();\n-406\n-407#if HAVE_MPI\n-408 // handle foreign requests\n-409\n-410 std::vector requests(_sendrequests.size() + _recvrequests.size\n-());\n-411 MPI_Request* req = requests.data();\n-412\n-413 // issue sends to foreign processes\n-414 for (unsigned int i=0; i<_sendrequests.size(); i++)\n-415 if (_sendrequests[i].rank!=rank())\n-416 {\n-417 // std::cout << \"[\" << rank() << \"]\" << \" send \" << _sendrequests[i].size\n-<< \" bytes \"\n-418 // << \"to \" << _sendrequests[i].rank << \" p=\" << _sendrequests[i].buffer <<\n-std::endl;\n-419 MPI_Isend(_sendrequests[i].buffer, _sendrequests[i].size, MPI_BYTE,\n-420 _sendrequests[i].rank, _tag, _comm, req++);\n-421 }\n-422\n-423 // issue receives from foreign processes\n-424 for (unsigned int i=0; i<_recvrequests.size(); i++)\n-425 if (_recvrequests[i].rank!=rank())\n-426 {\n-427 // std::cout << \"[\" << rank() << \"]\" << \" recv \" << _recvrequests[i].size\n-<< \" bytes \"\n-428 // << \"fm \" << _recvrequests[i].rank << \" p=\" << _recvrequests[i].buffer <<\n-std::endl;\n-429 MPI_Irecv(_recvrequests[i].buffer, _recvrequests[i].size, MPI_BYTE,\n-430 _recvrequests[i].rank, _tag, _comm, req++);\n-431 }\n-432\n-433 // Wait for communication to complete\n-434 MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);\n-435\n-436 // clear request buffers\n-437 _sendrequests.clear();\n-438 _recvrequests.clear();\n-439#endif\n-440 }\n-441\n-443 double global_max (double x) const\n-444 {\n-445 double res = 0.0;\n-446 _comm.template allreduce,double>(&x, &res, 1);\n-447 return res;\n-448 }\n-449\n-451 void print (std::ostream& s) const\n-452 {\n-453 s << \"[\" << rank() << \"]: Torus \" << procs() << \" processor(s) arranged as\n-\" << dims() << std::endl;\n-454 for (ProcListIterator i=sendbegin(); i!=sendend(); ++i)\n-455 {\n-456 s << \"[\" << rank() << \"]: send to \"\n-457 << \"rank=\" << i.rank()\n-458 << \" index=\" << i.index()\n-459 << \" delta=\" << i.delta() << \" dist=\" << i.distance() << std::endl;\n-460 }\n-461 for (ProcListIterator i=recvbegin(); i!=recvend(); ++i)\n-462 {\n-463 s << \"[\" << rank() << \"]: recv from \"\n-464 << \"rank=\" << i.rank()\n-465 << \" index=\" << i.index()\n-466 << \" delta=\" << i.delta() << \" dist=\" << i.distance() << std::endl;\n-467 }\n-468 }\n-469\n-470 private:\n-471\n-472 void proclists ()\n-473 {\n-474 // compile the full neighbor list\n-475 CommPartner cp;\n-476 iTupel delta;\n-477\n-478 std::fill(delta.begin(), delta.end(), -1);\n-479 bool ready = false;\n-480 iTupel me, nb;\n-481 me = rank_to_coord(_comm.rank());\n-482 int index = 0;\n-483 int last = neighbors()-1;\n-484 while (!ready)\n-485 {\n-486 // find neighbors coordinates\n-487 for (int i=0; i _sendlist;\n-530 std::deque _recvlist;\n-531\n-532 mutable std::vector _sendrequests;\n-533 mutable std::vector _recvrequests;\n-534 mutable std::vector _localsendrequests;\n-535 mutable std::vector _localrecvrequests;\n-536\n-537 };\n-538\n-540 template \n-541 inline std::ostream& operator<<_(std::ostream& s, const\n-Torus & t)\n-542 {\n-543 t.print(s);\n-544 return s;\n-545 }\n-546}\n-547\n-548#endif\n-partitioning.hh\n-This file provides tools to partition YaspGrids. If you want to write your own\n-partitioner,...\n-exceptions.hh\n-Dune::operator<<\n-std::ostream & operator<<(std::ostream &out, const PartitionType &type)\n-write a PartitionType to a stream\n-Definition gridenums.hh:72\n+52 const Entity& dereference() const\n+53 {\n+54 return _entity;\n+55 }\n+56\n+57 protected:\n+58 Entity _entity;\n+59 };\n+60\n+61}\n+62\n+63#endif // DUNE_GRID_YASPGRIDLEVELITERATOR_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Yasp::Partitioning\n-a base class for the yaspgrid partitioning strategy\n-Definition partitioning.hh:38\n-Dune::Yasp::Partitioning::partition\n-virtual void partition(const iTupel &, int, iTupel &, int) const =0\n-Dune::Torus\n-Definition torus.hh:46\n-Dune::Torus::Torus\n-Torus()\n-constructor making uninitialized object\n-Definition torus.hh:67\n-Dune::Torus::color\n-int color(int rank) const\n-assign color to given rank\n-Definition torus.hh:197\n-Dune::Torus::partition\n-double partition(int rank, iTupel origin_in, iTupel size_in, iTupel &origin_\n-out, iTupel &size_out) const\n-partition the given grid onto the torus and return the piece of the process\n-with given rank; returns ...\n-Definition torus.hh:239\n-Dune::Torus::dims\n-int dims(int i) const\n-return dimensions of torus in direction i\n-Definition torus.hh:118\n-Dune::Torus::coord\n-iTupel coord() const\n-return own coordinates\n-Definition torus.hh:100\n-Dune::Torus::rank\n-int rank() const\n-return own rank\n-Definition torus.hh:94\n-Dune::Torus::dims\n-const iTupel & dims() const\n-return dimensions of torus\n-Definition torus.hh:112\n-Dune::Torus::rank_relative\n-int rank_relative(int rank, int dir, int cnt) const\n-return rank of process where its coordinate in direction dir has offset cnt\n-(handles periodic case)\n-Definition torus.hh:166\n-Dune::Torus::recv\n-void recv(int rank, void *buffer, int size) const\n-store a receive request; buffers are received in order; handles also local\n-requests with memcpy\n-Definition torus.hh:374\n-Dune::Torus::send\n-void send(int rank, void *buffer, int size) const\n-store a send request; buffers are sent in order; handles also local requests\n-with memcpy\n-Definition torus.hh:361\n-Dune::Torus::Torus\n-Torus(Communication comm, int tag, iTupel size, int overlap, const Yasp::\n-Partitioning< d > *partitioner)\n-make partitioner from communicator and coarse mesh size\n-Definition torus.hh:71\n-Dune::Torus::neighbors\n-int neighbors() const\n-return the number of neighbors, which is\n-Definition torus.hh:203\n-Dune::Torus::print\n-void print(std::ostream &s) const\n-print contents of torus object\n-Definition torus.hh:451\n-Dune::Torus::global_max\n-double global_max(double x) const\n-global max\n-Definition torus.hh:443\n-Dune::Torus::comm\n-Communication comm() const\n-return communicator\n-Definition torus.hh:124\n-Dune::Torus::color\n-int color(const iTupel &coord) const\n-assign color to given coordinate\n-Definition torus.hh:174\n-Dune::Torus::recvend\n-ProcListIterator recvend() const\n-last process in receive list\n-Definition torus.hh:355\n-Dune::Torus::is_neighbor\n-bool is_neighbor(iTupel delta, std::bitset< d > periodic) const\n-return true if neighbor with given delta is a neighbor under the given\n-periodicity\n-Definition torus.hh:212\n-Dune::Torus::sendend\n-ProcListIterator sendend() const\n-end of send list\n-Definition torus.hh:343\n-Dune::Torus::procs\n-int procs() const\n-return number of processes\n-Definition torus.hh:106\n-Dune::Torus::rank_to_coord\n-iTupel rank_to_coord(int rank) const\n-map rank to coordinate in torus using lexicographic ordering\n-Definition torus.hh:144\n-Dune::Torus::iTupel\n-std::array< int, d > iTupel\n-type used to pass tupels in and out\n-Definition torus.hh:49\n-Dune::Torus::sendbegin\n-ProcListIterator sendbegin() const\n-first process in send list\n-Definition torus.hh:337\n-Dune::Torus::exchange\n-void exchange() const\n-exchange messages stored in request buffers; clear request buffers afterwards\n-Definition torus.hh:387\n-Dune::Torus::recvbegin\n-ProcListIterator recvbegin() const\n-first process in receive list\n-Definition torus.hh:349\n-Dune::Torus::coord_to_rank\n-int coord_to_rank(iTupel coord) const\n-map coordinate in torus to rank using lexicographic ordering\n-Definition torus.hh:157\n-Dune::Torus::inside\n-bool inside(iTupel c) const\n-return true if coordinate is inside torus\n-Definition torus.hh:136\n-Dune::Torus::tag\n-int tag() const\n-return tag used by torus\n-Definition torus.hh:130\n-Dune::Torus::ProcListIterator\n-Definition torus.hh:276\n-Dune::Torus::ProcListIterator::delta\n-iTupel delta() const\n-return distance vector\n-Definition torus.hh:291\n-Dune::Torus::ProcListIterator::operator==\n-bool operator==(const ProcListIterator &iter) const\n-Return true when two iterators point to same member.\n-Definition torus.hh:313\n-Dune::Torus::ProcListIterator::operator!=\n-bool operator!=(const ProcListIterator &iter) const\n-Return true when two iterators do not point to same member.\n-Definition torus.hh:320\n-Dune::Torus::ProcListIterator::rank\n-int rank() const\n-return rank of neighboring process\n-Definition torus.hh:285\n-Dune::Torus::ProcListIterator::ProcListIterator\n-ProcListIterator(typename std::deque< CommPartner >::const_iterator iter)\n-make an iterator\n-Definition torus.hh:279\n-Dune::Torus::ProcListIterator::operator++\n-ProcListIterator & operator++()\n-Increment iterator to next cell.\n-Definition torus.hh:326\n-Dune::Torus::ProcListIterator::index\n-int index() const\n-return index in proclist\n-Definition torus.hh:297\n-Dune::Torus::ProcListIterator::distance\n-int distance() const\n-return 1-norm of distance vector\n-Definition torus.hh:303\n+Dune::YaspEntity\n+Definition yaspgridentity.hh:242\n+Dune::YaspLevelIterator\n+Iterates over entities of one grid level.\n+Definition yaspgridleveliterator.hh:19\n+Dune::YaspLevelIterator::_entity\n+Entity _entity\n+entity\n+Definition yaspgridleveliterator.hh:58\n+Dune::YaspLevelIterator::YGLI\n+GridImp::YGridLevelIterator YGLI\n+Definition yaspgridleveliterator.hh:27\n+Dune::YaspLevelIterator::Entity\n+GridImp::template Codim< codim >::Entity Entity\n+Definition yaspgridleveliterator.hh:26\n+Dune::YaspLevelIterator::increment\n+void increment()\n+increment\n+Definition yaspgridleveliterator.hh:40\n+Dune::YaspLevelIterator::I\n+GridImp::YGrid::Iterator I\n+Definition yaspgridleveliterator.hh:28\n+Dune::YaspLevelIterator::YaspLevelIterator\n+YaspLevelIterator(const YGLI &g, const I &it)\n+constructor\n+Definition yaspgridleveliterator.hh:35\n+Dune::YaspLevelIterator::equals\n+bool equals(const YaspLevelIterator &rhs) const\n+equality\n+Definition yaspgridleveliterator.hh:46\n+Dune::YaspLevelIterator::YaspLevelIterator\n+YaspLevelIterator()\n+default constructor\n+Definition yaspgridleveliterator.hh:31\n+Dune::YaspLevelIterator::dereference\n+const Entity & dereference() const\n+dereferencing\n+Definition yaspgridleveliterator.hh:52\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00296.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00296.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: adaptcallback.hh File Reference\n+dune-grid: sizecache.hh File Reference\n \n \n \n \n \n \n \n@@ -72,43 +72,48 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n \n-
    adaptcallback.hh File Reference
    \n+
    sizecache.hh File Reference
    \n
    \n
    \n \n-

    interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid \n+

    Provides size cache classes to implement the grids size method efficiently. \n More...

    \n-\n+
    #include <cassert>
    \n+#include <vector>
    \n+#include <set>
    \n+#include <utility>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/capabilities.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::AdaptDataHandleInterface< Grid, Impl >
     Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface. More...
     
    class  Dune::AdaptDataHandle< Grid, Impl >
     
    class  Dune::CombinedAdaptProlongRestrict< A, B >
     class for combining 2 index sets together for adaptation process More...
    class  Dune::SizeCache< GridImp >
     organizes the caching of sizes for one grid and one GeometryType More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid

    \n-
    Author
    Martin Nolte
    \n+

    Provides size cache classes to implement the grids size method efficiently.

    \n+
    Author
    Robert Kloefkorn
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,33 +2,36 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n Classes | Namespaces\n-adaptcallback.hh File Reference\n-interfaces and wrappers needed for the callback adaptation provided by\n-AlbertaGrid and dune-ALUGrid More...\n+sizecache.hh File Reference\n+Provides size cache classes to implement the grids size method efficiently.\n+More...\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::AdaptDataHandleInterface<_Grid,_Impl_>\n-\u00a0 Interface class for the Grid's adapt method where the parameter is a\n- AdaptDataHandleInterface. More...\n-\u00a0\n-class \u00a0 Dune::AdaptDataHandle<_Grid,_Impl_>\n-\u00a0\n-class \u00a0 Dune::CombinedAdaptProlongRestrict<_A,_B_>\n-\u00a0 class for combining 2 index sets together for adaptation process\n+class \u00a0 Dune::SizeCache<_GridImp_>\n+\u00a0 organizes the caching of sizes for one grid and one GeometryType\n More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-interfaces and wrappers needed for the callback adaptation provided by\n-AlbertaGrid and dune-ALUGrid\n+Provides size cache classes to implement the grids size method efficiently.\n Author\n- Martin Nolte\n+ Robert Kloefkorn\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00296_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00296_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: adaptcallback.hh Source File\n+dune-grid: sizecache.hh Source File\n \n \n \n \n \n \n \n@@ -74,180 +74,385 @@\n \n
    \n \n
    \n
    \n
    \n-
    adaptcallback.hh
    \n+
    sizecache.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_COMMON_ADAPTCALLBACK_HH
    \n-
    6#define DUNE_GRID_COMMON_ADAPTCALLBACK_HH
    \n+
    5#ifndef DUNE_GRID_COMMON_SIZECACHE_HH
    \n+
    6#define DUNE_GRID_COMMON_SIZECACHE_HH
    \n
    7
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 // Internal Forward Declarations
    \n-
    18 // -----------------------------
    \n-
    19
    \n-
    20 template< class Grid, class Impl >
    \n-
    21 class AdaptDataHandle;
    \n-
    22
    \n-
    23
    \n-
    24
    \n-
    25 // AdaptDataHandleInterface
    \n-
    26 // ------------------------
    \n-
    27
    \n-
    31 template< class Grid, class Impl >
    \n+
    8#include <cassert>
    \n+
    9#include <vector>
    \n+
    10#include <set>
    \n+
    11#include <utility>
    \n+
    12
    \n+
    13#include <dune/common/exceptions.hh>
    \n+
    14#include <dune/common/hybridutilities.hh>
    \n+
    15
    \n+
    16#include <dune/geometry/type.hh>
    \n+
    17#include <dune/geometry/referenceelements.hh>
    \n+
    18
    \n+\n+\n+
    21
    \n+
    28namespace Dune {
    \n+
    29
    \n+
    31 template <class GridImp>
    \n
    \n-\n+\n
    33 {
    \n-\n-
    35
    \n-
    36 friend class AdaptDataHandle< Grid, Impl >;
    \n+\n+
    36 constexpr static int dim = GridImp::dimension;
    \n
    37
    \n-
    38 public:
    \n-
    39 typedef typename Grid::template Codim< 0 >::Entity Entity;
    \n+
    39 constexpr static int nCodim = GridImp::dimension + 1;
    \n
    40
    \n-
    41 private:
    \n-\n-
    43 {}
    \n-
    44
    \n-
    45 AdaptDataHandleInterface ( const This & );
    \n-
    46 This &operator= ( const This & );
    \n-
    47
    \n-
    48 public:
    \n-
    \n-
    54 void preCoarsening ( const Entity &father )
    \n-
    55 {
    \n-
    56 asImp().preCoarsening( father );
    \n-
    57 }
    \n-
    \n+
    41 // type of grid
    \n+
    42 typedef GridImp GridType;
    \n+
    43
    \n+
    44 // coordinate type
    \n+
    45 typedef typename GridType :: ctype ctype ;
    \n+
    46
    \n+
    47 // stores all sizes of the levels
    \n+
    48 mutable std::vector< int > levelSizes_[nCodim];
    \n+
    49
    \n+
    50 // stores all sizes of the levels
    \n+
    51 mutable std::vector< std::vector< int > > levelTypeSizes_[nCodim];
    \n+
    52
    \n+
    53 // stores all sizes of leafs
    \n+
    54 mutable int leafSizes_[nCodim];
    \n+
    55
    \n+
    56 // stores all sizes of leafs
    \n+
    57 mutable std::vector< int > leafTypeSizes_[nCodim];
    \n
    58
    \n-
    \n-
    64 void postRefinement ( const Entity &father )
    \n+
    59 // the grid
    \n+
    60 const GridType & grid_;
    \n+
    61
    \n+
    62 // count elements of set by iterating the grid
    \n+
    63 template < int codim, bool gridHasCodim >
    \n+
    64 struct CountLevelEntitiesBase
    \n
    65 {
    \n-
    66 asImp().postRefinement( father );
    \n-
    67 }
    \n-
    \n-
    68
    \n-
    \n-
    69 void restrictLocal( const Entity &father, const Entity& son, bool initialize )
    \n-
    70 {
    \n-
    71 asImp().restrictLocal( father, son, initialize );
    \n-
    72 }
    \n-
    \n-
    73
    \n-
    \n-
    74 void prolongLocal( const Entity &father, const Entity& son, bool initialize )
    \n-
    75 {
    \n-
    76 asImp().prolongLocal( father, son, initialize );
    \n-
    77 }
    \n-
    \n-
    78
    \n-
    79 protected:
    \n-
    80 const Impl &asImp () const { return static_cast< const Impl & >( *this ); }
    \n-
    81 Impl &asImp () { return static_cast< Impl & >( *this ); }
    \n-
    82 };
    \n-
    \n-
    83
    \n-
    84
    \n-
    85
    \n-
    86 // AdaptDataHandle
    \n-
    87 // ---------------
    \n+
    66 template < class SzCacheType >
    \n+
    67 static void apply(const SzCacheType & sc, int level, int cd)
    \n+
    68 {
    \n+
    69 if( cd == codim )
    \n+
    70 {
    \n+
    71 sc.template countLevelEntities<All_Partition,codim> (level);
    \n+
    72 }
    \n+
    73 }
    \n+
    74 };
    \n+
    75
    \n+
    76 template < int codim >
    \n+
    77 struct CountLevelEntitiesBase< codim, false >
    \n+
    78 {
    \n+
    79 template < class SzCacheType >
    \n+
    80 static void apply(const SzCacheType & sc, int level, int cd)
    \n+
    81 {
    \n+
    82 if( cd == codim )
    \n+
    83 {
    \n+
    84 sc.template countLevelEntitiesNoCodim<All_Partition,codim> (level);
    \n+
    85 }
    \n+
    86 }
    \n+
    87 };
    \n
    88
    \n-
    89 template< class Grid, class Impl >
    \n-
    \n-\n-
    91 : public AdaptDataHandleInterface< Grid, Impl >
    \n-
    92 {
    \n-\n-\n-
    95
    \n-
    96 public:
    \n-
    97 typedef typename Base::Entity Entity;
    \n-
    98
    \n-
    99 protected:
    \n-
    \n-\n-
    101 {}
    \n-
    \n-
    102
    \n-
    103 private:
    \n-
    104 AdaptDataHandle ( const This & );
    \n-
    105 This &operator= ( const This & );
    \n-
    106
    \n-
    107 void preCoarsening ( const Entity &father );
    \n-
    108 void postRefinement ( const Entity &father );
    \n-
    109 };
    \n-
    \n-
    110
    \n-
    111
    \n-
    112 // CombinedAdaptProlongRestrict
    \n-
    113 // ----------------------------
    \n-
    114
    \n-
    116 template <class A, class B >
    \n-
    \n-\n-
    118 {
    \n-
    120 A& _a;
    \n-
    121 B& _b;
    \n-
    122 public:
    \n-
    \n-
    124 CombinedAdaptProlongRestrict ( A& a, B& b ) : _a ( a ) , _b ( b )
    \n-
    125 {}
    \n-
    \n+
    89 template < int codim >
    \n+
    90 struct CountLevelEntities
    \n+
    91 : public CountLevelEntitiesBase< codim, Capabilities :: hasEntity< GridType, codim > :: v >
    \n+
    92 {};
    \n+
    93
    \n+
    94 // count elements of set by iterating the grid
    \n+
    95 template < int codim, bool gridHasCodim >
    \n+
    96 struct CountLeafEntitiesBase
    \n+
    97 {
    \n+
    98 template <class SzCacheType>
    \n+
    99 static void apply(const SzCacheType & sc, int cd)
    \n+
    100 {
    \n+
    101 if( cd == codim )
    \n+
    102 {
    \n+
    103 sc.template countLeafEntities<All_Partition,codim> ();
    \n+
    104 }
    \n+
    105 }
    \n+
    106 };
    \n+
    107
    \n+
    108 // count elements of set by iterating the grid
    \n+
    109 template < int codim >
    \n+
    110 struct CountLeafEntitiesBase< codim, false >
    \n+
    111 {
    \n+
    112 template <class SzCacheType>
    \n+
    113 static void apply(const SzCacheType & sc, int cd)
    \n+
    114 {
    \n+
    115 if( cd == codim )
    \n+
    116 {
    \n+
    117 sc.template countLeafEntitiesNoCodim<All_Partition,codim> ();
    \n+
    118 }
    \n+
    119 }
    \n+
    120 };
    \n+
    121
    \n+
    122 template < int codim >
    \n+
    123 struct CountLeafEntities
    \n+
    124 : public CountLeafEntitiesBase< codim, Capabilities :: hasEntity< GridType, codim > :: v >
    \n+
    125 {};
    \n
    126
    \n-
    128 template <class Entity>
    \n-
    \n-
    129 void restrictLocal ( const Entity &father, const Entity &son, bool initialize )
    \n-
    130 {
    \n-
    131 _a.restrictLocal(father,son,initialize);
    \n-
    132 _b.restrictLocal(father,son,initialize);
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    136 template <class Entity>
    \n-
    \n-
    137 void prolongLocal ( const Entity &father, const Entity &son, bool initialize )
    \n-
    138 {
    \n-
    139 _a.prolongLocal(father,son,initialize);
    \n-
    140 _b.prolongLocal(father,son,initialize);
    \n-
    141 }
    \n-
    \n-
    142 };
    \n-
    \n-
    143
    \n-
    144} // end namespace Dune
    \n-
    145
    \n-
    146#endif
    \n+
    127 int gtIndex( const GeometryType& type ) const
    \n+
    128 {
    \n+
    129 return type.id() >> 1 ;
    \n+
    130 }
    \n+
    131
    \n+
    132 int sizeCodim( const int codim ) const
    \n+
    133 {
    \n+
    134 const int mydim = GridType :: dimension - codim;
    \n+
    135 return ((1 << mydim) + 1) / 2;
    \n+
    136 }
    \n+
    137
    \n+
    138 // private copy constructor
    \n+
    139 SizeCache (const SizeCache & );
    \n+
    140 public:
    \n+
    \n+
    142 SizeCache (const GridType & grid) : grid_( grid )
    \n+
    143 {
    \n+
    144 reset();
    \n+
    145 }
    \n+
    \n+
    146
    \n+
    \n+
    148 void reset()
    \n+
    149 {
    \n+
    150 for(int codim=0; codim<nCodim; ++codim)
    \n+
    151 {
    \n+
    152 leafSizes_[ codim ] = -1;
    \n+
    153 leafTypeSizes_[ codim ].resize( sizeCodim( codim ), -1 );
    \n+
    154 }
    \n+
    155
    \n+
    156 const int numMxl = grid_.maxLevel()+1;
    \n+
    157 for(int codim=0; codim<nCodim; ++codim)
    \n+
    158 {
    \n+
    159 std::vector<int> & vec = levelSizes_[codim];
    \n+
    160 vec.resize(numMxl);
    \n+
    161 levelTypeSizes_[codim].resize( numMxl );
    \n+
    162 for(int level = 0; level<numMxl; ++level)
    \n+
    163 {
    \n+
    164 vec[level] = -1;
    \n+
    165 levelTypeSizes_[codim][level].resize( sizeCodim( codim ), -1 );
    \n+
    166 }
    \n+
    167 }
    \n+
    168 }
    \n+
    \n+
    169
    \n+
    170 //********************************************************************
    \n+
    171 // level sizes
    \n+
    172 //********************************************************************
    \n+
    \n+
    174 int size (int level, int codim) const
    \n+
    175 {
    \n+
    176 assert( codim >= 0 );
    \n+
    177 assert( codim < nCodim );
    \n+
    178 assert( level >= 0 );
    \n+
    179 if( level >= (int) levelSizes_[codim].size() ) return 0;
    \n+
    180
    \n+
    181 if( levelSizes_[codim][level] < 0)
    \n+
    182 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLevelEntities< i >::apply( *this, level, codim ); } );
    \n+
    183
    \n+
    184 // CountLevelEntities<ThisType,All_Partition,dim>::count(*this,level,codim);
    \n+
    185
    \n+
    186 assert( levelSizes_[codim][level] >= 0 );
    \n+
    187 return levelSizes_[codim][level];
    \n+
    188 }
    \n+
    \n+
    189
    \n+
    \n+
    191 int size (int level, GeometryType type) const
    \n+
    192 {
    \n+
    193 int codim = GridType ::dimension - type.dim();
    \n+
    194 if( levelSizes_[codim][level] < 0)
    \n+
    195 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLevelEntities< i >::apply( *this, level, codim ); } );
    \n+
    196
    \n+
    197 assert( levelTypeSizes_[codim][level][gtIndex( type )] >= 0 );
    \n+
    198 return levelTypeSizes_[codim][level][gtIndex( type )];
    \n+
    199 }
    \n+
    \n+
    200
    \n+
    201 //********************************************************************
    \n+
    202 // leaf sizes
    \n+
    203 //********************************************************************
    \n+
    \n+
    205 int size (int codim) const
    \n+
    206 {
    \n+
    207 assert( codim >= 0 );
    \n+
    208 assert( codim < nCodim );
    \n+
    209 if( leafSizes_[codim] < 0 )
    \n+
    210 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLeafEntities< i >::apply( *this, codim ); } );
    \n+
    211
    \n+
    212 assert( leafSizes_[codim] >= 0 );
    \n+
    213 return leafSizes_[codim];
    \n+
    214 };
    \n+
    \n+
    215
    \n+
    \n+
    217 int size ( const GeometryType type ) const
    \n+
    218 {
    \n+
    219 int codim = GridType :: dimension - type.dim();
    \n+
    220 if( leafSizes_[codim] < 0 )
    \n+
    221 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLeafEntities< i >::apply( *this, codim ); } );
    \n+
    222
    \n+
    223 assert( leafTypeSizes_[codim][ gtIndex( type )] >= 0 );
    \n+
    224 return leafTypeSizes_[codim][ gtIndex( type )];
    \n+
    225 }
    \n+
    \n+
    226
    \n+
    227 private:
    \n+
    228 template <PartitionIteratorType pitype, int codim>
    \n+
    229 void countLevelEntities(int level) const
    \n+
    230 {
    \n+
    231 typedef typename GridType :: LevelGridView GridView ;
    \n+
    232 typedef typename GridView :: template Codim< codim > :: template Partition<pitype> :: Iterator Iterator ;
    \n+
    233 GridView gridView = grid_.levelGridView( level );
    \n+
    234 Iterator it = gridView.template begin<codim,pitype> ();
    \n+
    235 Iterator end = gridView.template end<codim,pitype> ();
    \n+
    236 levelSizes_[codim][level] = countElements(it,end, levelTypeSizes_[codim][level]);
    \n+
    237 }
    \n+
    238
    \n+
    239 template <PartitionIteratorType pitype, int codim>
    \n+
    240 void countLeafEntities() const
    \n+
    241 {
    \n+
    242 // count All_Partition entities
    \n+
    243 typedef typename GridType :: LeafGridView GridView ;
    \n+
    244 typedef typename GridView :: template Codim< codim > :: template Partition<pitype> :: Iterator Iterator ;
    \n+
    245 GridView gridView = grid_.leafGridView();
    \n+
    246 Iterator it = gridView.template begin<codim,pitype> ();
    \n+
    247 Iterator end = gridView.template end<codim,pitype> ();
    \n+
    248 leafSizes_[codim] = countElements(it,end, leafTypeSizes_[codim] );
    \n+
    249 }
    \n+
    250
    \n+
    251 // counts entities with given type for given iterator
    \n+
    252 template <class IteratorType>
    \n+
    253 int countElements(IteratorType & it, const IteratorType & end, std::vector<int>& typeSizes) const
    \n+
    254 {
    \n+
    255 int overall = 0;
    \n+
    256 const size_t types = typeSizes.size();
    \n+
    257 for(size_t i=0; i<types; ++i) typeSizes[i] = 0;
    \n+
    258 for( ; it != end; ++it )
    \n+
    259 {
    \n+
    260 const GeometryType type = it->type();
    \n+
    261 ++typeSizes[ gtIndex( type ) ];
    \n+
    262 ++overall;
    \n+
    263 }
    \n+
    264
    \n+
    265#ifndef NDEBUG
    \n+
    266 int sumtypes = 0;
    \n+
    267 for(size_t i=0; i<types; ++i)
    \n+
    268 sumtypes += typeSizes[i];
    \n+
    269
    \n+
    270 assert( overall == sumtypes );
    \n+
    271#endif
    \n+
    272
    \n+
    273 return overall;
    \n+
    274 }
    \n+
    275
    \n+
    276 template <PartitionIteratorType pitype, int codim>
    \n+
    277 void countLevelEntitiesNoCodim(int level) const
    \n+
    278 {
    \n+
    279 typedef typename GridType :: LevelGridView GridView ;
    \n+
    280 typedef typename GridView :: template Codim< 0 > :: template Partition<pitype> :: Iterator Iterator ;
    \n+
    281 GridView gridView = grid_.levelGridView( level );
    \n+
    282 Iterator it = gridView.template begin< 0, pitype> ();
    \n+
    283 Iterator end = gridView.template end< 0, pitype> ();
    \n+
    284 levelSizes_[codim][level] = countElementsNoCodim< codim >(it,end, levelTypeSizes_[codim][level]);
    \n+
    285 }
    \n+
    286
    \n+
    287 template <PartitionIteratorType pitype, int codim>
    \n+
    288 void countLeafEntitiesNoCodim() const
    \n+
    289 {
    \n+
    290 // count All_Partition entities
    \n+
    291 typedef typename GridType :: LeafGridView GridView ;
    \n+
    292 typedef typename GridView :: template Codim< 0 > :: template Partition<pitype> :: Iterator Iterator ;
    \n+
    293 GridView gridView = grid_.leafGridView();
    \n+
    294 Iterator it = gridView.template begin< 0, pitype > ();
    \n+
    295 Iterator end = gridView.template end< 0, pitype > ();
    \n+
    296 leafSizes_[codim] = countElementsNoCodim< codim >(it,end, leafTypeSizes_[codim] );
    \n+
    297 }
    \n+
    298
    \n+
    299 // counts entities with given type for given iterator
    \n+
    300 template < int codim, class IteratorType >
    \n+
    301 int countElementsNoCodim(IteratorType & it, const IteratorType & end, std::vector<int>& typeSizes) const
    \n+
    302 {
    \n+
    303 typedef typename GridType :: LocalIdSet LocalIdSet ;
    \n+
    304 typedef typename LocalIdSet :: IdType IdType ;
    \n+
    305
    \n+
    306 typedef ReferenceElements< ctype, dim > ReferenceElementContainerType;
    \n+
    307 typedef typename ReferenceElementContainerType::ReferenceElement ReferenceElementType;
    \n+
    308
    \n+
    309 typedef std::set< IdType > CodimIdSetType ;
    \n+
    310
    \n+
    311 typedef typename IteratorType :: Entity ElementType ;
    \n+
    312
    \n+
    313 // get id set
    \n+
    314 const LocalIdSet& idSet = grid_.localIdSet();
    \n+
    315
    \n+
    316 const size_t types = typeSizes.size();
    \n+
    317 for(size_t i=0; i<types; ++i) typeSizes[ i ] = 0;
    \n+
    318
    \n+
    319 std::vector< CodimIdSetType > typeCount( types );
    \n+
    320
    \n+
    321 // count all elements of codimension codim
    \n+
    322 for( ; it != end; ++it )
    \n+
    323 {
    \n+
    324 // get entity
    \n+
    325 const ElementType& element = *it ;
    \n+
    326 // get reference element
    \n+
    327 ReferenceElementType refElem =
    \n+
    328 ReferenceElementContainerType :: general( element.type() );
    \n+
    329
    \n+
    330 // count all sub entities of codimension codim
    \n+
    331 const int count = element.subEntities( codim );
    \n+
    332 for( int i=0; i< count; ++ i )
    \n+
    333 {
    \n+
    334 // get geometry type
    \n+
    335 const GeometryType geomType = refElem.type( i, codim );
    \n+
    336 // get id of sub entity
    \n+
    337 const IdType id = idSet.subId( element, i, codim );
    \n+
    338 // insert id into set
    \n+
    339 typeCount[ gtIndex( geomType ) ].insert( id );
    \n+
    340 }
    \n+
    341 }
    \n+
    342
    \n+
    343 // accumulate numbers
    \n+
    344 int overall = 0;
    \n+
    345 for(size_t i=0; i<types; ++i)
    \n+
    346 {
    \n+
    347 typeSizes[ i ] = typeCount[ i ].size();
    \n+
    348 overall += typeSizes[ i ];
    \n+
    349 }
    \n+
    350
    \n+
    351 return overall;
    \n+
    352 }
    \n+
    353 };
    \n+
    \n+
    354
    \n+
    355} // end namespace Dune
    \n+
    356#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition adaptcallback.hh:92
    \n-
    Base::Entity Entity
    Definition adaptcallback.hh:97
    \n-
    AdaptDataHandle()
    Definition adaptcallback.hh:100
    \n-
    Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
    Definition adaptcallback.hh:33
    \n-
    void prolongLocal(const Entity &father, const Entity &son, bool initialize)
    Definition adaptcallback.hh:74
    \n-
    void postRefinement(const Entity &father)
    call back for activity to take place on newly created elements below the father element.
    Definition adaptcallback.hh:64
    \n-
    Grid::template Codim< 0 >::Entity Entity
    Definition adaptcallback.hh:39
    \n-
    Impl & asImp()
    Definition adaptcallback.hh:81
    \n-
    const Impl & asImp() const
    Definition adaptcallback.hh:80
    \n-
    void restrictLocal(const Entity &father, const Entity &son, bool initialize)
    Definition adaptcallback.hh:69
    \n-
    void preCoarsening(const Entity &father)
    call back for activity to take place on father and all descendants before the descendants are removed
    Definition adaptcallback.hh:54
    \n-
    class for combining 2 index sets together for adaptation process
    Definition adaptcallback.hh:118
    \n-
    CombinedAdaptProlongRestrict(A &a, B &b)
    constructor storing the two references
    Definition adaptcallback.hh:124
    \n-
    void restrictLocal(const Entity &father, const Entity &son, bool initialize)
    restrict data to father
    Definition adaptcallback.hh:129
    \n-
    void prolongLocal(const Entity &father, const Entity &son, bool initialize)
    prolong data to children
    Definition adaptcallback.hh:137
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    U_CHAR ElementType
    Definition misc.hh:63
    \n+
    GeometryType
    Type representing VTK's entity geometry types.
    Definition common.hh:132
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    organizes the caching of sizes for one grid and one GeometryType
    Definition sizecache.hh:33
    \n+
    int size(int level, GeometryType type) const
    Return number of entities per level and geometry type in this process.
    Definition sizecache.hh:191
    \n+
    int size(int level, int codim) const
    Return number of grid entities of a given codim on a given level in this process.
    Definition sizecache.hh:174
    \n+
    int size(int codim) const
    Return number of leaf entities of a given codim in this process.
    Definition sizecache.hh:205
    \n+
    SizeCache(const GridType &grid)
    constructor taking grid reference
    Definition sizecache.hh:142
    \n+
    int size(const GeometryType type) const
    Return number of leaf entities per geometry type in this process.
    Definition sizecache.hh:217
    \n+
    void reset()
    reset all cached sizes
    Definition sizecache.hh:148
    \n+
    A set of traits classes to store static information about grid implementation.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,202 +1,414 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n-adaptcallback.hh\n+sizecache.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_COMMON_ADAPTCALLBACK_HH\n-6#define DUNE_GRID_COMMON_ADAPTCALLBACK_HH\n+5#ifndef DUNE_GRID_COMMON_SIZECACHE_HH\n+6#define DUNE_GRID_COMMON_SIZECACHE_HH\n 7\n-14namespace Dune\n-15{\n-16\n-17 // Internal Forward Declarations\n-18 // -----------------------------\n-19\n-20 template< class Grid, class Impl >\n-21 class AdaptDataHandle;\n-22\n-23\n-24\n-25 // AdaptDataHandleInterface\n-26 // ------------------------\n-27\n-31 template< class Grid, class Impl >\n-32 class AdaptDataHandleInterface\n+8#include \n+9#include \n+10#include \n+11#include \n+12\n+13#include \n+14#include \n+15\n+16#include \n+17#include \n+18\n+19#include \n+20#include \n+21\n+28namespace Dune {\n+29\n+31 template \n+32 class SizeCache\n 33 {\n-34 typedef AdaptDataHandleInterface<_Grid,_Impl_> This;\n-35\n-36 friend class AdaptDataHandle< Grid, Impl >;\n+34 typedef SizeCache ThisType;\n+36 constexpr static int dim = GridImp::dimension;\n 37\n-38 public:\n-39 typedef typename Grid::template Codim< 0 >::Entity Entity;\n+39 constexpr static int nCodim = GridImp::dimension + 1;\n 40\n-41 private:\n-42 AdaptDataHandleInterface ()\n-43 {}\n-44\n-45 AdaptDataHandleInterface ( const This & );\n-46 This &operator= ( const This & );\n-47\n-48 public:\n-54 void preCoarsening ( const Entity &father )\n-55 {\n-56 asImp().preCoarsening( father );\n-57 }\n+41 // type of grid\n+42 typedef GridImp GridType;\n+43\n+44 // coordinate type\n+45 typedef typename GridType :: ctype ctype ;\n+46\n+47 // stores all sizes of the levels\n+48 mutable std::vector< int > levelSizes_[nCodim];\n+49\n+50 // stores all sizes of the levels\n+51 mutable std::vector< std::vector< int > > levelTypeSizes_[nCodim];\n+52\n+53 // stores all sizes of leafs\n+54 mutable int leafSizes_[nCodim];\n+55\n+56 // stores all sizes of leafs\n+57 mutable std::vector< int > leafTypeSizes_[nCodim];\n 58\n-64 void postRefinement ( const Entity &father )\n+59 // the grid\n+60 const GridType & grid_;\n+61\n+62 // count elements of set by iterating the grid\n+63 template < int codim, bool gridHasCodim >\n+64 struct CountLevelEntitiesBase\n 65 {\n-66 asImp().postRefinement( father );\n-67 }\n-68\n-69 void restrictLocal( const Entity &father, const Entity& son, bool initialize\n-)\n+66 template < class SzCacheType >\n+67 static void apply(const SzCacheType & sc, int level, int cd)\n+68 {\n+69 if( cd == codim )\n 70 {\n-71 asImp().restrictLocal( father, son, initialize );\n+71 sc.template countLevelEntities (level);\n 72 }\n-73\n-74 void prolongLocal( const Entity &father, const Entity& son, bool initialize\n-)\n-75 {\n-76 asImp().prolongLocal( father, son, initialize );\n-77 }\n-78\n-79 protected:\n-80 const Impl &asImp () const { return static_cast< const Impl & >( *this ); }\n-81 Impl &asImp () { return static_cast< Impl & >( *this ); }\n-82 };\n-83\n-84\n-85\n-86 // AdaptDataHandle\n-87 // ---------------\n+73 }\n+74 };\n+75\n+76 template < int codim >\n+77 struct CountLevelEntitiesBase< codim, false >\n+78 {\n+79 template < class SzCacheType >\n+80 static void apply(const SzCacheType & sc, int level, int cd)\n+81 {\n+82 if( cd == codim )\n+83 {\n+84 sc.template countLevelEntitiesNoCodim (level);\n+85 }\n+86 }\n+87 };\n 88\n-89 template< class Grid, class Impl >\n-90 class AdaptDataHandle\n-91 : public AdaptDataHandleInterface< Grid, Impl >\n-92 {\n-93 typedef AdaptDataHandle<_Grid,_Impl_> This;\n-94 typedef AdaptDataHandleInterface<_Grid,_Impl_> Base;\n-95\n-96 public:\n-97 typedef typename Base::Entity Entity;\n-98\n-99 protected:\n-100 AdaptDataHandle ()\n-101 {}\n-102\n-103 private:\n-104 AdaptDataHandle ( const This & );\n-105 This &operator= ( const This & );\n-106\n-107 void preCoarsening ( const Entity &father );\n-108 void postRefinement ( const Entity &father );\n-109 };\n-110\n-111\n-112 // CombinedAdaptProlongRestrict\n-113 // ----------------------------\n-114\n-116 template \n-117 class CombinedAdaptProlongRestrict\n-118 {\n-120 A& _a;\n-121 B& _b;\n-122 public:\n-124 CombinedAdaptProlongRestrict ( A& a, B& b ) : _a ( a ) , _b ( b )\n-125 {}\n+89 template < int codim >\n+90 struct CountLevelEntities\n+91 : public CountLevelEntitiesBase< codim, Capabilities :: hasEntity< GridType,\n+codim > :: v >\n+92 {};\n+93\n+94 // count elements of set by iterating the grid\n+95 template < int codim, bool gridHasCodim >\n+96 struct CountLeafEntitiesBase\n+97 {\n+98 template \n+99 static void apply(const SzCacheType & sc, int cd)\n+100 {\n+101 if( cd == codim )\n+102 {\n+103 sc.template countLeafEntities ();\n+104 }\n+105 }\n+106 };\n+107\n+108 // count elements of set by iterating the grid\n+109 template < int codim >\n+110 struct CountLeafEntitiesBase< codim, false >\n+111 {\n+112 template \n+113 static void apply(const SzCacheType & sc, int cd)\n+114 {\n+115 if( cd == codim )\n+116 {\n+117 sc.template countLeafEntitiesNoCodim ();\n+118 }\n+119 }\n+120 };\n+121\n+122 template < int codim >\n+123 struct CountLeafEntities\n+124 : public CountLeafEntitiesBase< codim, Capabilities :: hasEntity< GridType,\n+codim > :: v >\n+125 {};\n 126\n-128 template \n-129 void restrictLocal ( const Entity &father, const Entity &son, bool\n-initialize )\n-130 {\n-131 _a.restrictLocal(father,son,initialize);\n-132 _b.restrictLocal(father,son,initialize);\n-133 }\n-134\n-136 template \n-137 void prolongLocal ( const Entity &father, const Entity &son, bool\n-initialize )\n-138 {\n-139 _a.prolongLocal(father,son,initialize);\n-140 _b.prolongLocal(father,son,initialize);\n-141 }\n-142 };\n-143\n-144} // end namespace Dune\n-145\n-146#endif\n+127 int gtIndex( const GeometryType& type ) const\n+128 {\n+129 return type.id() >> 1 ;\n+130 }\n+131\n+132 int sizeCodim( const int codim ) const\n+133 {\n+134 const int mydim = GridType :: dimension - codim;\n+135 return ((1 << mydim) + 1) / 2;\n+136 }\n+137\n+138 // private copy constructor\n+139 SizeCache (const SizeCache & );\n+140 public:\n+142 SizeCache (const GridType & grid) : grid_( grid )\n+143 {\n+144 reset();\n+145 }\n+146\n+148 void reset()\n+149 {\n+150 for(int codim=0; codim & vec = levelSizes_[codim];\n+160 vec.resize(numMxl);\n+161 levelTypeSizes_[codim].resize( numMxl );\n+162 for(int level = 0; level= 0 );\n+177 assert( codim < nCodim );\n+178 assert( level >= 0 );\n+179 if( level >= (int) levelSizes_[codim].size() ) return 0;\n+180\n+181 if( levelSizes_[codim][level] < 0)\n+182 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n+{ CountLevelEntities< i >::apply( *this, level, codim ); } );\n+183\n+184 // CountLevelEntities::count\n+(*this,level,codim);\n+185\n+186 assert( levelSizes_[codim][level] >= 0 );\n+187 return levelSizes_[codim][level];\n+188 }\n+189\n+191 int size (int level, GeometryType type) const\n+192 {\n+193 int codim = GridType ::dimension - type.dim();\n+194 if( levelSizes_[codim][level] < 0)\n+195 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n+{ CountLevelEntities< i >::apply( *this, level, codim ); } );\n+196\n+197 assert( levelTypeSizes_[codim][level][gtIndex( type )] >= 0 );\n+198 return levelTypeSizes_[codim][level][gtIndex( type )];\n+199 }\n+200\n+201 //********************************************************************\n+202 // leaf sizes\n+203 //********************************************************************\n+205 int size (int codim) const\n+206 {\n+207 assert( codim >= 0 );\n+208 assert( codim < nCodim );\n+209 if( leafSizes_[codim] < 0 )\n+210 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n+{ CountLeafEntities< i >::apply( *this, codim ); } );\n+211\n+212 assert( leafSizes_[codim] >= 0 );\n+213 return leafSizes_[codim];\n+214 };\n+215\n+217 int size ( const GeometryType type ) const\n+218 {\n+219 int codim = GridType :: dimension - type.dim();\n+220 if( leafSizes_[codim] < 0 )\n+221 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n+{ CountLeafEntities< i >::apply( *this, codim ); } );\n+222\n+223 assert( leafTypeSizes_[codim][ gtIndex( type )] >= 0 );\n+224 return leafTypeSizes_[codim][ gtIndex( type )];\n+225 }\n+226\n+227 private:\n+228 template \n+229 void countLevelEntities(int level) const\n+230 {\n+231 typedef typename GridType :: LevelGridView GridView ;\n+232 typedef typename GridView :: template Codim< codim > :: template\n+Partition :: Iterator Iterator ;\n+233 GridView gridView = grid_.levelGridView( level );\n+234 Iterator it = gridView.template begin ();\n+235 Iterator end = gridView.template end ();\n+236 levelSizes_[codim][level] = countElements(it,end, levelTypeSizes_[codim]\n+[level]);\n+237 }\n+238\n+239 template \n+240 void countLeafEntities() const\n+241 {\n+242 // count All_Partition entities\n+243 typedef typename GridType :: LeafGridView GridView ;\n+244 typedef typename GridView :: template Codim< codim > :: template\n+Partition :: Iterator Iterator ;\n+245 GridView gridView = grid_.leafGridView();\n+246 Iterator it = gridView.template begin ();\n+247 Iterator end = gridView.template end ();\n+248 leafSizes_[codim] = countElements(it,end, leafTypeSizes_[codim] );\n+249 }\n+250\n+251 // counts entities with given type for given iterator\n+252 template \n+253 int countElements(IteratorType & it, const IteratorType & end, std::\n+vector& typeSizes) const\n+254 {\n+255 int overall = 0;\n+256 const size_t types = typeSizes.size();\n+257 for(size_t i=0; itype();\n+261 ++typeSizes[ gtIndex( type ) ];\n+262 ++overall;\n+263 }\n+264\n+265#ifndef NDEBUG\n+266 int sumtypes = 0;\n+267 for(size_t i=0; i\n+277 void countLevelEntitiesNoCodim(int level) const\n+278 {\n+279 typedef typename GridType :: LevelGridView GridView ;\n+280 typedef typename GridView :: template Codim< 0 > :: template\n+Partition :: Iterator Iterator ;\n+281 GridView gridView = grid_.levelGridView( level );\n+282 Iterator it = gridView.template begin< 0, pitype> ();\n+283 Iterator end = gridView.template end< 0, pitype> ();\n+284 levelSizes_[codim][level] = countElementsNoCodim< codim >(it,end,\n+levelTypeSizes_[codim][level]);\n+285 }\n+286\n+287 template \n+288 void countLeafEntitiesNoCodim() const\n+289 {\n+290 // count All_Partition entities\n+291 typedef typename GridType :: LeafGridView GridView ;\n+292 typedef typename GridView :: template Codim< 0 > :: template\n+Partition :: Iterator Iterator ;\n+293 GridView gridView = grid_.leafGridView();\n+294 Iterator it = gridView.template begin< 0, pitype > ();\n+295 Iterator end = gridView.template end< 0, pitype > ();\n+296 leafSizes_[codim] = countElementsNoCodim< codim >(it,end, leafTypeSizes_\n+[codim] );\n+297 }\n+298\n+299 // counts entities with given type for given iterator\n+300 template < int codim, class IteratorType >\n+301 int countElementsNoCodim(IteratorType & it, const IteratorType & end, std::\n+vector& typeSizes) const\n+302 {\n+303 typedef typename GridType :: LocalIdSet LocalIdSet ;\n+304 typedef typename LocalIdSet :: IdType IdType ;\n+305\n+306 typedef ReferenceElements< ctype, dim > ReferenceElementContainerType;\n+307 typedef typename ReferenceElementContainerType::ReferenceElement\n+ReferenceElementType;\n+308\n+309 typedef std::set< IdType > CodimIdSetType ;\n+310\n+311 typedef typename IteratorType :: Entity ElementType ;\n+312\n+313 // get id set\n+314 const LocalIdSet& idSet = grid_.localIdSet();\n+315\n+316 const size_t types = typeSizes.size();\n+317 for(size_t i=0; i typeCount( types );\n+320\n+321 // count all elements of codimension codim\n+322 for( ; it != end; ++it )\n+323 {\n+324 // get entity\n+325 const ElementType& element = *it ;\n+326 // get reference element\n+327 ReferenceElementType refElem =\n+328 ReferenceElementContainerType :: general( element.type() );\n+329\n+330 // count all sub entities of codimension codim\n+331 const int count = element.subEntities( codim );\n+332 for( int i=0; i< count; ++ i )\n+333 {\n+334 // get geometry type\n+335 const GeometryType geomType = refElem.type( i, codim );\n+336 // get id of sub entity\n+337 const IdType id = idSet.subId( element, i, codim );\n+338 // insert id into set\n+339 typeCount[ gtIndex( geomType ) ].insert( id );\n+340 }\n+341 }\n+342\n+343 // accumulate numbers\n+344 int overall = 0;\n+345 for(size_t i=0; i::Entity Entity\n-Definition adaptcallback.hh:39\n-Dune::AdaptDataHandleInterface::asImp\n-Impl & asImp()\n-Definition adaptcallback.hh:81\n-Dune::AdaptDataHandleInterface::asImp\n-const Impl & asImp() const\n-Definition adaptcallback.hh:80\n-Dune::AdaptDataHandleInterface::restrictLocal\n-void restrictLocal(const Entity &father, const Entity &son, bool initialize)\n-Definition adaptcallback.hh:69\n-Dune::AdaptDataHandleInterface::preCoarsening\n-void preCoarsening(const Entity &father)\n-call back for activity to take place on father and all descendants before the\n-descendants are removed\n-Definition adaptcallback.hh:54\n-Dune::CombinedAdaptProlongRestrict\n-class for combining 2 index sets together for adaptation process\n-Definition adaptcallback.hh:118\n-Dune::CombinedAdaptProlongRestrict::CombinedAdaptProlongRestrict\n-CombinedAdaptProlongRestrict(A &a, B &b)\n-constructor storing the two references\n-Definition adaptcallback.hh:124\n-Dune::CombinedAdaptProlongRestrict::restrictLocal\n-void restrictLocal(const Entity &father, const Entity &son, bool initialize)\n-restrict data to father\n-Definition adaptcallback.hh:129\n-Dune::CombinedAdaptProlongRestrict::prolongLocal\n-void prolongLocal(const Entity &father, const Entity &son, bool initialize)\n-prolong data to children\n-Definition adaptcallback.hh:137\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n+Dune::Alberta::ElementType\n+U_CHAR ElementType\n+Definition misc.hh:63\n+Dune::VTK::GeometryType\n+GeometryType\n+Type representing VTK's entity geometry types.\n+Definition common.hh:132\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::SizeCache\n+organizes the caching of sizes for one grid and one GeometryType\n+Definition sizecache.hh:33\n+Dune::SizeCache::size\n+int size(int level, GeometryType type) const\n+Return number of entities per level and geometry type in this process.\n+Definition sizecache.hh:191\n+Dune::SizeCache::size\n+int size(int level, int codim) const\n+Return number of grid entities of a given codim on a given level in this\n+process.\n+Definition sizecache.hh:174\n+Dune::SizeCache::size\n+int size(int codim) const\n+Return number of leaf entities of a given codim in this process.\n+Definition sizecache.hh:205\n+Dune::SizeCache::SizeCache\n+SizeCache(const GridType &grid)\n+constructor taking grid reference\n+Definition sizecache.hh:142\n+Dune::SizeCache::size\n+int size(const GeometryType type) const\n+Return number of leaf entities per geometry type in this process.\n+Definition sizecache.hh:217\n+Dune::SizeCache::reset\n+void reset()\n+reset all cached sizes\n+Definition sizecache.hh:148\n+capabilities.hh\n+A set of traits classes to store static information about grid implementation.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00335.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00335.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: defaultgridview.hh File Reference\n+dune-grid: boundarysegment.hh File Reference\n \n \n \n \n \n \n \n@@ -72,57 +72,44 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n \n-
    defaultgridview.hh File Reference
    \n+
    boundarysegment.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/typetraits.hh>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/grid/common/capabilities.hh>
    \n-#include <dune/grid/common/gridview.hh>
    \n+\n+

    Base class for grid boundary segments of arbitrary geometry. \n+More...

    \n+
    #include <map>
    \n+#include <sstream>
    \n+#include <dune/common/singleton.hh>
    \n+#include <dune/common/parameterizedobject.hh>
    \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-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::DefaultLevelGridViewTraits< GridImp >
     
    struct  Dune::DefaultLevelGridViewTraits< GridImp >::Codim< cd >
     
    struct  Dune::DefaultLevelGridViewTraits< GridImp >::Codim< cd >::Partition< pit >
     Define types needed to iterate over entities of a given partition type. More...
     
    class  Dune::DefaultLevelGridView< GridImp >
     
    struct  Dune::DefaultLevelGridView< GridImp >::Codim< cd >
     Codim Structure. More...
     
    struct  Dune::DefaultLeafGridViewTraits< GridImp >
     
    struct  Dune::DefaultLeafGridViewTraits< GridImp >::Codim< cd >
     
    struct  Dune::DefaultLeafGridViewTraits< GridImp >::Codim< cd >::Partition< pit >
     Define types needed to iterate over entities of a given partition type. More...
     
    class  Dune::DefaultLeafGridView< GridImp >
    class  Dune::BoundarySegmentBackupRestore< BndSeg >
     
    struct  Dune::DefaultLeafGridView< GridImp >::Codim< cd >
     Codim Structure. More...
    struct  Dune::BoundarySegment< dim, dimworld, ctype >
     Base class for classes implementing geometries of boundary segments. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    Base class for grid boundary segments of arbitrary geometry.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,48 +2,30 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n Classes | Namespaces\n-defaultgridview.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+boundarysegment.hh File Reference\n+Base class for grid boundary segments of arbitrary geometry. More...\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::DefaultLevelGridViewTraits<_GridImp_>\n+ class \u00a0 Dune::BoundarySegmentBackupRestore<_BndSeg_>\n \u00a0\n-struct \u00a0 Dune::DefaultLevelGridViewTraits<_GridImp_>::Codim<_cd_>\n-\u00a0\n-struct \u00a0 Dune::DefaultLevelGridViewTraits<_GridImp_>::Codim<_cd_>::Partition<\n- pit_>\n-\u00a0 Define types needed to iterate over entities of a given partition\n- type. More...\n-\u00a0\n- class \u00a0 Dune::DefaultLevelGridView<_GridImp_>\n-\u00a0\n-struct \u00a0 Dune::DefaultLevelGridView<_GridImp_>::Codim<_cd_>\n-\u00a0 Codim Structure. More...\n-\u00a0\n-struct \u00a0 Dune::DefaultLeafGridViewTraits<_GridImp_>\n-\u00a0\n-struct \u00a0 Dune::DefaultLeafGridViewTraits<_GridImp_>::Codim<_cd_>\n-\u00a0\n-struct \u00a0 Dune::DefaultLeafGridViewTraits<_GridImp_>::Codim<_cd_>::Partition<\n- pit_>\n-\u00a0 Define types needed to iterate over entities of a given partition\n- type. More...\n-\u00a0\n- class \u00a0 Dune::DefaultLeafGridView<_GridImp_>\n-\u00a0\n-struct \u00a0 Dune::DefaultLeafGridView<_GridImp_>::Codim<_cd_>\n-\u00a0 Codim Structure. More...\n+struct \u00a0 Dune::BoundarySegment<_dim,_dimworld,_ctype_>\n+\u00a0 Base class for classes implementing geometries of boundary segments.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+***** Detailed Description *****\n+Base class for grid boundary segments of arbitrary geometry.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00335_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00335_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: defaultgridview.hh Source File\n+dune-grid: boundarysegment.hh Source File\n \n \n \n \n \n \n \n@@ -74,519 +74,130 @@\n \n
    \n \n
    \n \n
    \n-
    defaultgridview.hh
    \n+
    boundarysegment.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH
    \n-
    6#define DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH
    \n+
    5#ifndef DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
    \n+
    6#define DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
    \n
    7
    \n-
    8#include <dune/common/typetraits.hh>
    \n-
    9#include <dune/common/exceptions.hh>
    \n+
    8#include <map>
    \n+
    9#include <sstream>
    \n
    10
    \n-\n-\n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 template< class GridImp >
    \n-
    18 class DefaultLevelGridView;
    \n-
    19
    \n-
    20 template< class GridImp >
    \n-
    21 class DefaultLeafGridView;
    \n-
    22
    \n-
    23
    \n-
    24 template< class GridImp >
    \n-
    \n-\n-
    26 {
    \n-\n-
    28
    \n-
    30 typedef typename std::remove_const<GridImp>::type Grid;
    \n-
    31
    \n-
    33 typedef typename Grid :: Traits :: LevelIndexSet IndexSet;
    \n-
    34
    \n-
    36 typedef typename Grid :: Traits :: LevelIntersection Intersection;
    \n-
    37
    \n-
    39 typedef typename Grid :: Traits :: LevelIntersectionIterator
    \n-\n-
    41
    \n-
    43 typedef typename Grid :: Traits :: Communication Communication;
    \n-
    44
    \n-
    45 template< int cd >
    \n-
    \n-
    46 struct Codim
    \n-
    47 {
    \n-
    48 typedef typename Grid :: Traits
    \n-
    49 :: template Codim< cd > :: template Partition< All_Partition > :: LevelIterator
    \n-\n-
    51
    \n-
    52 typedef typename Grid :: Traits :: template Codim< cd > :: Entity Entity;
    \n-
    53
    \n-
    54 typedef typename Grid :: template Codim< cd > :: Geometry Geometry;
    \n-
    55 typedef typename Grid :: template Codim< cd > :: LocalGeometry
    \n-\n-
    57
    \n-
    59 template< PartitionIteratorType pit >
    \n-
    \n-
    60 struct Partition
    \n-
    61 {
    \n-
    63 typedef typename Grid :: template Codim< cd >
    \n-
    64 :: template Partition< pit > :: LevelIterator
    \n-\n-
    66 };
    \n-
    \n-
    67 };
    \n+
    11#include <dune/common/singleton.hh>
    \n+
    12#include <dune/common/parameterizedobject.hh>
    \n+
    13#include <dune/common/fvector.hh>
    \n+
    14
    \n+
    19namespace Dune {
    \n+
    20
    \n+
    36 template< int dim, int dimworld = dim, class ctype = double >
    \n+
    37 struct BoundarySegment;
    \n+
    38
    \n+
    39 template <class BndSeg>
    \n+
    \n+\n+
    41 {
    \n+
    42 public:
    \n+
    43 // type of object stream used for storing boundary segment information
    \n+
    44 typedef std::stringstream ObjectStreamType ;
    \n+
    45
    \n+
    46 protected:
    \n+
    48 typedef BndSeg BoundarySegment;
    \n+
    49
    \n+
    51 typedef Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment > ( ObjectStreamType& ), int > FactoryType;
    \n+
    52
    \n+
    \n+
    59 static std::unique_ptr< BoundarySegment > restore( ObjectStreamType& in )
    \n+
    60 {
    \n+
    61 int key = -1;
    \n+
    62 // read class key for restore
    \n+
    63 in.read( (char *) &key, sizeof( int ) );
    \n+
    64
    \n+
    65 // factory creates a unique_ptr which can be released later on
    \n+
    66 return factory().create( key, in );
    \n+
    67 }
    \n
    \n
    68
    \n-
    69 constexpr static bool conforming = Capabilities :: isLevelwiseConforming< Grid > :: v;
    \n-
    70 };
    \n-
    \n-
    71
    \n-
    72
    \n-
    73 template< class GridImp >
    \n-
    \n-\n-
    75 {
    \n-\n-
    77
    \n-
    78 public:
    \n-\n-
    80
    \n-
    82 typedef typename Traits::Grid Grid;
    \n-
    83
    \n-
    85 typedef typename Traits :: IndexSet IndexSet;
    \n-
    86
    \n-
    88 typedef typename Traits :: Intersection Intersection;
    \n-
    89
    \n-
    91 typedef typename Traits :: IntersectionIterator IntersectionIterator;
    \n-
    92
    \n-
    94 typedef typename Grid :: Traits :: Communication Communication;
    \n-
    95
    \n-
    97 template< int cd >
    \n-
    98 struct Codim : public Traits :: template Codim<cd> {};
    \n+
    69 template <class DerivedType>
    \n+
    \n+
    70 static int registerFactory()
    \n+
    71 {
    \n+
    72 const int key = createKey();
    \n+
    73 // create factory method that produces unique_ptr
    \n+
    74 factory().template define< DerivedType >( key );
    \n+
    75 // return key for storage in derived class
    \n+
    76 return key;
    \n+
    77 }
    \n+
    \n+
    78
    \n+
    79 private:
    \n+
    80 static int createKey()
    \n+
    81 {
    \n+
    82 static int key = 0;
    \n+
    83 return key++;
    \n+
    84 }
    \n+
    85
    \n+
    86 static FactoryType& factory()
    \n+
    87 {
    \n+
    88 return Dune::Singleton< FactoryType > :: instance();
    \n+
    89 }
    \n+
    90 };
    \n+
    \n+
    91
    \n+
    92 template< int dim, int dimworld, class ctype >
    \n+
    \n+
    93 struct BoundarySegment : public BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > >
    \n+
    94 {
    \n+\n+\n+
    97
    \n+
    98 typedef typename BaseType :: ObjectStreamType ObjectStreamType;
    \n
    99
    \n-
    100 constexpr static bool conforming = Traits :: conforming;
    \n-
    101
    \n-
    \n-
    102 DefaultLevelGridView ( const Grid &grid, int level )
    \n-
    103 : grid_( &grid ),
    \n-
    104 level_( level )
    \n-
    105 {}
    \n-
    \n-
    106
    \n-
    \n-
    108 const Grid &grid () const
    \n-
    109 {
    \n-
    110 assert( grid_ );
    \n-
    111 return *grid_;
    \n-
    112 }
    \n-
    \n-
    113
    \n-
    \n-
    115 const IndexSet &indexSet () const
    \n-
    116 {
    \n-
    117 return grid().levelIndexSet( level_ );
    \n-
    118 }
    \n+
    100 using BaseType :: restore;
    \n+\n+
    102
    \n+
    104 virtual ~BoundarySegment() {}
    \n+
    105
    \n+
    108 virtual FieldVector< ctype, dimworld >
    \n+
    109 operator() ( const FieldVector< ctype, dim-1> &local ) const = 0;
    \n+
    110
    \n+
    \n+
    114 virtual void backup( [[maybe_unused]] ObjectStreamType& buffer ) const
    \n+
    115 {
    \n+
    116 DUNE_THROW(NotImplemented,"BoundarySegment::backup needs to be overloaded!");
    \n+
    117 }
    \n+
    \n+
    118 };
    \n
    \n
    119
    \n-
    121 bool isConforming() const { return bool(Traits::conforming); }
    \n+
    120
    \n+
    121} // end namespace Dune
    \n
    122
    \n-
    \n-
    124 int size ( int codim ) const
    \n-
    125 {
    \n-
    126 return grid().size( level_, codim );
    \n-
    127 }
    \n-
    \n-
    128
    \n-
    \n-
    130 int size ( const GeometryType &type ) const
    \n-
    131 {
    \n-
    132 return grid().size( level_, type );
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    136 template< int cd >
    \n-
    \n-
    137 typename Codim< cd > :: Iterator begin () const
    \n-
    138 {
    \n-
    139 return grid().template lbegin< cd, All_Partition >( level_ );
    \n-
    140 }
    \n-
    \n-
    141
    \n-
    143 template< int cd, PartitionIteratorType pit >
    \n-
    \n-
    144 typename Codim< cd > :: template Partition< pit > :: Iterator begin () const
    \n-
    145 {
    \n-
    146 return grid().template lbegin< cd, pit >( level_ );
    \n-
    147 }
    \n-
    \n-
    148
    \n-
    150 template< int cd >
    \n-
    \n-
    151 typename Codim< cd > :: Iterator end () const
    \n-
    152 {
    \n-
    153 return grid().template lend< cd, All_Partition >( level_ );
    \n-
    154 }
    \n-
    \n-
    155
    \n-
    157 template< int cd, PartitionIteratorType pit >
    \n-
    \n-
    158 typename Codim< cd > :: template Partition< pit > :: Iterator end () const
    \n-
    159 {
    \n-
    160 return grid().template lend< cd, pit >( level_ );
    \n-
    161 }
    \n-
    \n-
    162
    \n-\n-
    \n-
    165 ibegin ( const typename Codim< 0 > :: Entity &entity ) const
    \n-
    166 {
    \n-
    167 return grid().ilevelbegin(entity);
    \n-
    168 }
    \n-
    \n-
    169
    \n-\n-
    \n-
    172 iend ( const typename Codim< 0 > :: Entity &entity ) const
    \n-
    173 {
    \n-
    174 return grid().ilevelend(entity);
    \n-
    175 }
    \n-
    \n-
    176
    \n-
    \n-
    178 const Communication &comm () const
    \n-
    179 {
    \n-
    180 return grid().comm();
    \n-
    181 }
    \n-
    \n-
    182
    \n-
    \n-
    184 int overlapSize(int codim) const
    \n-
    185 {
    \n-
    186 return grid().overlapSize(level_, codim);
    \n-
    187 }
    \n-
    \n-
    188
    \n-
    \n-
    190 int ghostSize(int codim) const
    \n-
    191 {
    \n-
    192 return grid().ghostSize(level_, codim);
    \n-
    193 }
    \n-
    \n-
    194
    \n-
    196 template< class DataHandleImp, class DataType >
    \n-
    \n-\n-\n-\n-
    200 {
    \n-
    201 return grid().communicate( data, iftype, dir, level_ );
    \n-
    202 }
    \n-
    \n-
    203
    \n-
    204 private:
    \n-
    205 const Grid *grid_;
    \n-
    206 int level_;
    \n-
    207 };
    \n-
    \n-
    208
    \n-
    209
    \n-
    210 template< class GridImp >
    \n-
    \n-\n-\n-
    213
    \n-
    215 typedef typename std::remove_const<GridImp>::type Grid;
    \n-
    216
    \n-
    218 typedef typename Grid :: Traits :: LeafIndexSet IndexSet;
    \n-
    219
    \n-
    221 typedef typename Grid :: Traits :: LeafIntersection Intersection;
    \n-
    222
    \n-
    224 typedef typename Grid :: Traits :: LeafIntersectionIterator
    \n-\n-
    226
    \n-
    228 typedef typename Grid :: Traits :: Communication Communication;
    \n-
    229
    \n-
    230 template< int cd >
    \n-
    \n-
    231 struct Codim
    \n-
    232 {
    \n-
    233 typedef typename Grid :: Traits
    \n-
    234 :: template Codim< cd > :: template Partition< All_Partition > :: LeafIterator
    \n-\n-
    236
    \n-
    237 typedef typename Grid :: Traits :: template Codim< cd > :: Entity Entity;
    \n-
    238
    \n-
    239 typedef typename Grid :: template Codim< cd > :: Geometry Geometry;
    \n-
    240 typedef typename Grid :: template Codim< cd > :: LocalGeometry
    \n-\n-
    242
    \n-
    244 template <PartitionIteratorType pit >
    \n-
    \n-\n-
    246 {
    \n-
    248 typedef typename Grid :: template Codim< cd >
    \n-
    249 :: template Partition< pit > :: LeafIterator
    \n-\n-
    251 };
    \n-
    \n-
    252 };
    \n-
    \n-
    253
    \n-
    254 constexpr static bool conforming = Capabilities :: isLeafwiseConforming< Grid > :: v;
    \n-
    255 };
    \n-
    \n-
    256
    \n-
    257
    \n-
    258 template< class GridImp >
    \n-
    \n-\n-
    260 {
    \n-\n-
    262
    \n-
    263 public:
    \n-\n-
    265
    \n-
    267 typedef typename Traits::Grid Grid;
    \n-
    268
    \n-
    270 typedef typename Traits :: IndexSet IndexSet;
    \n-
    271
    \n-
    273 typedef typename Traits :: Intersection Intersection;
    \n-
    274
    \n-
    276 typedef typename Traits :: IntersectionIterator IntersectionIterator;
    \n-
    277
    \n-
    279 typedef typename Grid :: Traits :: Communication Communication;
    \n-
    280
    \n-
    282 template< int cd >
    \n-
    283 struct Codim : public Traits :: template Codim<cd> {};
    \n-
    284
    \n-
    285 constexpr static bool conforming = Traits :: conforming;
    \n-
    286
    \n-
    287 public:
    \n-
    \n-\n-
    289 : grid_( &grid )
    \n-
    290 {}
    \n-
    \n-
    291
    \n-
    \n-
    293 const Grid &grid () const
    \n-
    294 {
    \n-
    295 assert( grid_ );
    \n-
    296 return *grid_;
    \n-
    297 }
    \n-
    \n-
    298
    \n-
    \n-
    300 const IndexSet &indexSet () const
    \n-
    301 {
    \n-
    302 return grid().leafIndexSet();
    \n-
    303 }
    \n-
    \n-
    304
    \n-
    306 bool isConforming() const { return bool(Traits::conforming); }
    \n-
    307
    \n-
    \n-
    309 int size ( int codim ) const
    \n-
    310 {
    \n-
    311 return grid().size( codim );
    \n-
    312 }
    \n-
    \n-
    313
    \n-
    \n-
    315 int size ( const GeometryType &type ) const
    \n-
    316 {
    \n-
    317 return grid().size( type );
    \n-
    318 }
    \n-
    \n-
    319
    \n-
    321 template< int cd >
    \n-
    \n-
    322 typename Codim< cd > :: Iterator begin () const
    \n-
    323 {
    \n-
    324 return grid().template leafbegin< cd, All_Partition >();
    \n-
    325 }
    \n-
    \n-
    326
    \n-
    328 template< int cd, PartitionIteratorType pit >
    \n-
    \n-
    329 typename Codim< cd > :: template Partition< pit > :: Iterator begin () const
    \n-
    330 {
    \n-
    331 return grid().template leafbegin< cd, pit >();
    \n-
    332 }
    \n-
    \n-
    333
    \n-
    335 template< int cd >
    \n-
    \n-
    336 typename Codim< cd > :: Iterator end () const
    \n-
    337 {
    \n-
    338 return grid().template leafend< cd, All_Partition >();
    \n-
    339 }
    \n-
    \n-
    340
    \n-
    342 template< int cd, PartitionIteratorType pit >
    \n-
    \n-
    343 typename Codim< cd > :: template Partition< pit > :: Iterator end () const
    \n-
    344 {
    \n-
    345 return grid().template leafend< cd, pit >();
    \n-
    346 }
    \n-
    \n-
    347
    \n-\n-
    \n-
    350 ibegin ( const typename Codim< 0 > :: Entity &entity ) const
    \n-
    351 {
    \n-
    352 return grid().ileafbegin(entity);
    \n-
    353 }
    \n-
    \n-
    354
    \n-\n-
    \n-
    357 iend ( const typename Codim< 0 > :: Entity &entity ) const
    \n-
    358 {
    \n-
    359 return grid().ileafend(entity);
    \n-
    360 }
    \n-
    \n-
    361
    \n-
    \n-
    363 const Communication &comm () const
    \n-
    364 {
    \n-
    365 return grid().comm();
    \n-
    366 }
    \n-
    \n-
    367
    \n-
    \n-
    369 int overlapSize(int codim) const
    \n-
    370 {
    \n-
    371 return grid().overlapSize(codim);
    \n-
    372 }
    \n-
    \n-
    373
    \n-
    \n-
    375 int ghostSize(int codim) const
    \n-
    376 {
    \n-
    377 return grid().ghostSize(codim);
    \n-
    378 }
    \n-
    \n-
    379
    \n-
    381 template< class DataHandleImp, class DataType >
    \n-
    \n-\n-\n-\n-
    385 {
    \n-
    386 return grid().communicate( data, iftype, dir );
    \n-
    387 }
    \n-
    \n-
    388
    \n-
    389 private:
    \n-
    390 const Grid *grid_;
    \n-
    391 };
    \n-
    \n-
    392
    \n-
    393}
    \n-
    394
    \n-
    395#endif
    \n-
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n-
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n+
    123#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition defaultgridview.hh:75
    \n-
    Codim< cd >::template Partition< pit >::Iterator begin() const
    obtain begin iterator for this view
    Definition defaultgridview.hh:144
    \n-
    int size(const GeometryType &type) const
    obtain number of entities with a given geometry type
    Definition defaultgridview.hh:130
    \n-
    Codim< cd >::Iterator begin() const
    obtain begin iterator for this view
    Definition defaultgridview.hh:137
    \n-
    IntersectionIterator iend(const typename Codim< 0 > ::Entity &entity) const
    obtain end intersection iterator with respect to this view
    Definition defaultgridview.hh:172
    \n-
    Codim< cd >::template Partition< pit >::Iterator end() const
    obtain end iterator for this view
    Definition defaultgridview.hh:158
    \n-
    DefaultLevelGridViewTraits< GridImp > Traits
    Definition defaultgridview.hh:79
    \n-
    const IndexSet & indexSet() const
    obtain the index set
    Definition defaultgridview.hh:115
    \n-
    const Communication & comm() const
    obtain communication object
    Definition defaultgridview.hh:178
    \n-
    static constexpr bool conforming
    Definition defaultgridview.hh:100
    \n-
    Traits::IndexSet IndexSet
    type of the index set
    Definition defaultgridview.hh:85
    \n-
    void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
    Definition defaultgridview.hh:197
    \n-
    Traits::IntersectionIterator IntersectionIterator
    type of the intersection iterator
    Definition defaultgridview.hh:91
    \n-
    int size(int codim) const
    obtain number of entities in a given codimension
    Definition defaultgridview.hh:124
    \n-
    int overlapSize(int codim) const
    Return size of the overlap region for a given codim on the grid view.
    Definition defaultgridview.hh:184
    \n-
    Codim< cd >::Iterator end() const
    obtain end iterator for this view
    Definition defaultgridview.hh:151
    \n-
    IntersectionIterator ibegin(const typename Codim< 0 > ::Entity &entity) const
    obtain begin intersection iterator with respect to this view
    Definition defaultgridview.hh:165
    \n-
    DefaultLevelGridView(const Grid &grid, int level)
    Definition defaultgridview.hh:102
    \n-
    Traits::Intersection Intersection
    type of the intersection
    Definition defaultgridview.hh:88
    \n-
    Grid::Traits::Communication Communication
    type of the communication
    Definition defaultgridview.hh:94
    \n-
    bool isConforming() const
    return true if current state of grid view represents a conforming grid
    Definition defaultgridview.hh:121
    \n-
    int ghostSize(int codim) const
    Return size of the ghost region for a given codim on the grid view.
    Definition defaultgridview.hh:190
    \n-
    Traits::Grid Grid
    type of the grid
    Definition defaultgridview.hh:82
    \n-
    const Grid & grid() const
    obtain a const reference to the underlying hierarchic grid
    Definition defaultgridview.hh:108
    \n-
    Definition defaultgridview.hh:260
    \n-
    void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
    Definition defaultgridview.hh:382
    \n-
    DefaultLeafGridViewTraits< GridImp > Traits
    Definition defaultgridview.hh:264
    \n-
    Codim< cd >::template Partition< pit >::Iterator end() const
    obtain end iterator for this view
    Definition defaultgridview.hh:343
    \n-
    const Grid & grid() const
    obtain a const reference to the underlying hierarchic grid
    Definition defaultgridview.hh:293
    \n-
    Codim< cd >::template Partition< pit >::Iterator begin() const
    obtain begin iterator for this view
    Definition defaultgridview.hh:329
    \n-
    IntersectionIterator ibegin(const typename Codim< 0 > ::Entity &entity) const
    obtain begin intersection iterator with respect to this view
    Definition defaultgridview.hh:350
    \n-
    Traits::Intersection Intersection
    type of the intersection
    Definition defaultgridview.hh:273
    \n-
    IntersectionIterator iend(const typename Codim< 0 > ::Entity &entity) const
    obtain end intersection iterator with respect to this view
    Definition defaultgridview.hh:357
    \n-
    Codim< cd >::Iterator end() const
    obtain end iterator for this view
    Definition defaultgridview.hh:336
    \n-
    Traits::Grid Grid
    type of the grid
    Definition defaultgridview.hh:267
    \n-
    int size(const GeometryType &type) const
    obtain number of entities with a given geometry type
    Definition defaultgridview.hh:315
    \n-
    bool isConforming() const
    return true if current state of grid view represents a conforming grid
    Definition defaultgridview.hh:306
    \n-
    Traits::IndexSet IndexSet
    type of the index set
    Definition defaultgridview.hh:270
    \n-
    const Communication & comm() const
    obtain communication object
    Definition defaultgridview.hh:363
    \n-
    Grid::Traits::Communication Communication
    type of the communication
    Definition defaultgridview.hh:279
    \n-
    DefaultLeafGridView(const Grid &grid)
    Definition defaultgridview.hh:288
    \n-
    int overlapSize(int codim) const
    Return size of the overlap region for a given codim on the grid view.
    Definition defaultgridview.hh:369
    \n-
    Codim< cd >::Iterator begin() const
    obtain begin iterator for this view
    Definition defaultgridview.hh:322
    \n-
    int ghostSize(int codim) const
    Return size of the ghost region for a given codim on the grid view.
    Definition defaultgridview.hh:375
    \n-
    int size(int codim) const
    obtain number of entities in a given codimension
    Definition defaultgridview.hh:309
    \n-
    const IndexSet & indexSet() const
    obtain the index set
    Definition defaultgridview.hh:300
    \n-
    Traits::IntersectionIterator IntersectionIterator
    type of the intersection iterator
    Definition defaultgridview.hh:276
    \n-
    static constexpr bool conforming
    Definition defaultgridview.hh:285
    \n-
    Definition defaultgridview.hh:26
    \n-
    Grid::Traits::Communication Communication
    type of the communication
    Definition defaultgridview.hh:43
    \n-
    static constexpr bool conforming
    Definition defaultgridview.hh:69
    \n-
    Grid::Traits::LevelIntersection Intersection
    type of the intersection
    Definition defaultgridview.hh:36
    \n-
    Grid::Traits::LevelIntersectionIterator IntersectionIterator
    type of the intersection iterator
    Definition defaultgridview.hh:40
    \n-
    Grid::Traits::LevelIndexSet IndexSet
    type of the index set
    Definition defaultgridview.hh:33
    \n-
    std::remove_const< GridImp >::type Grid
    type of the grid
    Definition defaultgridview.hh:30
    \n-
    DefaultLevelGridView< GridImp > GridViewImp
    Definition defaultgridview.hh:27
    \n-
    Definition defaultgridview.hh:47
    \n-
    Grid::Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator Iterator
    Definition defaultgridview.hh:50
    \n-
    Grid::Traits::template Codim< cd >::Entity Entity
    Definition defaultgridview.hh:52
    \n-
    Grid::template Codim< cd >::Geometry Geometry
    Definition defaultgridview.hh:54
    \n-
    Grid::template Codim< cd >::LocalGeometry LocalGeometry
    Definition defaultgridview.hh:56
    \n-
    Define types needed to iterate over entities of a given partition type.
    Definition defaultgridview.hh:61
    \n-
    Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
    iterator over a given codim and partition type
    Definition defaultgridview.hh:65
    \n-
    Codim Structure.
    Definition defaultgridview.hh:98
    \n-
    Definition defaultgridview.hh:211
    \n-
    std::remove_const< GridImp >::type Grid
    type of the grid
    Definition defaultgridview.hh:215
    \n-
    DefaultLeafGridView< GridImp > GridViewImp
    Definition defaultgridview.hh:212
    \n-
    static constexpr bool conforming
    Definition defaultgridview.hh:254
    \n-
    Grid::Traits::LeafIntersectionIterator IntersectionIterator
    type of the intersection iterator
    Definition defaultgridview.hh:225
    \n-
    Grid::Traits::LeafIntersection Intersection
    type of the intersection
    Definition defaultgridview.hh:221
    \n-
    Grid::Traits::LeafIndexSet IndexSet
    type of the index set
    Definition defaultgridview.hh:218
    \n-
    Grid::Traits::Communication Communication
    type of the communication
    Definition defaultgridview.hh:228
    \n-
    Definition defaultgridview.hh:232
    \n-
    Grid::Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator Iterator
    Definition defaultgridview.hh:235
    \n-
    Grid::Traits::template Codim< cd >::Entity Entity
    Definition defaultgridview.hh:237
    \n-
    Grid::template Codim< cd >::Geometry Geometry
    Definition defaultgridview.hh:239
    \n-
    Grid::template Codim< cd >::LocalGeometry LocalGeometry
    Definition defaultgridview.hh:241
    \n-
    Define types needed to iterate over entities of a given partition type.
    Definition defaultgridview.hh:246
    \n-
    Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
    iterator over a given codim and partition type
    Definition defaultgridview.hh:250
    \n-
    Codim Structure.
    Definition defaultgridview.hh:283
    \n-
    Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
    Definition common/intersectioniterator.hh:83
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    A set of traits classes to store static information about grid implementation.
    \n-\n+
    BaseType::ObjectStreamType ObjectStreamType
    Definition boundarysegment.hh:98
    \n+
    BoundarySegment< dim, dimworld, ctype > ThisType
    Definition boundarysegment.hh:95
    \n+
    virtual void backup(ObjectStreamType &buffer) const
    write BoundarySegment's data to stream buffer
    Definition boundarysegment.hh:114
    \n+
    BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > > BaseType
    Definition boundarysegment.hh:96
    \n+
    virtual FieldVector< ctype, dimworld > operator()(const FieldVector< ctype, dim-1 > &local) const =0
    A function mapping local coordinates on a boundary segment to world coordinates.
    \n+
    virtual ~BoundarySegment()
    Dummy virtual destructor.
    Definition boundarysegment.hh:104
    \n+
    Definition boundarysegment.hh:41
    \n+
    static std::unique_ptr< BoundarySegment > restore(ObjectStreamType &in)
    create an object of BoundarySegment type from a previously registered factory linked to key.
    Definition boundarysegment.hh:59
    \n+
    Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >(ObjectStreamType &), int > FactoryType
    type of factory creating a unique_ptr from an ObjectStreamType
    Definition boundarysegment.hh:51
    \n+
    BndSeg BoundarySegment
    type of BoundarySegment interface class
    Definition boundarysegment.hh:48
    \n+
    std::stringstream ObjectStreamType
    Definition boundarysegment.hh:44
    \n+
    static int registerFactory()
    Definition boundarysegment.hh:70
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,666 +1,154 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n-defaultgridview.hh\n+boundarysegment.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH\n-6#define DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH\n+5#ifndef DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH\n+6#define DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH\n 7\n-8#include \n-9#include \n+8#include \n+9#include \n 10\n-11#include \n-12#include \n-13\n-14namespace Dune\n-15{\n-16\n-17 template< class GridImp >\n-18 class DefaultLevelGridView;\n-19\n-20 template< class GridImp >\n-21 class DefaultLeafGridView;\n-22\n-23\n-24 template< class GridImp >\n-25 struct DefaultLevelGridViewTraits\n-26 {\n-27 typedef DefaultLevelGridView<_GridImp_> GridViewImp;\n-28\n-30 typedef typename std::remove_const::type Grid;\n-31\n-33 typedef typename Grid :: Traits :: LevelIndexSet IndexSet;\n-34\n-36 typedef typename Grid :: Traits :: LevelIntersection Intersection;\n-37\n-39 typedef typename Grid :: Traits :: LevelIntersectionIterator\n-40 IntersectionIterator;\n-41\n-43 typedef typename Grid :: Traits :: Communication Communication;\n-44\n-45 template< int cd >\n-46 struct Codim\n-47 {\n-48 typedef typename Grid :: Traits\n-49 :: template Codim<_cd_> :: template Partition<_All_Partition_> ::\n-LevelIterator\n-50 Iterator;\n-51\n-52 typedef typename Grid :: Traits :: template Codim<_cd_> ::_Entity Entity;\n-53\n-54 typedef typename Grid :: template Codim<_cd_> ::_Geometry Geometry;\n-55 typedef typename Grid :: template Codim<_cd_> ::_LocalGeometry\n-56 LocalGeometry;\n-57\n-59 template< PartitionIteratorType pit >\n-60 struct Partition\n-61 {\n-63 typedef typename Grid :: template Codim<_cd_>\n-64 :: template Partition<_pit_> :: LevelIterator\n-65 Iterator;\n-66 };\n-67 };\n+11#include \n+12#include \n+13#include \n+14\n+19namespace Dune {\n+20\n+36 template< int dim, int dimworld = dim, class ctype = double >\n+37 struct BoundarySegment;\n+38\n+39 template \n+40 class BoundarySegmentBackupRestore\n+41 {\n+42 public:\n+43 // type of object stream used for storing boundary segment information\n+44 typedef std::stringstream ObjectStreamType ;\n+45\n+46 protected:\n+48 typedef BndSeg BoundarySegment;\n+49\n+51 typedef Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >\n+( ObjectStreamType& ), int > FactoryType;\n+52\n+59 static std::unique_ptr< BoundarySegment > restore( ObjectStreamType& in )\n+60 {\n+61 int key = -1;\n+62 // read class key for restore\n+63 in.read( (char *) &key, sizeof( int ) );\n+64\n+65 // factory creates a unique_ptr which can be released later on\n+66 return factory().create( key, in );\n+67 }\n 68\n-69 constexpr static bool conforming = Capabilities :: isLevelwiseConforming<\n-Grid > :: v;\n-70 };\n-71\n-72\n-73 template< class GridImp >\n-74 class DefaultLevelGridView\n-75 {\n-76 typedef DefaultLevelGridView<_GridImp_> ThisType;\n-77\n-78 public:\n-79 typedef DefaultLevelGridViewTraits Traits;\n-80\n-82 typedef typename Traits::Grid Grid;\n-83\n-85 typedef typename Traits :: IndexSet IndexSet;\n-86\n-88 typedef typename Traits :: Intersection Intersection;\n-89\n-91 typedef typename Traits :: IntersectionIterator IntersectionIterator;\n-92\n-94 typedef typename Grid :: Traits :: Communication Communication;\n-95\n-97 template< int cd >\n-98 struct Codim : public Traits :: template Codim {};\n+69 template \n+70 static int registerFactory()\n+71 {\n+72 const int key = createKey();\n+73 // create factory method that produces unique_ptr\n+74 factory().template define< DerivedType >( key );\n+75 // return key for storage in derived class\n+76 return key;\n+77 }\n+78\n+79 private:\n+80 static int createKey()\n+81 {\n+82 static int key = 0;\n+83 return key++;\n+84 }\n+85\n+86 static FactoryType& factory()\n+87 {\n+88 return Dune::Singleton< FactoryType > :: instance();\n+89 }\n+90 };\n+91\n+92 template< int dim, int dimworld, class ctype >\n+93 struct BoundarySegment : public BoundarySegmentBackupRestore<\n+BoundarySegment< dim, dimworld, ctype > >\n+94 {\n+95 typedef BoundarySegment<_dim,_dimworld,_ctype_> ThisType;\n+96 typedef BoundarySegmentBackupRestore<_BoundarySegment<_dim,_dimworld,_ctype\n+> > BaseType;\n+97\n+98 typedef typename BaseType :: ObjectStreamType ObjectStreamType;\n 99\n-100 constexpr static bool conforming = Traits :: conforming;\n-101\n-102 DefaultLevelGridView ( const Grid &grid, int level )\n-103 : grid_( &grid ),\n-104 level_( level )\n-105 {}\n-106\n-108 const Grid &grid () const\n-109 {\n-110 assert( grid_ );\n-111 return *grid_;\n-112 }\n-113\n-115 const IndexSet &indexSet () const\n-116 {\n-117 return grid().levelIndexSet( level_ );\n-118 }\n+100 using BaseType ::_restore;\n+101 using BaseType ::_registerFactory;\n+102\n+104 virtual ~BoundarySegment() {}\n+105\n+108 virtual FieldVector< ctype, dimworld >\n+109 operator()_( const FieldVector< ctype, dim-1> &local ) const = 0;\n+110\n+114 virtual void backup( [[maybe_unused]] ObjectStreamType& buffer ) const\n+115 {\n+116 DUNE_THROW(NotImplemented,\"BoundarySegment::backup needs to be\n+overloaded!\");\n+117 }\n+118 };\n 119\n-121 bool isConforming() const { return bool(Traits::conforming); }\n+120\n+121} // end namespace Dune\n 122\n-124 int size ( int codim ) const\n-125 {\n-126 return grid().size( level_, codim );\n-127 }\n-128\n-130 int size ( const GeometryType &type ) const\n-131 {\n-132 return grid().size( level_, type );\n-133 }\n-134\n-136 template< int cd >\n-137 typename Codim<_cd_> :: Iterator begin () const\n-138 {\n-139 return grid().template lbegin<_cd,_All_Partition_>( level_ );\n-140 }\n-141\n-143 template< int cd, PartitionIteratorType pit >\n-144 typename Codim<_cd_> :: template Partition<_pit_> :: Iterator begin ()\n-const\n-145 {\n-146 return grid().template lbegin<_cd,_pit_>( level_ );\n-147 }\n-148\n-150 template< int cd >\n-151 typename Codim<_cd_> :: Iterator end () const\n-152 {\n-153 return grid().template lend<_cd,_All_Partition_>( level_ );\n-154 }\n-155\n-157 template< int cd, PartitionIteratorType pit >\n-158 typename Codim<_cd_> :: template Partition<_pit_> :: Iterator end () const\n-159 {\n-160 return grid().template lend<_cd,_pit_>( level_ );\n-161 }\n-162\n-164 IntersectionIterator\n-165 ibegin ( const typename Codim<_0_>_::_Entity &entity ) const\n-166 {\n-167 return grid().ilevelbegin(entity);\n-168 }\n-169\n-171 IntersectionIterator\n-172 iend ( const typename Codim<_0_>_::_Entity &entity ) const\n-173 {\n-174 return grid().ilevelend(entity);\n-175 }\n-176\n-178 const Communication &comm () const\n-179 {\n-180 return grid().comm();\n-181 }\n-182\n-184 int overlapSize(int codim) const\n-185 {\n-186 return grid().overlapSize(level_, codim);\n-187 }\n-188\n-190 int ghostSize(int codim) const\n-191 {\n-192 return grid().ghostSize(level_, codim);\n-193 }\n-194\n-196 template< class DataHandleImp, class DataType >\n-197 void communicate ( CommDataHandleIF<_DataHandleImp,_DataType_> &data,\n-198 InterfaceType iftype,\n-199 CommunicationDirection dir ) const\n-200 {\n-201 return grid().communicate( data, iftype, dir, level_ );\n-202 }\n-203\n-204 private:\n-205 const Grid *grid_;\n-206 int level_;\n-207 };\n-208\n-209\n-210 template< class GridImp >\n-211 struct DefaultLeafGridViewTraits {\n-212 typedef DefaultLeafGridView<_GridImp_> GridViewImp;\n-213\n-215 typedef typename std::remove_const::type Grid;\n-216\n-218 typedef typename Grid :: Traits :: LeafIndexSet IndexSet;\n-219\n-221 typedef typename Grid :: Traits :: LeafIntersection Intersection;\n-222\n-224 typedef typename Grid :: Traits :: LeafIntersectionIterator\n-225 IntersectionIterator;\n-226\n-228 typedef typename Grid :: Traits :: Communication Communication;\n-229\n-230 template< int cd >\n-231 struct Codim\n-232 {\n-233 typedef typename Grid :: Traits\n-234 :: template Codim<_cd_> :: template Partition<_All_Partition_> ::\n-LeafIterator\n-235 Iterator;\n-236\n-237 typedef typename Grid :: Traits :: template Codim<_cd_> ::_Entity Entity;\n-238\n-239 typedef typename Grid :: template Codim<_cd_> ::_Geometry Geometry;\n-240 typedef typename Grid :: template Codim<_cd_> ::_LocalGeometry\n-241 LocalGeometry;\n-242\n-244 template \n-245 struct Partition\n-246 {\n-248 typedef typename Grid :: template Codim<_cd_>\n-249 :: template Partition<_pit_> :: LeafIterator\n-250 Iterator;\n-251 };\n-252 };\n-253\n-254 constexpr static bool conforming = Capabilities :: isLeafwiseConforming<\n-Grid > :: v;\n-255 };\n-256\n-257\n-258 template< class GridImp >\n-259 class DefaultLeafGridView\n-260 {\n-261 typedef DefaultLeafGridView<_GridImp_> ThisType;\n-262\n-263 public:\n-264 typedef DefaultLeafGridViewTraits Traits;\n-265\n-267 typedef typename Traits::Grid Grid;\n-268\n-270 typedef typename Traits :: IndexSet IndexSet;\n-271\n-273 typedef typename Traits :: Intersection Intersection;\n-274\n-276 typedef typename Traits :: IntersectionIterator IntersectionIterator;\n-277\n-279 typedef typename Grid :: Traits :: Communication Communication;\n-280\n-282 template< int cd >\n-283 struct Codim : public Traits :: template Codim {};\n-284\n-285 constexpr static bool conforming = Traits :: conforming;\n-286\n-287 public:\n-288 DefaultLeafGridView ( const Grid &grid )\n-289 : grid_( &grid )\n-290 {}\n-291\n-293 const Grid &grid () const\n-294 {\n-295 assert( grid_ );\n-296 return *grid_;\n-297 }\n-298\n-300 const IndexSet &indexSet () const\n-301 {\n-302 return grid().leafIndexSet();\n-303 }\n-304\n-306 bool isConforming() const { return bool(Traits::conforming); }\n-307\n-309 int size ( int codim ) const\n-310 {\n-311 return grid().size( codim );\n-312 }\n-313\n-315 int size ( const GeometryType &type ) const\n-316 {\n-317 return grid().size( type );\n-318 }\n-319\n-321 template< int cd >\n-322 typename Codim<_cd_> :: Iterator begin () const\n-323 {\n-324 return grid().template leafbegin<_cd,_All_Partition_>();\n-325 }\n-326\n-328 template< int cd, PartitionIteratorType pit >\n-329 typename Codim<_cd_> :: template Partition<_pit_> :: Iterator begin ()\n-const\n-330 {\n-331 return grid().template leafbegin<_cd,_pit_>();\n-332 }\n-333\n-335 template< int cd >\n-336 typename Codim<_cd_> :: Iterator end () const\n-337 {\n-338 return grid().template leafend<_cd,_All_Partition_>();\n-339 }\n-340\n-342 template< int cd, PartitionIteratorType pit >\n-343 typename Codim<_cd_> :: template Partition<_pit_> :: Iterator end () const\n-344 {\n-345 return grid().template leafend<_cd,_pit_>();\n-346 }\n-347\n-349 IntersectionIterator\n-350 ibegin ( const typename Codim<_0_>_::_Entity &entity ) const\n-351 {\n-352 return grid().ileafbegin(entity);\n-353 }\n-354\n-356 IntersectionIterator\n-357 iend ( const typename Codim<_0_>_::_Entity &entity ) const\n-358 {\n-359 return grid().ileafend(entity);\n-360 }\n-361\n-363 const Communication &comm () const\n-364 {\n-365 return grid().comm();\n-366 }\n-367\n-369 int overlapSize(int codim) const\n-370 {\n-371 return grid().overlapSize(codim);\n-372 }\n-373\n-375 int ghostSize(int codim) const\n-376 {\n-377 return grid().ghostSize(codim);\n-378 }\n-379\n-381 template< class DataHandleImp, class DataType >\n-382 void communicate ( CommDataHandleIF<_DataHandleImp,_DataType_> &data,\n-383 InterfaceType iftype,\n-384 CommunicationDirection dir ) const\n-385 {\n-386 return grid().communicate( data, iftype, dir );\n-387 }\n-388\n-389 private:\n-390 const Grid *grid_;\n-391 };\n-392\n-393}\n-394\n-395#endif\n-Dune::CommunicationDirection\n-CommunicationDirection\n-Define a type for communication direction parameter.\n-Definition gridenums.hh:170\n-Dune::InterfaceType\n-InterfaceType\n-Parameter to be used for the communication functions.\n-Definition gridenums.hh:86\n+123#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DefaultLevelGridView\n-Definition defaultgridview.hh:75\n-Dune::DefaultLevelGridView::begin\n-Codim< cd >::template Partition< pit >::Iterator begin() const\n-obtain begin iterator for this view\n-Definition defaultgridview.hh:144\n-Dune::DefaultLevelGridView::size\n-int size(const GeometryType &type) const\n-obtain number of entities with a given geometry type\n-Definition defaultgridview.hh:130\n-Dune::DefaultLevelGridView::begin\n-Codim< cd >::Iterator begin() const\n-obtain begin iterator for this view\n-Definition defaultgridview.hh:137\n-Dune::DefaultLevelGridView::iend\n-IntersectionIterator iend(const typename Codim< 0 > ::Entity &entity) const\n-obtain end intersection iterator with respect to this view\n-Definition defaultgridview.hh:172\n-Dune::DefaultLevelGridView::end\n-Codim< cd >::template Partition< pit >::Iterator end() const\n-obtain end iterator for this view\n-Definition defaultgridview.hh:158\n-Dune::DefaultLevelGridView::Traits\n-DefaultLevelGridViewTraits< GridImp > Traits\n-Definition defaultgridview.hh:79\n-Dune::DefaultLevelGridView::indexSet\n-const IndexSet & indexSet() const\n-obtain the index set\n-Definition defaultgridview.hh:115\n-Dune::DefaultLevelGridView::comm\n-const Communication & comm() const\n-obtain communication object\n-Definition defaultgridview.hh:178\n-Dune::DefaultLevelGridView::conforming\n-static constexpr bool conforming\n-Definition defaultgridview.hh:100\n-Dune::DefaultLevelGridView::IndexSet\n-Traits::IndexSet IndexSet\n-type of the index set\n-Definition defaultgridview.hh:85\n-Dune::DefaultLevelGridView::communicate\n-void communicate(CommDataHandleIF< DataHandleImp, DataType > &data,\n-InterfaceType iftype, CommunicationDirection dir) const\n-Definition defaultgridview.hh:197\n-Dune::DefaultLevelGridView::IntersectionIterator\n-Traits::IntersectionIterator IntersectionIterator\n-type of the intersection iterator\n-Definition defaultgridview.hh:91\n-Dune::DefaultLevelGridView::size\n-int size(int codim) const\n-obtain number of entities in a given codimension\n-Definition defaultgridview.hh:124\n-Dune::DefaultLevelGridView::overlapSize\n-int overlapSize(int codim) const\n-Return size of the overlap region for a given codim on the grid view.\n-Definition defaultgridview.hh:184\n-Dune::DefaultLevelGridView::end\n-Codim< cd >::Iterator end() const\n-obtain end iterator for this view\n-Definition defaultgridview.hh:151\n-Dune::DefaultLevelGridView::ibegin\n-IntersectionIterator ibegin(const typename Codim< 0 > ::Entity &entity) const\n-obtain begin intersection iterator with respect to this view\n-Definition defaultgridview.hh:165\n-Dune::DefaultLevelGridView::DefaultLevelGridView\n-DefaultLevelGridView(const Grid &grid, int level)\n-Definition defaultgridview.hh:102\n-Dune::DefaultLevelGridView::Intersection\n-Traits::Intersection Intersection\n-type of the intersection\n-Definition defaultgridview.hh:88\n-Dune::DefaultLevelGridView::Communication\n-Grid::Traits::Communication Communication\n-type of the communication\n-Definition defaultgridview.hh:94\n-Dune::DefaultLevelGridView::isConforming\n-bool isConforming() const\n-return true if current state of grid view represents a conforming grid\n-Definition defaultgridview.hh:121\n-Dune::DefaultLevelGridView::ghostSize\n-int ghostSize(int codim) const\n-Return size of the ghost region for a given codim on the grid view.\n-Definition defaultgridview.hh:190\n-Dune::DefaultLevelGridView::Grid\n-Traits::Grid Grid\n-type of the grid\n-Definition defaultgridview.hh:82\n-Dune::DefaultLevelGridView::grid\n-const Grid & grid() const\n-obtain a const reference to the underlying hierarchic grid\n-Definition defaultgridview.hh:108\n-Dune::DefaultLeafGridView\n-Definition defaultgridview.hh:260\n-Dune::DefaultLeafGridView::communicate\n-void communicate(CommDataHandleIF< DataHandleImp, DataType > &data,\n-InterfaceType iftype, CommunicationDirection dir) const\n-Definition defaultgridview.hh:382\n-Dune::DefaultLeafGridView::Traits\n-DefaultLeafGridViewTraits< GridImp > Traits\n-Definition defaultgridview.hh:264\n-Dune::DefaultLeafGridView::end\n-Codim< cd >::template Partition< pit >::Iterator end() const\n-obtain end iterator for this view\n-Definition defaultgridview.hh:343\n-Dune::DefaultLeafGridView::grid\n-const Grid & grid() const\n-obtain a const reference to the underlying hierarchic grid\n-Definition defaultgridview.hh:293\n-Dune::DefaultLeafGridView::begin\n-Codim< cd >::template Partition< pit >::Iterator begin() const\n-obtain begin iterator for this view\n-Definition defaultgridview.hh:329\n-Dune::DefaultLeafGridView::ibegin\n-IntersectionIterator ibegin(const typename Codim< 0 > ::Entity &entity) const\n-obtain begin intersection iterator with respect to this view\n-Definition defaultgridview.hh:350\n-Dune::DefaultLeafGridView::Intersection\n-Traits::Intersection Intersection\n-type of the intersection\n-Definition defaultgridview.hh:273\n-Dune::DefaultLeafGridView::iend\n-IntersectionIterator iend(const typename Codim< 0 > ::Entity &entity) const\n-obtain end intersection iterator with respect to this view\n-Definition defaultgridview.hh:357\n-Dune::DefaultLeafGridView::end\n-Codim< cd >::Iterator end() const\n-obtain end iterator for this view\n-Definition defaultgridview.hh:336\n-Dune::DefaultLeafGridView::Grid\n-Traits::Grid Grid\n-type of the grid\n-Definition defaultgridview.hh:267\n-Dune::DefaultLeafGridView::size\n-int size(const GeometryType &type) const\n-obtain number of entities with a given geometry type\n-Definition defaultgridview.hh:315\n-Dune::DefaultLeafGridView::isConforming\n-bool isConforming() const\n-return true if current state of grid view represents a conforming grid\n-Definition defaultgridview.hh:306\n-Dune::DefaultLeafGridView::IndexSet\n-Traits::IndexSet IndexSet\n-type of the index set\n-Definition defaultgridview.hh:270\n-Dune::DefaultLeafGridView::comm\n-const Communication & comm() const\n-obtain communication object\n-Definition defaultgridview.hh:363\n-Dune::DefaultLeafGridView::Communication\n-Grid::Traits::Communication Communication\n-type of the communication\n-Definition defaultgridview.hh:279\n-Dune::DefaultLeafGridView::DefaultLeafGridView\n-DefaultLeafGridView(const Grid &grid)\n-Definition defaultgridview.hh:288\n-Dune::DefaultLeafGridView::overlapSize\n-int overlapSize(int codim) const\n-Return size of the overlap region for a given codim on the grid view.\n-Definition defaultgridview.hh:369\n-Dune::DefaultLeafGridView::begin\n-Codim< cd >::Iterator begin() const\n-obtain begin iterator for this view\n-Definition defaultgridview.hh:322\n-Dune::DefaultLeafGridView::ghostSize\n-int ghostSize(int codim) const\n-Return size of the ghost region for a given codim on the grid view.\n-Definition defaultgridview.hh:375\n-Dune::DefaultLeafGridView::size\n-int size(int codim) const\n-obtain number of entities in a given codimension\n-Definition defaultgridview.hh:309\n-Dune::DefaultLeafGridView::indexSet\n-const IndexSet & indexSet() const\n-obtain the index set\n-Definition defaultgridview.hh:300\n-Dune::DefaultLeafGridView::IntersectionIterator\n-Traits::IntersectionIterator IntersectionIterator\n-type of the intersection iterator\n-Definition defaultgridview.hh:276\n-Dune::DefaultLeafGridView::conforming\n-static constexpr bool conforming\n-Definition defaultgridview.hh:285\n-Dune::DefaultLevelGridViewTraits\n-Definition defaultgridview.hh:26\n-Dune::DefaultLevelGridViewTraits::Communication\n-Grid::Traits::Communication Communication\n-type of the communication\n-Definition defaultgridview.hh:43\n-Dune::DefaultLevelGridViewTraits::conforming\n-static constexpr bool conforming\n-Definition defaultgridview.hh:69\n-Dune::DefaultLevelGridViewTraits::Intersection\n-Grid::Traits::LevelIntersection Intersection\n-type of the intersection\n-Definition defaultgridview.hh:36\n-Dune::DefaultLevelGridViewTraits::IntersectionIterator\n-Grid::Traits::LevelIntersectionIterator IntersectionIterator\n-type of the intersection iterator\n-Definition defaultgridview.hh:40\n-Dune::DefaultLevelGridViewTraits::IndexSet\n-Grid::Traits::LevelIndexSet IndexSet\n-type of the index set\n-Definition defaultgridview.hh:33\n-Dune::DefaultLevelGridViewTraits::Grid\n-std::remove_const< GridImp >::type Grid\n-type of the grid\n-Definition defaultgridview.hh:30\n-Dune::DefaultLevelGridViewTraits::GridViewImp\n-DefaultLevelGridView< GridImp > GridViewImp\n-Definition defaultgridview.hh:27\n-Dune::DefaultLevelGridViewTraits::Codim\n-Definition defaultgridview.hh:47\n-Dune::DefaultLevelGridViewTraits::Codim::Iterator\n-Grid::Traits::template Codim< cd >::template Partition< All_Partition >::\n-LevelIterator Iterator\n-Definition defaultgridview.hh:50\n-Dune::DefaultLevelGridViewTraits::Codim::Entity\n-Grid::Traits::template Codim< cd >::Entity Entity\n-Definition defaultgridview.hh:52\n-Dune::DefaultLevelGridViewTraits::Codim::Geometry\n-Grid::template Codim< cd >::Geometry Geometry\n-Definition defaultgridview.hh:54\n-Dune::DefaultLevelGridViewTraits::Codim::LocalGeometry\n-Grid::template Codim< cd >::LocalGeometry LocalGeometry\n-Definition defaultgridview.hh:56\n-Dune::DefaultLevelGridViewTraits::Codim::Partition\n-Define types needed to iterate over entities of a given partition type.\n-Definition defaultgridview.hh:61\n-Dune::DefaultLevelGridViewTraits::Codim::Partition::Iterator\n-Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator\n-iterator over a given codim and partition type\n-Definition defaultgridview.hh:65\n-Dune::DefaultLevelGridView::Codim\n-Codim Structure.\n-Definition defaultgridview.hh:98\n-Dune::DefaultLeafGridViewTraits\n-Definition defaultgridview.hh:211\n-Dune::DefaultLeafGridViewTraits::Grid\n-std::remove_const< GridImp >::type Grid\n-type of the grid\n-Definition defaultgridview.hh:215\n-Dune::DefaultLeafGridViewTraits::GridViewImp\n-DefaultLeafGridView< GridImp > GridViewImp\n-Definition defaultgridview.hh:212\n-Dune::DefaultLeafGridViewTraits::conforming\n-static constexpr bool conforming\n-Definition defaultgridview.hh:254\n-Dune::DefaultLeafGridViewTraits::IntersectionIterator\n-Grid::Traits::LeafIntersectionIterator IntersectionIterator\n-type of the intersection iterator\n-Definition defaultgridview.hh:225\n-Dune::DefaultLeafGridViewTraits::Intersection\n-Grid::Traits::LeafIntersection Intersection\n-type of the intersection\n-Definition defaultgridview.hh:221\n-Dune::DefaultLeafGridViewTraits::IndexSet\n-Grid::Traits::LeafIndexSet IndexSet\n-type of the index set\n-Definition defaultgridview.hh:218\n-Dune::DefaultLeafGridViewTraits::Communication\n-Grid::Traits::Communication Communication\n-type of the communication\n-Definition defaultgridview.hh:228\n-Dune::DefaultLeafGridViewTraits::Codim\n-Definition defaultgridview.hh:232\n-Dune::DefaultLeafGridViewTraits::Codim::Iterator\n-Grid::Traits::template Codim< cd >::template Partition< All_Partition >::\n-LeafIterator Iterator\n-Definition defaultgridview.hh:235\n-Dune::DefaultLeafGridViewTraits::Codim::Entity\n-Grid::Traits::template Codim< cd >::Entity Entity\n-Definition defaultgridview.hh:237\n-Dune::DefaultLeafGridViewTraits::Codim::Geometry\n-Grid::template Codim< cd >::Geometry Geometry\n-Definition defaultgridview.hh:239\n-Dune::DefaultLeafGridViewTraits::Codim::LocalGeometry\n-Grid::template Codim< cd >::LocalGeometry LocalGeometry\n-Definition defaultgridview.hh:241\n-Dune::DefaultLeafGridViewTraits::Codim::Partition\n-Define types needed to iterate over entities of a given partition type.\n-Definition defaultgridview.hh:246\n-Dune::DefaultLeafGridViewTraits::Codim::Partition::Iterator\n-Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator\n-iterator over a given codim and partition type\n-Definition defaultgridview.hh:250\n-Dune::DefaultLeafGridView::Codim\n-Codim Structure.\n-Definition defaultgridview.hh:283\n-Dune::IntersectionIterator\n-Mesh entities of codimension 0 (\"elements\") allow to visit all intersections\n-with \"neighboring\" eleme...\n-Definition common/intersectioniterator.hh:83\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-capabilities.hh\n-A set of traits classes to store static information about grid implementation.\n-gridview.hh\n+Dune::BoundarySegment::ObjectStreamType\n+BaseType::ObjectStreamType ObjectStreamType\n+Definition boundarysegment.hh:98\n+Dune::BoundarySegment::ThisType\n+BoundarySegment< dim, dimworld, ctype > ThisType\n+Definition boundarysegment.hh:95\n+Dune::BoundarySegment::backup\n+virtual void backup(ObjectStreamType &buffer) const\n+write BoundarySegment's data to stream buffer\n+Definition boundarysegment.hh:114\n+Dune::BoundarySegment::BaseType\n+BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > >\n+BaseType\n+Definition boundarysegment.hh:96\n+Dune::BoundarySegment::operator()\n+virtual FieldVector< ctype, dimworld > operator()(const FieldVector< ctype,\n+dim-1 > &local) const =0\n+A function mapping local coordinates on a boundary segment to world\n+coordinates.\n+Dune::BoundarySegment::~BoundarySegment\n+virtual ~BoundarySegment()\n+Dummy virtual destructor.\n+Definition boundarysegment.hh:104\n+Dune::BoundarySegmentBackupRestore\n+Definition boundarysegment.hh:41\n+Dune::BoundarySegmentBackupRestore::restore\n+static std::unique_ptr< BoundarySegment > restore(ObjectStreamType &in)\n+create an object of BoundarySegment type from a previously registered factory\n+linked to key.\n+Definition boundarysegment.hh:59\n+Dune::BoundarySegmentBackupRestore::FactoryType\n+Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >\n+(ObjectStreamType &), int > FactoryType\n+type of factory creating a unique_ptr from an ObjectStreamType\n+Definition boundarysegment.hh:51\n+Dune::BoundarySegmentBackupRestore::BoundarySegment\n+BndSeg BoundarySegment\n+type of BoundarySegment interface class\n+Definition boundarysegment.hh:48\n+Dune::BoundarySegmentBackupRestore::ObjectStreamType\n+std::stringstream ObjectStreamType\n+Definition boundarysegment.hh:44\n+Dune::BoundarySegmentBackupRestore::registerFactory\n+static int registerFactory()\n+Definition boundarysegment.hh:70\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00353.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00353.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: sizecache.hh File Reference\n+dune-grid: exceptions.hh File Reference\n \n \n \n \n \n \n \n@@ -72,48 +72,33 @@\n
  • dune
  • grid
  • common
  • \n
    \n
    \n
    \n \n-
    sizecache.hh File Reference
    \n+
    exceptions.hh File Reference
    \n
    \n
    \n-\n-

    Provides size cache classes to implement the grids size method efficiently. \n-More...

    \n-
    #include <cassert>
    \n-#include <vector>
    \n-#include <set>
    \n-#include <utility>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/common/capabilities.hh>
    \n+
    #include <dune/common/exceptions.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::SizeCache< GridImp >
     organizes the caching of sizes for one grid and one GeometryType More...
    class  Dune::GridError
     Base class for exceptions in Dune grid modules. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-

    Detailed Description

    \n-

    Provides size cache classes to implement the grids size method efficiently.

    \n-
    Author
    Robert Kloefkorn
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,36 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n Classes | Namespaces\n-sizecache.hh File Reference\n-Provides size cache classes to implement the grids size method efficiently.\n-More...\n-#include \n-#include \n-#include \n-#include \n+exceptions.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::SizeCache<_GridImp_>\n-\u00a0 organizes the caching of sizes for one grid and one GeometryType\n- More...\n+class \u00a0 Dune::GridError\n+\u00a0 Base class for exceptions in Dune grid modules. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Provides size cache classes to implement the grids size method efficiently.\n- Author\n- Robert Kloefkorn\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00353_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00353_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: sizecache.hh Source File\n+dune-grid: exceptions.hh Source File\n \n \n \n \n \n \n \n@@ -74,385 +74,43 @@\n \n
    \n \n
    \n \n
    \n-
    sizecache.hh
    \n+
    exceptions.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_COMMON_SIZECACHE_HH
    \n-
    6#define DUNE_GRID_COMMON_SIZECACHE_HH
    \n+
    5#ifndef DUNE_GRID_COMMON_EXCEPTIONS_HH
    \n+
    6#define DUNE_GRID_COMMON_EXCEPTIONS_HH
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9#include <vector>
    \n-
    10#include <set>
    \n-
    11#include <utility>
    \n+
    8#include <dune/common/exceptions.hh>
    \n+
    9
    \n+
    10namespace Dune
    \n+
    11{
    \n
    12
    \n-
    13#include <dune/common/exceptions.hh>
    \n-
    14#include <dune/common/hybridutilities.hh>
    \n+
    13 // GridError
    \n+
    14 // ---------
    \n
    15
    \n-
    16#include <dune/geometry/type.hh>
    \n-
    17#include <dune/geometry/referenceelements.hh>
    \n-
    18
    \n-\n-\n-
    21
    \n-
    28namespace Dune {
    \n-
    29
    \n-
    31 template <class GridImp>
    \n-
    \n-\n-
    33 {
    \n-\n-
    36 constexpr static int dim = GridImp::dimension;
    \n-
    37
    \n-
    39 constexpr static int nCodim = GridImp::dimension + 1;
    \n-
    40
    \n-
    41 // type of grid
    \n-
    42 typedef GridImp GridType;
    \n-
    43
    \n-
    44 // coordinate type
    \n-
    45 typedef typename GridType :: ctype ctype ;
    \n-
    46
    \n-
    47 // stores all sizes of the levels
    \n-
    48 mutable std::vector< int > levelSizes_[nCodim];
    \n-
    49
    \n-
    50 // stores all sizes of the levels
    \n-
    51 mutable std::vector< std::vector< int > > levelTypeSizes_[nCodim];
    \n-
    52
    \n-
    53 // stores all sizes of leafs
    \n-
    54 mutable int leafSizes_[nCodim];
    \n-
    55
    \n-
    56 // stores all sizes of leafs
    \n-
    57 mutable std::vector< int > leafTypeSizes_[nCodim];
    \n-
    58
    \n-
    59 // the grid
    \n-
    60 const GridType & grid_;
    \n-
    61
    \n-
    62 // count elements of set by iterating the grid
    \n-
    63 template < int codim, bool gridHasCodim >
    \n-
    64 struct CountLevelEntitiesBase
    \n-
    65 {
    \n-
    66 template < class SzCacheType >
    \n-
    67 static void apply(const SzCacheType & sc, int level, int cd)
    \n-
    68 {
    \n-
    69 if( cd == codim )
    \n-
    70 {
    \n-
    71 sc.template countLevelEntities<All_Partition,codim> (level);
    \n-
    72 }
    \n-
    73 }
    \n-
    74 };
    \n-
    75
    \n-
    76 template < int codim >
    \n-
    77 struct CountLevelEntitiesBase< codim, false >
    \n-
    78 {
    \n-
    79 template < class SzCacheType >
    \n-
    80 static void apply(const SzCacheType & sc, int level, int cd)
    \n-
    81 {
    \n-
    82 if( cd == codim )
    \n-
    83 {
    \n-
    84 sc.template countLevelEntitiesNoCodim<All_Partition,codim> (level);
    \n-
    85 }
    \n-
    86 }
    \n-
    87 };
    \n-
    88
    \n-
    89 template < int codim >
    \n-
    90 struct CountLevelEntities
    \n-
    91 : public CountLevelEntitiesBase< codim, Capabilities :: hasEntity< GridType, codim > :: v >
    \n-
    92 {};
    \n-
    93
    \n-
    94 // count elements of set by iterating the grid
    \n-
    95 template < int codim, bool gridHasCodim >
    \n-
    96 struct CountLeafEntitiesBase
    \n-
    97 {
    \n-
    98 template <class SzCacheType>
    \n-
    99 static void apply(const SzCacheType & sc, int cd)
    \n-
    100 {
    \n-
    101 if( cd == codim )
    \n-
    102 {
    \n-
    103 sc.template countLeafEntities<All_Partition,codim> ();
    \n-
    104 }
    \n-
    105 }
    \n-
    106 };
    \n-
    107
    \n-
    108 // count elements of set by iterating the grid
    \n-
    109 template < int codim >
    \n-
    110 struct CountLeafEntitiesBase< codim, false >
    \n-
    111 {
    \n-
    112 template <class SzCacheType>
    \n-
    113 static void apply(const SzCacheType & sc, int cd)
    \n-
    114 {
    \n-
    115 if( cd == codim )
    \n-
    116 {
    \n-
    117 sc.template countLeafEntitiesNoCodim<All_Partition,codim> ();
    \n-
    118 }
    \n-
    119 }
    \n-
    120 };
    \n-
    121
    \n-
    122 template < int codim >
    \n-
    123 struct CountLeafEntities
    \n-
    124 : public CountLeafEntitiesBase< codim, Capabilities :: hasEntity< GridType, codim > :: v >
    \n-
    125 {};
    \n-
    126
    \n-
    127 int gtIndex( const GeometryType& type ) const
    \n-
    128 {
    \n-
    129 return type.id() >> 1 ;
    \n-
    130 }
    \n-
    131
    \n-
    132 int sizeCodim( const int codim ) const
    \n-
    133 {
    \n-
    134 const int mydim = GridType :: dimension - codim;
    \n-
    135 return ((1 << mydim) + 1) / 2;
    \n-
    136 }
    \n-
    137
    \n-
    138 // private copy constructor
    \n-
    139 SizeCache (const SizeCache & );
    \n-
    140 public:
    \n-
    \n-
    142 SizeCache (const GridType & grid) : grid_( grid )
    \n-
    143 {
    \n-
    144 reset();
    \n-
    145 }
    \n-
    \n-
    146
    \n-
    \n-
    148 void reset()
    \n-
    149 {
    \n-
    150 for(int codim=0; codim<nCodim; ++codim)
    \n-
    151 {
    \n-
    152 leafSizes_[ codim ] = -1;
    \n-
    153 leafTypeSizes_[ codim ].resize( sizeCodim( codim ), -1 );
    \n-
    154 }
    \n-
    155
    \n-
    156 const int numMxl = grid_.maxLevel()+1;
    \n-
    157 for(int codim=0; codim<nCodim; ++codim)
    \n-
    158 {
    \n-
    159 std::vector<int> & vec = levelSizes_[codim];
    \n-
    160 vec.resize(numMxl);
    \n-
    161 levelTypeSizes_[codim].resize( numMxl );
    \n-
    162 for(int level = 0; level<numMxl; ++level)
    \n-
    163 {
    \n-
    164 vec[level] = -1;
    \n-
    165 levelTypeSizes_[codim][level].resize( sizeCodim( codim ), -1 );
    \n-
    166 }
    \n-
    167 }
    \n-
    168 }
    \n-
    \n-
    169
    \n-
    170 //********************************************************************
    \n-
    171 // level sizes
    \n-
    172 //********************************************************************
    \n-
    \n-
    174 int size (int level, int codim) const
    \n-
    175 {
    \n-
    176 assert( codim >= 0 );
    \n-
    177 assert( codim < nCodim );
    \n-
    178 assert( level >= 0 );
    \n-
    179 if( level >= (int) levelSizes_[codim].size() ) return 0;
    \n-
    180
    \n-
    181 if( levelSizes_[codim][level] < 0)
    \n-
    182 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLevelEntities< i >::apply( *this, level, codim ); } );
    \n-
    183
    \n-
    184 // CountLevelEntities<ThisType,All_Partition,dim>::count(*this,level,codim);
    \n-
    185
    \n-
    186 assert( levelSizes_[codim][level] >= 0 );
    \n-
    187 return levelSizes_[codim][level];
    \n-
    188 }
    \n-
    \n-
    189
    \n-
    \n-
    191 int size (int level, GeometryType type) const
    \n-
    192 {
    \n-
    193 int codim = GridType ::dimension - type.dim();
    \n-
    194 if( levelSizes_[codim][level] < 0)
    \n-
    195 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLevelEntities< i >::apply( *this, level, codim ); } );
    \n-
    196
    \n-
    197 assert( levelTypeSizes_[codim][level][gtIndex( type )] >= 0 );
    \n-
    198 return levelTypeSizes_[codim][level][gtIndex( type )];
    \n-
    199 }
    \n+
    \n+\n+
    19 : public Exception
    \n+
    20 {};
    \n
    \n-
    200
    \n-
    201 //********************************************************************
    \n-
    202 // leaf sizes
    \n-
    203 //********************************************************************
    \n-
    \n-
    205 int size (int codim) const
    \n-
    206 {
    \n-
    207 assert( codim >= 0 );
    \n-
    208 assert( codim < nCodim );
    \n-
    209 if( leafSizes_[codim] < 0 )
    \n-
    210 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLeafEntities< i >::apply( *this, codim ); } );
    \n-
    211
    \n-
    212 assert( leafSizes_[codim] >= 0 );
    \n-
    213 return leafSizes_[codim];
    \n-
    214 };
    \n-
    \n-
    215
    \n-
    \n-
    217 int size ( const GeometryType type ) const
    \n-
    218 {
    \n-
    219 int codim = GridType :: dimension - type.dim();
    \n-
    220 if( leafSizes_[codim] < 0 )
    \n-
    221 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CountLeafEntities< i >::apply( *this, codim ); } );
    \n-
    222
    \n-
    223 assert( leafTypeSizes_[codim][ gtIndex( type )] >= 0 );
    \n-
    224 return leafTypeSizes_[codim][ gtIndex( type )];
    \n-
    225 }
    \n-
    \n-
    226
    \n-
    227 private:
    \n-
    228 template <PartitionIteratorType pitype, int codim>
    \n-
    229 void countLevelEntities(int level) const
    \n-
    230 {
    \n-
    231 typedef typename GridType :: LevelGridView GridView ;
    \n-
    232 typedef typename GridView :: template Codim< codim > :: template Partition<pitype> :: Iterator Iterator ;
    \n-
    233 GridView gridView = grid_.levelGridView( level );
    \n-
    234 Iterator it = gridView.template begin<codim,pitype> ();
    \n-
    235 Iterator end = gridView.template end<codim,pitype> ();
    \n-
    236 levelSizes_[codim][level] = countElements(it,end, levelTypeSizes_[codim][level]);
    \n-
    237 }
    \n-
    238
    \n-
    239 template <PartitionIteratorType pitype, int codim>
    \n-
    240 void countLeafEntities() const
    \n-
    241 {
    \n-
    242 // count All_Partition entities
    \n-
    243 typedef typename GridType :: LeafGridView GridView ;
    \n-
    244 typedef typename GridView :: template Codim< codim > :: template Partition<pitype> :: Iterator Iterator ;
    \n-
    245 GridView gridView = grid_.leafGridView();
    \n-
    246 Iterator it = gridView.template begin<codim,pitype> ();
    \n-
    247 Iterator end = gridView.template end<codim,pitype> ();
    \n-
    248 leafSizes_[codim] = countElements(it,end, leafTypeSizes_[codim] );
    \n-
    249 }
    \n-
    250
    \n-
    251 // counts entities with given type for given iterator
    \n-
    252 template <class IteratorType>
    \n-
    253 int countElements(IteratorType & it, const IteratorType & end, std::vector<int>& typeSizes) const
    \n-
    254 {
    \n-
    255 int overall = 0;
    \n-
    256 const size_t types = typeSizes.size();
    \n-
    257 for(size_t i=0; i<types; ++i) typeSizes[i] = 0;
    \n-
    258 for( ; it != end; ++it )
    \n-
    259 {
    \n-
    260 const GeometryType type = it->type();
    \n-
    261 ++typeSizes[ gtIndex( type ) ];
    \n-
    262 ++overall;
    \n-
    263 }
    \n-
    264
    \n-
    265#ifndef NDEBUG
    \n-
    266 int sumtypes = 0;
    \n-
    267 for(size_t i=0; i<types; ++i)
    \n-
    268 sumtypes += typeSizes[i];
    \n-
    269
    \n-
    270 assert( overall == sumtypes );
    \n-
    271#endif
    \n-
    272
    \n-
    273 return overall;
    \n-
    274 }
    \n-
    275
    \n-
    276 template <PartitionIteratorType pitype, int codim>
    \n-
    277 void countLevelEntitiesNoCodim(int level) const
    \n-
    278 {
    \n-
    279 typedef typename GridType :: LevelGridView GridView ;
    \n-
    280 typedef typename GridView :: template Codim< 0 > :: template Partition<pitype> :: Iterator Iterator ;
    \n-
    281 GridView gridView = grid_.levelGridView( level );
    \n-
    282 Iterator it = gridView.template begin< 0, pitype> ();
    \n-
    283 Iterator end = gridView.template end< 0, pitype> ();
    \n-
    284 levelSizes_[codim][level] = countElementsNoCodim< codim >(it,end, levelTypeSizes_[codim][level]);
    \n-
    285 }
    \n-
    286
    \n-
    287 template <PartitionIteratorType pitype, int codim>
    \n-
    288 void countLeafEntitiesNoCodim() const
    \n-
    289 {
    \n-
    290 // count All_Partition entities
    \n-
    291 typedef typename GridType :: LeafGridView GridView ;
    \n-
    292 typedef typename GridView :: template Codim< 0 > :: template Partition<pitype> :: Iterator Iterator ;
    \n-
    293 GridView gridView = grid_.leafGridView();
    \n-
    294 Iterator it = gridView.template begin< 0, pitype > ();
    \n-
    295 Iterator end = gridView.template end< 0, pitype > ();
    \n-
    296 leafSizes_[codim] = countElementsNoCodim< codim >(it,end, leafTypeSizes_[codim] );
    \n-
    297 }
    \n-
    298
    \n-
    299 // counts entities with given type for given iterator
    \n-
    300 template < int codim, class IteratorType >
    \n-
    301 int countElementsNoCodim(IteratorType & it, const IteratorType & end, std::vector<int>& typeSizes) const
    \n-
    302 {
    \n-
    303 typedef typename GridType :: LocalIdSet LocalIdSet ;
    \n-
    304 typedef typename LocalIdSet :: IdType IdType ;
    \n-
    305
    \n-
    306 typedef ReferenceElements< ctype, dim > ReferenceElementContainerType;
    \n-
    307 typedef typename ReferenceElementContainerType::ReferenceElement ReferenceElementType;
    \n-
    308
    \n-
    309 typedef std::set< IdType > CodimIdSetType ;
    \n-
    310
    \n-
    311 typedef typename IteratorType :: Entity ElementType ;
    \n-
    312
    \n-
    313 // get id set
    \n-
    314 const LocalIdSet& idSet = grid_.localIdSet();
    \n-
    315
    \n-
    316 const size_t types = typeSizes.size();
    \n-
    317 for(size_t i=0; i<types; ++i) typeSizes[ i ] = 0;
    \n-
    318
    \n-
    319 std::vector< CodimIdSetType > typeCount( types );
    \n-
    320
    \n-
    321 // count all elements of codimension codim
    \n-
    322 for( ; it != end; ++it )
    \n-
    323 {
    \n-
    324 // get entity
    \n-
    325 const ElementType& element = *it ;
    \n-
    326 // get reference element
    \n-
    327 ReferenceElementType refElem =
    \n-
    328 ReferenceElementContainerType :: general( element.type() );
    \n-
    329
    \n-
    330 // count all sub entities of codimension codim
    \n-
    331 const int count = element.subEntities( codim );
    \n-
    332 for( int i=0; i< count; ++ i )
    \n-
    333 {
    \n-
    334 // get geometry type
    \n-
    335 const GeometryType geomType = refElem.type( i, codim );
    \n-
    336 // get id of sub entity
    \n-
    337 const IdType id = idSet.subId( element, i, codim );
    \n-
    338 // insert id into set
    \n-
    339 typeCount[ gtIndex( geomType ) ].insert( id );
    \n-
    340 }
    \n-
    341 }
    \n-
    342
    \n-
    343 // accumulate numbers
    \n-
    344 int overall = 0;
    \n-
    345 for(size_t i=0; i<types; ++i)
    \n-
    346 {
    \n-
    347 typeSizes[ i ] = typeCount[ i ].size();
    \n-
    348 overall += typeSizes[ i ];
    \n-
    349 }
    \n-
    350
    \n-
    351 return overall;
    \n-
    352 }
    \n-
    353 };
    \n-
    \n-
    354
    \n-
    355} // end namespace Dune
    \n-
    356#endif
    \n-\n+
    21
    \n+
    22}
    \n+
    23
    \n+
    24#endif // #ifndef DUNE_GRID_COMMON_EXCEPTIONS_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    U_CHAR ElementType
    Definition misc.hh:63
    \n-
    GeometryType
    Type representing VTK's entity geometry types.
    Definition common.hh:132
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    organizes the caching of sizes for one grid and one GeometryType
    Definition sizecache.hh:33
    \n-
    int size(int level, GeometryType type) const
    Return number of entities per level and geometry type in this process.
    Definition sizecache.hh:191
    \n-
    int size(int level, int codim) const
    Return number of grid entities of a given codim on a given level in this process.
    Definition sizecache.hh:174
    \n-
    int size(int codim) const
    Return number of leaf entities of a given codim in this process.
    Definition sizecache.hh:205
    \n-
    SizeCache(const GridType &grid)
    constructor taking grid reference
    Definition sizecache.hh:142
    \n-
    int size(const GeometryType type) const
    Return number of leaf entities per geometry type in this process.
    Definition sizecache.hh:217
    \n-
    void reset()
    reset all cached sizes
    Definition sizecache.hh:148
    \n-
    A set of traits classes to store static information about grid implementation.
    \n+
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,414 +1,40 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n-sizecache.hh\n+exceptions.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_COMMON_SIZECACHE_HH\n-6#define DUNE_GRID_COMMON_SIZECACHE_HH\n+5#ifndef DUNE_GRID_COMMON_EXCEPTIONS_HH\n+6#define DUNE_GRID_COMMON_EXCEPTIONS_HH\n 7\n-8#include \n-9#include \n-10#include \n-11#include \n+8#include \n+9\n+10namespace Dune\n+11{\n 12\n-13#include \n-14#include \n+13 // GridError\n+14 // ---------\n 15\n-16#include \n-17#include \n-18\n-19#include \n-20#include \n+18 class GridError\n+19 : public Exception\n+20 {};\n 21\n-28namespace Dune {\n-29\n-31 template \n-32 class SizeCache\n-33 {\n-34 typedef SizeCache ThisType;\n-36 constexpr static int dim = GridImp::dimension;\n-37\n-39 constexpr static int nCodim = GridImp::dimension + 1;\n-40\n-41 // type of grid\n-42 typedef GridImp GridType;\n-43\n-44 // coordinate type\n-45 typedef typename GridType :: ctype ctype ;\n-46\n-47 // stores all sizes of the levels\n-48 mutable std::vector< int > levelSizes_[nCodim];\n-49\n-50 // stores all sizes of the levels\n-51 mutable std::vector< std::vector< int > > levelTypeSizes_[nCodim];\n-52\n-53 // stores all sizes of leafs\n-54 mutable int leafSizes_[nCodim];\n-55\n-56 // stores all sizes of leafs\n-57 mutable std::vector< int > leafTypeSizes_[nCodim];\n-58\n-59 // the grid\n-60 const GridType & grid_;\n-61\n-62 // count elements of set by iterating the grid\n-63 template < int codim, bool gridHasCodim >\n-64 struct CountLevelEntitiesBase\n-65 {\n-66 template < class SzCacheType >\n-67 static void apply(const SzCacheType & sc, int level, int cd)\n-68 {\n-69 if( cd == codim )\n-70 {\n-71 sc.template countLevelEntities (level);\n-72 }\n-73 }\n-74 };\n-75\n-76 template < int codim >\n-77 struct CountLevelEntitiesBase< codim, false >\n-78 {\n-79 template < class SzCacheType >\n-80 static void apply(const SzCacheType & sc, int level, int cd)\n-81 {\n-82 if( cd == codim )\n-83 {\n-84 sc.template countLevelEntitiesNoCodim (level);\n-85 }\n-86 }\n-87 };\n-88\n-89 template < int codim >\n-90 struct CountLevelEntities\n-91 : public CountLevelEntitiesBase< codim, Capabilities :: hasEntity< GridType,\n-codim > :: v >\n-92 {};\n-93\n-94 // count elements of set by iterating the grid\n-95 template < int codim, bool gridHasCodim >\n-96 struct CountLeafEntitiesBase\n-97 {\n-98 template \n-99 static void apply(const SzCacheType & sc, int cd)\n-100 {\n-101 if( cd == codim )\n-102 {\n-103 sc.template countLeafEntities ();\n-104 }\n-105 }\n-106 };\n-107\n-108 // count elements of set by iterating the grid\n-109 template < int codim >\n-110 struct CountLeafEntitiesBase< codim, false >\n-111 {\n-112 template \n-113 static void apply(const SzCacheType & sc, int cd)\n-114 {\n-115 if( cd == codim )\n-116 {\n-117 sc.template countLeafEntitiesNoCodim ();\n-118 }\n-119 }\n-120 };\n-121\n-122 template < int codim >\n-123 struct CountLeafEntities\n-124 : public CountLeafEntitiesBase< codim, Capabilities :: hasEntity< GridType,\n-codim > :: v >\n-125 {};\n-126\n-127 int gtIndex( const GeometryType& type ) const\n-128 {\n-129 return type.id() >> 1 ;\n-130 }\n-131\n-132 int sizeCodim( const int codim ) const\n-133 {\n-134 const int mydim = GridType :: dimension - codim;\n-135 return ((1 << mydim) + 1) / 2;\n-136 }\n-137\n-138 // private copy constructor\n-139 SizeCache (const SizeCache & );\n-140 public:\n-142 SizeCache (const GridType & grid) : grid_( grid )\n-143 {\n-144 reset();\n-145 }\n-146\n-148 void reset()\n-149 {\n-150 for(int codim=0; codim & vec = levelSizes_[codim];\n-160 vec.resize(numMxl);\n-161 levelTypeSizes_[codim].resize( numMxl );\n-162 for(int level = 0; level= 0 );\n-177 assert( codim < nCodim );\n-178 assert( level >= 0 );\n-179 if( level >= (int) levelSizes_[codim].size() ) return 0;\n-180\n-181 if( levelSizes_[codim][level] < 0)\n-182 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n-{ CountLevelEntities< i >::apply( *this, level, codim ); } );\n-183\n-184 // CountLevelEntities::count\n-(*this,level,codim);\n-185\n-186 assert( levelSizes_[codim][level] >= 0 );\n-187 return levelSizes_[codim][level];\n-188 }\n-189\n-191 int size (int level, GeometryType type) const\n-192 {\n-193 int codim = GridType ::dimension - type.dim();\n-194 if( levelSizes_[codim][level] < 0)\n-195 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n-{ CountLevelEntities< i >::apply( *this, level, codim ); } );\n-196\n-197 assert( levelTypeSizes_[codim][level][gtIndex( type )] >= 0 );\n-198 return levelTypeSizes_[codim][level][gtIndex( type )];\n-199 }\n-200\n-201 //********************************************************************\n-202 // leaf sizes\n-203 //********************************************************************\n-205 int size (int codim) const\n-206 {\n-207 assert( codim >= 0 );\n-208 assert( codim < nCodim );\n-209 if( leafSizes_[codim] < 0 )\n-210 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n-{ CountLeafEntities< i >::apply( *this, codim ); } );\n-211\n-212 assert( leafSizes_[codim] >= 0 );\n-213 return leafSizes_[codim];\n-214 };\n-215\n-217 int size ( const GeometryType type ) const\n-218 {\n-219 int codim = GridType :: dimension - type.dim();\n-220 if( leafSizes_[codim] < 0 )\n-221 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n-{ CountLeafEntities< i >::apply( *this, codim ); } );\n-222\n-223 assert( leafTypeSizes_[codim][ gtIndex( type )] >= 0 );\n-224 return leafTypeSizes_[codim][ gtIndex( type )];\n-225 }\n-226\n-227 private:\n-228 template \n-229 void countLevelEntities(int level) const\n-230 {\n-231 typedef typename GridType :: LevelGridView GridView ;\n-232 typedef typename GridView :: template Codim< codim > :: template\n-Partition :: Iterator Iterator ;\n-233 GridView gridView = grid_.levelGridView( level );\n-234 Iterator it = gridView.template begin ();\n-235 Iterator end = gridView.template end ();\n-236 levelSizes_[codim][level] = countElements(it,end, levelTypeSizes_[codim]\n-[level]);\n-237 }\n-238\n-239 template \n-240 void countLeafEntities() const\n-241 {\n-242 // count All_Partition entities\n-243 typedef typename GridType :: LeafGridView GridView ;\n-244 typedef typename GridView :: template Codim< codim > :: template\n-Partition :: Iterator Iterator ;\n-245 GridView gridView = grid_.leafGridView();\n-246 Iterator it = gridView.template begin ();\n-247 Iterator end = gridView.template end ();\n-248 leafSizes_[codim] = countElements(it,end, leafTypeSizes_[codim] );\n-249 }\n-250\n-251 // counts entities with given type for given iterator\n-252 template \n-253 int countElements(IteratorType & it, const IteratorType & end, std::\n-vector& typeSizes) const\n-254 {\n-255 int overall = 0;\n-256 const size_t types = typeSizes.size();\n-257 for(size_t i=0; itype();\n-261 ++typeSizes[ gtIndex( type ) ];\n-262 ++overall;\n-263 }\n-264\n-265#ifndef NDEBUG\n-266 int sumtypes = 0;\n-267 for(size_t i=0; i\n-277 void countLevelEntitiesNoCodim(int level) const\n-278 {\n-279 typedef typename GridType :: LevelGridView GridView ;\n-280 typedef typename GridView :: template Codim< 0 > :: template\n-Partition :: Iterator Iterator ;\n-281 GridView gridView = grid_.levelGridView( level );\n-282 Iterator it = gridView.template begin< 0, pitype> ();\n-283 Iterator end = gridView.template end< 0, pitype> ();\n-284 levelSizes_[codim][level] = countElementsNoCodim< codim >(it,end,\n-levelTypeSizes_[codim][level]);\n-285 }\n-286\n-287 template \n-288 void countLeafEntitiesNoCodim() const\n-289 {\n-290 // count All_Partition entities\n-291 typedef typename GridType :: LeafGridView GridView ;\n-292 typedef typename GridView :: template Codim< 0 > :: template\n-Partition :: Iterator Iterator ;\n-293 GridView gridView = grid_.leafGridView();\n-294 Iterator it = gridView.template begin< 0, pitype > ();\n-295 Iterator end = gridView.template end< 0, pitype > ();\n-296 leafSizes_[codim] = countElementsNoCodim< codim >(it,end, leafTypeSizes_\n-[codim] );\n-297 }\n-298\n-299 // counts entities with given type for given iterator\n-300 template < int codim, class IteratorType >\n-301 int countElementsNoCodim(IteratorType & it, const IteratorType & end, std::\n-vector& typeSizes) const\n-302 {\n-303 typedef typename GridType :: LocalIdSet LocalIdSet ;\n-304 typedef typename LocalIdSet :: IdType IdType ;\n-305\n-306 typedef ReferenceElements< ctype, dim > ReferenceElementContainerType;\n-307 typedef typename ReferenceElementContainerType::ReferenceElement\n-ReferenceElementType;\n-308\n-309 typedef std::set< IdType > CodimIdSetType ;\n-310\n-311 typedef typename IteratorType :: Entity ElementType ;\n-312\n-313 // get id set\n-314 const LocalIdSet& idSet = grid_.localIdSet();\n-315\n-316 const size_t types = typeSizes.size();\n-317 for(size_t i=0; i typeCount( types );\n-320\n-321 // count all elements of codimension codim\n-322 for( ; it != end; ++it )\n-323 {\n-324 // get entity\n-325 const ElementType& element = *it ;\n-326 // get reference element\n-327 ReferenceElementType refElem =\n-328 ReferenceElementContainerType :: general( element.type() );\n-329\n-330 // count all sub entities of codimension codim\n-331 const int count = element.subEntities( codim );\n-332 for( int i=0; i< count; ++ i )\n-333 {\n-334 // get geometry type\n-335 const GeometryType geomType = refElem.type( i, codim );\n-336 // get id of sub entity\n-337 const IdType id = idSet.subId( element, i, codim );\n-338 // insert id into set\n-339 typeCount[ gtIndex( geomType ) ].insert( id );\n-340 }\n-341 }\n-342\n-343 // accumulate numbers\n-344 int overall = 0;\n-345 for(size_t i=0; i\n \n \n \n \n \n \n-dune-grid: mcmgmapper.hh File Reference\n+dune-grid: rangegenerators.hh File Reference\n \n \n \n \n \n \n \n@@ -70,74 +70,32 @@\n
    \n \n
    \n
    \n
    \n \n-
    mcmgmapper.hh File Reference
    \n+Namespaces
    \n+
    rangegenerators.hh File Reference
    \n \n
    \n-\n-

    Mapper for multiple codim and multiple geometry types. \n-More...

    \n-
    #include <functional>
    \n-#include <iostream>
    \n-#include <dune/common/exceptions.hh>
    \n+
    #include <dune/common/iteratorrange.hh>
    \n #include <dune/common/rangeutilities.hh>
    \n #include <dune/geometry/dimension.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/geometry/typeindex.hh>
    \n-#include "mapper.hh"
    \n+#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/partitionset.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::MultipleCodimMultipleGeomTypeMapper< GV >
     Implementation class for a multiple codim and multiple geometry type mapper. More...
     
    \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n-\n-

    \n-Typedefs

    using Dune::MCMGLayout = std::function< size_t(GeometryType, int)>
     layout function for MultipleCodimMultipleGeomTypeMapper
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

    template<int codim>
    MCMGLayout Dune::mcmgLayout (Codim< codim >)
     layout for entities of codimension codim
     
    template<int dim>
    MCMGLayout Dune::mcmgLayout (Dim< dim >)
     layout for entities of dimension dim
     
    MCMGLayout Dune::mcmgElementLayout ()
     layout for elements (codim-0 entities)
     
    MCMGLayout Dune::mcmgVertexLayout ()
     layout for vertices (dim-0 entities)
     
    \n-

    Detailed Description

    \n-

    Mapper for multiple codim and multiple geometry types.

    \n-
    Author
    Peter Bastian
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,54 +1,21 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n-Classes | Namespaces | Typedefs | Functions\n-mcmgmapper.hh File Reference\n-Mapper for multiple codim and multiple geometry types. More...\n-#include \n-#include \n-#include \n+Namespaces\n+rangegenerators.hh File Reference\n+#include \n #include \n #include \n-#include \n-#include \n-#include \n-#include \"mapper.hh\"\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::MultipleCodimMultipleGeomTypeMapper<_GV_>\n-\u00a0 Implementation class for a multiple codim and multiple geometry type\n- mapper. More...\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-Typedefs\n-using\u00a0 Dune::MCMGLayout = std::function< size_t(GeometryType, int)>\n-\u00a0 layout function for MultipleCodimMultipleGeomTypeMapper\n-\u00a0\n-Functions\n-template\n-MCMGLayout\u00a0 Dune::mcmgLayout (Codim< codim >)\n-\u00a0 layout for entities of codimension codim\n-\u00a0\n-template\n-MCMGLayout\u00a0 Dune::mcmgLayout (Dim< dim >)\n-\u00a0 layout for entities of dimension dim\n-\u00a0\n-MCMGLayout\u00a0 Dune::mcmgElementLayout ()\n-\u00a0 layout for elements (codim-0 entities)\n-\u00a0\n-MCMGLayout\u00a0 Dune::mcmgVertexLayout ()\n-\u00a0 layout for vertices (dim-0 entities)\n-\u00a0\n-***** Detailed Description *****\n-Mapper for multiple codim and multiple geometry types.\n- Author\n- Peter Bastian\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00362_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00362_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: mcmgmapper.hh Source File\n+dune-grid: rangegenerators.hh Source File\n \n \n \n \n \n \n \n@@ -74,306 +74,302 @@\n \n
    \n \n
    \n \n
    \n-
    mcmgmapper.hh
    \n+
    rangegenerators.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_COMMON_MCMGMAPPER_HH
    \n-
    7#define DUNE_GRID_COMMON_MCMGMAPPER_HH
    \n-
    8
    \n-
    9#include <functional>
    \n-
    10#include <iostream>
    \n-
    11
    \n-
    12#include <dune/common/exceptions.hh>
    \n-
    13#include <dune/common/rangeutilities.hh>
    \n-
    14#include <dune/geometry/dimension.hh>
    \n-
    15#include <dune/geometry/referenceelements.hh>
    \n-
    16#include <dune/geometry/type.hh>
    \n-
    17#include <dune/geometry/typeindex.hh>
    \n+
    5#ifndef DUNE_GRID_COMMON_RANGEGENERATORS_HH
    \n+
    6#define DUNE_GRID_COMMON_RANGEGENERATORS_HH
    \n+
    7
    \n+
    8#include <dune/common/iteratorrange.hh>
    \n+
    9#include <dune/common/rangeutilities.hh>
    \n+
    10#include <dune/geometry/dimension.hh>
    \n+\n+\n+
    13
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17#ifdef DOXYGEN
    \n
    18
    \n-
    19#include "mapper.hh"
    \n-
    20
    \n-
    27namespace Dune
    \n-
    28{
    \n-
    36 //
    \n-
    37 // Common Layout templates
    \n-
    38 //
    \n-
    39
    \n-
    64 using MCMGLayout = std::function<size_t(GeometryType, int)>;
    \n-
    65
    \n-
    71 template<int codim>
    \n-
    \n-
    72 MCMGLayout mcmgLayout(Codim<codim>)
    \n-
    73 {
    \n-
    74 return [](GeometryType gt, int dimgrid) {
    \n-
    75 return dimgrid - gt.dim() == codim;
    \n-
    76 };
    \n-
    77 }
    \n-
    \n-
    78
    \n-
    84 template<int dim>
    \n-
    \n-\n-
    86 {
    \n-
    87 return [](GeometryType gt, int) {
    \n-
    88 return gt.dim() == dim;
    \n-
    89 };
    \n-
    90 }
    \n-
    \n-
    91
    \n-
    \n-\n-
    98 {
    \n-
    99 return mcmgLayout(Codim<0>());
    \n-
    100 }
    \n-
    \n-
    101
    \n-
    \n-\n-
    108 {
    \n-
    109 return mcmgLayout(Dim<0>());
    \n-
    110 }
    \n-
    \n-
    111
    \n-
    113 //
    \n-
    114 // MultipleCodimMultipleGeomTypeMapper
    \n-
    115 //
    \n-
    116
    \n-
    126 template <typename GV>
    \n-
    \n-\n-
    128 public Mapper<typename GV::Grid,MultipleCodimMultipleGeomTypeMapper<GV>, typename GV::IndexSet::IndexType >
    \n-
    129 {
    \n-
    130 public:
    \n-
    131
    \n-
    133 typedef GV GridView;
    \n-
    134
    \n-
    136 typedef typename GV::IndexSet::IndexType Index;
    \n-
    137
    \n-
    142 using size_type = decltype(std::declval<typename GV::IndexSet>().size(0));
    \n-
    143
    \n-
    \n-\n-
    156 : gridView_(gridView)
    \n-
    157 , indexSet_(&gridView_.indexSet())
    \n-
    158 , layout_(layout)
    \n-
    159 {
    \n-\n-
    161 }
    \n-
    \n-
    162
    \n-
    170 template<class EntityType>
    \n-
    \n-
    171 Index index (const EntityType& e) const
    \n-
    172 {
    \n-
    173 const GeometryType gt = e.type();
    \n-
    174 assert(offset(gt) != invalidOffset);
    \n-
    175 return indexSet_->index(e)*blockSize(gt) + offset(gt);
    \n-
    176 }
    \n-
    \n-
    177
    \n-
    \n-
    185 Index subIndex (const typename GV::template Codim<0>::Entity& e, int i, unsigned int codim) const
    \n-
    186 {
    \n-
    187 const GeometryType eType = e.type();
    \n-
    188 GeometryType gt = eType.isNone() ?
    \n-
    189 GeometryTypes::none( GV::dimension - codim ) :
    \n-
    190 ReferenceElements<double,GV::dimension>::general(eType).type(i,codim) ;
    \n-
    191 //GeometryType gt=ReferenceElements<double,GV::dimension>::general(e.type()).type(i,codim);
    \n-
    192 assert(offset(gt) != invalidOffset);
    \n-
    193 return indexSet_->subIndex(e, i, codim)*blockSize(gt) + offset(gt);
    \n-
    194 }
    \n-
    \n-
    195
    \n-
    \n-\n-
    205 {
    \n-
    206 return n;
    \n-
    207 }
    \n-
    \n-
    208
    \n-
    \n-
    210 size_type size(GeometryType gt) const
    \n-
    211 {
    \n-
    212 return blockSize(gt);
    \n-
    213 }
    \n-
    \n-
    214
    \n-
    \n-
    216 const std::vector< GeometryType >& types ( int codim ) const
    \n-
    217 {
    \n-
    218 return myTypes_[ codim ];
    \n-
    219 }
    \n-
    \n+
    206 // *****************************************************************************************
    \n+
    207 // Doxygen documentation
    \n+
    208 // *****************************************************************************************
    \n+
    209 //
    \n+
    210 // In the following, the range generating functions are documented for Doxygen; the actual
    \n+
    211 // implementations are further down in this file and hidden from Doxygen.
    \n+
    212 // The main reason for this split are the return types of those functions, which either contain
    \n+
    213 // long type listings to obtain the iterator type or (in the case of the forwarded functions
    \n+
    214 // use the new-style function syntax and calculate the return type using decltype. In both cases,
    \n+
    215 // Doxygen generates function signatures that are very confusing to the average user.
    \n+
    216 //
    \n+
    217 // *****************************************************************************************
    \n+
    218
    \n+
    219
    \n
    220
    \n-
    230 template<class EntityType>
    \n-
    \n-
    231 IntegralRange<Index> indices (const EntityType& e) const
    \n-
    232 {
    \n-
    233 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)
    \n-
    234 return {0,0};
    \n-
    235 Index start = index(e);
    \n-
    236 return {start, start+blockSize(e.type())};
    \n-
    237 }
    \n-
    \n-
    238
    \n-
    \n-
    250 IntegralRange<Index> indices (const typename GV::template Codim<0>::Entity& e, int i, int cc) const
    \n-
    251 {
    \n-
    252 const GeometryType eType = e.type();
    \n-
    253 const GeometryType gt = eType.isNone() ?
    \n-
    254 GeometryTypes::none(GV::dimension - cc) :
    \n-
    255 ReferenceElements<double,GV::dimension>::general(eType).type(i,cc) ;
    \n-
    256 if (offset(gt) == invalidOffset)
    \n-
    257 return {0,0};
    \n-
    258 else
    \n-
    259 {
    \n-
    260 Index start = subIndex(e,i,cc);
    \n-
    261 return {start, start+blockSize(gt)};
    \n-
    262 }
    \n-
    263 }
    \n-
    \n-
    264
    \n-
    271 template<class EntityType>
    \n-
    \n-
    272 bool contains (const EntityType& e, Index& result) const
    \n-
    273 {
    \n-
    274 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)
    \n-
    275 {
    \n-
    276 result = 0;
    \n-
    277 return false;
    \n-
    278 }
    \n-
    279 result = index(e);
    \n-
    280 return true;
    \n-
    281 }
    \n-
    \n-
    282
    \n-
    \n-
    291 bool contains (const typename GV::template Codim<0>::Entity& e, int i, int cc, Index& result) const
    \n-
    292 {
    \n-
    293 const GeometryType eType = e.type();
    \n-
    294 const GeometryType gt = eType.isNone() ?
    \n-
    295 GeometryTypes::none( GV::dimension - cc ) :
    \n-
    296 ReferenceElements<double,GV::dimension>::general(eType).type(i,cc) ;
    \n-
    297 if (offset(gt) == invalidOffset)
    \n-
    298 return false;
    \n-
    299 result = indexSet_->subIndex(e, i, cc)*blockSize(gt) + offset(gt);
    \n-
    300 return true;
    \n-
    301 }
    \n-
    \n-
    302
    \n-
    \n-
    308 void update (const GV& gridView)
    \n-
    309 {
    \n-
    310 gridView_ = gridView;
    \n-
    311 indexSet_ = &gridView_.indexSet();
    \n-
    312 update_();
    \n-
    313 }
    \n-
    \n-
    314
    \n-
    \n-
    320 void update (GV&& gridView)
    \n-
    321 {
    \n-
    322 gridView_ = std::move(gridView);
    \n-
    323 indexSet_ = &gridView_.indexSet();
    \n-
    324 update_();
    \n-
    325 }
    \n-
    \n+
    224
    \n+
    225
    \n+
    227
    \n+
    256 template<typename GV>
    \n+
    257 inline IteratorRange<...> elements(const GV& gv);
    \n+
    258
    \n+
    259
    \n+
    261
    \n+
    290 template<typename GV>
    \n+
    291 inline IteratorRange<...> facets(const GV& gv);
    \n+
    292
    \n+
    293
    \n+
    295
    \n+
    324 template<typename GV>
    \n+
    325 inline IteratorRange<...> edges(const GV& gv);
    \n
    326
    \n-
    327 const MCMGLayout &layout () const { return layout_; }
    \n-
    328 const GridView &gridView () const { return gridView_; }
    \n+
    327
    \n
    329
    \n-
    330 private:
    \n-
    331 void update_()
    \n-
    332 {
    \n-
    333 n = 0;
    \n-
    334
    \n-
    335 std::fill(offsets.begin(),offsets.end(),Index(0));
    \n-
    336 std::fill(blocks.begin(),blocks.end(),Index(0));
    \n-
    337
    \n-
    338 for (unsigned int codim = 0; codim <= GV::dimension; ++codim)
    \n-
    339 {
    \n-
    340 // walk over all geometry types in the codimension
    \n-
    341 for (const GeometryType& gt : indexSet_->types(codim)) {
    \n-
    342 Index offset;
    \n-
    343 size_t block = layout()(gt, GV::Grid::dimension);
    \n-
    344
    \n-
    345 // if the geometry type is contained in the layout, increment offset
    \n-
    346 // and store geometry type
    \n-
    347 if (block) {
    \n-
    348 offset = n;
    \n-
    349 n += indexSet_->size(gt) * block;
    \n-
    350 myTypes_[codim].push_back(gt);
    \n-
    351 }
    \n-
    352 else {
    \n-
    353 offset = invalidOffset;
    \n-
    354 }
    \n-
    355
    \n-
    356 offsets[GlobalGeometryTypeIndex::index(gt)] = offset;
    \n-
    357 blocks[GlobalGeometryTypeIndex::index(gt)] = block;
    \n-
    358 }
    \n-
    359 }
    \n-
    360 }
    \n+
    358 template<typename GV>
    \n+
    359 inline IteratorRange<...> vertices(const GV& gv);
    \n+
    360
    \n
    361
    \n-
    362 Index offset(GeometryType gt) const
    \n-
    363 { return offsets[GlobalGeometryTypeIndex::index(gt)]; }
    \n-
    364 Index blockSize(GeometryType gt) const
    \n-
    365 { return blocks[GlobalGeometryTypeIndex::index(gt)]; }
    \n-
    366
    \n-
    367 static const Index invalidOffset = std::numeric_limits<Index>::max();
    \n-
    368
    \n-
    369 // number of data elements required
    \n-
    370 unsigned int n;
    \n-
    371 // GridView is needed to keep the IndexSet valid
    \n-
    372 GV gridView_;
    \n-
    373 const typename GV::IndexSet* indexSet_;
    \n-
    374 // provide an array for the offsets
    \n-
    375 std::array<Index, GlobalGeometryTypeIndex::size(GV::dimension)> offsets;
    \n-
    376 std::array<Index, GlobalGeometryTypeIndex::size(GV::dimension)> blocks;
    \n-
    377 MCMGLayout layout_; // get layout object
    \n-
    378 std::vector<GeometryType> myTypes_[GV::dimension+1];
    \n-
    379 };
    \n-
    \n-
    380
    \n-
    382}
    \n-
    383#endif
    \n-
    Provides classes with basic mappers which are used to attach data to a grid.
    \n-
    MCMGLayout mcmgLayout(Codim< codim >)
    layout for entities of codimension codim
    Definition mcmgmapper.hh:72
    \n-
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n-
    std::function< size_t(GeometryType, int)> MCMGLayout
    layout function for MultipleCodimMultipleGeomTypeMapper
    Definition mcmgmapper.hh:64
    \n-
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n+
    363
    \n+
    364
    \n+
    365
    \n+
    369
    \n+
    371
    \n+
    394 template<typename GV, typename Entity>
    \n+
    395 inline IteratorRange<...> intersections(const GV& gv, const Entity& e);
    \n+
    396
    \n+
    397
    \n+
    399
    \n+
    400
    \n+
    401
    \n+
    405
    \n+
    406
    \n+
    408
    \n+
    434 template<typename Entity>
    \n+
    435 inline IteratorRange<...> descendantElements(const Entity& e, int maxLevel);
    \n+
    436 // Entity<int dim, class GridImp, template<int,int,class> class EntityImp>
    \n+
    437
    \n+
    439
    \n+
    440
    \n+
    441
    \n+
    445
    \n+
    446
    \n+
    448
    \n+
    486 template<typename GV, int codim>
    \n+
    487 inline IteratorRange<...> entities(const GV& gv, Codim<codim> cd);
    \n+
    488
    \n+
    489
    \n+
    491
    \n+
    531 template<typename GV, int dim>
    \n+
    532 inline IteratorRange<...> entities(const GV& gv, Dim<dim> d);
    \n+
    533
    \n+
    535
    \n+
    536
    \n+
    537
    \n+
    541
    \n+
    542
    \n+
    544
    \n+
    570 template<typename GV, unsigned int partitions>
    \n+\n+
    572
    \n+
    573
    \n+
    575
    \n+
    604 template<typename GV, unsigned int partitions>
    \n+\n+
    606
    \n+
    607
    \n+
    609
    \n+
    635 template<typename GV, unsigned int partitions>
    \n+\n+
    637
    \n+
    638
    \n+
    640
    \n+
    666 template<typename GV, unsigned int partitions>
    \n+\n+
    668
    \n+
    670
    \n+
    671
    \n+
    672
    \n+
    676
    \n+
    677
    \n+
    679
    \n+
    715 template<typename GV, int codim, unsigned int partitions>
    \n+\n+
    717
    \n+
    718
    \n+
    720
    \n+
    756 template<typename GV, int dim, unsigned int partitions>
    \n+\n+
    758
    \n+
    759
    \n+
    761
    \n+
    782 template<typename E, int codim>
    \n+
    783 inline IteratorRange<...> subEntities(const E& e, Codim<codim> c);
    \n+
    784
    \n+
    785
    \n+
    787
    \n+
    788
    \n+
    789#else // DOXYGEN
    \n+
    790
    \n+
    791 // ******************************************************************************************
    \n+
    792 // Implementations
    \n+
    793 // ******************************************************************************************
    \n+
    794
    \n+
    795
    \n+
    805 template<typename GV, int codim, unsigned int partitions>
    \n+
    806 inline auto entities(const GV& gv, Codim<codim>, PartitionSet<partitions>)
    \n+
    807 -> IteratorRange<decltype(gv.template begin<codim,derive_partition_iterator_type<partitions>::value>())>
    \n+
    808 {
    \n+
    809 static_assert(0 <= codim && codim <= GV::dimension, "invalid codimension for given GridView");
    \n+
    810 const PartitionIteratorType pit = derive_partition_iterator_type<partitions>::value;
    \n+
    811 typedef IteratorRange<decltype(gv.template begin<codim,pit>())> return_type;
    \n+
    812 return return_type(gv.template begin<codim,pit>(),gv.template end<codim,pit>());
    \n+
    813 }
    \n+
    814
    \n+
    822 template<typename GV, int codim>
    \n+
    823 inline auto entities(const GV& gv, Codim<codim>)
    \n+
    824 -> IteratorRange<decltype(gv.template begin<codim>())>
    \n+
    825 {
    \n+
    826 static_assert(0 <= codim && codim <= GV::dimension, "invalid codimension for given GridView");
    \n+
    827 typedef IteratorRange<decltype(gv.template begin<codim>())> return_type;
    \n+
    828 return return_type(gv.template begin<codim>(),gv.template end<codim>());
    \n+
    829 }
    \n+
    830
    \n+
    834 template<typename Entity>
    \n+
    835 inline IteratorRange<typename Entity::HierarchicIterator> descendantElements(const Entity& e, int maxLevel)
    \n+
    836 {
    \n+
    837 typedef IteratorRange<typename Entity::HierarchicIterator> return_type;
    \n+
    838 return return_type(e.hbegin(maxLevel),e.hend(maxLevel));
    \n+
    839 }
    \n+
    840
    \n+
    844 template<typename GV, typename Entity>
    \n+
    845 inline auto intersections(const GV& gv, const Entity& e)
    \n+
    846 -> IteratorRange<decltype(gv.ibegin(e))>
    \n+
    847 {
    \n+
    848 return IteratorRange<decltype(gv.ibegin(e))>(gv.ibegin(e),gv.iend(e));
    \n+
    849 }
    \n+
    850
    \n+
    851
    \n+
    857 template<typename GV, int dim, unsigned int partitions>
    \n+
    858 inline auto entities(const GV& gv, Dim<dim>, PartitionSet<partitions>)
    \n+
    859 -> decltype(entities(gv,Codim<GV::dimension - dim>(),PartitionSet<partitions>()))
    \n+
    860 {
    \n+
    861 static_assert(0 <= dim && dim <= GV::dimension, "invalid dimension for given GridView");
    \n+
    862 return entities(gv,Codim<GV::dimension - dim>(),PartitionSet<partitions>());
    \n+
    863 }
    \n+
    864
    \n+
    865 template<typename GV, int dim>
    \n+
    866 inline auto entities(const GV& gv, Dim<dim>)
    \n+
    867 -> decltype(entities(gv,Codim<GV::dimension - dim>()))
    \n+
    868 {
    \n+
    869 static_assert(0 <= dim && dim <= GV::dimension, "invalid dimension for given GridView");
    \n+
    870 return entities(gv,Codim<GV::dimension - dim>());
    \n+
    871 }
    \n+
    872
    \n+
    873 template<typename GV, unsigned int partitions>
    \n+
    874 inline auto elements(const GV& gv, PartitionSet<partitions>)
    \n+
    875 -> decltype(entities(gv,Codim<0>(),PartitionSet<partitions>()))
    \n+
    876 {
    \n+
    877 return entities(gv,Codim<0>(),PartitionSet<partitions>());
    \n+
    878 }
    \n+
    879
    \n+
    880 template<typename GV>
    \n+
    881 inline auto elements(const GV& gv)
    \n+
    882 -> decltype(entities(gv,Codim<0>()))
    \n+
    883 {
    \n+
    884 return entities(gv,Codim<0>());
    \n+
    885 }
    \n+
    886
    \n+
    887 template<typename GV, unsigned int partitions>
    \n+
    888 inline auto facets(const GV& gv, PartitionSet<partitions>)
    \n+
    889 -> decltype(entities(gv,Codim<1>(),PartitionSet<partitions>()))
    \n+
    890 {
    \n+
    891 return entities(gv,Codim<1>(),PartitionSet<partitions>());
    \n+
    892 }
    \n+
    893
    \n+
    894 template<typename GV>
    \n+
    895 inline auto facets(const GV& gv)
    \n+
    896 -> decltype(entities(gv,Codim<1>()))
    \n+
    897 {
    \n+
    898 return entities(gv,Codim<1>());
    \n+
    899 }
    \n+
    900
    \n+
    901 template<typename GV, unsigned int partitions>
    \n+
    902 inline auto edges(const GV& gv, PartitionSet<partitions>)
    \n+
    903 -> decltype(entities(gv,Dim<1>(),PartitionSet<partitions>()))
    \n+
    904 {
    \n+
    905 return entities(gv,Dim<1>(),PartitionSet<partitions>());
    \n+
    906 }
    \n+
    907
    \n+
    908 template<typename GV>
    \n+
    909 inline auto edges(const GV& gv)
    \n+
    910 -> decltype(entities(gv,Dim<1>()))
    \n+
    911 {
    \n+
    912 return entities(gv,Dim<1>());
    \n+
    913 }
    \n+
    914
    \n+
    915 template<typename GV, unsigned int partitions>
    \n+
    916 inline auto vertices(const GV& gv, PartitionSet<partitions>)
    \n+
    917 -> decltype(entities(gv,Dim<0>(),PartitionSet<partitions>()))
    \n+
    918 {
    \n+
    919 return entities(gv,Dim<0>(),PartitionSet<partitions>());
    \n+
    920 }
    \n+
    921
    \n+
    922 template<typename GV>
    \n+
    923 inline auto vertices(const GV& gv)
    \n+
    924 -> decltype(entities(gv,Dim<0>()))
    \n+
    925 {
    \n+
    926 return entities(gv,Dim<0>());
    \n+
    927 }
    \n+
    928
    \n+
    929 template<typename E, int codim>
    \n+
    930 inline auto subEntities(const E& e, Codim<codim> c)
    \n+
    931 {
    \n+
    932 static_assert(E::codimension <= codim,
    \n+
    933 "Can only iterate over sub-entities with equal or larger codimension");
    \n+
    934 return transformedRangeView(
    \n+
    935 range(static_cast<int>(e.subEntities(c))),
    \n+
    936 [&](const int i){ return e.template subEntity<codim>(i); }
    \n+
    937 );
    \n+
    938 }
    \n+
    939
    \n+
    940#endif // DOXYGEN
    \n+
    941
    \n+
    946} // namespace Dune
    \n+
    947
    \n+
    948#endif // DUNE_GRID_COMMON_RANGEGENERATORS_HH
    \n+\n+\n+
    PartitionIteratorType
    Parameter to be used for the parallel level- and leaf iterators.
    Definition gridenums.hh:136
    \n+
    IteratorRange<... > intersections(const GV &gv, const Entity &e)
    Iterates over all Intersections of an Entity with respect to the given GridView.
    \n+
    IteratorRange<... > vertices(const GV &gv)
    Iterates over all vertices (entities with dimension 0) of a GridView.
    \n+
    IteratorRange<... > elements(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all elements / cells (entities with codimension 0) of a GridView that belong to the giv...
    \n+
    IteratorRange<... > entities(const GV &gv, Codim< codim > cd, PartitionSet< partitions > ps)
    Iterates over all entities of a GridView with the given codimension that belong to the given Partitio...
    \n+
    IteratorRange<... > edges(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all edges (entities with dimension 1) of a GridView that belong to the given PartitionS...
    \n+
    IteratorRange<... > entities(const GV &gv, Dim< dim > d, PartitionSet< partitions > ps)
    Iterates over all entities of a GridView with the given dimension that belong to the given PartitionS...
    \n+
    IteratorRange<... > entities(const GV &gv, Dim< dim > d)
    Iterates over all entities of a GridView with the given dimension.
    \n+
    IteratorRange<... > subEntities(const E &e, Codim< codim > c)
    Iterates over all sub-entities of an entity given the codimension of the sub-entities.
    \n+
    IteratorRange<... > vertices(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all vertices (entities with dimension 0) of a GridView that belong to the given Partiti...
    \n+
    IteratorRange<... > elements(const GV &gv)
    Iterates over all elements / cells (entities with codimension 0) of a GridView.
    \n+
    IteratorRange<... > entities(const GV &gv, Codim< codim > cd)
    Iterates over all entities of a GridView with the given codimension.
    \n+
    IteratorRange<... > facets(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all facets (entities with codimension 1) of a GridView that belong to the given Partiti...
    \n+
    IteratorRange<... > facets(const GV &gv)
    Iterates over all facets (entities with codimension 1) of a GridView.
    \n+
    IteratorRange<... > edges(const GV &gv)
    Iterates over all edges (entities with dimension 1) of a GridView.
    \n+
    IteratorRange<... > descendantElements(const Entity &e, int maxLevel)
    Iterates over all descendant elements of the given element up to a maximum level.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Mapper interface.
    Definition mapper.hh:110
    \n-
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n-
    bool contains(const EntityType &e, Index &result) const
    Returns true if the entity is contained in the index set.
    Definition mcmgmapper.hh:272
    \n-
    size_type size() const
    Return total number of entities in the entity set managed by the mapper.
    Definition mcmgmapper.hh:204
    \n-
    Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity of codim 0 entity to starting index in array for dof block.
    Definition mcmgmapper.hh:185
    \n-
    MultipleCodimMultipleGeomTypeMapper(const GV &gridView, const MCMGLayout &layout)
    construct mapper from grid and layout description
    Definition mcmgmapper.hh:155
    \n-
    bool contains(const typename GV::template Codim< 0 >::Entity &e, int i, int cc, Index &result) const
    Returns true if the entity is contained in the index set.
    Definition mcmgmapper.hh:291
    \n-
    IntegralRange< Index > indices(const EntityType &e) const
    Returns a pair with the starting point in the dof vector and the number of degrees of freedom if the ...
    Definition mcmgmapper.hh:231
    \n-
    decltype(std::declval< typename GV::IndexSet >().size(0)) size_type
    Number type used for the overall size (the return value of the 'size' method)
    Definition mcmgmapper.hh:142
    \n-
    Index index(const EntityType &e) const
    Map entity to starting index in array for dof block.
    Definition mcmgmapper.hh:171
    \n-
    const GridView & gridView() const
    Definition mcmgmapper.hh:328
    \n-
    void update(const GV &gridView)
    Recalculates indices after grid adaptation.
    Definition mcmgmapper.hh:308
    \n-
    GV::IndexSet::IndexType Index
    Number type used for indices.
    Definition mcmgmapper.hh:136
    \n-
    size_type size(GeometryType gt) const
    return number of entries for a given geometry type
    Definition mcmgmapper.hh:210
    \n-
    const MCMGLayout & layout() const
    Definition mcmgmapper.hh:327
    \n-
    IntegralRange< Index > indices(const typename GV::template Codim< 0 >::Entity &e, int i, int cc) const
    Returns a pair with the starting point in the dof vector and the number of degrees of freedom if the ...
    Definition mcmgmapper.hh:250
    \n-
    GV GridView
    Underlying GridView.
    Definition mcmgmapper.hh:133
    \n-
    const std::vector< GeometryType > & types(int codim) const
    return the geometry types with entries
    Definition mcmgmapper.hh:216
    \n-
    void update(GV &&gridView)
    Recalculates indices after grid adaptation.
    Definition mcmgmapper.hh:320
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n+
    A set of PartitionType values.
    Definition partitionset.hh:137
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,347 +1,382 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * common\n-mcmgmapper.hh\n+rangegenerators.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_COMMON_MCMGMAPPER_HH\n-7#define DUNE_GRID_COMMON_MCMGMAPPER_HH\n-8\n-9#include \n-10#include \n-11\n-12#include \n-13#include \n-14#include \n-15#include \n-16#include \n-17#include \n+5#ifndef DUNE_GRID_COMMON_RANGEGENERATORS_HH\n+6#define DUNE_GRID_COMMON_RANGEGENERATORS_HH\n+7\n+8#include \n+9#include \n+10#include \n+11#include \n+12#include \n+13\n+14namespace Dune\n+15{\n+16\n+17#ifdef DOXYGEN\n 18\n-19#include \"mapper.hh\"\n-20\n-27namespace Dune\n-28{\n-36 //\n-37 // Common Layout templates\n-38 //\n-39\n-64 using MCMGLayout = std::function;\n-65\n-71 template\n-72 MCMGLayout mcmgLayout(Codim)\n-73 {\n-74 return [](GeometryType gt, int dimgrid) {\n-75 return dimgrid - gt.dim() == codim;\n-76 };\n-77 }\n-78\n-84 template\n-85 MCMGLayout mcmgLayout(Dim)\n-86 {\n-87 return [](GeometryType gt, int) {\n-88 return gt.dim() == dim;\n-89 };\n-90 }\n-91\n-97 inline MCMGLayout mcmgElementLayout()\n-98 {\n-99 return mcmgLayout(Codim<0>());\n-100 }\n-101\n-107 inline MCMGLayout mcmgVertexLayout()\n-108 {\n-109 return mcmgLayout(Dim<0>());\n-110 }\n-111\n-113 //\n-114 // MultipleCodimMultipleGeomTypeMapper\n-115 //\n-116\n-126 template \n-127 class MultipleCodimMultipleGeomTypeMapper :\n-128 public Mapper,\n-typename GV::IndexSet::IndexType >\n-129 {\n-130 public:\n-131\n-133 typedef GV GridView;\n-134\n-136 typedef typename GV::IndexSet::IndexType Index;\n-137\n-142 using size_type = decltype(std::declval().size(0));\n-143\n-155 MultipleCodimMultipleGeomTypeMapper(const GV& gridView, const MCMGLayout&\n-layout)\n-156 : gridView_(gridView)\n-157 , indexSet_(&gridView_.indexSet())\n-158 , layout_(layout)\n-159 {\n-160 update(gridView);\n-161 }\n-162\n-170 template\n-171 Index index (const EntityType& e) const\n-172 {\n-173 const GeometryType gt = e.type();\n-174 assert(offset(gt) != invalidOffset);\n-175 return indexSet_->index(e)*blockSize(gt) + offset(gt);\n-176 }\n-177\n-185 Index subIndex (const typename GV::template Codim<0>::Entity& e, int i,\n-unsigned int codim) const\n-186 {\n-187 const GeometryType eType = e.type();\n-188 GeometryType gt = eType.isNone() ?\n-189 GeometryTypes::none( GV::dimension - codim ) :\n-190 ReferenceElements::general(eType).type(i,codim) ;\n-191 //GeometryType gt=ReferenceElements::general(e.type\n-()).type(i,codim);\n-192 assert(offset(gt) != invalidOffset);\n-193 return indexSet_->subIndex(e, i, codim)*blockSize(gt) + offset(gt);\n-194 }\n-195\n-204 size_type size () const\n-205 {\n-206 return n;\n-207 }\n-208\n-210 size_type size(GeometryType gt) const\n-211 {\n-212 return blockSize(gt);\n-213 }\n-214\n-216 const std::vector< GeometryType >& types ( int codim ) const\n-217 {\n-218 return myTypes_[ codim ];\n-219 }\n+206 /\n+/\n+*****************************************************************************************\n+207 // Doxygen documentation\n+208 /\n+/\n+*****************************************************************************************\n+209 //\n+210 // In the following, the range generating functions are documented for\n+Doxygen; the actual\n+211 // implementations are further down in this file and hidden from Doxygen.\n+212 // The main reason for this split are the return types of those functions,\n+which either contain\n+213 // long type listings to obtain the iterator type or (in the case of the\n+forwarded functions\n+214 // use the new-style function syntax and calculate the return type using\n+decltype. In both cases,\n+215 // Doxygen generates function signatures that are very confusing to the\n+average user.\n+216 //\n+217 /\n+/\n+*****************************************************************************************\n+218\n+219\n 220\n-230 template\n-231 IntegralRange indices (const EntityType& e) const\n-232 {\n-233 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)\n-234 return {0,0};\n-235 Index start = index(e);\n-236 return {start, start+blockSize(e.type())};\n-237 }\n-238\n-250 IntegralRange indices (const typename GV::template Codim<0>::Entity&\n-e, int i, int cc) const\n-251 {\n-252 const GeometryType eType = e.type();\n-253 const GeometryType gt = eType.isNone() ?\n-254 GeometryTypes::none(GV::dimension - cc) :\n-255 ReferenceElements::general(eType).type(i,cc) ;\n-256 if (offset(gt) == invalidOffset)\n-257 return {0,0};\n-258 else\n-259 {\n-260 Index start = subIndex(e,i,cc);\n-261 return {start, start+blockSize(gt)};\n-262 }\n-263 }\n-264\n-271 template\n-272 bool contains (const EntityType& e, Index& result) const\n-273 {\n-274 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)\n-275 {\n-276 result = 0;\n-277 return false;\n-278 }\n-279 result = index(e);\n-280 return true;\n-281 }\n-282\n-291 bool contains (const typename GV::template Codim<0>::Entity& e, int i, int\n-cc, Index& result) const\n-292 {\n-293 const GeometryType eType = e.type();\n-294 const GeometryType gt = eType.isNone() ?\n-295 GeometryTypes::none( GV::dimension - cc ) :\n-296 ReferenceElements::general(eType).type(i,cc) ;\n-297 if (offset(gt) == invalidOffset)\n-298 return false;\n-299 result = indexSet_->subIndex(e, i, cc)*blockSize(gt) + offset(gt);\n-300 return true;\n-301 }\n-302\n-308 void update (const GV& gridView)\n-309 {\n-310 gridView_ = gridView;\n-311 indexSet_ = &gridView_.indexSet();\n-312 update_();\n-313 }\n-314\n-320 void update (GV&& gridView)\n-321 {\n-322 gridView_ = std::move(gridView);\n-323 indexSet_ = &gridView_.indexSet();\n-324 update_();\n-325 }\n+224\n+225\n+227\n+256 template\n+257 inline IteratorRange<...> elements(const GV& gv);\n+258\n+259\n+261\n+290 template\n+291 inline IteratorRange<...> facets(const GV& gv);\n+292\n+293\n+295\n+324 template\n+325 inline IteratorRange<...> edges(const GV& gv);\n 326\n-327 const MCMGLayout &layout () const { return layout_; }\n-328 const GridView &gridView () const { return gridView_; }\n+327\n 329\n-330 private:\n-331 void update_()\n-332 {\n-333 n = 0;\n-334\n-335 std::fill(offsets.begin(),offsets.end(),Index(0));\n-336 std::fill(blocks.begin(),blocks.end(),Index(0));\n-337\n-338 for (unsigned int codim = 0; codim <= GV::dimension; ++codim)\n-339 {\n-340 // walk over all geometry types in the codimension\n-341 for (const GeometryType& gt : indexSet_->types(codim)) {\n-342 Index offset;\n-343 size_t block = layout()(gt, GV::Grid::dimension);\n-344\n-345 // if the geometry type is contained in the layout, increment offset\n-346 // and store geometry type\n-347 if (block) {\n-348 offset = n;\n-349 n += indexSet_->size(gt) * block;\n-350 myTypes_[codim].push_back(gt);\n-351 }\n-352 else {\n-353 offset = invalidOffset;\n-354 }\n-355\n-356 offsets[GlobalGeometryTypeIndex::index(gt)] = offset;\n-357 blocks[GlobalGeometryTypeIndex::index(gt)] = block;\n-358 }\n-359 }\n-360 }\n+358 template\n+359 inline IteratorRange<...> vertices(const GV& gv);\n+360\n 361\n-362 Index offset(GeometryType gt) const\n-363 { return offsets[GlobalGeometryTypeIndex::index(gt)]; }\n-364 Index blockSize(GeometryType gt) const\n-365 { return blocks[GlobalGeometryTypeIndex::index(gt)]; }\n-366\n-367 static const Index invalidOffset = std::numeric_limits::max();\n-368\n-369 // number of data elements required\n-370 unsigned int n;\n-371 // GridView is needed to keep the IndexSet valid\n-372 GV gridView_;\n-373 const typename GV::IndexSet* indexSet_;\n-374 // provide an array for the offsets\n-375 std::array offsets;\n-376 std::array blocks;\n-377 MCMGLayout layout_; // get layout object\n-378 std::vector myTypes_[GV::dimension+1];\n-379 };\n-380\n-382}\n-383#endif\n-mapper.hh\n-Provides classes with basic mappers which are used to attach data to a grid.\n-Dune::mcmgLayout\n-MCMGLayout mcmgLayout(Codim< codim >)\n-layout for entities of codimension codim\n-Definition mcmgmapper.hh:72\n-Dune::mcmgElementLayout\n-MCMGLayout mcmgElementLayout()\n-layout for elements (codim-0 entities)\n-Definition mcmgmapper.hh:97\n-Dune::MCMGLayout\n-std::function< size_t(GeometryType, int)> MCMGLayout\n-layout function for MultipleCodimMultipleGeomTypeMapper\n-Definition mcmgmapper.hh:64\n-Dune::mcmgVertexLayout\n-MCMGLayout mcmgVertexLayout()\n-layout for vertices (dim-0 entities)\n-Definition mcmgmapper.hh:107\n+363\n+364\n+365\n+369\n+371\n+394 template\n+395 inline IteratorRange<...> intersections(const GV& gv, const Entity& e);\n+396\n+397\n+399\n+400\n+401\n+405\n+406\n+408\n+434 template\n+435 inline IteratorRange<...> descendantElements(const Entity& e, int\n+maxLevel);\n+436 // Entity class EntityImp>\n+437\n+439\n+440\n+441\n+445\n+446\n+448\n+486 template\n+487 inline IteratorRange<...> entities(const GV& gv, Codim cd);\n+488\n+489\n+491\n+531 template\n+532 inline IteratorRange<...> entities(const GV& gv, Dim d);\n+533\n+535\n+536\n+537\n+541\n+542\n+544\n+570 template\n+571 inline IteratorRange<...> elements(const GV& gv, PartitionSet\n+ps);\n+572\n+573\n+575\n+604 template\n+605 inline IteratorRange<...> facets(const GV& gv, PartitionSet\n+ps);\n+606\n+607\n+609\n+635 template\n+636 inline IteratorRange<...> edges(const GV& gv, PartitionSet ps);\n+637\n+638\n+640\n+666 template\n+667 inline IteratorRange<...> vertices(const GV& gv, PartitionSet\n+ps);\n+668\n+670\n+671\n+672\n+676\n+677\n+679\n+715 template\n+716 inline IteratorRange<...> entities(const GV& gv, Codim cd,\n+PartitionSet ps);\n+717\n+718\n+720\n+756 template\n+757 inline IteratorRange<...> entities(const GV& gv, Dim d,\n+PartitionSet ps);\n+758\n+759\n+761\n+782 template\n+783 inline IteratorRange<...> subEntities(const E& e, Codim c);\n+784\n+785\n+787\n+788\n+789#else // DOXYGEN\n+790\n+791 /\n+/\n+******************************************************************************************\n+792 // Implementations\n+793 /\n+/\n+******************************************************************************************\n+794\n+795\n+805 template\n+806 inline auto entities(const GV& gv, Codim, PartitionSet)\n+807 -> IteratorRange::value>())>\n+808 {\n+809 static_assert(0 <= codim && codim <= GV::dimension, \"invalid codimension\n+for given GridView\");\n+810 const PartitionIteratorType pit = derive_partition_iterator_\n+type::value;\n+811 typedef IteratorRange())> return_\n+type;\n+812 return return_type(gv.template begin(),gv.template\n+end());\n+813 }\n+814\n+822 template\n+823 inline auto entities(const GV& gv, Codim)\n+824 -> IteratorRange())>\n+825 {\n+826 static_assert(0 <= codim && codim <= GV::dimension, \"invalid codimension\n+for given GridView\");\n+827 typedef IteratorRange())> return_type;\n+828 return return_type(gv.template begin(),gv.template end());\n+829 }\n+830\n+834 template\n+835 inline IteratorRange\n+descendantElements(const Entity& e, int maxLevel)\n+836 {\n+837 typedef IteratorRange return_type;\n+838 return return_type(e.hbegin(maxLevel),e.hend(maxLevel));\n+839 }\n+840\n+844 template\n+845 inline auto intersections(const GV& gv, const Entity& e)\n+846 -> IteratorRange\n+847 {\n+848 return IteratorRange(gv.ibegin(e),gv.iend(e));\n+849 }\n+850\n+851\n+857 template\n+858 inline auto entities(const GV& gv, Dim, PartitionSet)\n+859 -> decltype(entities(gv,Codim\n+(),PartitionSet()))\n+860 {\n+861 static_assert(0 <= dim && dim <= GV::dimension, \"invalid dimension for\n+given GridView\");\n+862 return entities(gv,Codim(),PartitionSet\n+());\n+863 }\n+864\n+865 template\n+866 inline auto entities(const GV& gv, Dim)\n+867 -> decltype(entities(gv,Codim()))\n+868 {\n+869 static_assert(0 <= dim && dim <= GV::dimension, \"invalid dimension for\n+given GridView\");\n+870 return entities(gv,Codim());\n+871 }\n+872\n+873 template\n+874 inline auto elements(const GV& gv, PartitionSet)\n+875 -> decltype(entities(gv,Codim<0>(),PartitionSet()))\n+876 {\n+877 return entities(gv,Codim<0>(),PartitionSet());\n+878 }\n+879\n+880 template\n+881 inline auto elements(const GV& gv)\n+882 -> decltype(entities(gv,Codim<0>()))\n+883 {\n+884 return entities(gv,Codim<0>());\n+885 }\n+886\n+887 template\n+888 inline auto facets(const GV& gv, PartitionSet)\n+889 -> decltype(entities(gv,Codim<1>(),PartitionSet()))\n+890 {\n+891 return entities(gv,Codim<1>(),PartitionSet());\n+892 }\n+893\n+894 template\n+895 inline auto facets(const GV& gv)\n+896 -> decltype(entities(gv,Codim<1>()))\n+897 {\n+898 return entities(gv,Codim<1>());\n+899 }\n+900\n+901 template\n+902 inline auto edges(const GV& gv, PartitionSet)\n+903 -> decltype(entities(gv,Dim<1>(),PartitionSet()))\n+904 {\n+905 return entities(gv,Dim<1>(),PartitionSet());\n+906 }\n+907\n+908 template\n+909 inline auto edges(const GV& gv)\n+910 -> decltype(entities(gv,Dim<1>()))\n+911 {\n+912 return entities(gv,Dim<1>());\n+913 }\n+914\n+915 template\n+916 inline auto vertices(const GV& gv, PartitionSet)\n+917 -> decltype(entities(gv,Dim<0>(),PartitionSet()))\n+918 {\n+919 return entities(gv,Dim<0>(),PartitionSet());\n+920 }\n+921\n+922 template\n+923 inline auto vertices(const GV& gv)\n+924 -> decltype(entities(gv,Dim<0>()))\n+925 {\n+926 return entities(gv,Dim<0>());\n+927 }\n+928\n+929 template\n+930 inline auto subEntities(const E& e, Codim c)\n+931 {\n+932 static_assert(E::codimension <= codim,\n+933 \"Can only iterate over sub-entities with equal or larger codimension\");\n+934 return transformedRangeView(\n+935 range(static_cast(e.subEntities(c))),\n+936 [&](const int i){ return e.template subEntity(i); }\n+937 );\n+938 }\n+939\n+940#endif // DOXYGEN\n+941\n+946} // namespace Dune\n+947\n+948#endif // DUNE_GRID_COMMON_RANGEGENERATORS_HH\n+gridenums.hh\n+partitionset.hh\n+Dune::PartitionIteratorType\n+PartitionIteratorType\n+Parameter to be used for the parallel level- and leaf iterators.\n+Definition gridenums.hh:136\n+Dune::Entity::intersections\n+IteratorRange<... > intersections(const GV &gv, const Entity &e)\n+Iterates over all Intersections of an Entity with respect to the given\n+GridView.\n+Dune::GridView::vertices\n+IteratorRange<... > vertices(const GV &gv)\n+Iterates over all vertices (entities with dimension 0) of a GridView.\n+Dune::GridView::elements\n+IteratorRange<... > elements(const GV &gv, PartitionSet< partitions > ps)\n+Iterates over all elements / cells (entities with codimension 0) of a GridView\n+that belong to the giv...\n+Dune::GridView::entities\n+IteratorRange<... > entities(const GV &gv, Codim< codim > cd, PartitionSet<\n+partitions > ps)\n+Iterates over all entities of a GridView with the given codimension that belong\n+to the given Partitio...\n+Dune::GridView::edges\n+IteratorRange<... > edges(const GV &gv, PartitionSet< partitions > ps)\n+Iterates over all edges (entities with dimension 1) of a GridView that belong\n+to the given PartitionS...\n+Dune::GridView::entities\n+IteratorRange<... > entities(const GV &gv, Dim< dim > d, PartitionSet<\n+partitions > ps)\n+Iterates over all entities of a GridView with the given dimension that belong\n+to the given PartitionS...\n+Dune::GridView::entities\n+IteratorRange<... > entities(const GV &gv, Dim< dim > d)\n+Iterates over all entities of a GridView with the given dimension.\n+Dune::Entity::subEntities\n+IteratorRange<... > subEntities(const E &e, Codim< codim > c)\n+Iterates over all sub-entities of an entity given the codimension of the sub-\n+entities.\n+Dune::GridView::vertices\n+IteratorRange<... > vertices(const GV &gv, PartitionSet< partitions > ps)\n+Iterates over all vertices (entities with dimension 0) of a GridView that\n+belong to the given Partiti...\n+Dune::GridView::elements\n+IteratorRange<... > elements(const GV &gv)\n+Iterates over all elements / cells (entities with codimension 0) of a GridView.\n+Dune::GridView::entities\n+IteratorRange<... > entities(const GV &gv, Codim< codim > cd)\n+Iterates over all entities of a GridView with the given codimension.\n+Dune::GridView::facets\n+IteratorRange<... > facets(const GV &gv, PartitionSet< partitions > ps)\n+Iterates over all facets (entities with codimension 1) of a GridView that\n+belong to the given Partiti...\n+Dune::GridView::facets\n+IteratorRange<... > facets(const GV &gv)\n+Iterates over all facets (entities with codimension 1) of a GridView.\n+Dune::GridView::edges\n+IteratorRange<... > edges(const GV &gv)\n+Iterates over all edges (entities with dimension 1) of a GridView.\n+Dune::Entity::descendantElements\n+IteratorRange<... > descendantElements(const Entity &e, int maxLevel)\n+Iterates over all descendant elements of the given element up to a maximum\n+level.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Mapper\n-Mapper interface.\n-Definition mapper.hh:110\n-Dune::MultipleCodimMultipleGeomTypeMapper\n-Implementation class for a multiple codim and multiple geometry type mapper.\n-Definition mcmgmapper.hh:129\n-Dune::MultipleCodimMultipleGeomTypeMapper::contains\n-bool contains(const EntityType &e, Index &result) const\n-Returns true if the entity is contained in the index set.\n-Definition mcmgmapper.hh:272\n-Dune::MultipleCodimMultipleGeomTypeMapper::size\n-size_type size() const\n-Return total number of entities in the entity set managed by the mapper.\n-Definition mcmgmapper.hh:204\n-Dune::MultipleCodimMultipleGeomTypeMapper::subIndex\n-Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i,\n-unsigned int codim) const\n-Map subentity of codim 0 entity to starting index in array for dof block.\n-Definition mcmgmapper.hh:185\n-Dune::MultipleCodimMultipleGeomTypeMapper::MultipleCodimMultipleGeomTypeMapper\n-MultipleCodimMultipleGeomTypeMapper(const GV &gridView, const MCMGLayout\n-&layout)\n-construct mapper from grid and layout description\n-Definition mcmgmapper.hh:155\n-Dune::MultipleCodimMultipleGeomTypeMapper::contains\n-bool contains(const typename GV::template Codim< 0 >::Entity &e, int i, int cc,\n-Index &result) const\n-Returns true if the entity is contained in the index set.\n-Definition mcmgmapper.hh:291\n-Dune::MultipleCodimMultipleGeomTypeMapper::indices\n-IntegralRange< Index > indices(const EntityType &e) const\n-Returns a pair with the starting point in the dof vector and the number of\n-degrees of freedom if the ...\n-Definition mcmgmapper.hh:231\n-Dune::MultipleCodimMultipleGeomTypeMapper::size_type\n-decltype(std::declval< typename GV::IndexSet >().size(0)) size_type\n-Number type used for the overall size (the return value of the 'size' method)\n-Definition mcmgmapper.hh:142\n-Dune::MultipleCodimMultipleGeomTypeMapper::index\n-Index index(const EntityType &e) const\n-Map entity to starting index in array for dof block.\n-Definition mcmgmapper.hh:171\n-Dune::MultipleCodimMultipleGeomTypeMapper::gridView\n-const GridView & gridView() const\n-Definition mcmgmapper.hh:328\n-Dune::MultipleCodimMultipleGeomTypeMapper::update\n-void update(const GV &gridView)\n-Recalculates indices after grid adaptation.\n-Definition mcmgmapper.hh:308\n-Dune::MultipleCodimMultipleGeomTypeMapper::Index\n-GV::IndexSet::IndexType Index\n-Number type used for indices.\n-Definition mcmgmapper.hh:136\n-Dune::MultipleCodimMultipleGeomTypeMapper::size\n-size_type size(GeometryType gt) const\n-return number of entries for a given geometry type\n-Definition mcmgmapper.hh:210\n-Dune::MultipleCodimMultipleGeomTypeMapper::layout\n-const MCMGLayout & layout() const\n-Definition mcmgmapper.hh:327\n-Dune::MultipleCodimMultipleGeomTypeMapper::indices\n-IntegralRange< Index > indices(const typename GV::template Codim< 0 >::Entity\n-&e, int i, int cc) const\n-Returns a pair with the starting point in the dof vector and the number of\n-degrees of freedom if the ...\n-Definition mcmgmapper.hh:250\n-Dune::MultipleCodimMultipleGeomTypeMapper::GridView\n-GV GridView\n-Underlying GridView.\n-Definition mcmgmapper.hh:133\n-Dune::MultipleCodimMultipleGeomTypeMapper::types\n-const std::vector< GeometryType > & types(int codim) const\n-return the geometry types with entries\n-Definition mcmgmapper.hh:216\n-Dune::MultipleCodimMultipleGeomTypeMapper::update\n-void update(GV &&gridView)\n-Recalculates indices after grid adaptation.\n-Definition mcmgmapper.hh:320\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::GridView::Codim\n+A struct that collects all associated types of one implementation from the\n+Traits class.\n+Definition common/gridview.hh:104\n+Dune::PartitionSet\n+A set of PartitionType values.\n+Definition partitionset.hh:137\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00566.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00566.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cornerstorage.hh File Reference\n+dune-grid: declaration.hh File Reference\n \n \n \n \n \n \n \n@@ -70,43 +70,26 @@\n \n \n
    \n \n-
    cornerstorage.hh File Reference
    \n+
    declaration.hh File Reference
    \n
    \n
    \n-
    #include <array>
    \n-#include <dune/grid/geometrygrid/coordfunctioncaller.hh>
    \n-
    \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::GeoGrid::CoordVector< mydim, Grid, false >
     
    class  Dune::GeoGrid::CoordVector< mydim, Grid, true >
     
    class  Dune::GeoGrid::IntersectionCoordVector< Grid >
     
    class  Dune::GeoGrid::CornerStorage< mydim, cdim, Grid >
     
    \n \n \n \n \n-\n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,30 +1,16 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n-Classes | Namespaces\n-cornerstorage.hh File Reference\n-#include \n-#include \n+Namespaces\n+declaration.hh File Reference\n Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::GeoGrid::CoordVector<_mydim,_Grid,_false_>\n-\u00a0\n-class \u00a0 Dune::GeoGrid::CoordVector<_mydim,_Grid,_true_>\n-\u00a0\n-class \u00a0 Dune::GeoGrid::IntersectionCoordVector<_Grid_>\n-\u00a0\n-class \u00a0 Dune::GeoGrid::CornerStorage<_mydim,_cdim,_Grid_>\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::GeoGrid\n-\u00a0 namespace containing the implementations of GeometryGrid\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00566_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00566_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cornerstorage.hh Source File\n+dune-grid: declaration.hh Source File\n \n \n \n \n \n \n \n@@ -74,277 +74,34 @@\n \n \n \n
    \n-
    cornerstorage.hh
    \n+
    declaration.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GEOGRID_CORNERSTORAGE_HH
    \n-
    6#define DUNE_GEOGRID_CORNERSTORAGE_HH
    \n+
    5#ifndef DUNE_GEOGRID_DECLARATION_HH
    \n+
    6#define DUNE_GEOGRID_DECLARATION_HH
    \n
    7
    \n-
    8#include <array>
    \n-
    9
    \n-\n-
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    15 namespace GeoGrid
    \n-
    16 {
    \n-
    17
    \n-
    18 // CoordVector
    \n-
    19 // -----------
    \n-
    20
    \n-
    21 template< int mydim, class Grid, bool fake >
    \n-\n-
    23
    \n-
    24
    \n-
    25 template< int mydim, class Grid >
    \n-
    \n-
    26 class CoordVector< mydim, Grid, false >
    \n-
    27 {
    \n-
    28 typedef typename std::remove_const< Grid >::type::Traits Traits;
    \n-
    29
    \n-
    30 typedef typename Traits::ctype ctype;
    \n-
    31
    \n-
    32 static const int dimension = Traits::dimension;
    \n-
    33 static const int mydimension = mydim;
    \n-
    34 static const int codimension = dimension - mydimension;
    \n-
    35 static const int dimensionworld = Traits::dimensionworld;
    \n-
    36
    \n-
    37 typedef FieldVector< ctype, dimensionworld > Coordinate;
    \n-
    38
    \n-
    39 typedef typename Traits::HostGrid HostGrid;
    \n-
    40 typedef typename Traits::CoordFunction CoordFunction;
    \n-
    41
    \n-
    42 typedef typename HostGrid::template Codim< codimension >::Entity HostEntity;
    \n-
    43
    \n-
    44 typedef GeoGrid :: CoordFunctionCaller< HostEntity, typename CoordFunction::Interface >
    \n-
    45 CoordFunctionCaller;
    \n-
    46
    \n-
    47 public:
    \n-
    \n-
    48 CoordVector ( const HostEntity &hostEntity,
    \n-
    49 const CoordFunction &coordFunction )
    \n-
    50 : coordFunctionCaller_( hostEntity, coordFunction )
    \n-
    51 {}
    \n-
    \n-
    52
    \n-
    53 template< std::size_t size >
    \n-
    \n-
    54 void calculate ( std::array< Coordinate, size > (&corners) ) const
    \n-
    55 {
    \n-
    56 const std::size_t numCorners = coordFunctionCaller_.size();
    \n-
    57 assert( size >= numCorners );
    \n-
    58 for( std::size_t i = 0; i < numCorners; ++i )
    \n-
    59 coordFunctionCaller_.evaluate( i, corners[ i ] );
    \n-
    60 }
    \n-
    \n-
    61
    \n-
    62 private:
    \n-
    63 const CoordFunctionCaller coordFunctionCaller_;
    \n-
    64 };
    \n-
    \n-
    65
    \n-
    66
    \n-
    67 template< int mydim, class Grid >
    \n-
    \n-
    68 class CoordVector< mydim, Grid, true >
    \n-
    69 {
    \n-
    70 typedef typename std::remove_const< Grid > :: type :: Traits Traits;
    \n-
    71
    \n-
    72 typedef typename Traits::ctype ctype;
    \n-
    73
    \n-
    74 static const int dimension = Traits::dimension;
    \n-
    75 static const int mydimension = mydim;
    \n-
    76 static const int codimension = dimension - mydimension;
    \n-
    77 static const int dimensionworld = Traits::dimensionworld;
    \n-
    78
    \n-
    79 typedef FieldVector< ctype, dimensionworld > Coordinate;
    \n-
    80
    \n-
    81 typedef typename Traits::HostGrid HostGrid;
    \n-
    82 typedef typename Traits::CoordFunction CoordFunction;
    \n-
    83
    \n-
    84 typedef typename HostGrid::template Codim< 0 >::Entity HostElement;
    \n-
    85
    \n-\n-\n-
    88
    \n-
    89 public:
    \n-
    \n-
    90 CoordVector ( const HostElement &hostElement,
    \n-
    91 const unsigned int subEntity,
    \n-
    92 const CoordFunction &coordFunction )
    \n-
    93 : coordFunctionCaller_( hostElement, coordFunction ),
    \n-
    94 subEntity_( subEntity )
    \n-
    95 {}
    \n-
    \n-
    96
    \n-
    97 template< std::size_t size >
    \n-
    \n-
    98 void calculate ( std::array< Coordinate, size > (&corners) ) const
    \n-
    99 {
    \n-
    100 const GeometryType type = coordFunctionCaller_.type();
    \n-
    101 auto refElement = referenceElement< ctype, dimension >( type );
    \n-
    102 const std::size_t numCorners = refElement.size( subEntity_, codimension, dimension );
    \n-
    103 assert( size >= numCorners );
    \n-
    104 for( std::size_t i = 0; i < numCorners; ++i )
    \n-
    105 {
    \n-
    106 const std::size_t j = refElement.subEntity( subEntity_, codimension, i, dimension );
    \n-
    107 coordFunctionCaller_.evaluate( j, corners[ i ] );
    \n-
    108 }
    \n-
    109 }
    \n-
    \n-
    110
    \n-
    111 private:
    \n-
    112 const CoordFunctionCaller coordFunctionCaller_;
    \n-
    113 const unsigned int subEntity_;
    \n-
    114 };
    \n-
    \n-
    115
    \n-
    116
    \n-
    117
    \n-
    118 // IntersectionCoordVector
    \n-
    119 // -----------------------
    \n-
    120
    \n-
    121 template< class Grid >
    \n-
    \n-\n-
    123 {
    \n-
    124 typedef typename std::remove_const< Grid >::type::Traits Traits;
    \n-
    125
    \n-
    126 typedef typename Traits::ctype ctype;
    \n-
    127
    \n-
    128 static const int dimension = Traits::dimension;
    \n-
    129 static const int codimension = 1;
    \n-
    130 static const int mydimension = dimension-codimension;
    \n-
    131 static const int dimensionworld = Traits::dimensionworld;
    \n-
    132
    \n-
    133 typedef FieldVector< ctype, dimensionworld > Coordinate;
    \n-
    134
    \n-
    135 typedef typename Traits::HostGrid HostGrid;
    \n-
    136
    \n-
    137 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
    \n-
    138 typedef typename Traits::template Codim< codimension >::LocalGeometry HostLocalGeometry;
    \n-
    139
    \n-
    140 public:
    \n-
    \n-
    141 IntersectionCoordVector ( const ElementGeometryImpl &elementGeometry,
    \n-
    142 const HostLocalGeometry &hostLocalGeometry )
    \n-
    143 : elementGeometry_( elementGeometry ),
    \n-
    144 hostLocalGeometry_( hostLocalGeometry )
    \n-
    145 {}
    \n-
    \n-
    146
    \n-
    147 template< std::size_t size >
    \n-
    \n-
    148 void calculate ( std::array< Coordinate, size > (&corners) ) const
    \n-
    149 {
    \n-
    150 const std::size_t numCorners = hostLocalGeometry_.corners();
    \n-
    151 assert( size >= numCorners );
    \n-
    152 for( std::size_t i = 0; i < numCorners; ++i )
    \n-
    153 corners[ i ] = elementGeometry_.global( hostLocalGeometry_.corner( i ) );
    \n-
    154 }
    \n-
    \n-
    155
    \n-
    156 template< unsigned int numCorners >
    \n-
    \n-
    157 void calculate ( Coordinate (&corners)[ numCorners ] ) const
    \n-
    158 {
    \n-
    159 assert( numCorners == hostLocalGeometry_.corners() );
    \n-
    160 }
    \n-
    \n-
    161
    \n-
    162 private:
    \n-
    163 const ElementGeometryImpl &elementGeometry_;
    \n-
    164 HostLocalGeometry hostLocalGeometry_;
    \n-
    165 };
    \n-
    \n-
    166
    \n-
    167
    \n-
    168
    \n-
    169 // CornerStorage
    \n-
    170 // -------------
    \n-
    171
    \n-
    172 template< int mydim, int cdim, class Grid >
    \n-
    \n-\n-
    174 {
    \n-
    175 typedef typename std::remove_const< Grid >::type::Traits Traits;
    \n-
    176
    \n-
    177 typedef typename Traits::ctype ctype;
    \n-
    178 typedef FieldVector< ctype, cdim > Coordinate;
    \n-
    179
    \n-
    180 typedef std::array< Coordinate, (1 << mydim) > Coords;
    \n-
    181
    \n-
    182 public:
    \n-
    183 typedef typename Coords::const_iterator const_iterator;
    \n-
    184
    \n-
    185 template< bool fake >
    \n-
    \n-\n-
    187 {
    \n-
    188 coords.calculate( coords_ );
    \n-
    189 }
    \n-
    \n-
    190
    \n-
    \n-\n-
    192 {
    \n-
    193 coords.calculate( coords_ );
    \n-
    194 }
    \n-
    \n-
    195
    \n-
    \n-
    196 const Coordinate &operator[] ( unsigned int i ) const
    \n-
    197 {
    \n-
    198 return coords_[ i ];
    \n-
    199 }
    \n-
    \n-
    200
    \n-
    201 const_iterator begin () const { return coords_.begin(); }
    \n-
    202 const_iterator end () const { return coords_.end(); }
    \n-
    203
    \n-
    204 private:
    \n-
    205 Coords coords_;
    \n-
    206 };
    \n-
    \n-
    207
    \n-
    208 } // namespace GeoGrid
    \n-
    209
    \n-
    210} // namespace Dune
    \n-
    211
    \n-
    212#endif // #ifndef DUNE_GEOGRID_CORNERSTORAGE_HH
    \n-\n+
    8namespace Dune
    \n+
    9{
    \n+
    10
    \n+
    11 template< class HostGrid, class CoordFunction, class Allocator >
    \n+
    12 class GeometryGrid;
    \n+
    13
    \n+
    14} // namespace Dune
    \n+
    15
    \n+
    16#endif // #ifndef DUNE_GEOGRID_DECLARATION_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    Definition coordfunctioncaller.hh:21
    \n-
    Definition cornerstorage.hh:22
    \n-
    CoordVector(const HostEntity &hostEntity, const CoordFunction &coordFunction)
    Definition cornerstorage.hh:48
    \n-
    void calculate(std::array< Coordinate, size >(&corners)) const
    Definition cornerstorage.hh:54
    \n-
    CoordVector(const HostElement &hostElement, const unsigned int subEntity, const CoordFunction &coordFunction)
    Definition cornerstorage.hh:90
    \n-
    void calculate(std::array< Coordinate, size >(&corners)) const
    Definition cornerstorage.hh:98
    \n-
    Definition cornerstorage.hh:123
    \n-
    IntersectionCoordVector(const ElementGeometryImpl &elementGeometry, const HostLocalGeometry &hostLocalGeometry)
    Definition cornerstorage.hh:141
    \n-
    void calculate(Coordinate(&corners)[numCorners]) const
    Definition cornerstorage.hh:157
    \n-
    void calculate(std::array< Coordinate, size >(&corners)) const
    Definition cornerstorage.hh:148
    \n-
    Definition cornerstorage.hh:174
    \n-
    Coords::const_iterator const_iterator
    Definition cornerstorage.hh:183
    \n-
    const_iterator begin() const
    Definition cornerstorage.hh:201
    \n-
    CornerStorage(const IntersectionCoordVector< Grid > &coords)
    Definition cornerstorage.hh:191
    \n-
    const_iterator end() const
    Definition cornerstorage.hh:202
    \n-
    const Coordinate & operator[](unsigned int i) const
    Definition cornerstorage.hh:196
    \n-
    CornerStorage(const CoordVector< mydim, Grid, fake > &coords)
    Definition cornerstorage.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,286 +1,31 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n-cornerstorage.hh\n+declaration.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GEOGRID_CORNERSTORAGE_HH\n-6#define DUNE_GEOGRID_CORNERSTORAGE_HH\n+5#ifndef DUNE_GEOGRID_DECLARATION_HH\n+6#define DUNE_GEOGRID_DECLARATION_HH\n 7\n-8#include \n-9\n-10#include \n-11\n-12namespace Dune\n-13{\n-14\n-15 namespace GeoGrid\n-16 {\n-17\n-18 // CoordVector\n-19 // -----------\n-20\n-21 template< int mydim, class Grid, bool fake >\n-22 class CoordVector;\n-23\n-24\n-25 template< int mydim, class Grid >\n-26 class CoordVector< mydim, Grid, false >\n-27 {\n-28 typedef typename std::remove_const< Grid >::type::Traits Traits;\n-29\n-30 typedef typename Traits::ctype ctype;\n-31\n-32 static const int dimension = Traits::dimension;\n-33 static const int mydimension = mydim;\n-34 static const int codimension = dimension - mydimension;\n-35 static const int dimensionworld = Traits::dimensionworld;\n-36\n-37 typedef FieldVector< ctype, dimensionworld > Coordinate;\n-38\n-39 typedef typename Traits::HostGrid HostGrid;\n-40 typedef typename Traits::CoordFunction CoordFunction;\n-41\n-42 typedef typename HostGrid::template Codim< codimension >::Entity HostEntity;\n-43\n-44 typedef GeoGrid :: CoordFunctionCaller< HostEntity, typename CoordFunction::\n-Interface >\n-45 CoordFunctionCaller;\n-46\n-47 public:\n-48 CoordVector ( const HostEntity &hostEntity,\n-49 const CoordFunction &coordFunction )\n-50 : coordFunctionCaller_( hostEntity, coordFunction )\n-51 {}\n-52\n-53 template< std::size_t size >\n-54 void calculate ( std::array< Coordinate, size > (&corners) ) const\n-55 {\n-56 const std::size_t numCorners = coordFunctionCaller_.size();\n-57 assert( size >= numCorners );\n-58 for( std::size_t i = 0; i < numCorners; ++i )\n-59 coordFunctionCaller_.evaluate( i, corners[ i ] );\n-60 }\n-61\n-62 private:\n-63 const CoordFunctionCaller coordFunctionCaller_;\n-64 };\n-65\n-66\n-67 template< int mydim, class Grid >\n-68 class CoordVector< mydim, Grid, true >\n-69 {\n-70 typedef typename std::remove_const< Grid > :: type :: Traits Traits;\n-71\n-72 typedef typename Traits::ctype ctype;\n-73\n-74 static const int dimension = Traits::dimension;\n-75 static const int mydimension = mydim;\n-76 static const int codimension = dimension - mydimension;\n-77 static const int dimensionworld = Traits::dimensionworld;\n-78\n-79 typedef FieldVector< ctype, dimensionworld > Coordinate;\n-80\n-81 typedef typename Traits::HostGrid HostGrid;\n-82 typedef typename Traits::CoordFunction CoordFunction;\n-83\n-84 typedef typename HostGrid::template Codim< 0 >::Entity HostElement;\n-85\n-86 typedef GeoGrid::CoordFunctionCaller<_HostElement,_typename_CoordFunction::\n-Interface_>\n-87 CoordFunctionCaller;\n-88\n-89 public:\n-90 CoordVector ( const HostElement &hostElement,\n-91 const unsigned int subEntity,\n-92 const CoordFunction &coordFunction )\n-93 : coordFunctionCaller_( hostElement, coordFunction ),\n-94 subEntity_( subEntity )\n-95 {}\n-96\n-97 template< std::size_t size >\n-98 void calculate ( std::array< Coordinate, size > (&corners) ) const\n-99 {\n-100 const GeometryType type = coordFunctionCaller_.type();\n-101 auto refElement = referenceElement< ctype, dimension >( type );\n-102 const std::size_t numCorners = refElement.size( subEntity_, codimension,\n-dimension );\n-103 assert( size >= numCorners );\n-104 for( std::size_t i = 0; i < numCorners; ++i )\n-105 {\n-106 const std::size_t j = refElement.subEntity( subEntity_, codimension, i,\n-dimension );\n-107 coordFunctionCaller_.evaluate( j, corners[ i ] );\n-108 }\n-109 }\n-110\n-111 private:\n-112 const CoordFunctionCaller coordFunctionCaller_;\n-113 const unsigned int subEntity_;\n-114 };\n-115\n-116\n-117\n-118 // IntersectionCoordVector\n-119 // -----------------------\n-120\n-121 template< class Grid >\n-122 class IntersectionCoordVector\n-123 {\n-124 typedef typename std::remove_const< Grid >::type::Traits Traits;\n-125\n-126 typedef typename Traits::ctype ctype;\n-127\n-128 static const int dimension = Traits::dimension;\n-129 static const int codimension = 1;\n-130 static const int mydimension = dimension-codimension;\n-131 static const int dimensionworld = Traits::dimensionworld;\n-132\n-133 typedef FieldVector< ctype, dimensionworld > Coordinate;\n-134\n-135 typedef typename Traits::HostGrid HostGrid;\n-136\n-137 typedef typename Traits::template Codim< 0 >::GeometryImpl\n-ElementGeometryImpl;\n-138 typedef typename Traits::template Codim< codimension >::LocalGeometry\n-HostLocalGeometry;\n-139\n-140 public:\n-141 IntersectionCoordVector ( const ElementGeometryImpl &elementGeometry,\n-142 const HostLocalGeometry &hostLocalGeometry )\n-143 : elementGeometry_( elementGeometry ),\n-144 hostLocalGeometry_( hostLocalGeometry )\n-145 {}\n-146\n-147 template< std::size_t size >\n-148 void calculate ( std::array< Coordinate, size > (&corners) ) const\n-149 {\n-150 const std::size_t numCorners = hostLocalGeometry_.corners();\n-151 assert( size >= numCorners );\n-152 for( std::size_t i = 0; i < numCorners; ++i )\n-153 corners[ i ] = elementGeometry_.global( hostLocalGeometry_.corner( i ) );\n-154 }\n-155\n-156 template< unsigned int numCorners >\n-157 void calculate ( Coordinate (&corners)[ numCorners ] ) const\n-158 {\n-159 assert( numCorners == hostLocalGeometry_.corners() );\n-160 }\n-161\n-162 private:\n-163 const ElementGeometryImpl &elementGeometry_;\n-164 HostLocalGeometry hostLocalGeometry_;\n-165 };\n-166\n-167\n-168\n-169 // CornerStorage\n-170 // -------------\n-171\n-172 template< int mydim, int cdim, class Grid >\n-173 class CornerStorage\n-174 {\n-175 typedef typename std::remove_const< Grid >::type::Traits Traits;\n-176\n-177 typedef typename Traits::ctype ctype;\n-178 typedef FieldVector< ctype, cdim > Coordinate;\n-179\n-180 typedef std::array< Coordinate, (1 << mydim) > Coords;\n-181\n-182 public:\n-183 typedef typename Coords::const_iterator const_iterator;\n-184\n-185 template< bool fake >\n-186 explicit CornerStorage ( const CoordVector<_mydim,_Grid,_fake_> &coords )\n-187 {\n-188 coords.calculate( coords_ );\n-189 }\n-190\n-191 explicit CornerStorage ( const IntersectionCoordVector<_Grid_> &coords )\n-192 {\n-193 coords.calculate( coords_ );\n-194 }\n-195\n-196 const Coordinate &operator[]_( unsigned int i ) const\n-197 {\n-198 return coords_[ i ];\n-199 }\n-200\n-201 const_iterator begin () const { return coords_.begin(); }\n-202 const_iterator end () const { return coords_.end(); }\n-203\n-204 private:\n-205 Coords coords_;\n-206 };\n-207\n-208 } // namespace GeoGrid\n-209\n-210} // namespace Dune\n-211\n-212#endif // #ifndef DUNE_GEOGRID_CORNERSTORAGE_HH\n-coordfunctioncaller.hh\n+8namespace Dune\n+9{\n+10\n+11 template< class HostGrid, class CoordFunction, class Allocator >\n+12 class GeometryGrid;\n+13\n+14} // namespace Dune\n+15\n+16#endif // #ifndef DUNE_GEOGRID_DECLARATION_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::GeoGrid::CoordFunctionCaller\n-Definition coordfunctioncaller.hh:21\n-Dune::GeoGrid::CoordVector\n-Definition cornerstorage.hh:22\n-Dune::GeoGrid::CoordVector<_mydim,_Grid,_false_>::CoordVector\n-CoordVector(const HostEntity &hostEntity, const CoordFunction &coordFunction)\n-Definition cornerstorage.hh:48\n-Dune::GeoGrid::CoordVector<_mydim,_Grid,_false_>::calculate\n-void calculate(std::array< Coordinate, size >(&corners)) const\n-Definition cornerstorage.hh:54\n-Dune::GeoGrid::CoordVector<_mydim,_Grid,_true_>::CoordVector\n-CoordVector(const HostElement &hostElement, const unsigned int subEntity, const\n-CoordFunction &coordFunction)\n-Definition cornerstorage.hh:90\n-Dune::GeoGrid::CoordVector<_mydim,_Grid,_true_>::calculate\n-void calculate(std::array< Coordinate, size >(&corners)) const\n-Definition cornerstorage.hh:98\n-Dune::GeoGrid::IntersectionCoordVector\n-Definition cornerstorage.hh:123\n-Dune::GeoGrid::IntersectionCoordVector::IntersectionCoordVector\n-IntersectionCoordVector(const ElementGeometryImpl &elementGeometry, const\n-HostLocalGeometry &hostLocalGeometry)\n-Definition cornerstorage.hh:141\n-Dune::GeoGrid::IntersectionCoordVector::calculate\n-void calculate(Coordinate(&corners)[numCorners]) const\n-Definition cornerstorage.hh:157\n-Dune::GeoGrid::IntersectionCoordVector::calculate\n-void calculate(std::array< Coordinate, size >(&corners)) const\n-Definition cornerstorage.hh:148\n-Dune::GeoGrid::CornerStorage\n-Definition cornerstorage.hh:174\n-Dune::GeoGrid::CornerStorage::const_iterator\n-Coords::const_iterator const_iterator\n-Definition cornerstorage.hh:183\n-Dune::GeoGrid::CornerStorage::begin\n-const_iterator begin() const\n-Definition cornerstorage.hh:201\n-Dune::GeoGrid::CornerStorage::CornerStorage\n-CornerStorage(const IntersectionCoordVector< Grid > &coords)\n-Definition cornerstorage.hh:191\n-Dune::GeoGrid::CornerStorage::end\n-const_iterator end() const\n-Definition cornerstorage.hh:202\n-Dune::GeoGrid::CornerStorage::operator[]\n-const Coordinate & operator[](unsigned int i) const\n-Definition cornerstorage.hh:196\n-Dune::GeoGrid::CornerStorage::CornerStorage\n-CornerStorage(const CoordVector< mydim, Grid, fake > &coords)\n-Definition cornerstorage.hh:186\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00584.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00584.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: coordfunction.hh File Reference\n+dune-grid: identity.hh File Reference\n \n \n \n \n \n \n \n@@ -72,46 +72,31 @@\n
  • dune
  • grid
  • geometrygrid
  • \n \n \n
    \n \n-
    coordfunction.hh File Reference
    \n+
    identity.hh File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/std/type_traits.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 Classes

    class  Dune::AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >
     Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid. An implementation should be derived from Dune::AnalyticalCoordFunction and the evaluate method mapping \"$ has to be supplied. More...
     
    class  Dune::AnalyticalCoordFunction< ct, dimD, dimR, Impl >
     Derive an implementation of an analytical coordinate function from this class. More...
     
    class  Dune::DiscreteCoordFunctionInterface< ct, dimR, Impl >
     Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid. An implementation should be derived from Dune::DiscreteCoordinateFunction and the evaluate method taking an entity of the host grid together with the number of a vertex returns the coordinate in \"$ of that corner. The user must ensure continuity of this mapping. In addition an adapt method is provided which is called whenever adapt() is called on the Dune::GeometryGrid. More...
     
    class  Dune::DiscreteCoordFunction< ct, dimR, Impl >
     Derive an implementation of a discrete coordinate function from this class. More...
    class  Dune::IdenticalCoordFunction< ctype, dim >
     
    \n \n \n \n \n-\n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,45 +2,19 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n Classes | Namespaces\n-coordfunction.hh File Reference\n-#include \n-#include \n-#include \n+identity.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::AnalyticalCoordFunctionInterface<_ct,_dimD,_dimR,_Impl_>\n- Interface class for using an analytical function to define the geometry\n-\u00a0 of a Dune::GeometryGrid. An implementation should be derived from\n- Dune::AnalyticalCoordFunction and the evaluate method mapping [$ R^d\\to\n- R^r $]has to be supplied. More...\n-\u00a0\n-class \u00a0 Dune::AnalyticalCoordFunction<_ct,_dimD,_dimR,_Impl_>\n-\u00a0 Derive an implementation of an analytical coordinate function from this\n- class. More...\n-\u00a0\n-class \u00a0 Dune::DiscreteCoordFunctionInterface<_ct,_dimR,_Impl_>\n- Interface class for using a discrete function to define the geometry of\n- a Dune::GeometryGrid. An implementation should be derived from Dune::\n- DiscreteCoordinateFunction and the evaluate method taking an entity of\n-\u00a0 the host grid together with the number of a vertex returns the\n- coordinate in [$ R^r $]of that corner. The user must ensure continuity\n- of this mapping. In addition an adapt method is provided which is\n- called whenever adapt() is called on the Dune::GeometryGrid. More...\n-\u00a0\n-class \u00a0 Dune::DiscreteCoordFunction<_ct,_dimR,_Impl_>\n-\u00a0 Derive an implementation of a discrete coordinate function from this\n- class. More...\n+class \u00a0 Dune::IdenticalCoordFunction<_ctype,_dim_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::GeoGrid\n-\u00a0 namespace containing the implementations of GeometryGrid\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00584_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00584_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: coordfunction.hh Source File\n+dune-grid: identity.hh Source File\n \n \n \n \n \n \n \n@@ -74,370 +74,69 @@\n \n \n
    \n
    \n-
    coordfunction.hh
    \n+
    identity.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GEOGRID_COORDFUNCTION_HH
    \n-
    6#define DUNE_GEOGRID_COORDFUNCTION_HH
    \n+
    5#ifndef DUNE_GEOGRID_IDENTITY_HH
    \n+
    6#define DUNE_GEOGRID_IDENTITY_HH
    \n
    7
    \n-
    8#include <cassert>
    \n+\n
    9
    \n-
    10#include <dune/common/fvector.hh>
    \n-
    11#include <dune/common/std/type_traits.hh>
    \n+
    10namespace Dune
    \n+
    11{
    \n
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n-
    15
    \n-
    16 // Internal Forward Declarations
    \n-
    17 // -----------------------------
    \n-
    18
    \n-
    19 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n-
    20 class AnalyticalCoordFunction;
    \n-
    21
    \n-
    22 template< class ct, unsigned int dimR, class Impl >
    \n-
    23 class DiscreteCoordFunction;
    \n+
    13 template< class ctype, unsigned int dim >
    \n+
    \n+\n+\n+
    16 < ctype, dim, dim, IdenticalCoordFunction< ctype, dim > >
    \n+
    17 {
    \n+\n+\n+
    20
    \n+
    21 public:
    \n+
    22 typedef typename Base :: DomainVector DomainVector;
    \n+
    23 typedef typename Base :: RangeVector RangeVector;
    \n
    24
    \n-
    25
    \n-
    26
    \n-
    27 // AnalyticalCoordFunctionInterface
    \n-
    28 // --------------------------------
    \n-
    29
    \n-
    42 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n-
    \n-\n-
    44 {
    \n-\n-
    46
    \n-
    47 friend class AnalyticalCoordFunction< ct, dimD, dimR, Impl >;
    \n-
    48
    \n-
    49 public:
    \n-
    50 typedef This Interface;
    \n-
    51 typedef Impl Implementation;
    \n-
    52
    \n-
    54 typedef ct ctype;
    \n-
    55
    \n-
    57 static const unsigned int dimDomain = dimD;
    \n-
    59 static const unsigned int dimRange = dimR;
    \n-
    60
    \n-
    62 typedef FieldVector< ctype, dimDomain > DomainVector;
    \n-
    64 typedef FieldVector< ctype, dimRange > RangeVector;
    \n-
    65
    \n-
    66 private:
    \n-\n-
    68 AnalyticalCoordFunctionInterface ( const This & ) = default;
    \n-\n-\n-
    71 This &operator= ( const This & ) = default;
    \n-
    72 This &operator= ( This && ) = default;
    \n-
    73
    \n-
    74 // helper for picking the correct version of evaluate further down
    \n-
    75 template<typename F, typename DV>
    \n-
    76 using has_operator_parentheses = decltype(std::declval<F>()(std::declval<DV>()));
    \n-
    77
    \n-
    78 public:
    \n-
    79
    \n-
    80#ifdef DOXYGEN
    \n-
    81
    \n-
    83 void evaluate ( const DomainVector &x, RangeVector &y ) const;
    \n-
    84
    \n-
    85#else
    \n-
    86
    \n-
    87 template<typename DV>
    \n-
    88 std::enable_if_t<
    \n-
    89 Std::is_detected<has_operator_parentheses,Impl,DV>::value
    \n-
    90 >
    \n-
    91 evaluate ( const DV &x, RangeVector &y ) const
    \n-
    92 {
    \n-
    93 y = asImp()(x);
    \n-
    94 }
    \n-
    95
    \n-
    96 template<typename DV>
    \n-
    97 std::enable_if_t<
    \n-
    98 not Std::is_detected<has_operator_parentheses,Impl,DV>::value
    \n-
    99 >
    \n-
    100 evaluate ( const DV &x, RangeVector &y ) const
    \n-
    101 {
    \n-
    102 assert(
    \n-
    103 static_cast<void(This::*)(const DomainVector&, RangeVector&) const>(&This::evaluate) !=
    \n-
    104 static_cast<void(Impl::*)(const DomainVector&, RangeVector&) const>(&Impl::evaluate) &&
    \n-
    105 "You need to implement either operator() or evaluate() in your coordinate function!");
    \n-
    106 asImp().evaluate( x, y );
    \n-
    107 }
    \n-
    108
    \n-
    109#endif // DOXYGEN
    \n-
    110
    \n-
    111 protected:
    \n-
    112
    \n-
    \n-
    113 const Implementation &asImp () const
    \n-
    114 {
    \n-
    115 return static_cast< const Implementation & >( *this );
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    \n-\n-
    119 {
    \n-
    120 return static_cast< Implementation & >( *this );
    \n-
    121 }
    \n-
    \n-
    122 };
    \n-
    \n-
    123
    \n-
    124
    \n-
    125
    \n-
    126 // AnalyticalCoordFunction
    \n-
    127 // -----------------------
    \n-
    131 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n-
    \n-\n-
    133 : public AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >
    \n-
    134 {
    \n-\n-\n-
    137
    \n-
    138 public:
    \n-
    139 typedef typename Base :: DomainVector DomainVector;
    \n-
    140 typedef typename Base :: RangeVector RangeVector;
    \n-
    141
    \n-
    142 protected:
    \n-\n-
    144 AnalyticalCoordFunction ( const This & ) = default;
    \n-\n-\n-
    147 This &operator= ( const This & ) = default;
    \n-
    148 This &operator= ( This && ) = default;
    \n-
    149
    \n-
    150 private:
    \n-
    151
    \n-
    152 };
    \n-
    \n-
    153
    \n-
    154
    \n-
    155
    \n-
    156 // DiscreteCoordFunctionInterface
    \n-
    157 // ------------------------------
    \n-
    158
    \n-
    173 template< class ct, unsigned int dimR, class Impl >
    \n-
    \n-\n-
    175 {
    \n-\n-
    177
    \n-
    178 friend class DiscreteCoordFunction< ct, dimR, Impl >;
    \n-
    179
    \n-
    180 public:
    \n-\n-
    182 typedef Impl Implementation;
    \n-
    183
    \n-
    185 typedef ct ctype;
    \n-
    186
    \n-
    188 static const unsigned int dimRange = dimR;
    \n-
    189
    \n-
    191 typedef FieldVector< ctype, dimRange > RangeVector;
    \n-
    192
    \n-
    193 private:
    \n-\n-
    195 DiscreteCoordFunctionInterface ( const This & ) = default;
    \n-
    196 DiscreteCoordFunctionInterface ( This && ) = default;
    \n-\n-
    198 This &operator= ( const This & ) = default;
    \n-
    199 This &operator= ( This && ) = default;
    \n-
    200
    \n-
    201 public:
    \n-
    210 template< class HostEntity >
    \n-
    \n-
    211 void evaluate ( const HostEntity &hostEntity, unsigned int corner,
    \n-
    212 RangeVector &y ) const
    \n-
    213 {
    \n-
    214 asImp().evaluate( hostEntity, corner, y );
    \n-
    215 }
    \n-
    \n-
    216
    \n-
    \n-
    220 void adapt ()
    \n-
    221 {
    \n-
    222 asImp().adapt();
    \n-
    223 }
    \n-
    \n-
    224
    \n-
    225 protected:
    \n-
    \n-
    226 const Implementation &asImp () const
    \n-
    227 {
    \n-
    228 return static_cast< const Implementation & >( *this );
    \n-
    229 }
    \n-
    \n-
    230
    \n-
    \n-\n-
    232 {
    \n-
    233 return static_cast< Implementation & >( *this );
    \n-
    234 }
    \n-
    \n-
    235 };
    \n-
    \n-
    236
    \n-
    237
    \n-
    238
    \n-
    239 // DiscreteCoordFunction
    \n-
    240 // ---------------------
    \n-
    241 //
    \n-
    245 template< class ct, unsigned int dimR, class Impl >
    \n-
    \n-\n-
    247 : public DiscreteCoordFunctionInterface< ct, dimR, Impl >
    \n-
    248 {
    \n-\n-\n-
    251
    \n-
    252 public:
    \n-
    253 typedef typename Base :: RangeVector RangeVector;
    \n-
    254
    \n-
    255 protected:
    \n-\n-
    257 DiscreteCoordFunction ( const This & ) = default;
    \n-
    258 DiscreteCoordFunction ( This && ) = default;
    \n-\n-
    260 This &operator= ( const This & ) = default;
    \n-
    261 This &operator= ( This && ) = default;
    \n-
    262
    \n-
    \n-
    263 void adapt ()
    \n-
    264 {}
    \n-
    \n-
    265
    \n-
    266 private:
    \n-
    267 template< class HostEntity >
    \n-
    268 void evaluate ( const HostEntity &hostEntity, unsigned int corner,
    \n-
    269 RangeVector &y ) const;
    \n-
    270 };
    \n-
    \n-
    271
    \n-
    272
    \n-
    273
    \n-
    274 namespace GeoGrid
    \n-
    275 {
    \n-
    276
    \n-
    277 // isCoordFunctionInterface
    \n-
    278 // ------------------------
    \n-
    279
    \n-
    280 template< class CoordFunctionInterface >
    \n-
    281 struct isCoordFunctionInterface
    \n-
    282 {
    \n-
    283 static const bool value = false;
    \n-
    284 };
    \n-
    285
    \n-
    286 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n-
    287 struct isCoordFunctionInterface
    \n-
    288 < AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl > >
    \n-
    289 {
    \n-
    290 static const bool value = true;
    \n-
    291 };
    \n-
    292
    \n-
    293 template< class ct, unsigned int dimR, class Impl >
    \n-
    294 struct isCoordFunctionInterface
    \n-
    295 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >
    \n-
    296 {
    \n-
    297 static const bool value = true;
    \n-
    298 };
    \n-
    299
    \n-
    300
    \n-
    301
    \n-
    302 // isDiscreteCoordFunctionInterface
    \n-
    303 // --------------------------------
    \n-
    304
    \n-
    305 template< class CoordFunctionInterface >
    \n-
    306 struct isDiscreteCoordFunctionInterface
    \n-
    307 {
    \n-
    308 static const bool value = false;
    \n-
    309 };
    \n-
    310
    \n-
    311 template< class ct, unsigned int dimR, class Impl >
    \n-
    312 struct isDiscreteCoordFunctionInterface
    \n-
    313 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >
    \n-
    314 {
    \n-
    315 static const bool value = true;
    \n-
    316 };
    \n-
    317
    \n-
    318
    \n-
    319
    \n-
    320 // AdaptCoordFunction
    \n-
    321 // ------------------
    \n-
    322
    \n-
    323 template< class CoordFunctionInterface >
    \n-
    324 struct AdaptCoordFunction
    \n-
    325 {
    \n-
    326 static void adapt ( CoordFunctionInterface & )
    \n-
    327 {}
    \n-
    328 };
    \n-
    329
    \n-
    330 template< class ct, unsigned int dimR, class Impl >
    \n-
    331 struct AdaptCoordFunction< DiscreteCoordFunctionInterface< ct, dimR, Impl > >
    \n-
    332 {
    \n-
    333 typedef DiscreteCoordFunctionInterface< ct, dimR, Impl > CoordFunctionInterface;
    \n-
    334
    \n-
    335 static void adapt ( CoordFunctionInterface &coordFunction )
    \n-
    336 {
    \n-
    337 coordFunction.adapt();
    \n-
    338 }
    \n-
    339 };
    \n-
    340
    \n-
    341 } // namespace GeoGrid
    \n-
    342
    \n-
    343} // namespace Dune
    \n-
    344
    \n-
    345#endif // #ifndef DUNE_GEOGRID_COORDFUNCTION_HH
    \n+
    25 template< typename... Args >
    \n+
    \n+\n+
    27 {}
    \n+
    \n+
    28
    \n+
    \n+\n+
    30 {
    \n+
    31 return x;
    \n+
    32 }
    \n+
    \n+
    33
    \n+
    34 };
    \n+
    \n+
    35
    \n+
    36}
    \n+
    37
    \n+
    38#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Derive an implementation of an analytical coordinate function from this class.
    Definition coordfunction.hh:134
    \n-
    Base::DomainVector DomainVector
    Definition coordfunction.hh:139
    \n-\n-\n-
    AnalyticalCoordFunction(This &&)=default
    \n-
    Base::RangeVector RangeVector
    Definition coordfunction.hh:140
    \n-
    This & operator=(const This &)=default
    \n-
    AnalyticalCoordFunction(const This &)=default
    \n-
    Derive an implementation of a discrete coordinate function from this class.
    Definition coordfunction.hh:248
    \n-
    This & operator=(const This &)=default
    \n-
    void adapt()
    Definition coordfunction.hh:263
    \n-\n-
    DiscreteCoordFunction(This &&)=default
    \n-\n-
    DiscreteCoordFunction(const This &)=default
    \n-
    Base::RangeVector RangeVector
    Definition coordfunction.hh:253
    \n-
    Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid....
    Definition coordfunction.hh:44
    \n-
    Impl Implementation
    Definition coordfunction.hh:51
    \n-
    FieldVector< ctype, dimRange > RangeVector
    range vector for the evaluate method
    Definition coordfunction.hh:64
    \n-
    void evaluate(const DomainVector &x, RangeVector &y) const
    evaluate method for global mapping
    \n-
    static const unsigned int dimRange
    dimension of the range vector
    Definition coordfunction.hh:59
    \n-
    ct ctype
    field type of the coordinate vector
    Definition coordfunction.hh:54
    \n-
    static const unsigned int dimDomain
    dimension of the range vector (dimensionworld of host grid)
    Definition coordfunction.hh:57
    \n-
    const Implementation & asImp() const
    Definition coordfunction.hh:113
    \n-
    This Interface
    Definition coordfunction.hh:50
    \n-
    Implementation & asImp()
    Definition coordfunction.hh:118
    \n-
    FieldVector< ctype, dimDomain > DomainVector
    domain vector for the evaluate method
    Definition coordfunction.hh:62
    \n-
    Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid....
    Definition coordfunction.hh:175
    \n-
    static const unsigned int dimRange
    dimension of the range vector
    Definition coordfunction.hh:188
    \n-
    void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
    evaluate method
    Definition coordfunction.hh:211
    \n-
    Implementation & asImp()
    Definition coordfunction.hh:231
    \n-
    ct ctype
    field type of the coordinate vector
    Definition coordfunction.hh:185
    \n-
    void adapt()
    method called from grid.adapt() method to allow adaptation of the discrete coordinate function
    Definition coordfunction.hh:220
    \n-
    FieldVector< ctype, dimRange > RangeVector
    range vector for the evaluate method
    Definition coordfunction.hh:191
    \n-
    const Implementation & asImp() const
    Definition coordfunction.hh:226
    \n-
    Impl Implementation
    Definition coordfunction.hh:182
    \n-
    This Interface
    Definition coordfunction.hh:181
    \n+
    Definition identity.hh:17
    \n+
    IdenticalCoordFunction(Args &...)
    Definition identity.hh:26
    \n+
    Base::RangeVector RangeVector
    Definition identity.hh:23
    \n+
    RangeVector operator()(const DomainVector &x) const
    Definition identity.hh:29
    \n+
    Base::DomainVector DomainVector
    Definition identity.hh:22
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,429 +1,71 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n-coordfunction.hh\n+identity.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GEOGRID_COORDFUNCTION_HH\n-6#define DUNE_GEOGRID_COORDFUNCTION_HH\n+5#ifndef DUNE_GEOGRID_IDENTITY_HH\n+6#define DUNE_GEOGRID_IDENTITY_HH\n 7\n-8#include \n+8#include \n 9\n-10#include \n-11#include \n+10namespace Dune\n+11{\n 12\n-13namespace Dune\n-14{\n-15\n-16 // Internal Forward Declarations\n-17 // -----------------------------\n-18\n-19 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n-20 class AnalyticalCoordFunction;\n-21\n-22 template< class ct, unsigned int dimR, class Impl >\n-23 class DiscreteCoordFunction;\n+13 template< class ctype, unsigned int dim >\n+14 class IdenticalCoordFunction\n+15 : public AnalyticalCoordFunction\n+16 < ctype, dim, dim, IdenticalCoordFunction< ctype, dim > >\n+17 {\n+18 typedef IdenticalCoordFunction<_ctype,_dim_> This;\n+19 typedef AnalyticalCoordFunction<_ctype,_dim,_dim,_This_> Base;\n+20\n+21 public:\n+22 typedef typename Base :: DomainVector DomainVector;\n+23 typedef typename Base :: RangeVector RangeVector;\n 24\n-25\n-26\n-27 // AnalyticalCoordFunctionInterface\n-28 // --------------------------------\n-29\n-42 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n-43 class AnalyticalCoordFunctionInterface\n-44 {\n-45 typedef AnalyticalCoordFunctionInterface<_ct,_dimD,_dimR,_Impl_> This;\n-46\n-47 friend class AnalyticalCoordFunction< ct, dimD, dimR, Impl >;\n-48\n-49 public:\n-50 typedef This Interface;\n-51 typedef Impl Implementation;\n-52\n-54 typedef ct ctype;\n-55\n-57 static const unsigned int dimDomain = dimD;\n-59 static const unsigned int dimRange = dimR;\n-60\n-62 typedef FieldVector< ctype, dimDomain > DomainVector;\n-64 typedef FieldVector< ctype, dimRange > RangeVector;\n-65\n-66 private:\n-67 AnalyticalCoordFunctionInterface () = default;\n-68 AnalyticalCoordFunctionInterface ( const This & ) = default;\n-69 AnalyticalCoordFunctionInterface ( This && ) = default;\n-70 ~AnalyticalCoordFunctionInterface () = default;\n-71 This &operator= ( const This & ) = default;\n-72 This &operator= ( This && ) = default;\n-73\n-74 // helper for picking the correct version of evaluate further down\n-75 template\n-76 using has_operator_parentheses = decltype(std::declval()(std::declval\n-()));\n-77\n-78 public:\n-79\n-80#ifdef DOXYGEN\n-81\n-83 void evaluate ( const DomainVector &x, RangeVector &y ) const;\n-84\n-85#else\n-86\n-87 template\n-88 std::enable_if_t<\n-89 Std::is_detected::value\n-90 >\n-91 evaluate ( const DV &x, RangeVector &y ) const\n-92 {\n-93 y = asImp()(x);\n-94 }\n-95\n-96 template\n-97 std::enable_if_t<\n-98 not Std::is_detected::value\n-99 >\n-100 evaluate ( const DV &x, RangeVector &y ) const\n-101 {\n-102 assert(\n-103 static_cast(&This::\n-evaluate) !=\n-104 static_cast(&Impl::\n-evaluate) &&\n-105 \"You need to implement either operator() or evaluate() in your coordinate\n-function!\");\n-106 asImp().evaluate( x, y );\n-107 }\n-108\n-109#endif // DOXYGEN\n-110\n-111 protected:\n-112\n-113 const Implementation &asImp () const\n-114 {\n-115 return static_cast< const Implementation & >( *this );\n-116 }\n-117\n-118 Implementation &asImp ()\n-119 {\n-120 return static_cast< Implementation & >( *this );\n-121 }\n-122 };\n-123\n-124\n-125\n-126 // AnalyticalCoordFunction\n-127 // -----------------------\n-131 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n-132 class AnalyticalCoordFunction\n-133 : public AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >\n-134 {\n-135 typedef AnalyticalCoordFunction<_ct,_dimD,_dimR,_Impl_> This;\n-136 typedef AnalyticalCoordFunctionInterface<_ct,_dimD,_dimR,_Impl_> Base;\n-137\n-138 public:\n-139 typedef typename Base :: DomainVector DomainVector;\n-140 typedef typename Base :: RangeVector RangeVector;\n-141\n-142 protected:\n-143 AnalyticalCoordFunction () = default;\n-144 AnalyticalCoordFunction ( const This & ) = default;\n-145 AnalyticalCoordFunction ( This && ) = default;\n-146 ~AnalyticalCoordFunction () = default;\n-147 This &operator=_( const This & ) = default;\n-148 This &operator=_( This && ) = default;\n-149\n-150 private:\n-151\n-152 };\n-153\n-154\n-155\n-156 // DiscreteCoordFunctionInterface\n-157 // ------------------------------\n-158\n-173 template< class ct, unsigned int dimR, class Impl >\n-174 class DiscreteCoordFunctionInterface\n-175 {\n-176 typedef DiscreteCoordFunctionInterface<_ct,_dimR,_Impl_> This;\n-177\n-178 friend class DiscreteCoordFunction< ct, dimR, Impl >;\n-179\n-180 public:\n-181 typedef This Interface;\n-182 typedef Impl Implementation;\n-183\n-185 typedef ct ctype;\n-186\n-188 static const unsigned int dimRange = dimR;\n-189\n-191 typedef FieldVector< ctype, dimRange > RangeVector;\n-192\n-193 private:\n-194 DiscreteCoordFunctionInterface () = default;\n-195 DiscreteCoordFunctionInterface ( const This & ) = default;\n-196 DiscreteCoordFunctionInterface ( This && ) = default;\n-197 ~DiscreteCoordFunctionInterface () = default;\n-198 This &operator= ( const This & ) = default;\n-199 This &operator= ( This && ) = default;\n-200\n-201 public:\n-210 template< class HostEntity >\n-211 void evaluate ( const HostEntity &hostEntity, unsigned int corner,\n-212 RangeVector &y ) const\n-213 {\n-214 asImp().evaluate( hostEntity, corner, y );\n-215 }\n-216\n-220 void adapt ()\n-221 {\n-222 asImp().adapt();\n-223 }\n-224\n-225 protected:\n-226 const Implementation &asImp () const\n-227 {\n-228 return static_cast< const Implementation & >( *this );\n-229 }\n-230\n-231 Implementation &asImp ()\n-232 {\n-233 return static_cast< Implementation & >( *this );\n-234 }\n-235 };\n-236\n-237\n-238\n-239 // DiscreteCoordFunction\n-240 // ---------------------\n-241 //\n-245 template< class ct, unsigned int dimR, class Impl >\n-246 class DiscreteCoordFunction\n-247 : public DiscreteCoordFunctionInterface< ct, dimR, Impl >\n-248 {\n-249 typedef DiscreteCoordFunction<_ct,_dimR,_Impl_> This;\n-250 typedef DiscreteCoordFunctionInterface<_ct,_dimR,_Impl_> Base;\n-251\n-252 public:\n-253 typedef typename Base :: RangeVector RangeVector;\n-254\n-255 protected:\n-256 DiscreteCoordFunction () = default;\n-257 DiscreteCoordFunction ( const This & ) = default;\n-258 DiscreteCoordFunction ( This && ) = default;\n-259 ~DiscreteCoordFunction () = default;\n-260 This &operator=_( const This & ) = default;\n-261 This &operator=_( This && ) = default;\n-262\n-263 void adapt ()\n-264 {}\n-265\n-266 private:\n-267 template< class HostEntity >\n-268 void evaluate ( const HostEntity &hostEntity, unsigned int corner,\n-269 RangeVector &y ) const;\n-270 };\n-271\n-272\n-273\n-274 namespace GeoGrid\n-275 {\n-276\n-277 // isCoordFunctionInterface\n-278 // ------------------------\n-279\n-280 template< class CoordFunctionInterface >\n-281 struct isCoordFunctionInterface\n-282 {\n-283 static const bool value = false;\n-284 };\n-285\n-286 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n-287 struct isCoordFunctionInterface\n-288 < AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl > >\n-289 {\n-290 static const bool value = true;\n-291 };\n-292\n-293 template< class ct, unsigned int dimR, class Impl >\n-294 struct isCoordFunctionInterface\n-295 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >\n-296 {\n-297 static const bool value = true;\n-298 };\n-299\n-300\n-301\n-302 // isDiscreteCoordFunctionInterface\n-303 // --------------------------------\n-304\n-305 template< class CoordFunctionInterface >\n-306 struct isDiscreteCoordFunctionInterface\n-307 {\n-308 static const bool value = false;\n-309 };\n-310\n-311 template< class ct, unsigned int dimR, class Impl >\n-312 struct isDiscreteCoordFunctionInterface\n-313 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >\n-314 {\n-315 static const bool value = true;\n-316 };\n-317\n-318\n-319\n-320 // AdaptCoordFunction\n-321 // ------------------\n-322\n-323 template< class CoordFunctionInterface >\n-324 struct AdaptCoordFunction\n-325 {\n-326 static void adapt ( CoordFunctionInterface & )\n-327 {}\n-328 };\n-329\n-330 template< class ct, unsigned int dimR, class Impl >\n-331 struct AdaptCoordFunction< DiscreteCoordFunctionInterface< ct, dimR, Impl >\n->\n-332 {\n-333 typedef DiscreteCoordFunctionInterface< ct, dimR, Impl >\n-CoordFunctionInterface;\n-334\n-335 static void adapt ( CoordFunctionInterface &coordFunction )\n-336 {\n-337 coordFunction.adapt();\n-338 }\n-339 };\n-340\n-341 } // namespace GeoGrid\n-342\n-343} // namespace Dune\n-344\n-345#endif // #ifndef DUNE_GEOGRID_COORDFUNCTION_HH\n+25 template< typename... Args >\n+26 IdenticalCoordFunction( Args&... )\n+27 {}\n+28\n+29 RangeVector operator()(const DomainVector& x) const\n+30 {\n+31 return x;\n+32 }\n+33\n+34 };\n+35\n+36}\n+37\n+38#endif\n+coordfunction.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::AnalyticalCoordFunction\n Derive an implementation of an analytical coordinate function from this class.\n Definition coordfunction.hh:134\n-Dune::AnalyticalCoordFunction::DomainVector\n-Base::DomainVector DomainVector\n-Definition coordfunction.hh:139\n-Dune::AnalyticalCoordFunction::AnalyticalCoordFunction\n-AnalyticalCoordFunction()=default\n-Dune::AnalyticalCoordFunction::~AnalyticalCoordFunction\n-~AnalyticalCoordFunction()=default\n-Dune::AnalyticalCoordFunction::AnalyticalCoordFunction\n-AnalyticalCoordFunction(This &&)=default\n-Dune::AnalyticalCoordFunction::RangeVector\n+Dune::IdenticalCoordFunction\n+Definition identity.hh:17\n+Dune::IdenticalCoordFunction::IdenticalCoordFunction\n+IdenticalCoordFunction(Args &...)\n+Definition identity.hh:26\n+Dune::IdenticalCoordFunction::RangeVector\n Base::RangeVector RangeVector\n-Definition coordfunction.hh:140\n-Dune::AnalyticalCoordFunction::operator=\n-This & operator=(const This &)=default\n-Dune::AnalyticalCoordFunction::AnalyticalCoordFunction\n-AnalyticalCoordFunction(const This &)=default\n-Dune::DiscreteCoordFunction\n-Derive an implementation of a discrete coordinate function from this class.\n-Definition coordfunction.hh:248\n-Dune::DiscreteCoordFunction::operator=\n-This & operator=(const This &)=default\n-Dune::DiscreteCoordFunction::adapt\n-void adapt()\n-Definition coordfunction.hh:263\n-Dune::DiscreteCoordFunction::DiscreteCoordFunction\n-DiscreteCoordFunction()=default\n-Dune::DiscreteCoordFunction::DiscreteCoordFunction\n-DiscreteCoordFunction(This &&)=default\n-Dune::DiscreteCoordFunction::~DiscreteCoordFunction\n-~DiscreteCoordFunction()=default\n-Dune::DiscreteCoordFunction::DiscreteCoordFunction\n-DiscreteCoordFunction(const This &)=default\n-Dune::DiscreteCoordFunction::RangeVector\n-Base::RangeVector RangeVector\n-Definition coordfunction.hh:253\n-Dune::AnalyticalCoordFunctionInterface\n-Interface class for using an analytical function to define the geometry of a\n-Dune::GeometryGrid....\n-Definition coordfunction.hh:44\n-Dune::AnalyticalCoordFunctionInterface::Implementation\n-Impl Implementation\n-Definition coordfunction.hh:51\n-Dune::AnalyticalCoordFunctionInterface::RangeVector\n-FieldVector< ctype, dimRange > RangeVector\n-range vector for the evaluate method\n-Definition coordfunction.hh:64\n-Dune::AnalyticalCoordFunctionInterface::evaluate\n-void evaluate(const DomainVector &x, RangeVector &y) const\n-evaluate method for global mapping\n-Dune::AnalyticalCoordFunctionInterface::dimRange\n-static const unsigned int dimRange\n-dimension of the range vector\n-Definition coordfunction.hh:59\n-Dune::AnalyticalCoordFunctionInterface::ctype\n-ct ctype\n-field type of the coordinate vector\n-Definition coordfunction.hh:54\n-Dune::AnalyticalCoordFunctionInterface::dimDomain\n-static const unsigned int dimDomain\n-dimension of the range vector (dimensionworld of host grid)\n-Definition coordfunction.hh:57\n-Dune::AnalyticalCoordFunctionInterface::asImp\n-const Implementation & asImp() const\n-Definition coordfunction.hh:113\n-Dune::AnalyticalCoordFunctionInterface::Interface\n-This Interface\n-Definition coordfunction.hh:50\n-Dune::AnalyticalCoordFunctionInterface::asImp\n-Implementation & asImp()\n-Definition coordfunction.hh:118\n-Dune::AnalyticalCoordFunctionInterface::DomainVector\n-FieldVector< ctype, dimDomain > DomainVector\n-domain vector for the evaluate method\n-Definition coordfunction.hh:62\n-Dune::DiscreteCoordFunctionInterface\n-Interface class for using a discrete function to define the geometry of a\n-Dune::GeometryGrid....\n-Definition coordfunction.hh:175\n-Dune::DiscreteCoordFunctionInterface::dimRange\n-static const unsigned int dimRange\n-dimension of the range vector\n-Definition coordfunction.hh:188\n-Dune::DiscreteCoordFunctionInterface::evaluate\n-void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector\n-&y) const\n-evaluate method\n-Definition coordfunction.hh:211\n-Dune::DiscreteCoordFunctionInterface::asImp\n-Implementation & asImp()\n-Definition coordfunction.hh:231\n-Dune::DiscreteCoordFunctionInterface::ctype\n-ct ctype\n-field type of the coordinate vector\n-Definition coordfunction.hh:185\n-Dune::DiscreteCoordFunctionInterface::adapt\n-void adapt()\n-method called from grid.adapt() method to allow adaptation of the discrete\n-coordinate function\n-Definition coordfunction.hh:220\n-Dune::DiscreteCoordFunctionInterface::RangeVector\n-FieldVector< ctype, dimRange > RangeVector\n-range vector for the evaluate method\n-Definition coordfunction.hh:191\n-Dune::DiscreteCoordFunctionInterface::asImp\n-const Implementation & asImp() const\n-Definition coordfunction.hh:226\n-Dune::DiscreteCoordFunctionInterface::Implementation\n-Impl Implementation\n-Definition coordfunction.hh:182\n-Dune::DiscreteCoordFunctionInterface::Interface\n-This Interface\n-Definition coordfunction.hh:181\n+Definition identity.hh:23\n+Dune::IdenticalCoordFunction::operator()\n+RangeVector operator()(const DomainVector &x) const\n+Definition identity.hh:29\n+Dune::IdenticalCoordFunction::DomainVector\n+Base::DomainVector DomainVector\n+Definition identity.hh:22\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00590.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00590.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: iterator.hh File Reference\n+dune-grid: cachedcoordfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -72,46 +72,32 @@\n
  • dune
  • grid
  • geometrygrid
  • \n \n \n
    \n \n-
    iterator.hh File Reference
    \n+
    cachedcoordfunction.hh File Reference
    \n
    \n
    \n
    #include <cassert>
    \n-#include <type_traits>
    \n-#include <utility>
    \n-#include <dune/geometry/referenceelements.hh>
    \n+#include <memory>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n #include <dune/grid/geometrygrid/capabilities.hh>
    \n-#include <dune/grid/geometrygrid/declaration.hh>
    \n-#include <dune/grid/geometrygrid/entity.hh>
    \n+#include <dune/grid/geometrygrid/coordfunctioncaller.hh>
    \n+#include <dune/grid/utility/persistentcontainer.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::GeoGrid::PartitionIteratorFilter< codim, Interior_Partition, Grid >
    class  Dune::GeoGrid::CoordCache< HostGrid, Coordinate >
     
    struct  Dune::GeoGrid::PartitionIteratorFilter< codim, InteriorBorder_Partition, Grid >
     
    struct  Dune::GeoGrid::PartitionIteratorFilter< codim, Overlap_Partition, Grid >
     
    struct  Dune::GeoGrid::PartitionIteratorFilter< codim, OverlapFront_Partition, Grid >
     
    struct  Dune::GeoGrid::PartitionIteratorFilter< codim, All_Partition, Grid >
     
    struct  Dune::GeoGrid::PartitionIteratorFilter< codim, Ghost_Partition, Grid >
     
    class  Dune::GeoGrid::Iterator< HostGridView, codim, pitype, G, false >
     
    class  Dune::GeoGrid::Iterator< HostGridView, codim, pitype, G, true >
     
    class  Dune::GeoGrid::HierarchicIterator< G >
    class  Dune::CachedCoordFunction< HostGrid, CoordFunction >
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,45 +2,27 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n Classes | Namespaces\n-iterator.hh File Reference\n+cachedcoordfunction.hh File Reference\n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n #include \n-#include \n-#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::GeoGrid::PartitionIteratorFilter<_codim,_Interior_Partition,\n- Grid_>\n+class \u00a0 Dune::GeoGrid::CoordCache<_HostGrid,_Coordinate_>\n \u00a0\n-struct \u00a0 Dune::GeoGrid::PartitionIteratorFilter<_codim,_InteriorBorder_\n- Partition,_Grid_>\n-\u00a0\n-struct \u00a0 Dune::GeoGrid::PartitionIteratorFilter<_codim,_Overlap_Partition,_Grid\n- >\n-\u00a0\n-struct \u00a0 Dune::GeoGrid::PartitionIteratorFilter<_codim,_OverlapFront_Partition,\n- Grid_>\n-\u00a0\n-struct \u00a0 Dune::GeoGrid::PartitionIteratorFilter<_codim,_All_Partition,_Grid_>\n-\u00a0\n-struct \u00a0 Dune::GeoGrid::PartitionIteratorFilter<_codim,_Ghost_Partition,_Grid_>\n-\u00a0\n- class \u00a0 Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>\n-\u00a0\n- class \u00a0 Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>\n-\u00a0\n- class \u00a0 Dune::GeoGrid::HierarchicIterator<_G_>\n+class \u00a0 Dune::CachedCoordFunction<_HostGrid,_CoordFunction_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::GeoGrid\n \u00a0 namespace containing the implementations of GeometryGrid\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00590_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00590_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: iterator.hh Source File\n+dune-grid: cachedcoordfunction.hh Source File\n \n \n \n \n \n \n \n@@ -74,592 +74,270 @@\n \n \n \n
    \n-
    iterator.hh
    \n+
    cachedcoordfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GEOGRID_ITERATOR_HH
    \n-
    6#define DUNE_GEOGRID_ITERATOR_HH
    \n+
    5#ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH
    \n+
    6#define DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH
    \n
    7
    \n
    8#include <cassert>
    \n-
    9
    \n-
    10#include <type_traits>
    \n-
    11#include <utility>
    \n+
    9#include <memory>
    \n+
    10
    \n+
    11#include <dune/common/typetraits.hh>
    \n
    12
    \n-
    13#include <dune/geometry/referenceelements.hh>
    \n+\n
    14
    \n \n-\n-\n+\n+\n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n-
    22 namespace GeoGrid
    \n-
    23 {
    \n+
    22 // Internal Forward Declarations
    \n+
    23 // -----------------------------
    \n
    24
    \n-
    25 // Internal Forward Declarations
    \n-
    26 // -----------------------------
    \n+
    25 template< class HostGrid, class CoordFunction >
    \n+
    26 class CachedCoordFunction;
    \n
    27
    \n-
    28 template< class HostGridView, int codim, PartitionIteratorType pitype, class Grid,
    \n-
    29 bool fake = !Capabilities::hasHostEntity< Grid, codim >::v >
    \n-
    30 class Iterator;
    \n-
    31
    \n-
    32 template< class Grid >
    \n-\n-
    34
    \n+
    28
    \n+
    29
    \n+
    30 // GeoGrid::CoordCache
    \n+
    31 // -------------------
    \n+
    32
    \n+
    33 namespace GeoGrid
    \n+
    34 {
    \n
    35
    \n-
    36
    \n-
    37 // PartitionIteratorFilter
    \n-
    38 // -----------------------
    \n-
    39
    \n-
    40 template< int codim, PartitionIteratorType pitype, class Grid >
    \n-\n+
    36 template< class HostGrid, class Coordinate >
    \n+
    \n+\n+
    38 {
    \n+\n+
    40
    \n+
    41 static const unsigned int dimension = HostGrid::dimension;
    \n
    42
    \n-
    43 template< int codim, class Grid >
    \n-
    \n-\n-
    45 {
    \n-
    46 static const int dimension = std::remove_const< Grid >::type::dimension;
    \n-
    47 static const int codimension = codim;
    \n-
    48
    \n-
    49 static const PartitionIteratorType Element_Partition = Interior_Partition;
    \n-
    50
    \n-
    51 typedef typename std::remove_const< Grid >::type::ctype ctype;
    \n-
    52 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element;
    \n-
    53 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement RefElement;
    \n-
    54
    \n-
    \n-
    55 static bool apply ( const RefElement &refElement,
    \n-
    56 const Element &element, int subEntity )
    \n-
    57 {
    \n-
    58 const int size = refElement.size( subEntity, codim, dimension );
    \n-
    59 for( int i = 0; i < size; ++i )
    \n-
    60 {
    \n-
    61 const int j = refElement.subEntity( subEntity, codim, i, dimension );
    \n-
    62 PartitionType type = element.template subEntity< dimension >( j ).partitionType();
    \n-
    63 if( type == InteriorEntity )
    \n-
    64 return true;
    \n-
    65 }
    \n-
    66 return false;
    \n-
    67 }
    \n-
    \n-
    68 };
    \n+
    43 typedef typename HostGrid::template Codim< dimension >::Entity Vertex;
    \n+
    44
    \n+\n+
    46
    \n+
    47 public:
    \n+
    \n+
    48 explicit CoordCache ( const HostGrid &hostGrid )
    \n+
    49 : data_( hostGrid, dimension )
    \n+
    50 {}
    \n+
    \n+
    51
    \n+
    52 template< class Entity >
    \n+
    \n+
    53 const Coordinate &operator() ( const Entity &entity, unsigned int corner ) const
    \n+
    54 {
    \n+
    55 return data_( entity, corner );
    \n+
    56 }
    \n+
    \n+
    57
    \n+
    \n+
    58 const Coordinate &operator() ( const Vertex &vertex, unsigned int corner ) const
    \n+
    59 {
    \n+
    60 assert( corner == 0 );
    \n+
    61 return data_[ vertex ];
    \n+
    62 }
    \n+
    \n+
    63
    \n+
    64 template< class Entity >
    \n+
    \n+
    65 Coordinate &operator() ( const Entity &entity, unsigned int corner )
    \n+
    66 {
    \n+
    67 return data_( entity,corner) ;
    \n+
    68 }
    \n
    \n
    69
    \n-
    70 template< int codim, class Grid >
    \n-
    \n-\n-
    72 {
    \n-
    73 static const int dimension = std::remove_const< Grid >::type::dimension;
    \n-
    74 static const int codimension = codim;
    \n+
    \n+
    70 Coordinate &operator() ( const Vertex &vertex, unsigned int corner )
    \n+
    71 {
    \n+
    72 assert( corner == 0 );
    \n+
    73 return data_[ vertex ];
    \n+
    74 }
    \n+
    \n
    75
    \n-
    76 static const PartitionIteratorType Element_Partition = Interior_Partition;
    \n-
    77
    \n-
    78 typedef typename std::remove_const< Grid >::type::ctype ctype;
    \n-
    79 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element;
    \n-
    80 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement RefElement;
    \n-
    81
    \n-
    \n-
    82 static bool apply ( const RefElement &refElement,
    \n-
    83 const Element &element, int subEntity )
    \n-
    84 {
    \n-
    85 return true;
    \n-
    86 }
    \n+
    \n+
    76 void adapt ()
    \n+
    77 {
    \n+
    78 data_.resize();
    \n+
    79 data_.shrinkToFit();
    \n+
    80 }
    \n
    \n+
    81
    \n+
    82 private:
    \n+
    83 CoordCache ( const This & );
    \n+
    84 This &operator= ( const This & );
    \n+
    85
    \n+
    86 DataCache data_;
    \n
    87 };
    \n
    \n
    88
    \n-
    89 template< int codim, class Grid >
    \n-
    \n-\n-
    91 {
    \n-
    92 static const int dimension = std::remove_const< Grid >::type::dimension;
    \n-
    93 static const int codimension = codim;
    \n-
    94
    \n-
    95 static const PartitionIteratorType Element_Partition = Overlap_Partition;
    \n-
    96
    \n-
    97 typedef typename std::remove_const< Grid >::type::ctype ctype;
    \n-
    98 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element;
    \n-
    99 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement RefElement;
    \n-
    100
    \n-
    \n-
    101 static bool apply ( const RefElement &refElement,
    \n-
    102 const Element &element, int subEntity )
    \n-
    103 {
    \n-
    104 if( element.partitionType() == InteriorEntity )
    \n-
    105 return true;
    \n-
    106
    \n-
    107 const int size = refElement.size( subEntity, codim, dimension );
    \n-
    108 for( int i = 0; i < size; ++i )
    \n-
    109 {
    \n-
    110 const int j = refElement.subEntity( subEntity, codim, i, dimension );
    \n-
    111 PartitionType type = element.template subEntity< dimension >( j ).partitionType();
    \n-
    112 if( (type == OverlapEntity) || (type == BorderEntity) )
    \n-
    113 return true;
    \n-
    114 }
    \n-
    115 return false;
    \n-
    116 }
    \n-
    \n-
    117 };
    \n-
    \n-
    118
    \n-
    119 template< int codim, class Grid >
    \n-
    \n-\n-
    121 {
    \n-
    122 static const int dimension = std::remove_const< Grid >::type::dimension;
    \n-
    123 static const int codimension = codim;
    \n-
    124
    \n-
    125 static const PartitionIteratorType Element_Partition = Overlap_Partition;
    \n-
    126
    \n-
    127 typedef typename std::remove_const< Grid >::type::ctype ctype;
    \n-
    128 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element;
    \n-
    129 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement RefElement;
    \n-
    130
    \n-
    \n-
    131 static bool apply ( const RefElement &refElement,
    \n-
    132 const Element &element, int subEntity )
    \n-
    133 {
    \n-
    134 return true;
    \n-
    135 }
    \n-
    \n-
    136 };
    \n-
    \n-
    137
    \n-
    138 template< int codim, class Grid >
    \n-
    \n-\n-
    140 {
    \n-
    141 static const int dimension = std::remove_const< Grid >::type::dimension;
    \n-
    142 static const int codimension = codim;
    \n-
    143
    \n-
    144 static const PartitionIteratorType Element_Partition = All_Partition;
    \n-
    145
    \n-
    146 typedef typename std::remove_const< Grid >::type::ctype ctype;
    \n-
    147 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element;
    \n-
    148 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement RefElement;
    \n-
    149
    \n-
    \n-
    150 static bool apply ( const RefElement &refElement,
    \n-
    151 const Element &element, int subEntity )
    \n-
    152 {
    \n-
    153 return true;
    \n-
    154 }
    \n-
    \n-
    155 };
    \n-
    \n-
    156
    \n-
    157 template< int codim, class Grid >
    \n-
    \n-\n-
    159 {
    \n-
    160 static const int dimension = std::remove_const< Grid >::type::dimension;
    \n-
    161 static const int codimension = codim;
    \n-
    162
    \n-
    163 static const PartitionIteratorType Element_Partition = Ghost_Partition;
    \n-
    164
    \n-
    165 typedef typename std::remove_const< Grid >::type::ctype ctype;
    \n-
    166 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element;
    \n-
    167 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement RefElement;
    \n-
    168
    \n-
    \n-
    169 static bool apply ( const RefElement &refElement,
    \n-
    170 const Element &element, int subEntity )
    \n-
    171 {
    \n-
    172 const int size = refElement.size( subEntity, codim, dimension );
    \n-
    173 for( int i = 0; i < size; ++i )
    \n-
    174 {
    \n-
    175 const int j = refElement.subEntity( subEntity, codim, i, dimension );
    \n-
    176 PartitionType type = element.template subEntity< dimension >( j ).partitionType();
    \n-
    177 if( type == GhostEntity )
    \n-
    178 return true;
    \n-
    179 }
    \n-
    180 return false;
    \n-
    181 }
    \n-
    \n-
    182 };
    \n+
    89 } // namespace GeoGrid
    \n+
    90
    \n+
    91
    \n+
    92
    \n+
    93 // CachedCoordFunction
    \n+
    94 // -------------------
    \n+
    95
    \n+
    96 template< class HostGrid, class CoordFunction >
    \n+
    \n+\n+
    98 : public DiscreteCoordFunction< typename CoordFunction::ctype, CoordFunction::dimRange, CachedCoordFunction< HostGrid, CoordFunction > >
    \n+
    99 {
    \n+\n+\n+
    102
    \n+
    103 public:
    \n+
    104 typedef typename Base::ctype ctype;
    \n+
    105
    \n+\n+
    107
    \n+
    108 private:
    \n+\n+
    110
    \n+
    111 public:
    \n+
    112 explicit
    \n+
    \n+
    113 CachedCoordFunction ( const HostGrid &hostGrid,
    \n+
    114 const CoordFunction &coordFunction = CoordFunction() )
    \n+
    115 : hostGrid_( hostGrid ),
    \n+
    116 coordFunction_( coordFunction ),
    \n+
    117 cache_( hostGrid )
    \n+
    118 {
    \n+
    119 buildCache();
    \n+
    120 }
    \n+
    \n+
    121
    \n+
    \n+
    122 void adapt ()
    \n+
    123 {
    \n+
    124 cache_.adapt();
    \n+
    125 buildCache();
    \n+
    126 }
    \n+
    \n+
    127
    \n+
    128 void buildCache ();
    \n+
    129
    \n+
    130 template< class HostEntity >
    \n+
    131 void insertEntity ( const HostEntity &hostEntity );
    \n+
    132
    \n+
    133 template< class HostEntity >
    \n+
    \n+
    134 void evaluate ( const HostEntity &hostEntity, unsigned int corner, RangeVector &y ) const
    \n+
    135 {
    \n+
    136 y = cache_( hostEntity, corner );
    \n+
    137#ifndef NDEBUG
    \n+\n+
    139 CoordFunctionCaller;
    \n+
    140
    \n+
    141 RangeVector z;
    \n+
    142 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );
    \n+
    143 coordFunctionCaller.evaluate( corner, z );
    \n+
    144 assert( ((y - z).two_norm() < 1e-6) );
    \n+
    145#endif
    \n+
    146 }
    \n+
    \n+
    147
    \n+
    148 private:
    \n+
    149 const HostGrid &hostGrid_;
    \n+
    150 const CoordFunction &coordFunction_;
    \n+
    151 Cache cache_;
    \n+
    152 };
    \n+
    \n+
    153
    \n+
    154
    \n+
    155
    \n+
    156 // Implementation of CachedCoordFunction
    \n+
    157 // -------------------------------------
    \n+
    158
    \n+
    159 template< class HostGrid, class CoordFunction >
    \n+
    \n+\n+
    161 {
    \n+
    162 typedef typename HostGrid::template Codim< 0 >::Entity Element;
    \n+
    163 typedef typename HostGrid::LevelGridView MacroView;
    \n+
    164 typedef typename HostGrid::HierarchicIterator HierarchicIterator;
    \n+
    165
    \n+
    166 typedef typename MacroView::template Codim< 0 >::template Partition< All_Partition >::Iterator MacroIterator;
    \n+
    167
    \n+
    168 const MacroView macroView = hostGrid_.levelGridView( 0 );
    \n+
    169 const int maxLevel = hostGrid_.maxLevel();
    \n+
    170
    \n+
    171 const MacroIterator mend = macroView.template end< 0, All_Partition >();
    \n+
    172 for( MacroIterator mit = macroView.template begin< 0, All_Partition >(); mit != mend; ++mit )
    \n+
    173 {
    \n+
    174 const Element &macroElement = *mit;
    \n+
    175 insertEntity( macroElement );
    \n+
    176
    \n+
    177 const HierarchicIterator hend = macroElement.hend( maxLevel );
    \n+
    178 for( HierarchicIterator hit = macroElement.hbegin( maxLevel ); hit != hend; ++hit )
    \n+
    179 insertEntity( *hit );
    \n+
    180 }
    \n+
    181 }
    \n
    \n+
    182
    \n
    183
    \n-
    184
    \n-
    185
    \n-
    186 // Iterator (real)
    \n-
    187 // ---------------
    \n-
    188
    \n-
    189 template< class HostGridView, int codim, PartitionIteratorType pitype, class G >
    \n-
    \n-
    190 class Iterator< HostGridView, codim, pitype, G, false >
    \n-
    191 {
    \n-
    192 typedef typename std::remove_const< G >::type::Traits Traits;
    \n-
    193
    \n-
    194 public:
    \n-
    195 typedef typename Traits::Grid Grid;
    \n-
    196
    \n-
    197 static const int codimension = codim;
    \n-
    198
    \n-
    199 typedef typename Traits::template Codim< codimension >::Entity Entity;
    \n-
    200
    \n-
    201 static const bool fake = false;
    \n-
    202
    \n-
    203 private:
    \n-\n-
    205
    \n-
    206 typedef typename HostGridView::template Codim< codim >::template Partition< pitype >::Iterator HostEntityIterator;
    \n-
    207
    \n-
    208 public:
    \n-
    209 Iterator () : grid_( nullptr ) {}
    \n-
    210
    \n-
    \n-
    211 Iterator ( const Grid &grid, HostEntityIterator hostEntityIterator )
    \n-
    212 : grid_( &grid ),
    \n-
    213 hostEntityIterator_( std::move( hostEntityIterator ) )
    \n-
    214 {}
    \n-
    \n-
    215
    \n-
    \n-
    216 void increment ()
    \n-
    217 {
    \n-
    218 ++hostEntityIterator_;
    \n-
    219 }
    \n-
    \n-
    220
    \n-
    \n-
    221 bool equals ( const Iterator &rhs ) const
    \n-
    222 {
    \n-
    223 return hostEntityIterator_ == rhs.hostEntityIterator_;
    \n-
    224 }
    \n-
    \n-
    225
    \n-
    \n-\n-
    227 {
    \n-
    228 return EntityImpl( grid(), *hostEntityIterator_ );
    \n-
    229 }
    \n-
    \n-
    230
    \n-
    231 int level () const { return hostEntityIterator_.level(); }
    \n-
    232
    \n-
    \n-
    233 const Grid &grid () const
    \n-
    234 {
    \n-
    235 assert( grid_ );
    \n-
    236 return *grid_;
    \n-
    237 }
    \n-
    \n-
    238
    \n-
    \n-
    239 static Iterator begin ( const Grid &grid, const HostGridView &hostGridView )
    \n-
    240 {
    \n-
    241 HostEntityIterator hostEntityIterator = hostGridView.template begin< codimension, pitype >();
    \n-
    242 return Iterator( grid, std::move( hostEntityIterator ) );
    \n-
    243 }
    \n-
    \n-
    244
    \n-
    \n-
    245 static Iterator end ( const Grid &grid, const HostGridView &hostGridView )
    \n-
    246 {
    \n-
    247 HostEntityIterator hostEntityIterator = hostGridView.template end< codimension, pitype >();
    \n-
    248 return Iterator( grid, std::move( hostEntityIterator ) );
    \n-
    249 }
    \n-
    \n-
    250
    \n-
    251 private:
    \n-
    252 const Grid *grid_;
    \n-
    253 HostEntityIterator hostEntityIterator_;
    \n-
    254 };
    \n-
    \n-
    255
    \n-
    256
    \n-
    257
    \n-
    258 // Iterator (fake)
    \n-
    259 // ---------------
    \n-
    260
    \n-
    261 template< class HostGridView, int codim, PartitionIteratorType pitype, class G >
    \n-
    \n-
    262 class Iterator< HostGridView, codim, pitype, G, true >
    \n-
    263 {
    \n-
    264 typedef typename std::remove_const< G >::type::Traits Traits;
    \n-
    265
    \n-
    266 public:
    \n-
    267 typedef typename Traits::Grid Grid;
    \n-
    268
    \n-
    269 static const int codimension = codim;
    \n-
    270
    \n-
    271 typedef typename Traits::template Codim< codimension >::Entity Entity;
    \n-
    272
    \n-
    273 private:
    \n-\n-
    275
    \n-\n-
    277
    \n-
    278 typedef typename HostGridView::template Codim<0>::template Partition< Filter::Element_Partition >::Iterator HostElementIterator;
    \n-
    279 typedef typename HostElementIterator::Entity HostElement;
    \n-
    280 typedef typename HostGridView::IndexSet HostIndexSet;
    \n-
    281
    \n-
    282 public:
    \n-
    283 Iterator () : grid_( nullptr ), subEntity_( -1 ), hostIndexSet_( nullptr ) {}
    \n-
    284
    \n-
    \n-
    285 Iterator ( const Grid &grid, HostElementIterator hostElementIterator, HostElementIterator hostEnd, const HostIndexSet &hostIndexSet )
    \n-
    286 : grid_( &grid ),
    \n-
    287 hostElementIterator_( hostElementIterator ),
    \n-
    288 hostEnd_( hostEnd ),
    \n-
    289 subEntity_( -1 ),
    \n-
    290 hostIndexSet_( &hostIndexSet )
    \n-
    291 {
    \n-
    292 if( hostElementIterator_ != hostEnd_ )
    \n-
    293 {
    \n-
    294 visited_.resize( hostIndexSet_->size( codimension ), false );
    \n-
    295 increment();
    \n-
    296 }
    \n-
    297 }
    \n-
    \n-
    298
    \n-
    \n-
    299 void increment ()
    \n-
    300 {
    \n-
    301 typedef typename Traits::ctype ctype;
    \n-
    302
    \n-
    303 while( hostElementIterator_ != hostEnd_ )
    \n-
    304 {
    \n-
    305 const HostElement &hostElement = *hostElementIterator_;
    \n-
    306
    \n-
    307 auto refElement = referenceElement< ctype, Traits::dimension >( hostElement.type() );
    \n-
    308
    \n-
    309 ++subEntity_;
    \n-
    310 const int count = refElement.size( codimension );
    \n-
    311 for( ; subEntity_ < count; ++subEntity_ )
    \n-
    312 {
    \n-
    313 if( !Filter::apply( refElement, hostElement, subEntity_ ) )
    \n-
    314 continue;
    \n-
    315
    \n-
    316 const size_t index = hostIndexSet_->subIndex( hostElement, subEntity_, codimension );
    \n-
    317 if( !visited_[ index ] )
    \n-
    318 {
    \n-
    319 visited_[ index ] = true;
    \n-
    320 return;
    \n-
    321 }
    \n-
    322 }
    \n-
    323 ++hostElementIterator_;
    \n-
    324 subEntity_ = -1;
    \n-
    325 }
    \n-
    326 }
    \n-
    \n-
    327
    \n-
    \n-
    328 bool equals ( const Iterator &rhs ) const
    \n-
    329 {
    \n-
    330 return hostElementIterator_ == rhs.hostElementIterator_ && ( hostElementIterator_ == hostEnd_ || subEntity_ == rhs.subEntity_ );
    \n-
    331 }
    \n-
    \n-
    332
    \n-
    \n-\n-
    334 {
    \n-
    335 return EntityImpl( grid(), *hostElementIterator_, subEntity_ );
    \n-
    336 }
    \n-
    \n-
    337
    \n-
    338 int level () const { return hostElementIterator_.level(); }
    \n-
    339
    \n-
    \n-
    340 const Grid &grid () const
    \n-
    341 {
    \n-
    342 assert( grid_ );
    \n-
    343 return *grid_;
    \n-
    344 }
    \n-
    \n-
    345
    \n-
    \n-
    346 static Iterator begin ( const Grid &grid, const HostGridView &hostGridView )
    \n-
    347 {
    \n-
    348 HostElementIterator first = hostGridView.template begin< 0, Filter::Element_Partition >();
    \n-
    349 HostElementIterator last = hostGridView.template end< 0, Filter::Element_Partition >();
    \n-
    350 return Iterator( grid, std::move( first ), std::move( last ), hostGridView.indexSet() );
    \n-
    351 }
    \n-
    \n-
    352
    \n-
    \n-
    353 static Iterator end ( const Grid &grid, const HostGridView &hostGridView )
    \n-
    354 {
    \n-
    355 HostElementIterator last = hostGridView.template end< 0, Filter::Element_Partition >();
    \n-
    356 return Iterator( grid, last, last, hostGridView.indexSet() );
    \n-
    357 }
    \n-
    \n-
    358
    \n-
    359 private:
    \n-
    360 const Grid *grid_;
    \n-
    361 HostElementIterator hostElementIterator_, hostEnd_;
    \n-
    362 int subEntity_;
    \n-
    363 const HostIndexSet *hostIndexSet_;
    \n-
    364 std::vector< bool > visited_;
    \n-
    365 };
    \n-
    \n-
    366
    \n-
    367
    \n-
    368
    \n-
    369 // HierarchicIterator
    \n-
    370 // ------------------
    \n-
    371
    \n-
    372 template< class G >
    \n-
    \n-\n-
    374 {
    \n-
    375 typedef typename std::remove_const< G >::type::Traits Traits;
    \n-
    376
    \n-
    377 public:
    \n-
    378 typedef typename Traits::Grid Grid;
    \n-
    379
    \n-
    380 static const int codimension = 0;
    \n-
    381
    \n-
    382 typedef typename Traits::template Codim< codimension >::Entity Entity;
    \n-
    383
    \n-
    384 private:
    \n-\n-
    386
    \n-
    387 typedef typename Grid::HostGrid::HierarchicIterator HostEntityIterator;
    \n-
    388
    \n-
    389 public:
    \n-
    390 HierarchicIterator () : grid_( nullptr ) {}
    \n-
    391
    \n-
    \n-
    392 HierarchicIterator ( const Grid &grid, HostEntityIterator hostEntityIterator )
    \n-
    393 : grid_( &grid ),
    \n-
    394 hostEntityIterator_( std::move( hostEntityIterator ) )
    \n-
    395 {}
    \n-
    \n-
    396
    \n-
    \n-
    397 void increment ()
    \n-
    398 {
    \n-
    399 ++hostEntityIterator_;
    \n-
    400 }
    \n-
    \n-
    401
    \n-
    \n-
    402 bool equals ( const HierarchicIterator &rhs ) const
    \n-
    403 {
    \n-
    404 return hostEntityIterator_ == rhs.hostEntityIterator_;
    \n-
    405 }
    \n-
    \n-
    406
    \n-
    \n-\n-
    408 {
    \n-
    409 return EntityImpl( grid(), *hostEntityIterator_ );
    \n-
    410 }
    \n-
    \n-
    411
    \n-
    412 int level () const { return hostEntityIterator_.level(); }
    \n-
    413
    \n-
    \n-
    414 const Grid &grid () const
    \n-
    415 {
    \n-
    416 assert( grid_ );
    \n-
    417 return *grid_;
    \n-
    418 }
    \n-
    \n-
    419
    \n-
    420 private:
    \n-
    421 const Grid *grid_;
    \n-
    422 HostEntityIterator hostEntityIterator_;
    \n-
    423 };
    \n-
    \n-
    424
    \n-
    425 } // namespace GeoGrid
    \n-
    426
    \n-
    427} // namespace Dune
    \n-
    428
    \n-
    429#endif // #ifndef DUNE_GEOGRID_ITERATOR_HH
    \n-\n-
    PartitionIteratorType
    Parameter to be used for the parallel level- and leaf iterators.
    Definition gridenums.hh:136
    \n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    @ All_Partition
    all entities
    Definition gridenums.hh:141
    \n-
    @ OverlapFront_Partition
    interior, border, overlap and front entities
    Definition gridenums.hh:140
    \n-
    @ Interior_Partition
    only interior entities
    Definition gridenums.hh:137
    \n-
    @ InteriorBorder_Partition
    interior and border entities
    Definition gridenums.hh:138
    \n-
    @ Overlap_Partition
    interior, border, and overlap entities
    Definition gridenums.hh:139
    \n-
    @ Ghost_Partition
    only ghost entities
    Definition gridenums.hh:142
    \n-
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n-
    @ GhostEntity
    ghost entities
    Definition gridenums.hh:35
    \n-
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n-
    @ OverlapEntity
    all entities lying in the overlap zone
    Definition gridenums.hh:33
    \n-
    STL namespace.
    \n+
    184 template< class HostGrid, class CoordFunction >
    \n+
    185 template< class HostEntity >
    \n+\n+
    \n+
    187 ::insertEntity ( const HostEntity &hostEntity )
    \n+
    188 {
    \n+\n+
    190 CoordFunctionCaller;
    \n+
    191
    \n+
    192 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );
    \n+
    193 auto refElement = referenceElement< ctype, HostEntity::dimension >( hostEntity.type() );
    \n+
    194
    \n+
    195 const unsigned int numCorners = refElement.size( HostEntity::dimension );
    \n+
    196 for( unsigned int i = 0; i < numCorners; ++i )
    \n+
    197 coordFunctionCaller.evaluate( i, cache_( hostEntity, i ) );
    \n+
    198 }
    \n+
    \n+
    199
    \n+
    200} // namespace Dune
    \n+
    201
    \n+
    202#endif // #ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    Definition cachedcoordfunction.hh:99
    \n+
    void adapt()
    Definition cachedcoordfunction.hh:122
    \n+
    CachedCoordFunction(const HostGrid &hostGrid, const CoordFunction &coordFunction=CoordFunction())
    Definition cachedcoordfunction.hh:113
    \n+
    void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
    Definition cachedcoordfunction.hh:134
    \n+
    Base::ctype ctype
    Definition cachedcoordfunction.hh:104
    \n+
    Base::RangeVector RangeVector
    Definition cachedcoordfunction.hh:106
    \n+
    void buildCache()
    Definition cachedcoordfunction.hh:160
    \n+
    void insertEntity(const HostEntity &hostEntity)
    Definition cachedcoordfunction.hh:187
    \n+
    Definition cachedcoordfunction.hh:38
    \n+
    void adapt()
    Definition cachedcoordfunction.hh:76
    \n+
    CoordCache(const HostGrid &hostGrid)
    Definition cachedcoordfunction.hh:48
    \n+
    const Coordinate & operator()(const Entity &entity, unsigned int corner) const
    Definition cachedcoordfunction.hh:53
    \n+
    Derive an implementation of a discrete coordinate function from this class.
    Definition coordfunction.hh:248
    \n+
    Base::RangeVector RangeVector
    Definition coordfunction.hh:253
    \n+
    ct ctype
    field type of the coordinate vector
    Definition coordfunction.hh:185
    \n+
    Definition coordfunctioncaller.hh:21
    \n
    DUNE-conform implementation of the entity.
    Definition geometrygrid/entity.hh:694
    \n-
    Definition iterator.hh:374
    \n-
    static const int codimension
    Definition iterator.hh:380
    \n-
    int level() const
    Definition iterator.hh:412
    \n-
    void increment()
    Definition iterator.hh:397
    \n-
    bool equals(const HierarchicIterator &rhs) const
    Definition iterator.hh:402
    \n-
    Entity dereference() const
    Definition iterator.hh:407
    \n-
    HierarchicIterator()
    Definition iterator.hh:390
    \n-
    HierarchicIterator(const Grid &grid, HostEntityIterator hostEntityIterator)
    Definition iterator.hh:392
    \n-
    Traits::Grid Grid
    Definition iterator.hh:378
    \n-
    const Grid & grid() const
    Definition iterator.hh:414
    \n-
    Traits::template Codim< codimension >::Entity Entity
    Definition iterator.hh:382
    \n-
    Definition iterator.hh:30
    \n-\n-
    std::remove_const< Grid >::type::ctype ctype
    Definition iterator.hh:51
    \n-
    std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
    Definition iterator.hh:52
    \n-
    ReferenceElements< ctype, dimension >::ReferenceElement RefElement
    Definition iterator.hh:53
    \n-
    static bool apply(const RefElement &refElement, const Element &element, int subEntity)
    Definition iterator.hh:55
    \n-
    static bool apply(const RefElement &refElement, const Element &element, int subEntity)
    Definition iterator.hh:82
    \n-
    ReferenceElements< ctype, dimension >::ReferenceElement RefElement
    Definition iterator.hh:80
    \n-
    std::remove_const< Grid >::type::ctype ctype
    Definition iterator.hh:78
    \n-
    std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
    Definition iterator.hh:79
    \n-
    ReferenceElements< ctype, dimension >::ReferenceElement RefElement
    Definition iterator.hh:99
    \n-
    std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
    Definition iterator.hh:98
    \n-
    static bool apply(const RefElement &refElement, const Element &element, int subEntity)
    Definition iterator.hh:101
    \n-
    std::remove_const< Grid >::type::ctype ctype
    Definition iterator.hh:97
    \n-
    std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
    Definition iterator.hh:128
    \n-
    std::remove_const< Grid >::type::ctype ctype
    Definition iterator.hh:127
    \n-
    ReferenceElements< ctype, dimension >::ReferenceElement RefElement
    Definition iterator.hh:129
    \n-
    static bool apply(const RefElement &refElement, const Element &element, int subEntity)
    Definition iterator.hh:131
    \n-
    static bool apply(const RefElement &refElement, const Element &element, int subEntity)
    Definition iterator.hh:150
    \n-
    std::remove_const< Grid >::type::ctype ctype
    Definition iterator.hh:146
    \n-
    ReferenceElements< ctype, dimension >::ReferenceElement RefElement
    Definition iterator.hh:148
    \n-
    std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
    Definition iterator.hh:147
    \n-
    ReferenceElements< ctype, dimension >::ReferenceElement RefElement
    Definition iterator.hh:167
    \n-
    std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
    Definition iterator.hh:166
    \n-
    std::remove_const< Grid >::type::ctype ctype
    Definition iterator.hh:165
    \n-
    static bool apply(const RefElement &refElement, const Element &element, int subEntity)
    Definition iterator.hh:169
    \n-\n-\n-
    Entity dereference() const
    Definition iterator.hh:226
    \n-\n-\n-
    bool equals(const Iterator &rhs) const
    Definition iterator.hh:221
    \n-
    static Iterator begin(const Grid &grid, const HostGridView &hostGridView)
    Definition iterator.hh:239
    \n-
    Traits::template Codim< codimension >::Entity Entity
    Definition iterator.hh:199
    \n-
    const Grid & grid() const
    Definition iterator.hh:233
    \n-
    static Iterator end(const Grid &grid, const HostGridView &hostGridView)
    Definition iterator.hh:245
    \n-
    Iterator(const Grid &grid, HostEntityIterator hostEntityIterator)
    Definition iterator.hh:211
    \n-\n-\n-\n-
    const Grid & grid() const
    Definition iterator.hh:340
    \n-
    static Iterator end(const Grid &grid, const HostGridView &hostGridView)
    Definition iterator.hh:353
    \n-
    static Iterator begin(const Grid &grid, const HostGridView &hostGridView)
    Definition iterator.hh:346
    \n-
    bool equals(const Iterator &rhs) const
    Definition iterator.hh:328
    \n-
    Entity dereference() const
    Definition iterator.hh:333
    \n-
    Iterator(const Grid &grid, HostElementIterator hostElementIterator, HostElementIterator hostEnd, const HostIndexSet &hostIndexSet)
    Definition iterator.hh:285
    \n-
    Traits::template Codim< codimension >::Entity Entity
    Definition iterator.hh:271
    \n-\n+\n+
    void resize(const Value &value=Value())
    Definition persistentcontainermap.hh:87
    \n+
    void shrinkToFit()
    Definition persistentcontainermap.hh:93
    \n \n-\n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,735 +1,290 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n-iterator.hh\n+cachedcoordfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GEOGRID_ITERATOR_HH\n-6#define DUNE_GEOGRID_ITERATOR_HH\n+5#ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH\n+6#define DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH\n 7\n 8#include \n-9\n-10#include \n-11#include \n+9#include \n+10\n+11#include \n 12\n-13#include \n+13#include \n 14\n 15#include \n-16#include \n-17#include \n+16#include \n+17#include \n 18\n 19namespace Dune\n 20{\n 21\n-22 namespace GeoGrid\n-23 {\n+22 // Internal Forward Declarations\n+23 // -----------------------------\n 24\n-25 // Internal Forward Declarations\n-26 // -----------------------------\n+25 template< class HostGrid, class CoordFunction >\n+26 class CachedCoordFunction;\n 27\n-28 template< class HostGridView, int codim, PartitionIteratorType pitype, class\n-Grid,\n-29 bool fake = !Capabilities::hasHostEntity< Grid, codim >::v >\n-30 class Iterator;\n-31\n-32 template< class Grid >\n-33 class HierarchicIterator;\n-34\n+28\n+29\n+30 // GeoGrid::CoordCache\n+31 // -------------------\n+32\n+33 namespace GeoGrid\n+34 {\n 35\n-36\n-37 // PartitionIteratorFilter\n-38 // -----------------------\n-39\n-40 template< int codim, PartitionIteratorType pitype, class Grid >\n-41 struct PartitionIteratorFilter;\n+36 template< class HostGrid, class Coordinate >\n+37 class CoordCache\n+38 {\n+39 typedef CoordCache<_HostGrid,_Coordinate_> This;\n+40\n+41 static const unsigned int dimension = HostGrid::dimension;\n 42\n-43 template< int codim, class Grid >\n-44 struct PartitionIteratorFilter< codim, Interior_Partition, Grid >\n-45 {\n-46 static const int dimension = std::remove_const< Grid >::type::dimension;\n-47 static const int codimension = codim;\n-48\n-49 static const PartitionIteratorType Element_Partition = Interior_Partition;\n-50\n-51 typedef typename std::remove_const< Grid >::type::ctype ctype;\n-52 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0\n->::Entity Element;\n-53 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement\n-RefElement;\n-54\n-55 static bool apply ( const RefElement &refElement,\n-56 const Element &element, int subEntity )\n-57 {\n-58 const int size = refElement.size( subEntity, codim, dimension );\n-59 for( int i = 0; i < size; ++i )\n-60 {\n-61 const int j = refElement.subEntity( subEntity, codim, i, dimension );\n-62 PartitionType type = element.template subEntity< dimension >( j\n-).partitionType();\n-63 if( type == InteriorEntity )\n-64 return true;\n-65 }\n-66 return false;\n-67 }\n-68 };\n+43 typedef typename HostGrid::template Codim< dimension >::Entity Vertex;\n+44\n+45 typedef PersistentContainer<_HostGrid,_Coordinate_> DataCache;\n+46\n+47 public:\n+48 explicit CoordCache ( const HostGrid &hostGrid )\n+49 : data_( hostGrid, dimension )\n+50 {}\n+51\n+52 template< class Entity >\n+53 const Coordinate &operator()_( const Entity &entity, unsigned int corner )\n+const\n+54 {\n+55 return data_( entity, corner );\n+56 }\n+57\n+58 const Coordinate &operator()_( const Vertex &vertex, unsigned int corner )\n+const\n+59 {\n+60 assert( corner == 0 );\n+61 return data_[ vertex ];\n+62 }\n+63\n+64 template< class Entity >\n+65 Coordinate &operator()_( const Entity &entity, unsigned int corner )\n+66 {\n+67 return data_( entity,corner) ;\n+68 }\n 69\n-70 template< int codim, class Grid >\n-71 struct PartitionIteratorFilter< codim, InteriorBorder_Partition, Grid >\n-72 {\n-73 static const int dimension = std::remove_const< Grid >::type::dimension;\n-74 static const int codimension = codim;\n+70 Coordinate &operator()_( const Vertex &vertex, unsigned int corner )\n+71 {\n+72 assert( corner == 0 );\n+73 return data_[ vertex ];\n+74 }\n 75\n-76 static const PartitionIteratorType Element_Partition = Interior_Partition;\n-77\n-78 typedef typename std::remove_const< Grid >::type::ctype ctype;\n-79 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0\n->::Entity Element;\n-80 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement\n-RefElement;\n+76 void adapt ()\n+77 {\n+78 data_.resize();\n+79 data_.shrinkToFit();\n+80 }\n 81\n-82 static bool apply ( const RefElement &refElement,\n-83 const Element &element, int subEntity )\n-84 {\n-85 return true;\n-86 }\n+82 private:\n+83 CoordCache ( const This & );\n+84 This &operator= ( const This & );\n+85\n+86 DataCache data_;\n 87 };\n 88\n-89 template< int codim, class Grid >\n-90 struct PartitionIteratorFilter< codim, Overlap_Partition, Grid >\n-91 {\n-92 static const int dimension = std::remove_const< Grid >::type::dimension;\n-93 static const int codimension = codim;\n-94\n-95 static const PartitionIteratorType Element_Partition = Overlap_Partition;\n-96\n-97 typedef typename std::remove_const< Grid >::type::ctype ctype;\n-98 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0\n->::Entity Element;\n-99 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement\n-RefElement;\n-100\n-101 static bool apply ( const RefElement &refElement,\n-102 const Element &element, int subEntity )\n-103 {\n-104 if( element.partitionType() == InteriorEntity )\n-105 return true;\n-106\n-107 const int size = refElement.size( subEntity, codim, dimension );\n-108 for( int i = 0; i < size; ++i )\n-109 {\n-110 const int j = refElement.subEntity( subEntity, codim, i, dimension );\n-111 PartitionType type = element.template subEntity< dimension >( j\n-).partitionType();\n-112 if( (type == OverlapEntity) || (type == BorderEntity) )\n-113 return true;\n-114 }\n-115 return false;\n-116 }\n-117 };\n-118\n-119 template< int codim, class Grid >\n-120 struct PartitionIteratorFilter< codim, OverlapFront_Partition, Grid >\n-121 {\n-122 static const int dimension = std::remove_const< Grid >::type::dimension;\n-123 static const int codimension = codim;\n-124\n-125 static const PartitionIteratorType Element_Partition = Overlap_Partition;\n-126\n-127 typedef typename std::remove_const< Grid >::type::ctype ctype;\n-128 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0\n->::Entity Element;\n-129 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement\n-RefElement;\n-130\n-131 static bool apply ( const RefElement &refElement,\n-132 const Element &element, int subEntity )\n-133 {\n-134 return true;\n-135 }\n-136 };\n-137\n-138 template< int codim, class Grid >\n-139 struct PartitionIteratorFilter< codim, All_Partition, Grid >\n-140 {\n-141 static const int dimension = std::remove_const< Grid >::type::dimension;\n-142 static const int codimension = codim;\n-143\n-144 static const PartitionIteratorType Element_Partition = All_Partition;\n-145\n-146 typedef typename std::remove_const< Grid >::type::ctype ctype;\n-147 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0\n->::Entity Element;\n-148 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement\n-RefElement;\n-149\n-150 static bool apply ( const RefElement &refElement,\n-151 const Element &element, int subEntity )\n-152 {\n-153 return true;\n-154 }\n-155 };\n-156\n-157 template< int codim, class Grid >\n-158 struct PartitionIteratorFilter< codim, Ghost_Partition, Grid >\n-159 {\n-160 static const int dimension = std::remove_const< Grid >::type::dimension;\n-161 static const int codimension = codim;\n-162\n-163 static const PartitionIteratorType Element_Partition = Ghost_Partition;\n-164\n-165 typedef typename std::remove_const< Grid >::type::ctype ctype;\n-166 typedef typename std::remove_const< Grid >::type::Traits::template Codim< 0\n->::Entity Element;\n-167 typedef typename ReferenceElements< ctype, dimension >::ReferenceElement\n-RefElement;\n-168\n-169 static bool apply ( const RefElement &refElement,\n-170 const Element &element, int subEntity )\n-171 {\n-172 const int size = refElement.size( subEntity, codim, dimension );\n-173 for( int i = 0; i < size; ++i )\n-174 {\n-175 const int j = refElement.subEntity( subEntity, codim, i, dimension );\n-176 PartitionType type = element.template subEntity< dimension >( j\n-).partitionType();\n-177 if( type == GhostEntity )\n-178 return true;\n-179 }\n-180 return false;\n+89 } // namespace GeoGrid\n+90\n+91\n+92\n+93 // CachedCoordFunction\n+94 // -------------------\n+95\n+96 template< class HostGrid, class CoordFunction >\n+97 class CachedCoordFunction\n+98 : public DiscreteCoordFunction< typename CoordFunction::ctype,\n+CoordFunction::dimRange, CachedCoordFunction< HostGrid, CoordFunction > >\n+99 {\n+100 typedef CachedCoordFunction<_HostGrid,_CoordFunction_> This;\n+101 typedef DiscreteCoordFunction<_typename_CoordFunction::ctype,\n+CoordFunction::dimRange,_This_> Base;\n+102\n+103 public:\n+104 typedef typename Base::ctype ctype;\n+105\n+106 typedef typename Base::RangeVector RangeVector;\n+107\n+108 private:\n+109 typedef GeoGrid::CoordCache<_HostGrid,_RangeVector_> Cache;\n+110\n+111 public:\n+112 explicit\n+113 CachedCoordFunction ( const HostGrid &hostGrid,\n+114 const CoordFunction &coordFunction = CoordFunction() )\n+115 : hostGrid_( hostGrid ),\n+116 coordFunction_( coordFunction ),\n+117 cache_( hostGrid )\n+118 {\n+119 buildCache();\n+120 }\n+121\n+122 void adapt ()\n+123 {\n+124 cache_.adapt();\n+125 buildCache();\n+126 }\n+127\n+128 void buildCache ();\n+129\n+130 template< class HostEntity >\n+131 void insertEntity ( const HostEntity &hostEntity );\n+132\n+133 template< class HostEntity >\n+134 void evaluate ( const HostEntity &hostEntity, unsigned int corner,\n+RangeVector &y ) const\n+135 {\n+136 y = cache_( hostEntity, corner );\n+137#ifndef NDEBUG\n+138 typedef GeoGrid::CoordFunctionCaller<_HostEntity,_typename_CoordFunction::\n+Interface_>\n+139 CoordFunctionCaller;\n+140\n+141 RangeVector z;\n+142 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );\n+143 coordFunctionCaller.evaluate( corner, z );\n+144 assert( ((y - z).two_norm() < 1e-6) );\n+145#endif\n+146 }\n+147\n+148 private:\n+149 const HostGrid &hostGrid_;\n+150 const CoordFunction &coordFunction_;\n+151 Cache cache_;\n+152 };\n+153\n+154\n+155\n+156 // Implementation of CachedCoordFunction\n+157 // -------------------------------------\n+158\n+159 template< class HostGrid, class CoordFunction >\n+160 inline void CachedCoordFunction<_HostGrid,_CoordFunction_>::buildCache ()\n+161 {\n+162 typedef typename HostGrid::template Codim< 0 >::Entity Element;\n+163 typedef typename HostGrid::LevelGridView MacroView;\n+164 typedef typename HostGrid::HierarchicIterator HierarchicIterator;\n+165\n+166 typedef typename MacroView::template Codim< 0 >::template Partition< All_\n+Partition >::Iterator MacroIterator;\n+167\n+168 const MacroView macroView = hostGrid_.levelGridView( 0 );\n+169 const int maxLevel = hostGrid_.maxLevel();\n+170\n+171 const MacroIterator mend = macroView.template end< 0, All_Partition >();\n+172 for( MacroIterator mit = macroView.template begin< 0, All_Partition >();\n+mit != mend; ++mit )\n+173 {\n+174 const Element ¯oElement = *mit;\n+175 insertEntity( macroElement );\n+176\n+177 const HierarchicIterator hend = macroElement.hend( maxLevel );\n+178 for( HierarchicIterator hit = macroElement.hbegin( maxLevel ); hit != hend;\n+++hit )\n+179 insertEntity( *hit );\n+180 }\n 181 }\n-182 };\n+182\n 183\n-184\n-185\n-186 // Iterator (real)\n-187 // ---------------\n-188\n-189 template< class HostGridView, int codim, PartitionIteratorType pitype,\n-class G >\n-190 class Iterator< HostGridView, codim, pitype, G, false >\n-191 {\n-192 typedef typename std::remove_const< G >::type::Traits Traits;\n-193\n-194 public:\n-195 typedef typename Traits::Grid Grid;\n-196\n-197 static const int codimension = codim;\n-198\n-199 typedef typename Traits::template Codim< codimension >::Entity Entity;\n-200\n-201 static const bool fake = false;\n-202\n-203 private:\n-204 typedef GeoGrid::Entity<_codimension,_Traits::dimension,_G_> EntityImpl;\n-205\n-206 typedef typename HostGridView::template Codim< codim >::template Partition<\n-pitype >::Iterator HostEntityIterator;\n-207\n-208 public:\n-209 Iterator () : grid_( nullptr ) {}\n-210\n-211 Iterator ( const Grid &grid, HostEntityIterator hostEntityIterator )\n-212 : grid_( &grid ),\n-213 hostEntityIterator_( std::move( hostEntityIterator ) )\n-214 {}\n-215\n-216 void increment ()\n-217 {\n-218 ++hostEntityIterator_;\n-219 }\n-220\n-221 bool equals ( const Iterator &rhs ) const\n-222 {\n-223 return hostEntityIterator_ == rhs.hostEntityIterator_;\n-224 }\n-225\n-226 Entity dereference () const\n-227 {\n-228 return EntityImpl( grid(), *hostEntityIterator_ );\n-229 }\n-230\n-231 int level () const { return hostEntityIterator_.level(); }\n-232\n-233 const Grid &grid () const\n-234 {\n-235 assert( grid_ );\n-236 return *grid_;\n-237 }\n-238\n-239 static Iterator begin ( const Grid &grid, const HostGridView &hostGridView\n-)\n-240 {\n-241 HostEntityIterator hostEntityIterator = hostGridView.template begin<\n-codimension, pitype >();\n-242 return Iterator( grid, std::move( hostEntityIterator ) );\n-243 }\n-244\n-245 static Iterator end ( const Grid &grid, const HostGridView &hostGridView )\n-246 {\n-247 HostEntityIterator hostEntityIterator = hostGridView.template end<\n-codimension, pitype >();\n-248 return Iterator( grid, std::move( hostEntityIterator ) );\n-249 }\n-250\n-251 private:\n-252 const Grid *grid_;\n-253 HostEntityIterator hostEntityIterator_;\n-254 };\n-255\n-256\n-257\n-258 // Iterator (fake)\n-259 // ---------------\n-260\n-261 template< class HostGridView, int codim, PartitionIteratorType pitype,\n-class G >\n-262 class Iterator< HostGridView, codim, pitype, G, true >\n-263 {\n-264 typedef typename std::remove_const< G >::type::Traits Traits;\n-265\n-266 public:\n-267 typedef typename Traits::Grid Grid;\n-268\n-269 static const int codimension = codim;\n-270\n-271 typedef typename Traits::template Codim< codimension >::Entity Entity;\n-272\n-273 private:\n-274 typedef GeoGrid::Entity<_codimension,_Traits::dimension,_G_> EntityImpl;\n-275\n-276 typedef PartitionIteratorFilter<_codim,_pitype,_typename_HostGridView::Grid\n-> Filter;\n-277\n-278 typedef typename HostGridView::template Codim<0>::template Partition<\n-Filter::Element_Partition >::Iterator HostElementIterator;\n-279 typedef typename HostElementIterator::Entity HostElement;\n-280 typedef typename HostGridView::IndexSet HostIndexSet;\n-281\n-282 public:\n-283 Iterator () : grid_( nullptr ), subEntity_( -1 ), hostIndexSet_( nullptr )\n-{}\n-284\n-285 Iterator ( const Grid &grid, HostElementIterator hostElementIterator,\n-HostElementIterator hostEnd, const HostIndexSet &hostIndexSet )\n-286 : grid_( &grid ),\n-287 hostElementIterator_( hostElementIterator ),\n-288 hostEnd_( hostEnd ),\n-289 subEntity_( -1 ),\n-290 hostIndexSet_( &hostIndexSet )\n-291 {\n-292 if( hostElementIterator_ != hostEnd_ )\n-293 {\n-294 visited_.resize( hostIndexSet_->size( codimension ), false );\n-295 increment();\n-296 }\n-297 }\n-298\n-299 void increment ()\n-300 {\n-301 typedef typename Traits::ctype ctype;\n-302\n-303 while( hostElementIterator_ != hostEnd_ )\n-304 {\n-305 const HostElement &hostElement = *hostElementIterator_;\n-306\n-307 auto refElement = referenceElement< ctype, Traits::dimension >\n-( hostElement.type() );\n-308\n-309 ++subEntity_;\n-310 const int count = refElement.size( codimension );\n-311 for( ; subEntity_ < count; ++subEntity_ )\n-312 {\n-313 if( !Filter::apply( refElement, hostElement, subEntity_ ) )\n-314 continue;\n-315\n-316 const size_t index = hostIndexSet_->subIndex( hostElement, subEntity_,\n-codimension );\n-317 if( !visited_[ index ] )\n-318 {\n-319 visited_[ index ] = true;\n-320 return;\n-321 }\n-322 }\n-323 ++hostElementIterator_;\n-324 subEntity_ = -1;\n-325 }\n-326 }\n-327\n-328 bool equals ( const Iterator &rhs ) const\n-329 {\n-330 return hostElementIterator_ == rhs.hostElementIterator_ &&\n-( hostElementIterator_ == hostEnd_ || subEntity_ == rhs.subEntity_ );\n-331 }\n-332\n-333 Entity dereference () const\n-334 {\n-335 return EntityImpl( grid(), *hostElementIterator_, subEntity_ );\n-336 }\n-337\n-338 int level () const { return hostElementIterator_.level(); }\n-339\n-340 const Grid &grid () const\n-341 {\n-342 assert( grid_ );\n-343 return *grid_;\n-344 }\n-345\n-346 static Iterator begin ( const Grid &grid, const HostGridView &hostGridView\n-)\n-347 {\n-348 HostElementIterator first = hostGridView.template begin< 0, Filter::\n-Element_Partition >();\n-349 HostElementIterator last = hostGridView.template end< 0, Filter::Element_\n-Partition >();\n-350 return Iterator( grid, std::move( first ), std::move( last ),\n-hostGridView.indexSet() );\n-351 }\n-352\n-353 static Iterator end ( const Grid &grid, const HostGridView &hostGridView )\n-354 {\n-355 HostElementIterator last = hostGridView.template end< 0, Filter::Element_\n-Partition >();\n-356 return Iterator( grid, last, last, hostGridView.indexSet() );\n-357 }\n-358\n-359 private:\n-360 const Grid *grid_;\n-361 HostElementIterator hostElementIterator_, hostEnd_;\n-362 int subEntity_;\n-363 const HostIndexSet *hostIndexSet_;\n-364 std::vector< bool > visited_;\n-365 };\n-366\n-367\n-368\n-369 // HierarchicIterator\n-370 // ------------------\n-371\n-372 template< class G >\n-373 class HierarchicIterator\n-374 {\n-375 typedef typename std::remove_const< G >::type::Traits Traits;\n-376\n-377 public:\n-378 typedef typename Traits::Grid Grid;\n-379\n-380 static const int codimension = 0;\n-381\n-382 typedef typename Traits::template Codim< codimension >::Entity Entity;\n-383\n-384 private:\n-385 typedef GeoGrid::Entity<_codimension,_Traits::dimension,_G_> EntityImpl;\n-386\n-387 typedef typename Grid::HostGrid::HierarchicIterator HostEntityIterator;\n-388\n-389 public:\n-390 HierarchicIterator () : grid_( nullptr ) {}\n-391\n-392 HierarchicIterator ( const Grid &grid, HostEntityIterator\n-hostEntityIterator )\n-393 : grid_( &grid ),\n-394 hostEntityIterator_( std::move( hostEntityIterator ) )\n-395 {}\n-396\n-397 void increment ()\n-398 {\n-399 ++hostEntityIterator_;\n-400 }\n-401\n-402 bool equals ( const HierarchicIterator &rhs ) const\n-403 {\n-404 return hostEntityIterator_ == rhs.hostEntityIterator_;\n-405 }\n-406\n-407 Entity dereference () const\n-408 {\n-409 return EntityImpl( grid(), *hostEntityIterator_ );\n-410 }\n-411\n-412 int level () const { return hostEntityIterator_.level(); }\n-413\n-414 const Grid &grid () const\n-415 {\n-416 assert( grid_ );\n-417 return *grid_;\n-418 }\n-419\n-420 private:\n-421 const Grid *grid_;\n-422 HostEntityIterator hostEntityIterator_;\n-423 };\n-424\n-425 } // namespace GeoGrid\n-426\n-427} // namespace Dune\n-428\n-429#endif // #ifndef DUNE_GEOGRID_ITERATOR_HH\n-declaration.hh\n-Dune::PartitionIteratorType\n-PartitionIteratorType\n-Parameter to be used for the parallel level- and leaf iterators.\n-Definition gridenums.hh:136\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-Dune::All_Partition\n-@ All_Partition\n-all entities\n-Definition gridenums.hh:141\n-Dune::OverlapFront_Partition\n-@ OverlapFront_Partition\n-interior, border, overlap and front entities\n-Definition gridenums.hh:140\n-Dune::Interior_Partition\n-@ Interior_Partition\n-only interior entities\n-Definition gridenums.hh:137\n-Dune::InteriorBorder_Partition\n-@ InteriorBorder_Partition\n-interior and border entities\n-Definition gridenums.hh:138\n-Dune::Overlap_Partition\n-@ Overlap_Partition\n-interior, border, and overlap entities\n-Definition gridenums.hh:139\n-Dune::Ghost_Partition\n-@ Ghost_Partition\n-only ghost entities\n-Definition gridenums.hh:142\n-Dune::InteriorEntity\n-@ InteriorEntity\n-all interior entities\n-Definition gridenums.hh:31\n-Dune::GhostEntity\n-@ GhostEntity\n-ghost entities\n-Definition gridenums.hh:35\n-Dune::BorderEntity\n-@ BorderEntity\n-on boundary between interior and overlap\n-Definition gridenums.hh:32\n-Dune::OverlapEntity\n-@ OverlapEntity\n-all entities lying in the overlap zone\n-Definition gridenums.hh:33\n-std\n-STL namespace.\n+184 template< class HostGrid, class CoordFunction >\n+185 template< class HostEntity >\n+186 inline void CachedCoordFunction<_HostGrid,_CoordFunction_>\n+187_::insertEntity ( const HostEntity &hostEntity )\n+188 {\n+189 typedef GeoGrid::CoordFunctionCaller<_HostEntity,_typename_CoordFunction::\n+Interface_>\n+190 CoordFunctionCaller;\n+191\n+192 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );\n+193 auto refElement = referenceElement< ctype, HostEntity::dimension >\n+( hostEntity.type() );\n+194\n+195 const unsigned int numCorners = refElement.size( HostEntity::dimension );\n+196 for( unsigned int i = 0; i < numCorners; ++i )\n+197 coordFunctionCaller.evaluate( i, cache_( hostEntity, i ) );\n+198 }\n+199\n+200} // namespace Dune\n+201\n+202#endif // #ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH\n+gridenums.hh\n+coordfunctioncaller.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n+Dune::CachedCoordFunction\n+Definition cachedcoordfunction.hh:99\n+Dune::CachedCoordFunction::adapt\n+void adapt()\n+Definition cachedcoordfunction.hh:122\n+Dune::CachedCoordFunction::CachedCoordFunction\n+CachedCoordFunction(const HostGrid &hostGrid, const CoordFunction\n+&coordFunction=CoordFunction())\n+Definition cachedcoordfunction.hh:113\n+Dune::CachedCoordFunction::evaluate\n+void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector\n+&y) const\n+Definition cachedcoordfunction.hh:134\n+Dune::CachedCoordFunction::ctype\n+Base::ctype ctype\n+Definition cachedcoordfunction.hh:104\n+Dune::CachedCoordFunction::RangeVector\n+Base::RangeVector RangeVector\n+Definition cachedcoordfunction.hh:106\n+Dune::CachedCoordFunction::buildCache\n+void buildCache()\n+Definition cachedcoordfunction.hh:160\n+Dune::CachedCoordFunction::insertEntity\n+void insertEntity(const HostEntity &hostEntity)\n+Definition cachedcoordfunction.hh:187\n+Dune::GeoGrid::CoordCache\n+Definition cachedcoordfunction.hh:38\n+Dune::GeoGrid::CoordCache::adapt\n+void adapt()\n+Definition cachedcoordfunction.hh:76\n+Dune::GeoGrid::CoordCache::CoordCache\n+CoordCache(const HostGrid &hostGrid)\n+Definition cachedcoordfunction.hh:48\n+Dune::GeoGrid::CoordCache::operator()\n+const Coordinate & operator()(const Entity &entity, unsigned int corner) const\n+Definition cachedcoordfunction.hh:53\n+Dune::DiscreteCoordFunction\n+Derive an implementation of a discrete coordinate function from this class.\n+Definition coordfunction.hh:248\n+Dune::DiscreteCoordFunction::RangeVector\n+Base::RangeVector RangeVector\n+Definition coordfunction.hh:253\n+Dune::DiscreteCoordFunctionInterface::ctype\n+ct ctype\n+field type of the coordinate vector\n+Definition coordfunction.hh:185\n+Dune::GeoGrid::CoordFunctionCaller\n+Definition coordfunctioncaller.hh:21\n Dune::GeoGrid::Entity\n DUNE-conform implementation of the entity.\n Definition geometrygrid/entity.hh:694\n-Dune::GeoGrid::HierarchicIterator\n-Definition iterator.hh:374\n-Dune::GeoGrid::HierarchicIterator::codimension\n-static const int codimension\n-Definition iterator.hh:380\n-Dune::GeoGrid::HierarchicIterator::level\n-int level() const\n-Definition iterator.hh:412\n-Dune::GeoGrid::HierarchicIterator::increment\n-void increment()\n-Definition iterator.hh:397\n-Dune::GeoGrid::HierarchicIterator::equals\n-bool equals(const HierarchicIterator &rhs) const\n-Definition iterator.hh:402\n-Dune::GeoGrid::HierarchicIterator::dereference\n-Entity dereference() const\n-Definition iterator.hh:407\n-Dune::GeoGrid::HierarchicIterator::HierarchicIterator\n-HierarchicIterator()\n-Definition iterator.hh:390\n-Dune::GeoGrid::HierarchicIterator::HierarchicIterator\n-HierarchicIterator(const Grid &grid, HostEntityIterator hostEntityIterator)\n-Definition iterator.hh:392\n-Dune::GeoGrid::HierarchicIterator::Grid\n-Traits::Grid Grid\n-Definition iterator.hh:378\n-Dune::GeoGrid::HierarchicIterator::grid\n-const Grid & grid() const\n-Definition iterator.hh:414\n-Dune::GeoGrid::HierarchicIterator::Entity\n-Traits::template Codim< codimension >::Entity Entity\n-Definition iterator.hh:382\n-Dune::GeoGrid::Iterator\n-Definition iterator.hh:30\n-Dune::GeoGrid::PartitionIteratorFilter\n-Definition iterator.hh:41\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Interior_Partition,_Grid_>::\n-ctype\n-std::remove_const< Grid >::type::ctype ctype\n-Definition iterator.hh:51\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Interior_Partition,_Grid_>::\n-Element\n-std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element\n-Definition iterator.hh:52\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Interior_Partition,_Grid_>::\n-RefElement\n-ReferenceElements< ctype, dimension >::ReferenceElement RefElement\n-Definition iterator.hh:53\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Interior_Partition,_Grid_>::\n-apply\n-static bool apply(const RefElement &refElement, const Element &element, int\n-subEntity)\n-Definition iterator.hh:55\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_InteriorBorder_Partition,_Grid\n->::apply\n-static bool apply(const RefElement &refElement, const Element &element, int\n-subEntity)\n-Definition iterator.hh:82\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_InteriorBorder_Partition,_Grid\n->::RefElement\n-ReferenceElements< ctype, dimension >::ReferenceElement RefElement\n-Definition iterator.hh:80\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_InteriorBorder_Partition,_Grid\n->::ctype\n-std::remove_const< Grid >::type::ctype ctype\n-Definition iterator.hh:78\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_InteriorBorder_Partition,_Grid\n->::Element\n-std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element\n-Definition iterator.hh:79\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Overlap_Partition,_Grid_>::\n-RefElement\n-ReferenceElements< ctype, dimension >::ReferenceElement RefElement\n-Definition iterator.hh:99\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Overlap_Partition,_Grid_>::\n-Element\n-std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element\n-Definition iterator.hh:98\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Overlap_Partition,_Grid_>::apply\n-static bool apply(const RefElement &refElement, const Element &element, int\n-subEntity)\n-Definition iterator.hh:101\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Overlap_Partition,_Grid_>::ctype\n-std::remove_const< Grid >::type::ctype ctype\n-Definition iterator.hh:97\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_OverlapFront_Partition,_Grid_>::\n-Element\n-std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element\n-Definition iterator.hh:128\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_OverlapFront_Partition,_Grid_>::\n-ctype\n-std::remove_const< Grid >::type::ctype ctype\n-Definition iterator.hh:127\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_OverlapFront_Partition,_Grid_>::\n-RefElement\n-ReferenceElements< ctype, dimension >::ReferenceElement RefElement\n-Definition iterator.hh:129\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_OverlapFront_Partition,_Grid_>::\n-apply\n-static bool apply(const RefElement &refElement, const Element &element, int\n-subEntity)\n-Definition iterator.hh:131\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_All_Partition,_Grid_>::apply\n-static bool apply(const RefElement &refElement, const Element &element, int\n-subEntity)\n-Definition iterator.hh:150\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_All_Partition,_Grid_>::ctype\n-std::remove_const< Grid >::type::ctype ctype\n-Definition iterator.hh:146\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_All_Partition,_Grid_>::\n-RefElement\n-ReferenceElements< ctype, dimension >::ReferenceElement RefElement\n-Definition iterator.hh:148\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_All_Partition,_Grid_>::Element\n-std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element\n-Definition iterator.hh:147\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Ghost_Partition,_Grid_>::\n-RefElement\n-ReferenceElements< ctype, dimension >::ReferenceElement RefElement\n-Definition iterator.hh:167\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Ghost_Partition,_Grid_>::Element\n-std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element\n-Definition iterator.hh:166\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Ghost_Partition,_Grid_>::ctype\n-std::remove_const< Grid >::type::ctype ctype\n-Definition iterator.hh:165\n-Dune::GeoGrid::PartitionIteratorFilter<_codim,_Ghost_Partition,_Grid_>::apply\n-static bool apply(const RefElement &refElement, const Element &element, int\n-subEntity)\n-Definition iterator.hh:169\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::Iterator\n-Iterator()\n-Definition iterator.hh:209\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::Grid\n-Traits::Grid Grid\n-Definition iterator.hh:195\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::dereference\n-Entity dereference() const\n-Definition iterator.hh:226\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::level\n-int level() const\n-Definition iterator.hh:231\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::increment\n-void increment()\n-Definition iterator.hh:216\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::equals\n-bool equals(const Iterator &rhs) const\n-Definition iterator.hh:221\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::begin\n-static Iterator begin(const Grid &grid, const HostGridView &hostGridView)\n-Definition iterator.hh:239\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::Entity\n-Traits::template Codim< codimension >::Entity Entity\n-Definition iterator.hh:199\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::grid\n-const Grid & grid() const\n-Definition iterator.hh:233\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::end\n-static Iterator end(const Grid &grid, const HostGridView &hostGridView)\n-Definition iterator.hh:245\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_false_>::Iterator\n-Iterator(const Grid &grid, HostEntityIterator hostEntityIterator)\n-Definition iterator.hh:211\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::Grid\n-Traits::Grid Grid\n-Definition iterator.hh:267\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::level\n-int level() const\n-Definition iterator.hh:338\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::increment\n-void increment()\n-Definition iterator.hh:299\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::grid\n-const Grid & grid() const\n-Definition iterator.hh:340\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::end\n-static Iterator end(const Grid &grid, const HostGridView &hostGridView)\n-Definition iterator.hh:353\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::begin\n-static Iterator begin(const Grid &grid, const HostGridView &hostGridView)\n-Definition iterator.hh:346\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::equals\n-bool equals(const Iterator &rhs) const\n-Definition iterator.hh:328\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::dereference\n-Entity dereference() const\n-Definition iterator.hh:333\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::Iterator\n-Iterator(const Grid &grid, HostElementIterator hostElementIterator,\n-HostElementIterator hostEnd, const HostIndexSet &hostIndexSet)\n-Definition iterator.hh:285\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::Entity\n-Traits::template Codim< codimension >::Entity Entity\n-Definition iterator.hh:271\n-Dune::GeoGrid::Iterator<_HostGridView,_codim,_pitype,_G,_true_>::Iterator\n-Iterator()\n-Definition iterator.hh:283\n+Dune::PersistentContainer<_HostGrid,_Coordinate_>\n+Dune::PersistentContainerMap::resize\n+void resize(const Value &value=Value())\n+Definition persistentcontainermap.hh:87\n+Dune::PersistentContainerMap::shrinkToFit\n+void shrinkToFit()\n+Definition persistentcontainermap.hh:93\n capabilities.hh\n-entity.hh\n+persistentcontainer.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00596.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00596.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hostcorners.hh File Reference\n+dune-grid: cornerstorage.hh File Reference\n \n \n \n \n \n \n \n@@ -72,25 +72,31 @@\n
  • dune
  • grid
  • geometrygrid
  • \n
    \n
    \n
    \n \n-
    hostcorners.hh File Reference
    \n+
    cornerstorage.hh File Reference
    \n
    \n
    \n-
    #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/entity.hh>
    \n+
    #include <array>
    \n+#include <dune/grid/geometrygrid/coordfunctioncaller.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n \n-\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::GeoGrid::HostCorners< HostEntity >
    class  Dune::GeoGrid::CoordVector< mydim, Grid, false >
     
    class  Dune::GeoGrid::CoordVector< mydim, Grid, true >
     
    class  Dune::GeoGrid::IntersectionCoordVector< Grid >
     
    class  Dune::GeoGrid::CornerStorage< mydim, cdim, Grid >
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n Classes | Namespaces\n-hostcorners.hh File Reference\n-#include \n-#include \n+cornerstorage.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::GeoGrid::HostCorners<_HostEntity_>\n+class \u00a0 Dune::GeoGrid::CoordVector<_mydim,_Grid,_false_>\n+\u00a0\n+class \u00a0 Dune::GeoGrid::CoordVector<_mydim,_Grid,_true_>\n+\u00a0\n+class \u00a0 Dune::GeoGrid::IntersectionCoordVector<_Grid_>\n+\u00a0\n+class \u00a0 Dune::GeoGrid::CornerStorage<_mydim,_cdim,_Grid_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::GeoGrid\n \u00a0 namespace containing the implementations of GeometryGrid\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00596_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00596_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hostcorners.hh Source File\n+dune-grid: cornerstorage.hh Source File\n \n \n \n \n \n \n \n@@ -74,90 +74,277 @@\n \n \n \n
    \n-
    hostcorners.hh
    \n+
    cornerstorage.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GEOGRID_HOSTCORNERS_HH
    \n-
    6#define DUNE_GEOGRID_HOSTCORNERS_HH
    \n+
    5#ifndef DUNE_GEOGRID_CORNERSTORAGE_HH
    \n+
    6#define DUNE_GEOGRID_CORNERSTORAGE_HH
    \n
    7
    \n-
    8#include <dune/geometry/type.hh>
    \n+
    8#include <array>
    \n
    9
    \n-\n+\n
    11
    \n
    12namespace Dune
    \n
    13{
    \n-
    14 namespace GeoGrid
    \n-
    15 {
    \n-
    16
    \n-
    17 // HostCorners
    \n-
    18 // -----------
    \n-
    19
    \n-
    20 template< class HostEntity >
    \n-
    \n-\n-
    22 {
    \n-
    23 typedef typename HostEntity::Geometry HostGeometry;
    \n+
    14
    \n+
    15 namespace GeoGrid
    \n+
    16 {
    \n+
    17
    \n+
    18 // CoordVector
    \n+
    19 // -----------
    \n+
    20
    \n+
    21 template< int mydim, class Grid, bool fake >
    \n+\n+
    23
    \n
    24
    \n-
    25 public:
    \n-
    26 typedef typename HostGeometry::GlobalCoordinate Coordinate;
    \n-
    27
    \n-
    \n-
    28 explicit HostCorners ( const HostEntity &hostEntity )
    \n-
    29 : hostGeometry_( hostEntity.geometry() )
    \n-
    30 {}
    \n-
    \n+
    25 template< int mydim, class Grid >
    \n+
    \n+
    26 class CoordVector< mydim, Grid, false >
    \n+
    27 {
    \n+
    28 typedef typename std::remove_const< Grid >::type::Traits Traits;
    \n+
    29
    \n+
    30 typedef typename Traits::ctype ctype;
    \n
    31
    \n-
    \n-
    32 GeometryType type () const
    \n-
    33 {
    \n-
    34 return hostGeometry_.type();
    \n-
    35 }
    \n-
    \n+
    32 static const int dimension = Traits::dimension;
    \n+
    33 static const int mydimension = mydim;
    \n+
    34 static const int codimension = dimension - mydimension;
    \n+
    35 static const int dimensionworld = Traits::dimensionworld;
    \n
    36
    \n-
    \n-
    37 Coordinate operator[] ( int i ) const
    \n-
    38 {
    \n-
    39 return hostGeometry_.corner( i );
    \n-
    40 }
    \n-
    \n+
    37 typedef FieldVector< ctype, dimensionworld > Coordinate;
    \n+
    38
    \n+
    39 typedef typename Traits::HostGrid HostGrid;
    \n+
    40 typedef typename Traits::CoordFunction CoordFunction;
    \n
    41
    \n-
    \n-
    42 std::size_t size () const
    \n-
    43 {
    \n-
    44 return hostGeometry_.corners();
    \n-
    45 }
    \n-
    \n+
    42 typedef typename HostGrid::template Codim< codimension >::Entity HostEntity;
    \n+
    43
    \n+
    44 typedef GeoGrid :: CoordFunctionCaller< HostEntity, typename CoordFunction::Interface >
    \n+
    45 CoordFunctionCaller;
    \n
    46
    \n-
    47 private:
    \n-
    48 HostGeometry hostGeometry_;
    \n-
    49 };
    \n+
    47 public:
    \n+
    \n+
    48 CoordVector ( const HostEntity &hostEntity,
    \n+
    49 const CoordFunction &coordFunction )
    \n+
    50 : coordFunctionCaller_( hostEntity, coordFunction )
    \n+
    51 {}
    \n
    \n-
    50
    \n-
    51 } // namespace GeoGrid
    \n
    52
    \n-
    53} // namespace Dune
    \n-
    54
    \n-
    55#endif // #ifndef DUNE_GEOGRID_HOSTCORNERS_HH
    \n+
    53 template< std::size_t size >
    \n+
    \n+
    54 void calculate ( std::array< Coordinate, size > (&corners) ) const
    \n+
    55 {
    \n+
    56 const std::size_t numCorners = coordFunctionCaller_.size();
    \n+
    57 assert( size >= numCorners );
    \n+
    58 for( std::size_t i = 0; i < numCorners; ++i )
    \n+
    59 coordFunctionCaller_.evaluate( i, corners[ i ] );
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    62 private:
    \n+
    63 const CoordFunctionCaller coordFunctionCaller_;
    \n+
    64 };
    \n+
    \n+
    65
    \n+
    66
    \n+
    67 template< int mydim, class Grid >
    \n+
    \n+
    68 class CoordVector< mydim, Grid, true >
    \n+
    69 {
    \n+
    70 typedef typename std::remove_const< Grid > :: type :: Traits Traits;
    \n+
    71
    \n+
    72 typedef typename Traits::ctype ctype;
    \n+
    73
    \n+
    74 static const int dimension = Traits::dimension;
    \n+
    75 static const int mydimension = mydim;
    \n+
    76 static const int codimension = dimension - mydimension;
    \n+
    77 static const int dimensionworld = Traits::dimensionworld;
    \n+
    78
    \n+
    79 typedef FieldVector< ctype, dimensionworld > Coordinate;
    \n+
    80
    \n+
    81 typedef typename Traits::HostGrid HostGrid;
    \n+
    82 typedef typename Traits::CoordFunction CoordFunction;
    \n+
    83
    \n+
    84 typedef typename HostGrid::template Codim< 0 >::Entity HostElement;
    \n+
    85
    \n+\n+\n+
    88
    \n+
    89 public:
    \n+
    \n+
    90 CoordVector ( const HostElement &hostElement,
    \n+
    91 const unsigned int subEntity,
    \n+
    92 const CoordFunction &coordFunction )
    \n+
    93 : coordFunctionCaller_( hostElement, coordFunction ),
    \n+
    94 subEntity_( subEntity )
    \n+
    95 {}
    \n+
    \n+
    96
    \n+
    97 template< std::size_t size >
    \n+
    \n+
    98 void calculate ( std::array< Coordinate, size > (&corners) ) const
    \n+
    99 {
    \n+
    100 const GeometryType type = coordFunctionCaller_.type();
    \n+
    101 auto refElement = referenceElement< ctype, dimension >( type );
    \n+
    102 const std::size_t numCorners = refElement.size( subEntity_, codimension, dimension );
    \n+
    103 assert( size >= numCorners );
    \n+
    104 for( std::size_t i = 0; i < numCorners; ++i )
    \n+
    105 {
    \n+
    106 const std::size_t j = refElement.subEntity( subEntity_, codimension, i, dimension );
    \n+
    107 coordFunctionCaller_.evaluate( j, corners[ i ] );
    \n+
    108 }
    \n+
    109 }
    \n+
    \n+
    110
    \n+
    111 private:
    \n+
    112 const CoordFunctionCaller coordFunctionCaller_;
    \n+
    113 const unsigned int subEntity_;
    \n+
    114 };
    \n+
    \n+
    115
    \n+
    116
    \n+
    117
    \n+
    118 // IntersectionCoordVector
    \n+
    119 // -----------------------
    \n+
    120
    \n+
    121 template< class Grid >
    \n+
    \n+\n+
    123 {
    \n+
    124 typedef typename std::remove_const< Grid >::type::Traits Traits;
    \n+
    125
    \n+
    126 typedef typename Traits::ctype ctype;
    \n+
    127
    \n+
    128 static const int dimension = Traits::dimension;
    \n+
    129 static const int codimension = 1;
    \n+
    130 static const int mydimension = dimension-codimension;
    \n+
    131 static const int dimensionworld = Traits::dimensionworld;
    \n+
    132
    \n+
    133 typedef FieldVector< ctype, dimensionworld > Coordinate;
    \n+
    134
    \n+
    135 typedef typename Traits::HostGrid HostGrid;
    \n+
    136
    \n+
    137 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
    \n+
    138 typedef typename Traits::template Codim< codimension >::LocalGeometry HostLocalGeometry;
    \n+
    139
    \n+
    140 public:
    \n+
    \n+
    141 IntersectionCoordVector ( const ElementGeometryImpl &elementGeometry,
    \n+
    142 const HostLocalGeometry &hostLocalGeometry )
    \n+
    143 : elementGeometry_( elementGeometry ),
    \n+
    144 hostLocalGeometry_( hostLocalGeometry )
    \n+
    145 {}
    \n+
    \n+
    146
    \n+
    147 template< std::size_t size >
    \n+
    \n+
    148 void calculate ( std::array< Coordinate, size > (&corners) ) const
    \n+
    149 {
    \n+
    150 const std::size_t numCorners = hostLocalGeometry_.corners();
    \n+
    151 assert( size >= numCorners );
    \n+
    152 for( std::size_t i = 0; i < numCorners; ++i )
    \n+
    153 corners[ i ] = elementGeometry_.global( hostLocalGeometry_.corner( i ) );
    \n+
    154 }
    \n+
    \n+
    155
    \n+
    156 template< unsigned int numCorners >
    \n+
    \n+
    157 void calculate ( Coordinate (&corners)[ numCorners ] ) const
    \n+
    158 {
    \n+
    159 assert( numCorners == hostLocalGeometry_.corners() );
    \n+
    160 }
    \n+
    \n+
    161
    \n+
    162 private:
    \n+
    163 const ElementGeometryImpl &elementGeometry_;
    \n+
    164 HostLocalGeometry hostLocalGeometry_;
    \n+
    165 };
    \n+
    \n+
    166
    \n+
    167
    \n+
    168
    \n+
    169 // CornerStorage
    \n+
    170 // -------------
    \n+
    171
    \n+
    172 template< int mydim, int cdim, class Grid >
    \n+
    \n+\n+
    174 {
    \n+
    175 typedef typename std::remove_const< Grid >::type::Traits Traits;
    \n+
    176
    \n+
    177 typedef typename Traits::ctype ctype;
    \n+
    178 typedef FieldVector< ctype, cdim > Coordinate;
    \n+
    179
    \n+
    180 typedef std::array< Coordinate, (1 << mydim) > Coords;
    \n+
    181
    \n+
    182 public:
    \n+
    183 typedef typename Coords::const_iterator const_iterator;
    \n+
    184
    \n+
    185 template< bool fake >
    \n+
    \n+\n+
    187 {
    \n+
    188 coords.calculate( coords_ );
    \n+
    189 }
    \n+
    \n+
    190
    \n+
    \n+\n+
    192 {
    \n+
    193 coords.calculate( coords_ );
    \n+
    194 }
    \n+
    \n+
    195
    \n+
    \n+
    196 const Coordinate &operator[] ( unsigned int i ) const
    \n+
    197 {
    \n+
    198 return coords_[ i ];
    \n+
    199 }
    \n+
    \n+
    200
    \n+
    201 const_iterator begin () const { return coords_.begin(); }
    \n+
    202 const_iterator end () const { return coords_.end(); }
    \n+
    203
    \n+
    204 private:
    \n+
    205 Coords coords_;
    \n+
    206 };
    \n+
    \n+
    207
    \n+
    208 } // namespace GeoGrid
    \n+
    209
    \n+
    210} // namespace Dune
    \n+
    211
    \n+
    212#endif // #ifndef DUNE_GEOGRID_CORNERSTORAGE_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition hostcorners.hh:22
    \n-
    GeometryType type() const
    Definition hostcorners.hh:32
    \n-
    Coordinate operator[](int i) const
    Definition hostcorners.hh:37
    \n-
    HostCorners(const HostEntity &hostEntity)
    Definition hostcorners.hh:28
    \n-
    HostGeometry::GlobalCoordinate Coordinate
    Definition hostcorners.hh:26
    \n-
    std::size_t size() const
    Definition hostcorners.hh:42
    \n-\n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    Definition coordfunctioncaller.hh:21
    \n+
    Definition cornerstorage.hh:22
    \n+
    CoordVector(const HostEntity &hostEntity, const CoordFunction &coordFunction)
    Definition cornerstorage.hh:48
    \n+
    void calculate(std::array< Coordinate, size >(&corners)) const
    Definition cornerstorage.hh:54
    \n+
    CoordVector(const HostElement &hostElement, const unsigned int subEntity, const CoordFunction &coordFunction)
    Definition cornerstorage.hh:90
    \n+
    void calculate(std::array< Coordinate, size >(&corners)) const
    Definition cornerstorage.hh:98
    \n+
    Definition cornerstorage.hh:123
    \n+
    IntersectionCoordVector(const ElementGeometryImpl &elementGeometry, const HostLocalGeometry &hostLocalGeometry)
    Definition cornerstorage.hh:141
    \n+
    void calculate(Coordinate(&corners)[numCorners]) const
    Definition cornerstorage.hh:157
    \n+
    void calculate(std::array< Coordinate, size >(&corners)) const
    Definition cornerstorage.hh:148
    \n+
    Definition cornerstorage.hh:174
    \n+
    Coords::const_iterator const_iterator
    Definition cornerstorage.hh:183
    \n+
    const_iterator begin() const
    Definition cornerstorage.hh:201
    \n+
    CornerStorage(const IntersectionCoordVector< Grid > &coords)
    Definition cornerstorage.hh:191
    \n+
    const_iterator end() const
    Definition cornerstorage.hh:202
    \n+
    const Coordinate & operator[](unsigned int i) const
    Definition cornerstorage.hh:196
    \n+
    CornerStorage(const CoordVector< mydim, Grid, fake > &coords)
    Definition cornerstorage.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,88 +1,286 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * geometrygrid\n-hostcorners.hh\n+cornerstorage.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GEOGRID_HOSTCORNERS_HH\n-6#define DUNE_GEOGRID_HOSTCORNERS_HH\n+5#ifndef DUNE_GEOGRID_CORNERSTORAGE_HH\n+6#define DUNE_GEOGRID_CORNERSTORAGE_HH\n 7\n-8#include \n+8#include \n 9\n-10#include \n+10#include \n 11\n 12namespace Dune\n 13{\n-14 namespace GeoGrid\n-15 {\n-16\n-17 // HostCorners\n-18 // -----------\n-19\n-20 template< class HostEntity >\n-21 class HostCorners\n-22 {\n-23 typedef typename HostEntity::Geometry HostGeometry;\n+14\n+15 namespace GeoGrid\n+16 {\n+17\n+18 // CoordVector\n+19 // -----------\n+20\n+21 template< int mydim, class Grid, bool fake >\n+22 class CoordVector;\n+23\n 24\n-25 public:\n-26 typedef typename HostGeometry::GlobalCoordinate Coordinate;\n-27\n-28 explicit HostCorners ( const HostEntity &hostEntity )\n-29 : hostGeometry_( hostEntity.geometry() )\n-30 {}\n+25 template< int mydim, class Grid >\n+26 class CoordVector< mydim, Grid, false >\n+27 {\n+28 typedef typename std::remove_const< Grid >::type::Traits Traits;\n+29\n+30 typedef typename Traits::ctype ctype;\n 31\n-32 GeometryType type () const\n-33 {\n-34 return hostGeometry_.type();\n-35 }\n+32 static const int dimension = Traits::dimension;\n+33 static const int mydimension = mydim;\n+34 static const int codimension = dimension - mydimension;\n+35 static const int dimensionworld = Traits::dimensionworld;\n 36\n-37 Coordinate operator[]_( int i ) const\n-38 {\n-39 return hostGeometry_.corner( i );\n-40 }\n+37 typedef FieldVector< ctype, dimensionworld > Coordinate;\n+38\n+39 typedef typename Traits::HostGrid HostGrid;\n+40 typedef typename Traits::CoordFunction CoordFunction;\n 41\n-42 std::size_t size () const\n-43 {\n-44 return hostGeometry_.corners();\n-45 }\n+42 typedef typename HostGrid::template Codim< codimension >::Entity HostEntity;\n+43\n+44 typedef GeoGrid :: CoordFunctionCaller< HostEntity, typename CoordFunction::\n+Interface >\n+45 CoordFunctionCaller;\n 46\n-47 private:\n-48 HostGeometry hostGeometry_;\n-49 };\n-50\n-51 } // namespace GeoGrid\n+47 public:\n+48 CoordVector ( const HostEntity &hostEntity,\n+49 const CoordFunction &coordFunction )\n+50 : coordFunctionCaller_( hostEntity, coordFunction )\n+51 {}\n 52\n-53} // namespace Dune\n-54\n-55#endif // #ifndef DUNE_GEOGRID_HOSTCORNERS_HH\n+53 template< std::size_t size >\n+54 void calculate ( std::array< Coordinate, size > (&corners) ) const\n+55 {\n+56 const std::size_t numCorners = coordFunctionCaller_.size();\n+57 assert( size >= numCorners );\n+58 for( std::size_t i = 0; i < numCorners; ++i )\n+59 coordFunctionCaller_.evaluate( i, corners[ i ] );\n+60 }\n+61\n+62 private:\n+63 const CoordFunctionCaller coordFunctionCaller_;\n+64 };\n+65\n+66\n+67 template< int mydim, class Grid >\n+68 class CoordVector< mydim, Grid, true >\n+69 {\n+70 typedef typename std::remove_const< Grid > :: type :: Traits Traits;\n+71\n+72 typedef typename Traits::ctype ctype;\n+73\n+74 static const int dimension = Traits::dimension;\n+75 static const int mydimension = mydim;\n+76 static const int codimension = dimension - mydimension;\n+77 static const int dimensionworld = Traits::dimensionworld;\n+78\n+79 typedef FieldVector< ctype, dimensionworld > Coordinate;\n+80\n+81 typedef typename Traits::HostGrid HostGrid;\n+82 typedef typename Traits::CoordFunction CoordFunction;\n+83\n+84 typedef typename HostGrid::template Codim< 0 >::Entity HostElement;\n+85\n+86 typedef GeoGrid::CoordFunctionCaller<_HostElement,_typename_CoordFunction::\n+Interface_>\n+87 CoordFunctionCaller;\n+88\n+89 public:\n+90 CoordVector ( const HostElement &hostElement,\n+91 const unsigned int subEntity,\n+92 const CoordFunction &coordFunction )\n+93 : coordFunctionCaller_( hostElement, coordFunction ),\n+94 subEntity_( subEntity )\n+95 {}\n+96\n+97 template< std::size_t size >\n+98 void calculate ( std::array< Coordinate, size > (&corners) ) const\n+99 {\n+100 const GeometryType type = coordFunctionCaller_.type();\n+101 auto refElement = referenceElement< ctype, dimension >( type );\n+102 const std::size_t numCorners = refElement.size( subEntity_, codimension,\n+dimension );\n+103 assert( size >= numCorners );\n+104 for( std::size_t i = 0; i < numCorners; ++i )\n+105 {\n+106 const std::size_t j = refElement.subEntity( subEntity_, codimension, i,\n+dimension );\n+107 coordFunctionCaller_.evaluate( j, corners[ i ] );\n+108 }\n+109 }\n+110\n+111 private:\n+112 const CoordFunctionCaller coordFunctionCaller_;\n+113 const unsigned int subEntity_;\n+114 };\n+115\n+116\n+117\n+118 // IntersectionCoordVector\n+119 // -----------------------\n+120\n+121 template< class Grid >\n+122 class IntersectionCoordVector\n+123 {\n+124 typedef typename std::remove_const< Grid >::type::Traits Traits;\n+125\n+126 typedef typename Traits::ctype ctype;\n+127\n+128 static const int dimension = Traits::dimension;\n+129 static const int codimension = 1;\n+130 static const int mydimension = dimension-codimension;\n+131 static const int dimensionworld = Traits::dimensionworld;\n+132\n+133 typedef FieldVector< ctype, dimensionworld > Coordinate;\n+134\n+135 typedef typename Traits::HostGrid HostGrid;\n+136\n+137 typedef typename Traits::template Codim< 0 >::GeometryImpl\n+ElementGeometryImpl;\n+138 typedef typename Traits::template Codim< codimension >::LocalGeometry\n+HostLocalGeometry;\n+139\n+140 public:\n+141 IntersectionCoordVector ( const ElementGeometryImpl &elementGeometry,\n+142 const HostLocalGeometry &hostLocalGeometry )\n+143 : elementGeometry_( elementGeometry ),\n+144 hostLocalGeometry_( hostLocalGeometry )\n+145 {}\n+146\n+147 template< std::size_t size >\n+148 void calculate ( std::array< Coordinate, size > (&corners) ) const\n+149 {\n+150 const std::size_t numCorners = hostLocalGeometry_.corners();\n+151 assert( size >= numCorners );\n+152 for( std::size_t i = 0; i < numCorners; ++i )\n+153 corners[ i ] = elementGeometry_.global( hostLocalGeometry_.corner( i ) );\n+154 }\n+155\n+156 template< unsigned int numCorners >\n+157 void calculate ( Coordinate (&corners)[ numCorners ] ) const\n+158 {\n+159 assert( numCorners == hostLocalGeometry_.corners() );\n+160 }\n+161\n+162 private:\n+163 const ElementGeometryImpl &elementGeometry_;\n+164 HostLocalGeometry hostLocalGeometry_;\n+165 };\n+166\n+167\n+168\n+169 // CornerStorage\n+170 // -------------\n+171\n+172 template< int mydim, int cdim, class Grid >\n+173 class CornerStorage\n+174 {\n+175 typedef typename std::remove_const< Grid >::type::Traits Traits;\n+176\n+177 typedef typename Traits::ctype ctype;\n+178 typedef FieldVector< ctype, cdim > Coordinate;\n+179\n+180 typedef std::array< Coordinate, (1 << mydim) > Coords;\n+181\n+182 public:\n+183 typedef typename Coords::const_iterator const_iterator;\n+184\n+185 template< bool fake >\n+186 explicit CornerStorage ( const CoordVector<_mydim,_Grid,_fake_> &coords )\n+187 {\n+188 coords.calculate( coords_ );\n+189 }\n+190\n+191 explicit CornerStorage ( const IntersectionCoordVector<_Grid_> &coords )\n+192 {\n+193 coords.calculate( coords_ );\n+194 }\n+195\n+196 const Coordinate &operator[]_( unsigned int i ) const\n+197 {\n+198 return coords_[ i ];\n+199 }\n+200\n+201 const_iterator begin () const { return coords_.begin(); }\n+202 const_iterator end () const { return coords_.end(); }\n+203\n+204 private:\n+205 Coords coords_;\n+206 };\n+207\n+208 } // namespace GeoGrid\n+209\n+210} // namespace Dune\n+211\n+212#endif // #ifndef DUNE_GEOGRID_CORNERSTORAGE_HH\n+coordfunctioncaller.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::GeoGrid::HostCorners\n-Definition hostcorners.hh:22\n-Dune::GeoGrid::HostCorners::type\n-GeometryType type() const\n-Definition hostcorners.hh:32\n-Dune::GeoGrid::HostCorners::operator[]\n-Coordinate operator[](int i) const\n-Definition hostcorners.hh:37\n-Dune::GeoGrid::HostCorners::HostCorners\n-HostCorners(const HostEntity &hostEntity)\n-Definition hostcorners.hh:28\n-Dune::GeoGrid::HostCorners::Coordinate\n-HostGeometry::GlobalCoordinate Coordinate\n-Definition hostcorners.hh:26\n-Dune::GeoGrid::HostCorners::size\n-std::size_t size() const\n-Definition hostcorners.hh:42\n-entity.hh\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::GeoGrid::CoordFunctionCaller\n+Definition coordfunctioncaller.hh:21\n+Dune::GeoGrid::CoordVector\n+Definition cornerstorage.hh:22\n+Dune::GeoGrid::CoordVector<_mydim,_Grid,_false_>::CoordVector\n+CoordVector(const HostEntity &hostEntity, const CoordFunction &coordFunction)\n+Definition cornerstorage.hh:48\n+Dune::GeoGrid::CoordVector<_mydim,_Grid,_false_>::calculate\n+void calculate(std::array< Coordinate, size >(&corners)) const\n+Definition cornerstorage.hh:54\n+Dune::GeoGrid::CoordVector<_mydim,_Grid,_true_>::CoordVector\n+CoordVector(const HostElement &hostElement, const unsigned int subEntity, const\n+CoordFunction &coordFunction)\n+Definition cornerstorage.hh:90\n+Dune::GeoGrid::CoordVector<_mydim,_Grid,_true_>::calculate\n+void calculate(std::array< Coordinate, size >(&corners)) const\n+Definition cornerstorage.hh:98\n+Dune::GeoGrid::IntersectionCoordVector\n+Definition cornerstorage.hh:123\n+Dune::GeoGrid::IntersectionCoordVector::IntersectionCoordVector\n+IntersectionCoordVector(const ElementGeometryImpl &elementGeometry, const\n+HostLocalGeometry &hostLocalGeometry)\n+Definition cornerstorage.hh:141\n+Dune::GeoGrid::IntersectionCoordVector::calculate\n+void calculate(Coordinate(&corners)[numCorners]) const\n+Definition cornerstorage.hh:157\n+Dune::GeoGrid::IntersectionCoordVector::calculate\n+void calculate(std::array< Coordinate, size >(&corners)) const\n+Definition cornerstorage.hh:148\n+Dune::GeoGrid::CornerStorage\n+Definition cornerstorage.hh:174\n+Dune::GeoGrid::CornerStorage::const_iterator\n+Coords::const_iterator const_iterator\n+Definition cornerstorage.hh:183\n+Dune::GeoGrid::CornerStorage::begin\n+const_iterator begin() const\n+Definition cornerstorage.hh:201\n+Dune::GeoGrid::CornerStorage::CornerStorage\n+CornerStorage(const IntersectionCoordVector< Grid > &coords)\n+Definition cornerstorage.hh:191\n+Dune::GeoGrid::CornerStorage::end\n+const_iterator end() const\n+Definition cornerstorage.hh:202\n+Dune::GeoGrid::CornerStorage::operator[]\n+const Coordinate & operator[](unsigned int i) const\n+Definition cornerstorage.hh:196\n+Dune::GeoGrid::CornerStorage::CornerStorage\n+CornerStorage(const CoordVector< mydim, Grid, fake > &coords)\n+Definition cornerstorage.hh:186\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00614.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00614.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hierarchiciterator.hh File Reference\n+dune-grid: geometryreference.hh File Reference\n \n \n \n \n \n \n \n@@ -72,33 +72,41 @@\n
  • dune
  • grid
  • albertagrid
  • \n
    \n \n
    \n \n-
    hierarchiciterator.hh File Reference
    \n+
    geometryreference.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/albertagrid/elementinfo.hh>
    \n-#include <dune/grid/common/entityiterator.hh>
    \n+\n+

    Wrapper and interface classes for element geometries. \n+More...

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

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n \n-\n+\n+\n+\n \n

    \n Classes

    class  Dune::AlbertaGridHierarchicIterator< GridImp >
    class  Dune::GeometryReference< Implementation >
     
    class  Dune::LocalGeometryReference< mydim, cdim, Grid >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    Wrapper and interface classes for element geometries.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n Classes | Namespaces\n-hierarchiciterator.hh File Reference\n-#include \n-#include \n+geometryreference.hh File Reference\n+Wrapper and interface classes for element geometries. More...\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::AlbertaGridHierarchicIterator<_GridImp_>\n+class \u00a0 Dune::GeometryReference<_Implementation_>\n+\u00a0\n+class \u00a0 Dune::LocalGeometryReference<_mydim,_cdim,_Grid_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+***** Detailed Description *****\n+Wrapper and interface classes for element geometries.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00614_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00614_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hierarchiciterator.hh Source File\n+dune-grid: geometryreference.hh Source File\n \n \n \n \n \n \n \n@@ -74,210 +74,225 @@\n \n \n \n
    \n-
    hierarchiciterator.hh
    \n+
    geometryreference.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH
    \n-
    6#define DUNE_ALBERTA_HIERARCHICITERATOR_HH
    \n+
    5#ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
    \n+
    6#define DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
    \n
    7
    \n-\n-\n-
    10
    \n-
    11#if HAVE_ALBERTA
    \n-
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n+
    12#include <dune/common/typetraits.hh>
    \n+
    13
    \n+
    14#include <dune/geometry/type.hh>
    \n
    15
    \n-
    16 // AlbertaGridHierarchicIterator
    \n-
    17 // -----------------------------
    \n-
    18
    \n-
    27 template< class GridImp >
    \n-
    \n-\n-
    29 {
    \n-\n-
    31
    \n-
    32 public:
    \n-
    33 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    34 typedef typename GridImp::ctype ctype;
    \n-
    35
    \n-\n-\n-
    38
    \n-
    39 typedef typename EntityImp::ElementInfo ElementInfo;
    \n+\n+
    17
    \n+
    18namespace Dune
    \n+
    19{
    \n+
    20
    \n+
    21 // GeometryReference
    \n+
    22 // -----------------
    \n+
    23
    \n+
    24 template< class Implementation >
    \n+
    \n+\n+
    26 {
    \n+\n+
    28
    \n+
    29 public:
    \n+
    30 static const int mydimension = Implementation::mydimension;
    \n+
    31 static const int coorddimension = Implementation::coorddimension;
    \n+
    32
    \n+
    33 typedef typename Implementation::ctype ctype;
    \n+
    34
    \n+
    35 typedef typename Implementation::LocalCoordinate LocalCoordinate;
    \n+
    36 typedef typename Implementation::GlobalCoordinate GlobalCoordinate;
    \n+
    37
    \n+
    38 typedef typename Implementation::JacobianInverseTransposed JacobianInverseTransposed;
    \n+
    39 typedef typename Implementation::JacobianTransposed JacobianTransposed;
    \n
    40
    \n-\n-
    43
    \n-
    45 AlbertaGridHierarchicIterator ( const GridImp &grid,
    \n-
    46 const ElementInfo &elementInfo,
    \n-
    47 int maxLevel );
    \n-
    48
    \n-
    50 AlbertaGridHierarchicIterator ( const GridImp &grid, int actLevel, int maxLevel );
    \n-
    51
    \n-
    53 AlbertaGridHierarchicIterator ( const This &other );
    \n-
    54
    \n-
    56 This &operator= ( const This &other );
    \n-
    57
    \n-
    59 void increment();
    \n-
    60
    \n-
    \n-
    62 bool equals ( const This &other ) const
    \n-
    63 {
    \n-
    64 return entity_.impl().equals( other.entity_.impl() );
    \n-
    65 }
    \n-
    \n-
    66
    \n-
    \n-\n-
    69 {
    \n-
    70 return entity_;
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    \n-
    74 int level () const
    \n-
    75 {
    \n-
    76 return entity_.impl().level();
    \n-
    77 }
    \n-
    \n+
    41 private:
    \n+
    42
    \n+
    43 template<class Implementation_T>
    \n+
    44 using JacobianInverseOfImplementation = decltype(typename Implementation_T::JacobianInverse{std::declval<Implementation_T>().jacobianInverse(std::declval<LocalCoordinate>())});
    \n+
    45
    \n+
    46 using JacobianInverseDefault = decltype(transpose(std::declval<JacobianInverseTransposed>()));
    \n+
    47
    \n+
    48 template<class Implementation_T>
    \n+
    49 using JacobianOfImplementation = decltype(typename Implementation_T::Jacobian{std::declval<Implementation_T>().jacobian(std::declval<LocalCoordinate>())});
    \n+
    50
    \n+
    51 using JacobianDefault = decltype(transpose(std::declval<JacobianTransposed>()));
    \n+
    52
    \n+
    53
    \n+
    54 template <class I = Implementation>
    \n+
    55 [[deprecated("Geometry implementatons are required to provide a jacobian(local) method. The default implementation is deprecated and will be removed after release 2.9")]]
    \n+
    56 auto deprecatedDefaultJacobian ( const LocalCoordinate& local ) const {
    \n+
    57 return transpose(jacobianTransposed(local));
    \n+
    58 }
    \n+
    59
    \n+
    60 template <class I = Implementation>
    \n+
    61 [[deprecated("Geometry implementatons are required to provide a jacobianInverse(local) method. The default implementation is deprecated and will be removed after release 2.9")]]
    \n+
    62 auto deprecatedDefaultJacobianInverse ( const LocalCoordinate& local ) const {
    \n+
    63 return transpose(jacobianInverseTransposed(local));
    \n+
    64 }
    \n+
    65
    \n+
    66 public:
    \n+
    67
    \n+
    68 using Jacobian = Std::detected_or_t<JacobianDefault, JacobianOfImplementation, Implementation>;
    \n+
    69 using JacobianInverse = Std::detected_or_t<JacobianInverseDefault, JacobianInverseOfImplementation, Implementation>;
    \n+
    70
    \n+
    \n+
    71 explicit GeometryReference ( const Implementation &impl )
    \n+
    72 : impl_( &impl )
    \n+
    73 {}
    \n+
    \n+
    74
    \n+
    75 GeometryType type () const { return impl().type(); }
    \n+
    76
    \n+
    77 bool affine() const { return impl().affine(); }
    \n
    78
    \n-
    79 protected:
    \n-
    \n-
    81 const GridImp &grid () const
    \n-
    82 {
    \n-
    83 return entity_.impl().grid();
    \n-
    84 }
    \n-
    \n-
    85
    \n-
    86 private:
    \n-
    87 void increment ( ElementInfo elementInfo );
    \n-
    88
    \n-
    89 mutable Entity entity_;
    \n-
    90
    \n-
    91 // level on which the iterator was started
    \n-
    92 int startLevel_;
    \n-
    93
    \n-
    94 // maximal level to go down to
    \n-
    95 int maxlevel_;
    \n-
    96 };
    \n+
    79 int corners () const { return impl().corners(); }
    \n+
    80 GlobalCoordinate corner ( int i ) const { return impl().corner( i ); }
    \n+
    81 GlobalCoordinate center () const { return impl().center(); }
    \n+
    82
    \n+
    \n+\n+
    84 {
    \n+
    85 return impl().global( local );
    \n+
    86 }
    \n+
    \n+
    87
    \n+
    \n+\n+
    89 {
    \n+
    90 return impl().local( global );
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    \n+\n+
    94 {
    \n+
    95 return impl().integrationElement( local );
    \n+
    96 }
    \n
    \n
    97
    \n-
    98
    \n-
    99 template< class GridImp >
    \n-
    100 inline AlbertaGridHierarchicIterator< GridImp >
    \n-
    \n-
    101 ::AlbertaGridHierarchicIterator( const GridImp &grid, int actLevel, int maxLevel )
    \n-
    102 : entity_( EntityImp( grid ) ),
    \n-
    103 startLevel_( actLevel ),
    \n-
    104 maxlevel_( maxLevel )
    \n-
    105 {}
    \n-
    \n-
    106
    \n-
    107
    \n-
    108 template< class GridImp >
    \n-\n+
    98 ctype volume () const { return impl().volume(); }
    \n+
    99
    \n+
    \n+\n+
    101 {
    \n+
    102 return impl().jacobianTransposed( local );
    \n+
    103 }
    \n+
    \n+
    104
    \n+
    \n+\n+
    106 {
    \n+
    107 return impl().jacobianInverseTransposed( local );
    \n+
    108 }
    \n+
    \n+
    109
    \n
    \n-\n-
    111 const ElementInfo &elementInfo,
    \n-
    112 int maxLevel )
    \n-
    113 : entity_( EntityImp( grid ) ),
    \n-
    114 startLevel_( elementInfo.level() ),
    \n-
    115 maxlevel_( maxLevel )
    \n-
    116 {
    \n-
    117 increment( elementInfo );
    \n-
    118 }
    \n-
    \n-
    119
    \n-
    120
    \n-
    121 template< class GridImp >
    \n-\n-
    \n-\n-
    124 : entity_( other.entity_ ),
    \n-
    125 startLevel_( other.startLevel_ ),
    \n-
    126 maxlevel_( other.maxlevel_ )
    \n-
    127 {}
    \n-
    \n-
    128
    \n-
    129
    \n-
    130 template< class GridImp >
    \n-\n-
    \n-\n-
    133 {
    \n-
    134 entity_ = other.entity_;
    \n-
    135 startLevel_ = other.startLevel_;
    \n-
    136 maxlevel_ = other.maxlevel_;
    \n-
    137 return *this;
    \n-
    138 }
    \n-
    \n-
    139
    \n-
    140
    \n-
    141 template< class GridImp >
    \n-
    \n-\n-
    143 {
    \n-
    144 increment( entity_.impl().elementInfo() );
    \n-
    145 }
    \n-
    \n-
    146
    \n-
    147 template< class GridImp >
    \n-\n-
    149 ::increment ( ElementInfo elementInfo )
    \n-
    150 {
    \n-
    151 assert( !elementInfo == false );
    \n-
    152 if( (elementInfo.level() >= maxlevel_) || elementInfo.isLeaf() )
    \n-
    153 {
    \n-
    154 while( (elementInfo.level() > startLevel_) && (elementInfo.indexInFather() == 1) )
    \n-
    155 elementInfo = elementInfo.father();
    \n-
    156 if( elementInfo.level() > startLevel_ )
    \n-
    157 entity_.impl().setElement( elementInfo.father().child( 1 ), 0 );
    \n-
    158 else
    \n-
    159 entity_.impl().clearElement();
    \n-
    160 }
    \n-
    161 else
    \n-
    162 entity_.impl().setElement( elementInfo.child( 0 ), 0 );
    \n-
    163 }
    \n-
    164
    \n-
    165}
    \n-
    166
    \n-
    167#endif // #if HAVE_ALBERTA
    \n-
    168
    \n-
    169#endif // #ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n+\n+
    111 {
    \n+
    112 if constexpr(Std::is_detected_v<JacobianOfImplementation, Implementation>)
    \n+
    113 return impl().jacobian(local);
    \n+
    114 else
    \n+
    115 return deprecatedDefaultJacobian(local);
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    \n+\n+
    119 {
    \n+
    120 if constexpr(Std::is_detected_v<JacobianInverseOfImplementation, Implementation>)
    \n+
    121 return impl().jacobianInverse(local);
    \n+
    122 else
    \n+
    123 return deprecatedDefaultJacobianInverse(local);
    \n+
    124 }
    \n+
    \n+
    125
    \n+
    126 const Implementation &impl () const { return *impl_; }
    \n+
    127
    \n+
    128 private:
    \n+
    129 const Implementation *impl_;
    \n+
    130 };
    \n+
    \n+
    131
    \n+
    132
    \n+
    133 // LocalGeometryReference
    \n+
    134 // -----------------------
    \n+
    135
    \n+
    136 template< int mydim, int cdim, class Grid >
    \n+
    \n+\n+
    138 : public GeometryReference< typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl >
    \n+
    139 {
    \n+
    140 typedef typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl Implementation;
    \n+
    141
    \n+
    142 public:
    \n+
    \n+
    143 LocalGeometryReference ( const Implementation &impl )
    \n+
    144 : GeometryReference< Implementation >( impl )
    \n+
    145 {}
    \n+
    \n+
    146 };
    \n+
    \n+
    147
    \n+
    148
    \n+
    149
    \n+
    150 // Definitions of GeometryReference
    \n+
    151 // --------------------------------
    \n+
    152
    \n+
    153 template< class Implementation >
    \n+\n+
    155
    \n+
    156 template< class Implementation >
    \n+\n+
    158
    \n+
    159} // namespace Dune
    \n+
    160
    \n+
    161#endif // #ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition hierarchiciterator.hh:29
    \n-
    Entity & dereference() const
    dereferencing
    Definition hierarchiciterator.hh:68
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition hierarchiciterator.hh:33
    \n-
    const GridImp & grid() const
    obtain a reference to the grid
    Definition hierarchiciterator.hh:81
    \n-
    EntityImp::ElementInfo ElementInfo
    Definition hierarchiciterator.hh:39
    \n-
    int level() const
    ask for level of entities
    Definition hierarchiciterator.hh:74
    \n-
    AlbertaGridHierarchicIterator()
    Definition hierarchiciterator.hh:41
    \n-
    void increment()
    increment
    Definition hierarchiciterator.hh:142
    \n-
    GridImp::ctype ctype
    Definition hierarchiciterator.hh:34
    \n-
    EntityObject::ImplementationType EntityImp
    Definition hierarchiciterator.hh:37
    \n-
    bool equals(const This &other) const
    equality
    Definition hierarchiciterator.hh:62
    \n-
    This & operator=(const This &other)
    assignment operator
    Definition hierarchiciterator.hh:132
    \n-
    MakeableInterfaceObject< Entity > EntityObject
    Definition hierarchiciterator.hh:36
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-\n-
    InterfaceType::Implementation ImplementationType
    Definition common/grid.hh:1122
    \n-\n+
    Definition geometryreference.hh:26
    \n+
    static const int mydimension
    Definition geometryreference.hh:30
    \n+
    ctype integrationElement(const LocalCoordinate &local) const
    Definition geometryreference.hh:93
    \n+
    ctype volume() const
    Definition geometryreference.hh:98
    \n+
    const Implementation & impl() const
    Definition geometryreference.hh:126
    \n+
    JacobianInverse jacobianInverse(const LocalCoordinate &local) const
    Definition geometryreference.hh:118
    \n+
    GlobalCoordinate center() const
    Definition geometryreference.hh:81
    \n+
    Implementation::JacobianTransposed JacobianTransposed
    Definition geometryreference.hh:39
    \n+
    GeometryReference(const Implementation &impl)
    Definition geometryreference.hh:71
    \n+
    Std::detected_or_t< JacobianInverseDefault, JacobianInverseOfImplementation, Implementation > JacobianInverse
    Definition geometryreference.hh:69
    \n+
    LocalCoordinate local(const GlobalCoordinate &global) const
    Definition geometryreference.hh:88
    \n+
    Implementation::GlobalCoordinate GlobalCoordinate
    Definition geometryreference.hh:36
    \n+
    static const int coorddimension
    Definition geometryreference.hh:31
    \n+
    bool affine() const
    Definition geometryreference.hh:77
    \n+
    GlobalCoordinate corner(int i) const
    Definition geometryreference.hh:80
    \n+
    JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
    Definition geometryreference.hh:105
    \n+
    JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
    Definition geometryreference.hh:100
    \n+
    int corners() const
    Definition geometryreference.hh:79
    \n+
    Implementation::LocalCoordinate LocalCoordinate
    Definition geometryreference.hh:35
    \n+
    GlobalCoordinate global(const LocalCoordinate &local) const
    Definition geometryreference.hh:83
    \n+
    Std::detected_or_t< JacobianDefault, JacobianOfImplementation, Implementation > Jacobian
    Definition geometryreference.hh:68
    \n+
    Implementation::ctype ctype
    Definition geometryreference.hh:33
    \n+
    Implementation::JacobianInverseTransposed JacobianInverseTransposed
    Definition geometryreference.hh:38
    \n+
    Jacobian jacobian(const LocalCoordinate &local) const
    Definition geometryreference.hh:110
    \n+
    GeometryType type() const
    Definition geometryreference.hh:75
    \n+
    Definition geometryreference.hh:139
    \n+
    LocalGeometryReference(const Implementation &impl)
    Definition geometryreference.hh:143
    \n+
    Wrapper and interface classes for element geometries.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,224 +1,277 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-hierarchiciterator.hh\n+geometryreference.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH\n-6#define DUNE_ALBERTA_HIERARCHICITERATOR_HH\n+5#ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH\n+6#define DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH\n 7\n-8#include \n-9#include \n-10\n-11#if HAVE_ALBERTA\n-12\n-13namespace Dune\n-14{\n+12#include \n+13\n+14#include \n 15\n-16 // AlbertaGridHierarchicIterator\n-17 // -----------------------------\n-18\n-27 template< class GridImp >\n-28 class AlbertaGridHierarchicIterator\n-29 {\n-30 typedef AlbertaGridHierarchicIterator<_GridImp_> This;\n-31\n-32 public:\n-33 typedef typename GridImp::template Codim<0>::Entity Entity;\n-34 typedef typename GridImp::ctype ctype;\n-35\n-36 typedef MakeableInterfaceObject<_Entity_> EntityObject;\n-37 typedef typename EntityObject::ImplementationType EntityImp;\n-38\n-39 typedef typename EntityImp::ElementInfo ElementInfo;\n+16#include \n+17\n+18namespace Dune\n+19{\n+20\n+21 // GeometryReference\n+22 // -----------------\n+23\n+24 template< class Implementation >\n+25 class GeometryReference\n+26 {\n+27 typedef GeometryReference<_Implementation_> This;\n+28\n+29 public:\n+30 static const int mydimension = Implementation::mydimension;\n+31 static const int coorddimension = Implementation::coorddimension;\n+32\n+33 typedef typename Implementation::ctype ctype;\n+34\n+35 typedef typename Implementation::LocalCoordinate LocalCoordinate;\n+36 typedef typename Implementation::GlobalCoordinate GlobalCoordinate;\n+37\n+38 typedef typename Implementation::JacobianInverseTransposed\n+JacobianInverseTransposed;\n+39 typedef typename Implementation::JacobianTransposed JacobianTransposed;\n 40\n-41 AlbertaGridHierarchicIterator ()\n-42 {}\n-43\n-45 AlbertaGridHierarchicIterator ( const GridImp &grid,\n-46 const ElementInfo &elementInfo,\n-47 int maxLevel );\n-48\n-50 AlbertaGridHierarchicIterator ( const GridImp &grid, int actLevel, int\n-maxLevel );\n-51\n-53 AlbertaGridHierarchicIterator ( const This &other );\n-54\n-56 This &operator=_( const This &other );\n-57\n-59 void increment();\n-60\n-62 bool equals ( const This &other ) const\n-63 {\n-64 return entity_.impl().equals( other.entity_.impl() );\n-65 }\n-66\n-68 Entity &dereference () const\n-69 {\n-70 return entity_;\n-71 }\n-72\n-74 int level () const\n-75 {\n-76 return entity_.impl().level();\n-77 }\n+41 private:\n+42\n+43 template\n+44 using JacobianInverseOfImplementation = decltype(typename Implementation_T::\n+JacobianInverse{std::declval().jacobianInverse(std::\n+declval())});\n+45\n+46 using JacobianInverseDefault = decltype(transpose(std::\n+declval()));\n+47\n+48 template\n+49 using JacobianOfImplementation = decltype(typename Implementation_T::\n+Jacobian{std::declval().jacobian(std::\n+declval())});\n+50\n+51 using JacobianDefault = decltype(transpose(std::declval\n+()));\n+52\n+53\n+54 template \n+55 [[deprecated(\"Geometry implementatons are required to provide a jacobian\n+(local) method. The default implementation is deprecated and will be removed\n+after release 2.9\")]]\n+56 auto deprecatedDefaultJacobian ( const LocalCoordinate& local ) const {\n+57 return transpose(jacobianTransposed(local));\n+58 }\n+59\n+60 template \n+61 [[deprecated(\"Geometry implementatons are required to provide a\n+jacobianInverse(local) method. The default implementation is deprecated and\n+will be removed after release 2.9\")]]\n+62 auto deprecatedDefaultJacobianInverse ( const LocalCoordinate& local ) const\n+{\n+63 return transpose(jacobianInverseTransposed(local));\n+64 }\n+65\n+66 public:\n+67\n+68 using Jacobian = Std::detected_or_t;\n+69 using JacobianInverse = Std::detected_or_t;\n+70\n+71 explicit GeometryReference ( const Implementation &impl )\n+72 : impl_( &impl )\n+73 {}\n+74\n+75 GeometryType type () const { return impl().type(); }\n+76\n+77 bool affine() const { return impl().affine(); }\n 78\n-79 protected:\n-81 const GridImp &grid () const\n-82 {\n-83 return entity_.impl().grid();\n-84 }\n-85\n-86 private:\n-87 void increment ( ElementInfo elementInfo );\n-88\n-89 mutable Entity entity_;\n-90\n-91 // level on which the iterator was started\n-92 int startLevel_;\n-93\n-94 // maximal level to go down to\n-95 int maxlevel_;\n-96 };\n+79 int corners () const { return impl().corners(); }\n+80 GlobalCoordinate corner ( int i ) const { return impl().corner( i ); }\n+81 GlobalCoordinate center () const { return impl().center(); }\n+82\n+83 GlobalCoordinate global ( const LocalCoordinate &local ) const\n+84 {\n+85 return impl().global( local );\n+86 }\n+87\n+88 LocalCoordinate local ( const GlobalCoordinate &global ) const\n+89 {\n+90 return impl().local( global );\n+91 }\n+92\n+93 ctype integrationElement ( const LocalCoordinate &local ) const\n+94 {\n+95 return impl().integrationElement( local );\n+96 }\n 97\n-98\n-99 template< class GridImp >\n-100 inline AlbertaGridHierarchicIterator< GridImp >\n-101 ::AlbertaGridHierarchicIterator( const GridImp &grid, int actLevel, int\n-maxLevel )\n-102 : entity_( EntityImp( grid ) ),\n-103 startLevel_( actLevel ),\n-104 maxlevel_( maxLevel )\n-105 {}\n-106\n-107\n-108 template< class GridImp >\n-109 inline AlbertaGridHierarchicIterator<_GridImp_>\n-110_::AlbertaGridHierarchicIterator ( const GridImp &grid,\n-111 const ElementInfo &elementInfo,\n-112 int maxLevel )\n-113 : entity_( EntityImp( grid ) ),\n-114 startLevel_( elementInfo.level() ),\n-115 maxlevel_( maxLevel )\n-116 {\n-117 increment( elementInfo );\n-118 }\n-119\n-120\n-121 template< class GridImp >\n-122 inline AlbertaGridHierarchicIterator<_GridImp_>\n-123_::AlbertaGridHierarchicIterator( const This &other )\n-124 : entity_( other.entity_ ),\n-125 startLevel_( other.startLevel_ ),\n-126 maxlevel_( other.maxlevel_ )\n-127 {}\n-128\n-129\n-130 template< class GridImp >\n-131 inline typename AlbertaGridHierarchicIterator<_GridImp_>::This &\n-132 AlbertaGridHierarchicIterator<_GridImp_>::operator=_( const This &other )\n-133 {\n-134 entity_ = other.entity_;\n-135 startLevel_ = other.startLevel_;\n-136 maxlevel_ = other.maxlevel_;\n-137 return *this;\n-138 }\n-139\n-140\n-141 template< class GridImp >\n-142 inline void AlbertaGridHierarchicIterator<_GridImp_>::increment ()\n-143 {\n-144 increment( entity_.impl().elementInfo() );\n-145 }\n-146\n-147 template< class GridImp >\n-148 inline void AlbertaGridHierarchicIterator<_GridImp_>\n-149_::increment ( ElementInfo elementInfo )\n-150 {\n-151 assert( !elementInfo == false );\n-152 if( (elementInfo.level() >= maxlevel_) || elementInfo.isLeaf() )\n-153 {\n-154 while( (elementInfo.level() > startLevel_) && (elementInfo.indexInFather()\n-== 1) )\n-155 elementInfo = elementInfo.father();\n-156 if( elementInfo.level() > startLevel_ )\n-157 entity_.impl().setElement( elementInfo.father().child( 1 ), 0 );\n-158 else\n-159 entity_.impl().clearElement();\n-160 }\n-161 else\n-162 entity_.impl().setElement( elementInfo.child( 0 ), 0 );\n-163 }\n-164\n-165}\n-166\n-167#endif // #if HAVE_ALBERTA\n-168\n-169#endif // #ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n+98 ctype volume () const { return impl().volume(); }\n+99\n+100 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local )\n+const\n+101 {\n+102 return impl().jacobianTransposed( local );\n+103 }\n+104\n+105 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate\n+&local ) const\n+106 {\n+107 return impl().jacobianInverseTransposed( local );\n+108 }\n+109\n+110 Jacobian jacobian ( const LocalCoordinate& local ) const\n+111 {\n+112 if constexpr(Std::is_detected_v)\n+113 return impl().jacobian(local);\n+114 else\n+115 return deprecatedDefaultJacobian(local);\n+116 }\n+117\n+118 JacobianInverse jacobianInverse ( const LocalCoordinate &local ) const\n+119 {\n+120 if constexpr(Std::is_detected_v)\n+121 return impl().jacobianInverse(local);\n+122 else\n+123 return deprecatedDefaultJacobianInverse(local);\n+124 }\n+125\n+126 const Implementation &impl () const { return *impl_; }\n+127\n+128 private:\n+129 const Implementation *impl_;\n+130 };\n+131\n+132\n+133 // LocalGeometryReference\n+134 // -----------------------\n+135\n+136 template< int mydim, int cdim, class Grid >\n+137 class LocalGeometryReference\n+138 : public GeometryReference< typename std::remove_const< Grid >::type::\n+Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::\n+LocalGeometryImpl >\n+139 {\n+140 typedef typename std::remove_const< Grid >::type::Traits::template Codim<\n+std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl\n+Implementation;\n+141\n+142 public:\n+143 LocalGeometryReference ( const Implementation &impl )\n+144 : GeometryReference< Implementation >( impl )\n+145 {}\n+146 };\n+147\n+148\n+149\n+150 // Definitions of GeometryReference\n+151 // --------------------------------\n+152\n+153 template< class Implementation >\n+154 const int GeometryReference<_Implementation_>::mydimension;\n+155\n+156 template< class Implementation >\n+157 const int GeometryReference<_Implementation_>::coorddimension;\n+158\n+159} // namespace Dune\n+160\n+161#endif // #ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::AlbertaGridHierarchicIterator\n-Definition hierarchiciterator.hh:29\n-Dune::AlbertaGridHierarchicIterator::dereference\n-Entity & dereference() const\n-dereferencing\n-Definition hierarchiciterator.hh:68\n-Dune::AlbertaGridHierarchicIterator::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Definition hierarchiciterator.hh:33\n-Dune::AlbertaGridHierarchicIterator::grid\n-const GridImp & grid() const\n-obtain a reference to the grid\n-Definition hierarchiciterator.hh:81\n-Dune::AlbertaGridHierarchicIterator::ElementInfo\n-EntityImp::ElementInfo ElementInfo\n-Definition hierarchiciterator.hh:39\n-Dune::AlbertaGridHierarchicIterator::level\n-int level() const\n-ask for level of entities\n-Definition hierarchiciterator.hh:74\n-Dune::AlbertaGridHierarchicIterator::AlbertaGridHierarchicIterator\n-AlbertaGridHierarchicIterator()\n-Definition hierarchiciterator.hh:41\n-Dune::AlbertaGridHierarchicIterator::increment\n-void increment()\n-increment\n-Definition hierarchiciterator.hh:142\n-Dune::AlbertaGridHierarchicIterator::ctype\n-GridImp::ctype ctype\n-Definition hierarchiciterator.hh:34\n-Dune::AlbertaGridHierarchicIterator::EntityImp\n-EntityObject::ImplementationType EntityImp\n-Definition hierarchiciterator.hh:37\n-Dune::AlbertaGridHierarchicIterator::equals\n-bool equals(const This &other) const\n-equality\n-Definition hierarchiciterator.hh:62\n-Dune::AlbertaGridHierarchicIterator::operator=\n-This & operator=(const This &other)\n-assignment operator\n-Definition hierarchiciterator.hh:132\n-Dune::AlbertaGridHierarchicIterator::EntityObject\n-MakeableInterfaceObject< Entity > EntityObject\n-Definition hierarchiciterator.hh:36\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::MakeableInterfaceObject<_Entity_>\n-Dune::MakeableInterfaceObject<_Entity_>::ImplementationType\n-InterfaceType::Implementation ImplementationType\n-Definition common/grid.hh:1122\n-entityiterator.hh\n+Dune::GeometryReference\n+Definition geometryreference.hh:26\n+Dune::GeometryReference::mydimension\n+static const int mydimension\n+Definition geometryreference.hh:30\n+Dune::GeometryReference::integrationElement\n+ctype integrationElement(const LocalCoordinate &local) const\n+Definition geometryreference.hh:93\n+Dune::GeometryReference::volume\n+ctype volume() const\n+Definition geometryreference.hh:98\n+Dune::GeometryReference::impl\n+const Implementation & impl() const\n+Definition geometryreference.hh:126\n+Dune::GeometryReference::jacobianInverse\n+JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n+Definition geometryreference.hh:118\n+Dune::GeometryReference::center\n+GlobalCoordinate center() const\n+Definition geometryreference.hh:81\n+Dune::GeometryReference::JacobianTransposed\n+Implementation::JacobianTransposed JacobianTransposed\n+Definition geometryreference.hh:39\n+Dune::GeometryReference::GeometryReference\n+GeometryReference(const Implementation &impl)\n+Definition geometryreference.hh:71\n+Dune::GeometryReference::JacobianInverse\n+Std::detected_or_t< JacobianInverseDefault, JacobianInverseOfImplementation,\n+Implementation > JacobianInverse\n+Definition geometryreference.hh:69\n+Dune::GeometryReference::local\n+LocalCoordinate local(const GlobalCoordinate &global) const\n+Definition geometryreference.hh:88\n+Dune::GeometryReference::GlobalCoordinate\n+Implementation::GlobalCoordinate GlobalCoordinate\n+Definition geometryreference.hh:36\n+Dune::GeometryReference::coorddimension\n+static const int coorddimension\n+Definition geometryreference.hh:31\n+Dune::GeometryReference::affine\n+bool affine() const\n+Definition geometryreference.hh:77\n+Dune::GeometryReference::corner\n+GlobalCoordinate corner(int i) const\n+Definition geometryreference.hh:80\n+Dune::GeometryReference::jacobianInverseTransposed\n+JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n+&local) const\n+Definition geometryreference.hh:105\n+Dune::GeometryReference::jacobianTransposed\n+JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n+Definition geometryreference.hh:100\n+Dune::GeometryReference::corners\n+int corners() const\n+Definition geometryreference.hh:79\n+Dune::GeometryReference::LocalCoordinate\n+Implementation::LocalCoordinate LocalCoordinate\n+Definition geometryreference.hh:35\n+Dune::GeometryReference::global\n+GlobalCoordinate global(const LocalCoordinate &local) const\n+Definition geometryreference.hh:83\n+Dune::GeometryReference::Jacobian\n+Std::detected_or_t< JacobianDefault, JacobianOfImplementation, Implementation >\n+Jacobian\n+Definition geometryreference.hh:68\n+Dune::GeometryReference::ctype\n+Implementation::ctype ctype\n+Definition geometryreference.hh:33\n+Dune::GeometryReference::JacobianInverseTransposed\n+Implementation::JacobianInverseTransposed JacobianInverseTransposed\n+Definition geometryreference.hh:38\n+Dune::GeometryReference::jacobian\n+Jacobian jacobian(const LocalCoordinate &local) const\n+Definition geometryreference.hh:110\n+Dune::GeometryReference::type\n+GeometryType type() const\n+Definition geometryreference.hh:75\n+Dune::LocalGeometryReference\n+Definition geometryreference.hh:139\n+Dune::LocalGeometryReference::LocalGeometryReference\n+LocalGeometryReference(const Implementation &impl)\n+Definition geometryreference.hh:143\n+geometry.hh\n+Wrapper and interface classes for element geometries.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00623.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00623.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: misc.hh File Reference\n+dune-grid: meshpointer.hh File Reference\n \n \n \n \n \n \n \n@@ -71,187 +71,48 @@\n \n \n \n
    \n \n-
    misc.hh File Reference
    \n+Namespaces
    \n+
    meshpointer.hh File Reference
    \n \n
    \n-
    #include <cassert>
    \n-#include <utility>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/grid/albertagrid/albertaheader.hh>
    \n+\n+

    provides a wrapper for ALBERTA's mesh structure \n+More...

    \n+
    #include <limits>
    \n+#include <string>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/elementinfo.hh>
    \n+#include <dune/grid/albertagrid/macrodata.hh>
    \n+#include <dune/grid/albertagrid/projection.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n-\n-\n-\n-\n-\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::AlbertaError
     
    class  Dune::AlbertaIOError
     
    class  Dune::Alberta::GlobalSpace
     
    struct  Dune::Alberta::NumSubEntities< dim, 0 >
     
    struct  Dune::Alberta::NumSubEntities< dim, dim >
     
    struct  Dune::Alberta::NumSubEntities< 0, 0 >
     
    struct  Dune::Alberta::NumSubEntities< 2, 1 >
     
    struct  Dune::Alberta::NumSubEntities< 3, 1 >
     
    struct  Dune::Alberta::NumSubEntities< 3, 2 >
     
    struct  Dune::Alberta::CodimType< dim, 0 >
     
    struct  Dune::Alberta::CodimType< dim, dim >
     
    struct  Dune::Alberta::CodimType< 2, 1 >
     
    struct  Dune::Alberta::CodimType< 3, 1 >
     
    struct  Dune::Alberta::CodimType< 3, 2 >
     
    struct  Dune::Alberta::FillFlags< dim >
     
    struct  Dune::Alberta::RefinementEdge< dim >
     
    struct  Dune::Alberta::RefinementEdge< 2 >
     
    struct  Dune::Alberta::Dune2AlbertaNumbering< dim, codim >
     
    struct  Dune::Alberta::Dune2AlbertaNumbering< 3, 2 >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< dim, codim >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< dim, 1 >
    class  Dune::Alberta::MeshPointer< dim >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< 1, 1 >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< 3, 2 >
     
    class  Dune::Alberta::NumberingMap< dim, Numbering >
     
    struct  Dune::Alberta::MapVertices< dim, 0 >
     
    struct  Dune::Alberta::MapVertices< 2, 1 >
     
    struct  Dune::Alberta::MapVertices< 3, 1 >
     
    struct  Dune::Alberta::MapVertices< 3, 2 >
     
    struct  Dune::Alberta::MapVertices< dim, dim >
     
    struct  Dune::Alberta::Twist< dim, subdim >
     
    struct  Dune::Alberta::Twist< dim, 1 >
     
    struct  Dune::Alberta::Twist< 1, 1 >
     
    struct  Dune::Alberta::Twist< dim, 2 >
     
    struct  Dune::Alberta::Twist< 2, 2 >
    class  Dune::Alberta::MeshPointer< dim >::MacroIterator
     
    \n \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-\n-\n-\n-

    \n-Macros

    #define DUNE_ALBERTA_CACHE_COORDINATES   1
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-Typedefs

    typedef ALBERTA REAL Dune::Alberta::Real
     
    typedef ALBERTA REAL_B Dune::Alberta::LocalVector
     
    typedef ALBERTA REAL_D Dune::Alberta::GlobalVector
     
    typedef ALBERTA REAL_DD Dune::Alberta::GlobalMatrix
     
    typedef ALBERTA AFF_TRAFO Dune::Alberta::AffineTransformation
     
    typedef ALBERTA MESH Dune::Alberta::Mesh
     
    typedef ALBERTA EL Dune::Alberta::Element
     
    typedef ALBERTA BNDRY_TYPE Dune::Alberta::BoundaryId
     
    typedef U_CHAR Dune::Alberta::ElementType
     
    typedef ALBERTA FE_SPACE Dune::Alberta::DofSpace
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-Functions

    template<class Data >
    Data * Dune::Alberta::memAlloc (size_t size)
     
    template<class Data >
    Data * Dune::Alberta::memCAlloc (size_t size)
     
    template<class Data >
    Data * Dune::Alberta::memReAlloc (Data *ptr, size_t oldSize, size_t newSize)
     
    template<class Data >
    void Dune::Alberta::memFree (Data *ptr, size_t size)
     
    template<int dim>
    int Dune::Alberta::applyTwist (int twist, int i)
     
    template<int dim>
    int Dune::Alberta::applyInverseTwist (int twist, int i)
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-Variables

    static const int Dune::Alberta::dimWorld = DIM_OF_WORLD
     
    static const int Dune::Alberta::meshRefined = MESH_REFINED
     
    static const int Dune::Alberta::meshCoarsened = MESH_COARSENED
     
    static const int Dune::Alberta::InteriorBoundary = INTERIOR
     
    static const int Dune::Alberta::DirichletBoundary = DIRICHLET
     
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_ALBERTA_CACHE_COORDINATES

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_ALBERTA_CACHE_COORDINATES   1
    \n-
    \n-\n-
    \n-
    \n-
    \n+

    Detailed Description

    \n+

    provides a wrapper for ALBERTA's mesh structure

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,150 +1,34 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces | Macros | Typedefs | Functions | Variables\n-misc.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces\n+meshpointer.hh File Reference\n+provides a wrapper for ALBERTA's mesh structure More...\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::AlbertaError\n+class \u00a0 Dune::Alberta::MeshPointer<_dim_>\n \u00a0\n- class \u00a0 Dune::AlbertaIOError\n-\u00a0\n- class \u00a0 Dune::Alberta::GlobalSpace\n-\u00a0\n-struct \u00a0 Dune::Alberta::NumSubEntities<_dim,_0_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::NumSubEntities<_dim,_dim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::NumSubEntities<_0,_0_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::NumSubEntities<_2,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::NumSubEntities<_3,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::NumSubEntities<_3,_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::CodimType<_dim,_0_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::CodimType<_dim,_dim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::CodimType<_2,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::CodimType<_3,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::CodimType<_3,_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::FillFlags<_dim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::RefinementEdge<_dim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::RefinementEdge<_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Dune2AlbertaNumbering<_dim,_codim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Dune2AlbertaNumbering<_3,_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_dim,_codim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_dim,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_1,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_3,_2_>\n-\u00a0\n- class \u00a0 Dune::Alberta::NumberingMap<_dim,_Numbering_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::MapVertices<_dim,_0_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::MapVertices<_2,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::MapVertices<_3,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::MapVertices<_3,_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::MapVertices<_dim,_dim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Twist<_dim,_subdim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Twist<_dim,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Twist<_1,_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Twist<_dim,_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::Twist<_2,_2_>\n+class \u00a0 Dune::Alberta::MeshPointer<_dim_>::MacroIterator\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n-Macros\n-#define\u00a0 DUNE_ALBERTA_CACHE_COORDINATES\u00a0\u00a0\u00a01\n-\u00a0\n-Typedefs\n- typedef ALBERTA REAL\u00a0 Dune::Alberta::Real\n-\u00a0\n- typedef ALBERTA REAL_B\u00a0 Dune::Alberta::LocalVector\n-\u00a0\n- typedef ALBERTA REAL_D\u00a0 Dune::Alberta::GlobalVector\n-\u00a0\n- typedef ALBERTA REAL_DD\u00a0 Dune::Alberta::GlobalMatrix\n-\u00a0\n- typedef ALBERTA AFF_TRAFO\u00a0 Dune::Alberta::AffineTransformation\n-\u00a0\n- typedef ALBERTA MESH\u00a0 Dune::Alberta::Mesh\n-\u00a0\n- typedef ALBERTA EL\u00a0 Dune::Alberta::Element\n-\u00a0\n-typedef ALBERTA BNDRY_TYPE\u00a0 Dune::Alberta::BoundaryId\n-\u00a0\n- typedef U_CHAR\u00a0 Dune::Alberta::ElementType\n-\u00a0\n- typedef ALBERTA FE_SPACE\u00a0 Dune::Alberta::DofSpace\n-\u00a0\n-Functions\n-template\n-Data *\u00a0 Dune::Alberta::memAlloc (size_t size)\n-\u00a0\n-template\n-Data *\u00a0 Dune::Alberta::memCAlloc (size_t size)\n-\u00a0\n-template\n-Data *\u00a0 Dune::Alberta::memReAlloc (Data *ptr, size_t oldSize, size_t newSize)\n-\u00a0\n-template\n- void\u00a0 Dune::Alberta::memFree (Data *ptr, size_t size)\n-\u00a0\n-template\n- int\u00a0 Dune::Alberta::applyTwist (int twist, int i)\n-\u00a0\n-template\n- int\u00a0 Dune::Alberta::applyInverseTwist (int twist, int i)\n-\u00a0\n-Variables\n-static const int\u00a0 Dune::Alberta::dimWorld = DIM_OF_WORLD\n-\u00a0\n-static const int\u00a0 Dune::Alberta::meshRefined = MESH_REFINED\n-\u00a0\n-static const int\u00a0 Dune::Alberta::meshCoarsened = MESH_COARSENED\n-\u00a0\n-static const int\u00a0 Dune::Alberta::InteriorBoundary = INTERIOR\n-\u00a0\n-static const int\u00a0 Dune::Alberta::DirichletBoundary = DIRICHLET\n-\u00a0\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_ALBERTA_CACHE_COORDINATES *****\n-#define DUNE_ALBERTA_CACHE_COORDINATES\u00a0\u00a0\u00a01\n+***** Detailed Description *****\n+provides a wrapper for ALBERTA's mesh structure\n+ Author\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00623_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00623_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: misc.hh Source File\n+dune-grid: meshpointer.hh Source File\n \n \n \n \n \n \n \n@@ -74,870 +74,623 @@\n \n \n \n
    \n-
    misc.hh
    \n+
    meshpointer.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_MISC_HH
    \n-
    6#define DUNE_ALBERTA_MISC_HH
    \n+
    5#ifndef DUNE_ALBERTA_MESHPOINTER_HH
    \n+
    6#define DUNE_ALBERTA_MESHPOINTER_HH
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9#include <utility>
    \n-
    10
    \n-
    11#include <dune/common/exceptions.hh>
    \n-
    12#include <dune/common/hybridutilities.hh>
    \n-
    13#include <dune/common/typetraits.hh>
    \n-
    14
    \n-\n-
    16
    \n-
    17#if HAVE_ALBERTA
    \n-
    18
    \n-
    19// should the coordinates be cached in a vector (required for ALBERTA 2.0)?
    \n-
    20#ifndef DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    21#define DUNE_ALBERTA_CACHE_COORDINATES 1
    \n-
    22#endif
    \n-
    23
    \n-
    24namespace Dune
    \n-
    25{
    \n-
    26
    \n-
    27 // Exceptions
    \n-
    28 // ----------
    \n-
    29
    \n-
    \n-\n-
    31 : public Exception
    \n-
    32 {};
    \n-
    \n-
    33
    \n-
    \n-\n-
    35 : public IOError
    \n-
    36 {};
    \n-
    \n+
    13#include <limits>
    \n+
    14#include <string>
    \n+
    15
    \n+\n+\n+\n+\n+
    20
    \n+
    21#if HAVE_ALBERTA
    \n+
    22
    \n+
    23namespace Dune
    \n+
    24{
    \n+
    25
    \n+
    26 namespace Alberta
    \n+
    27 {
    \n+
    28
    \n+
    29 // External Forward Declarations
    \n+
    30 // -----------------------------
    \n+
    31
    \n+
    32 template< int dim >
    \n+
    33 class HierarchyDofNumbering;
    \n+
    34
    \n+
    35 // MeshPointer
    \n+
    36 // -----------
    \n
    37
    \n-
    38
    \n-
    39
    \n-
    40 namespace Alberta
    \n-
    41 {
    \n-
    42
    \n-
    43 // Import Types
    \n-
    44 // ------------
    \n-
    45
    \n-
    46 static const int dimWorld = DIM_OF_WORLD;
    \n-
    47
    \n-
    48 typedef ALBERTA REAL Real;
    \n-
    49 typedef ALBERTA REAL_B LocalVector; // in barycentric coordinates
    \n-
    50 typedef ALBERTA REAL_D GlobalVector;
    \n-
    51 typedef ALBERTA REAL_DD GlobalMatrix;
    \n-
    52 typedef ALBERTA AFF_TRAFO AffineTransformation;
    \n-
    53 typedef ALBERTA MESH Mesh;
    \n-
    54 typedef ALBERTA EL Element;
    \n-
    55
    \n-
    56 static const int meshRefined = MESH_REFINED;
    \n-
    57 static const int meshCoarsened = MESH_COARSENED;
    \n-
    58
    \n-
    59 static const int InteriorBoundary = INTERIOR;
    \n-
    60 static const int DirichletBoundary = DIRICHLET;
    \n-
    61 typedef ALBERTA BNDRY_TYPE BoundaryId;
    \n-
    62
    \n-
    63 typedef U_CHAR ElementType;
    \n-
    64
    \n-
    65 typedef ALBERTA FE_SPACE DofSpace;
    \n-
    66
    \n-
    67
    \n-
    68
    \n-
    69 // Memory Manipulation Functions
    \n-
    70 // -----------------------------
    \n-
    71
    \n-
    72 template< class Data >
    \n-
    \n-
    73 inline Data *memAlloc ( size_t size )
    \n-
    74 {
    \n-
    75 return MEM_ALLOC( size, Data );
    \n-
    76 }
    \n-
    \n-
    77
    \n-
    78 template< class Data >
    \n-
    \n-
    79 inline Data *memCAlloc ( size_t size )
    \n-
    80 {
    \n-
    81 return MEM_CALLOC( size, Data );
    \n-
    82 }
    \n-
    \n+
    38 template< int dim >
    \n+
    \n+\n+
    40 {
    \n+\n+\n+
    43 typedef typename ElementInfo::FillFlags FillFlags;
    \n+
    44
    \n+
    45 class BoundaryProvider;
    \n+
    46
    \n+
    47 template< int dimWorld >
    \n+
    48 struct Library;
    \n+
    49
    \n+
    50 public:
    \n+
    51 class MacroIterator;
    \n+
    52
    \n+
    \n+\n+
    54 : mesh_( 0 )
    \n+
    55 {}
    \n+
    \n+
    56
    \n+
    \n+
    57 explicit MeshPointer ( Mesh *mesh )
    \n+
    58 : mesh_( mesh )
    \n+
    59 {}
    \n+
    \n+
    60
    \n+
    \n+
    61 operator Mesh * () const
    \n+
    62 {
    \n+
    63 return mesh_;
    \n+
    64 }
    \n+
    \n+
    65
    \n+
    \n+
    66 explicit operator bool () const
    \n+
    67 {
    \n+
    68 return (bool)mesh_;
    \n+
    69 }
    \n+
    \n+
    70
    \n+
    \n+\n+
    72 {
    \n+
    73 return MacroIterator( *this, false );
    \n+
    74 }
    \n+
    \n+
    75
    \n+
    \n+\n+
    77 {
    \n+
    78 return MacroIterator( *this, true );
    \n+
    79 }
    \n+
    \n+
    80
    \n+
    \n+
    81 int numMacroElements () const;
    \n+
    82 int size ( int codim ) const;
    \n
    83
    \n-
    84 template< class Data >
    \n-
    \n-
    85 inline Data *memReAlloc ( Data *ptr, size_t oldSize, size_t newSize )
    \n-
    86 {
    \n-
    87 return MEM_REALLOC( ptr, oldSize, newSize, Data );
    \n-
    88 }
    \n-
    \n-
    89
    \n-
    90 template< class Data >
    \n-
    \n-
    91 inline void memFree ( Data *ptr, size_t size )
    \n-
    92 {
    \n-
    93 return MEM_FREE( ptr, size, Data );
    \n-
    94 }
    \n-
    \n-
    95
    \n+
    84 // create a mesh from a macrodata structure
    \n+
    85 // params: macroData - macro data structure
    \n+
    86 // returns: number of boundary segments
    \n+
    \n+
    87 unsigned int create ( const MacroData< dim > &macroData );
    \n+
    88
    \n+
    89 // create a mesh from a macrodata structure, adding projections
    \n+
    90 // params: macroData - macro data structure
    \n+
    91 // projectionFactory - factory for the projections
    \n+
    92 // returns: number of boundary segments
    \n+
    93 template< class Proj, class Impl >
    \n+
    \n+
    94 unsigned int create ( const MacroData< dim > &macroData,
    \n+
    95 const ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
    \n
    96
    \n-
    97
    \n-
    98 // GlobalSpace
    \n-
    99 // -----------
    \n-
    100
    \n-
    \n-\n-
    102 {
    \n-
    103 typedef GlobalSpace This;
    \n-
    104
    \n-
    105 public:
    \n-\n-\n-
    108
    \n-
    109 private:
    \n-
    110 Matrix identityMatrix_;
    \n-
    111 Vector nullVector_;
    \n-
    112
    \n-
    113 GlobalSpace ()
    \n-
    114 {
    \n-
    115 for( int i = 0; i < dimWorld; ++i )
    \n-
    116 {
    \n-
    117 for( int j = 0; j < dimWorld; ++j )
    \n-
    118 identityMatrix_[ i ][ j ] = Real( 0 );
    \n-
    119 identityMatrix_[ i ][ i ] = Real( 1 );
    \n-
    120 nullVector_[ i ] = Real( 0 );
    \n-
    121 }
    \n-
    122 }
    \n-
    123
    \n-
    124 static This &instance ()
    \n-
    125 {
    \n-
    126 static This theInstance;
    \n-
    127 return theInstance;
    \n-
    128 }
    \n+
    97 // create a mesh from a file
    \n+
    98 // params: filename - file name of an Alberta macro triangulation
    \n+
    99 // binary - read binary?
    \n+
    100 // returns: number of boundary segments
    \n+
    \n+
    101 unsigned int create ( const std::string &filename, bool binary = false );
    \n+
    102
    \n+
    103 // read back a mesh from a file
    \n+
    104 // params: filename - file name of an Alberta save file
    \n+
    105 // time - variable to receive the time stored in the file
    \n+
    106 // returns: number of boundary segments
    \n+
    107 //
    \n+
    108 // notes: - projections are not preserved
    \n+
    109 // - we assume that projections are added in the same order they
    \n+
    110 // inserted in when the grid was created (otherwise the boundary
    \n+
    111 // indices change)
    \n+
    \n+
    112 unsigned int read ( const std::string &filename, Real &time );
    \n+
    113
    \n+
    \n+
    114 bool write ( const std::string &filename, Real time ) const;
    \n+
    115
    \n+
    \n+
    116 void release ();
    \n+
    117
    \n+
    118 template< class Functor >
    \n+
    \n+
    119 void hierarchicTraverse ( Functor &functor,
    \n+
    120 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;
    \n+
    121
    \n+
    122 template< class Functor >
    \n+
    \n+
    123 void leafTraverse ( Functor &functor,
    \n+
    124 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;
    \n+
    125
    \n+
    \n+
    126 bool coarsen ( typename FillFlags::Flags fillFlags = FillFlags::nothing );
    \n+
    127
    \n+
    \n+
    128 bool refine ( typename FillFlags::Flags fillFlags = FillFlags::nothing );
    \n
    129
    \n-
    130 public:
    \n-
    \n-
    131 static const Matrix &identityMatrix ()
    \n-
    132 {
    \n-
    133 return instance().identityMatrix_;
    \n-
    134 }
    \n-
    \n-
    135
    \n-
    \n-
    136 static const Vector &nullVector ()
    \n-
    137 {
    \n-
    138 return instance().nullVector_;
    \n-
    139 }
    \n-
    \n-
    140 };
    \n-
    \n+
    130 private:
    \n+
    131 static ALBERTA NODE_PROJECTION *
    \n+
    132 initNodeProjection ( [[maybe_unused]] Mesh *mesh, ALBERTA MACRO_EL *macroElement, int n );
    \n+
    133 template< class ProjectionProvider >
    \n+
    134 static ALBERTA NODE_PROJECTION *
    \n+
    135 initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroElement, int n );
    \n+
    136
    \n+
    137 Mesh *mesh_;
    \n+
    138 };
    \n+
    139
    \n+
    140
    \n
    141
    \n-
    142
    \n-
    143
    \n-
    144 // NumSubEntities
    \n-
    145 // --------------
    \n-
    146
    \n-
    147 template< int dim, int codim >
    \n-\n-
    149
    \n-
    150 template< int dim >
    \n-
    \n-
    151 struct NumSubEntities< dim, 0 >
    \n-
    152 {
    \n-
    153 static const int value = 1;
    \n-
    154 };
    \n-
    \n-
    155
    \n-
    156 template< int dim >
    \n-
    \n-
    157 struct NumSubEntities< dim, dim >
    \n-
    158 {
    \n-
    159 static const int value = dim+1;
    \n-
    160 };
    \n-
    \n+
    142 // MeshPointer::Library
    \n+
    143 // --------------------
    \n+
    144
    \n+
    145 template< int dim >
    \n+
    146 template< int dimWorld >
    \n+
    147 struct MeshPointer< dim >::Library
    \n+
    148 {
    \n+\n+
    150
    \n+
    151 static inline unsigned int boundaryCount = 0;
    \n+
    152 static inline const void *projectionFactory = nullptr;
    \n+
    153
    \n+
    154 static void
    \n+
    155 create ( MeshPointer &ptr, const MacroData< dim > &macroData,
    \n+
    156 ALBERTA NODE_PROJECTION *(*initNodeProjection)( Mesh *, ALBERTA MACRO_EL *, int ) );
    \n+
    157 static void release ( MeshPointer &ptr );
    \n+
    158 };
    \n+
    159
    \n+
    160
    \n
    161
    \n-
    162 template<>
    \n-
    \n-
    163 struct NumSubEntities< 0, 0 >
    \n-
    164 {
    \n-
    165 static const int value = 1;
    \n-
    166 };
    \n-
    \n-
    167
    \n-
    168 template<>
    \n-
    \n-
    169 struct NumSubEntities< 2, 1 >
    \n-
    170 {
    \n-
    171 static const int value = 3;
    \n-
    172 };
    \n-
    \n-
    173
    \n-
    174 template<>
    \n-
    \n-
    175 struct NumSubEntities< 3, 1 >
    \n-
    176 {
    \n-
    177 static const int value = 4;
    \n-
    178 };
    \n-
    \n-
    179
    \n-
    180 template<>
    \n-
    \n-
    181 struct NumSubEntities< 3, 2 >
    \n-
    182 {
    \n-
    183 static const int value = 6;
    \n-
    184 };
    \n-
    \n-
    185
    \n-
    186
    \n+
    162 // MeshPointer::MacroIterator
    \n+
    163 // --------------------------
    \n+
    164
    \n+
    165 template< int dim >
    \n+
    \n+\n+
    167 {
    \n+\n+
    169
    \n+
    170 friend class MeshPointer< dim >;
    \n+
    171
    \n+
    172 public:
    \n+\n+\n+
    175
    \n+
    \n+\n+
    177 : mesh_(),
    \n+
    178 index_( -1 )
    \n+
    179 {}
    \n+
    \n+
    180
    \n+
    181 private:
    \n+
    182
    \n+
    183 explicit MacroIterator ( const MeshPointer &mesh, bool end = false )
    \n+
    184 : mesh_( mesh ),
    \n+
    185 index_( end ? mesh.numMacroElements() : 0 )
    \n+
    186 {}
    \n
    187
    \n-
    188 // CodimType
    \n-
    189 // ---------
    \n-
    190
    \n-
    191 template< int dim, int codim >
    \n-
    192 struct CodimType;
    \n+
    188 public:
    \n+
    \n+
    189 bool done () const
    \n+
    190 {
    \n+
    191 return (index_ >= mesh().numMacroElements());
    \n+
    192 }
    \n+
    \n
    193
    \n-
    194 template< int dim >
    \n-
    \n-
    195 struct CodimType< dim, 0 >
    \n-
    196 {
    \n-
    197 static const int value = CENTER;
    \n-
    198 };
    \n-
    \n-
    199
    \n-
    200 template< int dim >
    \n-
    \n-
    201 struct CodimType< dim, dim >
    \n-
    202 {
    \n-
    203 static const int value = VERTEX;
    \n-
    204 };
    \n-
    \n-
    205
    \n-
    206 template<>
    \n-
    \n-
    207 struct CodimType< 2, 1 >
    \n-
    208 {
    \n-
    209 static const int value = EDGE;
    \n-
    210 };
    \n-
    \n-
    211
    \n-
    212 template<>
    \n-
    \n-
    213 struct CodimType< 3, 1 >
    \n-
    214 {
    \n-
    215 static const int value = FACE;
    \n-
    216 };
    \n-
    \n-
    217
    \n-
    218 template<>
    \n-
    \n-
    219 struct CodimType< 3, 2 >
    \n-
    220 {
    \n-
    221 static const int value = EDGE;
    \n-
    222 };
    \n-
    \n-
    223
    \n-
    224
    \n-
    225
    \n-
    226 // FillFlags
    \n-
    227 // ---------
    \n-
    228
    \n-
    229 template< int dim >
    \n-
    \n-\n-
    231 {
    \n-
    232 typedef ALBERTA FLAGS Flags;
    \n-
    233
    \n-
    234 static const Flags nothing = FILL_NOTHING;
    \n-
    235
    \n-
    236 static const Flags coords = FILL_COORDS;
    \n-
    237
    \n-
    238 static const Flags neighbor = FILL_NEIGH;
    \n-
    239
    \n-
    240 static const Flags orientation = (dim == 3 ? FILL_ORIENTATION : FILL_NOTHING);
    \n-
    241
    \n-
    242 static const Flags projection = FILL_PROJECTION;
    \n-
    243
    \n-
    244 static const Flags elementType = FILL_NOTHING;
    \n+
    \n+
    194 bool equals ( const MacroIterator &other ) const
    \n+
    195 {
    \n+
    196 return (index_ == other.index_);
    \n+
    197 }
    \n+
    \n+
    198
    \n+
    \n+
    199 void increment ()
    \n+
    200 {
    \n+
    201 assert( !done() );
    \n+
    202 ++index_;
    \n+
    203 }
    \n+
    \n+
    204
    \n+
    \n+\n+
    206 {
    \n+
    207 assert( !done() );
    \n+
    208 return static_cast< const MacroElement & >( mesh().mesh_->macro_els[ index_ ] );
    \n+
    209 }
    \n+
    \n+
    210
    \n+
    \n+
    211 const MeshPointer &mesh () const
    \n+
    212 {
    \n+
    213 return mesh_;
    \n+
    214 }
    \n+
    \n+
    215
    \n+
    \n+
    216 This &operator++ ()
    \n+
    217 {
    \n+
    218 increment();
    \n+
    219 return *this;
    \n+
    220 }
    \n+
    \n+
    221
    \n+
    \n+
    222 ElementInfo operator* () const
    \n+
    223 {
    \n+
    224 return elementInfo();
    \n+
    225 }
    \n+
    \n+
    226
    \n+
    \n+
    227 bool operator== ( const MacroIterator &other ) const
    \n+
    228 {
    \n+
    229 return equals( other );
    \n+
    230 }
    \n+
    \n+
    231
    \n+
    \n+
    232 bool operator!= ( const MacroIterator &other ) const
    \n+
    233 {
    \n+
    234 return !equals( other );
    \n+
    235 }
    \n+
    \n+
    236
    \n+\n+
    \n+
    238 elementInfo ( typename FillFlags::Flags fillFlags = FillFlags::standard ) const
    \n+
    239 {
    \n+
    240 if( done() )
    \n+
    241 return ElementInfo();
    \n+
    242 else
    \n+
    243 return ElementInfo( mesh(), macroElement(), fillFlags );
    \n+
    244 }
    \n+
    \n
    245
    \n-
    246 static const Flags boundaryId = FILL_MACRO_WALLS;
    \n-
    247
    \n-
    248 static const Flags nonPeriodic = FILL_NON_PERIODIC;
    \n-
    249
    \n-\n-\n+
    246 private:
    \n+
    247 MeshPointer mesh_;
    \n+
    248 int index_;
    \n+
    249 };
    \n+
    \n+
    250
    \n+
    251
    \n
    252
    \n-
    253 static const Flags standardWithCoords = all & ~nonPeriodic & ~projection;
    \n-
    254
    \n-
    255#if DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    256 static const Flags standard = standardWithCoords & ~coords;
    \n-
    257#else
    \n-\n-
    259#endif
    \n-
    260 };
    \n+
    253 // Implementation of MeshPointer
    \n+
    254 // -----------------------------
    \n+
    255
    \n+
    256 template< int dim >
    \n+
    \n+\n+
    258 {
    \n+
    259 return (mesh_ ? mesh_->n_macro_el : 0);
    \n+
    260 }
    \n
    \n
    261
    \n
    262
    \n-
    263
    \n-
    264 // RefinementEdge
    \n-
    265 // --------------
    \n-
    266
    \n-
    267 template< int dim >
    \n-
    \n-\n-
    269 {
    \n-
    270 static const int value = 0;
    \n-
    271 };
    \n-
    \n-
    272
    \n-
    273 template<>
    \n-
    \n-
    274 struct RefinementEdge< 2 >
    \n-
    275 {
    \n-
    276 static const int value = 2;
    \n-
    277 };
    \n-
    \n-
    278
    \n-
    279
    \n-
    280
    \n-
    281 // Dune2AlbertaNumbering
    \n-
    282 // ---------------------
    \n-
    283
    \n-
    284 template< int dim, int codim >
    \n-
    \n-\n-
    286 {
    \n-
    \n-
    287 static int apply ( const int i )
    \n-
    288 {
    \n-
    289 assert( (i >= 0) && (i < NumSubEntities< dim, codim >::value) );
    \n-
    290 return i;
    \n-
    291 }
    \n-
    \n-
    292 };
    \n-
    \n-
    293
    \n-
    294 template<>
    \n-
    \n-\n-
    296 {
    \n-
    297 static const int numSubEntities = NumSubEntities< 3, 2 >::value;
    \n-
    298
    \n+
    263 template<>
    \n+
    \n+
    264 inline int MeshPointer< 1 >::size( int codim ) const
    \n+
    265 {
    \n+
    266 assert( (codim >= 0) && (codim <= 1) );
    \n+
    267 return (codim == 0 ? mesh_->n_elements : mesh_->n_vertices);
    \n+
    268 }
    \n+
    \n+
    269
    \n+
    270 template<>
    \n+
    \n+
    271 inline int MeshPointer< 2 >::size( int codim ) const
    \n+
    272 {
    \n+
    273 assert( (codim >= 0) && (codim <= 2) );
    \n+
    274 if( codim == 0 )
    \n+
    275 return mesh_->n_elements;
    \n+
    276 else if( codim == 2 )
    \n+
    277 return mesh_->n_vertices;
    \n+
    278 else
    \n+
    279 return mesh_->n_edges;
    \n+
    280 }
    \n+
    \n+
    281
    \n+
    282 template<>
    \n+
    \n+
    283 inline int MeshPointer< 3 >::size( int codim ) const
    \n+
    284 {
    \n+
    285 assert( (codim >= 0) && (codim <= 3) );
    \n+
    286 if( codim == 0 )
    \n+
    287 return mesh_->n_elements;
    \n+
    288 else if( codim == 3 )
    \n+
    289 return mesh_->n_vertices;
    \n+
    290 else if( codim == 1 )
    \n+
    291 return mesh_->n_faces;
    \n+
    292 else
    \n+
    293 return mesh_->n_edges;
    \n+
    294 }
    \n+
    \n+
    295
    \n+
    296
    \n+
    297 template< int dim >
    \n+
    298 inline unsigned int MeshPointer< dim >
    \n
    \n-
    299 static int apply ( const int i )
    \n-
    300 {
    \n-
    301 assert( (i >= 0) && (i < numSubEntities) );
    \n-
    302 static int dune2alberta[ numSubEntities ] = { 0, 3, 1, 2, 4, 5 };
    \n-
    303 return dune2alberta[ i ];
    \n-
    304 }
    \n-
    \n-
    305 };
    \n+
    299 ::create ( const MacroData< dim > &macroData )
    \n+
    300 {
    \n+
    301 release();
    \n+
    302
    \n+
    303 Library< dimWorld >::boundaryCount = 0;
    \n+
    304 Library< dimWorld >::create( *this, macroData, &initNodeProjection );
    \n+
    305 return Library< dimWorld >::boundaryCount;
    \n+
    306 }
    \n
    \n-
    306
    \n
    307
    \n
    308
    \n-
    309 // Generic2AlbertaNumbering
    \n-
    310 // ------------------------
    \n-
    311
    \n-
    312 template< int dim, int codim >
    \n-
    \n-\n+
    309 template< int dim >
    \n+
    310 template< class Proj, class Impl >
    \n+
    311 inline unsigned int MeshPointer< dim >
    \n+
    \n+
    312 ::create ( const MacroData< dim > &macroData,
    \n+
    313 const ProjectionFactoryInterface< Proj, Impl > &projectionFactory )
    \n
    314 {
    \n-
    \n-
    315 static int apply ( const int i )
    \n-
    316 {
    \n-
    317 assert( (i >= 0) && (i < NumSubEntities< dim, codim >::value) );
    \n-
    318 return i;
    \n-
    319 }
    \n-
    \n-
    320 };
    \n-
    \n-
    321
    \n-
    322 template< int dim >
    \n-
    \n-\n-
    324 {
    \n-
    \n-
    325 static int apply ( const int i )
    \n-
    326 {
    \n-
    327 assert( (i >= 0) && (i < NumSubEntities< dim, 1 >::value) );
    \n-
    328 return dim - i;
    \n-
    329 }
    \n-
    \n-
    330 };
    \n-
    \n-
    331
    \n-
    332 template<>
    \n-
    \n-\n-
    334 {
    \n-
    \n-
    335 static int apply ( const int i )
    \n-
    336 {
    \n-
    337 assert( (i >= 0) && (i < NumSubEntities< 1, 1 >::value) );
    \n-
    338 return i;
    \n-
    339 }
    \n-
    \n-
    340 };
    \n-
    \n-
    341
    \n-
    342 template<>
    \n-
    \n-\n-
    344 {
    \n-
    345 static const int numSubEntities = NumSubEntities< 3, 2 >::value;
    \n-
    346
    \n-
    \n-
    347 static int apply ( const int i )
    \n-
    348 {
    \n-
    349 assert( (i >= 0) && (i < numSubEntities) );
    \n-
    350 static int generic2alberta[ numSubEntities ] = { 0, 1, 3, 2, 4, 5 };
    \n-
    351 return generic2alberta[ i ];
    \n-
    352 }
    \n-
    \n-
    353 };
    \n-
    \n-
    354
    \n-
    355
    \n-
    356
    \n-
    357 // NumberingMap
    \n-
    358 // ------------
    \n+\n+
    316
    \n+
    317 release();
    \n+
    318
    \n+
    319 Library< dimWorld >::boundaryCount = 0;
    \n+
    320 Library< dimWorld >::projectionFactory = &projectionFactory;
    \n+
    321 Library< dimWorld >::create( *this, macroData, &initNodeProjection< ProjectionFactory > );
    \n+
    322 Library< dimWorld >::projectionFactory = nullptr;
    \n+
    323 return Library< dimWorld >::boundaryCount;
    \n+
    324 }
    \n+
    \n+
    325
    \n+
    326
    \n+
    327
    \n+
    328
    \n+
    329 template< int dim >
    \n+
    330 inline unsigned int MeshPointer< dim >
    \n+
    \n+
    331 ::create ( const std::string &filename, bool binary )
    \n+
    332 {
    \n+
    333 MacroData< dim > macroData;
    \n+
    334 macroData.read( filename, binary );
    \n+
    335 const unsigned int boundaryCount = create( macroData );
    \n+
    336 macroData.release();
    \n+
    337 return boundaryCount;
    \n+
    338 }
    \n+
    \n+
    339
    \n+
    340
    \n+
    341 template< int dim >
    \n+
    \n+
    342 inline unsigned int MeshPointer< dim >::read ( const std::string &filename, Real &time )
    \n+
    343 {
    \n+
    344 release();
    \n+
    345
    \n+
    346 Library< dimWorld >::boundaryCount = 0;
    \n+
    347 mesh_ = ALBERTA read_mesh_xdr( filename.c_str(), &time, NULL, NULL );
    \n+
    348 return Library< dimWorld >::boundaryCount;
    \n+
    349 }
    \n+
    \n+
    350
    \n+
    351
    \n+
    352 template< int dim >
    \n+
    \n+
    353 inline bool MeshPointer< dim >::write ( const std::string &filename, Real time ) const
    \n+
    354 {
    \n+
    355 int success = ALBERTA write_mesh_xdr( mesh_, filename.c_str(), time );
    \n+
    356 return (success == 0);
    \n+
    357 }
    \n+
    \n+
    358
    \n
    359
    \n-
    360 template< int dim, template< int, int > class Numbering = Generic2AlbertaNumbering >
    \n-
    \n-\n+
    360 template< int dim >
    \n+
    \n+\n
    362 {
    \n-\n-
    364
    \n-
    365 template< int codim >
    \n-
    366 struct Initialize;
    \n-
    367
    \n-
    368 int *dune2alberta_[ dim+1 ];
    \n-
    369 int *alberta2dune_[ dim+1 ];
    \n-
    370 int numSubEntities_[ dim+1 ];
    \n-
    371
    \n-
    372 NumberingMap ( const This & );
    \n-
    373 This &operator= ( const This & );
    \n-
    374
    \n-
    375 public:
    \n-
    \n-\n-
    377 {
    \n-
    378 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ Initialize< i >::apply( *this ); } );
    \n-
    379 }
    \n+
    363 Library< dimWorld >::release( *this );
    \n+
    364 }
    \n+
    \n+
    365
    \n+
    366
    \n+
    367 template< int dim >
    \n+
    368 template< class Functor >
    \n+
    369 inline void MeshPointer< dim >
    \n+
    \n+
    370 ::hierarchicTraverse ( Functor &functor,
    \n+
    371 typename FillFlags::Flags fillFlags ) const
    \n+
    372 {
    \n+
    373 const MacroIterator eit = end();
    \n+
    374 for( MacroIterator it = begin(); it != eit; ++it )
    \n+
    375 {
    \n+
    376 const ElementInfo info = it.elementInfo( fillFlags );
    \n+
    377 info.hierarchicTraverse( functor );
    \n+
    378 }
    \n+
    379 }
    \n
    \n
    380
    \n-
    \n-\n-
    382 {
    \n-
    383 for( int codim = 0; codim <= dim; ++codim )
    \n-
    384 {
    \n-
    385 delete[]( dune2alberta_[ codim ] );
    \n-
    386 delete[]( alberta2dune_[ codim ] );
    \n-
    387 }
    \n-
    388 }
    \n-
    \n-
    389
    \n-
    \n-
    390 int dune2alberta ( int codim, int i ) const
    \n-
    391 {
    \n-
    392 assert( (codim >= 0) && (codim <= dim) );
    \n-
    393 assert( (i >= 0) && (i < numSubEntities( codim )) );
    \n-
    394 return dune2alberta_[ codim ][ i ];
    \n-
    395 }
    \n+
    381
    \n+
    382 template< int dim >
    \n+
    383 template< class Functor >
    \n+
    384 inline void MeshPointer< dim >
    \n+
    \n+
    385 ::leafTraverse ( Functor &functor,
    \n+
    386 typename FillFlags::Flags fillFlags ) const
    \n+
    387 {
    \n+
    388 const MacroIterator eit = end();
    \n+
    389 for( MacroIterator it = begin(); it != eit; ++it )
    \n+
    390 {
    \n+
    391 const ElementInfo info = it.elementInfo( fillFlags );
    \n+
    392 info.leafTraverse( functor );
    \n+
    393 }
    \n+
    394 }
    \n
    \n+
    395
    \n
    396
    \n-
    \n-
    397 int alberta2dune ( int codim, int i ) const
    \n-
    398 {
    \n-
    399 assert( (codim >= 0) && (codim <= dim) );
    \n-
    400 assert( (i >= 0) && (i < numSubEntities( codim )) );
    \n-
    401 return alberta2dune_[ codim ][ i ];
    \n-
    402 }
    \n-
    \n-
    403
    \n-
    \n-
    404 int numSubEntities ( int codim ) const
    \n-
    405 {
    \n-
    406 assert( (codim >= 0) && (codim <= dim) );
    \n-
    407 return numSubEntities_[ codim ];
    \n-
    408 }
    \n+
    397 template< int dim >
    \n+
    \n+
    398 inline bool MeshPointer< dim >::coarsen ( typename FillFlags::Flags fillFlags )
    \n+
    399 {
    \n+
    400 const bool coarsened = (ALBERTA coarsen( mesh_, fillFlags ) == meshCoarsened);
    \n+
    401 if( coarsened )
    \n+
    402 ALBERTA dof_compress( mesh_ );
    \n+
    403 return coarsened;
    \n+
    404 }
    \n+
    \n+
    405
    \n+
    406 template< int dim >
    \n+
    \n+
    407 inline bool MeshPointer< dim >::refine ( typename FillFlags::Flags fillFlags )
    \n+
    408 {
    \n+
    409 return (ALBERTA refine( mesh_, fillFlags ) == meshRefined);
    \n+
    410 }
    \n
    \n-
    409 };
    \n
    \n-
    410
    \n
    411
    \n
    412
    \n-
    413 // NumberingMap::Initialize
    \n-
    414 // ------------------------
    \n-
    415
    \n-
    416 template< int dim, template< int, int > class Numbering >
    \n-
    417 template< int codim >
    \n-
    418 struct NumberingMap< dim, Numbering >::Initialize
    \n-
    419 {
    \n-
    420 static const int numSubEntities = NumSubEntities< dim, codim >::value;
    \n-
    421
    \n-
    422 static void apply ( NumberingMap< dim, Numbering > &map )
    \n-
    423 {
    \n-
    424 map.numSubEntities_[ codim ] = numSubEntities;
    \n-
    425 map.dune2alberta_[ codim ] = new int[ numSubEntities ];
    \n-
    426 map.alberta2dune_[ codim ] = new int[ numSubEntities ];
    \n-
    427
    \n-
    428 for( int i = 0; i < numSubEntities; ++i )
    \n-
    429 {
    \n-
    430 const int j = Numbering< dim, codim >::apply( i );
    \n-
    431 map.dune2alberta_[ codim ][ i ] = j;
    \n-
    432 map.alberta2dune_[ codim ][ j ] = i;
    \n-
    433 }
    \n-
    434 }
    \n-
    435 };
    \n-
    436
    \n-
    437
    \n-
    438
    \n-
    439 // MapVertices
    \n-
    440 // -----------
    \n-
    441
    \n-
    442 template< int dim, int codim >
    \n-\n-
    444
    \n-
    445 template< int dim >
    \n-
    \n-
    446 struct MapVertices< dim, 0 >
    \n-
    447 {
    \n-
    \n-
    448 static int apply ( int subEntity, int vertex )
    \n+
    413 template< int dim >
    \n+
    414 inline ALBERTA NODE_PROJECTION *
    \n+
    415 MeshPointer< dim >::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroEl, int n )
    \n+
    416 {
    \n+
    417 const MacroElement &macroElement = static_cast< const MacroElement & >( *macroEl );
    \n+
    418 if( (n > 0) && macroElement.isBoundary( n-1 ) )
    \n+
    419 return new BasicNodeProjection( Library< dimWorld >::boundaryCount++ );
    \n+
    420 else
    \n+
    421 return 0;
    \n+
    422 }
    \n+
    423
    \n+
    424
    \n+
    425 template< int dim >
    \n+
    426 template< class ProjectionFactory >
    \n+
    427 inline ALBERTA NODE_PROJECTION *
    \n+
    428 MeshPointer< dim >::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroEl, int n )
    \n+
    429 {
    \n+
    430 typedef typename ProjectionFactory::Projection Projection;
    \n+
    431
    \n+
    432 const MacroElement &macroElement = static_cast< const MacroElement & >( *macroEl );
    \n+
    433
    \n+
    434 MeshPointer< dim > meshPointer( mesh );
    \n+
    435 ElementInfo elementInfo( meshPointer, macroElement, FillFlags::standard );
    \n+
    436 const ProjectionFactory &projectionFactory = *static_cast< const ProjectionFactory * >( Library< dimWorld >::projectionFactory );
    \n+
    437 if( (n > 0) && macroElement.isBoundary( n-1 ) )
    \n+
    438 {
    \n+
    439 const unsigned int boundaryIndex = Library< dimWorld >::boundaryCount++;
    \n+
    440 if( projectionFactory.hasProjection( elementInfo, n-1 ) )
    \n+
    441 {
    \n+
    442 Projection projection = projectionFactory.projection( elementInfo, n-1 );
    \n+
    443 return new NodeProjection< dim, Projection >( boundaryIndex, projection );
    \n+
    444 }
    \n+
    445 else
    \n+
    446 return new BasicNodeProjection( boundaryIndex );
    \n+
    447 }
    \n+
    448 else if( (dim < dimWorld) && (n == 0) )
    \n
    449 {
    \n-
    450 assert( subEntity == 0 );
    \n-
    451 assert( (vertex >= 0) && (vertex <= NumSubEntities< dim, dim >::value) );
    \n-
    452 return vertex;
    \n-
    453 }
    \n-
    \n-
    454 };
    \n-
    \n-
    455
    \n-
    456 template<>
    \n-
    \n-
    457 struct MapVertices< 2, 1 >
    \n-
    458 {
    \n-
    \n-
    459 static int apply ( int subEntity, int vertex )
    \n-
    460 {
    \n-
    461 assert( (subEntity >= 0) && (subEntity < 3) );
    \n-
    462 assert( (vertex >= 0) && (vertex < 2) );
    \n-
    463 //static const int map[ 3 ][ 2 ] = { {1,2}, {2,0}, {0,1} };
    \n-
    464 static const int map[ 3 ][ 2 ] = { {1,2}, {0,2}, {0,1} };
    \n-
    465 return map[ subEntity ][ vertex ];
    \n-
    466 }
    \n+
    450 const unsigned int boundaryIndex = std::numeric_limits< unsigned int >::max();
    \n+
    451 if( projectionFactory.hasProjection( elementInfo ) )
    \n+
    452 {
    \n+
    453 Projection projection = projectionFactory.projection( elementInfo );
    \n+
    454 return new NodeProjection< dim, Projection >( boundaryIndex, projection );
    \n+
    455 }
    \n+
    456 else
    \n+
    457 return 0;
    \n+
    458 }
    \n+
    459 else
    \n+
    460 return 0;
    \n+
    461 }
    \n+
    462
    \n+
    463 } // namespace Alberta
    \n+
    464
    \n+
    465} // namespace Dune
    \n+
    466
    \n+
    467#endif // #if HAVE_ALBERTA
    \n+
    468
    \n+
    469#endif // #ifndef DUNE_ALBERTA_MESHPOINTER_HH
    \n
    \n-
    467 };
    \n
    \n-
    468
    \n-
    469 template<>
    \n-
    \n-
    470 struct MapVertices< 3, 1 >
    \n-
    471 {
    \n-
    \n-
    472 static int apply ( int subEntity, int vertex )
    \n-
    473 {
    \n-
    474 assert( (subEntity >= 0) && (subEntity < 4) );
    \n-
    475 assert( (vertex >= 0) && (vertex < 3) );
    \n-
    476 //static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,3,2}, {0,1,3}, {0,2,1} };
    \n-
    477 static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,2,3}, {0,1,3}, {0,1,2} };
    \n-
    478 return map[ subEntity ][ vertex ];
    \n-
    479 }
    \n-
    \n-
    480 };
    \n-
    \n-
    481
    \n-
    482 template<>
    \n-
    \n-
    483 struct MapVertices< 3, 2 >
    \n-
    484 {
    \n-
    \n-
    485 static int apply ( int subEntity, int vertex )
    \n-
    486 {
    \n-
    487 assert( (subEntity >= 0) && (subEntity < 6) );
    \n-
    488 assert( (vertex >= 0) && (vertex < 2) );
    \n-
    489 static const int map[ 6 ][ 2 ] = { {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3} };
    \n-
    490 return map[ subEntity ][ vertex ];
    \n-
    491 }
    \n-
    \n-
    492 };
    \n-
    \n-
    493
    \n-
    494 template< int dim >
    \n-
    \n-
    495 struct MapVertices< dim, dim >
    \n-
    496 {
    \n-
    \n-
    497 static int apply ( int subEntity, int vertex )
    \n-
    498 {
    \n-
    499 assert( (subEntity >= 0) && (subEntity < NumSubEntities< dim, 1 >::value) );
    \n-
    500 assert( vertex == 0 );
    \n-
    501 return subEntity;
    \n-
    502 }
    \n-
    \n-
    503 };
    \n-
    \n-
    504
    \n-
    505
    \n-
    506
    \n-
    507 // Twist
    \n-
    508 // -----
    \n-
    509
    \n-
    510 // ******************************************************************
    \n-
    511 // Meaning of the twist (same as in ALU)
    \n-
    512 // -------------------------------------
    \n-
    513 //
    \n-
    514 // Consider a fixed ordering of the vertices v_1, ... v_n of a face
    \n-
    515 // (here, we assume their indices to be increasing). Denote by k the
    \n-
    516 // local number of a vertex v within the element and by t the twist.
    \n-
    517 // Then, v = v_j, where j is computed by the following formula:
    \n-
    518 //
    \n-
    519 // / (2n + 1 - k + t) % n, if t < 0
    \n-
    520 // j = <
    \n-
    521 // \\ (k + t) % n, if t >= 0
    \n-
    522 //
    \n-
    523 // Note: We use the order of the 0-th vertex dof to assign the twist.
    \n-
    524 // This is ok for two reasons:
    \n-
    525 // - ALBERTA preserves the relative order of the dofs during
    \n-
    526 // dof compression.
    \n-
    527 // - ALBERTA enforces the first vertex dof admin to be periodic.
    \n-
    528 // ******************************************************************
    \n-
    529
    \n-
    530 template< int dim, int subdim >
    \n-
    \n-
    531 struct Twist
    \n-
    532 {
    \n-
    533 static const int numSubEntities = NumSubEntities< dim, dim-subdim >::value;
    \n-
    534
    \n-
    535 static const int minTwist = 0;
    \n-
    536 static const int maxTwist = 0;
    \n-
    537
    \n-
    \n-
    538 static int twist ( [[maybe_unused]] const Element *element,
    \n-
    539 [[maybe_unused]] int subEntity )
    \n-
    540 {
    \n-
    541 assert( (subEntity >= 0) && (subEntity < numSubEntities) );
    \n-
    542 return 0;
    \n-
    543 }
    \n-
    \n-
    544 };
    \n-
    \n-
    545
    \n-
    546 template< int dim >
    \n-
    \n-
    547 struct Twist< dim, 1 >
    \n-
    548 {
    \n-
    549 static const int numSubEntities = NumSubEntities< dim, dim-1 >::value;
    \n-
    550
    \n-
    551 static const int minTwist = 0;
    \n-
    552 static const int maxTwist = 1;
    \n-
    553
    \n-
    \n-
    554 static int twist ( const Element *element, int subEntity )
    \n-
    555 {
    \n-
    556 assert( (subEntity >= 0) && (subEntity < numSubEntities) );
    \n-
    557 const int numVertices = NumSubEntities< 1, 1 >::value;
    \n-
    558 int dof[ numVertices ];
    \n-
    559 for( int i = 0; i < numVertices; ++i )
    \n-
    560 {
    \n-
    561 const int j = MapVertices< dim, dim-1 >::apply( subEntity, i );
    \n-
    562 dof[ i ] = element->dof[ j ][ 0 ];
    \n-
    563 }
    \n-
    564 return (dof[ 0 ] < dof[ 1 ] ? 0 : 1);
    \n-
    565 }
    \n-
    \n-
    566 };
    \n-
    \n-
    567
    \n-
    568
    \n-
    569 template<>
    \n-
    \n-
    570 struct Twist< 1, 1 >
    \n-
    571 {
    \n-
    572 static const int minTwist = 0;
    \n-
    573 static const int maxTwist = 0;
    \n-
    574
    \n-
    \n-
    575 static int twist ( [[maybe_unused]] const Element *element,
    \n-
    576 [[maybe_unused]] int subEntity )
    \n-
    577 {
    \n-
    578 assert( subEntity == 0 );
    \n-
    579 return 0;
    \n-
    580 }
    \n-
    \n-
    581 };
    \n-
    \n-
    582
    \n-
    583
    \n-
    584 template< int dim >
    \n-
    \n-
    585 struct Twist< dim, 2 >
    \n-
    586 {
    \n-
    587 static const int numSubEntities = NumSubEntities< dim, dim-2 >::value;
    \n-
    588
    \n-
    589 static const int minTwist = -3;
    \n-
    590 static const int maxTwist = 2;
    \n-
    591
    \n-
    \n-
    592 static int twist ( const Element *element, int subEntity )
    \n-
    593 {
    \n-
    594 assert( (subEntity >= 0) && (subEntity < numSubEntities) );
    \n-
    595 const int numVertices = NumSubEntities< 2, 2 >::value;
    \n-
    596 int dof[ numVertices ];
    \n-
    597 for( int i = 0; i < numVertices; ++i )
    \n-
    598 {
    \n-
    599 const int j = MapVertices< dim, dim-2 >::apply( subEntity, i );
    \n-
    600 dof[ i ] = element->dof[ j ][ 0 ];
    \n-
    601 }
    \n-
    602
    \n-
    603 const int twist[ 8 ] = { -2, 1, 666, -1, 2, 666, -3, 0 };
    \n-
    604 const int k = int( dof[ 0 ] < dof[ 1 ] )
    \n-
    605 | (int( dof[ 0 ] < dof[ 2 ] ) << 1)
    \n-
    606 | (int( dof[ 1 ] < dof[ 2 ] ) << 2);
    \n-
    607 assert( twist[ k ] != 666 );
    \n-
    608 return twist[ k ];
    \n-
    609 }
    \n-
    \n-
    610 };
    \n-
    \n-
    611
    \n-
    612
    \n-
    613 template<>
    \n-
    \n-
    614 struct Twist< 2, 2 >
    \n-
    615 {
    \n-
    616 static const int minTwist = 0;
    \n-
    617 static const int maxTwist = 0;
    \n-
    618
    \n-
    \n-
    619 static int twist ( [[maybe_unused]] const Element *element,
    \n-
    620 [[maybe_unused]] int subEntity )
    \n-
    621 {
    \n-
    622 assert( subEntity == 0 );
    \n-
    623 return 0;
    \n-
    624 }
    \n-
    \n-
    625 };
    \n-
    \n-
    626
    \n-
    627
    \n-
    628
    \n-
    629 template< int dim >
    \n-
    \n-
    630 inline int applyTwist ( int twist, int i )
    \n-
    631 {
    \n-
    632 const int numCorners = NumSubEntities< dim, dim >::value;
    \n-
    633 return (twist < 0 ? (2*numCorners + 1 - i + twist) : i + twist) % numCorners;
    \n-
    634 }
    \n-
    \n-
    635
    \n-
    636 template< int dim >
    \n-
    \n-
    637 inline int applyInverseTwist ( int twist, int i )
    \n-
    638 {
    \n-
    639 const int numCorners = NumSubEntities< dim, dim >::value;
    \n-
    640 return (twist < 0 ? (2*numCorners + 1 - i + twist) : numCorners + i - twist) % numCorners;
    \n-
    641 }
    \n-
    \n-
    642
    \n-
    643 }
    \n-
    644
    \n-
    645}
    \n-
    646
    \n-
    647#endif // #if HAVE_ALBERTA
    \n-
    648
    \n-
    649#endif // #ifndef DUNE_ALBERTA_MISC_HH
    \n-\n-
    #define DIM_OF_WORLD
    Definition albertaheader.hh:23
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n+
    provides a wrapper for ALBERTA's macro_data structure
    \n+\n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    int applyInverseTwist(int twist, int i)
    Definition misc.hh:637
    \n
    ALBERTA MESH Mesh
    Definition misc.hh:53
    \n-
    int applyTwist(int twist, int i)
    Definition misc.hh:630
    \n-
    void memFree(Data *ptr, size_t size)
    Definition misc.hh:91
    \n-
    ALBERTA REAL_DD GlobalMatrix
    Definition misc.hh:51
    \n-
    ALBERTA AFF_TRAFO AffineTransformation
    Definition misc.hh:52
    \n-
    ALBERTA REAL_B LocalVector
    Definition misc.hh:49
    \n-
    ALBERTA EL Element
    Definition misc.hh:54
    \n-
    ALBERTA BNDRY_TYPE BoundaryId
    Definition misc.hh:61
    \n-
    static const int InteriorBoundary
    Definition misc.hh:59
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n
    static const int meshRefined
    Definition misc.hh:56
    \n-
    Data * memAlloc(size_t size)
    Definition misc.hh:73
    \n-
    Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)
    Definition misc.hh:85
    \n-
    static const int DirichletBoundary
    Definition misc.hh:60
    \n-
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n-
    Data * memCAlloc(size_t size)
    Definition misc.hh:79
    \n
    static const int dimWorld
    Definition misc.hh:46
    \n-
    U_CHAR ElementType
    Definition misc.hh:63
    \n
    static const int meshCoarsened
    Definition misc.hh:57
    \n-
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition misc.hh:32
    \n-
    Definition misc.hh:36
    \n-
    Definition misc.hh:102
    \n-
    static const Matrix & identityMatrix()
    Definition misc.hh:131
    \n-
    static const Vector & nullVector()
    Definition misc.hh:136
    \n-
    GlobalMatrix Matrix
    Definition misc.hh:106
    \n-
    GlobalVector Vector
    Definition misc.hh:107
    \n-
    Definition misc.hh:148
    \n-
    Definition misc.hh:192
    \n+
    Definition meshpointer.hh:40
    \n+
    int numMacroElements() const
    Definition meshpointer.hh:257
    \n+
    unsigned int create(const MacroData< dim > &macroData, const ProjectionFactoryInterface< Proj, Impl > &projectionFactory)
    Definition meshpointer.hh:312
    \n+
    void release()
    Definition meshpointer.hh:361
    \n+
    unsigned int read(const std::string &filename, Real &time)
    Definition meshpointer.hh:342
    \n+
    MacroIterator end() const
    Definition meshpointer.hh:76
    \n+
    bool coarsen(typename FillFlags::Flags fillFlags=FillFlags::nothing)
    Definition meshpointer.hh:398
    \n+
    int size(int codim) const
    \n+
    unsigned int create(const std::string &filename, bool binary=false)
    Definition meshpointer.hh:331
    \n+
    void leafTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:385
    \n+
    unsigned int create(const MacroData< dim > &macroData)
    Definition meshpointer.hh:299
    \n+
    MacroIterator begin() const
    Definition meshpointer.hh:71
    \n+
    MeshPointer(Mesh *mesh)
    Definition meshpointer.hh:57
    \n+
    bool write(const std::string &filename, Real time) const
    Definition meshpointer.hh:353
    \n+
    bool refine(typename FillFlags::Flags fillFlags=FillFlags::nothing)
    Definition meshpointer.hh:407
    \n+
    MeshPointer()
    Definition meshpointer.hh:53
    \n+
    void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:370
    \n+
    Definition elementinfo.hh:43
    \n+
    void hierarchicTraverse(Functor &functor) const
    Definition elementinfo.hh:695
    \n+
    void leafTraverse(Functor &functor) const
    Definition elementinfo.hh:708
    \n+
    Definition macrodata.hh:30
    \n+
    void release()
    release the macro data structure
    Definition macrodata.hh:127
    \n+
    void read(const std::string &filename, bool binary=false)
    Definition macrodata.hh:413
    \n+
    Definition macroelement.hh:24
    \n+
    bool isBoundary(const int face) const
    Definition macroelement.hh:42
    \n+
    Definition meshpointer.hh:167
    \n+
    const MeshPointer & mesh() const
    Definition meshpointer.hh:211
    \n+
    const MacroElement & macroElement() const
    Definition meshpointer.hh:205
    \n+
    Alberta::ElementInfo< dim > ElementInfo
    Definition meshpointer.hh:174
    \n+
    Alberta::MeshPointer< dim > MeshPointer
    Definition meshpointer.hh:173
    \n+
    ElementInfo elementInfo(typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:238
    \n+
    bool done() const
    Definition meshpointer.hh:189
    \n+
    void increment()
    Definition meshpointer.hh:199
    \n+
    bool equals(const MacroIterator &other) const
    Definition meshpointer.hh:194
    \n+
    MacroIterator()
    Definition meshpointer.hh:176
    \n
    Definition misc.hh:231
    \n
    static const Flags nothing
    Definition misc.hh:234
    \n-
    static const Flags nonPeriodic
    Definition misc.hh:248
    \n-
    static const Flags boundaryId
    Definition misc.hh:246
    \n-
    static const Flags elementType
    Definition misc.hh:244
    \n
    ALBERTA FLAGS Flags
    Definition misc.hh:232
    \n-
    static const Flags projection
    Definition misc.hh:242
    \n-
    static const Flags coords
    Definition misc.hh:236
    \n-
    static const Flags orientation
    Definition misc.hh:240
    \n
    static const Flags standard
    Definition misc.hh:258
    \n-
    static const Flags neighbor
    Definition misc.hh:238
    \n-
    static const Flags all
    Definition misc.hh:250
    \n-
    static const Flags standardWithCoords
    Definition misc.hh:253
    \n-
    Definition misc.hh:269
    \n-
    static const int value
    Definition misc.hh:270
    \n-\n-
    static int apply(const int i)
    Definition misc.hh:287
    \n-
    static int apply(const int i)
    Definition misc.hh:299
    \n-\n-
    static int apply(const int i)
    Definition misc.hh:315
    \n-
    static int apply(const int i)
    Definition misc.hh:325
    \n-
    static int apply(const int i)
    Definition misc.hh:335
    \n-
    static int apply(const int i)
    Definition misc.hh:347
    \n-
    Definition misc.hh:362
    \n-
    int alberta2dune(int codim, int i) const
    Definition misc.hh:397
    \n-
    int numSubEntities(int codim) const
    Definition misc.hh:404
    \n-
    int dune2alberta(int codim, int i) const
    Definition misc.hh:390
    \n-
    ~NumberingMap()
    Definition misc.hh:381
    \n-
    NumberingMap()
    Definition misc.hh:376
    \n-
    Definition misc.hh:443
    \n-
    static int apply(int subEntity, int vertex)
    Definition misc.hh:448
    \n-
    static int apply(int subEntity, int vertex)
    Definition misc.hh:459
    \n-
    static int apply(int subEntity, int vertex)
    Definition misc.hh:472
    \n-
    static int apply(int subEntity, int vertex)
    Definition misc.hh:485
    \n-
    static int apply(int subEntity, int vertex)
    Definition misc.hh:497
    \n-
    Definition misc.hh:532
    \n-
    static const int maxTwist
    Definition misc.hh:536
    \n-
    static const int minTwist
    Definition misc.hh:535
    \n-
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:538
    \n-
    static const int numSubEntities
    Definition misc.hh:533
    \n-
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:554
    \n-
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:575
    \n-
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:592
    \n-
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:619
    \n+
    Definition albertagrid/projection.hh:135
    \n+
    Base::Projection Projection
    Definition albertagrid/projection.hh:140
    \n+
    Definition albertagrid/projection.hh:80
    \n+
    Definition albertagrid/projection.hh:208
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,888 +1,643 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-misc.hh\n+meshpointer.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_MISC_HH\n-6#define DUNE_ALBERTA_MISC_HH\n+5#ifndef DUNE_ALBERTA_MESHPOINTER_HH\n+6#define DUNE_ALBERTA_MESHPOINTER_HH\n 7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13#include \n-14\n-15#include \n-16\n-17#if HAVE_ALBERTA\n-18\n-19// should the coordinates be cached in a vector (required for ALBERTA 2.0)?\n-20#ifndef DUNE_ALBERTA_CACHE_COORDINATES\n-21#define DUNE_ALBERTA_CACHE_COORDINATES 1\n-22#endif\n-23\n-24namespace Dune\n-25{\n-26\n-27 // Exceptions\n-28 // ----------\n-29\n-30 class AlbertaError\n-31 : public Exception\n-32 {};\n-33\n-34 class AlbertaIOError\n-35 : public IOError\n-36 {};\n+13#include \n+14#include \n+15\n+16#include \n+17#include \n+18#include \n+19#include \n+20\n+21#if HAVE_ALBERTA\n+22\n+23namespace Dune\n+24{\n+25\n+26 namespace Alberta\n+27 {\n+28\n+29 // External Forward Declarations\n+30 // -----------------------------\n+31\n+32 template< int dim >\n+33 class HierarchyDofNumbering;\n+34\n+35 // MeshPointer\n+36 // -----------\n 37\n-38\n-39\n-40 namespace Alberta\n-41 {\n-42\n-43 // Import Types\n-44 // ------------\n-45\n-46 static const int dimWorld = DIM_OF_WORLD;\n-47\n-48 typedef ALBERTA REAL Real;\n-49 typedef ALBERTA REAL_B LocalVector; // in barycentric coordinates\n-50 typedef ALBERTA REAL_D GlobalVector;\n-51 typedef ALBERTA REAL_DD GlobalMatrix;\n-52 typedef ALBERTA AFF_TRAFO AffineTransformation;\n-53 typedef ALBERTA MESH Mesh;\n-54 typedef ALBERTA EL Element;\n-55\n-56 static const int meshRefined = MESH_REFINED;\n-57 static const int meshCoarsened = MESH_COARSENED;\n-58\n-59 static const int InteriorBoundary = INTERIOR;\n-60 static const int DirichletBoundary = DIRICHLET;\n-61 typedef ALBERTA BNDRY_TYPE BoundaryId;\n-62\n-63 typedef U_CHAR ElementType;\n-64\n-65 typedef ALBERTA FE_SPACE DofSpace;\n-66\n-67\n-68\n-69 // Memory Manipulation Functions\n-70 // -----------------------------\n-71\n-72 template< class Data >\n-73 inline Data *memAlloc ( size_t size )\n-74 {\n-75 return MEM_ALLOC( size, Data );\n-76 }\n-77\n-78 template< class Data >\n-79 inline Data *memCAlloc ( size_t size )\n-80 {\n-81 return MEM_CALLOC( size, Data );\n-82 }\n+38 template< int dim >\n+39 class MeshPointer\n+40 {\n+41 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n+42 typedef typename ElementInfo::MacroElement MacroElement;\n+43 typedef typename ElementInfo::FillFlags FillFlags;\n+44\n+45 class BoundaryProvider;\n+46\n+47 template< int dimWorld >\n+48 struct Library;\n+49\n+50 public:\n+51 class MacroIterator;\n+52\n+53 MeshPointer ()\n+54 : mesh_( 0 )\n+55 {}\n+56\n+57 explicit MeshPointer ( Mesh *mesh )\n+58 : mesh_( mesh )\n+59 {}\n+60\n+61 operator Mesh * () const\n+62 {\n+63 return mesh_;\n+64 }\n+65\n+66 explicit operator bool () const\n+67 {\n+68 return (bool)mesh_;\n+69 }\n+70\n+71 MacroIterator begin () const\n+72 {\n+73 return MacroIterator( *this, false );\n+74 }\n+75\n+76 MacroIterator end () const\n+77 {\n+78 return MacroIterator( *this, true );\n+79 }\n+80\n+81 int numMacroElements () const;\n+82 int size ( int codim ) const;\n 83\n-84 template< class Data >\n-85 inline Data *memReAlloc ( Data *ptr, size_t oldSize, size_t newSize )\n-86 {\n-87 return MEM_REALLOC( ptr, oldSize, newSize, Data );\n-88 }\n-89\n-90 template< class Data >\n-91 inline void memFree ( Data *ptr, size_t size )\n-92 {\n-93 return MEM_FREE( ptr, size, Data );\n-94 }\n-95\n+84 // create a mesh from a macrodata structure\n+85 // params: macroData - macro data structure\n+86 // returns: number of boundary segments\n+87 unsigned int create ( const MacroData<_dim_> ¯oData );\n+88\n+89 // create a mesh from a macrodata structure, adding projections\n+90 // params: macroData - macro data structure\n+91 // projectionFactory - factory for the projections\n+92 // returns: number of boundary segments\n+93 template< class Proj, class Impl >\n+94 unsigned int create ( const MacroData<_dim_> ¯oData,\n+95 const ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory );\n 96\n-97\n-98 // GlobalSpace\n-99 // -----------\n-100\n-101 class GlobalSpace\n-102 {\n-103 typedef GlobalSpace This;\n-104\n-105 public:\n-106 typedef GlobalMatrix Matrix;\n-107 typedef GlobalVector Vector;\n-108\n-109 private:\n-110 Matrix identityMatrix_;\n-111 Vector nullVector_;\n-112\n-113 GlobalSpace ()\n-114 {\n-115 for( int i = 0; i < dimWorld; ++i )\n-116 {\n-117 for( int j = 0; j < dimWorld; ++j )\n-118 identityMatrix_[ i ][ j ] = Real( 0 );\n-119 identityMatrix_[ i ][ i ] = Real( 1 );\n-120 nullVector_[ i ] = Real( 0 );\n-121 }\n-122 }\n-123\n-124 static This &instance ()\n-125 {\n-126 static This theInstance;\n-127 return theInstance;\n-128 }\n+97 // create a mesh from a file\n+98 // params: filename - file name of an Alberta macro triangulation\n+99 // binary - read binary?\n+100 // returns: number of boundary segments\n+101 unsigned int create ( const std::string &filename, bool binary = false );\n+102\n+103 // read back a mesh from a file\n+104 // params: filename - file name of an Alberta save file\n+105 // time - variable to receive the time stored in the file\n+106 // returns: number of boundary segments\n+107 //\n+108 // notes: - projections are not preserved\n+109 // - we assume that projections are added in the same order they\n+110 // inserted in when the grid was created (otherwise the boundary\n+111 // indices change)\n+112 unsigned int read ( const std::string &filename, Real &time );\n+113\n+114 bool write ( const std::string &filename, Real time ) const;\n+115\n+116 void release ();\n+117\n+118 template< class Functor >\n+119 void hierarchicTraverse ( Functor &functor,\n+120 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;\n+121\n+122 template< class Functor >\n+123 void leafTraverse ( Functor &functor,\n+124 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;\n+125\n+126 bool coarsen ( typename FillFlags::Flags fillFlags = FillFlags::nothing );\n+127\n+128 bool refine ( typename FillFlags::Flags fillFlags = FillFlags::nothing );\n 129\n-130 public:\n-131 static const Matrix &identityMatrix ()\n-132 {\n-133 return instance().identityMatrix_;\n-134 }\n-135\n-136 static const Vector &nullVector ()\n-137 {\n-138 return instance().nullVector_;\n-139 }\n-140 };\n+130 private:\n+131 static ALBERTA NODE_PROJECTION *\n+132 initNodeProjection ( [[maybe_unused]] Mesh *mesh, ALBERTA MACRO_EL\n+*macroElement, int n );\n+133 template< class ProjectionProvider >\n+134 static ALBERTA NODE_PROJECTION *\n+135 initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroElement, int n );\n+136\n+137 Mesh *mesh_;\n+138 };\n+139\n+140\n 141\n-142\n-143\n-144 // NumSubEntities\n-145 // --------------\n-146\n-147 template< int dim, int codim >\n-148 struct NumSubEntities;\n-149\n-150 template< int dim >\n-151 struct NumSubEntities< dim, 0 >\n-152 {\n-153 static const int value = 1;\n-154 };\n-155\n-156 template< int dim >\n-157 struct NumSubEntities< dim, dim >\n-158 {\n-159 static const int value = dim+1;\n-160 };\n+142 // MeshPointer::Library\n+143 // --------------------\n+144\n+145 template< int dim >\n+146 template< int dimWorld >\n+147 struct MeshPointer< dim >::Library\n+148 {\n+149 typedef Alberta::MeshPointer<_dim_> MeshPointer;\n+150\n+151 static inline unsigned int boundaryCount = 0;\n+152 static inline const void *projectionFactory = nullptr;\n+153\n+154 static void\n+155 create ( MeshPointer &ptr, const MacroData<_dim_> ¯oData,\n+156 ALBERTA NODE_PROJECTION *(*initNodeProjection)( Mesh *, ALBERTA MACRO_EL *,\n+int ) );\n+157 static void release ( MeshPointer &ptr );\n+158 };\n+159\n+160\n 161\n-162 template<>\n-163 struct NumSubEntities< 0, 0 >\n-164 {\n-165 static const int value = 1;\n-166 };\n-167\n-168 template<>\n-169 struct NumSubEntities< 2, 1 >\n-170 {\n-171 static const int value = 3;\n-172 };\n-173\n-174 template<>\n-175 struct NumSubEntities< 3, 1 >\n-176 {\n-177 static const int value = 4;\n-178 };\n-179\n-180 template<>\n-181 struct NumSubEntities< 3, 2 >\n-182 {\n-183 static const int value = 6;\n-184 };\n-185\n-186\n+162 // MeshPointer::MacroIterator\n+163 // --------------------------\n+164\n+165 template< int dim >\n+166 class MeshPointer< dim >::MacroIterator\n+167 {\n+168 typedef MacroIterator This;\n+169\n+170 friend class MeshPointer< dim >;\n+171\n+172 public:\n+173 typedef Alberta::MeshPointer<_dim_> MeshPointer;\n+174 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n+175\n+176 MacroIterator ()\n+177 : mesh_(),\n+178 index_( -1 )\n+179 {}\n+180\n+181 private:\n+182\n+183 explicit MacroIterator ( const MeshPointer &mesh, bool end = false )\n+184 : mesh_( mesh ),\n+185 index_( end ? mesh.numMacroElements() : 0 )\n+186 {}\n 187\n-188 // CodimType\n-189 // ---------\n-190\n-191 template< int dim, int codim >\n-192 struct CodimType;\n+188 public:\n+189 bool done () const\n+190 {\n+191 return (index_ >= mesh().numMacroElements());\n+192 }\n 193\n-194 template< int dim >\n-195 struct CodimType< dim, 0 >\n-196 {\n-197 static const int value = CENTER;\n-198 };\n-199\n-200 template< int dim >\n-201 struct CodimType< dim, dim >\n-202 {\n-203 static const int value = VERTEX;\n-204 };\n-205\n-206 template<>\n-207 struct CodimType< 2, 1 >\n-208 {\n-209 static const int value = EDGE;\n-210 };\n-211\n-212 template<>\n-213 struct CodimType< 3, 1 >\n-214 {\n-215 static const int value = FACE;\n-216 };\n-217\n-218 template<>\n-219 struct CodimType< 3, 2 >\n-220 {\n-221 static const int value = EDGE;\n-222 };\n-223\n-224\n-225\n-226 // FillFlags\n-227 // ---------\n-228\n-229 template< int dim >\n-230 struct FillFlags\n-231 {\n-232 typedef ALBERTA FLAGS Flags;\n-233\n-234 static const Flags nothing = FILL_NOTHING;\n-235\n-236 static const Flags coords = FILL_COORDS;\n-237\n-238 static const Flags neighbor = FILL_NEIGH;\n-239\n-240 static const Flags orientation = (dim == 3 ? FILL_ORIENTATION : FILL_\n-NOTHING);\n-241\n-242 static const Flags projection = FILL_PROJECTION;\n-243\n-244 static const Flags elementType = FILL_NOTHING;\n+194 bool equals ( const MacroIterator &other ) const\n+195 {\n+196 return (index_ == other.index_);\n+197 }\n+198\n+199 void increment ()\n+200 {\n+201 assert( !done() );\n+202 ++index_;\n+203 }\n+204\n+205 const MacroElement ¯oElement () const\n+206 {\n+207 assert( !done() );\n+208 return static_cast< const MacroElement & >( mesh().mesh_->macro_els[ index_\n+] );\n+209 }\n+210\n+211 const MeshPointer &mesh () const\n+212 {\n+213 return mesh_;\n+214 }\n+215\n+216 This &operator++ ()\n+217 {\n+218 increment();\n+219 return *this;\n+220 }\n+221\n+222 ElementInfo operator* () const\n+223 {\n+224 return elementInfo();\n+225 }\n+226\n+227 bool operator== ( const MacroIterator &other ) const\n+228 {\n+229 return equals( other );\n+230 }\n+231\n+232 bool operator!= ( const MacroIterator &other ) const\n+233 {\n+234 return !equals( other );\n+235 }\n+236\n+237 ElementInfo\n+238 elementInfo ( typename FillFlags::Flags fillFlags = FillFlags::standard )\n+const\n+239 {\n+240 if( done() )\n+241 return ElementInfo();\n+242 else\n+243 return ElementInfo( mesh(), macroElement(), fillFlags );\n+244 }\n 245\n-246 static const Flags boundaryId = FILL_MACRO_WALLS;\n-247\n-248 static const Flags nonPeriodic = FILL_NON_PERIODIC;\n-249\n-250 static const Flags all = coords | neighbor | boundaryId | nonPeriodic\n-251 | orientation | projection | elementType;\n+246 private:\n+247 MeshPointer mesh_;\n+248 int index_;\n+249 };\n+250\n+251\n 252\n-253 static const Flags standardWithCoords = all & ~nonPeriodic & ~projection;\n-254\n-255#if DUNE_ALBERTA_CACHE_COORDINATES\n-256 static const Flags standard = standardWithCoords & ~coords;\n-257#else\n-258 static const Flags standard = standardWithCoords;\n-259#endif\n-260 };\n+253 // Implementation of MeshPointer\n+254 // -----------------------------\n+255\n+256 template< int dim >\n+257 inline int MeshPointer<_dim_>::numMacroElements () const\n+258 {\n+259 return (mesh_ ? mesh_->n_macro_el : 0);\n+260 }\n 261\n 262\n-263\n-264 // RefinementEdge\n-265 // --------------\n-266\n-267 template< int dim >\n-268 struct RefinementEdge\n-269 {\n-270 static const int value = 0;\n-271 };\n-272\n-273 template<>\n-274 struct RefinementEdge< 2 >\n-275 {\n-276 static const int value = 2;\n-277 };\n-278\n-279\n-280\n-281 // Dune2AlbertaNumbering\n-282 // ---------------------\n-283\n-284 template< int dim, int codim >\n-285 struct Dune2AlbertaNumbering\n-286 {\n-287 static int apply ( const int i )\n-288 {\n-289 assert( (i >= 0) && (i < NumSubEntities<_dim,_codim_>::value) );\n-290 return i;\n-291 }\n-292 };\n-293\n-294 template<>\n-295 struct Dune2AlbertaNumbering< 3, 2 >\n-296 {\n-297 static const int numSubEntities = NumSubEntities<_3,_2_>::value;\n-298\n-299 static int apply ( const int i )\n+263 template<>\n+264 inline int MeshPointer<_1_>::size( int codim ) const\n+265 {\n+266 assert( (codim >= 0) && (codim <= 1) );\n+267 return (codim == 0 ? mesh_->n_elements : mesh_->n_vertices);\n+268 }\n+269\n+270 template<>\n+271 inline int MeshPointer<_2_>::size( int codim ) const\n+272 {\n+273 assert( (codim >= 0) && (codim <= 2) );\n+274 if( codim == 0 )\n+275 return mesh_->n_elements;\n+276 else if( codim == 2 )\n+277 return mesh_->n_vertices;\n+278 else\n+279 return mesh_->n_edges;\n+280 }\n+281\n+282 template<>\n+283 inline int MeshPointer<_3_>::size( int codim ) const\n+284 {\n+285 assert( (codim >= 0) && (codim <= 3) );\n+286 if( codim == 0 )\n+287 return mesh_->n_elements;\n+288 else if( codim == 3 )\n+289 return mesh_->n_vertices;\n+290 else if( codim == 1 )\n+291 return mesh_->n_faces;\n+292 else\n+293 return mesh_->n_edges;\n+294 }\n+295\n+296\n+297 template< int dim >\n+298 inline unsigned int MeshPointer<_dim_>\n+299_::create ( const MacroData<_dim_> ¯oData )\n 300 {\n-301 assert( (i >= 0) && (i < numSubEntities) );\n-302 static int dune2alberta[ numSubEntities ] = { 0, 3, 1, 2, 4, 5 };\n-303 return dune2alberta[ i ];\n-304 }\n-305 };\n-306\n+301 release();\n+302\n+303 Library< dimWorld >::boundaryCount = 0;\n+304 Library< dimWorld >::create( *this, macroData, &initNodeProjection );\n+305 return Library< dimWorld >::boundaryCount;\n+306 }\n 307\n 308\n-309 // Generic2AlbertaNumbering\n-310 // ------------------------\n-311\n-312 template< int dim, int codim >\n-313 struct Generic2AlbertaNumbering\n+309 template< int dim >\n+310 template< class Proj, class Impl >\n+311 inline unsigned int MeshPointer<_dim_>\n+312_::create ( const MacroData<_dim_> ¯oData,\n+313 const ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory )\n 314 {\n-315 static int apply ( const int i )\n-316 {\n-317 assert( (i >= 0) && (i < NumSubEntities<_dim,_codim_>::value) );\n-318 return i;\n-319 }\n-320 };\n-321\n-322 template< int dim >\n-323 struct Generic2AlbertaNumbering< dim, 1 >\n-324 {\n-325 static int apply ( const int i )\n-326 {\n-327 assert( (i >= 0) && (i < NumSubEntities<_dim,_1_>::value) );\n-328 return dim - i;\n-329 }\n-330 };\n-331\n-332 template<>\n-333 struct Generic2AlbertaNumbering< 1, 1 >\n-334 {\n-335 static int apply ( const int i )\n-336 {\n-337 assert( (i >= 0) && (i < NumSubEntities<_1,_1_>::value) );\n-338 return i;\n-339 }\n-340 };\n-341\n-342 template<>\n-343 struct Generic2AlbertaNumbering< 3, 2 >\n-344 {\n-345 static const int numSubEntities = NumSubEntities<_3,_2_>::value;\n-346\n-347 static int apply ( const int i )\n-348 {\n-349 assert( (i >= 0) && (i < numSubEntities) );\n-350 static int generic2alberta[ numSubEntities ] = { 0, 1, 3, 2, 4, 5 };\n-351 return generic2alberta[ i ];\n-352 }\n-353 };\n-354\n-355\n-356\n-357 // NumberingMap\n-358 // ------------\n+315 typedef ProjectionFactoryInterface<_Proj,_Impl_> ProjectionFactory;\n+316\n+317 release();\n+318\n+319 Library< dimWorld >::boundaryCount = 0;\n+320 Library< dimWorld >::projectionFactory = &projectionFactory;\n+321 Library< dimWorld >::create( *this, macroData, &initNodeProjection<\n+ProjectionFactory > );\n+322 Library< dimWorld >::projectionFactory = nullptr;\n+323 return Library< dimWorld >::boundaryCount;\n+324 }\n+325\n+326\n+327\n+328\n+329 template< int dim >\n+330 inline unsigned int MeshPointer<_dim_>\n+331_::create ( const std::string &filename, bool binary )\n+332 {\n+333 MacroData<_dim_> macroData;\n+334 macroData.read( filename, binary );\n+335 const unsigned int boundaryCount = create( macroData );\n+336 macroData.release();\n+337 return boundaryCount;\n+338 }\n+339\n+340\n+341 template< int dim >\n+342 inline unsigned int MeshPointer<_dim_>::read ( const std::string &filename,\n+Real &time )\n+343 {\n+344 release();\n+345\n+346 Library< dimWorld >::boundaryCount = 0;\n+347 mesh_ = ALBERTA read_mesh_xdr( filename.c_str(), &time, NULL, NULL );\n+348 return Library< dimWorld >::boundaryCount;\n+349 }\n+350\n+351\n+352 template< int dim >\n+353 inline bool MeshPointer<_dim_>::write ( const std::string &filename, Real\n+time ) const\n+354 {\n+355 int success = ALBERTA write_mesh_xdr( mesh_, filename.c_str(), time );\n+356 return (success == 0);\n+357 }\n+358\n 359\n-360 template< int dim, template< int, int > class Numbering =\n-Generic2AlbertaNumbering >\n-361 class NumberingMap\n+360 template< int dim >\n+361 inline void MeshPointer<_dim_>::release ()\n 362 {\n-363 typedef NumberingMap<_dim,_Numbering_> This;\n-364\n-365 template< int codim >\n-366 struct Initialize;\n-367\n-368 int *dune2alberta_[ dim+1 ];\n-369 int *alberta2dune_[ dim+1 ];\n-370 int numSubEntities_[ dim+1 ];\n-371\n-372 NumberingMap ( const This & );\n-373 This &operator= ( const This & );\n-374\n-375 public:\n-376 NumberingMap ()\n-377 {\n-378 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n-{ Initialize< i >::apply( *this ); } );\n+363 Library< dimWorld >::release( *this );\n+364 }\n+365\n+366\n+367 template< int dim >\n+368 template< class Functor >\n+369 inline void MeshPointer<_dim_>\n+370_::hierarchicTraverse ( Functor &functor,\n+371 typename FillFlags::Flags fillFlags ) const\n+372 {\n+373 const MacroIterator eit = end();\n+374 for( MacroIterator it = begin(); it != eit; ++it )\n+375 {\n+376 const ElementInfo info = it.elementInfo( fillFlags );\n+377 info.hierarchicTraverse( functor );\n+378 }\n 379 }\n 380\n-381 ~NumberingMap ()\n-382 {\n-383 for( int codim = 0; codim <= dim; ++codim )\n-384 {\n-385 delete[]( dune2alberta_[ codim ] );\n-386 delete[]( alberta2dune_[ codim ] );\n-387 }\n-388 }\n-389\n-390 int dune2alberta ( int codim, int i ) const\n-391 {\n-392 assert( (codim >= 0) && (codim <= dim) );\n-393 assert( (i >= 0) && (i < numSubEntities( codim )) );\n-394 return dune2alberta_[ codim ][ i ];\n-395 }\n+381\n+382 template< int dim >\n+383 template< class Functor >\n+384 inline void MeshPointer<_dim_>\n+385_::leafTraverse ( Functor &functor,\n+386 typename FillFlags::Flags fillFlags ) const\n+387 {\n+388 const MacroIterator eit = end();\n+389 for( MacroIterator it = begin(); it != eit; ++it )\n+390 {\n+391 const ElementInfo info = it.elementInfo( fillFlags );\n+392 info.leafTraverse( functor );\n+393 }\n+394 }\n+395\n 396\n-397 int alberta2dune ( int codim, int i ) const\n-398 {\n-399 assert( (codim >= 0) && (codim <= dim) );\n-400 assert( (i >= 0) && (i < numSubEntities( codim )) );\n-401 return alberta2dune_[ codim ][ i ];\n-402 }\n-403\n-404 int numSubEntities ( int codim ) const\n-405 {\n-406 assert( (codim >= 0) && (codim <= dim) );\n-407 return numSubEntities_[ codim ];\n-408 }\n-409 };\n-410\n+397 template< int dim >\n+398 inline bool MeshPointer<_dim_>::coarsen ( typename FillFlags::Flags\n+fillFlags )\n+399 {\n+400 const bool coarsened = (ALBERTA coarsen( mesh_, fillFlags ) ==\n+meshCoarsened);\n+401 if( coarsened )\n+402 ALBERTA dof_compress( mesh_ );\n+403 return coarsened;\n+404 }\n+405\n+406 template< int dim >\n+407 inline bool MeshPointer<_dim_>::refine ( typename FillFlags::Flags\n+fillFlags )\n+408 {\n+409 return (ALBERTA refine( mesh_, fillFlags ) == meshRefined);\n+410 }\n 411\n 412\n-413 // NumberingMap::Initialize\n-414 // ------------------------\n-415\n-416 template< int dim, template< int, int > class Numbering >\n-417 template< int codim >\n-418 struct NumberingMap< dim, Numbering >::Initialize\n-419 {\n-420 static const int numSubEntities = NumSubEntities< dim, codim >::value;\n-421\n-422 static void apply ( NumberingMap< dim, Numbering > &map )\n-423 {\n-424 map.numSubEntities_[ codim ] = numSubEntities;\n-425 map.dune2alberta_[ codim ] = new int[ numSubEntities ];\n-426 map.alberta2dune_[ codim ] = new int[ numSubEntities ];\n-427\n-428 for( int i = 0; i < numSubEntities; ++i )\n+413 template< int dim >\n+414 inline ALBERTA NODE_PROJECTION *\n+415 MeshPointer<_dim_>::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL\n+*macroEl, int n )\n+416 {\n+417 const MacroElement ¯oElement = static_cast< const MacroElement & >\n+( *macroEl );\n+418 if( (n > 0) && macroElement.isBoundary( n-1 ) )\n+419 return new BasicNodeProjection( Library< dimWorld >::boundaryCount++ );\n+420 else\n+421 return 0;\n+422 }\n+423\n+424\n+425 template< int dim >\n+426 template< class ProjectionFactory >\n+427 inline ALBERTA NODE_PROJECTION *\n+428 MeshPointer< dim >::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL\n+*macroEl, int n )\n 429 {\n-430 const int j = Numbering< dim, codim >::apply( i );\n-431 map.dune2alberta_[ codim ][ i ] = j;\n-432 map.alberta2dune_[ codim ][ j ] = i;\n-433 }\n-434 }\n-435 };\n-436\n-437\n-438\n-439 // MapVertices\n-440 // -----------\n-441\n-442 template< int dim, int codim >\n-443 struct MapVertices;\n-444\n-445 template< int dim >\n-446 struct MapVertices< dim, 0 >\n-447 {\n-448 static int apply ( int subEntity, int vertex )\n+430 typedef typename ProjectionFactory::Projection Projection;\n+431\n+432 const MacroElement ¯oElement = static_cast< const MacroElement & >\n+( *macroEl );\n+433\n+434 MeshPointer< dim > meshPointer( mesh );\n+435 ElementInfo elementInfo( meshPointer, macroElement, FillFlags::standard );\n+436 const ProjectionFactory &projectionFactory = *static_cast< const\n+ProjectionFactory * >( Library< dimWorld >::projectionFactory );\n+437 if( (n > 0) && macroElement.isBoundary( n-1 ) )\n+438 {\n+439 const unsigned int boundaryIndex = Library< dimWorld >::boundaryCount++;\n+440 if( projectionFactory.hasProjection( elementInfo, n-1 ) )\n+441 {\n+442 Projection projection = projectionFactory.projection( elementInfo, n-1 );\n+443 return new NodeProjection< dim, Projection >( boundaryIndex, projection );\n+444 }\n+445 else\n+446 return new BasicNodeProjection( boundaryIndex );\n+447 }\n+448 else if( (dim < dimWorld) && (n == 0) )\n 449 {\n-450 assert( subEntity == 0 );\n-451 assert( (vertex >= 0) && (vertex <= NumSubEntities<_dim,_dim_>::value) );\n-452 return vertex;\n-453 }\n-454 };\n-455\n-456 template<>\n-457 struct MapVertices< 2, 1 >\n-458 {\n-459 static int apply ( int subEntity, int vertex )\n-460 {\n-461 assert( (subEntity >= 0) && (subEntity < 3) );\n-462 assert( (vertex >= 0) && (vertex < 2) );\n-463 //static const int map[ 3 ][ 2 ] = { {1,2}, {2,0}, {0,1} };\n-464 static const int map[ 3 ][ 2 ] = { {1,2}, {0,2}, {0,1} };\n-465 return map[ subEntity ][ vertex ];\n-466 }\n-467 };\n+450 const unsigned int boundaryIndex = std::numeric_limits< unsigned int >::max\n+();\n+451 if( projectionFactory.hasProjection( elementInfo ) )\n+452 {\n+453 Projection projection = projectionFactory.projection( elementInfo );\n+454 return new NodeProjection< dim, Projection >( boundaryIndex, projection );\n+455 }\n+456 else\n+457 return 0;\n+458 }\n+459 else\n+460 return 0;\n+461 }\n+462\n+463 } // namespace Alberta\n+464\n+465} // namespace Dune\n+466\n+467#endif // #if HAVE_ALBERTA\n 468\n-469 template<>\n-470 struct MapVertices< 3, 1 >\n-471 {\n-472 static int apply ( int subEntity, int vertex )\n-473 {\n-474 assert( (subEntity >= 0) && (subEntity < 4) );\n-475 assert( (vertex >= 0) && (vertex < 3) );\n-476 //static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,3,2}, {0,1,3}, {0,2,1} };\n-477 static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,2,3}, {0,1,3}, {0,1,2} };\n-478 return map[ subEntity ][ vertex ];\n-479 }\n-480 };\n-481\n-482 template<>\n-483 struct MapVertices< 3, 2 >\n-484 {\n-485 static int apply ( int subEntity, int vertex )\n-486 {\n-487 assert( (subEntity >= 0) && (subEntity < 6) );\n-488 assert( (vertex >= 0) && (vertex < 2) );\n-489 static const int map[ 6 ][ 2 ] = { {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3}\n-};\n-490 return map[ subEntity ][ vertex ];\n-491 }\n-492 };\n-493\n-494 template< int dim >\n-495 struct MapVertices< dim, dim >\n-496 {\n-497 static int apply ( int subEntity, int vertex )\n-498 {\n-499 assert( (subEntity >= 0) && (subEntity < NumSubEntities<_dim,_1_>::value)\n-);\n-500 assert( vertex == 0 );\n-501 return subEntity;\n-502 }\n-503 };\n-504\n-505\n-506\n-507 // Twist\n-508 // -----\n-509\n-510 // ******************************************************************\n-511 // Meaning of the twist (same as in ALU)\n-512 // -------------------------------------\n-513 //\n-514 // Consider a fixed ordering of the vertices v_1, ... v_n of a face\n-515 // (here, we assume their indices to be increasing). Denote by k the\n-516 // local number of a vertex v within the element and by t the twist.\n-517 // Then, v = v_j, where j is computed by the following formula:\n-518 //\n-519 // / (2n + 1 - k + t) % n, if t < 0\n-520 // j = <\n-521 // \\ (k + t) % n, if t >= 0\n-522 //\n-523 // Note: We use the order of the 0-th vertex dof to assign the twist.\n-524 // This is ok for two reasons:\n-525 // - ALBERTA preserves the relative order of the dofs during\n-526 // dof compression.\n-527 // - ALBERTA enforces the first vertex dof admin to be periodic.\n-528 // ******************************************************************\n-529\n-530 template< int dim, int subdim >\n-531 struct Twist\n-532 {\n-533 static const int numSubEntities = NumSubEntities< dim, dim-subdim >::value;\n-534\n-535 static const int minTwist = 0;\n-536 static const int maxTwist = 0;\n-537\n-538 static int twist ( [[maybe_unused]] const Element *element,\n-539 [[maybe_unused]] int subEntity )\n-540 {\n-541 assert( (subEntity >= 0) && (subEntity < numSubEntities) );\n-542 return 0;\n-543 }\n-544 };\n-545\n-546 template< int dim >\n-547 struct Twist< dim, 1 >\n-548 {\n-549 static const int numSubEntities = NumSubEntities< dim, dim-1 >::value;\n-550\n-551 static const int minTwist = 0;\n-552 static const int maxTwist = 1;\n-553\n-554 static int twist ( const Element *element, int subEntity )\n-555 {\n-556 assert( (subEntity >= 0) && (subEntity < numSubEntities) );\n-557 const int numVertices = NumSubEntities<_1,_1_>::value;\n-558 int dof[ numVertices ];\n-559 for( int i = 0; i < numVertices; ++i )\n-560 {\n-561 const int j = MapVertices<_dim,_dim-1_>::apply( subEntity, i );\n-562 dof[ i ] = element->dof[ j ][ 0 ];\n-563 }\n-564 return (dof[ 0 ] < dof[ 1 ] ? 0 : 1);\n-565 }\n-566 };\n-567\n-568\n-569 template<>\n-570 struct Twist< 1, 1 >\n-571 {\n-572 static const int minTwist = 0;\n-573 static const int maxTwist = 0;\n-574\n-575 static int twist ( [[maybe_unused]] const Element *element,\n-576 [[maybe_unused]] int subEntity )\n-577 {\n-578 assert( subEntity == 0 );\n-579 return 0;\n-580 }\n-581 };\n-582\n-583\n-584 template< int dim >\n-585 struct Twist< dim, 2 >\n-586 {\n-587 static const int numSubEntities = NumSubEntities< dim, dim-2 >::value;\n-588\n-589 static const int minTwist = -3;\n-590 static const int maxTwist = 2;\n-591\n-592 static int twist ( const Element *element, int subEntity )\n-593 {\n-594 assert( (subEntity >= 0) && (subEntity < numSubEntities) );\n-595 const int numVertices = NumSubEntities<_2,_2_>::value;\n-596 int dof[ numVertices ];\n-597 for( int i = 0; i < numVertices; ++i )\n-598 {\n-599 const int j = MapVertices<_dim,_dim-2_>::apply( subEntity, i );\n-600 dof[ i ] = element->dof[ j ][ 0 ];\n-601 }\n-602\n-603 const int twist[ 8 ] = { -2, 1, 666, -1, 2, 666, -3, 0 };\n-604 const int k = int( dof[ 0 ] < dof[ 1 ] )\n-605 | (int( dof[ 0 ] < dof[ 2 ] ) << 1)\n-606 | (int( dof[ 1 ] < dof[ 2 ] ) << 2);\n-607 assert( twist[ k ] != 666 );\n-608 return twist[ k ];\n-609 }\n-610 };\n-611\n-612\n-613 template<>\n-614 struct Twist< 2, 2 >\n-615 {\n-616 static const int minTwist = 0;\n-617 static const int maxTwist = 0;\n-618\n-619 static int twist ( [[maybe_unused]] const Element *element,\n-620 [[maybe_unused]] int subEntity )\n-621 {\n-622 assert( subEntity == 0 );\n-623 return 0;\n-624 }\n-625 };\n-626\n-627\n-628\n-629 template< int dim >\n-630 inline int applyTwist ( int twist, int i )\n-631 {\n-632 const int numCorners = NumSubEntities<_dim,_dim_>::value;\n-633 return (twist < 0 ? (2*numCorners + 1 - i + twist) : i + twist) %\n-numCorners;\n-634 }\n-635\n-636 template< int dim >\n-637 inline int applyInverseTwist ( int twist, int i )\n-638 {\n-639 const int numCorners = NumSubEntities<_dim,_dim_>::value;\n-640 return (twist < 0 ? (2*numCorners + 1 - i + twist) : numCorners + i -\n-twist) % numCorners;\n-641 }\n-642\n-643 }\n-644\n-645}\n-646\n-647#endif // #if HAVE_ALBERTA\n-648\n-649#endif // #ifndef DUNE_ALBERTA_MISC_HH\n-albertaheader.hh\n-DIM_OF_WORLD\n-#define DIM_OF_WORLD\n-Definition albertaheader.hh:23\n+469#endif // #ifndef DUNE_ALBERTA_MESHPOINTER_HH\n+elementinfo.hh\n+provides a wrapper for ALBERTA's el_info structure\n+macrodata.hh\n+provides a wrapper for ALBERTA's macro_data structure\n+misc.hh\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::applyInverseTwist\n-int applyInverseTwist(int twist, int i)\n-Definition misc.hh:637\n Dune::Alberta::Mesh\n ALBERTA MESH Mesh\n Definition misc.hh:53\n-Dune::Alberta::applyTwist\n-int applyTwist(int twist, int i)\n-Definition misc.hh:630\n-Dune::Alberta::memFree\n-void memFree(Data *ptr, size_t size)\n-Definition misc.hh:91\n-Dune::Alberta::GlobalMatrix\n-ALBERTA REAL_DD GlobalMatrix\n-Definition misc.hh:51\n-Dune::Alberta::AffineTransformation\n-ALBERTA AFF_TRAFO AffineTransformation\n-Definition misc.hh:52\n-Dune::Alberta::LocalVector\n-ALBERTA REAL_B LocalVector\n-Definition misc.hh:49\n-Dune::Alberta::Element\n-ALBERTA EL Element\n-Definition misc.hh:54\n-Dune::Alberta::BoundaryId\n-ALBERTA BNDRY_TYPE BoundaryId\n-Definition misc.hh:61\n-Dune::Alberta::InteriorBoundary\n-static const int InteriorBoundary\n-Definition misc.hh:59\n Dune::Alberta::Real\n ALBERTA REAL Real\n Definition misc.hh:48\n Dune::Alberta::meshRefined\n static const int meshRefined\n Definition misc.hh:56\n-Dune::Alberta::memAlloc\n-Data * memAlloc(size_t size)\n-Definition misc.hh:73\n-Dune::Alberta::memReAlloc\n-Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)\n-Definition misc.hh:85\n-Dune::Alberta::DirichletBoundary\n-static const int DirichletBoundary\n-Definition misc.hh:60\n-Dune::Alberta::DofSpace\n-ALBERTA FE_SPACE DofSpace\n-Definition misc.hh:65\n-Dune::Alberta::memCAlloc\n-Data * memCAlloc(size_t size)\n-Definition misc.hh:79\n Dune::Alberta::dimWorld\n static const int dimWorld\n Definition misc.hh:46\n-Dune::Alberta::ElementType\n-U_CHAR ElementType\n-Definition misc.hh:63\n Dune::Alberta::meshCoarsened\n static const int meshCoarsened\n Definition misc.hh:57\n-Dune::Alberta::GlobalVector\n-ALBERTA REAL_D GlobalVector\n-Definition misc.hh:50\n-Dune::AlbertaError\n-Definition misc.hh:32\n-Dune::AlbertaIOError\n-Definition misc.hh:36\n-Dune::Alberta::GlobalSpace\n-Definition misc.hh:102\n-Dune::Alberta::GlobalSpace::identityMatrix\n-static const Matrix & identityMatrix()\n-Definition misc.hh:131\n-Dune::Alberta::GlobalSpace::nullVector\n-static const Vector & nullVector()\n-Definition misc.hh:136\n-Dune::Alberta::GlobalSpace::Matrix\n-GlobalMatrix Matrix\n-Definition misc.hh:106\n-Dune::Alberta::GlobalSpace::Vector\n-GlobalVector Vector\n-Definition misc.hh:107\n-Dune::Alberta::NumSubEntities\n-Definition misc.hh:148\n-Dune::Alberta::CodimType\n-Definition misc.hh:192\n+Dune::Alberta::MeshPointer\n+Definition meshpointer.hh:40\n+Dune::Alberta::MeshPointer::numMacroElements\n+int numMacroElements() const\n+Definition meshpointer.hh:257\n+Dune::Alberta::MeshPointer::create\n+unsigned int create(const MacroData< dim > ¯oData, const\n+ProjectionFactoryInterface< Proj, Impl > &projectionFactory)\n+Definition meshpointer.hh:312\n+Dune::Alberta::MeshPointer::release\n+void release()\n+Definition meshpointer.hh:361\n+Dune::Alberta::MeshPointer::read\n+unsigned int read(const std::string &filename, Real &time)\n+Definition meshpointer.hh:342\n+Dune::Alberta::MeshPointer::end\n+MacroIterator end() const\n+Definition meshpointer.hh:76\n+Dune::Alberta::MeshPointer::coarsen\n+bool coarsen(typename FillFlags::Flags fillFlags=FillFlags::nothing)\n+Definition meshpointer.hh:398\n+Dune::Alberta::MeshPointer::size\n+int size(int codim) const\n+Dune::Alberta::MeshPointer::create\n+unsigned int create(const std::string &filename, bool binary=false)\n+Definition meshpointer.hh:331\n+Dune::Alberta::MeshPointer::leafTraverse\n+void leafTraverse(Functor &functor, typename FillFlags::Flags\n+fillFlags=FillFlags::standard) const\n+Definition meshpointer.hh:385\n+Dune::Alberta::MeshPointer::create\n+unsigned int create(const MacroData< dim > ¯oData)\n+Definition meshpointer.hh:299\n+Dune::Alberta::MeshPointer::begin\n+MacroIterator begin() const\n+Definition meshpointer.hh:71\n+Dune::Alberta::MeshPointer::MeshPointer\n+MeshPointer(Mesh *mesh)\n+Definition meshpointer.hh:57\n+Dune::Alberta::MeshPointer::write\n+bool write(const std::string &filename, Real time) const\n+Definition meshpointer.hh:353\n+Dune::Alberta::MeshPointer::refine\n+bool refine(typename FillFlags::Flags fillFlags=FillFlags::nothing)\n+Definition meshpointer.hh:407\n+Dune::Alberta::MeshPointer::MeshPointer\n+MeshPointer()\n+Definition meshpointer.hh:53\n+Dune::Alberta::MeshPointer::hierarchicTraverse\n+void hierarchicTraverse(Functor &functor, typename FillFlags::Flags\n+fillFlags=FillFlags::standard) const\n+Definition meshpointer.hh:370\n+Dune::Alberta::ElementInfo\n+Definition elementinfo.hh:43\n+Dune::Alberta::ElementInfo::hierarchicTraverse\n+void hierarchicTraverse(Functor &functor) const\n+Definition elementinfo.hh:695\n+Dune::Alberta::ElementInfo::leafTraverse\n+void leafTraverse(Functor &functor) const\n+Definition elementinfo.hh:708\n+Dune::Alberta::MacroData\n+Definition macrodata.hh:30\n+Dune::Alberta::MacroData::release\n+void release()\n+release the macro data structure\n+Definition macrodata.hh:127\n+Dune::Alberta::MacroData::read\n+void read(const std::string &filename, bool binary=false)\n+Definition macrodata.hh:413\n+Dune::Alberta::MacroElement\n+Definition macroelement.hh:24\n+Dune::Alberta::MacroElement::isBoundary\n+bool isBoundary(const int face) const\n+Definition macroelement.hh:42\n+Dune::Alberta::MeshPointer::MacroIterator\n+Definition meshpointer.hh:167\n+Dune::Alberta::MeshPointer::MacroIterator::mesh\n+const MeshPointer & mesh() const\n+Definition meshpointer.hh:211\n+Dune::Alberta::MeshPointer::MacroIterator::macroElement\n+const MacroElement & macroElement() const\n+Definition meshpointer.hh:205\n+Dune::Alberta::MeshPointer::MacroIterator::ElementInfo\n+Alberta::ElementInfo< dim > ElementInfo\n+Definition meshpointer.hh:174\n+Dune::Alberta::MeshPointer::MacroIterator::MeshPointer\n+Alberta::MeshPointer< dim > MeshPointer\n+Definition meshpointer.hh:173\n+Dune::Alberta::MeshPointer::MacroIterator::elementInfo\n+ElementInfo elementInfo(typename FillFlags::Flags fillFlags=FillFlags::\n+standard) const\n+Definition meshpointer.hh:238\n+Dune::Alberta::MeshPointer::MacroIterator::done\n+bool done() const\n+Definition meshpointer.hh:189\n+Dune::Alberta::MeshPointer::MacroIterator::increment\n+void increment()\n+Definition meshpointer.hh:199\n+Dune::Alberta::MeshPointer::MacroIterator::equals\n+bool equals(const MacroIterator &other) const\n+Definition meshpointer.hh:194\n+Dune::Alberta::MeshPointer::MacroIterator::MacroIterator\n+MacroIterator()\n+Definition meshpointer.hh:176\n Dune::Alberta::FillFlags\n Definition misc.hh:231\n Dune::Alberta::FillFlags::nothing\n static const Flags nothing\n Definition misc.hh:234\n-Dune::Alberta::FillFlags::nonPeriodic\n-static const Flags nonPeriodic\n-Definition misc.hh:248\n-Dune::Alberta::FillFlags::boundaryId\n-static const Flags boundaryId\n-Definition misc.hh:246\n-Dune::Alberta::FillFlags::elementType\n-static const Flags elementType\n-Definition misc.hh:244\n Dune::Alberta::FillFlags::Flags\n ALBERTA FLAGS Flags\n Definition misc.hh:232\n-Dune::Alberta::FillFlags::projection\n-static const Flags projection\n-Definition misc.hh:242\n-Dune::Alberta::FillFlags::coords\n-static const Flags coords\n-Definition misc.hh:236\n-Dune::Alberta::FillFlags::orientation\n-static const Flags orientation\n-Definition misc.hh:240\n Dune::Alberta::FillFlags::standard\n static const Flags standard\n Definition misc.hh:258\n-Dune::Alberta::FillFlags::neighbor\n-static const Flags neighbor\n-Definition misc.hh:238\n-Dune::Alberta::FillFlags::all\n-static const Flags all\n-Definition misc.hh:250\n-Dune::Alberta::FillFlags::standardWithCoords\n-static const Flags standardWithCoords\n-Definition misc.hh:253\n-Dune::Alberta::RefinementEdge\n-Definition misc.hh:269\n-Dune::Alberta::RefinementEdge::value\n-static const int value\n-Definition misc.hh:270\n-Dune::Alberta::Dune2AlbertaNumbering\n-Definition misc.hh:286\n-Dune::Alberta::Dune2AlbertaNumbering::apply\n-static int apply(const int i)\n-Definition misc.hh:287\n-Dune::Alberta::Dune2AlbertaNumbering<_3,_2_>::apply\n-static int apply(const int i)\n-Definition misc.hh:299\n-Dune::Alberta::Generic2AlbertaNumbering\n-Definition misc.hh:314\n-Dune::Alberta::Generic2AlbertaNumbering::apply\n-static int apply(const int i)\n-Definition misc.hh:315\n-Dune::Alberta::Generic2AlbertaNumbering<_dim,_1_>::apply\n-static int apply(const int i)\n-Definition misc.hh:325\n-Dune::Alberta::Generic2AlbertaNumbering<_1,_1_>::apply\n-static int apply(const int i)\n-Definition misc.hh:335\n-Dune::Alberta::Generic2AlbertaNumbering<_3,_2_>::apply\n-static int apply(const int i)\n-Definition misc.hh:347\n-Dune::Alberta::NumberingMap\n-Definition misc.hh:362\n-Dune::Alberta::NumberingMap::alberta2dune\n-int alberta2dune(int codim, int i) const\n-Definition misc.hh:397\n-Dune::Alberta::NumberingMap::numSubEntities\n-int numSubEntities(int codim) const\n-Definition misc.hh:404\n-Dune::Alberta::NumberingMap::dune2alberta\n-int dune2alberta(int codim, int i) const\n-Definition misc.hh:390\n-Dune::Alberta::NumberingMap::~NumberingMap\n-~NumberingMap()\n-Definition misc.hh:381\n-Dune::Alberta::NumberingMap::NumberingMap\n-NumberingMap()\n-Definition misc.hh:376\n-Dune::Alberta::MapVertices\n-Definition misc.hh:443\n-Dune::Alberta::MapVertices<_dim,_0_>::apply\n-static int apply(int subEntity, int vertex)\n-Definition misc.hh:448\n-Dune::Alberta::MapVertices<_2,_1_>::apply\n-static int apply(int subEntity, int vertex)\n-Definition misc.hh:459\n-Dune::Alberta::MapVertices<_3,_1_>::apply\n-static int apply(int subEntity, int vertex)\n-Definition misc.hh:472\n-Dune::Alberta::MapVertices<_3,_2_>::apply\n-static int apply(int subEntity, int vertex)\n-Definition misc.hh:485\n-Dune::Alberta::MapVertices<_dim,_dim_>::apply\n-static int apply(int subEntity, int vertex)\n-Definition misc.hh:497\n-Dune::Alberta::Twist\n-Definition misc.hh:532\n-Dune::Alberta::Twist::maxTwist\n-static const int maxTwist\n-Definition misc.hh:536\n-Dune::Alberta::Twist::minTwist\n-static const int minTwist\n-Definition misc.hh:535\n-Dune::Alberta::Twist::twist\n-static int twist(const Element *element, int subEntity)\n-Definition misc.hh:538\n-Dune::Alberta::Twist::numSubEntities\n-static const int numSubEntities\n-Definition misc.hh:533\n-Dune::Alberta::Twist<_dim,_1_>::twist\n-static int twist(const Element *element, int subEntity)\n-Definition misc.hh:554\n-Dune::Alberta::Twist<_1,_1_>::twist\n-static int twist(const Element *element, int subEntity)\n-Definition misc.hh:575\n-Dune::Alberta::Twist<_dim,_2_>::twist\n-static int twist(const Element *element, int subEntity)\n-Definition misc.hh:592\n-Dune::Alberta::Twist<_2,_2_>::twist\n-static int twist(const Element *element, int subEntity)\n-Definition misc.hh:619\n+Dune::Alberta::ProjectionFactory\n+Definition albertagrid/projection.hh:135\n+Dune::Alberta::ProjectionFactory::Projection\n+Base::Projection Projection\n+Definition albertagrid/projection.hh:140\n+Dune::Alberta::ProjectionFactoryInterface\n+Definition albertagrid/projection.hh:80\n+Dune::Alberta::BasicNodeProjection\n+Definition albertagrid/projection.hh:208\n+projection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00626.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00626.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: leafiterator.hh File Reference\n+dune-grid: elementinfo.cc File Reference\n \n \n \n \n \n \n \n@@ -70,37 +70,35 @@\n \n
    \n
    \n \n-
    leafiterator.hh File Reference
    \n+
    elementinfo.cc File Reference
    \n
    \n
    \n-\n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::AlbertaGridLeafIterator< codim, pitype, GridImp >
     
    class  Dune::AlbertaGridLeafIterator< codim, Ghost_Partition, GridImp >
     
    \n+\n+

    provides a wrapper for ALBERTA's el_info structure \n+More...

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

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-
    \n+

    Detailed Description

    \n+

    provides a wrapper for ALBERTA's el_info structure

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,23 +1,24 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-leafiterator.hh File Reference\n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::AlbertaGridLeafIterator<_codim,_pitype,_GridImp_>\n-\u00a0\n-class \u00a0 Dune::AlbertaGridLeafIterator<_codim,_Ghost_Partition,_GridImp_>\n-\u00a0\n+Namespaces\n+elementinfo.cc File Reference\n+provides a wrapper for ALBERTA's el_info structure More...\n+#include \n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::Alberta\n+\u00a0\n+***** Detailed Description *****\n+provides a wrapper for ALBERTA's el_info structure\n+ Author\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00629.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00629.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entity.cc File Reference\n+dune-grid: undefine-2.0.hh File Reference\n \n \n \n \n \n \n \n@@ -69,49 +69,25 @@\n \n \n
    \n
    \n- \n-
    entity.cc File Reference
    \n+
    undefine-2.0.hh File Reference
    \n
    \n
    \n \n-

    Go to the source code of this file.

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

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n-

    \n-Macros

    #define DUNE_ALBERTA_ENTITY_CC
     
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_ALBERTA_ENTITY_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_ALBERTA_ENTITY_CC
    \n-
    \n+

    Contains #undefs for all preprocessor macros defined by alberta. \n+More...

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

    Go to the source code of this file.

    \n+

    Detailed Description

    \n+

    Contains #undefs for all preprocessor macros defined by alberta.

    \n+

    This file is created automatically by the perl script undefAllMacros.pl.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,22 +1,15 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Namespaces | Macros\n-entity.cc File Reference\n+undefine-2.0.hh File Reference\n+Contains #undefs for all preprocessor macros defined by alberta. More...\n Go_to_the_source_code_of_this_file.\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n-Macros\n-#define\u00a0 DUNE_ALBERTA_ENTITY_CC\n-\u00a0\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_ALBERTA_ENTITY_CC *****\n-#define DUNE_ALBERTA_ENTITY_CC\n+***** Detailed Description *****\n+Contains #undefs for all preprocessor macros defined by alberta.\n+This file is created automatically by the perl script undefAllMacros.pl.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00629_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00629_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entity.cc Source File\n+dune-grid: undefine-2.0.hh Source File\n \n \n \n \n \n \n \n@@ -74,493 +74,476 @@\n \n \n
    \n
    \n-
    entity.cc
    \n+
    undefine-2.0.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_ENTITY_CC
    \n-
    6#define DUNE_ALBERTA_ENTITY_CC
    \n-
    7
    \n-
    8namespace Dune
    \n-
    9{
    \n-
    10
    \n-
    11 // AlbertaGridEntity (for codim > 0)
    \n-
    12 // ---------------------------------
    \n-
    13
    \n-
    14 template<int codim, int dim, class Grid>
    \n-
    15 inline AlbertaGridEntity< codim, dim, Grid >
    \n-
    \n-
    16 ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int subEntity )
    \n-
    17 : grid_( &grid ),
    \n-
    18 elementInfo_( elementInfo ),
    \n-
    19 subEntity_( subEntity )
    \n-
    20 {}
    \n-
    \n-
    21
    \n-
    22 template<int codim, int dim, class Grid>
    \n-\n-
    \n-\n-
    25 : grid_( &grid ),
    \n-
    26 elementInfo_(),
    \n-
    27 subEntity_( -1 )
    \n-
    28 {}
    \n-
    \n-
    29
    \n-
    30 template<int codim, int dim, class Grid>
    \n-\n-
    \n-\n-
    33 : grid_( NULL ),
    \n-
    34 elementInfo_(),
    \n-
    35 subEntity_( -1 )
    \n-
    36 {}
    \n-
    \n-
    37
    \n-
    38 template< int codim, int dim, class Grid >
    \n-
    39 inline PartitionType
    \n-
    \n-\n-
    41 {
    \n-
    42 return InteriorEntity;
    \n-
    43 }
    \n-
    \n-
    44
    \n-
    45
    \n-
    46 template< int codim, int dim, class Grid >
    \n-
    47 inline bool
    \n-
    \n-\n-
    49 {
    \n-
    50 const Alberta::Element *e1 = elementInfo().el();
    \n-
    51 const Alberta::Element *e2 = other.elementInfo().el();
    \n-
    52
    \n-
    53 // if both element null then they are equal
    \n-
    54 if( (e1 == NULL) && (e2 == NULL) )
    \n-
    55 return true;
    \n-
    56 return ((e1 == e2) && (subEntity_ == other.subEntity_));
    \n-
    57 }
    \n-
    \n-
    58
    \n+
    12#ifdef _ALBERTA_H_
    \n+
    13 #undef _ALBERTA_H_
    \n+
    14#endif // _ALBERTA_H_
    \n+
    15
    \n+
    16#ifdef ALBERTA_VERSION
    \n+
    17 #undef ALBERTA_VERSION
    \n+
    18#endif // ALBERTA_VERSION
    \n+
    19
    \n+
    20#ifdef ALBERTA_DEBUG
    \n+
    21 #undef ALBERTA_DEBUG
    \n+
    22#endif // ALBERTA_DEBUG
    \n+
    23
    \n+
    24#ifdef DIM_MAX
    \n+
    25 #undef DIM_MAX
    \n+
    26#endif // DIM_MAX
    \n+
    27
    \n+
    28#ifdef N_VERTICES
    \n+
    29 #undef N_VERTICES
    \n+
    30#endif // N_VERTICES
    \n+
    31
    \n+
    32#ifdef N_EDGES
    \n+
    33 #undef N_EDGES
    \n+
    34#endif // N_EDGES
    \n+
    35
    \n+
    36#ifdef N_WALLS
    \n+
    37 #undef N_WALLS
    \n+
    38#endif // N_WALLS
    \n+
    39
    \n+
    40#ifdef N_FACES
    \n+
    41 #undef N_FACES
    \n+
    42#endif // N_FACES
    \n+
    43
    \n+
    44#ifdef N_NEIGH
    \n+
    45 #undef N_NEIGH
    \n+
    46#endif // N_NEIGH
    \n+
    47
    \n+
    48#ifdef DIM_FAC
    \n+
    49 #undef DIM_FAC
    \n+
    50#endif // DIM_FAC
    \n+
    51
    \n+
    52#ifdef N_VERTICES_0D
    \n+
    53 #undef N_VERTICES_0D
    \n+
    54#endif // N_VERTICES_0D
    \n+
    55
    \n+
    56#ifdef N_EDGES_0D
    \n+
    57 #undef N_EDGES_0D
    \n+
    58#endif // N_EDGES_0D
    \n
    59
    \n-
    60 template< int codim, int dim, class Grid >
    \n-
    61 inline ALBERTA EL_INFO *
    \n-
    \n-\n-
    63 {
    \n-
    64 return &(elementInfo_.elInfo());
    \n-
    65 }
    \n-
    \n-
    66
    \n+
    60#ifdef N_FACES_0D
    \n+
    61 #undef N_FACES_0D
    \n+
    62#endif // N_FACES_0D
    \n+
    63
    \n+
    64#ifdef N_NEIGH_0D
    \n+
    65 #undef N_NEIGH_0D
    \n+
    66#endif // N_NEIGH_0D
    \n
    67
    \n-
    68 template< int codim, int dim, class Grid >
    \n-
    69 inline void
    \n-
    \n-\n-
    71 {
    \n-
    72 elementInfo_ = ElementInfo();
    \n-
    73 }
    \n-
    \n-
    74
    \n+
    68#ifdef N_WALLS_0D
    \n+
    69 #undef N_WALLS_0D
    \n+
    70#endif // N_WALLS_0D
    \n+
    71
    \n+
    72#ifdef N_VERTICES_1D
    \n+
    73 #undef N_VERTICES_1D
    \n+
    74#endif // N_VERTICES_1D
    \n
    75
    \n-
    76 template< int codim, int dim, class Grid >
    \n-\n-
    \n-
    78 ::setElement ( const ElementInfo &elementInfo, int subEntity )
    \n-
    79 {
    \n-
    80 elementInfo_ = elementInfo;
    \n-
    81 subEntity_ = subEntity;
    \n-
    82 }
    \n-
    \n+
    76#ifdef N_EDGES_1D
    \n+
    77 #undef N_EDGES_1D
    \n+
    78#endif // N_EDGES_1D
    \n+
    79
    \n+
    80#ifdef N_FACES_1D
    \n+
    81 #undef N_FACES_1D
    \n+
    82#endif // N_FACES_1D
    \n
    83
    \n-
    84
    \n-
    85 template< int codim, int dim, class Grid >
    \n-
    86 inline void
    \n-
    \n-\n-
    88 {
    \n-
    89 setElement( other.elementInfo_, other.subEntity_ );
    \n-
    90 }
    \n-
    \n+
    84#ifdef N_NEIGH_1D
    \n+
    85 #undef N_NEIGH_1D
    \n+
    86#endif // N_NEIGH_1D
    \n+
    87
    \n+
    88#ifdef N_WALLS_1D
    \n+
    89 #undef N_WALLS_1D
    \n+
    90#endif // N_WALLS_1D
    \n
    91
    \n-
    92
    \n-
    93 template< int codim, int dim, class Grid >
    \n-
    \n-\n-
    95 {
    \n-
    96 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );
    \n-
    97 return elementInfo_.level();
    \n-
    98 }
    \n-
    \n+
    92#ifdef N_VERTICES_2D
    \n+
    93 #undef N_VERTICES_2D
    \n+
    94#endif // N_VERTICES_2D
    \n+
    95
    \n+
    96#ifdef N_EDGES_2D
    \n+
    97 #undef N_EDGES_2D
    \n+
    98#endif // N_EDGES_2D
    \n
    99
    \n-
    100
    \n-
    101 template< int codim, int dim, class Grid >
    \n-\n-
    \n-\n-
    104 {
    \n-\n-
    106
    \n-
    107 assert( elementInfo_ );
    \n-
    108 const CoordReader coordReader( grid(), elementInfo_, subEntity_ );
    \n-
    109 return Geometry( GeometryImpl( coordReader ) );
    \n-
    110 }
    \n-
    \n+
    100#ifdef N_FACES_2D
    \n+
    101 #undef N_FACES_2D
    \n+
    102#endif // N_FACES_2D
    \n+
    103
    \n+
    104#ifdef N_NEIGH_2D
    \n+
    105 #undef N_NEIGH_2D
    \n+
    106#endif // N_NEIGH_2D
    \n+
    107
    \n+
    108#ifdef N_WALLS_2D
    \n+
    109 #undef N_WALLS_2D
    \n+
    110#endif // N_WALLS_2D
    \n
    111
    \n-
    112
    \n-
    113 template< int codim, int dim, class Grid >
    \n-
    \n-\n-
    115 {
    \n-
    116 return GeometryTypes::simplex( mydimension );
    \n-
    117 }
    \n-
    \n-
    118
    \n+
    112#ifdef N_VERTICES_3D
    \n+
    113 #undef N_VERTICES_3D
    \n+
    114#endif // N_VERTICES_3D
    \n+
    115
    \n+
    116#ifdef N_EDGES_3D
    \n+
    117 #undef N_EDGES_3D
    \n+
    118#endif // N_EDGES_3D
    \n
    119
    \n-
    120
    \n-
    121 // AlbertaGridEntity (for codim = 0)
    \n-
    122 // ---------------------------------
    \n+
    120#ifdef N_FACES_3D
    \n+
    121 #undef N_FACES_3D
    \n+
    122#endif // N_FACES_3D
    \n
    123
    \n-
    124 template< int dim, class Grid >
    \n-\n-
    \n-
    126 ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int subEntity )
    \n-
    127 : grid_( &grid ),
    \n-
    128 elementInfo_( elementInfo )
    \n-
    129 {
    \n-
    130 assert( subEntity == 0 );
    \n-
    131 }
    \n-
    \n-
    132
    \n-
    133 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    136 : grid_( &grid ),
    \n-
    137 elementInfo_()
    \n-
    138 {}
    \n-
    \n+
    124#ifdef N_NEIGH_3D
    \n+
    125 #undef N_NEIGH_3D
    \n+
    126#endif // N_NEIGH_3D
    \n+
    127
    \n+
    128#ifdef N_WALLS_3D
    \n+
    129 #undef N_WALLS_3D
    \n+
    130#endif // N_WALLS_3D
    \n+
    131
    \n+
    132#ifdef N_VERTICES_MAX
    \n+
    133 #undef N_VERTICES_MAX
    \n+
    134#endif // N_VERTICES_MAX
    \n+
    135
    \n+
    136#ifdef N_EDGES_MAX
    \n+
    137 #undef N_EDGES_MAX
    \n+
    138#endif // N_EDGES_MAX
    \n
    139
    \n-
    140 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    143 : grid_( NULL ),
    \n-
    144 elementInfo_()
    \n-
    145 {}
    \n-
    \n-
    146
    \n+
    140#ifdef N_FACES_MAX
    \n+
    141 #undef N_FACES_MAX
    \n+
    142#endif // N_FACES_MAX
    \n+
    143
    \n+
    144#ifdef N_NEIGH_MAX
    \n+
    145 #undef N_NEIGH_MAX
    \n+
    146#endif // N_NEIGH_MAX
    \n
    147
    \n-
    148 template< int dim, class Grid >
    \n-
    \n-\n-
    150 {
    \n-
    151 // elements are always inside of our Domain
    \n-
    152 return 0;
    \n-
    153 }
    \n-
    \n-
    154
    \n+
    148#ifdef N_WALLS_MAX
    \n+
    149 #undef N_WALLS_MAX
    \n+
    150#endif // N_WALLS_MAX
    \n+
    151
    \n+
    152#ifdef N_LAMBDA
    \n+
    153 #undef N_LAMBDA
    \n+
    154#endif // N_LAMBDA
    \n
    155
    \n-
    156 template< int dim, class Grid >
    \n-
    \n-\n-
    158 {
    \n-
    159 return grid().levelProvider().isNew( elementInfo_ );
    \n-
    160 }
    \n-
    \n-
    161
    \n-
    162
    \n-
    163 template< int dim, class Grid >
    \n-
    \n-\n-
    165 {
    \n-
    166 return elementInfo_.mightVanish();
    \n-
    167 }
    \n-
    \n-
    168
    \n-
    169
    \n-
    170 template< int dim, class Grid >
    \n-
    171 inline bool
    \n-
    \n-\n-
    173 {
    \n-
    174 assert( elementInfo_ );
    \n-
    175 bool isBoundary = false;
    \n-
    176 for( int i = 0; i < dim+1; ++i )
    \n-
    177 isBoundary |= elementInfo_.isBoundary( i );
    \n-
    178 return isBoundary;
    \n-
    179 }
    \n-
    \n-
    180
    \n-
    181
    \n-
    182 template< int dim, class Grid >
    \n-
    183 inline PartitionType
    \n-
    \n-\n-
    185 {
    \n-
    186 return InteriorEntity;
    \n-
    187 }
    \n-
    \n-
    188
    \n-
    189
    \n-
    190 template< int dim, class Grid >
    \n-
    \n-\n-
    192 {
    \n-
    193 return elementInfo_.isLeaf();
    \n-
    194 }
    \n-
    \n+
    156#ifdef LAMBDA_MAX
    \n+
    157 #undef LAMBDA_MAX
    \n+
    158#endif // LAMBDA_MAX
    \n+
    159
    \n+
    160#ifdef INDEX
    \n+
    161 #undef INDEX
    \n+
    162#endif // INDEX
    \n+
    163
    \n+
    164#ifdef INDEX
    \n+
    165 #undef INDEX
    \n+
    166#endif // INDEX
    \n+
    167
    \n+
    168#ifdef IS_LEAF_EL
    \n+
    169 #undef IS_LEAF_EL
    \n+
    170#endif // IS_LEAF_EL
    \n+
    171
    \n+
    172#ifdef LEAF_DATA
    \n+
    173 #undef LEAF_DATA
    \n+
    174#endif // LEAF_DATA
    \n+
    175
    \n+
    176#ifdef INTERIOR
    \n+
    177 #undef INTERIOR
    \n+
    178#endif // INTERIOR
    \n+
    179
    \n+
    180#ifdef DIRICHLET
    \n+
    181 #undef DIRICHLET
    \n+
    182#endif // DIRICHLET
    \n+
    183
    \n+
    184#ifdef NEUMANN
    \n+
    185 #undef NEUMANN
    \n+
    186#endif // NEUMANN
    \n+
    187
    \n+
    188#ifdef IS_NEUMANN
    \n+
    189 #undef IS_NEUMANN
    \n+
    190#endif // IS_NEUMANN
    \n+
    191
    \n+
    192#ifdef IS_DIRICHLET
    \n+
    193 #undef IS_DIRICHLET
    \n+
    194#endif // IS_DIRICHLET
    \n
    195
    \n-
    196
    \n-
    197 template< int dim, class Grid >
    \n-
    198 inline bool
    \n-
    \n-\n-
    200 {
    \n-
    201 // element pointers are unique
    \n-
    202 return (elementInfo().el() == other.elementInfo().el());
    \n-
    203 }
    \n-
    \n-
    204
    \n-
    205
    \n-
    206 template< int dim, class Grid >
    \n-
    207 template< int codim >
    \n-
    208 inline typename Grid::template Codim< codim >::Entity
    \n-
    \n-\n-
    210 {
    \n-
    211 typedef AlbertaGridEntity< codim, dim, Grid > EntityImpl;
    \n-
    212 return EntityImpl( grid(), elementInfo_, grid().generic2alberta( codim, i ) );
    \n-
    213 }
    \n-
    \n-
    214
    \n+
    196#ifdef IS_INTERIOR
    \n+
    197 #undef IS_INTERIOR
    \n+
    198#endif // IS_INTERIOR
    \n+
    199
    \n+
    200#ifdef N_NODE_TYPES
    \n+
    201 #undef N_NODE_TYPES
    \n+
    202#endif // N_NODE_TYPES
    \n+
    203
    \n+
    204#ifdef VERTEX
    \n+
    205 #undef VERTEX
    \n+
    206#endif // VERTEX
    \n+
    207
    \n+
    208#ifdef CENTER
    \n+
    209 #undef CENTER
    \n+
    210#endif // CENTER
    \n+
    211
    \n+
    212#ifdef EDGE
    \n+
    213 #undef EDGE
    \n+
    214#endif // EDGE
    \n
    215
    \n-
    216 template< int dim, class Grid >
    \n-
    217 inline ALBERTA EL_INFO *
    \n-
    \n-\n-
    219 {
    \n-
    220 return &(elementInfo_.elInfo());
    \n-
    221 }
    \n-
    \n-
    222
    \n+
    216#ifdef FACE
    \n+
    217 #undef FACE
    \n+
    218#endif // FACE
    \n+
    219
    \n+
    220#ifdef LIST_ENTRY
    \n+
    221 #undef LIST_ENTRY
    \n+
    222#endif // LIST_ENTRY
    \n
    223
    \n-
    224 template< int dim, class Grid >
    \n-
    \n-\n-
    226 {
    \n-
    227 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );
    \n-
    228 return elementInfo_.level();
    \n-
    229 }
    \n-
    \n-
    230
    \n+
    224#ifdef WALL_BOUND
    \n+
    225 #undef WALL_BOUND
    \n+
    226#endif // WALL_BOUND
    \n+
    227
    \n+
    228#ifdef FILL_NOTHING
    \n+
    229 #undef FILL_NOTHING
    \n+
    230#endif // FILL_NOTHING
    \n
    231
    \n-
    232 template< int dim, class Grid >
    \n-
    233 inline void
    \n-
    \n-\n-
    235 {
    \n-
    236 elementInfo_ = ElementInfo();
    \n-
    237 }
    \n-
    \n-
    238
    \n+
    232#ifdef FILL_COORDS
    \n+
    233 #undef FILL_COORDS
    \n+
    234#endif // FILL_COORDS
    \n+
    235
    \n+
    236#ifdef FILL_BOUND
    \n+
    237 #undef FILL_BOUND
    \n+
    238#endif // FILL_BOUND
    \n
    239
    \n-
    240 template< int dim, class Grid >
    \n-\n-
    \n-
    242 ::setElement ( const ElementInfo &elementInfo, int /* subEntity */ )
    \n-
    243 {
    \n-
    244 elementInfo_ = elementInfo;
    \n-
    245 }
    \n-
    \n-
    246
    \n+
    240#ifdef FILL_NEIGH
    \n+
    241 #undef FILL_NEIGH
    \n+
    242#endif // FILL_NEIGH
    \n+
    243
    \n+
    244#ifdef FILL_OPP_COORDS
    \n+
    245 #undef FILL_OPP_COORDS
    \n+
    246#endif // FILL_OPP_COORDS
    \n
    247
    \n-
    248 template< int dim, class Grid >
    \n-
    249 inline void
    \n-
    \n-\n-
    251 {
    \n-
    252 setElement( other.elementInfo_, 0 );
    \n-
    253 }
    \n-
    \n-
    254
    \n+
    248#ifdef FILL_ORIENTATION
    \n+
    249 #undef FILL_ORIENTATION
    \n+
    250#endif // FILL_ORIENTATION
    \n+
    251
    \n+
    252#ifdef FILL_EL_TYPE
    \n+
    253 #undef FILL_EL_TYPE
    \n+
    254#endif // FILL_EL_TYPE
    \n
    255
    \n-
    256 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    259 {
    \n-
    260 typedef AlbertaGridCoordinateReader< 0, Grid > CoordReader;
    \n-
    261
    \n-
    262 assert( elementInfo_ );
    \n-
    263 const CoordReader coordReader( grid(), elementInfo_, 0 );
    \n-
    264 return Geometry( GeometryImpl( coordReader ) );
    \n-
    265 }
    \n-
    \n-
    266
    \n+
    256#ifdef FILL_PROJECTION
    \n+
    257 #undef FILL_PROJECTION
    \n+
    258#endif // FILL_PROJECTION
    \n+
    259
    \n+
    260#ifdef FILL_ANY
    \n+
    261 #undef FILL_ANY
    \n+
    262#endif // FILL_ANY
    \n+
    263
    \n+
    264#ifdef HOOK_QUEUE_OFFSET
    \n+
    265 #undef HOOK_QUEUE_OFFSET
    \n+
    266#endif // HOOK_QUEUE_OFFSET
    \n
    267
    \n-
    268 template< int dim, class Grid >
    \n-
    \n-
    269 inline GeometryType AlbertaGridEntity< 0, dim, Grid>::type () const
    \n-
    270 {
    \n-
    271 return GeometryTypes::simplex( mydimension );
    \n-
    272 }
    \n-
    \n-
    273
    \n-
    274
    \n-
    275 template< int dim, class Grid >
    \n-
    276 inline typename Grid::template Codim< 0 >::Entity
    \n-
    \n-\n-
    278 {
    \n-
    279 typedef AlbertaGridEntity< 0, dim, Grid > EntityImpl;
    \n-
    280
    \n-
    281 assert( elementInfo_ );
    \n-
    282 const ElementInfo fatherInfo = elementInfo_.father();
    \n+
    268#ifdef RUN_HOOKS_0
    \n+
    269 #undef RUN_HOOKS_0
    \n+
    270#endif // RUN_HOOKS_0
    \n+
    271
    \n+
    272#ifdef RUN_BAS_FCTS_HOOKS
    \n+
    273 #undef RUN_BAS_FCTS_HOOKS
    \n+
    274#endif // RUN_BAS_FCTS_HOOKS
    \n+
    275
    \n+
    276#ifdef RUN_HOOKS_1
    \n+
    277 #undef RUN_HOOKS_1
    \n+
    278#endif // RUN_HOOKS_1
    \n+
    279
    \n+
    280#ifdef RUN_HOOKS_2
    \n+
    281 #undef RUN_HOOKS_2
    \n+
    282#endif // RUN_HOOKS_2
    \n
    283
    \n-
    284 return EntityImpl( grid(), fatherInfo, 0 );
    \n-
    285 }
    \n-
    \n-
    286
    \n+
    284#ifdef RUN_HOOKS_3
    \n+
    285 #undef RUN_HOOKS_3
    \n+
    286#endif // RUN_HOOKS_3
    \n
    287
    \n-
    288 template< int dim, class Grid >
    \n-\n-
    290 {
    \n-
    291 return elementInfo_.indexInFather();
    \n-
    292 }
    \n-
    293
    \n-
    294
    \n-
    295 template< int dim, class Grid >
    \n-
    296 inline typename AlbertaGridEntity< 0, dim, Grid >::LocalGeometry
    \n-
    \n-\n-
    298 {
    \n-
    299 typedef AlbertaGridLocalGeometryProvider< Grid > LocalGeoProvider;
    \n-
    300 const int indexInFather = elementInfo_.indexInFather();
    \n-
    301 const int orientation = (elementInfo_.type() == 1 ? -1 : 1);
    \n-
    302 return LocalGeometry( LocalGeoProvider::instance().geometryInFather( indexInFather, orientation ) );
    \n-
    303 }
    \n-
    \n-
    304
    \n-
    305
    \n-
    306 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    309 {
    \n-
    310 assert( elementInfo_ );
    \n-
    311 typedef AlbertaGridHierarchicIterator< Grid > IteratorImp;
    \n-
    312 return IteratorImp( grid(), elementInfo_, maxlevel );
    \n-
    313 }
    \n-
    \n-
    314
    \n+
    288#ifdef RUN_HOOKS_4
    \n+
    289 #undef RUN_HOOKS_4
    \n+
    290#endif // RUN_HOOKS_4
    \n+
    291
    \n+
    292#ifdef RUN_HOOKS_5
    \n+
    293 #undef RUN_HOOKS_5
    \n+
    294#endif // RUN_HOOKS_5
    \n+
    295
    \n+
    296#ifdef RUN_HOOKS_6
    \n+
    297 #undef RUN_HOOKS_6
    \n+
    298#endif // RUN_HOOKS_6
    \n+
    299
    \n+
    300#ifdef RUN_HOOKS_7
    \n+
    301 #undef RUN_HOOKS_7
    \n+
    302#endif // RUN_HOOKS_7
    \n+
    303
    \n+
    304#ifdef CALL_EVERY_EL_PREORDER
    \n+
    305 #undef CALL_EVERY_EL_PREORDER
    \n+
    306#endif // CALL_EVERY_EL_PREORDER
    \n+
    307
    \n+
    308#ifdef CALL_EVERY_EL_INORDER
    \n+
    309 #undef CALL_EVERY_EL_INORDER
    \n+
    310#endif // CALL_EVERY_EL_INORDER
    \n+
    311
    \n+
    312#ifdef CALL_EVERY_EL_POSTORDER
    \n+
    313 #undef CALL_EVERY_EL_POSTORDER
    \n+
    314#endif // CALL_EVERY_EL_POSTORDER
    \n
    315
    \n-
    316 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    319 {
    \n-
    320 assert( elementInfo_ );
    \n-
    321 typedef AlbertaGridHierarchicIterator< Grid > IteratorImp;
    \n-
    322 return IteratorImp( grid(), level(), maxlevel );
    \n-
    323 }
    \n-
    \n-
    324
    \n-
    325
    \n-
    326 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    329 {
    \n-
    330 assert( elementInfo_ );
    \n+
    316#ifdef CALL_LEAF_EL
    \n+
    317 #undef CALL_LEAF_EL
    \n+
    318#endif // CALL_LEAF_EL
    \n+
    319
    \n+
    320#ifdef CALL_LEAF_EL_LEVEL
    \n+
    321 #undef CALL_LEAF_EL_LEVEL
    \n+
    322#endif // CALL_LEAF_EL_LEVEL
    \n+
    323
    \n+
    324#ifdef CALL_EL_LEVEL
    \n+
    325 #undef CALL_EL_LEVEL
    \n+
    326#endif // CALL_EL_LEVEL
    \n+
    327
    \n+
    328#ifdef CALL_MG_LEVEL
    \n+
    329 #undef CALL_MG_LEVEL
    \n+
    330#endif // CALL_MG_LEVEL
    \n
    331
    \n-
    332#ifndef NDEBUG
    \n-
    333 for( int i = 0; i <= dimension; ++i )
    \n-
    334 {
    \n-
    335 // std::cout << "Opposite vertex " << i << ": "
    \n-
    336 // << (int)(getElInfo()->opp_vertex[ i ]) << std::endl;
    \n-
    337 if( getElInfo()->opp_vertex[ i ] == 127 )
    \n-
    338 {
    \n-
    339 assert( false );
    \n-
    340 DUNE_THROW( NotImplemented, "AlbertaGrid: Intersections on outside "
    \n-
    341 "entities are not fully implemented, yet." );
    \n-
    342 }
    \n-
    343 }
    \n-
    344#endif // #ifndef NDEBUG
    \n-
    345
    \n-\n-
    347 return AlbertaGridLeafIntersectionIterator( *this, begin );
    \n-
    348 }
    \n-
    \n-
    349
    \n-
    350
    \n-
    351 template< int dim, class Grid >
    \n-\n-
    \n-\n-
    354 {
    \n-
    355 assert( elementInfo_ );
    \n-\n-
    357 return AlbertaGridLeafIntersectionIterator( *this, end );
    \n-
    358 }
    \n-
    \n+
    332#ifdef TEST_FLAG
    \n+
    333 #undef TEST_FLAG
    \n+
    334#endif // TEST_FLAG
    \n+
    335
    \n+
    336#ifdef DOF_ADMIN_DEF
    \n+
    337 #undef DOF_ADMIN_DEF
    \n+
    338#endif // DOF_ADMIN_DEF
    \n+
    339
    \n+
    340#ifdef DOF_FREE_SIZE
    \n+
    341 #undef DOF_FREE_SIZE
    \n+
    342#endif // DOF_FREE_SIZE
    \n+
    343
    \n+
    344#ifdef DOF_UNIT_ALL_FREE
    \n+
    345 #undef DOF_UNIT_ALL_FREE
    \n+
    346#endif // DOF_UNIT_ALL_FREE
    \n+
    347
    \n+
    348#ifdef FOR_ALL_DOFS
    \n+
    349 #undef FOR_ALL_DOFS
    \n+
    350#endif // FOR_ALL_DOFS
    \n+
    351
    \n+
    352#ifdef FOR_ALL_FREE_DOFS
    \n+
    353 #undef FOR_ALL_FREE_DOFS
    \n+
    354#endif // FOR_ALL_FREE_DOFS
    \n+
    355
    \n+
    356#ifdef DOWBM_FULL
    \n+
    357 #undef DOWBM_FULL
    \n+
    358#endif // DOWBM_FULL
    \n
    359
    \n-
    360} // namespace Dune
    \n-
    361
    \n-
    362#endif // #ifndef DUNE_ALBERTA_ENTITY_CC
    \n-
    #define ALBERTA
    Definition albertaheader.hh:29
    \n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n-
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA EL Element
    Definition misc.hh:54
    \n-\n-
    int level() const
    Definition elementinfo.hh:533
    \n-
    bool mightVanish() const
    Definition elementinfo.hh:526
    \n-
    ElementInfo father() const
    Definition elementinfo.hh:449
    \n-
    int type() const
    Definition elementinfo.hh:540
    \n-
    bool isBoundary(int face) const
    Definition elementinfo.hh:620
    \n-
    int indexInFather() const
    Definition elementinfo.hh:457
    \n-
    ALBERTA EL_INFO & elInfo() const
    Definition elementinfo.hh:744
    \n-
    Definition hierarchiciterator.hh:29
    \n-
    Definition albertagrid/intersectioniterator.hh:27
    \n-
    Definition albertagrid/entity.hh:46
    \n-
    void clearElement()
    Definition entity.cc:70
    \n-
    ALBERTA EL_INFO * getElInfo() const
    needed for the LevelIterator and LeafIterator
    Definition entity.cc:62
    \n-
    int level() const
    level of this element
    Definition entity.cc:94
    \n-
    void setElement(const ElementInfo &elementInfo, int subEntity)
    Definition entity.cc:78
    \n-
    PartitionType partitionType() const
    return partition type of this entity
    Definition entity.cc:40
    \n-
    Grid::template Codim< codim >::Geometry Geometry
    Definition albertagrid/entity.hh:69
    \n-
    void setEntity(const This &other)
    Definition entity.cc:87
    \n-
    const ElementInfo & elementInfo() const
    Definition albertagrid/entity.hh:130
    \n-
    Geometry geometry() const
    geometry of this entity
    Definition entity.cc:103
    \n-
    static const int dimension
    Definition albertagrid/entity.hh:57
    \n-
    const Grid & grid() const
    obtain a reference to the grid
    Definition albertagrid/entity.hh:142
    \n-
    int subEntity() const
    obtain number of the subentity within the element (in ALBERTA numbering)
    Definition albertagrid/entity.hh:148
    \n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition albertagrid/entity.hh:71
    \n-
    GeometryType type() const
    type of geometry of this entity
    Definition entity.cc:114
    \n-
    bool equals(const This &other) const
    equality of entities
    Definition entity.cc:48
    \n-
    Definition albertagrid/entity.hh:63
    \n-
    Definition albertagrid/entity.hh:185
    \n-
    Grid::Traits::template Codim< 0 >::GeometryImpl GeometryImpl
    Definition albertagrid/entity.hh:211
    \n-
    const ElementInfo & elementInfo() const
    Definition albertagrid/entity.hh:355
    \n-
    Grid::template Codim< 0 >::LocalGeometry LocalGeometry
    Definition albertagrid/entity.hh:210
    \n-
    Definition albertagrid/geometry.hh:30
    \n-
    Definition albertagrid/geometry.hh:504
    \n-
    Definition albertagrid/intersectioniterator.hh:35
    \n-
    Definition albertagrid/intersectioniterator.hh:36
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    360#ifdef DOWBM_SYMM
    \n+
    361 #undef DOWBM_SYMM
    \n+
    362#endif // DOWBM_SYMM
    \n+
    363
    \n+
    364#ifdef DOWBM_DIAG
    \n+
    365 #undef DOWBM_DIAG
    \n+
    366#endif // DOWBM_DIAG
    \n+
    367
    \n+
    368#ifdef ROW_LENGTH
    \n+
    369 #undef ROW_LENGTH
    \n+
    370#endif // ROW_LENGTH
    \n+
    371
    \n+
    372#ifdef ENTRY_USED
    \n+
    373 #undef ENTRY_USED
    \n+
    374#endif // ENTRY_USED
    \n+
    375
    \n+
    376#ifdef ENTRY_NOT_USED
    \n+
    377 #undef ENTRY_NOT_USED
    \n+
    378#endif // ENTRY_NOT_USED
    \n+
    379
    \n+
    380#ifdef UNUSED_ENTRY
    \n+
    381 #undef UNUSED_ENTRY
    \n+
    382#endif // UNUSED_ENTRY
    \n+
    383
    \n+
    384#ifdef NO_MORE_ENTRIES
    \n+
    385 #undef NO_MORE_ENTRIES
    \n+
    386#endif // NO_MORE_ENTRIES
    \n+
    387
    \n+
    388#ifdef LAGRANGE_NODES
    \n+
    389 #undef LAGRANGE_NODES
    \n+
    390#endif // LAGRANGE_NODES
    \n+
    391
    \n+
    392#ifdef MAX_N_QUAD_POINTS
    \n+
    393 #undef MAX_N_QUAD_POINTS
    \n+
    394#endif // MAX_N_QUAD_POINTS
    \n+
    395
    \n+
    396#ifdef INIT_PHI
    \n+
    397 #undef INIT_PHI
    \n+
    398#endif // INIT_PHI
    \n+
    399
    \n+
    400#ifdef INIT_GRD_PHI
    \n+
    401 #undef INIT_GRD_PHI
    \n+
    402#endif // INIT_GRD_PHI
    \n+
    403
    \n+
    404#ifdef INIT_D2_PHI
    \n+
    405 #undef INIT_D2_PHI
    \n+
    406#endif // INIT_D2_PHI
    \n+
    407
    \n+
    408#ifdef MESH_REFINED
    \n+
    409 #undef MESH_REFINED
    \n+
    410#endif // MESH_REFINED
    \n+
    411
    \n+
    412#ifdef MESH_COARSENED
    \n+
    413 #undef MESH_COARSENED
    \n+
    414#endif // MESH_COARSENED
    \n+
    415
    \n+
    416#ifdef H1_NORM
    \n+
    417 #undef H1_NORM
    \n+
    418#endif // H1_NORM
    \n+
    419
    \n+
    420#ifdef L2_NORM
    \n+
    421 #undef L2_NORM
    \n+
    422#endif // L2_NORM
    \n+
    423
    \n+
    424#ifdef GRAPH_MESH_BOUNDARY
    \n+
    425 #undef GRAPH_MESH_BOUNDARY
    \n+
    426#endif // GRAPH_MESH_BOUNDARY
    \n+
    427
    \n+
    428#ifdef GRAPH_MESH_ELEMENT_MARK
    \n+
    429 #undef GRAPH_MESH_ELEMENT_MARK
    \n+
    430#endif // GRAPH_MESH_ELEMENT_MARK
    \n+
    431
    \n+
    432#ifdef GRAPH_MESH_VERTEX_DOF
    \n+
    433 #undef GRAPH_MESH_VERTEX_DOF
    \n+
    434#endif // GRAPH_MESH_VERTEX_DOF
    \n+
    435
    \n+
    436#ifdef GRAPH_MESH_ELEMENT_INDEX
    \n+
    437 #undef GRAPH_MESH_ELEMENT_INDEX
    \n+
    438#endif // GRAPH_MESH_ELEMENT_INDEX
    \n+
    439
    \n+
    440#ifdef GET_MESH
    \n+
    441 #undef GET_MESH
    \n+
    442#endif // GET_MESH
    \n+
    443
    \n+
    444#ifdef GET_DOF_VEC
    \n+
    445 #undef GET_DOF_VEC
    \n+
    446#endif // GET_DOF_VEC
    \n+
    447
    \n+
    448#ifdef CARD_SN_MAX
    \n+
    449 #undef CARD_SN_MAX
    \n+
    450#endif // CARD_SN_MAX
    \n+
    451
    \n+
    452#ifdef INIT_UH
    \n+
    453 #undef INIT_UH
    \n+
    454#endif // INIT_UH
    \n+
    455
    \n+
    456#ifdef INIT_GRD_UH
    \n+
    457 #undef INIT_GRD_UH
    \n+
    458#endif // INIT_GRD_UH
    \n+
    459
    \n+
    460#ifdef TRAVERSE_START
    \n+
    461 #undef TRAVERSE_START
    \n+
    462#endif // TRAVERSE_START
    \n+
    463
    \n+
    464#ifdef TRAVERSE_STOP
    \n+
    465 #undef TRAVERSE_STOP
    \n+
    466#endif // TRAVERSE_STOP
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,505 +1,471 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-entity.cc\n+undefine-2.0.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_ENTITY_CC\n-6#define DUNE_ALBERTA_ENTITY_CC\n-7\n-8namespace Dune\n-9{\n-10\n-11 // AlbertaGridEntity (for codim > 0)\n-12 // ---------------------------------\n-13\n-14 template\n-15 inline AlbertaGridEntity< codim, dim, Grid >\n-16 ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int\n-subEntity )\n-17 : grid_( &grid ),\n-18 elementInfo_( elementInfo ),\n-19 subEntity_( subEntity )\n-20 {}\n-21\n-22 template\n-23 inline AlbertaGridEntity<_codim,_dim,_Grid_>\n-24_::AlbertaGridEntity ( const Grid &grid )\n-25 : grid_( &grid ),\n-26 elementInfo_(),\n-27 subEntity_( -1 )\n-28 {}\n-29\n-30 template\n-31 inline AlbertaGridEntity<_codim,_dim,_Grid_>\n-32_::AlbertaGridEntity ()\n-33 : grid_( NULL ),\n-34 elementInfo_(),\n-35 subEntity_( -1 )\n-36 {}\n-37\n-38 template< int codim, int dim, class Grid >\n-39 inline PartitionType\n-40 AlbertaGridEntity<_codim,dim,Grid_>::partitionType () const\n-41 {\n-42 return InteriorEntity;\n-43 }\n-44\n-45\n-46 template< int codim, int dim, class Grid >\n-47 inline bool\n-48 AlbertaGridEntity<_codim,_dim,_Grid_>::equals ( const This &other ) const\n-49 {\n-50 const Alberta::Element *e1 = elementInfo().el();\n-51 const Alberta::Element *e2 = other.elementInfo().el();\n-52\n-53 // if both element null then they are equal\n-54 if( (e1 == NULL) && (e2 == NULL) )\n-55 return true;\n-56 return ((e1 == e2) && (subEntity_ == other.subEntity_));\n-57 }\n-58\n+12#ifdef _ALBERTA_H_\n+13 #undef _ALBERTA_H_\n+14#endif // _ALBERTA_H_\n+15\n+16#ifdef ALBERTA_VERSION\n+17 #undef ALBERTA_VERSION\n+18#endif // ALBERTA_VERSION\n+19\n+20#ifdef ALBERTA_DEBUG\n+21 #undef ALBERTA_DEBUG\n+22#endif // ALBERTA_DEBUG\n+23\n+24#ifdef DIM_MAX\n+25 #undef DIM_MAX\n+26#endif // DIM_MAX\n+27\n+28#ifdef N_VERTICES\n+29 #undef N_VERTICES\n+30#endif // N_VERTICES\n+31\n+32#ifdef N_EDGES\n+33 #undef N_EDGES\n+34#endif // N_EDGES\n+35\n+36#ifdef N_WALLS\n+37 #undef N_WALLS\n+38#endif // N_WALLS\n+39\n+40#ifdef N_FACES\n+41 #undef N_FACES\n+42#endif // N_FACES\n+43\n+44#ifdef N_NEIGH\n+45 #undef N_NEIGH\n+46#endif // N_NEIGH\n+47\n+48#ifdef DIM_FAC\n+49 #undef DIM_FAC\n+50#endif // DIM_FAC\n+51\n+52#ifdef N_VERTICES_0D\n+53 #undef N_VERTICES_0D\n+54#endif // N_VERTICES_0D\n+55\n+56#ifdef N_EDGES_0D\n+57 #undef N_EDGES_0D\n+58#endif // N_EDGES_0D\n 59\n-60 template< int codim, int dim, class Grid >\n-61 inline ALBERTA EL_INFO *\n-62 AlbertaGridEntity<_codim,_dim,_Grid_>::getElInfo () const\n-63 {\n-64 return &(elementInfo_.elInfo());\n-65 }\n-66\n+60#ifdef N_FACES_0D\n+61 #undef N_FACES_0D\n+62#endif // N_FACES_0D\n+63\n+64#ifdef N_NEIGH_0D\n+65 #undef N_NEIGH_0D\n+66#endif // N_NEIGH_0D\n 67\n-68 template< int codim, int dim, class Grid >\n-69 inline void\n-70 AlbertaGridEntity<_codim,_dim,_Grid_>::clearElement ()\n-71 {\n-72 elementInfo_ = ElementInfo();\n-73 }\n-74\n+68#ifdef N_WALLS_0D\n+69 #undef N_WALLS_0D\n+70#endif // N_WALLS_0D\n+71\n+72#ifdef N_VERTICES_1D\n+73 #undef N_VERTICES_1D\n+74#endif // N_VERTICES_1D\n 75\n-76 template< int codim, int dim, class Grid >\n-77 inline void AlbertaGridEntity<_codim,_dim,_Grid_>\n-78_::setElement ( const ElementInfo &elementInfo, int subEntity )\n-79 {\n-80 elementInfo_ = elementInfo;\n-81 subEntity_ = subEntity;\n-82 }\n+76#ifdef N_EDGES_1D\n+77 #undef N_EDGES_1D\n+78#endif // N_EDGES_1D\n+79\n+80#ifdef N_FACES_1D\n+81 #undef N_FACES_1D\n+82#endif // N_FACES_1D\n 83\n-84\n-85 template< int codim, int dim, class Grid >\n-86 inline void\n-87 AlbertaGridEntity<_codim,_dim,_Grid_>::setEntity ( const This &other )\n-88 {\n-89 setElement( other.elementInfo_, other.subEntity_ );\n-90 }\n+84#ifdef N_NEIGH_1D\n+85 #undef N_NEIGH_1D\n+86#endif // N_NEIGH_1D\n+87\n+88#ifdef N_WALLS_1D\n+89 #undef N_WALLS_1D\n+90#endif // N_WALLS_1D\n 91\n-92\n-93 template< int codim, int dim, class Grid >\n-94 inline int AlbertaGridEntity<_codim,_dim,_Grid_>::level() const\n-95 {\n-96 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );\n-97 return elementInfo_.level();\n-98 }\n+92#ifdef N_VERTICES_2D\n+93 #undef N_VERTICES_2D\n+94#endif // N_VERTICES_2D\n+95\n+96#ifdef N_EDGES_2D\n+97 #undef N_EDGES_2D\n+98#endif // N_EDGES_2D\n 99\n-100\n-101 template< int codim, int dim, class Grid >\n-102 inline typename AlbertaGridEntity<_codim,_dim,_Grid_>::Geometry\n-103 AlbertaGridEntity<_codim,_dim,_Grid_>::geometry () const\n-104 {\n-105 typedef AlbertaGridCoordinateReader<_codim,_Grid_> CoordReader;\n-106\n-107 assert( elementInfo_ );\n-108 const CoordReader coordReader( grid(), elementInfo_, subEntity_ );\n-109 return Geometry( GeometryImpl( coordReader ) );\n-110 }\n+100#ifdef N_FACES_2D\n+101 #undef N_FACES_2D\n+102#endif // N_FACES_2D\n+103\n+104#ifdef N_NEIGH_2D\n+105 #undef N_NEIGH_2D\n+106#endif // N_NEIGH_2D\n+107\n+108#ifdef N_WALLS_2D\n+109 #undef N_WALLS_2D\n+110#endif // N_WALLS_2D\n 111\n-112\n-113 template< int codim, int dim, class Grid >\n-114 inline GeometryType AlbertaGridEntity<_codim,_dim,_Grid_>::type () const\n-115 {\n-116 return GeometryTypes::simplex( mydimension );\n-117 }\n-118\n+112#ifdef N_VERTICES_3D\n+113 #undef N_VERTICES_3D\n+114#endif // N_VERTICES_3D\n+115\n+116#ifdef N_EDGES_3D\n+117 #undef N_EDGES_3D\n+118#endif // N_EDGES_3D\n 119\n-120\n-121 // AlbertaGridEntity (for codim = 0)\n-122 // ---------------------------------\n+120#ifdef N_FACES_3D\n+121 #undef N_FACES_3D\n+122#endif // N_FACES_3D\n 123\n-124 template< int dim, class Grid >\n-125 inline AlbertaGridEntity<_0,_dim,_Grid_>\n-126_::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int\n-subEntity )\n-127 : grid_( &grid ),\n-128 elementInfo_( elementInfo )\n-129 {\n-130 assert( subEntity == 0 );\n-131 }\n-132\n-133 template< int dim, class Grid >\n-134 inline AlbertaGridEntity<_0,_dim,_Grid_>\n-135_::AlbertaGridEntity( const Grid &grid )\n-136 : grid_( &grid ),\n-137 elementInfo_()\n-138 {}\n+124#ifdef N_NEIGH_3D\n+125 #undef N_NEIGH_3D\n+126#endif // N_NEIGH_3D\n+127\n+128#ifdef N_WALLS_3D\n+129 #undef N_WALLS_3D\n+130#endif // N_WALLS_3D\n+131\n+132#ifdef N_VERTICES_MAX\n+133 #undef N_VERTICES_MAX\n+134#endif // N_VERTICES_MAX\n+135\n+136#ifdef N_EDGES_MAX\n+137 #undef N_EDGES_MAX\n+138#endif // N_EDGES_MAX\n 139\n-140 template< int dim, class Grid >\n-141 inline AlbertaGridEntity<_0,_dim,_Grid_>\n-142_::AlbertaGridEntity ()\n-143 : grid_( NULL ),\n-144 elementInfo_()\n-145 {}\n-146\n+140#ifdef N_FACES_MAX\n+141 #undef N_FACES_MAX\n+142#endif // N_FACES_MAX\n+143\n+144#ifdef N_NEIGH_MAX\n+145 #undef N_NEIGH_MAX\n+146#endif // N_NEIGH_MAX\n 147\n-148 template< int dim, class Grid >\n-149 inline int AlbertaGridEntity<_0,_dim,_Grid_>::boundaryId() const\n-150 {\n-151 // elements are always inside of our Domain\n-152 return 0;\n-153 }\n-154\n+148#ifdef N_WALLS_MAX\n+149 #undef N_WALLS_MAX\n+150#endif // N_WALLS_MAX\n+151\n+152#ifdef N_LAMBDA\n+153 #undef N_LAMBDA\n+154#endif // N_LAMBDA\n 155\n-156 template< int dim, class Grid >\n-157 inline bool AlbertaGridEntity<_0,_dim,_Grid_>::isNew () const\n-158 {\n-159 return grid().levelProvider().isNew( elementInfo_ );\n-160 }\n-161\n-162\n-163 template< int dim, class Grid >\n-164 inline bool AlbertaGridEntity<_0,_dim,_Grid_>::mightVanish () const\n-165 {\n-166 return elementInfo_.mightVanish();\n-167 }\n-168\n-169\n-170 template< int dim, class Grid >\n-171 inline bool\n-172 AlbertaGridEntity<_0,_dim,_Grid_>::hasBoundaryIntersections () const\n-173 {\n-174 assert( elementInfo_ );\n-175 bool isBoundary = false;\n-176 for( int i = 0; i < dim+1; ++i )\n-177 isBoundary |= elementInfo_.isBoundary( i );\n-178 return isBoundary;\n-179 }\n-180\n-181\n-182 template< int dim, class Grid >\n-183 inline PartitionType\n-184 AlbertaGridEntity<_0,_dim,_Grid_>::partitionType () const\n-185 {\n-186 return InteriorEntity;\n-187 }\n-188\n-189\n-190 template< int dim, class Grid >\n-191 inline bool AlbertaGridEntity<_0,_dim,Grid_>::isLeaf () const\n-192 {\n-193 return elementInfo_.isLeaf();\n-194 }\n+156#ifdef LAMBDA_MAX\n+157 #undef LAMBDA_MAX\n+158#endif // LAMBDA_MAX\n+159\n+160#ifdef INDEX\n+161 #undef INDEX\n+162#endif // INDEX\n+163\n+164#ifdef INDEX\n+165 #undef INDEX\n+166#endif // INDEX\n+167\n+168#ifdef IS_LEAF_EL\n+169 #undef IS_LEAF_EL\n+170#endif // IS_LEAF_EL\n+171\n+172#ifdef LEAF_DATA\n+173 #undef LEAF_DATA\n+174#endif // LEAF_DATA\n+175\n+176#ifdef INTERIOR\n+177 #undef INTERIOR\n+178#endif // INTERIOR\n+179\n+180#ifdef DIRICHLET\n+181 #undef DIRICHLET\n+182#endif // DIRICHLET\n+183\n+184#ifdef NEUMANN\n+185 #undef NEUMANN\n+186#endif // NEUMANN\n+187\n+188#ifdef IS_NEUMANN\n+189 #undef IS_NEUMANN\n+190#endif // IS_NEUMANN\n+191\n+192#ifdef IS_DIRICHLET\n+193 #undef IS_DIRICHLET\n+194#endif // IS_DIRICHLET\n 195\n-196\n-197 template< int dim, class Grid >\n-198 inline bool\n-199 AlbertaGridEntity<_0,_dim,_Grid_>::equals ( const This &other ) const\n-200 {\n-201 // element pointers are unique\n-202 return (elementInfo().el() == other.elementInfo().el());\n-203 }\n-204\n-205\n-206 template< int dim, class Grid >\n-207 template< int codim >\n-208 inline typename Grid::template Codim< codim >::Entity\n-209 AlbertaGridEntity<_0,_dim,_Grid_>::subEntity ( int i ) const\n-210 {\n-211 typedef AlbertaGridEntity<_codim,_dim,_Grid_> EntityImpl;\n-212 return EntityImpl( grid(), elementInfo_, grid().generic2alberta( codim, i )\n-);\n-213 }\n-214\n+196#ifdef IS_INTERIOR\n+197 #undef IS_INTERIOR\n+198#endif // IS_INTERIOR\n+199\n+200#ifdef N_NODE_TYPES\n+201 #undef N_NODE_TYPES\n+202#endif // N_NODE_TYPES\n+203\n+204#ifdef VERTEX\n+205 #undef VERTEX\n+206#endif // VERTEX\n+207\n+208#ifdef CENTER\n+209 #undef CENTER\n+210#endif // CENTER\n+211\n+212#ifdef EDGE\n+213 #undef EDGE\n+214#endif // EDGE\n 215\n-216 template< int dim, class Grid >\n-217 inline ALBERTA EL_INFO *\n-218 AlbertaGridEntity<_0,_dim,_Grid_>::getElInfo () const\n-219 {\n-220 return &(elementInfo_.elInfo());\n-221 }\n-222\n+216#ifdef FACE\n+217 #undef FACE\n+218#endif // FACE\n+219\n+220#ifdef LIST_ENTRY\n+221 #undef LIST_ENTRY\n+222#endif // LIST_ENTRY\n 223\n-224 template< int dim, class Grid >\n-225 inline int AlbertaGridEntity<_0,_dim,_Grid_>::level () const\n-226 {\n-227 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );\n-228 return elementInfo_.level();\n-229 }\n-230\n+224#ifdef WALL_BOUND\n+225 #undef WALL_BOUND\n+226#endif // WALL_BOUND\n+227\n+228#ifdef FILL_NOTHING\n+229 #undef FILL_NOTHING\n+230#endif // FILL_NOTHING\n 231\n-232 template< int dim, class Grid >\n-233 inline void\n-234 AlbertaGridEntity<_0,_dim,_Grid_>::clearElement ()\n-235 {\n-236 elementInfo_ = ElementInfo();\n-237 }\n-238\n+232#ifdef FILL_COORDS\n+233 #undef FILL_COORDS\n+234#endif // FILL_COORDS\n+235\n+236#ifdef FILL_BOUND\n+237 #undef FILL_BOUND\n+238#endif // FILL_BOUND\n 239\n-240 template< int dim, class Grid >\n-241 inline void AlbertaGridEntity<_0,_dim,_Grid_>\n-242_::setElement ( const ElementInfo &elementInfo, int /* subEntity */ )\n-243 {\n-244 elementInfo_ = elementInfo;\n-245 }\n-246\n+240#ifdef FILL_NEIGH\n+241 #undef FILL_NEIGH\n+242#endif // FILL_NEIGH\n+243\n+244#ifdef FILL_OPP_COORDS\n+245 #undef FILL_OPP_COORDS\n+246#endif // FILL_OPP_COORDS\n 247\n-248 template< int dim, class Grid >\n-249 inline void\n-250 AlbertaGridEntity<_0,_dim,_Grid_>::setEntity( const This &other )\n-251 {\n-252 setElement( other.elementInfo_, 0 );\n-253 }\n-254\n+248#ifdef FILL_ORIENTATION\n+249 #undef FILL_ORIENTATION\n+250#endif // FILL_ORIENTATION\n+251\n+252#ifdef FILL_EL_TYPE\n+253 #undef FILL_EL_TYPE\n+254#endif // FILL_EL_TYPE\n 255\n-256 template< int dim, class Grid >\n-257 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::Geometry\n-258 AlbertaGridEntity<_0,_dim,_Grid_>::geometry () const\n-259 {\n-260 typedef AlbertaGridCoordinateReader<_0,_Grid_> CoordReader;\n-261\n-262 assert( elementInfo_ );\n-263 const CoordReader coordReader( grid(), elementInfo_, 0 );\n-264 return Geometry( GeometryImpl( coordReader ) );\n-265 }\n-266\n+256#ifdef FILL_PROJECTION\n+257 #undef FILL_PROJECTION\n+258#endif // FILL_PROJECTION\n+259\n+260#ifdef FILL_ANY\n+261 #undef FILL_ANY\n+262#endif // FILL_ANY\n+263\n+264#ifdef HOOK_QUEUE_OFFSET\n+265 #undef HOOK_QUEUE_OFFSET\n+266#endif // HOOK_QUEUE_OFFSET\n 267\n-268 template< int dim, class Grid >\n-269 inline GeometryType AlbertaGridEntity<_0,_dim,_Grid>::type () const\n-270 {\n-271 return GeometryTypes::simplex( mydimension );\n-272 }\n-273\n-274\n-275 template< int dim, class Grid >\n-276 inline typename Grid::template Codim< 0 >::Entity\n-277 AlbertaGridEntity<_0,_dim,_Grid_>::father () const\n-278 {\n-279 typedef AlbertaGridEntity<_0,_dim,_Grid_> EntityImpl;\n-280\n-281 assert( elementInfo_ );\n-282 const ElementInfo fatherInfo = elementInfo_.father();\n+268#ifdef RUN_HOOKS_0\n+269 #undef RUN_HOOKS_0\n+270#endif // RUN_HOOKS_0\n+271\n+272#ifdef RUN_BAS_FCTS_HOOKS\n+273 #undef RUN_BAS_FCTS_HOOKS\n+274#endif // RUN_BAS_FCTS_HOOKS\n+275\n+276#ifdef RUN_HOOKS_1\n+277 #undef RUN_HOOKS_1\n+278#endif // RUN_HOOKS_1\n+279\n+280#ifdef RUN_HOOKS_2\n+281 #undef RUN_HOOKS_2\n+282#endif // RUN_HOOKS_2\n 283\n-284 return EntityImpl( grid(), fatherInfo, 0 );\n-285 }\n-286\n+284#ifdef RUN_HOOKS_3\n+285 #undef RUN_HOOKS_3\n+286#endif // RUN_HOOKS_3\n 287\n-288 template< int dim, class Grid >\n-289 inline int AlbertaGridEntity<_0,_dim,_Grid_>::nChild () const\n-290 {\n-291 return elementInfo_.indexInFather();\n-292 }\n-293\n-294\n-295 template< int dim, class Grid >\n-296 inline typename AlbertaGridEntity< 0, dim, Grid >::LocalGeometry\n-297 AlbertaGridEntity<_0,_dim,_Grid_>::geometryInFather() const\n-298 {\n-299 typedef AlbertaGridLocalGeometryProvider<_Grid_> LocalGeoProvider;\n-300 const int indexInFather = elementInfo_.indexInFather();\n-301 const int orientation = (elementInfo_.type() == 1 ? -1 : 1);\n-302 return LocalGeometry( LocalGeoProvider::instance().geometryInFather\n-( indexInFather, orientation ) );\n-303 }\n-304\n-305\n-306 template< int dim, class Grid >\n-307 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::HierarchicIterator\n-308 AlbertaGridEntity<_0,_dim,_Grid_>::hbegin( int maxlevel ) const\n-309 {\n-310 assert( elementInfo_ );\n-311 typedef AlbertaGridHierarchicIterator<_Grid_> IteratorImp;\n-312 return IteratorImp( grid(), elementInfo_, maxlevel );\n-313 }\n-314\n+288#ifdef RUN_HOOKS_4\n+289 #undef RUN_HOOKS_4\n+290#endif // RUN_HOOKS_4\n+291\n+292#ifdef RUN_HOOKS_5\n+293 #undef RUN_HOOKS_5\n+294#endif // RUN_HOOKS_5\n+295\n+296#ifdef RUN_HOOKS_6\n+297 #undef RUN_HOOKS_6\n+298#endif // RUN_HOOKS_6\n+299\n+300#ifdef RUN_HOOKS_7\n+301 #undef RUN_HOOKS_7\n+302#endif // RUN_HOOKS_7\n+303\n+304#ifdef CALL_EVERY_EL_PREORDER\n+305 #undef CALL_EVERY_EL_PREORDER\n+306#endif // CALL_EVERY_EL_PREORDER\n+307\n+308#ifdef CALL_EVERY_EL_INORDER\n+309 #undef CALL_EVERY_EL_INORDER\n+310#endif // CALL_EVERY_EL_INORDER\n+311\n+312#ifdef CALL_EVERY_EL_POSTORDER\n+313 #undef CALL_EVERY_EL_POSTORDER\n+314#endif // CALL_EVERY_EL_POSTORDER\n 315\n-316 template< int dim, class Grid >\n-317 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::HierarchicIterator\n-318 AlbertaGridEntity<_0,_dim,_Grid>::hend( int maxlevel ) const\n-319 {\n-320 assert( elementInfo_ );\n-321 typedef AlbertaGridHierarchicIterator<_Grid_> IteratorImp;\n-322 return IteratorImp( grid(), level(), maxlevel );\n-323 }\n-324\n-325\n-326 template< int dim, class Grid >\n-327 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::\n-AlbertaGridLeafIntersectionIterator\n-328 AlbertaGridEntity<_0,_dim,_Grid_>::ileafbegin() const\n-329 {\n-330 assert( elementInfo_ );\n+316#ifdef CALL_LEAF_EL\n+317 #undef CALL_LEAF_EL\n+318#endif // CALL_LEAF_EL\n+319\n+320#ifdef CALL_LEAF_EL_LEVEL\n+321 #undef CALL_LEAF_EL_LEVEL\n+322#endif // CALL_LEAF_EL_LEVEL\n+323\n+324#ifdef CALL_EL_LEVEL\n+325 #undef CALL_EL_LEVEL\n+326#endif // CALL_EL_LEVEL\n+327\n+328#ifdef CALL_MG_LEVEL\n+329 #undef CALL_MG_LEVEL\n+330#endif // CALL_MG_LEVEL\n 331\n-332#ifndef NDEBUG\n-333 for( int i = 0; i <= dimension; ++i )\n-334 {\n-335 // std::cout << \"Opposite vertex \" << i << \": \"\n-336 // << (int)(getElInfo()->opp_vertex[ i ]) << std::endl;\n-337 if( getElInfo()->opp_vertex[ i ] == 127 )\n-338 {\n-339 assert( false );\n-340 DUNE_THROW( NotImplemented, \"AlbertaGrid: Intersections on outside \"\n-341 \"entities are not fully implemented, yet.\" );\n-342 }\n-343 }\n-344#endif // #ifndef NDEBUG\n-345\n-346 typename AlbertaGridLeafIntersectionIterator::Begin begin;\n-347 return AlbertaGridLeafIntersectionIterator( *this, begin );\n-348 }\n-349\n-350\n-351 template< int dim, class Grid >\n-352 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::\n-AlbertaGridLeafIntersectionIterator\n-353 AlbertaGridEntity<_0,_dim,_Grid_>::ileafend() const\n-354 {\n-355 assert( elementInfo_ );\n-356 typename AlbertaGridLeafIntersectionIterator::End end;\n-357 return AlbertaGridLeafIntersectionIterator( *this, end );\n-358 }\n+332#ifdef TEST_FLAG\n+333 #undef TEST_FLAG\n+334#endif // TEST_FLAG\n+335\n+336#ifdef DOF_ADMIN_DEF\n+337 #undef DOF_ADMIN_DEF\n+338#endif // DOF_ADMIN_DEF\n+339\n+340#ifdef DOF_FREE_SIZE\n+341 #undef DOF_FREE_SIZE\n+342#endif // DOF_FREE_SIZE\n+343\n+344#ifdef DOF_UNIT_ALL_FREE\n+345 #undef DOF_UNIT_ALL_FREE\n+346#endif // DOF_UNIT_ALL_FREE\n+347\n+348#ifdef FOR_ALL_DOFS\n+349 #undef FOR_ALL_DOFS\n+350#endif // FOR_ALL_DOFS\n+351\n+352#ifdef FOR_ALL_FREE_DOFS\n+353 #undef FOR_ALL_FREE_DOFS\n+354#endif // FOR_ALL_FREE_DOFS\n+355\n+356#ifdef DOWBM_FULL\n+357 #undef DOWBM_FULL\n+358#endif // DOWBM_FULL\n 359\n-360} // namespace Dune\n-361\n-362#endif // #ifndef DUNE_ALBERTA_ENTITY_CC\n-ALBERTA\n-#define ALBERTA\n-Definition albertaheader.hh:29\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-Dune::InteriorEntity\n-@ InteriorEntity\n-all interior entities\n-Definition gridenums.hh:31\n-Dune\n-Include standard header files.\n-Definition agrid.hh:60\n-Dune::Alberta::Element\n-ALBERTA EL Element\n-Definition misc.hh:54\n-Dune::Alberta::ElementInfo<_dimension_>\n-Dune::Alberta::ElementInfo::level\n-int level() const\n-Definition elementinfo.hh:533\n-Dune::Alberta::ElementInfo::mightVanish\n-bool mightVanish() const\n-Definition elementinfo.hh:526\n-Dune::Alberta::ElementInfo::father\n-ElementInfo father() const\n-Definition elementinfo.hh:449\n-Dune::Alberta::ElementInfo::type\n-int type() const\n-Definition elementinfo.hh:540\n-Dune::Alberta::ElementInfo::isBoundary\n-bool isBoundary(int face) const\n-Definition elementinfo.hh:620\n-Dune::Alberta::ElementInfo::indexInFather\n-int indexInFather() const\n-Definition elementinfo.hh:457\n-Dune::Alberta::ElementInfo::elInfo\n-ALBERTA EL_INFO & elInfo() const\n-Definition elementinfo.hh:744\n-Dune::AlbertaGridHierarchicIterator\n-Definition hierarchiciterator.hh:29\n-Dune::AlbertaGridLeafIntersectionIterator\n-Definition albertagrid/intersectioniterator.hh:27\n-Dune::AlbertaGridEntity\n-Definition albertagrid/entity.hh:46\n-Dune::AlbertaGridEntity::clearElement\n-void clearElement()\n-Definition entity.cc:70\n-Dune::AlbertaGridEntity::getElInfo\n-ALBERTA EL_INFO * getElInfo() const\n-needed for the LevelIterator and LeafIterator\n-Definition entity.cc:62\n-Dune::AlbertaGridEntity::level\n-int level() const\n-level of this element\n-Definition entity.cc:94\n-Dune::AlbertaGridEntity::setElement\n-void setElement(const ElementInfo &elementInfo, int subEntity)\n-Definition entity.cc:78\n-Dune::AlbertaGridEntity::partitionType\n-PartitionType partitionType() const\n-return partition type of this entity\n-Definition entity.cc:40\n-Dune::AlbertaGridEntity::Geometry\n-Grid::template Codim< codim >::Geometry Geometry\n-Definition albertagrid/entity.hh:69\n-Dune::AlbertaGridEntity::setEntity\n-void setEntity(const This &other)\n-Definition entity.cc:87\n-Dune::AlbertaGridEntity::elementInfo\n-const ElementInfo & elementInfo() const\n-Definition albertagrid/entity.hh:130\n-Dune::AlbertaGridEntity::geometry\n-Geometry geometry() const\n-geometry of this entity\n-Definition entity.cc:103\n-Dune::AlbertaGridEntity::dimension\n-static const int dimension\n-Definition albertagrid/entity.hh:57\n-Dune::AlbertaGridEntity::grid\n-const Grid & grid() const\n-obtain a reference to the grid\n-Definition albertagrid/entity.hh:142\n-Dune::AlbertaGridEntity::subEntity\n-int subEntity() const\n-obtain number of the subentity within the element (in ALBERTA numbering)\n-Definition albertagrid/entity.hh:148\n-Dune::AlbertaGridEntity::ElementInfo\n-Alberta::ElementInfo< dimension > ElementInfo\n-Definition albertagrid/entity.hh:71\n-Dune::AlbertaGridEntity::type\n-GeometryType type() const\n-type of geometry of this entity\n-Definition entity.cc:114\n-Dune::AlbertaGridEntity::equals\n-bool equals(const This &other) const\n-equality of entities\n-Definition entity.cc:48\n-Dune::AlbertaGridEntity::Codim\n-Definition albertagrid/entity.hh:63\n-Dune::AlbertaGridEntity<_0,_dim,_Grid_>\n-Definition albertagrid/entity.hh:185\n-Dune::AlbertaGridEntity<_0,_dim,_Grid_>::GeometryImpl\n-Grid::Traits::template Codim< 0 >::GeometryImpl GeometryImpl\n-Definition albertagrid/entity.hh:211\n-Dune::AlbertaGridEntity<_0,_dim,_Grid_>::elementInfo\n-const ElementInfo & elementInfo() const\n-Definition albertagrid/entity.hh:355\n-Dune::AlbertaGridEntity<_0,_dim,_Grid_>::LocalGeometry\n-Grid::template Codim< 0 >::LocalGeometry LocalGeometry\n-Definition albertagrid/entity.hh:210\n-Dune::AlbertaGridCoordinateReader\n-Definition albertagrid/geometry.hh:30\n-Dune::AlbertaGridLocalGeometryProvider\n-Definition albertagrid/geometry.hh:504\n-Dune::AlbertaGridLeafIntersectionIterator::Begin\n-Definition albertagrid/intersectioniterator.hh:35\n-Dune::AlbertaGridLeafIntersectionIterator::End\n-Definition albertagrid/intersectioniterator.hh:36\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n+360#ifdef DOWBM_SYMM\n+361 #undef DOWBM_SYMM\n+362#endif // DOWBM_SYMM\n+363\n+364#ifdef DOWBM_DIAG\n+365 #undef DOWBM_DIAG\n+366#endif // DOWBM_DIAG\n+367\n+368#ifdef ROW_LENGTH\n+369 #undef ROW_LENGTH\n+370#endif // ROW_LENGTH\n+371\n+372#ifdef ENTRY_USED\n+373 #undef ENTRY_USED\n+374#endif // ENTRY_USED\n+375\n+376#ifdef ENTRY_NOT_USED\n+377 #undef ENTRY_NOT_USED\n+378#endif // ENTRY_NOT_USED\n+379\n+380#ifdef UNUSED_ENTRY\n+381 #undef UNUSED_ENTRY\n+382#endif // UNUSED_ENTRY\n+383\n+384#ifdef NO_MORE_ENTRIES\n+385 #undef NO_MORE_ENTRIES\n+386#endif // NO_MORE_ENTRIES\n+387\n+388#ifdef LAGRANGE_NODES\n+389 #undef LAGRANGE_NODES\n+390#endif // LAGRANGE_NODES\n+391\n+392#ifdef MAX_N_QUAD_POINTS\n+393 #undef MAX_N_QUAD_POINTS\n+394#endif // MAX_N_QUAD_POINTS\n+395\n+396#ifdef INIT_PHI\n+397 #undef INIT_PHI\n+398#endif // INIT_PHI\n+399\n+400#ifdef INIT_GRD_PHI\n+401 #undef INIT_GRD_PHI\n+402#endif // INIT_GRD_PHI\n+403\n+404#ifdef INIT_D2_PHI\n+405 #undef INIT_D2_PHI\n+406#endif // INIT_D2_PHI\n+407\n+408#ifdef MESH_REFINED\n+409 #undef MESH_REFINED\n+410#endif // MESH_REFINED\n+411\n+412#ifdef MESH_COARSENED\n+413 #undef MESH_COARSENED\n+414#endif // MESH_COARSENED\n+415\n+416#ifdef H1_NORM\n+417 #undef H1_NORM\n+418#endif // H1_NORM\n+419\n+420#ifdef L2_NORM\n+421 #undef L2_NORM\n+422#endif // L2_NORM\n+423\n+424#ifdef GRAPH_MESH_BOUNDARY\n+425 #undef GRAPH_MESH_BOUNDARY\n+426#endif // GRAPH_MESH_BOUNDARY\n+427\n+428#ifdef GRAPH_MESH_ELEMENT_MARK\n+429 #undef GRAPH_MESH_ELEMENT_MARK\n+430#endif // GRAPH_MESH_ELEMENT_MARK\n+431\n+432#ifdef GRAPH_MESH_VERTEX_DOF\n+433 #undef GRAPH_MESH_VERTEX_DOF\n+434#endif // GRAPH_MESH_VERTEX_DOF\n+435\n+436#ifdef GRAPH_MESH_ELEMENT_INDEX\n+437 #undef GRAPH_MESH_ELEMENT_INDEX\n+438#endif // GRAPH_MESH_ELEMENT_INDEX\n+439\n+440#ifdef GET_MESH\n+441 #undef GET_MESH\n+442#endif // GET_MESH\n+443\n+444#ifdef GET_DOF_VEC\n+445 #undef GET_DOF_VEC\n+446#endif // GET_DOF_VEC\n+447\n+448#ifdef CARD_SN_MAX\n+449 #undef CARD_SN_MAX\n+450#endif // CARD_SN_MAX\n+451\n+452#ifdef INIT_UH\n+453 #undef INIT_UH\n+454#endif // INIT_UH\n+455\n+456#ifdef INIT_GRD_UH\n+457 #undef INIT_GRD_UH\n+458#endif // INIT_GRD_UH\n+459\n+460#ifdef TRAVERSE_START\n+461 #undef TRAVERSE_START\n+462#endif // TRAVERSE_START\n+463\n+464#ifdef TRAVERSE_STOP\n+465 #undef TRAVERSE_STOP\n+466#endif // TRAVERSE_STOP\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00635.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00635.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: level.hh File Reference\n+dune-grid: leveliterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,34 +72,27 @@\n
  • dune
  • grid
  • albertagrid
  • \n
    \n
    \n
    \n \n-
    level.hh File Reference
    \n+
    leveliterator.hh File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <cstdlib>
    \n-#include <dune/grid/albertagrid/meshpointer.hh>
    \n-#include <dune/grid/albertagrid/dofadmin.hh>
    \n-#include <dune/grid/albertagrid/dofvector.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::AlbertaGridLevelProvider< dim >
    class  Dune::AlbertaGridLevelIterator< codim, pitype, GridImp >
     
    class  Dune::AlbertaGridLevelProvider< dim >::SetLocal
     
    class  Dune::AlbertaGridLevelProvider< dim >::CalcMaxLevel
     
    struct  Dune::AlbertaGridLevelProvider< dim >::Interpolation
    class  Dune::AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp >
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,22 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n Classes | Namespaces\n-level.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+leveliterator.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::AlbertaGridLevelProvider<_dim_>\n+class \u00a0 Dune::AlbertaGridLevelIterator<_codim,_pitype,_GridImp_>\n \u00a0\n- class \u00a0 Dune::AlbertaGridLevelProvider<_dim_>::SetLocal\n-\u00a0\n- class \u00a0 Dune::AlbertaGridLevelProvider<_dim_>::CalcMaxLevel\n-\u00a0\n-struct \u00a0 Dune::AlbertaGridLevelProvider<_dim_>::Interpolation\n+class \u00a0 Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00635_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00635_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: level.hh Source File\n+dune-grid: leveliterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,327 +74,145 @@\n \n \n \n
    \n-
    level.hh
    \n+
    leveliterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_LEVEL_HH
    \n-
    6#define DUNE_ALBERTA_LEVEL_HH
    \n+
    5#ifndef DUNE_ALBERTA_LEVELITERATOR_HH
    \n+
    6#define DUNE_ALBERTA_LEVELITERATOR_HH
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9#include <cstdlib>
    \n-
    10
    \n-\n-\n-\n-
    14
    \n-
    15#if HAVE_ALBERTA
    \n+\n+
    9
    \n+\n+
    11
    \n+
    12#if HAVE_ALBERTA
    \n+
    13
    \n+
    14namespace Dune
    \n+
    15{
    \n
    16
    \n-
    17namespace Dune
    \n-
    18{
    \n+
    17 // AlbertaGridLevelIterator
    \n+
    18 // ------------------------
    \n
    19
    \n-
    20 // AlbertaGridLevelProvider
    \n-
    21 // ------------------------
    \n-
    22
    \n-
    23 template< int dim >
    \n-
    \n-\n-
    25 {
    \n-\n-
    27
    \n-
    28 typedef unsigned char Level;
    \n-
    29
    \n-\n-\n-
    32
    \n-\n-
    34
    \n-
    35 static const Level isNewFlag = (1 << 7);
    \n-
    36 static const Level levelMask = (1 << 7) - 1;
    \n-
    37
    \n-
    38 class SetLocal;
    \n-
    39 class CalcMaxLevel;
    \n-
    40
    \n-
    41 template< Level flags >
    \n-
    42 struct ClearFlags;
    \n-
    43
    \n-
    44 struct Interpolation;
    \n+
    20 template< int codim, PartitionIteratorType pitype, class GridImp >
    \n+
    \n+\n+
    22 : public AlbertaGridTreeIterator< codim, GridImp, false >
    \n+
    23 {
    \n+\n+\n+
    26
    \n+
    27 public:
    \n+
    28 typedef typename Base::Entity Entity;
    \n+\n+
    30
    \n+
    \n+\n+
    32 {}
    \n+
    \n+
    33
    \n+
    \n+
    35 AlbertaGridLevelIterator ( const GridImp &grid, int level )
    \n+
    36 : Base( grid, level )
    \n+
    37 {}
    \n+
    \n+
    38
    \n+
    \n+\n+
    41 const MarkerVector *vec,
    \n+
    42 int level )
    \n+
    43 : Base( grid, vec, level )
    \n+
    44 {}
    \n+
    \n
    45
    \n-
    46 public:
    \n-\n-\n-\n-
    50
    \n-
    \n-
    51 Level operator() ( const Alberta::Element *element ) const
    \n-
    52 {
    \n-
    53 const Level *array = (Level *)level_;
    \n-
    54 return array[ dofAccess_( element, 0 ) ] & levelMask;
    \n-
    55 }
    \n-
    \n-
    56
    \n-
    \n-
    57 Level operator() ( const ElementInfo &elementInfo ) const
    \n-
    58 {
    \n-
    59 return (*this)( elementInfo.el() );
    \n-
    60 }
    \n-
    \n-
    61
    \n-
    \n-
    62 bool isNew ( const Alberta::Element *element ) const
    \n-
    63 {
    \n-
    64 const Level *array = (Level *)level_;
    \n-
    65 return ((array[ dofAccess_( element, 0 ) ] & isNewFlag) != 0);
    \n-
    66 }
    \n+
    \n+
    47 void increment ()
    \n+
    48 {
    \n+\n+
    50 }
    \n+
    \n+
    51 };
    \n+
    \n+
    52
    \n+
    53
    \n+
    54 template< int codim, class GridImp >
    \n+
    \n+\n+
    56 : public AlbertaGridTreeIterator< codim, GridImp, false >
    \n+
    57 {
    \n+\n+\n+
    60
    \n+
    61 public:
    \n+
    62 typedef typename Base::Entity Entity;
    \n+\n+
    64
    \n+
    \n+\n+
    66 {}
    \n
    \n
    67
    \n-
    \n-
    68 bool isNew ( const ElementInfo &elementInfo ) const
    \n-
    69 {
    \n-
    70 return isNew( elementInfo.el() );
    \n-
    71 }
    \n+
    \n+
    69 AlbertaGridLevelIterator ( const GridImp &grid, int level )
    \n+
    70 : Base( grid, level )
    \n+
    71 {}
    \n
    \n
    72
    \n-
    \n-
    73 Level maxLevel () const
    \n-
    74 {
    \n-
    75 CalcMaxLevel calcFromCache;
    \n-
    76 level_.forEach( calcFromCache );
    \n-
    77#ifndef NDEBUG
    \n-
    78 CalcMaxLevel calcFromGrid;
    \n-
    79 mesh().leafTraverse( calcFromGrid, FillFlags::nothing );
    \n-
    80 assert( calcFromCache.maxLevel() == calcFromGrid.maxLevel() );
    \n-
    81#endif
    \n-
    82 return calcFromCache.maxLevel();;
    \n-
    83 }
    \n-
    \n-
    84
    \n-
    \n-\n-
    86 {
    \n-
    87 return MeshPointer( level_.dofSpace()->mesh );
    \n-
    88 }
    \n-
    \n+
    \n+\n+
    75 const MarkerVector *,
    \n+
    76 int level )
    \n+
    77 : Base( grid, level )
    \n+
    78 {}
    \n+
    \n+
    79
    \n+
    \n+
    81 void increment ()
    \n+
    82 {
    \n+\n+
    84 }
    \n+
    \n+
    85 };
    \n+
    \n+
    86}
    \n+
    87
    \n+
    88#endif // #if HAVE_ALBERTA
    \n
    89
    \n-
    \n-
    90 void markAllOld ()
    \n-
    91 {
    \n-
    92 ClearFlags< isNewFlag > clearIsNew;
    \n-
    93 level_.forEach( clearIsNew );
    \n-
    94 }
    \n-
    \n-
    95
    \n-
    \n-
    96 void create ( const DofNumbering &dofNumbering )
    \n-
    97 {
    \n-
    98 const Alberta::DofSpace *const dofSpace = dofNumbering.dofSpace( 0 );
    \n-
    99 dofAccess_ = DofAccess( dofSpace );
    \n-
    100
    \n-
    101 level_.create( dofSpace, "Element level" );
    \n-
    102 assert( level_ );
    \n-
    103 level_.template setupInterpolation< Interpolation >();
    \n-
    104
    \n-
    105 SetLocal setLocal( level_ );
    \n-\n-
    107 }
    \n-
    \n-
    108
    \n-
    \n-
    109 void release ()
    \n-
    110 {
    \n-
    111 level_.release();
    \n-
    112 dofAccess_ = DofAccess();
    \n-
    113 }
    \n-
    \n-
    114
    \n-
    115 private:
    \n-
    116 DofVectorPointer level_;
    \n-
    117 DofAccess dofAccess_;
    \n-
    118 };
    \n-
    \n-
    119
    \n-
    120
    \n-
    121
    \n-
    122 // AlbertaGridLevelProvider::SetLocal
    \n-
    123 // ----------------------------------
    \n-
    124
    \n-
    125 template< int dim >
    \n-
    \n-\n-
    127 {
    \n-
    128 DofVectorPointer level_;
    \n-
    129 DofAccess dofAccess_;
    \n-
    130
    \n-
    131 public:
    \n-
    \n-
    132 explicit SetLocal ( const DofVectorPointer &level )
    \n-
    133 : level_( level ),
    \n-
    134 dofAccess_( level.dofSpace() )
    \n-
    135 {}
    \n-
    \n-
    136
    \n-
    \n-
    137 void operator() ( const Alberta::ElementInfo< dim > &elementInfo ) const
    \n-
    138 {
    \n-
    139 Level *const array = (Level *)level_;
    \n-
    140 array[ dofAccess_( elementInfo, 0 ) ] = elementInfo.level();
    \n-
    141 }
    \n-
    \n-
    142 };
    \n-
    \n-
    143
    \n-
    144
    \n-
    145
    \n-
    146 // AlbertaGridLevelProvider::CalcMaxLevel
    \n-
    147 // --------------------------------------
    \n-
    148
    \n-
    149 template< int dim >
    \n-
    \n-\n-
    151 {
    \n-
    152 Level maxLevel_;
    \n-
    153
    \n-
    154 public:
    \n-
    \n-\n-
    156 : maxLevel_( 0 )
    \n-
    157 {}
    \n-
    \n-
    158
    \n-
    \n-
    159 void operator() ( const Level &dof )
    \n-
    160 {
    \n-
    161 maxLevel_ = std::max( maxLevel_, Level( dof & levelMask ) );
    \n-
    162 }
    \n-
    \n-
    163
    \n-
    \n-
    164 void operator() ( const Alberta::ElementInfo< dim > &elementInfo )
    \n-
    165 {
    \n-
    166 maxLevel_ = std::max( maxLevel_, Level( elementInfo.level() ) );
    \n-
    167 }
    \n-
    \n-
    168
    \n-
    \n-
    169 Level maxLevel () const
    \n-
    170 {
    \n-
    171 return maxLevel_;
    \n-
    172 }
    \n-
    \n-
    173 };
    \n-
    \n-
    174
    \n-
    175
    \n-
    176
    \n-
    177 // AlbertaGridLevelProvider::ClearFlags
    \n-
    178 // ------------------------------------
    \n-
    179
    \n-
    180 template< int dim >
    \n-
    181 template< typename AlbertaGridLevelProvider< dim >::Level flags >
    \n-
    182 struct AlbertaGridLevelProvider< dim >::ClearFlags
    \n-
    183 {
    \n-
    184 void operator() ( Level &dof ) const
    \n-
    185 {
    \n-
    186 dof &= ~flags;
    \n-
    187 }
    \n-
    188 };
    \n-
    189
    \n-
    190
    \n-
    191
    \n-
    192 // AlbertaGridLevelProvider::Interpolation
    \n-
    193 // ---------------------------------------
    \n-
    194
    \n-
    195 template< int dim >
    \n-
    \n-\n-
    197 {
    \n-
    198 static const int dimension = dim;
    \n-
    199
    \n-\n-
    201
    \n-
    \n-
    202 static void interpolateVector ( const DofVectorPointer &dofVector,
    \n-
    203 const Patch &patch )
    \n-
    204 {
    \n-
    205 const DofAccess dofAccess( dofVector.dofSpace() );
    \n-
    206 Level *array = (Level *)dofVector;
    \n-
    207
    \n-
    208 for( int i = 0; i < patch.count(); ++i )
    \n-
    209 {
    \n-
    210 const Alberta::Element *const father = patch[ i ];
    \n-
    211 assert( (array[ dofAccess( father, 0 ) ] & levelMask) < levelMask );
    \n-
    212 const Level childLevel = (array[ dofAccess( father, 0 ) ] + 1) | isNewFlag;
    \n-
    213 for( int i = 0; i < 2; ++i )
    \n-
    214 {
    \n-
    215 const Alberta::Element *child = father->child[ i ];
    \n-
    216 array[ dofAccess( child, 0 ) ] = childLevel;
    \n-
    217 }
    \n-
    218 }
    \n-
    219 }
    \n-
    \n-
    220 };
    \n-
    \n-
    221
    \n-
    222}
    \n-
    223
    \n-
    224#endif // #if HAVE_ALBERTA
    \n-
    225
    \n-
    226#endif
    \n-\n-\n-
    provides a wrapper for ALBERTA's mesh structure
    \n+
    90#endif // #ifndef DUNE_ALBERTA_LEVELITERATOR_HH
    \n+\n+
    @ Ghost_Partition
    only ghost entities
    Definition gridenums.hh:142
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA EL Element
    Definition misc.hh:54
    \n-
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n-
    Definition meshpointer.hh:40
    \n-
    void leafTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:385
    \n-
    void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:370
    \n-\n-
    Definition dofadmin.hh:93
    \n-
    const DofSpace * dofSpace(int codim) const
    Definition dofadmin.hh:145
    \n-\n-
    void create(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:236
    \n-
    void release()
    Definition dofvector.hh:254
    \n-
    const DofSpace * dofSpace() const
    Definition dofvector.hh:223
    \n-
    void forEach(Functor &functor) const
    Definition dofvector.hh:264
    \n-
    Definition elementinfo.hh:43
    \n-
    int level() const
    Definition elementinfo.hh:533
    \n-
    Element * el() const
    Definition elementinfo.hh:737
    \n-
    Definition level.hh:25
    \n-
    bool isNew(const Alberta::Element *element) const
    Definition level.hh:62
    \n-
    bool isNew(const ElementInfo &elementInfo) const
    Definition level.hh:68
    \n-
    Alberta::MeshPointer< dim > MeshPointer
    Definition level.hh:48
    \n-
    MeshPointer mesh() const
    Definition level.hh:85
    \n-
    void create(const DofNumbering &dofNumbering)
    Definition level.hh:96
    \n-
    Level maxLevel() const
    Definition level.hh:73
    \n-
    Alberta::HierarchyDofNumbering< dim > DofNumbering
    Definition level.hh:49
    \n-
    void release()
    Definition level.hh:109
    \n-
    Level operator()(const Alberta::Element *element) const
    Definition level.hh:51
    \n-
    void markAllOld()
    Definition level.hh:90
    \n-
    Alberta::ElementInfo< dim > ElementInfo
    Definition level.hh:47
    \n-\n-
    SetLocal(const DofVectorPointer &level)
    Definition level.hh:132
    \n-\n-\n-
    Level maxLevel() const
    Definition level.hh:169
    \n-\n-
    Alberta::Patch< dimension > Patch
    Definition level.hh:200
    \n-
    static void interpolateVector(const DofVectorPointer &dofVector, const Patch &patch)
    Definition level.hh:202
    \n-
    Definition misc.hh:231
    \n-
    static const Flags nothing
    Definition misc.hh:234
    \n-
    Definition refinement.hh:40
    \n-
    int count() const
    Definition refinement.hh:67
    \n+
    Definition treeiterator.hh:189
    \n+
    GridImp::template Codim< codim >::Entity Entity
    Definition treeiterator.hh:207
    \n+
    int level() const
    ask for level of entities
    Definition treeiterator.hh:243
    \n+
    void increment()
    increment
    Definition treeiterator.hh:411
    \n+
    const GridImp & grid() const
    obtain a reference to the grid
    Definition treeiterator.hh:253
    \n+
    Definition leveliterator.hh:23
    \n+
    Base::MarkerVector MarkerVector
    Definition leveliterator.hh:29
    \n+
    AlbertaGridLevelIterator()
    Definition leveliterator.hh:31
    \n+
    AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *vec, int level)
    Constructor making begin iterator.
    Definition leveliterator.hh:40
    \n+
    Base::Entity Entity
    Definition leveliterator.hh:28
    \n+
    AlbertaGridLevelIterator(const GridImp &grid, int level)
    Constructor making end iterator.
    Definition leveliterator.hh:35
    \n+
    void increment()
    increment the iterator
    Definition leveliterator.hh:47
    \n+\n+\n+
    void increment()
    increment the iterator
    Definition leveliterator.hh:81
    \n+
    Base::Entity Entity
    Definition leveliterator.hh:62
    \n+
    Base::MarkerVector MarkerVector
    Definition leveliterator.hh:63
    \n+
    AlbertaGridLevelIterator(const GridImp &grid, int level)
    Constructor making end iterator.
    Definition leveliterator.hh:69
    \n+
    AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *, int level)
    Constructor making begin iterator (which is the end iterator in this case)
    Definition leveliterator.hh:74
    \n+
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,355 +1,175 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-level.hh\n+leveliterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_LEVEL_HH\n-6#define DUNE_ALBERTA_LEVEL_HH\n+5#ifndef DUNE_ALBERTA_LEVELITERATOR_HH\n+6#define DUNE_ALBERTA_LEVELITERATOR_HH\n 7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13#include \n-14\n-15#if HAVE_ALBERTA\n+8#include \n+9\n+10#include \n+11\n+12#if HAVE_ALBERTA\n+13\n+14namespace Dune\n+15{\n 16\n-17namespace Dune\n-18{\n+17 // AlbertaGridLevelIterator\n+18 // ------------------------\n 19\n-20 // AlbertaGridLevelProvider\n-21 // ------------------------\n-22\n-23 template< int dim >\n-24 class AlbertaGridLevelProvider\n-25 {\n-26 typedef AlbertaGridLevelProvider<_dim_> This;\n-27\n-28 typedef unsigned char Level;\n-29\n-30 typedef Alberta::DofVectorPointer<_Level_> DofVectorPointer;\n-31 typedef Alberta::DofAccess<_dim,_0_> DofAccess;\n-32\n-33 typedef Alberta::FillFlags<_dim_> FillFlags;\n-34\n-35 static const Level isNewFlag = (1 << 7);\n-36 static const Level levelMask = (1 << 7) - 1;\n-37\n-38 class SetLocal;\n-39 class CalcMaxLevel;\n-40\n-41 template< Level flags >\n-42 struct ClearFlags;\n-43\n-44 struct Interpolation;\n+20 template< int codim, PartitionIteratorType pitype, class GridImp >\n+21 class AlbertaGridLevelIterator\n+22 : public AlbertaGridTreeIterator< codim, GridImp, false >\n+23 {\n+24 typedef AlbertaGridLevelIterator<_codim,_pitype,_GridImp_> This;\n+25 typedef AlbertaGridTreeIterator<_codim,_GridImp,_false_> Base;\n+26\n+27 public:\n+28 typedef typename Base::Entity Entity;\n+29 typedef typename Base::MarkerVector MarkerVector;\n+30\n+31 AlbertaGridLevelIterator ()\n+32 {}\n+33\n+35 AlbertaGridLevelIterator ( const GridImp &grid, int level )\n+36 : Base( grid, level )\n+37 {}\n+38\n+40 AlbertaGridLevelIterator ( const GridImp &grid,\n+41 const MarkerVector *vec,\n+42 int level )\n+43 : Base( grid, vec, level )\n+44 {}\n 45\n-46 public:\n-47 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n-48 typedef Alberta::MeshPointer<_dim_> MeshPointer;\n-49 typedef Alberta::HierarchyDofNumbering<_dim_> DofNumbering;\n-50\n-51 Level operator()_( const Alberta::Element *element ) const\n-52 {\n-53 const Level *array = (Level *)level_;\n-54 return array[ dofAccess_( element, 0 ) ] & levelMask;\n-55 }\n-56\n-57 Level operator()_( const ElementInfo &elementInfo ) const\n-58 {\n-59 return (*this)( elementInfo.el() );\n-60 }\n-61\n-62 bool isNew ( const Alberta::Element *element ) const\n-63 {\n-64 const Level *array = (Level *)level_;\n-65 return ((array[ dofAccess_( element, 0 ) ] & isNewFlag) != 0);\n-66 }\n+47 void increment ()\n+48 {\n+49 Base::increment();\n+50 }\n+51 };\n+52\n+53\n+54 template< int codim, class GridImp >\n+55 class AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp >\n+56 : public AlbertaGridTreeIterator< codim, GridImp, false >\n+57 {\n+58 typedef AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_> This;\n+59 typedef AlbertaGridTreeIterator<_codim,_GridImp,_false_> Base;\n+60\n+61 public:\n+62 typedef typename Base::Entity Entity;\n+63 typedef typename Base::MarkerVector MarkerVector;\n+64\n+65 AlbertaGridLevelIterator ()\n+66 {}\n 67\n-68 bool isNew ( const ElementInfo &elementInfo ) const\n-69 {\n-70 return isNew( elementInfo.el() );\n-71 }\n+69 AlbertaGridLevelIterator ( const GridImp &grid, int level )\n+70 : Base( grid, level )\n+71 {}\n 72\n-73 Level maxLevel () const\n-74 {\n-75 CalcMaxLevel calcFromCache;\n-76 level_.forEach( calcFromCache );\n-77#ifndef NDEBUG\n-78 CalcMaxLevel calcFromGrid;\n-79 mesh().leafTraverse( calcFromGrid, FillFlags::nothing );\n-80 assert( calcFromCache.maxLevel() == calcFromGrid.maxLevel() );\n-81#endif\n-82 return calcFromCache.maxLevel();;\n-83 }\n-84\n-85 MeshPointer mesh () const\n-86 {\n-87 return MeshPointer( level_.dofSpace()->mesh );\n-88 }\n+74 AlbertaGridLevelIterator ( const GridImp &grid,\n+75 const MarkerVector *,\n+76 int level )\n+77 : Base( grid, level )\n+78 {}\n+79\n+81 void increment ()\n+82 {\n+83 Base::increment();\n+84 }\n+85 };\n+86}\n+87\n+88#endif // #if HAVE_ALBERTA\n 89\n-90 void markAllOld ()\n-91 {\n-92 ClearFlags< isNewFlag > clearIsNew;\n-93 level_.forEach( clearIsNew );\n-94 }\n-95\n-96 void create ( const DofNumbering &dofNumbering )\n-97 {\n-98 const Alberta::DofSpace *const dofSpace = dofNumbering.dofSpace( 0 );\n-99 dofAccess_ = DofAccess( dofSpace );\n-100\n-101 level_.create( dofSpace, \"Element level\" );\n-102 assert( level_ );\n-103 level_.template setupInterpolation< Interpolation >();\n-104\n-105 SetLocal setLocal( level_ );\n-106 mesh().hierarchicTraverse( setLocal, FillFlags::nothing );\n-107 }\n-108\n-109 void release ()\n-110 {\n-111 level_.release();\n-112 dofAccess_ = DofAccess();\n-113 }\n-114\n-115 private:\n-116 DofVectorPointer level_;\n-117 DofAccess dofAccess_;\n-118 };\n-119\n-120\n-121\n-122 // AlbertaGridLevelProvider::SetLocal\n-123 // ----------------------------------\n-124\n-125 template< int dim >\n-126 class AlbertaGridLevelProvider< dim >::SetLocal\n-127 {\n-128 DofVectorPointer level_;\n-129 DofAccess dofAccess_;\n-130\n-131 public:\n-132 explicit SetLocal ( const DofVectorPointer &level )\n-133 : level_( level ),\n-134 dofAccess_( level.dofSpace() )\n-135 {}\n-136\n-137 void operator()_( const Alberta::ElementInfo<_dim_> &elementInfo ) const\n-138 {\n-139 Level *const array = (Level *)level_;\n-140 array[ dofAccess_( elementInfo, 0 ) ] = elementInfo.level();\n-141 }\n-142 };\n-143\n-144\n-145\n-146 // AlbertaGridLevelProvider::CalcMaxLevel\n-147 // --------------------------------------\n-148\n-149 template< int dim >\n-150 class AlbertaGridLevelProvider< dim >::CalcMaxLevel\n-151 {\n-152 Level maxLevel_;\n-153\n-154 public:\n-155 CalcMaxLevel ()\n-156 : maxLevel_( 0 )\n-157 {}\n-158\n-159 void operator()_( const Level &dof )\n-160 {\n-161 maxLevel_ = std::max( maxLevel_, Level( dof & levelMask ) );\n-162 }\n-163\n-164 void operator()_( const Alberta::ElementInfo<_dim_> &elementInfo )\n-165 {\n-166 maxLevel_ = std::max( maxLevel_, Level( elementInfo.level() ) );\n-167 }\n-168\n-169 Level maxLevel () const\n-170 {\n-171 return maxLevel_;\n-172 }\n-173 };\n-174\n-175\n-176\n-177 // AlbertaGridLevelProvider::ClearFlags\n-178 // ------------------------------------\n-179\n-180 template< int dim >\n-181 template< typename AlbertaGridLevelProvider< dim >::Level flags >\n-182 struct AlbertaGridLevelProvider< dim >::ClearFlags\n-183 {\n-184 void operator()_( Level &dof ) const\n-185 {\n-186 dof &= ~flags;\n-187 }\n-188 };\n-189\n-190\n-191\n-192 // AlbertaGridLevelProvider::Interpolation\n-193 // ---------------------------------------\n-194\n-195 template< int dim >\n-196 struct AlbertaGridLevelProvider< dim >::Interpolation\n-197 {\n-198 static const int dimension = dim;\n-199\n-200 typedef Alberta::Patch<_dimension_> Patch;\n-201\n-202 static void interpolateVector ( const DofVectorPointer &dofVector,\n-203 const Patch &patch )\n-204 {\n-205 const DofAccess dofAccess( dofVector.dofSpace() );\n-206 Level *array = (Level *)dofVector;\n-207\n-208 for( int i = 0; i < patch.count(); ++i )\n-209 {\n-210 const Alberta::Element *const father = patch[ i ];\n-211 assert( (array[ dofAccess( father, 0 ) ] & levelMask) < levelMask );\n-212 const Level childLevel = (array[ dofAccess( father, 0 ) ] + 1) | isNewFlag;\n-213 for( int i = 0; i < 2; ++i )\n-214 {\n-215 const Alberta::Element *child = father->child[ i ];\n-216 array[ dofAccess( child, 0 ) ] = childLevel;\n-217 }\n-218 }\n-219 }\n-220 };\n-221\n-222}\n-223\n-224#endif // #if HAVE_ALBERTA\n-225\n-226#endif\n-dofadmin.hh\n-dofvector.hh\n-meshpointer.hh\n-provides a wrapper for ALBERTA's mesh structure\n+90#endif // #ifndef DUNE_ALBERTA_LEVELITERATOR_HH\n+treeiterator.hh\n+Dune::Ghost_Partition\n+@ Ghost_Partition\n+only ghost entities\n+Definition gridenums.hh:142\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::Element\n-ALBERTA EL Element\n-Definition misc.hh:54\n-Dune::Alberta::DofSpace\n-ALBERTA FE_SPACE DofSpace\n-Definition misc.hh:65\n-Dune::Alberta::MeshPointer\n-Definition meshpointer.hh:40\n-Dune::Alberta::MeshPointer::leafTraverse\n-void leafTraverse(Functor &functor, typename FillFlags::Flags\n-fillFlags=FillFlags::standard) const\n-Definition meshpointer.hh:385\n-Dune::Alberta::MeshPointer::hierarchicTraverse\n-void hierarchicTraverse(Functor &functor, typename FillFlags::Flags\n-fillFlags=FillFlags::standard) const\n-Definition meshpointer.hh:370\n-Dune::Alberta::DofAccess<_dim,_0_>\n-Dune::Alberta::HierarchyDofNumbering\n-Definition dofadmin.hh:93\n-Dune::Alberta::HierarchyDofNumbering::dofSpace\n-const DofSpace * dofSpace(int codim) const\n-Definition dofadmin.hh:145\n-Dune::Alberta::DofVectorPointer<_Level_>\n-Dune::Alberta::DofVectorPointer::create\n-void create(const DofSpace *dofSpace, const std::string &name=\"\")\n-Definition dofvector.hh:236\n-Dune::Alberta::DofVectorPointer::release\n-void release()\n-Definition dofvector.hh:254\n-Dune::Alberta::DofVectorPointer::dofSpace\n-const DofSpace * dofSpace() const\n-Definition dofvector.hh:223\n-Dune::Alberta::DofVectorPointer::forEach\n-void forEach(Functor &functor) const\n-Definition dofvector.hh:264\n-Dune::Alberta::ElementInfo\n-Definition elementinfo.hh:43\n-Dune::Alberta::ElementInfo::level\n+Dune::AlbertaGridTreeIterator\n+Definition treeiterator.hh:189\n+Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::Entity\n+GridImp::template Codim< codim >::Entity Entity\n+Definition treeiterator.hh:207\n+Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::level\n int level() const\n-Definition elementinfo.hh:533\n-Dune::Alberta::ElementInfo::el\n-Element * el() const\n-Definition elementinfo.hh:737\n-Dune::AlbertaGridLevelProvider\n-Definition level.hh:25\n-Dune::AlbertaGridLevelProvider::isNew\n-bool isNew(const Alberta::Element *element) const\n-Definition level.hh:62\n-Dune::AlbertaGridLevelProvider::isNew\n-bool isNew(const ElementInfo &elementInfo) const\n-Definition level.hh:68\n-Dune::AlbertaGridLevelProvider::MeshPointer\n-Alberta::MeshPointer< dim > MeshPointer\n-Definition level.hh:48\n-Dune::AlbertaGridLevelProvider::mesh\n-MeshPointer mesh() const\n-Definition level.hh:85\n-Dune::AlbertaGridLevelProvider::create\n-void create(const DofNumbering &dofNumbering)\n-Definition level.hh:96\n-Dune::AlbertaGridLevelProvider::maxLevel\n-Level maxLevel() const\n-Definition level.hh:73\n-Dune::AlbertaGridLevelProvider::DofNumbering\n-Alberta::HierarchyDofNumbering< dim > DofNumbering\n-Definition level.hh:49\n-Dune::AlbertaGridLevelProvider::release\n-void release()\n-Definition level.hh:109\n-Dune::AlbertaGridLevelProvider::operator()\n-Level operator()(const Alberta::Element *element) const\n-Definition level.hh:51\n-Dune::AlbertaGridLevelProvider::markAllOld\n-void markAllOld()\n-Definition level.hh:90\n-Dune::AlbertaGridLevelProvider::ElementInfo\n-Alberta::ElementInfo< dim > ElementInfo\n-Definition level.hh:47\n-Dune::AlbertaGridLevelProvider::SetLocal\n-Definition level.hh:127\n-Dune::AlbertaGridLevelProvider::SetLocal::SetLocal\n-SetLocal(const DofVectorPointer &level)\n-Definition level.hh:132\n-Dune::AlbertaGridLevelProvider::CalcMaxLevel\n-Definition level.hh:151\n-Dune::AlbertaGridLevelProvider::CalcMaxLevel::CalcMaxLevel\n-CalcMaxLevel()\n-Definition level.hh:155\n-Dune::AlbertaGridLevelProvider::CalcMaxLevel::maxLevel\n-Level maxLevel() const\n-Definition level.hh:169\n-Dune::AlbertaGridLevelProvider::Interpolation\n-Definition level.hh:197\n-Dune::AlbertaGridLevelProvider::Interpolation::Patch\n-Alberta::Patch< dimension > Patch\n-Definition level.hh:200\n-Dune::AlbertaGridLevelProvider::Interpolation::interpolateVector\n-static void interpolateVector(const DofVectorPointer &dofVector, const Patch\n-&patch)\n-Definition level.hh:202\n-Dune::Alberta::FillFlags\n-Definition misc.hh:231\n-Dune::Alberta::FillFlags::nothing\n-static const Flags nothing\n-Definition misc.hh:234\n-Dune::Alberta::Patch\n-Definition refinement.hh:40\n-Dune::Alberta::Patch::count\n-int count() const\n-Definition refinement.hh:67\n+ask for level of entities\n+Definition treeiterator.hh:243\n+Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::increment\n+void increment()\n+increment\n+Definition treeiterator.hh:411\n+Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::grid\n+const GridImp & grid() const\n+obtain a reference to the grid\n+Definition treeiterator.hh:253\n+Dune::AlbertaGridLevelIterator\n+Definition leveliterator.hh:23\n+Dune::AlbertaGridLevelIterator::MarkerVector\n+Base::MarkerVector MarkerVector\n+Definition leveliterator.hh:29\n+Dune::AlbertaGridLevelIterator::AlbertaGridLevelIterator\n+AlbertaGridLevelIterator()\n+Definition leveliterator.hh:31\n+Dune::AlbertaGridLevelIterator::AlbertaGridLevelIterator\n+AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *vec, int\n+level)\n+Constructor making begin iterator.\n+Definition leveliterator.hh:40\n+Dune::AlbertaGridLevelIterator::Entity\n+Base::Entity Entity\n+Definition leveliterator.hh:28\n+Dune::AlbertaGridLevelIterator::AlbertaGridLevelIterator\n+AlbertaGridLevelIterator(const GridImp &grid, int level)\n+Constructor making end iterator.\n+Definition leveliterator.hh:35\n+Dune::AlbertaGridLevelIterator::increment\n+void increment()\n+increment the iterator\n+Definition leveliterator.hh:47\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>\n+Definition leveliterator.hh:57\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::\n+AlbertaGridLevelIterator\n+AlbertaGridLevelIterator()\n+Definition leveliterator.hh:65\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::increment\n+void increment()\n+increment the iterator\n+Definition leveliterator.hh:81\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::Entity\n+Base::Entity Entity\n+Definition leveliterator.hh:62\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::MarkerVector\n+Base::MarkerVector MarkerVector\n+Definition leveliterator.hh:63\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::\n+AlbertaGridLevelIterator\n+AlbertaGridLevelIterator(const GridImp &grid, int level)\n+Constructor making end iterator.\n+Definition leveliterator.hh:69\n+Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::\n+AlbertaGridLevelIterator\n+AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *, int level)\n+Constructor making begin iterator (which is the end iterator in this case)\n+Definition leveliterator.hh:74\n+Dune::AlbertaMarkerVector\n+marker assigning subentities to one element containing them\n+Definition treeiterator.hh:35\n+entityiterator.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00638.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00638.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    transformation.hh File Reference
    \n
    \n
    \n
    #include <dune/common/fvector.hh>
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00638_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00638_source.html", "unified_diff": "@@ -86,15 +86,15 @@\n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_TRANSFORMATION_HH
    \n
    6#define DUNE_ALBERTA_TRANSFORMATION_HH
    \n
    7
    \n
    8#include <dune/common/fvector.hh>
    \n
    9
    \n-\n+\n
    11
    \n
    12#if HAVE_ALBERTA
    \n
    13
    \n
    14namespace Dune
    \n
    15{
    \n
    16
    \n
    \n@@ -163,15 +163,15 @@\n
    \n
    71
    \n
    72}
    \n
    73
    \n
    74#endif // #if HAVE_ALBERTA
    \n
    75
    \n
    76#endif // #ifndef DUNE_ALBERTA_TRANSFORMATION_HH
    \n-\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    ALBERTA AFF_TRAFO AffineTransformation
    Definition misc.hh:52
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n
    static const int dimWorld
    Definition misc.hh:46
    \n
    Definition misc.hh:102
    \n
    GlobalMatrix Matrix
    Definition misc.hh:106
    \n
    GlobalVector Vector
    Definition misc.hh:107
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00644.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00644.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: indexstack.hh File Reference\n+dune-grid: indexsets.cc File Reference\n \n \n \n \n \n \n \n@@ -70,43 +70,27 @@\n \n \n
    \n \n-
    indexstack.hh File Reference
    \n+
    indexsets.cc File Reference
    \n
    \n
    \n-\n-

    Provides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid) \n-More...

    \n-
    #include <assert.h>
    \n-#include <stack>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/reservedvector.hh>
    \n-
    \n-

    Go to the source code of this file.

    \n-

    \n Classes

    class  Dune::AlbertaTransformation
     
    \n-\n-\n-\n-

    \n-Classes

    class  Dune::IndexStack< T, length >
     
    \n+
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-

    Detailed Description

    \n-

    Provides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid)

    \n-
    Author
    Robert Kloefkorn
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,30 +1,17 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-indexstack.hh File Reference\n-Provides an index stack that supplies indices for element numbering for a grid\n-(i.e. AlbertaGrid and ALUGrid) More...\n-#include \n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::IndexStack<_T,_length_>\n-\u00a0\n+Namespaces\n+indexsets.cc File Reference\n+#include \n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Provides an index stack that supplies indices for element numbering for a grid\n-(i.e. AlbertaGrid and ALUGrid)\n- Author\n- Robert Kloefkorn\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00647.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00647.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: meshpointer.cc File Reference\n+dune-grid: geometrycache.hh File Reference\n \n \n \n \n \n \n \n@@ -70,20 +70,31 @@\n \n \n
    \n \n-
    meshpointer.cc File Reference
    \n+
    geometrycache.hh File Reference
    \n
    \n
    \n-\n+\n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::Alberta::GeometryCache< dim >
     
    struct  Dune::Alberta::GeometryCacheProxy< dim >
     
    \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,17 +1,24 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Namespaces\n-meshpointer.cc File Reference\n-#include \n+Classes | Namespaces\n+geometrycache.hh File Reference\n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+ class \u00a0 Dune::Alberta::GeometryCache<_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::GeometryCacheProxy<_dim_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n ===============================================================================\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00650.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00650.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: intersection.cc File Reference\n+dune-grid: dofadmin.hh File Reference\n \n \n \n \n \n \n \n@@ -71,56 +71,40 @@\n \n \n \n
    \n \n-
    intersection.cc File Reference
    \n+Namespaces
    \n+
    dofadmin.hh File Reference
    \n \n
    \n-
    #include <dune/grid/albertagrid/intersection.hh>
    \n+
    #include <utility>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/elementinfo.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n \n-\n+\n \n-\n+\n \n

    \n Classes

    struct  Dune::AlbertaGridIntersectionBase< Grid >::GlobalCoordReader< GridImp >
    class  Dune::Alberta::DofAccess< dim, codim >
     
    struct  Dune::AlbertaGridIntersectionBase< Grid >::LocalCoordReader< GridImp >
    class  Dune::Alberta::HierarchyDofNumbering< dim >
     
    \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n+\n+\n

    \n-Macros

    #define DUNE_ALBERTA_INTERSECTION_CC
     
    namespace  Dune::Alberta
     
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_ALBERTA_INTERSECTION_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_ALBERTA_INTERSECTION_CC
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,29 +1,27 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces | Macros\n-intersection.cc File Reference\n-#include \n+Classes | Namespaces\n+dofadmin.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::AlbertaGridIntersectionBase<_Grid_>::GlobalCoordReader<_GridImp\n- >\n+class \u00a0 Dune::Alberta::DofAccess<_dim,_codim_>\n \u00a0\n-struct \u00a0 Dune::AlbertaGridIntersectionBase<_Grid_>::LocalCoordReader<_GridImp_>\n+class \u00a0 Dune::Alberta::HierarchyDofNumbering<_dim_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-Macros\n-#define\u00a0 DUNE_ALBERTA_INTERSECTION_CC\n+namespace \u00a0 Dune::Alberta\n \u00a0\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_ALBERTA_INTERSECTION_CC *****\n-#define DUNE_ALBERTA_INTERSECTION_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00650_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00650_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: intersection.cc Source File\n+dune-grid: dofadmin.hh Source File\n \n \n \n \n \n \n \n@@ -74,618 +74,387 @@\n \n \n \n
    \n-
    intersection.cc
    \n+
    dofadmin.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_INTERSECTION_CC
    \n-
    6#define DUNE_ALBERTA_INTERSECTION_CC
    \n+
    5#ifndef DUNE_ALBERTA_DOFADMIN_HH
    \n+
    6#define DUNE_ALBERTA_DOFADMIN_HH
    \n
    7
    \n-\n+
    8#include <utility>
    \n
    9
    \n-
    10namespace Dune
    \n-
    11{
    \n-
    12
    \n-
    13 // AlbertaGridIntersectionBase
    \n-
    14 // ---------------------------
    \n-
    15
    \n-
    16 template< class Grid >
    \n-
    17 inline AlbertaGridIntersectionBase< Grid >
    \n-
    \n-
    18 ::AlbertaGridIntersectionBase ()
    \n-
    19 : grid_( nullptr ),
    \n-
    20 elementInfo_(),
    \n-
    21 oppVertex_( -1 ) // mark invalid intersection
    \n-
    22 {}
    \n-
    \n-
    23
    \n-
    24 template< class Grid >
    \n-\n-
    \n-
    26 ::AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex )
    \n-
    27 : grid_( &entity.grid() ),
    \n-
    28 elementInfo_( entity.elementInfo() ),
    \n-
    29 oppVertex_( oppVertex )
    \n-
    30 {}
    \n-
    \n-
    31
    \n-
    32
    \n-
    33 template< class Grid >
    \n-
    34 inline typename Grid::template Codim< 0 >::Entity
    \n-
    \n-\n-
    36 {
    \n-\n-
    38 return EntityImp( grid(), elementInfo(), 0 );
    \n-
    39 }
    \n-
    \n-
    40
    \n+
    10#include <dune/common/hybridutilities.hh>
    \n+
    11
    \n+\n+\n+
    14
    \n+
    15#if HAVE_ALBERTA
    \n+
    16
    \n+
    17namespace Dune
    \n+
    18{
    \n+
    19
    \n+
    20 namespace Alberta
    \n+
    21 {
    \n+
    22
    \n+
    23 // External Forward Declarations
    \n+
    24 // -----------------------------
    \n+
    25
    \n+
    26 template< int dim >
    \n+
    27 class MeshPointer;
    \n+
    28
    \n+
    29
    \n+
    30
    \n+
    31 // DofAccess
    \n+
    32 // ---------
    \n+
    33
    \n+
    34 template< int dim, int codim >
    \n+
    \n+\n+
    36 {
    \n+
    37 static const int codimtype = CodimType< dim, codim >::value;
    \n+
    38
    \n+
    39 public:
    \n+\n
    41
    \n-
    42 template< class Grid >
    \n-
    \n-\n-
    44 {
    \n-
    45 return elementInfo().isBoundary( oppVertex_ );
    \n-
    46 }
    \n-
    \n-
    47
    \n-
    48
    \n-
    49 template< class Grid >
    \n-
    \n-\n-
    51 {
    \n-
    52 if( boundary() )
    \n-
    53 {
    \n-
    54 const int id = elementInfo().boundaryId( oppVertex_ );
    \n-
    55 assert( id != 0 );
    \n-
    56 return id;
    \n-
    57 }
    \n-
    58 else
    \n-
    59 return 0;
    \n-
    60 }
    \n-
    \n-
    61
    \n-
    \n-\n-
    63 template< class Grid >
    \n-
    \n-\n-
    65 {
    \n+
    42 static const int dimension = dim;
    \n+
    43 static const int codimension = codim;
    \n+
    44
    \n+\n+
    46
    \n+
    \n+\n+
    48 : node_( -1 )
    \n+
    49 {}
    \n+
    \n+
    50
    \n+
    \n+
    51 explicit DofAccess ( const DofSpace *dofSpace )
    \n+
    52 {
    \n+
    53 assert( dofSpace );
    \n+
    54 node_ = dofSpace->admin->mesh->node[ codimtype ];
    \n+
    55 index_ = dofSpace->admin->n0_dof[ codimtype ];
    \n+
    56 }
    \n+
    \n+
    57
    \n+
    \n+
    58 int operator() ( const Element *element, int subEntity, int i ) const
    \n+
    59 {
    \n+
    60 assert( element );
    \n+
    61 assert( node_ != -1 );
    \n+
    62 assert( subEntity < numSubEntities );
    \n+
    63 return element->dof[ node_ + subEntity ][ index_ + i ];
    \n+
    64 }
    \n+
    \n+
    65
    \n
    \n-
    66 assert( boundary() );
    \n-
    67 const Alberta::BasicNodeProjection *projection = elementInfo().boundaryProjection( oppVertex_ );
    \n-
    \n-
    68 assert( projection );
    \n-
    \n-
    69 return projection->boundaryIndex();
    \n-
    70 }
    \n-
    71
    \n-
    \n-\n-
    73 template< class Grid >
    \n-
    \n-\n-
    75 {
    \n+
    66 int operator() ( const Element *element, int subEntity ) const
    \n+
    67 {
    \n+
    68 return (*this)( element, subEntity, 0 );
    \n+
    69 }
    \n+
    \n+
    70
    \n+
    \n+
    71 int operator() ( const ElementInfo &elementInfo, int subEntity, int i ) const
    \n+
    72 {
    \n+
    73 return (*this)( elementInfo.el(), subEntity, i );
    \n+
    74 }
    \n+
    \n+
    75
    \n
    \n-
    76 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);
    \n-
    \n-
    77 return grid().alberta2generic( 1, face );
    \n-
    \n-
    78 }
    \n-
    79
    \n-
    \n-\n-
    \n-
    81 template< class Grid >
    \n-
    \n-
    82 inline GeometryType AlbertaGridIntersectionBase< Grid >::type () const
    \n-
    83 {
    \n-
    84 return GeometryTypes::simplex( dimension-1 );
    \n-
    85 }
    \n+
    76 int operator() ( const ElementInfo &elementInfo, int subEntity ) const
    \n+
    77 {
    \n+
    78 return (*this)( elementInfo.el(), subEntity );
    \n+
    79 }
    \n+
    \n+
    80
    \n+
    81 private:
    \n+
    82 int node_;
    \n+
    83 int index_;
    \n+
    84 };
    \n
    \n+
    85
    \n
    86
    \n
    87
    \n-
    \n-
    88 template< class Grid >
    \n-
    \n-\n-
    \n-\n-
    91 {
    \n-
    92 const typename Entity::Geometry geoInside = inside().geometry();
    \n-
    93
    \n-
    94 const int face = indexInInside();
    \n-
    95 auto refSimplex = ReferenceElements< ctype, dimension >::simplex();
    \n-
    96 FieldVector< ctype, dimension > refNormal = refSimplex.integrationOuterNormal( face );
    \n-
    97
    \n-
    98 const typename Entity::Geometry::JacobianInverseTransposed &jInvT
    \n-
    99 = geoInside.impl().jacobianInverseTransposed();
    \n-
    100
    \n-
    101 NormalVector normal;
    \n-
    102 jInvT.mv( refNormal, normal );
    \n-
    103 normal *= geoInside.impl().integrationElement();
    \n+
    88 // HierarchyDofNumbering
    \n+
    89 // ---------------------
    \n+
    90
    \n+
    91 template< int dim >
    \n+
    \n+\n+
    93 {
    \n+\n+
    95
    \n+
    96 public:
    \n+
    97 static const int dimension = dim;
    \n+
    98
    \n+\n+\n+
    101
    \n+
    102 private:
    \n+
    103 static const int nNodeTypes = N_NODE_TYPES;
    \n
    104
    \n-
    105 return normal;
    \n-
    106 }
    \n-
    \n+
    105 template< int codim >
    \n+
    106 struct CreateDofSpace;
    \n
    107
    \n-
    108 template<>
    \n-\n-
    \n-
    110 AlbertaGridIntersectionBase< const AlbertaGrid< 1, 1 > >::centerIntegrationOuterNormal () const
    \n-
    111 {
    \n-
    112 const Alberta::GlobalVector &oppCoord = grid().getCoord( elementInfo(), oppVertex_ );
    \n-
    113 const Alberta::GlobalVector &myCoord = grid().getCoord( elementInfo(), 1-oppVertex_ );
    \n-
    114 NormalVector n;
    \n-
    115 n[ 0 ] = (myCoord[ 0 ] > oppCoord[ 0 ] ? ctype( 1 ) : -ctype( 1 ));
    \n-
    116 return n;
    \n-
    117 }
    \n-
    \n-
    118
    \n-
    119#if defined GRIDDIM && GRIDDIM > 1
    \n-
    120 template<>
    \n-\n-
    122 AlbertaGridIntersectionBase< const AlbertaGrid< 2, 2 > >::centerIntegrationOuterNormal () const
    \n-
    123 {
    \n-
    124 const Alberta::GlobalVector &coordOne = grid().getCoord( elementInfo(), (oppVertex_+1)%3 );
    \n-
    125 const Alberta::GlobalVector &coordTwo = grid().getCoord( elementInfo(), (oppVertex_+2)%3 );
    \n+
    108 template< int codim >
    \n+
    109 struct CacheDofSpace;
    \n+
    110
    \n+
    111 typedef std::pair< int, int > Cache;
    \n+
    112
    \n+
    113 public:
    \n+
    \n+\n+
    115 {}
    \n+
    \n+
    116
    \n+
    117 private:
    \n+
    118 HierarchyDofNumbering ( const This & );
    \n+
    119 This &operator= ( const This & );
    \n+
    120
    \n+
    121 public:
    \n+
    \n+\n+
    123 {
    \n+
    124 release();
    \n+
    125 }
    \n+
    \n
    126
    \n-
    127 NormalVector n;
    \n-
    128 n[ 0 ] = -(coordOne[ 1 ] - coordTwo[ 1 ]);
    \n-
    129 n[ 1 ] = coordOne[ 0 ] - coordTwo[ 0 ];
    \n-
    130 return n;
    \n-
    131 }
    \n-
    132#endif // defined GRIDDIM && GRIDDIM > 1
    \n-
    133
    \n-
    134 template<>
    \n-
    135 inline AlbertaGridIntersectionBase< const AlbertaGrid< 3, 3 > >::NormalVector
    \n-
    \n-
    136 AlbertaGridIntersectionBase< const AlbertaGrid< 3, 3 > >::centerIntegrationOuterNormal () const
    \n-
    137 {
    \n-
    138 // in this case the orientation is negative, multiply by -1
    \n-
    139 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();
    \n-
    140 const ctype val = (elInfo.orientation > 0) ? 1.0 : -1.0;
    \n-
    141
    \n-
    142 static const int faceVertices[ 4 ][ 3 ]
    \n-
    143 = { {1,3,2}, {0,2,3}, {0,3,1}, {0,1,2} };
    \n-
    144 const int *localFaces = faceVertices[ oppVertex_ ];
    \n-
    145
    \n-
    146 const Alberta::GlobalVector &coord0 = grid().getCoord( elementInfo(), localFaces[ 0 ] );
    \n-
    147 const Alberta::GlobalVector &coord1 = grid().getCoord( elementInfo(), localFaces[ 1 ] );
    \n-
    148 const Alberta::GlobalVector &coord2 = grid().getCoord( elementInfo(), localFaces[ 2 ] );
    \n-
    149
    \n-
    150 FieldVector< ctype, dimensionworld > u;
    \n-
    151 FieldVector< ctype, dimensionworld > v;
    \n-
    152 for( int i = 0; i < dimension; ++i )
    \n-
    153 {
    \n-
    154 v[ i ] = coord1[ i ] - coord0[ i ];
    \n-
    155 u[ i ] = coord2[ i ] - coord1[ i ];
    \n-
    156 }
    \n+
    \n+
    127 int operator() ( const Element *element, int codim, unsigned int subEntity ) const
    \n+
    128 {
    \n+
    129 assert( !(*this) == false );
    \n+
    130 assert( (codim >= 0) && (codim <= dimension) );
    \n+
    131 const Cache &cache = cache_[ codim ];
    \n+
    132 return element->dof[ cache.first + subEntity ][ cache.second ];
    \n+
    133 }
    \n+
    \n+
    134
    \n+
    \n+
    135 int operator() ( const ElementInfo &element, int codim, unsigned int subEntity ) const
    \n+
    136 {
    \n+
    137 return (*this)( element.el(), codim, subEntity );
    \n+
    138 }
    \n+
    \n+
    139
    \n+
    \n+
    140 explicit operator bool () const
    \n+
    141 {
    \n+
    142 return (bool)mesh_;
    \n+
    143 }
    \n+
    \n+
    144
    \n+
    \n+
    145 const DofSpace *dofSpace ( int codim ) const
    \n+
    146 {
    \n+
    147 assert( *this );
    \n+
    148 assert( (codim >= 0) && (codim <= dimension) );
    \n+
    149 return dofSpace_[ codim ];
    \n+
    150 }
    \n+
    \n+
    151
    \n+
    \n+
    152 const DofSpace *emptyDofSpace () const
    \n+
    153 {
    \n+
    154 assert( *this );
    \n+
    155 return emptySpace_;
    \n+
    156 }
    \n+
    \n
    157
    \n-
    158 NormalVector n;
    \n-
    159 for( int i = 0; i < dimension; ++i )
    \n-
    160 {
    \n-
    161 const int j = (i+1)%dimension;
    \n-
    162 const int k = (i+2)%dimension;
    \n-
    163 n[ i ] = val * (u[ j ] * v[ k ] - u[ k ] * v[ j ]);
    \n-
    164 }
    \n-
    165 return n;
    \n-
    166 }
    \n+
    \n+
    158 const MeshPointer &mesh () const
    \n+
    159 {
    \n+
    160 return mesh_;
    \n+
    161 }
    \n+
    \n+
    162
    \n+
    \n+
    163 int size ( int codim ) const
    \n+
    164 {
    \n+
    165 return dofSpace( codim )->admin->size;
    \n+
    166 }
    \n
    \n
    167
    \n-
    168
    \n-
    169 template< class Grid >
    \n-\n-
    \n-\n-
    172 {
    \n-
    173 return centerIntegrationOuterNormal();
    \n-
    174 }
    \n-
    \n-
    175
    \n-
    176
    \n-
    177 template< class Grid >
    \n-\n-
    \n-\n-
    180 {
    \n-
    181 NormalVector normal = centerOuterNormal();
    \n-
    182 normal *= (1.0 / normal.two_norm());
    \n-
    183 return normal;
    \n-
    184 }
    \n-
    \n-
    185
    \n-
    186
    \n-
    187 template< class Grid >
    \n-\n-
    \n-\n-
    190 {
    \n-
    191 return centerIntegrationOuterNormal();
    \n-
    192 }
    \n-
    \n-
    193
    \n+
    \n+
    168 void create ( const MeshPointer &mesh );
    \n+
    169
    \n+
    \n+
    170 void release ()
    \n+
    171 {
    \n+
    172 if( *this )
    \n+
    173 {
    \n+
    174 for( int codim = 0; codim <= dimension; ++codim )
    \n+
    175 freeDofSpace( dofSpace_[ codim ] );
    \n+
    176 freeDofSpace( emptySpace_ );
    \n+
    177 mesh_ = MeshPointer();
    \n+
    178 }
    \n+
    179 }
    \n+
    \n+
    180
    \n+
    181 private:
    \n+
    182 static const DofSpace *createEmptyDofSpace ( const MeshPointer &mesh );
    \n+
    183 static const DofSpace *createDofSpace ( const MeshPointer &mesh,
    \n+
    184 const std::string &name,
    \n+
    185 const int (&ndof)[ nNodeTypes ],
    \n+
    186 const bool periodic = false );
    \n+
    187 static void freeDofSpace ( const DofSpace *dofSpace );
    \n+
    188
    \n+
    189 MeshPointer mesh_;
    \n+
    190 const DofSpace *emptySpace_;
    \n+
    191 const DofSpace *dofSpace_[ dimension+1 ];
    \n+
    192 Cache cache_[ dimension+1 ];
    \n+
    193 };
    \n
    194
    \n-
    195 template< class Grid >
    \n-\n-
    \n-\n-
    198 {
    \n-
    199 return centerOuterNormal();
    \n-
    200 }
    \n-
    \n-
    201
    \n+
    195
    \n+
    196
    \n+
    197 template< int dim >
    \n+
    198 inline void
    \n+
    \n+\n+
    200 {
    \n+
    201 release();
    \n
    202
    \n-
    203 template< class Grid >
    \n-\n-
    \n-\n-
    206 {
    \n-
    207 return centerUnitOuterNormal();
    \n-
    208 }
    \n-
    \n-
    209
    \n+
    203 if( !mesh )
    \n+
    204 return;
    \n+
    205
    \n+
    206 mesh_ = mesh;
    \n+
    207
    \n+
    208 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i ){ CreateDofSpace< i >::apply( mesh_, dofSpace_ ); } );
    \n+
    209 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i ){ CacheDofSpace< i >::apply( dofSpace_, cache_ ); } );
    \n
    210
    \n-
    211 template< class Grid >
    \n-\n-
    \n-\n-
    214 {
    \n-
    215 return AlbertaTransformation( elementInfo().transformation( oppVertex_ ) );
    \n-
    216 }
    \n+
    211 emptySpace_ = createEmptyDofSpace( mesh_ );
    \n+
    212 for( int i = 0; i < nNodeTypes; ++i )
    \n+
    213 assert( emptySpace_->admin->n_dof[ i ] == 0 );
    \n+
    214 }
    \n
    \n+
    \n+
    215
    \n+
    216
    \n
    217
    \n-
    218
    \n-
    219 template< class Grid >
    \n-
    \n-\n-
    221 {
    \n-
    222 return *grid_;
    \n-
    223 }
    \n-
    \n-
    224
    \n-
    225
    \n-
    226 template< class Grid >
    \n-\n-
    \n-\n-
    229 {
    \n-
    230 assert( !!elementInfo_ );
    \n-
    231 return elementInfo_;
    \n-
    232 }
    \n-
    \n-
    \n-
    233
    \n-
    234
    \n-
    235
    \n-
    236 // AlbertaGridIntersectionBase::GlobalCoordReader
    \n-
    237 // ----------------------------------------------
    \n-
    238
    \n-
    239 template< class GridImp >
    \n-
    \n-\n-
    241 {
    \n-
    242 typedef typename std::remove_const< GridImp >::type Grid;
    \n-
    243
    \n-
    244 static const int dimension = Grid::dimension;
    \n-
    245 static const int codimension = 1;
    \n-
    246 static const int mydimension = dimension - codimension;
    \n-
    247 static const int coorddimension = Grid::dimensionworld;
    \n-
    248
    \n-\n+
    218 template< int dim >
    \n+
    219 inline const DofSpace *
    \n+\n+
    221 {
    \n+
    222 int ndof[ nNodeTypes ];
    \n+
    223 for( int i = 0; i < nNodeTypes; ++i )
    \n+
    224 ndof[ i ] = 0;
    \n+
    225 std::string name = "Empty";
    \n+
    226 return createDofSpace( mesh, name, ndof );
    \n+
    227 }
    \n+
    228
    \n+
    229
    \n+
    230 template< int dim >
    \n+
    231 inline const DofSpace *
    \n+
    232 HierarchyDofNumbering< dim >::createDofSpace ( const MeshPointer &mesh,
    \n+
    233 const std::string &name,
    \n+
    234 const int (&ndof)[ nNodeTypes ],
    \n+
    235 const bool periodic )
    \n+
    236 {
    \n+
    237 const ALBERTA FLAGS flags
    \n+
    238 = ADM_PRESERVE_COARSE_DOFS | (periodic ? ADM_PERIODIC : 0);
    \n+
    239 return ALBERTA get_dof_space ( mesh, name.c_str(), ndof, flags );
    \n+
    240 }
    \n+
    241
    \n+
    242
    \n+
    243 template< int dim >
    \n+
    244 inline void
    \n+
    245 HierarchyDofNumbering< dim >::freeDofSpace ( const DofSpace *dofSpace )
    \n+
    246 {
    \n+
    247 ALBERTA free_fe_space( dofSpace );
    \n+
    248 }
    \n+
    249
    \n
    250
    \n-\n-
    252 typedef FieldVector< ctype, coorddimension > Coordinate;
    \n-
    253
    \n-
    254 private:
    \n-
    255 const Grid &grid_;
    \n-\n-
    257 const int subEntity_;
    \n-
    258 const int twist_;
    \n-
    259
    \n-
    260 public:
    \n-
    \n-
    261 GlobalCoordReader ( const GridImp &grid,
    \n-\n-
    263 int subEntity )
    \n-
    264 : grid_( grid ),
    \n-\n-
    266 subEntity_( subEntity ),
    \n-
    267 twist_( elementInfo.template twist< codimension >( subEntity ) )
    \n-
    268 {}
    \n-
    \n-
    269
    \n-
    \n-
    270 void coordinate ( int i, Coordinate &x ) const
    \n-
    271 {
    \n-
    272 assert( !elementInfo_ == false );
    \n-
    273 assert( (i >= 0) && (i <= mydimension) );
    \n+
    251
    \n+
    252 // HierarchyDofNumbering::CreateDofSpace
    \n+
    253 // -------------------------------------
    \n+
    254
    \n+
    255 template< int dim >
    \n+
    256 template< int codim >
    \n+
    257 struct HierarchyDofNumbering< dim >::CreateDofSpace
    \n+
    258 {
    \n+
    259 static void apply ( const MeshPointer &mesh, const DofSpace *(&dofSpace)[ dim+1 ] )
    \n+
    260 {
    \n+
    261 int ndof[ nNodeTypes ];
    \n+
    262 for( int i = 0; i < nNodeTypes; ++i )
    \n+
    263 ndof[ i ] = 0;
    \n+
    264 ndof[ CodimType< dim, codim >::value ] = 1;
    \n+
    265
    \n+
    266 std::string name = "Codimension ";
    \n+
    267 name += (char)(codim + '0');
    \n+
    268
    \n+
    269 dofSpace[ codim ] = createDofSpace( mesh, name, ndof );
    \n+
    270 assert( dofSpace[ codim ] );
    \n+
    271 }
    \n+
    272 };
    \n+
    273
    \n
    274
    \n-
    275 const int ti = Alberta::applyInverseTwist< mydimension >( twist_, i );
    \n-
    276 const int k = mapVertices( subEntity_, ti );
    \n-
    277 const Alberta::GlobalVector &coord = grid_.getCoord( elementInfo_, k );
    \n-
    278 for( int j = 0; j < coorddimension; ++j )
    \n-
    279 x[ j ] = coord[ j ];
    \n-
    280 }
    \n-
    \n-
    281
    \n-
    \n-
    282 bool hasDeterminant () const
    \n-
    283 {
    \n-
    284 return false;
    \n-
    285 }
    \n-
    \n-
    286
    \n-
    \n-\n-
    288 {
    \n-
    289 assert( false );
    \n-
    290 return ctype( 0 );
    \n-
    291 }
    \n-
    \n-
    292
    \n-
    293 private:
    \n-
    294 static int mapVertices ( int subEntity, int i )
    \n-
    295 {
    \n-\n-
    297 }
    \n-
    298 };
    \n-
    \n-
    299
    \n-
    300
    \n-
    301
    \n-
    302
    \n-
    303 // AlbertaGridIntersectionBase::LocalCoordReader
    \n-
    304 // ---------------------------------------------
    \n-
    305
    \n-
    306 template< class GridImp >
    \n-
    \n-\n-
    308 {
    \n-
    309 typedef typename std::remove_const< GridImp >::type Grid;
    \n-
    310
    \n-
    311 static const int dimension = Grid::dimension;
    \n-
    312 static const int codimension = 1;
    \n-
    313 static const int mydimension = dimension - codimension;
    \n-
    314 static const int coorddimension = dimension;
    \n-
    315
    \n-\n-
    317
    \n-
    318 typedef FieldVector< ctype, coorddimension > Coordinate;
    \n-
    319
    \n-
    320 typedef typename Grid::template Codim< 0 >::Geometry ElementGeometry;
    \n-
    321 typedef typename Grid::template Codim< 1 >::Geometry FaceGeometry;
    \n-
    322
    \n-
    323 private:
    \n-
    324 const ElementGeometry &elementGeometry_;
    \n-
    325 const FaceGeometry &faceGeometry_;
    \n-
    326
    \n-
    327 public:
    \n-
    \n-
    328 LocalCoordReader ( const ElementGeometry &elementGeometry,
    \n-
    329 const FaceGeometry &faceGeometry )
    \n-
    330 : elementGeometry_( elementGeometry ),
    \n-
    331 faceGeometry_( faceGeometry )
    \n-
    332 {}
    \n-
    \n-
    333
    \n-
    \n-
    334 void coordinate ( int i, Coordinate &x ) const
    \n-
    335 {
    \n-
    336 x = elementGeometry_.local( faceGeometry_.corner( i ) );
    \n-
    337 }
    \n-
    \n-
    338
    \n-
    \n-
    339 bool hasDeterminant () const
    \n-
    340 {
    \n-
    341 return false;
    \n-
    342 }
    \n-
    \n-
    343
    \n-
    \n-\n-
    345 {
    \n-
    346 return ctype( 0 );
    \n-
    347 }
    \n-
    \n-
    348 };
    \n-
    \n-
    349
    \n-
    350
    \n-
    351
    \n-
    352 // AlbertaGridLeafIntersection
    \n-
    353 // ---------------------------
    \n-
    354
    \n-
    355 template< class GridImp >
    \n-
    \n-\n-
    357 {
    \n-
    358 assert( oppVertex_ <= dimension );
    \n-
    359 ++oppVertex_;
    \n-
    360 neighborInfo_ = ElementInfo();
    \n-
    361 }
    \n-
    \n-
    362
    \n-
    363 template< class GridImp >
    \n-
    364 inline typename GridImp::template Codim< 0 >::Entity
    \n-
    \n-\n-
    366 {
    \n-\n-
    368
    \n-
    369 if( !neighborInfo_ )
    \n-
    370 {
    \n-
    371 assert( neighbor() );
    \n-
    372
    \n-
    373 neighborInfo_ = elementInfo().leafNeighbor( oppVertex_ );
    \n-
    374 }
    \n-
    375
    \n-
    376 assert( !neighborInfo_ == false );
    \n-
    377 assert( neighborInfo_.el() != NULL );
    \n-
    378 return EntityImp( grid(), neighborInfo_, 0 );
    \n-
    379 }
    \n-
    \n-
    380
    \n-
    381 template< class GridImp >
    \n-
    \n-\n-
    383 {
    \n-
    384 assert( oppVertex_ <= dimension );
    \n-
    385 return elementInfo().hasLeafNeighbor( oppVertex_ );
    \n-
    386 }
    \n-
    \n-
    387
    \n-
    388
    \n-
    389 template< class GridImp >
    \n-\n-
    \n-\n-
    392 {
    \n-
    393 typedef AlbertaGridLocalGeometryProvider< GridImp > LocalGeoProvider;
    \n-
    394 const int twist = elementInfo().template twist< 1 >( oppVertex_ );
    \n-
    395 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);
    \n-
    396 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face, twist ) );
    \n-
    397 }
    \n-
    \n-
    398
    \n-
    399
    \n-
    400 template< class GridImp >
    \n-\n-
    \n-\n-
    403 {
    \n-
    404 assert( neighbor() );
    \n-
    405
    \n-
    406 typedef AlbertaGridLocalGeometryProvider< GridImp > LocalGeoProvider;
    \n-
    407 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();
    \n-
    408 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];
    \n-
    409 const int twist = elementInfo().twistInNeighbor( oppVertex_ );
    \n-
    410 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);
    \n-
    411 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face, twist ) );
    \n-
    412 }
    \n-
    \n-
    413
    \n-
    414
    \n-
    415 template< class GridImp >
    \n-\n-
    \n-\n-
    418 {
    \n-
    419 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);
    \n-
    420 const GlobalCoordReader coordReader( grid(), elementInfo(), face );
    \n-
    421 return Geometry( GeometryImpl( coordReader ) );
    \n-
    422 }
    \n-
    \n-
    423
    \n-
    424
    \n-
    425 template< class GridImp >
    \n-
    \n-\n-
    427 {
    \n-
    428 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();
    \n-
    429 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];
    \n-
    430 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);
    \n-
    431 return grid().alberta2generic( 1, face );
    \n-
    432 }
    \n-
    \n-
    433
    \n-
    434} // namespace Dune
    \n-
    435
    \n-
    436#endif // #ifndef DUNE_ALBERTA_INTERSECTION_CC
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n+
    275
    \n+
    276 // HierarchyDofNumbering::CacheDofSpace
    \n+
    277 // ------------------------------------
    \n+
    278
    \n+
    279 template< int dim >
    \n+
    280 template< int codim >
    \n+
    281 struct HierarchyDofNumbering< dim >::CacheDofSpace
    \n+
    282 {
    \n+
    283 static void apply ( const DofSpace *(&dofSpace)[ dim+1 ], Cache (&cache)[ dim+1 ] )
    \n+
    284 {
    \n+
    285 assert( dofSpace[ codim ] );
    \n+
    286 const int codimtype = CodimType< dim, codim >::value;
    \n+
    287 cache[ codim ].first = dofSpace[ codim ]->mesh->node[ codimtype ];
    \n+
    288 cache[ codim ].second = dofSpace[ codim ]->admin->n0_dof[ codimtype ];
    \n+
    289 }
    \n+
    290 };
    \n+
    291
    \n+
    292 } // namespace Alberta
    \n+
    293
    \n+
    294} // namespace Dune
    \n+
    295
    \n+
    296#endif // #if HAVE_ALBERTA
    \n+
    297
    \n+
    298#endif // #ifndef DUNE_ALBERTA_DOFADMIN_HH
    \n
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n+\n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA REAL Real
    Definition misc.hh:48
    \n-
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n+
    ALBERTA EL Element
    Definition misc.hh:54
    \n+
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n+\n+
    Definition dofadmin.hh:36
    \n+
    static const int dimension
    Definition dofadmin.hh:42
    \n+
    DofAccess()
    Definition dofadmin.hh:47
    \n+
    static const int codimension
    Definition dofadmin.hh:43
    \n+
    static const int numSubEntities
    Definition dofadmin.hh:40
    \n+
    DofAccess(const DofSpace *dofSpace)
    Definition dofadmin.hh:51
    \n+
    int operator()(const Element *element, int subEntity, int i) const
    Definition dofadmin.hh:58
    \n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition dofadmin.hh:45
    \n+
    Definition dofadmin.hh:93
    \n+
    HierarchyDofNumbering()
    Definition dofadmin.hh:114
    \n+
    int operator()(const Element *element, int codim, unsigned int subEntity) const
    Definition dofadmin.hh:127
    \n+
    const MeshPointer & mesh() const
    Definition dofadmin.hh:158
    \n+
    void create(const MeshPointer &mesh)
    Definition dofadmin.hh:199
    \n+
    ~HierarchyDofNumbering()
    Definition dofadmin.hh:122
    \n+
    Alberta::MeshPointer< dimension > MeshPointer
    Definition dofadmin.hh:99
    \n+
    int size(int codim) const
    Definition dofadmin.hh:163
    \n+
    const DofSpace * dofSpace(int codim) const
    Definition dofadmin.hh:145
    \n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition dofadmin.hh:100
    \n+
    static const int dimension
    Definition dofadmin.hh:97
    \n+
    const DofSpace * emptyDofSpace() const
    Definition dofadmin.hh:152
    \n+
    void release()
    Definition dofadmin.hh:170
    \n \n-
    LocalGeometry geometryInOutside() const
    Definition intersection.cc:402
    \n-
    GridImp::template Codim< 0 >::Entity outside() const
    Definition intersection.cc:365
    \n-
    void next()
    Definition intersection.cc:356
    \n-
    Base::GeometryImpl GeometryImpl
    Definition albertagrid/intersection.hh:130
    \n-
    int indexInOutside() const
    Definition intersection.cc:426
    \n-
    LocalGeometry geometryInInside() const
    Definition intersection.cc:391
    \n-
    Base::GlobalCoordReader GlobalCoordReader
    Definition albertagrid/intersection.hh:133
    \n-
    Base::Geometry Geometry
    Definition albertagrid/intersection.hh:122
    \n-
    Geometry geometry() const
    Definition intersection.cc:417
    \n-
    bool neighbor() const
    Definition intersection.cc:382
    \n-
    Base::LocalGeometry LocalGeometry
    Definition albertagrid/intersection.hh:123
    \n-
    Definition albertagrid/entity.hh:46
    \n-
    Definition albertagrid/geometry.hh:504
    \n-\n-
    FieldVector< ctype, coorddimension > Coordinate
    Definition intersection.cc:252
    \n-
    Alberta::Real ctype
    Definition intersection.cc:249
    \n-
    std::remove_const< GridImp >::type Grid
    Definition intersection.cc:242
    \n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition intersection.cc:251
    \n-
    ctype determinant() const
    Definition intersection.cc:287
    \n-
    bool hasDeterminant() const
    Definition intersection.cc:282
    \n-
    GlobalCoordReader(const GridImp &grid, const ElementInfo &elementInfo, int subEntity)
    Definition intersection.cc:261
    \n-
    void coordinate(int i, Coordinate &x) const
    Definition intersection.cc:270
    \n-\n-
    Grid::template Codim< 1 >::Geometry FaceGeometry
    Definition intersection.cc:321
    \n-
    Alberta::Real ctype
    Definition intersection.cc:316
    \n-
    LocalCoordReader(const ElementGeometry &elementGeometry, const FaceGeometry &faceGeometry)
    Definition intersection.cc:328
    \n-
    std::remove_const< GridImp >::type Grid
    Definition intersection.cc:309
    \n-
    void coordinate(int i, Coordinate &x) const
    Definition intersection.cc:334
    \n-
    bool hasDeterminant() const
    Definition intersection.cc:339
    \n-
    ctype determinant() const
    Definition intersection.cc:344
    \n-
    FieldVector< ctype, coorddimension > Coordinate
    Definition intersection.cc:318
    \n-
    Grid::template Codim< 0 >::Geometry ElementGeometry
    Definition intersection.cc:320
    \n-
    Definition albertagrid/intersection.hh:32
    \n-
    NormalVector centerOuterNormal() const
    Definition intersection.cc:171
    \n-
    const ElementInfo & elementInfo() const
    Definition intersection.cc:228
    \n-
    FieldVector< ctype, dimensionworld > NormalVector
    Definition albertagrid/intersection.hh:41
    \n-
    NormalVector centerIntegrationOuterNormal() const
    Definition intersection.cc:90
    \n-
    Grid::ctype ctype
    Definition albertagrid/intersection.hh:36
    \n-
    NormalVector integrationOuterNormal(const LocalCoordType &local) const
    Definition intersection.cc:189
    \n-
    ElementInfo elementInfo_
    Definition albertagrid/intersection.hh:93
    \n-
    FieldVector< ctype, dimension-1 > LocalCoordType
    Definition albertagrid/intersection.hh:42
    \n-
    NormalVector centerUnitOuterNormal() const
    Definition intersection.cc:179
    \n-
    int indexInInside() const
    Definition intersection.cc:74
    \n-
    Entity inside() const
    Definition intersection.cc:35
    \n-
    NormalVector unitOuterNormal(const LocalCoordType &local) const
    Definition intersection.cc:205
    \n-
    const Grid & grid() const
    Definition intersection.cc:220
    \n-
    static const int dimension
    Definition albertagrid/intersection.hh:38
    \n-
    bool boundary() const
    Definition intersection.cc:43
    \n-
    size_t boundarySegmentIndex() const
    Definition intersection.cc:64
    \n-
    GeometryType type() const
    Definition intersection.cc:82
    \n-
    AlbertaTransformation transformation() const
    Definition intersection.cc:213
    \n-
    NormalVector outerNormal(const LocalCoordType &local) const
    Definition intersection.cc:197
    \n-
    int boundaryId() const
    Definition intersection.cc:50
    \n-
    const Grid * grid_
    Definition albertagrid/intersection.hh:92
    \n-
    Definition misc.hh:443
    \n-
    Definition albertagrid/projection.hh:208
    \n-
    unsigned int boundaryIndex() const
    Definition albertagrid/projection.hh:218
    \n-
    Definition transformation.hh:18
    \n-
    GridImp::template Codim< cd >::Geometry Geometry
    The corresponding geometry type.
    Definition common/entity.hh:100
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-\n+
    Element * el() const
    Definition elementinfo.hh:737
    \n+
    Definition misc.hh:148
    \n+
    Definition misc.hh:192
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,671 +1,403 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-intersection.cc\n+dofadmin.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_INTERSECTION_CC\n-6#define DUNE_ALBERTA_INTERSECTION_CC\n+5#ifndef DUNE_ALBERTA_DOFADMIN_HH\n+6#define DUNE_ALBERTA_DOFADMIN_HH\n 7\n-8#include \n+8#include \n 9\n-10namespace Dune\n-11{\n-12\n-13 // AlbertaGridIntersectionBase\n-14 // ---------------------------\n-15\n-16 template< class Grid >\n-17 inline AlbertaGridIntersectionBase< Grid >\n-18 ::AlbertaGridIntersectionBase ()\n-19 : grid_( nullptr ),\n-20 elementInfo_(),\n-21 oppVertex_( -1 ) // mark invalid intersection\n-22 {}\n-23\n-24 template< class Grid >\n-25 inline AlbertaGridIntersectionBase<_Grid_>\n-26_::AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex\n-)\n-27 : grid_( &entity.grid() ),\n-28 elementInfo_( entity.elementInfo() ),\n-29 oppVertex_( oppVertex )\n-30 {}\n-31\n-32\n-33 template< class Grid >\n-34 inline typename Grid::template Codim< 0 >::Entity\n-35 AlbertaGridIntersectionBase<_Grid_>::inside () const\n+10#include \n+11\n+12#include \n+13#include \n+14\n+15#if HAVE_ALBERTA\n+16\n+17namespace Dune\n+18{\n+19\n+20 namespace Alberta\n+21 {\n+22\n+23 // External Forward Declarations\n+24 // -----------------------------\n+25\n+26 template< int dim >\n+27 class MeshPointer;\n+28\n+29\n+30\n+31 // DofAccess\n+32 // ---------\n+33\n+34 template< int dim, int codim >\n+35 class DofAccess\n 36 {\n-37 typedef AlbertaGridEntity<_0,_Grid::dimension,_Grid_> EntityImp;\n-38 return EntityImp( grid(), elementInfo(), 0 );\n-39 }\n-40\n+37 static const int codimtype = CodimType<_dim,_codim_>::value;\n+38\n+39 public:\n+40 static const int numSubEntities = NumSubEntities<_dim,_codim_>::value;\n 41\n-42 template< class Grid >\n-43 inline bool AlbertaGridIntersectionBase<_Grid_>::boundary () const\n-44 {\n-45 return elementInfo().isBoundary( oppVertex_ );\n-46 }\n-47\n-48\n-49 template< class Grid >\n-50 inline int AlbertaGridIntersectionBase<_Grid_>::boundaryId () const\n-51 {\n-52 if( boundary() )\n-53 {\n-54 const int id = elementInfo().boundaryId( oppVertex_ );\n-55 assert( id != 0 );\n-56 return id;\n-57 }\n-58 else\n-59 return 0;\n-60 }\n-61\n-62\n-63 template< class Grid >\n-64 inline size_t AlbertaGridIntersectionBase<_Grid_>::boundarySegmentIndex ()\n+42 static const int dimension = dim;\n+43 static const int codimension = codim;\n+44\n+45 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+46\n+47 DofAccess ()\n+48 : node_( -1 )\n+49 {}\n+50\n+51 explicit DofAccess ( const DofSpace *dofSpace )\n+52 {\n+53 assert( dofSpace );\n+54 node_ = dofSpace->admin->mesh->node[ codimtype ];\n+55 index_ = dofSpace->admin->n0_dof[ codimtype ];\n+56 }\n+57\n+58 int operator()_( const Element *element, int subEntity, int i ) const\n+59 {\n+60 assert( element );\n+61 assert( node_ != -1 );\n+62 assert( subEntity < numSubEntities );\n+63 return element->dof[ node_ + subEntity ][ index_ + i ];\n+64 }\n+65\n+66 int operator()_( const Element *element, int subEntity ) const\n+67 {\n+68 return (*this)( element, subEntity, 0 );\n+69 }\n+70\n+71 int operator()_( const ElementInfo &elementInfo, int subEntity, int i )\n const\n-65 {\n-66 assert( boundary() );\n-67 const Alberta::BasicNodeProjection *projection = elementInfo\n-().boundaryProjection( oppVertex_ );\n-68 assert( projection );\n-69 return projection->boundaryIndex();\n-70 }\n-71\n-72\n-73 template< class Grid >\n-74 inline int AlbertaGridIntersectionBase<_Grid_>::indexInInside () const\n-75 {\n-76 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);\n-77 return grid().alberta2generic( 1, face );\n-78 }\n-79\n+72 {\n+73 return (*this)( elementInfo.el(), subEntity, i );\n+74 }\n+75\n+76 int operator()_( const ElementInfo &elementInfo, int subEntity ) const\n+77 {\n+78 return (*this)( elementInfo.el(), subEntity );\n+79 }\n 80\n-81 template< class Grid >\n-82 inline GeometryType AlbertaGridIntersectionBase<_Grid_>::type () const\n-83 {\n-84 return GeometryTypes::simplex( dimension-1 );\n-85 }\n+81 private:\n+82 int node_;\n+83 int index_;\n+84 };\n+85\n 86\n 87\n-88 template< class Grid >\n-89 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n-90 AlbertaGridIntersectionBase<_Grid_>::centerIntegrationOuterNormal () const\n-91 {\n-92 const typename Entity::Geometry geoInside = inside().geometry();\n-93\n-94 const int face = indexInInside();\n-95 auto refSimplex = ReferenceElements< ctype, dimension >::simplex();\n-96 FieldVector< ctype, dimension > refNormal =\n-refSimplex.integrationOuterNormal( face );\n-97\n-98 const typename Entity::Geometry::JacobianInverseTransposed &jInvT\n-99 = geoInside.impl().jacobianInverseTransposed();\n-100\n-101 NormalVector normal;\n-102 jInvT.mv( refNormal, normal );\n-103 normal *= geoInside.impl().integrationElement();\n+88 // HierarchyDofNumbering\n+89 // ---------------------\n+90\n+91 template< int dim >\n+92 class HierarchyDofNumbering\n+93 {\n+94 typedef HierarchyDofNumbering<_dim_> This;\n+95\n+96 public:\n+97 static const int dimension = dim;\n+98\n+99 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n+100 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+101\n+102 private:\n+103 static const int nNodeTypes = N_NODE_TYPES;\n 104\n-105 return normal;\n-106 }\n+105 template< int codim >\n+106 struct CreateDofSpace;\n 107\n-108 template<>\n-109 inline AlbertaGridIntersectionBase<_const_AlbertaGrid<_1,_1_> >::\n-NormalVector\n-110 AlbertaGridIntersectionBase<_const_AlbertaGrid<_1,_1_> >::\n-centerIntegrationOuterNormal () const\n-111 {\n-112 const Alberta::GlobalVector &oppCoord = grid().getCoord( elementInfo(),\n-oppVertex_ );\n-113 const Alberta::GlobalVector &myCoord = grid().getCoord( elementInfo(), 1-\n-oppVertex_ );\n-114 NormalVector n;\n-115 n[ 0 ] = (myCoord[ 0 ] > oppCoord[ 0 ] ? ctype( 1 ) : -ctype( 1 ));\n-116 return n;\n-117 }\n-118\n-119#if defined GRIDDIM && GRIDDIM > 1\n-120 template<>\n-121 inline AlbertaGridIntersectionBase<_const_AlbertaGrid<_2,_2_> >::\n-NormalVector\n-122 AlbertaGridIntersectionBase<_const_AlbertaGrid<_2,_2_> >::\n-centerIntegrationOuterNormal () const\n+108 template< int codim >\n+109 struct CacheDofSpace;\n+110\n+111 typedef std::pair< int, int > Cache;\n+112\n+113 public:\n+114 HierarchyDofNumbering ()\n+115 {}\n+116\n+117 private:\n+118 HierarchyDofNumbering ( const This & );\n+119 This &operator= ( const This & );\n+120\n+121 public:\n+122 ~HierarchyDofNumbering ()\n 123 {\n-124 const Alberta::GlobalVector &coordOne = grid().getCoord( elementInfo(),\n-(oppVertex_+1)%3 );\n-125 const Alberta::GlobalVector &coordTwo = grid().getCoord( elementInfo(),\n-(oppVertex_+2)%3 );\n+124 release();\n+125 }\n 126\n-127 NormalVector n;\n-128 n[ 0 ] = -(coordOne[ 1 ] - coordTwo[ 1 ]);\n-129 n[ 1 ] = coordOne[ 0 ] - coordTwo[ 0 ];\n-130 return n;\n-131 }\n-132#endif // defined GRIDDIM && GRIDDIM > 1\n-133\n-134 template<>\n-135 inline AlbertaGridIntersectionBase< const AlbertaGrid< 3, 3 > >::\n-NormalVector\n-136 AlbertaGridIntersectionBase<_const_AlbertaGrid<_3,_3_> >::\n-centerIntegrationOuterNormal () const\n-137 {\n-138 // in this case the orientation is negative, multiply by -1\n-139 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();\n-140 const ctype val = (elInfo.orientation > 0) ? 1.0 : -1.0;\n-141\n-142 static const int faceVertices[ 4 ][ 3 ]\n-143 = { {1,3,2}, {0,2,3}, {0,3,1}, {0,1,2} };\n-144 const int *localFaces = faceVertices[ oppVertex_ ];\n-145\n-146 const Alberta::GlobalVector &coord0 = grid().getCoord( elementInfo(),\n-localFaces[ 0 ] );\n-147 const Alberta::GlobalVector &coord1 = grid().getCoord( elementInfo(),\n-localFaces[ 1 ] );\n-148 const Alberta::GlobalVector &coord2 = grid().getCoord( elementInfo(),\n-localFaces[ 2 ] );\n-149\n-150 FieldVector< ctype, dimensionworld > u;\n-151 FieldVector< ctype, dimensionworld > v;\n-152 for( int i = 0; i < dimension; ++i )\n+127 int operator()_( const Element *element, int codim, unsigned int subEntity\n+) const\n+128 {\n+129 assert( !(*this) == false );\n+130 assert( (codim >= 0) && (codim <= dimension) );\n+131 const Cache &cache = cache_[ codim ];\n+132 return element->dof[ cache.first + subEntity ][ cache.second ];\n+133 }\n+134\n+135 int operator()_( const ElementInfo &element, int codim, unsigned int\n+subEntity ) const\n+136 {\n+137 return (*this)( element.el(), codim, subEntity );\n+138 }\n+139\n+140 explicit operator bool () const\n+141 {\n+142 return (bool)mesh_;\n+143 }\n+144\n+145 const DofSpace *dofSpace ( int codim ) const\n+146 {\n+147 assert( *this );\n+148 assert( (codim >= 0) && (codim <= dimension) );\n+149 return dofSpace_[ codim ];\n+150 }\n+151\n+152 const DofSpace *emptyDofSpace () const\n 153 {\n-154 v[ i ] = coord1[ i ] - coord0[ i ];\n-155 u[ i ] = coord2[ i ] - coord1[ i ];\n+154 assert( *this );\n+155 return emptySpace_;\n 156 }\n 157\n-158 NormalVector n;\n-159 for( int i = 0; i < dimension; ++i )\n-160 {\n-161 const int j = (i+1)%dimension;\n-162 const int k = (i+2)%dimension;\n-163 n[ i ] = val * (u[ j ] * v[ k ] - u[ k ] * v[ j ]);\n-164 }\n-165 return n;\n+158 const MeshPointer &mesh () const\n+159 {\n+160 return mesh_;\n+161 }\n+162\n+163 int size ( int codim ) const\n+164 {\n+165 return dofSpace( codim )->admin->size;\n 166 }\n 167\n-168\n-169 template< class Grid >\n-170 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n-171 AlbertaGridIntersectionBase<_Grid_>::centerOuterNormal() const\n-172 {\n-173 return centerIntegrationOuterNormal();\n-174 }\n-175\n-176\n-177 template< class Grid >\n-178 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n-179 AlbertaGridIntersectionBase<_Grid_>::centerUnitOuterNormal () const\n-180 {\n-181 NormalVector normal = centerOuterNormal();\n-182 normal *= (1.0 / normal.two_norm());\n-183 return normal;\n-184 }\n-185\n-186\n-187 template< class Grid >\n-188 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n-189 AlbertaGridIntersectionBase<_Grid_>::integrationOuterNormal ( const\n-LocalCoordType & ) const\n-190 {\n-191 return centerIntegrationOuterNormal();\n-192 }\n-193\n+168 void create ( const MeshPointer &mesh );\n+169\n+170 void release ()\n+171 {\n+172 if( *this )\n+173 {\n+174 for( int codim = 0; codim <= dimension; ++codim )\n+175 freeDofSpace( dofSpace_[ codim ] );\n+176 freeDofSpace( emptySpace_ );\n+177 mesh_ = MeshPointer();\n+178 }\n+179 }\n+180\n+181 private:\n+182 static const DofSpace *createEmptyDofSpace ( const MeshPointer &mesh );\n+183 static const DofSpace *createDofSpace ( const MeshPointer &mesh,\n+184 const std::string &name,\n+185 const int (&ndof)[ nNodeTypes ],\n+186 const bool periodic = false );\n+187 static void freeDofSpace ( const DofSpace *dofSpace );\n+188\n+189 MeshPointer mesh_;\n+190 const DofSpace *emptySpace_;\n+191 const DofSpace *dofSpace_[ dimension+1 ];\n+192 Cache cache_[ dimension+1 ];\n+193 };\n 194\n-195 template< class Grid >\n-196 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n-197 AlbertaGridIntersectionBase<_Grid_>::outerNormal( const LocalCoordType & )\n-const\n-198 {\n-199 return centerOuterNormal();\n-200 }\n-201\n+195\n+196\n+197 template< int dim >\n+198 inline void\n+199 HierarchyDofNumbering<_dim_>::create ( const MeshPointer &mesh )\n+200 {\n+201 release();\n 202\n-203 template< class Grid >\n-204 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n-205 AlbertaGridIntersectionBase<_Grid_>::unitOuterNormal ( const LocalCoordType\n-& ) const\n-206 {\n-207 return centerUnitOuterNormal();\n-208 }\n-209\n+203 if( !mesh )\n+204 return;\n+205\n+206 mesh_ = mesh;\n+207\n+208 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i )\n+{ CreateDofSpace< i >::apply( mesh_, dofSpace_ ); } );\n+209 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i )\n+{ CacheDofSpace< i >::apply( dofSpace_, cache_ ); } );\n 210\n-211 template< class Grid >\n-212 inline AlbertaTransformation\n-213 AlbertaGridIntersectionBase<_Grid_>::transformation () const\n-214 {\n-215 return AlbertaTransformation( elementInfo().transformation( oppVertex_ ) );\n-216 }\n+211 emptySpace_ = createEmptyDofSpace( mesh_ );\n+212 for( int i = 0; i < nNodeTypes; ++i )\n+213 assert( emptySpace_->admin->n_dof[ i ] == 0 );\n+214 }\n+215\n+216\n 217\n-218\n-219 template< class Grid >\n-220 inline const Grid &AlbertaGridIntersectionBase<_Grid_>::grid () const\n+218 template< int dim >\n+219 inline const DofSpace *\n+220 HierarchyDofNumbering<_dim_>::createEmptyDofSpace ( const MeshPointer &mesh\n+)\n 221 {\n-222 return *grid_;\n-223 }\n-224\n-225\n-226 template< class Grid >\n-227 inline const typename AlbertaGridIntersectionBase<_Grid_>::ElementInfo &\n-228 AlbertaGridIntersectionBase<_Grid_>::elementInfo () const\n-229 {\n-230 assert( !!elementInfo_ );\n-231 return elementInfo_;\n-232 }\n-233\n-234\n-235\n-236 // AlbertaGridIntersectionBase::GlobalCoordReader\n-237 // ----------------------------------------------\n-238\n-239 template< class GridImp >\n-240 struct AlbertaGridIntersectionBase< GridImp >::GlobalCoordReader\n-241 {\n-242 typedef typename std::remove_const< GridImp >::type Grid;\n-243\n-244 static const int dimension = Grid::dimension;\n-245 static const int codimension = 1;\n-246 static const int mydimension = dimension - codimension;\n-247 static const int coorddimension = Grid::dimensionworld;\n-248\n-249 typedef Alberta::Real ctype;\n+222 int ndof[ nNodeTypes ];\n+223 for( int i = 0; i < nNodeTypes; ++i )\n+224 ndof[ i ] = 0;\n+225 std::string name = \"Empty\";\n+226 return createDofSpace( mesh, name, ndof );\n+227 }\n+228\n+229\n+230 template< int dim >\n+231 inline const DofSpace *\n+232 HierarchyDofNumbering< dim >::createDofSpace ( const MeshPointer &mesh,\n+233 const std::string &name,\n+234 const int (&ndof)[ nNodeTypes ],\n+235 const bool periodic )\n+236 {\n+237 const ALBERTA FLAGS flags\n+238 = ADM_PRESERVE_COARSE_DOFS | (periodic ? ADM_PERIODIC : 0);\n+239 return ALBERTA get_dof_space ( mesh, name.c_str(), ndof, flags );\n+240 }\n+241\n+242\n+243 template< int dim >\n+244 inline void\n+245 HierarchyDofNumbering< dim >::freeDofSpace ( const DofSpace *dofSpace )\n+246 {\n+247 ALBERTA free_fe_space( dofSpace );\n+248 }\n+249\n 250\n-251 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-252 typedef FieldVector< ctype, coorddimension > Coordinate;\n-253\n-254 private:\n-255 const Grid &grid_;\n-256 const ElementInfo &elementInfo_;\n-257 const int subEntity_;\n-258 const int twist_;\n-259\n-260 public:\n-261 GlobalCoordReader ( const GridImp &grid,\n-262 const ElementInfo &elementInfo,\n-263 int subEntity )\n-264 : grid_( grid ),\n-265 elementInfo_( elementInfo ),\n-266 subEntity_( subEntity ),\n-267 twist_( elementInfo.template twist< codimension >( subEntity ) )\n-268 {}\n-269\n-270 void coordinate ( int i, Coordinate &x ) const\n-271 {\n-272 assert( !elementInfo_ == false );\n-273 assert( (i >= 0) && (i <= mydimension) );\n+251\n+252 // HierarchyDofNumbering::CreateDofSpace\n+253 // -------------------------------------\n+254\n+255 template< int dim >\n+256 template< int codim >\n+257 struct HierarchyDofNumbering< dim >::CreateDofSpace\n+258 {\n+259 static void apply ( const MeshPointer &mesh, const DofSpace *(&dofSpace)\n+[ dim+1 ] )\n+260 {\n+261 int ndof[ nNodeTypes ];\n+262 for( int i = 0; i < nNodeTypes; ++i )\n+263 ndof[ i ] = 0;\n+264 ndof[ CodimType< dim, codim >::value ] = 1;\n+265\n+266 std::string name = \"Codimension \";\n+267 name += (char)(codim + '0');\n+268\n+269 dofSpace[ codim ] = createDofSpace( mesh, name, ndof );\n+270 assert( dofSpace[ codim ] );\n+271 }\n+272 };\n+273\n 274\n-275 const int ti = Alberta::applyInverseTwist< mydimension >( twist_, i );\n-276 const int k = mapVertices( subEntity_, ti );\n-277 const Alberta::GlobalVector &coord = grid_.getCoord( elementInfo_, k );\n-278 for( int j = 0; j < coorddimension; ++j )\n-279 x[ j ] = coord[ j ];\n-280 }\n-281\n-282 bool hasDeterminant () const\n-283 {\n-284 return false;\n-285 }\n-286\n-287 ctype determinant () const\n-288 {\n-289 assert( false );\n-290 return ctype( 0 );\n-291 }\n-292\n-293 private:\n-294 static int mapVertices ( int subEntity, int i )\n-295 {\n-296 return Alberta::MapVertices<_dimension,_codimension_>::apply( subEntity, i\n-);\n-297 }\n-298 };\n-299\n-300\n-301\n-302\n-303 // AlbertaGridIntersectionBase::LocalCoordReader\n-304 // ---------------------------------------------\n-305\n-306 template< class GridImp >\n-307 struct AlbertaGridIntersectionBase< GridImp >::LocalCoordReader\n-308 {\n-309 typedef typename std::remove_const< GridImp >::type Grid;\n-310\n-311 static const int dimension = Grid::dimension;\n-312 static const int codimension = 1;\n-313 static const int mydimension = dimension - codimension;\n-314 static const int coorddimension = dimension;\n-315\n-316 typedef Alberta::Real ctype;\n-317\n-318 typedef FieldVector< ctype, coorddimension > Coordinate;\n-319\n-320 typedef typename Grid::template Codim< 0 >::Geometry ElementGeometry;\n-321 typedef typename Grid::template Codim< 1 >::Geometry FaceGeometry;\n-322\n-323 private:\n-324 const ElementGeometry &elementGeometry_;\n-325 const FaceGeometry &faceGeometry_;\n-326\n-327 public:\n-328 LocalCoordReader ( const ElementGeometry &elementGeometry,\n-329 const FaceGeometry &faceGeometry )\n-330 : elementGeometry_( elementGeometry ),\n-331 faceGeometry_( faceGeometry )\n-332 {}\n-333\n-334 void coordinate ( int i, Coordinate &x ) const\n-335 {\n-336 x = elementGeometry_.local( faceGeometry_.corner( i ) );\n-337 }\n-338\n-339 bool hasDeterminant () const\n-340 {\n-341 return false;\n-342 }\n-343\n-344 ctype determinant () const\n-345 {\n-346 return ctype( 0 );\n-347 }\n-348 };\n-349\n-350\n-351\n-352 // AlbertaGridLeafIntersection\n-353 // ---------------------------\n-354\n-355 template< class GridImp >\n-356 inline void AlbertaGridLeafIntersection::next ()\n-357 {\n-358 assert( oppVertex_ <= dimension );\n-359 ++oppVertex_;\n-360 neighborInfo_ = ElementInfo();\n-361 }\n-362\n-363 template< class GridImp >\n-364 inline typename GridImp::template Codim< 0 >::Entity\n-365 AlbertaGridLeafIntersection<_GridImp_>::outside () const\n-366 {\n-367 typedef AlbertaGridEntity<_0,_GridImp::dimension,_GridImp_> EntityImp;\n-368\n-369 if( !neighborInfo_ )\n-370 {\n-371 assert( neighbor() );\n-372\n-373 neighborInfo_ = elementInfo().leafNeighbor( oppVertex_ );\n-374 }\n-375\n-376 assert( !neighborInfo_ == false );\n-377 assert( neighborInfo_.el() != NULL );\n-378 return EntityImp( grid(), neighborInfo_, 0 );\n-379 }\n-380\n-381 template< class GridImp >\n-382 inline bool AlbertaGridLeafIntersection<_GridImp_>::neighbor () const\n-383 {\n-384 assert( oppVertex_ <= dimension );\n-385 return elementInfo().hasLeafNeighbor( oppVertex_ );\n-386 }\n-387\n-388\n-389 template< class GridImp >\n-390 inline typename AlbertaGridLeafIntersection<_GridImp_>::LocalGeometry\n-391 AlbertaGridLeafIntersection<_GridImp_>::geometryInInside () const\n-392 {\n-393 typedef AlbertaGridLocalGeometryProvider<_GridImp_> LocalGeoProvider;\n-394 const int twist = elementInfo().template twist< 1 >( oppVertex_ );\n-395 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);\n-396 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face,\n-twist ) );\n-397 }\n-398\n-399\n-400 template< class GridImp >\n-401 inline typename AlbertaGridLeafIntersection<_GridImp_>::LocalGeometry\n-402 AlbertaGridLeafIntersection<_GridImp_>::geometryInOutside () const\n-403 {\n-404 assert( neighbor() );\n-405\n-406 typedef AlbertaGridLocalGeometryProvider<_GridImp_> LocalGeoProvider;\n-407 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();\n-408 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];\n-409 const int twist = elementInfo().twistInNeighbor( oppVertex_ );\n-410 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);\n-411 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face,\n-twist ) );\n-412 }\n-413\n-414\n-415 template< class GridImp >\n-416 inline typename AlbertaGridLeafIntersection<_GridImp_>::Geometry\n-417 AlbertaGridLeafIntersection<_GridImp_>::geometry () const\n-418 {\n-419 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);\n-420 const GlobalCoordReader coordReader( grid(), elementInfo(), face );\n-421 return Geometry( GeometryImpl( coordReader ) );\n-422 }\n-423\n-424\n-425 template< class GridImp >\n-426 inline int AlbertaGridLeafIntersection<_GridImp_>::indexInOutside () const\n-427 {\n-428 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();\n-429 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];\n-430 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);\n-431 return grid().alberta2generic( 1, face );\n-432 }\n-433\n-434} // namespace Dune\n-435\n-436#endif // #ifndef DUNE_ALBERTA_INTERSECTION_CC\n+275\n+276 // HierarchyDofNumbering::CacheDofSpace\n+277 // ------------------------------------\n+278\n+279 template< int dim >\n+280 template< int codim >\n+281 struct HierarchyDofNumbering< dim >::CacheDofSpace\n+282 {\n+283 static void apply ( const DofSpace *(&dofSpace)[ dim+1 ], Cache (&cache)\n+[ dim+1 ] )\n+284 {\n+285 assert( dofSpace[ codim ] );\n+286 const int codimtype = CodimType< dim, codim >::value;\n+287 cache[ codim ].first = dofSpace[ codim ]->mesh->node[ codimtype ];\n+288 cache[ codim ].second = dofSpace[ codim ]->admin->n0_dof[ codimtype ];\n+289 }\n+290 };\n+291\n+292 } // namespace Alberta\n+293\n+294} // namespace Dune\n+295\n+296#endif // #if HAVE_ALBERTA\n+297\n+298#endif // #ifndef DUNE_ALBERTA_DOFADMIN_HH\n+elementinfo.hh\n+provides a wrapper for ALBERTA's el_info structure\n+misc.hh\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::Real\n-ALBERTA REAL Real\n-Definition misc.hh:48\n-Dune::Alberta::GlobalVector\n-ALBERTA REAL_D GlobalVector\n-Definition misc.hh:50\n-Dune::Alberta::ElementInfo<_dimension_>\n-Dune::AlbertaGridLeafIntersection::geometryInOutside\n-LocalGeometry geometryInOutside() const\n-Definition intersection.cc:402\n-Dune::AlbertaGridLeafIntersection::outside\n-GridImp::template Codim< 0 >::Entity outside() const\n-Definition intersection.cc:365\n-Dune::AlbertaGridLeafIntersection::next\n-void next()\n-Definition intersection.cc:356\n-Dune::AlbertaGridLeafIntersection::GeometryImpl\n-Base::GeometryImpl GeometryImpl\n-Definition albertagrid/intersection.hh:130\n-Dune::AlbertaGridLeafIntersection::indexInOutside\n-int indexInOutside() const\n-Definition intersection.cc:426\n-Dune::AlbertaGridLeafIntersection::geometryInInside\n-LocalGeometry geometryInInside() const\n-Definition intersection.cc:391\n-Dune::AlbertaGridLeafIntersection::GlobalCoordReader\n-Base::GlobalCoordReader GlobalCoordReader\n-Definition albertagrid/intersection.hh:133\n-Dune::AlbertaGridLeafIntersection::Geometry\n-Base::Geometry Geometry\n-Definition albertagrid/intersection.hh:122\n-Dune::AlbertaGridLeafIntersection::geometry\n-Geometry geometry() const\n-Definition intersection.cc:417\n-Dune::AlbertaGridLeafIntersection::neighbor\n-bool neighbor() const\n-Definition intersection.cc:382\n-Dune::AlbertaGridLeafIntersection::LocalGeometry\n-Base::LocalGeometry LocalGeometry\n-Definition albertagrid/intersection.hh:123\n-Dune::AlbertaGridEntity\n-Definition albertagrid/entity.hh:46\n-Dune::AlbertaGridLocalGeometryProvider\n-Definition albertagrid/geometry.hh:504\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader\n-Definition intersection.cc:241\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::Coordinate\n-FieldVector< ctype, coorddimension > Coordinate\n-Definition intersection.cc:252\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::ctype\n-Alberta::Real ctype\n-Definition intersection.cc:249\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::Grid\n-std::remove_const< GridImp >::type Grid\n-Definition intersection.cc:242\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::ElementInfo\n+Dune::Alberta::Element\n+ALBERTA EL Element\n+Definition misc.hh:54\n+Dune::Alberta::DofSpace\n+ALBERTA FE_SPACE DofSpace\n+Definition misc.hh:65\n+Dune::Alberta::MeshPointer<_dimension_>\n+Dune::Alberta::DofAccess\n+Definition dofadmin.hh:36\n+Dune::Alberta::DofAccess::dimension\n+static const int dimension\n+Definition dofadmin.hh:42\n+Dune::Alberta::DofAccess::DofAccess\n+DofAccess()\n+Definition dofadmin.hh:47\n+Dune::Alberta::DofAccess::codimension\n+static const int codimension\n+Definition dofadmin.hh:43\n+Dune::Alberta::DofAccess::numSubEntities\n+static const int numSubEntities\n+Definition dofadmin.hh:40\n+Dune::Alberta::DofAccess::DofAccess\n+DofAccess(const DofSpace *dofSpace)\n+Definition dofadmin.hh:51\n+Dune::Alberta::DofAccess::operator()\n+int operator()(const Element *element, int subEntity, int i) const\n+Definition dofadmin.hh:58\n+Dune::Alberta::DofAccess::ElementInfo\n+Alberta::ElementInfo< dimension > ElementInfo\n+Definition dofadmin.hh:45\n+Dune::Alberta::HierarchyDofNumbering\n+Definition dofadmin.hh:93\n+Dune::Alberta::HierarchyDofNumbering::HierarchyDofNumbering\n+HierarchyDofNumbering()\n+Definition dofadmin.hh:114\n+Dune::Alberta::HierarchyDofNumbering::operator()\n+int operator()(const Element *element, int codim, unsigned int subEntity) const\n+Definition dofadmin.hh:127\n+Dune::Alberta::HierarchyDofNumbering::mesh\n+const MeshPointer & mesh() const\n+Definition dofadmin.hh:158\n+Dune::Alberta::HierarchyDofNumbering::create\n+void create(const MeshPointer &mesh)\n+Definition dofadmin.hh:199\n+Dune::Alberta::HierarchyDofNumbering::~HierarchyDofNumbering\n+~HierarchyDofNumbering()\n+Definition dofadmin.hh:122\n+Dune::Alberta::HierarchyDofNumbering::MeshPointer\n+Alberta::MeshPointer< dimension > MeshPointer\n+Definition dofadmin.hh:99\n+Dune::Alberta::HierarchyDofNumbering::size\n+int size(int codim) const\n+Definition dofadmin.hh:163\n+Dune::Alberta::HierarchyDofNumbering::dofSpace\n+const DofSpace * dofSpace(int codim) const\n+Definition dofadmin.hh:145\n+Dune::Alberta::HierarchyDofNumbering::ElementInfo\n Alberta::ElementInfo< dimension > ElementInfo\n-Definition intersection.cc:251\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::determinant\n-ctype determinant() const\n-Definition intersection.cc:287\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::hasDeterminant\n-bool hasDeterminant() const\n-Definition intersection.cc:282\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::GlobalCoordReader\n-GlobalCoordReader(const GridImp &grid, const ElementInfo &elementInfo, int\n-subEntity)\n-Definition intersection.cc:261\n-Dune::AlbertaGridIntersectionBase::GlobalCoordReader::coordinate\n-void coordinate(int i, Coordinate &x) const\n-Definition intersection.cc:270\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader\n-Definition intersection.cc:308\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::FaceGeometry\n-Grid::template Codim< 1 >::Geometry FaceGeometry\n-Definition intersection.cc:321\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::ctype\n-Alberta::Real ctype\n-Definition intersection.cc:316\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::LocalCoordReader\n-LocalCoordReader(const ElementGeometry &elementGeometry, const FaceGeometry\n-&faceGeometry)\n-Definition intersection.cc:328\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::Grid\n-std::remove_const< GridImp >::type Grid\n-Definition intersection.cc:309\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::coordinate\n-void coordinate(int i, Coordinate &x) const\n-Definition intersection.cc:334\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::hasDeterminant\n-bool hasDeterminant() const\n-Definition intersection.cc:339\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::determinant\n-ctype determinant() const\n-Definition intersection.cc:344\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::Coordinate\n-FieldVector< ctype, coorddimension > Coordinate\n-Definition intersection.cc:318\n-Dune::AlbertaGridIntersectionBase::LocalCoordReader::ElementGeometry\n-Grid::template Codim< 0 >::Geometry ElementGeometry\n-Definition intersection.cc:320\n-Dune::AlbertaGridIntersectionBase\n-Definition albertagrid/intersection.hh:32\n-Dune::AlbertaGridIntersectionBase::centerOuterNormal\n-NormalVector centerOuterNormal() const\n-Definition intersection.cc:171\n-Dune::AlbertaGridIntersectionBase::elementInfo\n-const ElementInfo & elementInfo() const\n-Definition intersection.cc:228\n-Dune::AlbertaGridIntersectionBase::NormalVector\n-FieldVector< ctype, dimensionworld > NormalVector\n-Definition albertagrid/intersection.hh:41\n-Dune::AlbertaGridIntersectionBase::centerIntegrationOuterNormal\n-NormalVector centerIntegrationOuterNormal() const\n-Definition intersection.cc:90\n-Dune::AlbertaGridIntersectionBase::ctype\n-Grid::ctype ctype\n-Definition albertagrid/intersection.hh:36\n-Dune::AlbertaGridIntersectionBase::integrationOuterNormal\n-NormalVector integrationOuterNormal(const LocalCoordType &local) const\n-Definition intersection.cc:189\n-Dune::AlbertaGridIntersectionBase::elementInfo_\n-ElementInfo elementInfo_\n-Definition albertagrid/intersection.hh:93\n-Dune::AlbertaGridIntersectionBase::LocalCoordType\n-FieldVector< ctype, dimension-1 > LocalCoordType\n-Definition albertagrid/intersection.hh:42\n-Dune::AlbertaGridIntersectionBase::centerUnitOuterNormal\n-NormalVector centerUnitOuterNormal() const\n-Definition intersection.cc:179\n-Dune::AlbertaGridIntersectionBase::indexInInside\n-int indexInInside() const\n-Definition intersection.cc:74\n-Dune::AlbertaGridIntersectionBase::inside\n-Entity inside() const\n-Definition intersection.cc:35\n-Dune::AlbertaGridIntersectionBase::unitOuterNormal\n-NormalVector unitOuterNormal(const LocalCoordType &local) const\n-Definition intersection.cc:205\n-Dune::AlbertaGridIntersectionBase::grid\n-const Grid & grid() const\n-Definition intersection.cc:220\n-Dune::AlbertaGridIntersectionBase::dimension\n+Definition dofadmin.hh:100\n+Dune::Alberta::HierarchyDofNumbering::dimension\n static const int dimension\n-Definition albertagrid/intersection.hh:38\n-Dune::AlbertaGridIntersectionBase::boundary\n-bool boundary() const\n-Definition intersection.cc:43\n-Dune::AlbertaGridIntersectionBase::boundarySegmentIndex\n-size_t boundarySegmentIndex() const\n-Definition intersection.cc:64\n-Dune::AlbertaGridIntersectionBase::type\n-GeometryType type() const\n-Definition intersection.cc:82\n-Dune::AlbertaGridIntersectionBase::transformation\n-AlbertaTransformation transformation() const\n-Definition intersection.cc:213\n-Dune::AlbertaGridIntersectionBase::outerNormal\n-NormalVector outerNormal(const LocalCoordType &local) const\n-Definition intersection.cc:197\n-Dune::AlbertaGridIntersectionBase::boundaryId\n-int boundaryId() const\n-Definition intersection.cc:50\n-Dune::AlbertaGridIntersectionBase::grid_\n-const Grid * grid_\n-Definition albertagrid/intersection.hh:92\n-Dune::Alberta::MapVertices\n-Definition misc.hh:443\n-Dune::Alberta::BasicNodeProjection\n-Definition albertagrid/projection.hh:208\n-Dune::Alberta::BasicNodeProjection::boundaryIndex\n-unsigned int boundaryIndex() const\n-Definition albertagrid/projection.hh:218\n-Dune::AlbertaTransformation\n-Definition transformation.hh:18\n-Dune::Entity::Geometry\n-GridImp::template Codim< cd >::Geometry Geometry\n-The corresponding geometry type.\n-Definition common/entity.hh:100\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/grid.hh:390\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-intersection.hh\n+Definition dofadmin.hh:97\n+Dune::Alberta::HierarchyDofNumbering::emptyDofSpace\n+const DofSpace * emptyDofSpace() const\n+Definition dofadmin.hh:152\n+Dune::Alberta::HierarchyDofNumbering::release\n+void release()\n+Definition dofadmin.hh:170\n+Dune::Alberta::ElementInfo<_dimension_>\n+Dune::Alberta::ElementInfo::el\n+Element * el() const\n+Definition elementinfo.hh:737\n+Dune::Alberta::NumSubEntities\n+Definition misc.hh:148\n+Dune::Alberta::CodimType\n+Definition misc.hh:192\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00653.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00653.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: coordcache.hh File Reference\n+dune-grid: refinement.hh File Reference\n \n \n \n \n \n \n \n@@ -72,40 +72,58 @@\n
  • dune
  • grid
  • albertagrid
  • \n
    \n
    \n
    \n \n-
    coordcache.hh File Reference
    \n+
    refinement.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/albertagrid/meshpointer.hh>
    \n-#include <dune/grid/albertagrid/dofadmin.hh>
    \n-#include <dune/grid/albertagrid/dofvector.hh>
    \n+\n+

    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather \n+More...

    \n+
    #include <cassert>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/elementinfo.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::Alberta::CoordCache< dim >
    class  Dune::Alberta::Patch< dim >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< dim, 0 >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< dim, dim >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< 2, 1 >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< 3, 1 >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< 3, 2 >
     
    struct  Dune::Alberta::GeometryInFather< 1 >
     
    class  Dune::Alberta::CoordCache< dim >::LocalCaching
    struct  Dune::Alberta::GeometryInFather< 2 >
     
    struct  Dune::Alberta::CoordCache< dim >::Interpolation
    struct  Dune::Alberta::GeometryInFather< 3 >
     
    \n \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-
    \n+

    Detailed Description

    \n+

    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,27 +2,46 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n Classes | Namespaces\n-coordcache.hh File Reference\n-#include \n-#include \n-#include \n+refinement.hh File Reference\n+provides a wrapper for ALBERTA's refinement patches and the corners for\n+geometryInFather More...\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::Alberta::CoordCache<_dim_>\n+ class \u00a0 Dune::Alberta::Patch<_dim_>\n \u00a0\n- class \u00a0 Dune::Alberta::CoordCache<_dim_>::LocalCaching\n+struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_dim,_0_>\n \u00a0\n-struct \u00a0 Dune::Alberta::CoordCache<_dim_>::Interpolation\n+struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_dim,_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_2,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_3,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_3,_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::GeometryInFather<_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::GeometryInFather<_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::GeometryInFather<_3_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n+***** Detailed Description *****\n+provides a wrapper for ALBERTA's refinement patches and the corners for\n+geometryInFather\n+ Author\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00653_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00653_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: coordcache.hh Source File\n+dune-grid: refinement.hh Source File\n \n \n \n \n \n \n \n@@ -74,225 +74,454 @@\n \n \n \n
    \n-
    coordcache.hh
    \n+
    refinement.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_COORDCACHE_HH
    \n-
    6#define DUNE_ALBERTA_COORDCACHE_HH
    \n+
    5#ifndef DUNE_ALBERTA_REFINEMENT_HH
    \n+
    6#define DUNE_ALBERTA_REFINEMENT_HH
    \n
    7
    \n-\n-\n-\n-
    11
    \n-
    12#if HAVE_ALBERTA
    \n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 namespace Alberta
    \n-
    18 {
    \n-
    19
    \n-
    20 // CoordCache
    \n-
    21 // ----------
    \n-
    22
    \n-
    23 template< int dim >
    \n-
    \n-\n-
    25 {
    \n-\n-\n-
    28
    \n-
    29 class LocalCaching;
    \n-
    30 struct Interpolation;
    \n-
    31
    \n-
    32 public:
    \n-
    33 static const int dimension = dim;
    \n+
    14#include <cassert>
    \n+
    15
    \n+\n+\n+
    18
    \n+
    19#if HAVE_ALBERTA
    \n+
    20
    \n+
    21namespace Dune
    \n+
    22{
    \n+
    23
    \n+
    24 namespace Alberta
    \n+
    25 {
    \n+
    26
    \n+
    27 // Internal Forward Declarations
    \n+
    28 // -----------------------------
    \n+
    29
    \n+
    30 template< int dim, int codim >
    \n+\n+
    32
    \n+
    33
    \n
    34
    \n-\n-\n-\n-
    38
    \n-
    \n-
    39 GlobalVector &operator() ( const Element *element, int vertex ) const
    \n-
    40 {
    \n-
    41 assert( !(!coords_) );
    \n-
    42 GlobalVector *array = (GlobalVector *)coords_;
    \n-
    43 return array[ dofAccess_( element, vertex ) ];
    \n-
    44 }
    \n-
    \n+
    35 // Patch
    \n+
    36 // -----
    \n+
    37
    \n+
    38 template< int dim >
    \n+
    \n+
    39 class Patch
    \n+
    40 {
    \n+
    41 typedef Patch< dim > This;
    \n+
    42
    \n+
    43 static_assert(((dim >= 1) && (dim <= 3)),
    \n+
    44 "Alberta supports only dimensions 1, 2, 3");
    \n
    45
    \n-
    \n-
    46 GlobalVector &operator() ( const ElementInfo &elementInfo, int vertex ) const
    \n-
    47 {
    \n-
    48 return (*this)( elementInfo.el(), vertex );
    \n-
    49 }
    \n-
    \n+
    46 public:
    \n+
    47 static const int dimension = dim;
    \n+
    48
    \n+\n
    50
    \n-
    \n-
    51 void create ( const DofNumbering &dofNumbering )
    \n-
    52 {
    \n-
    53 MeshPointer mesh = dofNumbering.mesh();
    \n-
    54 const DofSpace *dofSpace = dofNumbering.dofSpace( dimension );
    \n-
    55
    \n-
    56 coords_.create( dofSpace, "Coordinate Cache" );
    \n-
    57 LocalCaching localCaching( coords_ );
    \n-\n-
    59 coords_.template setupInterpolation< Interpolation >();
    \n-
    60
    \n-
    61 dofAccess_ = DofAccess( dofSpace );
    \n-
    62 }
    \n-
    \n-
    63
    \n-
    \n-
    64 void release ()
    \n-
    65 {
    \n-
    66 coords_.release();
    \n-
    67 }
    \n-
    \n-
    68
    \n-
    69 private:
    \n-
    70 CoordVectorPointer coords_;
    \n-
    71 DofAccess dofAccess_;
    \n-
    72 };
    \n-
    \n-
    73
    \n+
    51 typedef ALBERTA RC_LIST_EL ElementList;
    \n+
    52
    \n+
    53 private:
    \n+
    54 ElementList *list_;
    \n+
    55 int count_;
    \n+
    56
    \n+
    57 public:
    \n+
    \n+
    58 Patch ( ElementList *list, int count )
    \n+
    59 : list_( list ),
    \n+
    60 count_( count )
    \n+
    61 {
    \n+
    62 assert( count > 0 );
    \n+
    63 }
    \n+
    \n+
    64
    \n+
    65 Element *operator[] ( int i ) const;
    \n+
    66
    \n+
    \n+
    67 int count () const
    \n+
    68 {
    \n+
    69 return count_;
    \n+
    70 }
    \n+
    \n+
    71
    \n+
    72 template< class LevelProvider >
    \n+
    73 ElementInfo elementInfo ( int i, const LevelProvider &levelProvider ) const;
    \n
    74
    \n-
    75
    \n-
    76 // CoordCache::LocalCaching
    \n-
    77 // ------------------------
    \n+
    75 int elementType ( int i ) const;
    \n+
    76 bool hasNeighbor ( int i, int neighbor ) const;
    \n+
    77 int neighborIndex ( int i, int neighbor ) const;
    \n
    78
    \n-
    79 template< int dim >
    \n-
    \n-\n-
    81 {
    \n-
    82 CoordVectorPointer coords_;
    \n-
    83 DofAccess dofAccess_;
    \n-
    84
    \n-
    85 public:
    \n-
    \n-
    86 explicit LocalCaching ( const CoordVectorPointer &coords )
    \n-
    87 : coords_( coords ),
    \n-
    88 dofAccess_( coords.dofSpace() )
    \n-
    89 {}
    \n-
    \n-
    90
    \n-
    \n-
    91 void operator() ( const ElementInfo &elementInfo ) const
    \n-
    92 {
    \n-
    93 GlobalVector *array = (GlobalVector *)coords_;
    \n-
    94 for( int i = 0; i < DofAccess::numSubEntities; ++i )
    \n-
    95 {
    \n-
    96 const GlobalVector &x = elementInfo.coordinate( i );
    \n-
    97 GlobalVector &y = array[ dofAccess_( elementInfo.el(), i ) ];
    \n-
    98 for( int i = 0; i < dimWorld; ++i )
    \n-
    99 y[ i ] = x[ i ];
    \n-
    100 }
    \n-
    101 }
    \n-
    \n-
    102 };
    \n-
    \n-
    103
    \n-
    104
    \n-
    105
    \n-
    106 // CoordCache::Interpolation
    \n-
    107 // -------------------------
    \n-
    108
    \n-
    109 template< int dim >
    \n-
    \n-\n-
    111 {
    \n-
    112 static const int dimension = dim;
    \n-
    113
    \n-\n-
    115
    \n-
    116 static void
    \n-
    \n-
    117 interpolateVector ( const CoordVectorPointer &dofVector, const Patch &patch )
    \n-
    118 {
    \n-
    119 DofAccess dofAccess( dofVector.dofSpace() );
    \n-
    120 GlobalVector *array = (GlobalVector *)dofVector;
    \n-
    121
    \n-
    122 const Element *element = patch[ 0 ];
    \n-
    123
    \n-
    124 // new vertex is always the last one
    \n-
    125 assert( element->child[ 0 ] != NULL );
    \n-
    126 GlobalVector &newCoord = array[ dofAccess( element->child[ 0 ], dimension ) ];
    \n-
    127
    \n-
    128 if( element->new_coord != NULL )
    \n-
    129 {
    \n-
    130 for( int j = 0; j < dimWorld; ++j )
    \n-
    131 newCoord[ j ] = element->new_coord[ j ];
    \n-
    132 }
    \n-
    133 else
    \n-
    134 {
    \n-
    135 // new coordinate is the average of of old ones on the same edge
    \n-
    136 // refinement edge is always between vertices 0 and 1
    \n-
    137 const GlobalVector &coord0 = array[ dofAccess( element, 0 ) ];
    \n-
    138 const GlobalVector &coord1 = array[ dofAccess( element, 1 ) ];
    \n-
    139 for( int j = 0; j < dimWorld; ++j )
    \n-
    140 newCoord[ j ] = 0.5 * (coord0[ j ] + coord1[ j ]);
    \n-
    141 }
    \n-
    142 }
    \n+
    79 template< class Functor >
    \n+
    \n+
    80 void forEach ( Functor &functor ) const
    \n+
    81 {
    \n+
    82 for( int i = 0; i < count(); ++i )
    \n+
    83 functor( (*this)[ i ] );
    \n+
    84 }
    \n+
    \n+
    85
    \n+
    86 template< int codim, class Functor >
    \n+
    \n+
    87 void forEachInteriorSubChild ( Functor &functor ) const
    \n+
    88 {
    \n+\n+
    90 }
    \n+
    \n+
    91 };
    \n+
    \n+
    92
    \n+
    93
    \n+
    94 template< int dim >
    \n+
    \n+
    95 inline Element *Patch< dim >::operator[] ( int i ) const
    \n+
    96 {
    \n+
    97 assert( (i >= 0) && (i < count()) );
    \n+
    98 return list_[ i ].el_info.el;
    \n+
    99 }
    \n+
    \n+
    100
    \n+
    101
    \n+
    102 template< int dim >
    \n+
    103 template< class LevelProvider >
    \n+
    104 inline typename Patch< dim >::ElementInfo
    \n+
    \n+
    105 Patch< dim >::elementInfo ( int i, const LevelProvider &levelProvider ) const
    \n+
    106 {
    \n+
    107 assert( (i >= 0) && (i < count()) );
    \n+
    108 return ElementInfo::createFake( list_[ i ].el_info );
    \n+
    109 }
    \n+
    \n+
    110
    \n+
    111 template<>
    \n+
    112 template< class LevelProvider >
    \n+
    113 inline typename Patch< 2 >::ElementInfo
    \n+
    \n+
    114 Patch< 2 >::elementInfo ( int i, const LevelProvider &levelProvider ) const
    \n+
    115 {
    \n+
    116 assert( (i >= 0) && (i < count()) );
    \n+
    117 const MeshPointer< 2 > &mesh = levelProvider.mesh();
    \n+
    118 const Element *element = (*this)[ i ];
    \n+
    119 const int level = levelProvider( element );
    \n+
    120 return ElementInfo::createFake( mesh, element, level );
    \n+
    121 }
    \n
    \n-
    143 };
    \n+
    122
    \n+
    123
    \n+
    124 template< int dim >
    \n+
    \n+
    125 inline int Patch< dim >::elementType ( int i ) const
    \n+
    126 {
    \n+
    127 assert( (i >= 0) && (i < count()) );
    \n+
    128 return list_[ i ].el_info.el_type;
    \n+
    129 }
    \n+
    \n+
    130
    \n+
    131
    \n+
    132 template< int dim >
    \n+
    \n+
    133 inline bool Patch< dim >::hasNeighbor ( int i, int neighbor ) const
    \n+
    134 {
    \n+
    135 return (list_[ i ].neigh[ neighbor ] != NULL);
    \n+
    136 }
    \n+
    \n+
    137
    \n+
    138 template< int dim >
    \n+
    \n+
    139 inline int Patch< dim >::neighborIndex ( int i, int neighbor ) const
    \n+
    140 {
    \n+
    141 assert( hasNeighbor( i, neighbor ) );
    \n+
    142 return (list_[ i ].neigh[ neighbor ]->no);
    \n+
    143 }
    \n
    \n
    144
    \n-
    145 }
    \n+
    145
    \n
    146
    \n-
    147}
    \n-
    148
    \n-
    149#endif // #if HAVE_ALBERTA
    \n-
    150
    \n-
    151#endif // #ifndef DUNE_ALBERTA_COORDCACHE_HH
    \n-\n-\n-
    provides a wrapper for ALBERTA's mesh structure
    \n+
    147 // ForEachInteriorSubChild
    \n+
    148 // -----------------------
    \n+
    149
    \n+
    150 template< int dim >
    \n+
    \n+
    151 struct ForEachInteriorSubChild< dim, 0 >
    \n+
    152 {
    \n+
    153 template< class Functor >
    \n+
    \n+
    154 static void apply ( Functor &functor, const Patch< dim > &patch )
    \n+
    155 {
    \n+
    156 for( int i = 0; i < patch.count(); ++i )
    \n+
    157 {
    \n+
    158 Element *const father = patch[ i ];
    \n+
    159 functor( father->child[ 0 ], 0 );
    \n+
    160 functor( father->child[ 1 ], 0 );
    \n+
    161 }
    \n+
    162 }
    \n+
    \n+
    163 };
    \n+
    \n+
    164
    \n+
    165 template< int dim >
    \n+
    \n+
    166 struct ForEachInteriorSubChild< dim, dim >
    \n+
    167 {
    \n+
    168 template< class Functor >
    \n+
    \n+
    169 static void apply ( Functor &functor, const Patch< dim > &patch )
    \n+
    170 {
    \n+
    171 functor( patch[ 0 ]->child[ 0 ], dim );
    \n+
    172 }
    \n+
    \n+
    173 };
    \n+
    \n+
    174
    \n+
    175 template<>
    \n+
    \n+\n+
    177 {
    \n+
    178 template< class Functor >
    \n+
    \n+
    179 static void apply ( Functor &functor, const Patch< 2 > &patch )
    \n+
    180 {
    \n+
    181 // see alberta/src/2d/lagrange_2_2d.c for details
    \n+
    182 Element *const firstFather = patch[ 0 ];
    \n+
    183
    \n+
    184 Element *const firstChild = firstFather->child[ 0 ];
    \n+
    185 functor( firstChild, 0 );
    \n+
    186 functor( firstChild, 1 );
    \n+
    187
    \n+
    188 functor( firstFather->child[ 1 ], 1 );
    \n+
    189
    \n+
    190 if( patch.count() > 1 )
    \n+
    191 {
    \n+
    192 Element *const father = patch[ 1 ];
    \n+
    193 functor( father->child[ 0 ], 1 );
    \n+
    194 }
    \n+
    195 }
    \n+
    \n+
    196 };
    \n+
    \n+
    197
    \n+
    198 template<>
    \n+
    \n+\n+
    200 {
    \n+
    201 template< class Functor >
    \n+
    \n+
    202 static void apply ( Functor &functor, const Patch< 3 > &patch )
    \n+
    203 {
    \n+
    204 // see alberta/src/3d/lagrange_3_3d.c for details
    \n+
    205 Element *const firstFather = patch[ 0 ];
    \n+
    206
    \n+
    207 Element *const firstChild = firstFather->child[ 0 ];
    \n+
    208 functor( firstChild, 0 );
    \n+
    209 functor( firstChild, 1 );
    \n+
    210 functor( firstChild, 2 );
    \n+
    211
    \n+
    212 Element *const secondChild = firstFather->child[ 1 ];
    \n+
    213 functor( secondChild, 1 );
    \n+
    214 functor( secondChild, 2 );
    \n+
    215
    \n+
    216 for( int i = 1; i < patch.count(); ++i )
    \n+
    217 {
    \n+
    218 Element *const father = patch[ i ];
    \n+
    219 const int type = patch.elementType( i );
    \n+
    220
    \n+
    221 int lr_set = 0;
    \n+
    222 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )
    \n+
    223 lr_set |= 1;
    \n+
    224 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )
    \n+
    225 lr_set |= 2;
    \n+
    226 assert( lr_set != 0 );
    \n+
    227
    \n+
    228 functor( father->child[ 0 ], 0 );
    \n+
    229 switch( lr_set )
    \n+
    230 {
    \n+
    231 case 1 :
    \n+
    232 functor( father->child[ 0 ], 2 );
    \n+
    233 functor( father->child[ 1 ], (type == 0 ? 1 : 2) );
    \n+
    234 break;
    \n+
    235
    \n+
    236 case 2 :
    \n+
    237 functor( father->child[ 0 ], 1 );
    \n+
    238 functor( father->child[ 1 ], (type == 0 ? 2 : 1) );
    \n+
    239 break;
    \n+
    240 }
    \n+
    241 }
    \n+
    242 }
    \n+
    \n+
    243 };
    \n+
    \n+
    244
    \n+
    245 template<>
    \n+
    \n+\n+
    247 {
    \n+
    248 template< class Functor >
    \n+
    \n+
    249 static void apply ( Functor &functor, const Patch< 3 > &patch )
    \n+
    250 {
    \n+
    251 // see alberta/src/3d/lagrange_2_3d.c for details
    \n+
    252 Element *const firstFather = patch[ 0 ];
    \n+
    253
    \n+
    254 Element *const firstChild = firstFather->child[ 0 ];
    \n+
    255 functor( firstChild, 2 );
    \n+
    256 functor( firstChild, 4 );
    \n+
    257 functor( firstChild, 5 );
    \n+
    258
    \n+
    259 functor( firstFather->child[ 1 ], 2 );
    \n+
    260
    \n+
    261 for( int i = 1; i < patch.count(); ++i )
    \n+
    262 {
    \n+
    263 Element *const father = patch[ i ];
    \n+
    264
    \n+
    265 int lr_set = 0;
    \n+
    266 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )
    \n+
    267 lr_set = 1;
    \n+
    268 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )
    \n+
    269 lr_set += 2;
    \n+
    270 assert( lr_set != 0 );
    \n+
    271
    \n+
    272 switch( lr_set )
    \n+
    273 {
    \n+
    274 case 1 :
    \n+
    275 functor( father->child[ 0 ], 4 );
    \n+
    276 break;
    \n+
    277
    \n+
    278 case 2 :
    \n+
    279 functor( father->child[ 0 ], 5 );
    \n+
    280 break;
    \n+
    281 }
    \n+
    282 }
    \n+
    283 }
    \n+
    \n+
    284 };
    \n+
    \n+
    285
    \n+
    286
    \n+
    287
    \n+
    288 // GeometryInFather
    \n+
    289 // ----------------
    \n+
    290
    \n+
    291 template< int dim >
    \n+\n+
    293
    \n+
    294 template<>
    \n+
    \n+\n+
    296 {
    \n+
    297 static const int dim = 1;
    \n+
    298
    \n+
    299 typedef Real LocalVector[ dim ];
    \n+
    300
    \n+
    301 static const LocalVector &
    \n+
    \n+
    302 coordinate ( int child, int /* orientation */, int i )
    \n+
    303 {
    \n+
    304 static const Real coords[ 2 ][ dim+1 ][ dim ]
    \n+
    305 = { { {0.0}, {0.5} }, { {0.5}, {1.0} } };
    \n+
    306 assert( (i >= 0) && (i <= dim) );
    \n+
    307 return coords[ child ][ i ];
    \n+
    308 }
    \n+
    \n+
    309 };
    \n+
    \n+
    310
    \n+
    311 template<>
    \n+
    \n+\n+
    313 {
    \n+
    314 static const int dim = 2;
    \n+
    315
    \n+
    316 typedef Real LocalVector[ dim ];
    \n+
    317
    \n+
    318 static const LocalVector &
    \n+
    \n+
    319 coordinate ( int child, int /* orientation */, int i )
    \n+
    320 {
    \n+
    321 static const Real coords[ 2 ][ dim+1 ][ dim ]
    \n+
    322 = { { {0.0, 1.0}, {0.0, 0.0}, {0.5, 0.0} },
    \n+
    323 { {1.0, 0.0}, {0.0, 1.0}, {0.5, 0.0} } };
    \n+
    324 assert( (i >= 0) && (i <= dim) );
    \n+
    325 return coords[ child ][ i ];
    \n+
    326 }
    \n+
    \n+
    327 };
    \n+
    \n+
    328
    \n+
    329 template<>
    \n+
    \n+\n+
    331 {
    \n+
    332 static const int dim = 3;
    \n+
    333
    \n+
    334 typedef Real LocalVector[ dim ];
    \n+
    335
    \n+
    336 static const LocalVector &
    \n+
    \n+
    337 coordinate ( int child, int orientation, int i )
    \n+
    338 {
    \n+
    339 static const Real coords[ 2 ][ dim+1 ][ dim ]
    \n+
    340 = { { {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} },
    \n+
    341 { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} } };
    \n+
    342 static const int flip[ 2 ][ 2 ][ dim+1 ]
    \n+
    343 = { { {0, 1, 2, 3}, {0, 1, 2, 3} }, { {0, 2, 1, 3}, {0, 1, 2, 3} } };
    \n+
    344 assert( (i >= 0) && (i <= dim) );
    \n+
    345 i = flip[ child ][ orientation ][ i ];
    \n+
    346 return coords[ child ][ i ];
    \n+
    347 }
    \n+
    \n+
    348 };
    \n+
    \n+
    349
    \n+
    350 }
    \n+
    351
    \n+
    352}
    \n+
    353
    \n+
    354#endif // #if HAVE_ALBERTA
    \n+
    355
    \n+
    356#endif
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n+\n+
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n+
    ALBERTA REAL_B LocalVector
    Definition misc.hh:49
    \n
    ALBERTA EL Element
    Definition misc.hh:54
    \n-
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n-
    static const int dimWorld
    Definition misc.hh:46
    \n-
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition coordcache.hh:25
    \n-
    static const int dimension
    Definition coordcache.hh:33
    \n-
    GlobalVector & operator()(const Element *element, int vertex) const
    Definition coordcache.hh:39
    \n-
    Alberta::MeshPointer< dimension > MeshPointer
    Definition coordcache.hh:36
    \n-
    void release()
    Definition coordcache.hh:64
    \n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition coordcache.hh:35
    \n-
    HierarchyDofNumbering< dimension > DofNumbering
    Definition coordcache.hh:37
    \n-
    void create(const DofNumbering &dofNumbering)
    Definition coordcache.hh:51
    \n-
    Definition coordcache.hh:81
    \n-
    LocalCaching(const CoordVectorPointer &coords)
    Definition coordcache.hh:86
    \n-
    Definition coordcache.hh:111
    \n-
    Alberta::Patch< dimension > Patch
    Definition coordcache.hh:114
    \n-
    static void interpolateVector(const CoordVectorPointer &dofVector, const Patch &patch)
    Definition coordcache.hh:117
    \n-\n-
    void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:370
    \n-\n-
    static const int numSubEntities
    Definition dofadmin.hh:40
    \n-\n-
    const MeshPointer & mesh() const
    Definition dofadmin.hh:158
    \n-
    const DofSpace * dofSpace(int codim) const
    Definition dofadmin.hh:145
    \n-\n-
    void create(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:236
    \n-
    void release()
    Definition dofvector.hh:254
    \n-
    const DofSpace * dofSpace() const
    Definition dofvector.hh:223
    \n+
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    Definition meshpointer.hh:40
    \n \n-
    const GlobalVector & coordinate(int vertex) const
    Definition elementinfo.hh:685
    \n-
    Element * el() const
    Definition elementinfo.hh:737
    \n-
    Definition misc.hh:231
    \n+
    static ElementInfo createFake(const MeshPointer &mesh, const Element *element, int level, int type=0)
    Definition elementinfo.hh:752
    \n+
    Definition refinement.hh:31
    \n
    Definition refinement.hh:40
    \n+
    int neighborIndex(int i, int neighbor) const
    Definition refinement.hh:139
    \n+
    int elementType(int i) const
    Definition refinement.hh:125
    \n+
    int count() const
    Definition refinement.hh:67
    \n+
    ElementInfo elementInfo(int i, const LevelProvider &levelProvider) const
    Definition refinement.hh:105
    \n+
    void forEach(Functor &functor) const
    Definition refinement.hh:80
    \n+
    Element * operator[](int i) const
    Definition refinement.hh:95
    \n+
    void forEachInteriorSubChild(Functor &functor) const
    Definition refinement.hh:87
    \n+
    static const int dimension
    Definition refinement.hh:47
    \n+
    bool hasNeighbor(int i, int neighbor) const
    Definition refinement.hh:133
    \n+
    Patch(ElementList *list, int count)
    Definition refinement.hh:58
    \n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition refinement.hh:49
    \n+
    ALBERTA RC_LIST_EL ElementList
    Definition refinement.hh:51
    \n+
    static void apply(Functor &functor, const Patch< dim > &patch)
    Definition refinement.hh:154
    \n+
    static void apply(Functor &functor, const Patch< dim > &patch)
    Definition refinement.hh:169
    \n+
    static void apply(Functor &functor, const Patch< 2 > &patch)
    Definition refinement.hh:179
    \n+
    static void apply(Functor &functor, const Patch< 3 > &patch)
    Definition refinement.hh:202
    \n+
    static void apply(Functor &functor, const Patch< 3 > &patch)
    Definition refinement.hh:249
    \n+
    Definition refinement.hh:292
    \n+
    static const LocalVector & coordinate(int child, int, int i)
    Definition refinement.hh:302
    \n+
    static const LocalVector & coordinate(int child, int, int i)
    Definition refinement.hh:319
    \n+
    static const LocalVector & coordinate(int child, int orientation, int i)
    Definition refinement.hh:337
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,259 +1,454 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-coordcache.hh\n+refinement.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_COORDCACHE_HH\n-6#define DUNE_ALBERTA_COORDCACHE_HH\n+5#ifndef DUNE_ALBERTA_REFINEMENT_HH\n+6#define DUNE_ALBERTA_REFINEMENT_HH\n 7\n-8#include \n-9#include \n-10#include \n-11\n-12#if HAVE_ALBERTA\n-13\n-14namespace Dune\n-15{\n-16\n-17 namespace Alberta\n-18 {\n-19\n-20 // CoordCache\n-21 // ----------\n-22\n-23 template< int dim >\n-24 class CoordCache\n+14#include \n+15\n+16#include \n+17#include \n+18\n+19#if HAVE_ALBERTA\n+20\n+21namespace Dune\n+22{\n+23\n+24 namespace Alberta\n 25 {\n-26 typedef DofVectorPointer<_GlobalVector_> CoordVectorPointer;\n-27 typedef Alberta::DofAccess<_dim,_dim_> DofAccess;\n-28\n-29 class LocalCaching;\n-30 struct Interpolation;\n-31\n-32 public:\n-33 static const int dimension = dim;\n+26\n+27 // Internal Forward Declarations\n+28 // -----------------------------\n+29\n+30 template< int dim, int codim >\n+31 struct ForEachInteriorSubChild;\n+32\n+33\n 34\n-35 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-36 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n-37 typedef HierarchyDofNumbering<_dimension_> DofNumbering;\n-38\n-39 GlobalVector &operator()_( const Element *element, int vertex ) const\n+35 // Patch\n+36 // -----\n+37\n+38 template< int dim >\n+39 class Patch\n 40 {\n-41 assert( !(!coords_) );\n-42 GlobalVector *array = (GlobalVector *)coords_;\n-43 return array[ dofAccess_( element, vertex ) ];\n-44 }\n+41 typedef Patch<_dim_> This;\n+42\n+43 static_assert(((dim >= 1) && (dim <= 3)),\n+44 \"Alberta supports only dimensions 1, 2, 3\");\n 45\n-46 GlobalVector &operator()_( const ElementInfo &elementInfo, int vertex )\n-const\n-47 {\n-48 return (*this)( elementInfo.el(), vertex );\n-49 }\n+46 public:\n+47 static const int dimension = dim;\n+48\n+49 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n 50\n-51 void create ( const DofNumbering &dofNumbering )\n-52 {\n-53 MeshPointer mesh = dofNumbering.mesh();\n-54 const DofSpace *dofSpace = dofNumbering.dofSpace( dimension );\n-55\n-56 coords_.create( dofSpace, \"Coordinate Cache\" );\n-57 LocalCaching localCaching( coords_ );\n-58 mesh.hierarchicTraverse( localCaching, FillFlags<_dimension_>::coords );\n-59 coords_.template setupInterpolation< Interpolation >();\n-60\n-61 dofAccess_ = DofAccess( dofSpace );\n-62 }\n-63\n-64 void release ()\n-65 {\n-66 coords_.release();\n-67 }\n-68\n-69 private:\n-70 CoordVectorPointer coords_;\n-71 DofAccess dofAccess_;\n-72 };\n-73\n+51 typedef ALBERTA RC_LIST_EL ElementList;\n+52\n+53 private:\n+54 ElementList *list_;\n+55 int count_;\n+56\n+57 public:\n+58 Patch ( ElementList *list, int count )\n+59 : list_( list ),\n+60 count_( count )\n+61 {\n+62 assert( count > 0 );\n+63 }\n+64\n+65 Element *operator[]_( int i ) const;\n+66\n+67 int count () const\n+68 {\n+69 return count_;\n+70 }\n+71\n+72 template< class LevelProvider >\n+73 ElementInfo elementInfo ( int i, const LevelProvider &levelProvider ) const;\n 74\n-75\n-76 // CoordCache::LocalCaching\n-77 // ------------------------\n+75 int elementType ( int i ) const;\n+76 bool hasNeighbor ( int i, int neighbor ) const;\n+77 int neighborIndex ( int i, int neighbor ) const;\n 78\n-79 template< int dim >\n-80 class CoordCache< dim >::LocalCaching\n+79 template< class Functor >\n+80 void forEach ( Functor &functor ) const\n 81 {\n-82 CoordVectorPointer coords_;\n-83 DofAccess dofAccess_;\n-84\n-85 public:\n-86 explicit LocalCaching ( const CoordVectorPointer &coords )\n-87 : coords_( coords ),\n-88 dofAccess_( coords.dofSpace() )\n-89 {}\n-90\n-91 void operator()_( const ElementInfo &elementInfo ) const\n-92 {\n-93 GlobalVector *array = (GlobalVector *)coords_;\n-94 for( int i = 0; i < DofAccess::numSubEntities; ++i )\n-95 {\n-96 const GlobalVector &x = elementInfo.coordinate( i );\n-97 GlobalVector &y = array[ dofAccess_( elementInfo.el(), i ) ];\n-98 for( int i = 0; i < dimWorld; ++i )\n-99 y[ i ] = x[ i ];\n-100 }\n-101 }\n-102 };\n-103\n-104\n-105\n-106 // CoordCache::Interpolation\n-107 // -------------------------\n-108\n-109 template< int dim >\n-110 struct CoordCache< dim >::Interpolation\n-111 {\n-112 static const int dimension = dim;\n-113\n-114 typedef Alberta::Patch<_dimension_> Patch;\n-115\n-116 static void\n-117 interpolateVector ( const CoordVectorPointer &dofVector, const Patch &patch\n-)\n-118 {\n-119 DofAccess dofAccess( dofVector.dofSpace() );\n-120 GlobalVector *array = (GlobalVector *)dofVector;\n-121\n-122 const Element *element = patch[ 0 ];\n+82 for( int i = 0; i < count(); ++i )\n+83 functor( (*this)[ i ] );\n+84 }\n+85\n+86 template< int codim, class Functor >\n+87 void forEachInteriorSubChild ( Functor &functor ) const\n+88 {\n+89 ForEachInteriorSubChild<_dim,_codim_>::apply( functor, *this );\n+90 }\n+91 };\n+92\n+93\n+94 template< int dim >\n+95 inline Element *Patch<_dim_>::operator[]_( int i ) const\n+96 {\n+97 assert( (i >= 0) && (i < count()) );\n+98 return list_[ i ].el_info.el;\n+99 }\n+100\n+101\n+102 template< int dim >\n+103 template< class LevelProvider >\n+104 inline typename Patch<_dim_>::ElementInfo\n+105 Patch<_dim_>::elementInfo ( int i, const LevelProvider &levelProvider )\n+const\n+106 {\n+107 assert( (i >= 0) && (i < count()) );\n+108 return ElementInfo::createFake( list_[ i ].el_info );\n+109 }\n+110\n+111 template<>\n+112 template< class LevelProvider >\n+113 inline typename Patch<_2_>::ElementInfo\n+114 Patch<_2_>::elementInfo ( int i, const LevelProvider &levelProvider ) const\n+115 {\n+116 assert( (i >= 0) && (i < count()) );\n+117 const MeshPointer<_2_> &mesh = levelProvider.mesh();\n+118 const Element *element = (*this)[ i ];\n+119 const int level = levelProvider( element );\n+120 return ElementInfo::createFake( mesh, element, level );\n+121 }\n+122\n 123\n-124 // new vertex is always the last one\n-125 assert( element->child[ 0 ] != NULL );\n-126 GlobalVector &newCoord = array[ dofAccess( element->child[ 0 ], dimension )\n-];\n-127\n-128 if( element->new_coord != NULL )\n-129 {\n-130 for( int j = 0; j < dimWorld; ++j )\n-131 newCoord[ j ] = element->new_coord[ j ];\n-132 }\n-133 else\n+124 template< int dim >\n+125 inline int Patch<_dim_>::elementType ( int i ) const\n+126 {\n+127 assert( (i >= 0) && (i < count()) );\n+128 return list_[ i ].el_info.el_type;\n+129 }\n+130\n+131\n+132 template< int dim >\n+133 inline bool Patch<_dim_>::hasNeighbor ( int i, int neighbor ) const\n 134 {\n-135 // new coordinate is the average of of old ones on the same edge\n-136 // refinement edge is always between vertices 0 and 1\n-137 const GlobalVector &coord0 = array[ dofAccess( element, 0 ) ];\n-138 const GlobalVector &coord1 = array[ dofAccess( element, 1 ) ];\n-139 for( int j = 0; j < dimWorld; ++j )\n-140 newCoord[ j ] = 0.5 * (coord0[ j ] + coord1[ j ]);\n-141 }\n-142 }\n-143 };\n+135 return (list_[ i ].neigh[ neighbor ] != NULL);\n+136 }\n+137\n+138 template< int dim >\n+139 inline int Patch<_dim_>::neighborIndex ( int i, int neighbor ) const\n+140 {\n+141 assert( hasNeighbor( i, neighbor ) );\n+142 return (list_[ i ].neigh[ neighbor ]->no);\n+143 }\n 144\n-145 }\n+145\n 146\n-147}\n-148\n-149#endif // #if HAVE_ALBERTA\n-150\n-151#endif // #ifndef DUNE_ALBERTA_COORDCACHE_HH\n-dofadmin.hh\n-dofvector.hh\n-meshpointer.hh\n-provides a wrapper for ALBERTA's mesh structure\n+147 // ForEachInteriorSubChild\n+148 // -----------------------\n+149\n+150 template< int dim >\n+151 struct ForEachInteriorSubChild< dim, 0 >\n+152 {\n+153 template< class Functor >\n+154 static void apply ( Functor &functor, const Patch<_dim_> &patch )\n+155 {\n+156 for( int i = 0; i < patch.count(); ++i )\n+157 {\n+158 Element *const father = patch[ i ];\n+159 functor( father->child[ 0 ], 0 );\n+160 functor( father->child[ 1 ], 0 );\n+161 }\n+162 }\n+163 };\n+164\n+165 template< int dim >\n+166 struct ForEachInteriorSubChild< dim, dim >\n+167 {\n+168 template< class Functor >\n+169 static void apply ( Functor &functor, const Patch<_dim_> &patch )\n+170 {\n+171 functor( patch[ 0 ]->child[ 0 ], dim );\n+172 }\n+173 };\n+174\n+175 template<>\n+176 struct ForEachInteriorSubChild< 2, 1 >\n+177 {\n+178 template< class Functor >\n+179 static void apply ( Functor &functor, const Patch<_2_> &patch )\n+180 {\n+181 // see alberta/src/2d/lagrange_2_2d.c for details\n+182 Element *const firstFather = patch[ 0 ];\n+183\n+184 Element *const firstChild = firstFather->child[ 0 ];\n+185 functor( firstChild, 0 );\n+186 functor( firstChild, 1 );\n+187\n+188 functor( firstFather->child[ 1 ], 1 );\n+189\n+190 if( patch.count() > 1 )\n+191 {\n+192 Element *const father = patch[ 1 ];\n+193 functor( father->child[ 0 ], 1 );\n+194 }\n+195 }\n+196 };\n+197\n+198 template<>\n+199 struct ForEachInteriorSubChild< 3, 1 >\n+200 {\n+201 template< class Functor >\n+202 static void apply ( Functor &functor, const Patch<_3_> &patch )\n+203 {\n+204 // see alberta/src/3d/lagrange_3_3d.c for details\n+205 Element *const firstFather = patch[ 0 ];\n+206\n+207 Element *const firstChild = firstFather->child[ 0 ];\n+208 functor( firstChild, 0 );\n+209 functor( firstChild, 1 );\n+210 functor( firstChild, 2 );\n+211\n+212 Element *const secondChild = firstFather->child[ 1 ];\n+213 functor( secondChild, 1 );\n+214 functor( secondChild, 2 );\n+215\n+216 for( int i = 1; i < patch.count(); ++i )\n+217 {\n+218 Element *const father = patch[ i ];\n+219 const int type = patch.elementType( i );\n+220\n+221 int lr_set = 0;\n+222 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )\n+223 lr_set |= 1;\n+224 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )\n+225 lr_set |= 2;\n+226 assert( lr_set != 0 );\n+227\n+228 functor( father->child[ 0 ], 0 );\n+229 switch( lr_set )\n+230 {\n+231 case 1 :\n+232 functor( father->child[ 0 ], 2 );\n+233 functor( father->child[ 1 ], (type == 0 ? 1 : 2) );\n+234 break;\n+235\n+236 case 2 :\n+237 functor( father->child[ 0 ], 1 );\n+238 functor( father->child[ 1 ], (type == 0 ? 2 : 1) );\n+239 break;\n+240 }\n+241 }\n+242 }\n+243 };\n+244\n+245 template<>\n+246 struct ForEachInteriorSubChild< 3, 2 >\n+247 {\n+248 template< class Functor >\n+249 static void apply ( Functor &functor, const Patch<_3_> &patch )\n+250 {\n+251 // see alberta/src/3d/lagrange_2_3d.c for details\n+252 Element *const firstFather = patch[ 0 ];\n+253\n+254 Element *const firstChild = firstFather->child[ 0 ];\n+255 functor( firstChild, 2 );\n+256 functor( firstChild, 4 );\n+257 functor( firstChild, 5 );\n+258\n+259 functor( firstFather->child[ 1 ], 2 );\n+260\n+261 for( int i = 1; i < patch.count(); ++i )\n+262 {\n+263 Element *const father = patch[ i ];\n+264\n+265 int lr_set = 0;\n+266 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )\n+267 lr_set = 1;\n+268 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )\n+269 lr_set += 2;\n+270 assert( lr_set != 0 );\n+271\n+272 switch( lr_set )\n+273 {\n+274 case 1 :\n+275 functor( father->child[ 0 ], 4 );\n+276 break;\n+277\n+278 case 2 :\n+279 functor( father->child[ 0 ], 5 );\n+280 break;\n+281 }\n+282 }\n+283 }\n+284 };\n+285\n+286\n+287\n+288 // GeometryInFather\n+289 // ----------------\n+290\n+291 template< int dim >\n+292 struct GeometryInFather;\n+293\n+294 template<>\n+295 struct GeometryInFather< 1 >\n+296 {\n+297 static const int dim = 1;\n+298\n+299 typedef Real LocalVector[ dim ];\n+300\n+301 static const LocalVector &\n+302 coordinate ( int child, int /* orientation */, int i )\n+303 {\n+304 static const Real coords[ 2 ][ dim+1 ][ dim ]\n+305 = { { {0.0}, {0.5} }, { {0.5}, {1.0} } };\n+306 assert( (i >= 0) && (i <= dim) );\n+307 return coords[ child ][ i ];\n+308 }\n+309 };\n+310\n+311 template<>\n+312 struct GeometryInFather< 2 >\n+313 {\n+314 static const int dim = 2;\n+315\n+316 typedef Real LocalVector[ dim ];\n+317\n+318 static const LocalVector &\n+319 coordinate ( int child, int /* orientation */, int i )\n+320 {\n+321 static const Real coords[ 2 ][ dim+1 ][ dim ]\n+322 = { { {0.0, 1.0}, {0.0, 0.0}, {0.5, 0.0} },\n+323 { {1.0, 0.0}, {0.0, 1.0}, {0.5, 0.0} } };\n+324 assert( (i >= 0) && (i <= dim) );\n+325 return coords[ child ][ i ];\n+326 }\n+327 };\n+328\n+329 template<>\n+330 struct GeometryInFather< 3 >\n+331 {\n+332 static const int dim = 3;\n+333\n+334 typedef Real LocalVector[ dim ];\n+335\n+336 static const LocalVector &\n+337 coordinate ( int child, int orientation, int i )\n+338 {\n+339 static const Real coords[ 2 ][ dim+1 ][ dim ]\n+340 = { { {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} },\n+341 { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} } };\n+342 static const int flip[ 2 ][ 2 ][ dim+1 ]\n+343 = { { {0, 1, 2, 3}, {0, 1, 2, 3} }, { {0, 2, 1, 3}, {0, 1, 2, 3} } };\n+344 assert( (i >= 0) && (i <= dim) );\n+345 i = flip[ child ][ orientation ][ i ];\n+346 return coords[ child ][ i ];\n+347 }\n+348 };\n+349\n+350 }\n+351\n+352}\n+353\n+354#endif // #if HAVE_ALBERTA\n+355\n+356#endif\n+elementinfo.hh\n+provides a wrapper for ALBERTA's el_info structure\n+misc.hh\n+ALBERTA\n+#define ALBERTA\n+Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n+Dune::Alberta::LocalVector\n+ALBERTA REAL_B LocalVector\n+Definition misc.hh:49\n Dune::Alberta::Element\n ALBERTA EL Element\n Definition misc.hh:54\n-Dune::Alberta::DofSpace\n-ALBERTA FE_SPACE DofSpace\n-Definition misc.hh:65\n-Dune::Alberta::dimWorld\n-static const int dimWorld\n-Definition misc.hh:46\n-Dune::Alberta::GlobalVector\n-ALBERTA REAL_D GlobalVector\n-Definition misc.hh:50\n-Dune::Alberta::CoordCache\n-Definition coordcache.hh:25\n-Dune::Alberta::CoordCache::dimension\n-static const int dimension\n-Definition coordcache.hh:33\n-Dune::Alberta::CoordCache::operator()\n-GlobalVector & operator()(const Element *element, int vertex) const\n-Definition coordcache.hh:39\n-Dune::Alberta::CoordCache::MeshPointer\n-Alberta::MeshPointer< dimension > MeshPointer\n-Definition coordcache.hh:36\n-Dune::Alberta::CoordCache::release\n-void release()\n-Definition coordcache.hh:64\n-Dune::Alberta::CoordCache::ElementInfo\n-Alberta::ElementInfo< dimension > ElementInfo\n-Definition coordcache.hh:35\n-Dune::Alberta::CoordCache::DofNumbering\n-HierarchyDofNumbering< dimension > DofNumbering\n-Definition coordcache.hh:37\n-Dune::Alberta::CoordCache::create\n-void create(const DofNumbering &dofNumbering)\n-Definition coordcache.hh:51\n-Dune::Alberta::CoordCache::LocalCaching\n-Definition coordcache.hh:81\n-Dune::Alberta::CoordCache::LocalCaching::LocalCaching\n-LocalCaching(const CoordVectorPointer &coords)\n-Definition coordcache.hh:86\n-Dune::Alberta::CoordCache::Interpolation\n-Definition coordcache.hh:111\n-Dune::Alberta::CoordCache::Interpolation::Patch\n-Alberta::Patch< dimension > Patch\n-Definition coordcache.hh:114\n-Dune::Alberta::CoordCache::Interpolation::interpolateVector\n-static void interpolateVector(const CoordVectorPointer &dofVector, const Patch\n-&patch)\n-Definition coordcache.hh:117\n-Dune::Alberta::MeshPointer<_dimension_>\n-Dune::Alberta::MeshPointer::hierarchicTraverse\n-void hierarchicTraverse(Functor &functor, typename FillFlags::Flags\n-fillFlags=FillFlags::standard) const\n-Definition meshpointer.hh:370\n-Dune::Alberta::DofAccess<_dim,_dim_>\n-Dune::Alberta::DofAccess<_dim,_dim_>::numSubEntities\n-static const int numSubEntities\n-Definition dofadmin.hh:40\n-Dune::Alberta::HierarchyDofNumbering<_dimension_>\n-Dune::Alberta::HierarchyDofNumbering::mesh\n-const MeshPointer & mesh() const\n-Definition dofadmin.hh:158\n-Dune::Alberta::HierarchyDofNumbering::dofSpace\n-const DofSpace * dofSpace(int codim) const\n-Definition dofadmin.hh:145\n-Dune::Alberta::DofVectorPointer<_GlobalVector_>\n-Dune::Alberta::DofVectorPointer::create\n-void create(const DofSpace *dofSpace, const std::string &name=\"\")\n-Definition dofvector.hh:236\n-Dune::Alberta::DofVectorPointer::release\n-void release()\n-Definition dofvector.hh:254\n-Dune::Alberta::DofVectorPointer::dofSpace\n-const DofSpace * dofSpace() const\n-Definition dofvector.hh:223\n+Dune::Alberta::Real\n+ALBERTA REAL Real\n+Definition misc.hh:48\n+Dune::Alberta::MeshPointer\n+Definition meshpointer.hh:40\n Dune::Alberta::ElementInfo<_dimension_>\n-Dune::Alberta::ElementInfo::coordinate\n-const GlobalVector & coordinate(int vertex) const\n-Definition elementinfo.hh:685\n-Dune::Alberta::ElementInfo::el\n-Element * el() const\n-Definition elementinfo.hh:737\n-Dune::Alberta::FillFlags\n-Definition misc.hh:231\n+Dune::Alberta::ElementInfo::createFake\n+static ElementInfo createFake(const MeshPointer &mesh, const Element *element,\n+int level, int type=0)\n+Definition elementinfo.hh:752\n+Dune::Alberta::ForEachInteriorSubChild\n+Definition refinement.hh:31\n Dune::Alberta::Patch\n Definition refinement.hh:40\n+Dune::Alberta::Patch::neighborIndex\n+int neighborIndex(int i, int neighbor) const\n+Definition refinement.hh:139\n+Dune::Alberta::Patch::elementType\n+int elementType(int i) const\n+Definition refinement.hh:125\n+Dune::Alberta::Patch::count\n+int count() const\n+Definition refinement.hh:67\n+Dune::Alberta::Patch::elementInfo\n+ElementInfo elementInfo(int i, const LevelProvider &levelProvider) const\n+Definition refinement.hh:105\n+Dune::Alberta::Patch::forEach\n+void forEach(Functor &functor) const\n+Definition refinement.hh:80\n+Dune::Alberta::Patch::operator[]\n+Element * operator[](int i) const\n+Definition refinement.hh:95\n+Dune::Alberta::Patch::forEachInteriorSubChild\n+void forEachInteriorSubChild(Functor &functor) const\n+Definition refinement.hh:87\n+Dune::Alberta::Patch::dimension\n+static const int dimension\n+Definition refinement.hh:47\n+Dune::Alberta::Patch::hasNeighbor\n+bool hasNeighbor(int i, int neighbor) const\n+Definition refinement.hh:133\n+Dune::Alberta::Patch::Patch\n+Patch(ElementList *list, int count)\n+Definition refinement.hh:58\n+Dune::Alberta::Patch::ElementInfo\n+Alberta::ElementInfo< dimension > ElementInfo\n+Definition refinement.hh:49\n+Dune::Alberta::Patch::ElementList\n+ALBERTA RC_LIST_EL ElementList\n+Definition refinement.hh:51\n+Dune::Alberta::ForEachInteriorSubChild<_dim,_0_>::apply\n+static void apply(Functor &functor, const Patch< dim > &patch)\n+Definition refinement.hh:154\n+Dune::Alberta::ForEachInteriorSubChild<_dim,_dim_>::apply\n+static void apply(Functor &functor, const Patch< dim > &patch)\n+Definition refinement.hh:169\n+Dune::Alberta::ForEachInteriorSubChild<_2,_1_>::apply\n+static void apply(Functor &functor, const Patch< 2 > &patch)\n+Definition refinement.hh:179\n+Dune::Alberta::ForEachInteriorSubChild<_3,_1_>::apply\n+static void apply(Functor &functor, const Patch< 3 > &patch)\n+Definition refinement.hh:202\n+Dune::Alberta::ForEachInteriorSubChild<_3,_2_>::apply\n+static void apply(Functor &functor, const Patch< 3 > &patch)\n+Definition refinement.hh:249\n+Dune::Alberta::GeometryInFather\n+Definition refinement.hh:292\n+Dune::Alberta::GeometryInFather<_1_>::coordinate\n+static const LocalVector & coordinate(int child, int, int i)\n+Definition refinement.hh:302\n+Dune::Alberta::GeometryInFather<_2_>::coordinate\n+static const LocalVector & coordinate(int child, int, int i)\n+Definition refinement.hh:319\n+Dune::Alberta::GeometryInFather<_3_>::coordinate\n+static const LocalVector & coordinate(int child, int orientation, int i)\n+Definition refinement.hh:337\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00659.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00659.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: agrid.hh File Reference\n+dune-grid: elementinfo.hh File Reference\n \n \n \n \n \n \n \n@@ -71,95 +71,51 @@\n \n
    \n
    \n
    \n \n-
    agrid.hh File Reference
    \n+Namespaces
    \n+
    elementinfo.hh File Reference
    \n \n
    \n \n-

    provides the AlbertaGrid class \n+

    provides a wrapper for ALBERTA's el_info structure \n More...

    \n
    #include <cassert>
    \n-#include <cstddef>
    \n-#include <algorithm>
    \n-#include <iostream>
    \n-#include <fstream>
    \n-#include <memory>
    \n #include <vector>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/fmatrix.hh>
    \n-#include <dune/common/stdstreams.hh>
    \n-#include <dune/common/parallel/communication.hh>
    \n-#include <dune/grid/common/grid.hh>
    \n-#include <dune/grid/common/gridfactory.hh>
    \n-#include <dune/grid/common/adaptcallback.hh>
    \n-#include <dune/grid/common/sizecache.hh>
    \n-#include "albertaheader.hh"
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/capabilities.hh>
    \n-#include <dune/grid/albertagrid/backuprestore.hh>
    \n-#include <dune/grid/albertagrid/coordcache.hh>
    \n-#include <dune/grid/albertagrid/gridfamily.hh>
    \n-#include <dune/grid/albertagrid/level.hh>
    \n-#include <dune/grid/albertagrid/intersection.hh>
    \n-#include <dune/grid/albertagrid/intersectioniterator.hh>
    \n-#include <dune/grid/albertagrid/datahandle.hh>
    \n-#include <dune/grid/albertagrid/entityseed.hh>
    \n-#include "indexsets.hh"
    \n-#include "geometry.hh"
    \n-#include "entity.hh"
    \n-#include "hierarchiciterator.hh"
    \n-#include "treeiterator.hh"
    \n-#include "leveliterator.hh"
    \n-#include "leafiterator.hh"
    \n-#include "albertagrid.cc"
    \n-#include <dune/grid/albertagrid/undefine-3.0.hh>
    \n+#include <utility>
    \n+#include <dune/grid/albertagrid/geometrycache.hh>
    \n+#include <dune/grid/albertagrid/macroelement.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::AlbertaGrid< dim, dimworld >
     [ provides Dune::Grid ] More...
    class  Dune::Alberta::ElementInfo< dim >
     
    struct  Dune::Alberta::ElementInfo< dim >::Instance
     
    class  Dune::Alberta::ElementInfo< dim >::Stack
     
    struct  Dune::Alberta::ElementInfo< dim >::Seed
     
    \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n+\n+\n

    \n-Macros

    #define _ALBERTA_H_
     
    namespace  Dune::Alberta
     
    \n

    Detailed Description

    \n-

    provides the AlbertaGrid class

    \n-
    Author
    Robert Kloefkorn and Martin Nolte
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ _ALBERTA_H_

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define _ALBERTA_H_
    \n-
    \n-\n-
    \n-
    \n-
    \n+

    provides a wrapper for ALBERTA's el_info structure

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,66 +1,37 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces | Macros\n-agrid.hh File Reference\n-provides the AlbertaGrid class More...\n+Classes | Namespaces\n+elementinfo.hh File Reference\n+provides a wrapper for ALBERTA's el_info structure 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 \"albertaheader.hh\"\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \"indexsets.hh\"\n-#include \"geometry.hh\"\n-#include \"entity.hh\"\n-#include \"hierarchiciterator.hh\"\n-#include \"treeiterator.hh\"\n-#include \"leveliterator.hh\"\n-#include \"leafiterator.hh\"\n-#include \"albertagrid.cc\"\n-#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::AlbertaGrid<_dim,_dimworld_>\n-\u00a0 [ provides Dune::Grid ] More...\n+ class \u00a0 Dune::Alberta::ElementInfo<_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::ElementInfo<_dim_>::Instance\n+\u00a0\n+ class \u00a0 Dune::Alberta::ElementInfo<_dim_>::Stack\n+\u00a0\n+struct \u00a0 Dune::Alberta::ElementInfo<_dim_>::Seed\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-Macros\n-#define\u00a0 _ALBERTA_H_\n+namespace \u00a0 Dune::Alberta\n \u00a0\n ***** Detailed Description *****\n-provides the AlbertaGrid class\n+provides a wrapper for ALBERTA's el_info structure\n Author\n- Robert Kloefkorn and Martin Nolte\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0_ALBERTA_H_ *****\n-#define _ALBERTA_H_\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00659_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00659_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: agrid.hh Source File\n+dune-grid: elementinfo.hh Source File\n \n \n \n \n \n \n \n@@ -74,845 +74,1228 @@\n \n \n \n
    \n-
    agrid.hh
    \n+
    elementinfo.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTAGRID_IMP_HH
    \n-
    6#define DUNE_ALBERTAGRID_IMP_HH
    \n+
    5#ifndef DUNE_ALBERTA_ELEMENTINFO_HH
    \n+
    6#define DUNE_ALBERTA_ELEMENTINFO_HH
    \n
    7
    \n-
    13#if HAVE_ALBERTA || DOXYGEN
    \n-
    14
    \n-
    15#include <cassert>
    \n-
    16#include <cstddef>
    \n-
    17
    \n-
    18#include <algorithm>
    \n-
    19#include <iostream>
    \n-
    20#include <fstream>
    \n-
    21#include <memory>
    \n-
    22#include <vector>
    \n-
    23
    \n-
    24// Dune includes
    \n-
    25#include <dune/common/fvector.hh>
    \n-
    26#include <dune/common/fmatrix.hh>
    \n-
    27#include <dune/common/stdstreams.hh>
    \n-
    28#include <dune/common/parallel/communication.hh>
    \n-
    29
    \n-\n-\n-\n-\n-
    34
    \n-
    35//- Local includes
    \n-
    36// some cpp defines and include of alberta.h
    \n-
    37#include "albertaheader.hh"
    \n-
    38
    \n-\n-\n-\n-
    42
    \n-\n-\n-\n-\n-\n-\n-\n-
    50
    \n-
    51#include "indexsets.hh"
    \n-
    52#include "geometry.hh"
    \n-
    53#include "entity.hh"
    \n-
    54#include "hierarchiciterator.hh"
    \n-
    55#include "treeiterator.hh"
    \n-
    56#include "leveliterator.hh"
    \n-
    57#include "leafiterator.hh"
    \n-
    58
    \n-
    \n-
    59namespace Dune
    \n-
    60{
    \n+
    13#include <cassert>
    \n+
    14#include <vector>
    \n+
    15#include <utility>
    \n+
    16
    \n+\n+\n+
    19
    \n+
    20#if HAVE_ALBERTA
    \n+
    21
    \n+
    22namespace Dune
    \n+
    23{
    \n+
    24
    \n+
    25 namespace Alberta
    \n+
    26 {
    \n+
    27
    \n+
    28 // External Forward Declarations
    \n+
    29 // -----------------------------
    \n+
    30
    \n+
    31 template< int dim >
    \n+
    32 class MeshPointer;
    \n+
    33
    \n+
    34 struct BasicNodeProjection;
    \n+
    35
    \n+
    36
    \n+
    37
    \n+
    38 // ElementInfo
    \n+
    39 // -----------
    \n+
    40
    \n+
    41 template< int dim >
    \n+
    \n+\n+
    43 {
    \n+
    44 struct Instance;
    \n+
    45 class Stack;
    \n+
    46
    \n+
    47 template< int >
    \n+
    48 struct Library;
    \n+
    49
    \n+
    50 typedef Instance *InstancePtr;
    \n+
    51
    \n+
    52 public:
    \n+
    53 static const int dimension = dim;
    \n+
    54
    \n+\n+\n+
    57
    \n+\n+\n+\n
    61
    \n-
    62 // External Forward Declarations
    \n-
    63 // -----------------------------
    \n-
    64
    \n-
    65 template< class Grid >
    \n-
    66 struct DGFGridFactory;
    \n-
    67
    \n-
    68
    \n+
    62 static const int maxNeighbors = N_NEIGH_MAX;
    \n+
    63
    \n+
    64 static const int maxLevelNeighbors = Library< dimWorld >::maxLevelNeighbors;
    \n+
    65
    \n+
    66#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n+\n+
    68#endif
    \n
    69
    \n-
    70 // AlbertaGrid
    \n-
    71 // -----------
    \n-
    72
    \n-
    105 template< int dim, int dimworld = Alberta::dimWorld >
    \n-
    \n-\n-\n-
    108 < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
    \n-
    109 {
    \n-\n-\n-\n-
    113 Base;
    \n-
    114
    \n-
    115 template< int, int, class > friend class AlbertaGridEntity;
    \n-
    116 template< class > friend class AlbertaLevelGridView;
    \n-
    117 template< class > friend class AlbertaLeafGridView;
    \n-
    118 template< int, class, bool > friend class AlbertaGridTreeIterator;
    \n-
    119 template< class > friend class AlbertaGridHierarchicIterator;
    \n-
    120
    \n-
    121 friend class GridFactory< This >;
    \n-
    122 friend struct DGFGridFactory< This >;
    \n-
    123
    \n-
    124 friend class AlbertaGridIntersectionBase< const This >;
    \n-
    125 friend class AlbertaGridLeafIntersection< const This >;
    \n-
    126
    \n-
    127 friend class AlbertaMarkerVector< dim, dimworld >;
    \n-
    128#if (__GNUC__ < 4) && !(defined __ICC)
    \n-
    129 // add additional friend decls for gcc 3.4
    \n-
    130 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<true>;
    \n-
    131 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<false>;
    \n-
    132#endif
    \n-
    133 friend class AlbertaGridIndexSet< dim, dimworld >;
    \n-\n-
    135
    \n-
    136 template< class, class >
    \n-\n-
    138
    \n-
    139 public:
    \n-\n-
    142
    \n-\n-
    144
    \n-\n-\n-
    147
    \n-
    148 // the Traits
    \n-\n-
    150
    \n-\n-\n-
    155
    \n-\n-
    158
    \n-\n-\n-
    163
    \n-\n-
    166
    \n-
    167 private:
    \n-
    169 typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
    \n-
    170
    \n-
    172 typedef AlbertaGridIdSet<dim,dimworld> IdSetImp;
    \n-
    173
    \n-
    175 struct AdaptationState
    \n-
    176 {
    \n-
    177 enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };
    \n+
    70 struct Seed;
    \n+
    71
    \n+
    72 private:
    \n+
    73 explicit ElementInfo ( const InstancePtr &instance );
    \n+
    74
    \n+
    75 public:
    \n+
    \n+\n+
    \n+\n+
    78 typename FillFlags::Flags fillFlags = FillFlags::standard );
    \n+
    \n+
    79 ElementInfo ( const MeshPointer &mesh, const Seed &seed,
    \n+
    80 typename FillFlags::Flags fillFlags = FillFlags::standard );
    \n+
    \n+
    81 ElementInfo ( const ElementInfo &other );
    \n+
    \n+\n+
    83
    \n+
    \n+\n+
    85
    \n+
    \n+\n+
    \n+\n+
    88
    \n+
    89 explicit operator bool () const { return (instance_ != null()); }
    \n+
    90
    \n+
    \n+
    91 bool operator== ( const ElementInfo &other ) const;
    \n+
    \n+
    92 bool operator!= ( const ElementInfo &other ) const;
    \n+
    93
    \n+
    \n+
    94 const MacroElement &macroElement () const;
    \n+
    \n+\n+
    \n+
    96 int indexInFather () const;
    \n+
    \n+
    97 ElementInfo child ( int i ) const;
    \n+
    \n+
    98 bool isLeaf () const;
    \n+
    99
    \n+
    \n+
    100 Seed seed () const;
    \n+
    101
    \n+
    \n+\n+
    103
    \n+
    \n+
    104 bool mightVanish () const;
    \n+
    105
    \n+
    \n+
    106 int level () const;
    \n+
    107 // see ALBERTA documentation for definition of element type
    \n+
    108 // values are 0, 1, 2
    \n+
    \n+
    109 int type () const;
    \n+
    110
    \n+
    \n+
    111 int getMark () const;
    \n+
    \n+
    112 void setMark ( int refCount ) const;
    \n+
    113
    \n+
    \n+
    114 bool hasLeafNeighbor ( const int face ) const;
    \n+
    \n+
    115 ElementInfo leafNeighbor ( const int face ) const;
    \n+
    116
    \n+
    117 /* obtain all level neighbors of a face
    \n+
    118 *
    \n+
    119 * param[in] face face for which the neighbors are desired
    \n+
    120 * param[out] neighbor array storing the neighbors
    \n+
    121 * param[out] faceInNeighbor array storing the faces in neighbor
    \n+
    122 * (-1, if this neighbor does not exist)
    \n+
    123 *
    \n+
    124 * returns (potential) number of neighbors (i.e., the number of valid
    \n+
    125 * entries in the output arrays
    \n+
    126 */
    \n+
    \n+
    127 int levelNeighbors ( const int face, ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const;
    \n+
    128
    \n+
    129 template< int codim >
    \n+
    \n+
    130 int twist ( int subEntity ) const;
    \n+
    \n+
    131 int twistInNeighbor ( int face ) const;
    \n+
    \n+
    132 bool isBoundary ( int face ) const;
    \n+
    \n+
    133 int boundaryId ( int face ) const;
    \n+
    \n+\n+
    \n+\n+
    136
    \n+
    \n+
    137 bool hasCoordinates () const;
    \n+
    \n+
    138 const GlobalVector &coordinate ( int vertex ) const;
    \n+
    139#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    \n+\n+
    141 {
    \n+
    142 return GeometryCache( instance_->geometryCache, instance_->elInfo );
    \n+
    143 }
    \n+
    \n+
    144#endif
    \n+
    145
    \n+
    146 template< class Functor >
    \n+
    \n+
    147 void hierarchicTraverse ( Functor &functor ) const;
    \n+
    148
    \n+
    149 template< class Functor >
    \n+
    \n+
    150 void leafTraverse ( Functor &functor ) const;
    \n+
    151
    \n+
    \n+
    152 const Element *element () const;
    \n+
    \n+
    153 const Element *neighbor ( int face ) const;
    \n+
    \n+
    154 Element *el () const;
    \n+
    \n+
    155 ALBERTA EL_INFO &elInfo () const;
    \n+
    156
    \n+
    157 static ElementInfo
    \n+
    \n+\n+
    159 const Element *element, int level, int type = 0 );
    \n+
    \n+
    160 static ElementInfo createFake ( const ALBERTA EL_INFO &elInfo );
    \n+
    161
    \n+
    162 private:
    \n+
    163 static bool isLeaf ( Element *element );
    \n+
    164 static bool mightVanish ( Element *element, int depth );
    \n+
    165
    \n+
    166 static void fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO &elInfo );
    \n+
    167 static void fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA EL_INFO &elInfo );
    \n+
    168
    \n+
    169 void addReference () const;
    \n+
    170 void removeReference () const;
    \n+
    171
    \n+
    172 static InstancePtr null ();
    \n+
    173 static Stack &stack ();
    \n+
    174
    \n+
    175 InstancePtr instance_;
    \n+
    176 };
    \n+
    177
    \n
    178
    \n-
    179 private:
    \n-
    180 Phase phase_;
    \n-
    181 int coarsenMarked_;
    \n-
    182 int refineMarked_;
    \n-
    183
    \n-
    184 public:
    \n-
    185 AdaptationState ()
    \n-
    186 : phase_( ComputationPhase ),
    \n-
    187 coarsenMarked_( 0 ),
    \n-
    188 refineMarked_( 0 )
    \n-
    189 {}
    \n-
    190
    \n-
    191 void mark ( int count )
    \n-
    192 {
    \n-
    193 if( count < 0 )
    \n-
    194 ++coarsenMarked_;
    \n-
    195 if( count > 0 )
    \n-
    196 refineMarked_ += (2 << count);
    \n-
    197 }
    \n-
    198
    \n-
    199 void unmark ( int count )
    \n-
    200 {
    \n-
    201 if( count < 0 )
    \n-
    202 --coarsenMarked_;
    \n-
    203 if( count > 0 )
    \n-
    204 refineMarked_ -= (2 << count);
    \n-
    205 }
    \n-
    206
    \n-
    207 bool coarsen () const
    \n-
    208 {
    \n-
    209 return (coarsenMarked_ > 0);
    \n-
    210 }
    \n-
    211
    \n-
    212 int refineMarked () const
    \n-
    213 {
    \n-
    214 return refineMarked_;
    \n-
    215 }
    \n-
    216
    \n-
    217 void preAdapt ()
    \n-
    218 {
    \n-
    219 if( phase_ != ComputationPhase )
    \n-
    220 error( "preAdapt may only be called in computation phase." );
    \n-
    221 phase_ = PreAdaptationPhase;
    \n-
    222 }
    \n+
    179
    \n+
    180 // ElementInfo::Instance
    \n+
    181 // ---------------------
    \n+
    182
    \n+
    183 template< int dim >
    \n+
    \n+
    184 struct ElementInfo< dim >::Instance
    \n+
    185 {
    \n+\n+
    187 unsigned int refCount;
    \n+
    188
    \n+
    \n+\n+
    190 {
    \n+
    191 return parent_;
    \n+
    192 }
    \n+
    \n+
    193
    \n+
    194 private:
    \n+
    195 InstancePtr parent_;
    \n+
    196
    \n+
    197#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    198 public:
    \n+\n+
    200#endif
    \n+
    201 };
    \n+
    \n+
    202
    \n+
    203
    \n+
    204
    \n+
    205 // ElementInfo::Stack
    \n+
    206 // ------------------
    \n+
    207
    \n+
    208 template< int dim >
    \n+
    \n+
    209 class ElementInfo< dim >::Stack
    \n+
    210 {
    \n+
    211 InstancePtr top_;
    \n+
    212 Instance null_;
    \n+
    213
    \n+
    214 public:
    \n+
    \n+
    215 Stack ();
    \n+
    \n+
    216 ~Stack ();
    \n+
    217
    \n+
    \n+
    218 InstancePtr allocate ();
    \n+
    \n+
    219 void release ( InstancePtr &p );
    \n+
    \n+
    220 InstancePtr null ();
    \n+
    221 };
    \n+
    222
    \n
    223
    \n-
    224 void adapt ()
    \n-
    225 {
    \n-
    226 if( phase_ != PreAdaptationPhase )
    \n-
    227 error( "adapt may only be called in preadapdation phase." );
    \n-
    228 phase_ = PostAdaptationPhase;
    \n-
    229 }
    \n-
    230
    \n-
    231 void postAdapt ()
    \n-
    232 {
    \n-
    233 if( phase_ != PostAdaptationPhase )
    \n-
    234 error( "postAdapt may only be called in postadaptation phase." );
    \n-
    235 phase_ = ComputationPhase;
    \n-
    236
    \n-
    237 coarsenMarked_ = 0;
    \n-
    238 refineMarked_ = 0;
    \n-
    239 }
    \n-
    240
    \n-
    241 private:
    \n-
    242 void error ( const std::string &message )
    \n-
    243 {
    \n-\n-
    245 }
    \n+
    224
    \n+
    225 // ElementInfo::Library
    \n+
    226 // --------------------
    \n+
    227
    \n+
    228 template< int dim >
    \n+
    229 template< int >
    \n+
    230 struct ElementInfo< dim >::Library
    \n+
    231 {
    \n+\n+
    233
    \n+
    234 static const int maxLevelNeighbors = (1 << (dim-1));
    \n+
    235
    \n+
    236 static int
    \n+
    237 leafNeighbor ( const ElementInfo &element, const int face, ElementInfo &neighbor );
    \n+
    238
    \n+
    239 static int
    \n+
    240 levelNeighbors ( const ElementInfo &element, const int face,
    \n+
    241 ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] );
    \n+
    242
    \n+
    243 private:
    \n+
    244 static int
    \n+
    245 macroNeighbor ( const ElementInfo &element, const int face, ElementInfo &neighbor );
    \n
    246 };
    \n
    247
    \n-
    248 template< class DataHandler >
    \n-
    249 struct AdaptationCallback;
    \n-
    250
    \n-
    251 // max number of allowed levels is 64
    \n-
    252 static const int MAXL = 64;
    \n-
    253
    \n-
    254 typedef Alberta::ElementInfo< dimension > ElementInfo;
    \n-
    255 typedef Alberta::MeshPointer< dimension > MeshPointer;
    \n-\n-
    257 typedef AlbertaGridLevelProvider< dimension > LevelProvider;
    \n-
    258
    \n-
    259 public:
    \n-
    260 AlbertaGrid ( const This & ) = delete;
    \n-
    261 This &operator= ( const This & ) = delete;
    \n-
    262
    \n-
    264 AlbertaGrid ();
    \n-
    265
    \n-\n-
    272 const std::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection
    \n-
    273 = std::shared_ptr< DuneBoundaryProjection< dimensionworld > >() );
    \n-
    274
    \n-
    275 template< class Proj, class Impl >
    \n-\n-
    277 const Alberta::ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
    \n+
    248
    \n+
    249
    \n+
    250 // ElementInfo::Seed
    \n+
    251 // -----------------
    \n+
    252
    \n+
    253 template< int dim >
    \n+
    \n+
    254 struct ElementInfo< dim >::Seed
    \n+
    255 {
    \n+
    \n+\n+
    257 : macroIndex_( -1 ), level_( 0 ), path_( 0 )
    \n+
    258 {}
    \n+
    \n+
    259
    \n+
    \n+
    260 Seed ( const int macroIndex, const int level, const unsigned long path )
    \n+
    261 : macroIndex_( macroIndex ), level_( level ), path_( path )
    \n+
    262 {}
    \n+
    \n+
    263
    \n+
    \n+
    264 bool operator== ( const Seed &other ) const
    \n+
    265 {
    \n+
    266 return (macroIndex() == other.macroIndex()) && (level() == other.level()) && (path() == other.path());
    \n+
    267 }
    \n+
    \n+
    268
    \n+
    \n+
    269 bool operator< ( const Seed &other ) const
    \n+
    270 {
    \n+
    271 const bool ml = (macroIndex() < other.macroIndex());
    \n+
    272 const bool me = (macroIndex() == other.macroIndex());
    \n+
    273 const bool ll = (level() < other.level());
    \n+
    274 const bool le = (level() == other.level());
    \n+
    275 const bool pl = (path() < other.path());
    \n+
    276 return ml | (me & (ll | (le & pl)));
    \n+
    277 }
    \n+
    \n
    278
    \n-
    283 AlbertaGrid ( const std::string &macroGridFileName );
    \n-
    284
    \n-
    286 ~AlbertaGrid ();
    \n-
    287
    \n-
    290 int maxLevel () const;
    \n-
    291
    \n-
    293 template<int cd, PartitionIteratorType pitype>
    \n-
    294 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
    \n-
    295 lbegin (int level) const;
    \n+
    279 bool operator!= ( const Seed &other ) const { return !(*this == other); }
    \n+
    280 bool operator<= ( const Seed &other ) const { return !(other < *this); }
    \n+
    281 bool operator> ( const Seed &other ) const { return (other < *this); }
    \n+
    282 bool operator>= ( const Seed &other ) const { return !(*this < other); }
    \n+
    283
    \n+
    284 bool isValid ( ) const { return macroIndex_ != -1; }
    \n+
    285
    \n+
    286 int macroIndex () const { return macroIndex_; }
    \n+
    287 int level () const { return level_; }
    \n+
    288 unsigned long path () const { return path_; }
    \n+
    289
    \n+
    290 private:
    \n+
    291 int macroIndex_;
    \n+
    292 int level_;
    \n+
    293 unsigned long path_;
    \n+
    294 };
    \n+
    \n+
    295
    \n
    296
    \n-
    298 template<int cd, PartitionIteratorType pitype>
    \n-
    299 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
    \n-
    300 lend (int level) const;
    \n-
    301
    \n-
    303 template< int codim >
    \n-\n-
    305 lbegin ( int level ) const;
    \n-
    306
    \n-
    308 template< int codim >
    \n-\n-
    310 lend ( int level ) const;
    \n-
    311
    \n-
    313 template< int codim, PartitionIteratorType pitype >
    \n-
    314 typename Traits
    \n-
    315 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n-
    316 leafbegin () const;
    \n-
    317
    \n-
    319 template< int codim, PartitionIteratorType pitype >
    \n-
    320 typename Traits
    \n-
    321 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n-
    322 leafend () const;
    \n-
    323
    \n-
    325 template< int codim >
    \n-\n-
    327 leafbegin () const;
    \n-
    328
    \n-
    330 template< int codim >
    \n-\n-
    332 leafend () const;
    \n+
    297
    \n+
    298 // Implementation of ElementInfo
    \n+
    299 // -----------------------------
    \n+
    300
    \n+
    301 template< int dim >
    \n+
    302 inline ElementInfo< dim >::ElementInfo ( const InstancePtr &instance )
    \n+
    303 : instance_( instance )
    \n+
    304 {
    \n+
    305 addReference();
    \n+
    306 }
    \n+
    307
    \n+
    308
    \n+
    309 template< int dim >
    \n+
    \n+\n+
    311 : instance_( null() )
    \n+
    312 {
    \n+
    313 addReference();
    \n+
    314 }
    \n+
    \n+
    315
    \n+
    316
    \n+
    317 template< int dim >
    \n+
    318 inline ElementInfo< dim >
    \n+
    \n+
    319 ::ElementInfo ( const MeshPointer &mesh, const MacroElement &macroElement,
    \n+
    320 typename FillFlags::Flags fillFlags )
    \n+
    321 {
    \n+
    322 instance_ = stack().allocate();
    \n+
    323 instance_->parent() = null();
    \n+
    324 ++(instance_->parent()->refCount);
    \n+
    325
    \n+
    326 addReference();
    \n+
    327
    \n+
    328 elInfo().fill_flag = fillFlags;
    \n+
    329
    \n+
    330 // Alberta fills opp_vertex only if there is a neighbor
    \n+
    331 for( int k = 0; k < maxNeighbors; ++k )
    \n+
    332 elInfo().opp_vertex[ k ] = -1;
    \n
    333
    \n-
    338 int size (int level, int codim) const;
    \n-
    339
    \n-
    341 int size (int level, GeometryType type) const;
    \n-
    342
    \n-
    344 int size (int codim) const;
    \n-
    345
    \n-
    347 int size (GeometryType type) const;
    \n-
    348
    \n-
    \n-
    350 std::size_t numBoundarySegments () const
    \n-
    351 {
    \n-
    352 return numBoundarySegments_;
    \n-
    353 }
    \n-
    \n-
    354
    \n-
    \n-
    356 typename Traits::LevelGridView levelGridView ( int level ) const
    \n-
    357 {
    \n-
    358 typedef typename Traits::LevelGridView View;
    \n-
    359 typedef typename View::GridViewImp ViewImp;
    \n-
    360 return View( ViewImp( *this, level ) );
    \n-
    361 }
    \n-
    \n-
    362
    \n-
    \n-\n-
    365 {
    \n-
    366 typedef typename Traits::LeafGridView View;
    \n-
    367 typedef typename View::GridViewImp ViewImp;
    \n-
    368 return View( ViewImp( *this ) );
    \n-
    369 }
    \n+
    334 fill( mesh, &macroElement, elInfo() );
    \n+
    335 }
    \n
    \n+
    336
    \n+
    337
    \n+
    338 template< int dim >
    \n+
    339 inline ElementInfo< dim >
    \n+
    \n+
    340 ::ElementInfo ( const MeshPointer &mesh, const Seed &seed,
    \n+
    341 typename FillFlags::Flags fillFlags )
    \n+
    342 {
    \n+
    343 instance_ = stack().allocate();
    \n+
    344 instance_->parent() = null();
    \n+
    345 ++(instance_->parent()->refCount);
    \n+
    346
    \n+
    347 addReference();
    \n+
    348
    \n+
    349 // fill in macro element info
    \n+
    350 elInfo().fill_flag = fillFlags;
    \n+
    351
    \n+
    352 // Alberta fills opp_vertex only if there is a neighbor
    \n+
    353 for( int k = 0; k < maxNeighbors; ++k )
    \n+
    354 elInfo().opp_vertex[ k ] = -1;
    \n+
    355
    \n+
    356 fill( mesh, ((Mesh *)mesh)->macro_els + seed.macroIndex(), elInfo() );
    \n+
    357
    \n+
    358 // traverse the seed's path
    \n+
    359 unsigned long path = seed.path();
    \n+
    360 for( int i = 0; i < seed.level(); ++i )
    \n+
    361 {
    \n+
    362 InstancePtr child = stack().allocate();
    \n+
    363 child->parent() = instance_;
    \n+
    364
    \n+
    365 // Alberta fills opp_vertex only if there is a neighbor
    \n+
    366 for( int k = 0; k < maxNeighbors; ++k )
    \n+
    367 child->elInfo.opp_vertex[ k ] = -2;
    \n+
    368
    \n+
    369 fill( path & 1, elInfo(), child->elInfo );
    \n
    370
    \n-
    371 public:
    \n-
    372 //***************************************************************
    \n-
    373 // Interface for Adaptation
    \n-
    374 //***************************************************************
    \n-
    375 using Base::getMark;
    \n-
    376 using Base::mark;
    \n-
    377
    \n-
    379 int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const;
    \n+
    371 instance_ = child;
    \n+
    372 addReference();
    \n+
    373
    \n+
    374 path = path >> 1;
    \n+
    375 }
    \n+
    376
    \n+
    377 assert( this->seed() == seed );
    \n+
    378 }
    \n+
    \n+
    379
    \n
    380
    \n-
    382 bool mark ( int refCount, const typename Traits::template Codim< 0 >::Entity &e );
    \n-
    383
    \n-
    385 void globalRefine ( int refCount );
    \n-
    386
    \n-
    387 template< class DataHandle >
    \n-
    388 void globalRefine ( int refCount, AdaptDataHandleInterface< This, DataHandle > &handle );
    \n-
    389
    \n-
    391 bool adapt ();
    \n-
    392
    \n-
    394 template< class DataHandle >
    \n-\n-
    396
    \n-
    398 bool preAdapt ();
    \n-
    399
    \n-
    401 void postAdapt();
    \n+
    381 template< int dim >
    \n+
    \n+\n+
    383 : instance_( other.instance_ )
    \n+
    384 {
    \n+
    385 addReference();
    \n+
    386 }
    \n+
    \n+
    387
    \n+
    388 template< int dim >
    \n+
    \n+\n+
    390 : instance_( NULL )
    \n+
    391 {
    \n+
    392 using std::swap;
    \n+
    393 swap( instance_, other.instance_ );
    \n+
    394 }
    \n+
    \n+
    395
    \n+
    396 template< int dim >
    \n+
    \n+\n+
    398 {
    \n+
    399 removeReference();
    \n+
    400 }
    \n+
    \n+
    401
    \n
    402
    \n+
    403 template< int dim >
    \n+
    404 inline ElementInfo< dim > &
    \n
    \n-
    405 const Communication &comm () const
    \n-
    406 {
    \n-
    407 return comm_;
    \n-
    408 }
    \n-
    \n-
    409
    \n-
    \n-
    410 static std::string typeName ()
    \n-
    411 {
    \n-
    412 std::ostringstream s;
    \n-
    413 s << "AlbertaGrid< " << dim << ", " << dimworld << " >";
    \n-
    414 return s.str();
    \n-
    415 }
    \n-
    \n-
    416
    \n-
    418 template< class EntitySeed >
    \n-
    419 typename Traits::template Codim< EntitySeed::codimension >::Entity
    \n-
    \n-
    420 entity ( const EntitySeed &seed ) const
    \n-
    421 {
    \n-\n-
    423 return EntityImpl( *this, seed.impl().elementInfo( meshPointer() ), seed.impl().subEntity() );
    \n-
    424 }
    \n-
    \n-
    425
    \n-
    426 //**********************************************************
    \n-
    427 // End of Interface Methods
    \n-
    428 //**********************************************************
    \n-
    430 bool writeGrid( const std::string &filename, ctype time ) const;
    \n-
    431
    \n-
    433 bool readGrid( const std::string &filename, ctype &time );
    \n-
    434
    \n-
    435 // return hierarchic index set
    \n-
    436 const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
    \n+\n+
    406 {
    \n+
    407 other.addReference();
    \n+
    408 removeReference();
    \n+
    409 instance_ = other.instance_;
    \n+
    410 return *this;
    \n+
    411 }
    \n+
    \n+
    412
    \n+
    413 template< int dim >
    \n+
    414 inline ElementInfo< dim > &
    \n+
    \n+\n+
    416 {
    \n+
    417 using std::swap;
    \n+
    418 swap( instance_, other.instance_ );
    \n+
    419 return *this;
    \n+
    420 }
    \n+
    \n+
    421
    \n+
    422 template< int dim >
    \n+
    423 inline bool
    \n+
    \n+\n+
    425 {
    \n+
    426 return (instance_->elInfo.el == other.instance_->elInfo.el);
    \n+
    427 }
    \n+
    \n+
    428
    \n+
    429
    \n+
    430 template< int dim >
    \n+
    431 inline bool
    \n+
    \n+\n+
    433 {
    \n+
    434 return (instance_->elInfo.el != other.instance_->elInfo.el);
    \n+
    435 }
    \n+
    \n+
    436
    \n
    437
    \n-
    439 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
    \n-
    440
    \n-
    442 const typename Traits :: LeafIndexSet & leafIndexSet () const;
    \n-
    443
    \n-
    \n-
    445 const GlobalIdSet &globalIdSet () const
    \n-
    446 {
    \n-
    447 return idSet_;
    \n-
    448 }
    \n-
    \n-
    449
    \n-
    \n-
    451 const LocalIdSet &localIdSet () const
    \n-
    452 {
    \n-
    453 return idSet_;
    \n-
    454 }
    \n+
    438 template< int dim >
    \n+
    439 inline const typename ElementInfo< dim >::MacroElement &
    \n+
    \n+\n+
    441 {
    \n+
    442 assert( !!(*this) );
    \n+
    443 assert( elInfo().macro_el != NULL );
    \n+
    444 return static_cast< const MacroElement & >( *(elInfo().macro_el) );
    \n+
    445 }
    \n+
    \n+
    446
    \n+
    447
    \n+
    448 template< int dim >
    \n+
    \n+\n+
    450 {
    \n+
    451 assert( !!(*this) );
    \n+
    452 return ElementInfo< dim >( instance_->parent() );
    \n+
    453 }
    \n
    \n+
    454
    \n
    455
    \n-
    456 // access to mesh pointer, needed by some methods
    \n+
    456 template< int dim >
    \n
    \n-\n+\n
    458 {
    \n-
    459 return mesh_;
    \n-
    460 };
    \n-
    \n-
    461
    \n-
    \n-
    462 const MeshPointer &meshPointer () const
    \n-
    463 {
    \n-
    464 return mesh_;
    \n-
    465 }
    \n-
    \n-
    466
    \n-
    \n-\n-
    468 {
    \n-
    469 return dofNumbering_;
    \n-
    470 }
    \n-
    \n-
    471
    \n-
    \n-\n-
    473 {
    \n-
    474 return levelProvider_;
    \n-
    475 }
    \n-
    \n-
    476
    \n-
    \n-
    477 int dune2alberta ( int codim, int i ) const
    \n-
    478 {
    \n-
    479 return numberingMap_.dune2alberta( codim, i );
    \n-
    480 }
    \n-
    \n+
    459 const Element *element = elInfo().el;
    \n+
    460 const Element *father = elInfo().parent->el;
    \n+
    461 assert( father != NULL );
    \n+
    462
    \n+
    463 const int index = (father->child[ 0 ] == element ? 0 : 1);
    \n+
    464 assert( father->child[ index ] == element );
    \n+
    465 return index;
    \n+
    466 }
    \n+
    \n+
    467
    \n+
    468
    \n+
    469 template< int dim >
    \n+
    \n+\n+
    471 {
    \n+
    472 assert( !isLeaf() );
    \n+
    473
    \n+
    474 InstancePtr child = stack().allocate();
    \n+
    475 child->parent() = instance_;
    \n+
    476 addReference();
    \n+
    477
    \n+
    478 // Alberta fills opp_vertex only if there is a neighbor
    \n+
    479 for( int k = 0; k < maxNeighbors; ++k )
    \n+
    480 child->elInfo.opp_vertex[ k ] = -2;
    \n
    481
    \n-
    \n-
    482 int alberta2dune ( int codim, int i ) const
    \n-
    483 {
    \n-
    484 return numberingMap_.alberta2dune( codim, i );
    \n-
    485 }
    \n+
    482 fill( i, elInfo(), child->elInfo );
    \n+
    483 return ElementInfo< dim >( child );
    \n+
    484 }
    \n
    \n+
    485
    \n
    486
    \n-
    \n-
    487 int generic2alberta ( int codim, int i ) const
    \n-
    488 {
    \n-
    489 return genericNumberingMap_.dune2alberta( codim, i );
    \n-
    490 }
    \n-
    \n-
    491
    \n-
    \n-
    492 int alberta2generic ( int codim, int i ) const
    \n-
    493 {
    \n-
    494 return genericNumberingMap_.alberta2dune( codim, i );
    \n-
    495 }
    \n-
    \n-
    496
    \n-
    497 private:
    \n-
    498 typedef std::vector<int> ArrayType;
    \n+
    487 template< int dim >
    \n+
    \n+
    488 inline bool ElementInfo< dim >::isLeaf () const
    \n+
    489 {
    \n+
    490 assert( !(*this) == false );
    \n+
    491 return isLeaf( el() );
    \n+
    492 }
    \n+
    \n+
    493
    \n+
    494
    \n+
    495 template< int dim >
    \n+
    \n+\n+
    497 {
    \n+
    498 assert( !!(*this) );
    \n
    499
    \n-
    500 void setup ();
    \n-
    501
    \n-
    502 // make the calculation of indexOnLevel and so on.
    \n-
    503 // extra method because of Reihenfolge
    \n-
    504 void calcExtras();
    \n-
    505
    \n-
    506 private:
    \n-
    507 // delete mesh and all vectors
    \n-
    508 void removeMesh();
    \n-
    509
    \n-
    510 //***********************************************************************
    \n-
    511 // MemoryManagement for Entities and Geometries
    \n-
    512 //**********************************************************************
    \n-\n-\n-
    515
    \n-
    516 public:
    \n-\n-
    518
    \n-
    519 template< int codim >
    \n-
    520 static int
    \n-
    \n-\n-
    522 {
    \n-
    523 return entity.impl().twist();
    \n-
    524 }
    \n-
    \n-
    525
    \n-
    526 template< int codim >
    \n-
    527 static int
    \n-
    \n-
    528 getTwist ( const typename Traits::template Codim< 0 >::Entity &entity, int subEntity )
    \n-
    529 {
    \n-
    530 return entity.impl().template twist< codim >( subEntity );
    \n-
    531 }
    \n-
    \n-
    532
    \n-
    533 static int
    \n-
    \n-
    534 getTwistInInside ( const typename Traits::LeafIntersection &intersection )
    \n-
    535 {
    \n-
    536 return intersection.impl().twistInInside();
    \n-
    537 }
    \n+
    500 int level = 0;
    \n+
    501 unsigned long path = 0;
    \n+
    502 for( InstancePtr p = instance_; p->parent() != null(); p = p->parent() )
    \n+
    503 {
    \n+
    504 const Element *element = p->elInfo.el;
    \n+
    505 const Element *father = p->parent()->elInfo.el;
    \n+
    506 const unsigned long child = static_cast< unsigned long >( father->child[ 1 ] == element );
    \n+
    507 path = (path << 1) | child;
    \n+
    508 ++level;
    \n+
    509 }
    \n+
    510
    \n+
    511 if( level != elInfo().level )
    \n+
    512 DUNE_THROW( NotImplemented, "Seed for fake elements not implemented." );
    \n+
    513
    \n+
    514 return Seed( macroElement().index, level, path );
    \n+
    515 }
    \n+
    \n+
    516
    \n+
    517
    \n+
    518 template< int dim >
    \n+
    \n+\n+
    520 {
    \n+
    521 return MeshPointer( elInfo().mesh );
    \n+
    522 }
    \n+
    \n+
    523
    \n+
    524
    \n+
    525 template< int dim >
    \n+
    \n+\n+
    527 {
    \n+
    528 return mightVanish( el(), 0 );
    \n+
    529 }
    \n+
    \n+
    530
    \n+
    531
    \n+
    532 template< int dim >
    \n+
    \n+
    533 inline int ElementInfo< dim >::level () const
    \n+
    534 {
    \n+
    535 return elInfo().level;
    \n+
    536 }
    \n
    \n+
    537
    \n
    538
    \n-
    539 static int
    \n+
    539 template< int dim >
    \n
    \n-
    540 getTwistInOutside ( const typename Traits::LeafIntersection &intersection )
    \n-
    541 {
    \n-
    542 return intersection.impl().twistInOutside();
    \n+
    540 inline int ElementInfo< dim >::type () const
    \n+
    541 {
    \n+
    542 return 0;
    \n
    543 }
    \n
    \n
    544
    \n-
    545 public:
    \n-
    546 // read global element number from elNumbers_
    \n-\n-
    548 getCoord ( const ElementInfo &elementInfo, int vertex ) const;
    \n-
    549
    \n-
    550 private:
    \n-
    551 // pointer to an Albert Mesh, which contains the data
    \n-
    552 MeshPointer mesh_;
    \n-
    553
    \n-
    554 // communication
    \n-
    555 Communication comm_;
    \n-
    556
    \n-
    557 // maximum level of the mesh
    \n-
    558 int maxlevel_;
    \n+
    545
    \n+
    546 template<>
    \n+
    \n+
    547 inline int ElementInfo< 3 >::type () const
    \n+
    548 {
    \n+
    549 return instance_->elInfo.el_type;
    \n+
    550 }
    \n+
    \n+
    551
    \n+
    552
    \n+
    553 template< int dim >
    \n+
    \n+
    554 inline int ElementInfo< dim >::getMark () const
    \n+
    555 {
    \n+
    556 return el()->mark;
    \n+
    557 }
    \n+
    \n+
    558
    \n
    559
    \n-
    560 // number of boundary segments within the macro grid
    \n-
    561 size_t numBoundarySegments_;
    \n-
    562
    \n-
    563 // map between ALBERTA and DUNE numbering
    \n-\n-\n-
    566
    \n-
    567 DofNumbering dofNumbering_;
    \n+
    560 template< int dim >
    \n+
    \n+
    561 inline void ElementInfo< dim >::setMark ( int refCount ) const
    \n+
    562 {
    \n+
    563 assert( isLeaf() );
    \n+
    564 assert( (refCount >= -128) && (refCount < 127) );
    \n+
    565 el()->mark = refCount;
    \n+
    566 }
    \n+
    \n+
    567
    \n
    568
    \n-
    569 LevelProvider levelProvider_;
    \n-
    570
    \n-
    571 // hierarchical numbering of AlbertaGrid, unique per codim
    \n-
    572 HierarchicIndexSet hIndexSet_;
    \n-
    573
    \n-
    574 // the id set of this grid
    \n-
    575 IdSetImp idSet_;
    \n-
    576
    \n-
    577 // the level index set, is generated from the HierarchicIndexSet
    \n-
    578 // is generated, when accessed
    \n-
    579 mutable std::vector< typename GridFamily::LevelIndexSetImp * > levelIndexVec_;
    \n-
    580
    \n-
    581 // the leaf index set, is generated from the HierarchicIndexSet
    \n-
    582 // is generated, when accessed
    \n-
    583 mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;
    \n-
    584
    \n-
    585 SizeCache< This > sizeCache_;
    \n-
    586
    \n-
    587 typedef AlbertaMarkerVector< dim, dimworld > MarkerVector;
    \n-
    588
    \n-
    589 // needed for VertexIterator, mark on which element a vertex is treated
    \n-
    590 mutable MarkerVector leafMarkerVector_;
    \n-
    591
    \n-
    592 // needed for VertexIterator, mark on which element a vertex is treated
    \n-
    593 mutable std::vector< MarkerVector > levelMarkerVector_;
    \n-
    594
    \n-
    595#if DUNE_ALBERTA_CACHE_COORDINATES
    \n-\n-
    597#endif
    \n-
    598
    \n-
    599 // current state of adaptation
    \n-
    600 AdaptationState adaptationState_;
    \n-
    601 };
    \n+
    569 template< int dim >
    \n+
    \n+
    570 inline bool ElementInfo< dim >::hasLeafNeighbor ( const int face ) const
    \n+
    571 {
    \n+
    572 assert( !!(*this) );
    \n+
    573 assert( (face >= 0) && (face < maxNeighbors) );
    \n+
    574
    \n+
    575 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n+
    576 const int macroFace = elInfo().macro_wall[ face ];
    \n+
    577 if( macroFace >= 0 )
    \n+
    578 return (macroElement().neighbor( macroFace ) != NULL);
    \n+
    579 else
    \n+
    580 return true;
    \n+
    581 }
    \n+
    \n+
    582
    \n+
    583
    \n+
    584 template< int dim >
    \n+
    \n+\n+
    586 {
    \n+
    587 assert( (face >= 0) && (face < numFaces) );
    \n+
    588 ElementInfo neighbor;
    \n+
    589 Library< dimWorld >::leafNeighbor( *this, face, neighbor );
    \n+
    590 return neighbor;
    \n+
    591 }
    \n+
    \n+
    592
    \n+
    593
    \n+
    594 template< int dim >
    \n+
    595 inline int ElementInfo< dim >
    \n+
    \n+
    596 ::levelNeighbors ( const int face, ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const
    \n+
    597 {
    \n+
    598 assert( (face >= 0) && (face < numFaces) );
    \n+
    599 return Library< dimWorld >::levelNeighbors( *this, face, neighbor, faceInNeighbor );
    \n+
    600 }
    \n
    \n+
    601
    \n
    602
    \n-
    603} // namespace Dune
    \n+
    603 template< int dim >
    \n+
    604 template< int codim >
    \n+
    \n+
    605 inline int ElementInfo< dim >::twist ( int subEntity ) const
    \n+
    606 {
    \n+
    607 return Twist< dim, dim-codim >::twist( element(), subEntity );
    \n+
    608 }
    \n
    \n-
    604
    \n-
    605#include "albertagrid.cc"
    \n-
    606
    \n-
    607// undef all dangerous defines
    \n-
    608#undef DIM
    \n-
    609#undef DIM_OF_WORLD
    \n+
    609
    \n
    610
    \n-
    611#ifdef _ABS_NOT_DEFINED_
    \n-
    612#undef ABS
    \n-
    613#endif
    \n-
    614
    \n-
    615#ifdef _MIN_NOT_DEFINED_
    \n-
    616#undef MIN
    \n-
    617#endif
    \n+
    611 template< int dim >
    \n+
    \n+
    612 inline int ElementInfo< dim >::twistInNeighbor ( const int face ) const
    \n+
    613 {
    \n+
    614 assert( neighbor( face ) != NULL );
    \n+
    615 return Twist< dim, dim-1 >::twist( neighbor( face ), elInfo().opp_vertex[ face ] );
    \n+
    616 }
    \n+
    \n+
    617
    \n
    618
    \n-
    619#ifdef _MAX_NOT_DEFINED_
    \n-
    620#undef MAX
    \n-
    621#endif
    \n-
    622
    \n-
    623#ifdef obstack_chunk_alloc
    \n-
    624#undef obstack_chunk_alloc
    \n-
    625#endif
    \n-
    626#ifdef obstack_chunk_free
    \n-
    627#undef obstack_chunk_free
    \n-
    628#endif
    \n-\n-
    630
    \n-
    631// We use MEM_ALLOC, so undefine it here.
    \n-
    632#undef MEM_ALLOC
    \n+
    619 template< int dim >
    \n+
    \n+
    620 inline bool ElementInfo< dim >::isBoundary ( int face ) const
    \n+
    621 {
    \n+
    622 assert( !!(*this) );
    \n+
    623 assert( (face >= 0) && (face < maxNeighbors) );
    \n+
    624
    \n+
    625 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n+
    626 const int macroFace = elInfo().macro_wall[ face ];
    \n+
    627 if( macroFace >= 0 )
    \n+
    628 return macroElement().isBoundary( macroFace );
    \n+
    629 else
    \n+
    630 return false;
    \n+
    631 }
    \n+
    \n+
    632
    \n
    633
    \n-
    634// We use MEM_REALLOC, so undefine it here.
    \n-
    635#undef MEM_REALLOC
    \n-
    636
    \n-
    637// We use MEM_CALLOC, so undefine it here.
    \n-
    638#undef MEM_CALLOC
    \n+
    634 template< int dim >
    \n+
    \n+
    635 inline int ElementInfo< dim >::boundaryId ( int face ) const
    \n+
    636 {
    \n+
    637 assert( !!(*this) );
    \n+
    638 assert( (face >= 0) && (face < N_WALLS_MAX) );
    \n
    639
    \n-
    640// We use MEM_FREE, so undefine it here.
    \n-
    641#undef MEM_FREE
    \n-
    642
    \n-
    643// Macro ERROR may be defined by alberta_util.h. If so, undefine it.
    \n-
    644#ifdef ERROR
    \n-
    645#undef ERROR
    \n-
    646#endif // #ifdef ERROR
    \n+
    640 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n+
    641 const int macroFace = elInfo().macro_wall[ face ];
    \n+
    642 const int id = macroElement().boundaryId( macroFace );
    \n+
    643 // this assertion is only allowed, if FILL_BOUND is set
    \n+
    644 // assert( id == elInfo().wall_bound[ face ] );
    \n+
    645 return id;
    \n+
    646 }
    \n+
    \n
    647
    \n-
    648// Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.
    \n-
    649#ifdef ERROR_EXIT
    \n-
    650#undef ERROR_EXIT
    \n-
    651#endif // #ifdef ERROR_EXIT
    \n-
    652
    \n-
    653// Macro WARNING may be defined by alberta_util.h. If so, undefine it.
    \n-
    654#ifdef WARNING
    \n-
    655#undef WARNING
    \n-
    656#endif // #ifdef WARNING
    \n-
    657
    \n-
    658// Macro TEST may be defined by alberta_util.h. If so, undefine it.
    \n-
    659#ifdef TEST
    \n-
    660#undef TEST
    \n-
    661#endif // #ifdef TEST
    \n-
    662
    \n-
    663// Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
    \n-
    664#ifdef TEST_EXIT
    \n-
    665#undef TEST_EXIT
    \n-
    666#endif // #ifdef TEST_EXIT
    \n-
    667
    \n-
    668// Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.
    \n-
    669#ifdef DEBUG_TEST
    \n-
    670#undef DEBUG_TEST
    \n-
    671#endif // #ifdef DEBUG_TEST
    \n-
    672
    \n-
    673// Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
    \n-
    674#ifdef DEBUG_TEST_EXIT
    \n-
    675#undef DEBUG_TEST_EXIT
    \n-
    676#endif // #ifdef DEBUG_TEST_EXIT
    \n+
    648
    \n+
    649 template< int dim >
    \n+
    650 inline AffineTransformation *
    \n+
    \n+\n+
    652 {
    \n+
    653 assert( !!(*this) );
    \n+
    654 assert( (face >= 0) && (face < N_WALLS_MAX) );
    \n+
    655
    \n+
    656 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n+
    657 const int macroFace = elInfo().macro_wall[ face ];
    \n+
    658 return (macroFace < 0 ? NULL : macroElement().wall_trafo[ macroFace ]);
    \n+
    659 }
    \n+
    \n+
    660
    \n+
    661
    \n+
    662 template< int dim >
    \n+
    663 inline BasicNodeProjection *
    \n+
    \n+\n+
    665 {
    \n+
    666 assert( !!(*this) );
    \n+
    667 assert( (face >= 0) && (face < N_WALLS_MAX) );
    \n+
    668
    \n+
    669 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n+
    670 const int macroFace = elInfo().macro_wall[ face ];
    \n+
    671 if( macroFace >= 0 )
    \n+
    672 return static_cast< BasicNodeProjection * >( macroElement().projection[ macroFace+1 ] );
    \n+
    673 else
    \n+
    674 return 0;
    \n+
    675 }
    \n+
    \n+
    676
    \n
    677
    \n-
    678// Macro INFO may be defined by alberta_util.h. If so, undefine it.
    \n-
    679#ifdef INFO
    \n-
    680#undef INFO
    \n-
    681#endif // #ifdef INFO
    \n-
    682
    \n-
    683// Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.
    \n-
    684#ifdef PRINT_INFO
    \n-
    685#undef PRINT_INFO
    \n-
    686#endif // #ifdef PRINT_INFO
    \n-
    687
    \n-
    688// Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.
    \n-
    689#ifdef PRINT_INT_VEC
    \n-
    690#undef PRINT_INT_VEC
    \n-
    691#endif // #ifdef PRINT_INT_VEC
    \n+
    678 template< int dim >
    \n+
    \n+\n+
    680 {
    \n+
    681 return ((elInfo().fill_flag & FillFlags::coords) != 0);
    \n+
    682 }
    \n+
    \n+
    683
    \n+
    684 template< int dim >
    \n+
    \n+
    685 inline const GlobalVector &ElementInfo< dim >::coordinate ( int vertex ) const
    \n+
    686 {
    \n+
    687 assert( hasCoordinates() );
    \n+
    688 assert( (vertex >= 0) && (vertex < numVertices) );
    \n+
    689 return elInfo().coord[ vertex ];
    \n+
    690 }
    \n+
    \n+
    691
    \n
    692
    \n-
    693// Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine it.
    \n-
    694#ifdef PRINT_REAL_VEC
    \n-
    695#undef PRINT_REAL_VEC
    \n-
    696#endif // #ifdef PRINT_REAL_VEC
    \n-
    697
    \n-
    698// Macro WAIT may be defined by alberta_util.h. If so, undefine it.
    \n-
    699#ifdef WAIT
    \n-
    700#undef WAIT
    \n-
    701#endif // #ifdef WAIT
    \n-
    702
    \n-
    703// Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.
    \n-
    704#ifdef WAIT_REALLY
    \n-
    705#undef WAIT_REALLY
    \n-
    706#endif // #ifdef WAIT_REALLY
    \n-
    707
    \n-
    708// Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
    \n-
    709#ifdef GET_WORKSPACE
    \n-
    710#undef GET_WORKSPACE
    \n-
    711#endif // #ifdef GET_WORKSPACE
    \n-
    712
    \n-
    713// Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
    \n-
    714#ifdef FREE_WORKSPACE
    \n-
    715#undef FREE_WORKSPACE
    \n-
    716#endif // #ifdef FREE_WORKSPACE
    \n-
    717
    \n-
    718// Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.
    \n-
    719#ifdef MAT_ALLOC
    \n-
    720#undef MAT_ALLOC
    \n-
    721#endif // #ifdef MAT_ALLOC
    \n-
    722
    \n-
    723// Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.
    \n-
    724#ifdef MAT_FREE
    \n-
    725#undef MAT_FREE
    \n-
    726#endif // #ifdef MAT_FREE
    \n-
    727
    \n-
    728// Macro NAME may be defined by alberta_util.h. If so, undefine it.
    \n-
    729#ifdef NAME
    \n-
    730#undef NAME
    \n-
    731#endif // #ifdef NAME
    \n-
    732
    \n-
    733// Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.
    \n-
    734#ifdef GET_STRUCT
    \n-
    735#undef GET_STRUCT
    \n-
    736#endif // #ifdef GET_STRUCT
    \n-
    737
    \n-
    738// Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.
    \n-
    739#ifdef ADD_PARAMETER
    \n-
    740#undef ADD_PARAMETER
    \n-
    741#endif // #ifdef ADD_PARAMETER
    \n+
    693 template< int dim >
    \n+
    694 template< class Functor >
    \n+
    \n+
    695 inline void ElementInfo< dim >::hierarchicTraverse ( Functor &functor ) const
    \n+
    696 {
    \n+
    697 functor( *this );
    \n+
    698 if( !isLeaf() )
    \n+
    699 {
    \n+
    700 child( 0 ).hierarchicTraverse( functor );
    \n+
    701 child( 1 ).hierarchicTraverse( functor );
    \n+
    702 }
    \n+
    703 }
    \n+
    \n+
    704
    \n+
    705
    \n+
    706 template< int dim >
    \n+
    707 template< class Functor >
    \n+
    \n+
    708 inline void ElementInfo< dim >::leafTraverse ( Functor &functor ) const
    \n+
    709 {
    \n+
    710 if( !isLeaf() )
    \n+
    711 {
    \n+
    712 child( 0 ).leafTraverse( functor );
    \n+
    713 child( 1 ).leafTraverse( functor );
    \n+
    714 }
    \n+
    715 else
    \n+
    716 functor( *this );
    \n+
    717 }
    \n+
    \n+
    718
    \n+
    719
    \n+
    720 template< int dim >
    \n+
    \n+\n+
    722 {
    \n+
    723 return elInfo().el;
    \n+
    724 }
    \n+
    \n+
    725
    \n+
    726
    \n+
    727 template< int dim >
    \n+
    \n+
    728 inline const Element *ElementInfo< dim >::neighbor ( int face ) const
    \n+
    729 {
    \n+
    730 assert( (face >= 0) && (face < numFaces) );
    \n+
    731 assert( (elInfo().fill_flag & FillFlags::neighbor) != 0 );
    \n+
    732 return elInfo().neigh[ face ];
    \n+
    733 }
    \n+
    \n+
    734
    \n+
    735
    \n+
    736 template< int dim >
    \n+
    \n+\n+
    738 {
    \n+
    739 return elInfo().el;
    \n+
    740 }
    \n+
    \n+
    741
    \n
    742
    \n-
    743// Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.
    \n-
    744#ifdef GET_PARAMETER
    \n-
    745#undef GET_PARAMETER
    \n-
    746#endif // #ifdef GET_PARAMETER
    \n-
    747
    \n-
    748#define _ALBERTA_H_
    \n+
    743 template< int dim >
    \n+
    \n+
    744 inline ALBERTA EL_INFO &ElementInfo< dim >::elInfo () const
    \n+
    745 {
    \n+
    746 return (instance_->elInfo);
    \n+
    747 }
    \n+
    \n+
    748
    \n
    749
    \n-
    750#endif // HAVE_ALBERTA || DOXYGEN
    \n-
    751
    \n-
    752#endif
    \n-
    interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
    \n-
    Provides size cache classes to implement the grids size method efficiently.
    \n-\n-\n-\n-\n-
    Contains #undefs for all preprocessor macros defined by alberta.
    \n-\n-\n-\n-\n+
    750 template< int dim >
    \n+
    751 inline ElementInfo< dim >
    \n+
    \n+\n+
    753 const Element *element, int level, int type )
    \n+
    754 {
    \n+
    755 InstancePtr instance = stack().allocate();
    \n+
    756 instance->parent() = null();
    \n+
    757 ++(instance->parent()->refCount);
    \n+
    758
    \n+
    759 instance->elInfo.mesh = mesh;
    \n+
    760 instance->elInfo.macro_el = NULL;
    \n+
    761 instance->elInfo.el = const_cast< Element * >( element );
    \n+
    762 instance->elInfo.parent = NULL;
    \n+
    763 instance->elInfo.fill_flag = FillFlags::nothing;
    \n+
    764 instance->elInfo.level = level;
    \n+
    765 instance->elInfo.el_type = type;
    \n+
    766
    \n+
    767 return ElementInfo< dim >( instance );
    \n+
    768 }
    \n+
    \n+
    769
    \n+
    770
    \n+
    771 template< int dim >
    \n+
    772 inline ElementInfo< dim >
    \n+
    \n+
    773 ElementInfo< dim >::createFake ( const ALBERTA EL_INFO &elInfo )
    \n+
    774 {
    \n+
    775 InstancePtr instance = stack().allocate();
    \n+
    776 instance->parent() = null();
    \n+
    777 ++(instance->parent()->refCount);
    \n+
    778
    \n+
    779 instance->elInfo = elInfo;
    \n+
    780 return ElementInfo< dim >( instance );
    \n+
    781 }
    \n+
    \n+
    782
    \n+
    783
    \n+
    784 template< int dim >
    \n+
    785 inline bool ElementInfo< dim >::isLeaf ( Element *element )
    \n+
    786 {
    \n+
    787 return IS_LEAF_EL( element );
    \n+
    788 }
    \n+
    789
    \n+
    790
    \n+
    791 template< int dim >
    \n+
    792 inline bool ElementInfo< dim >::mightVanish ( Alberta::Element *element, int depth )
    \n+
    793 {
    \n+
    794 if( isLeaf( element ) )
    \n+
    795 return (element->mark < depth);
    \n+
    796 else
    \n+
    797 return (mightVanish( element->child[ 0 ], depth-1 ) && mightVanish( element->child[ 1 ], depth-1 ));
    \n+
    798 }
    \n+
    799
    \n+
    800
    \n+
    801 template< int dim >
    \n+
    802 inline void ElementInfo< dim >
    \n+
    803 ::fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO &elInfo )
    \n+
    804 {
    \n+
    805 ALBERTA fill_macro_info( mesh, mel, &elInfo );
    \n+
    806 }
    \n+
    807
    \n+
    808 template< int dim >
    \n+
    809 inline void ElementInfo< dim >
    \n+
    810 ::fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA EL_INFO &elInfo )
    \n+
    811 {
    \n+
    812 ALBERTA fill_elinfo( ichild, FILL_ANY, &parentInfo, &elInfo );
    \n+
    813 }
    \n+
    814
    \n+
    815
    \n+
    816 template< int dim >
    \n+
    817 inline void ElementInfo< dim >::addReference () const
    \n+
    818 {
    \n+
    819 ++(instance_->refCount);
    \n+
    820 }
    \n+
    821
    \n+
    822
    \n+
    823 template< int dim >
    \n+
    824 inline void ElementInfo< dim >::removeReference () const
    \n+
    825 {
    \n+
    826 // short-circuit for rvalues that have been drained as argument to a move operation
    \n+
    827 if ( !instance_ )
    \n+
    828 return;
    \n+
    829 // this loop breaks when instance becomes null()
    \n+
    830 for( InstancePtr instance = instance_; --(instance->refCount) == 0; )
    \n+
    831 {
    \n+
    832 const InstancePtr parent = instance->parent();
    \n+
    833 stack().release( instance );
    \n+
    834 instance = parent;
    \n+
    835 }
    \n+
    836 }
    \n+
    837
    \n+
    838
    \n+
    839 template< int dim >
    \n+
    840 inline typename ElementInfo< dim >::InstancePtr
    \n+
    841 ElementInfo< dim >::null ()
    \n+
    842 {
    \n+
    843 return stack().null();
    \n+
    844 }
    \n+
    845
    \n+
    846
    \n+
    847 template< int dim >
    \n+
    848 inline typename ElementInfo< dim >::Stack &
    \n+
    849 ElementInfo< dim >::stack ()
    \n+
    850 {
    \n+
    851 static Stack s;
    \n+
    852 return s;
    \n+
    853 }
    \n+
    854
    \n+
    855
    \n+
    856
    \n+
    857 // Implementation of ElementInfo::Stack
    \n+
    858 // ------------------------------------
    \n+
    859
    \n+
    860 template< int dim >
    \n+
    \n+\n+
    862 : top_( 0 )
    \n+
    863 {
    \n+
    864 null_.elInfo.el = NULL;
    \n+
    865 null_.refCount = 1;
    \n+
    866 null_.parent() = 0;
    \n+
    867 }
    \n+
    \n+
    868
    \n+
    869
    \n+
    870 template< int dim >
    \n+
    \n+\n+
    872 {
    \n+
    873 while( top_ != 0 )
    \n+
    874 {
    \n+
    875 InstancePtr p = top_;
    \n+
    876 top_ = p->parent();
    \n+
    877 delete p;
    \n+
    878 }
    \n+
    879 }
    \n+
    \n+
    880
    \n+
    881
    \n+
    882 template< int dim >
    \n+
    883 inline typename ElementInfo< dim >::InstancePtr
    \n+
    \n+\n+
    885 {
    \n+
    886 InstancePtr p = top_;
    \n+
    887 if( p != 0 )
    \n+
    888 top_ = p->parent();
    \n+
    889 else
    \n+
    890 p = new Instance;
    \n+
    891 p->refCount = 0;
    \n+
    892 return p;
    \n+
    893 }
    \n+
    \n+
    894
    \n+
    895
    \n+
    896 template< int dim >
    \n+
    \n+\n+
    898 {
    \n+
    899 assert( (p != null()) && (p->refCount == 0) );
    \n+
    900 p->parent() = top_;
    \n+
    901 top_ = p;
    \n+
    902 }
    \n+
    \n+
    903
    \n+
    904
    \n+
    905 template< int dim >
    \n+
    906 inline typename ElementInfo< dim >::InstancePtr
    \n+
    \n+\n+
    908 {
    \n+
    909 return &null_;
    \n+
    910 }
    \n+
    \n+
    \n+
    911
    \n+
    912 } // namespace Alberta
    \n+
    913
    \n+
    914} // namespace Dune
    \n+
    915
    \n+
    916#endif // #if HAVE_ALBERTA
    \n+
    917
    \n+
    918#endif // #ifndef DUNE_ALBERTA_ELEMENTINFO_HH
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \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 ALBERTA
    Definition albertaheader.hh:29
    \n-\n+
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    ALBERTA MESH Mesh
    Definition misc.hh:53
    \n+
    ALBERTA AFF_TRAFO AffineTransformation
    Definition misc.hh:52
    \n+
    ALBERTA EL Element
    Definition misc.hh:54
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n-
    bool readGrid(const std::string &filename, ctype &time)
    read Grid from file filename and store time of mesh in time
    Definition albertagrid.cc:585
    \n-
    const DofNumbering & dofNumbering() const
    Definition agrid.hh:467
    \n-
    int generic2alberta(int codim, int i) const
    Definition agrid.hh:487
    \n-
    static std::string typeName()
    Definition agrid.hh:410
    \n-
    Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
    return LeafIterator which points to first leaf entity
    \n-
    const HierarchicIndexSet & hierarchicIndexSet() const
    Definition agrid.hh:436
    \n-
    Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
    one past the end on this level
    \n-
    static const int dimension
    Definition agrid.hh:145
    \n-
    int dune2alberta(int codim, int i) const
    Definition agrid.hh:477
    \n-
    Traits::Communication Communication
    type of communication
    Definition agrid.hh:165
    \n-
    int maxLevel() const
    Definition albertagrid.cc:483
    \n-
    AlbertaGrid()
    create an empty grid
    Definition albertagrid.cc:42
    \n-
    Traits::template Codim< codim >::LevelIterator lbegin(int level) const
    Iterator to first entity of given codim on level.
    \n-
    const LevelProvider & levelProvider() const
    Definition agrid.hh:472
    \n-
    static int getTwistInOutside(const typename Traits::LeafIntersection &intersection)
    Definition agrid.hh:540
    \n-
    const Alberta::GlobalVector & getCoord(const ElementInfo &elementInfo, int vertex) const
    Definition albertagrid.cc:471
    \n-
    Traits::template Codim< codim >::LevelIterator lend(int level) const
    one past the end on this level
    \n-
    Traits::LeafGridView leafGridView() const
    View for the leaf grid for All_Partition.
    Definition agrid.hh:364
    \n-
    bool adapt()
    Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
    Definition albertagrid.cc:415
    \n-
    static const int dimensionworld
    Definition agrid.hh:146
    \n-
    static int getTwistInInside(const typename Traits::LeafIntersection &intersection)
    Definition agrid.hh:534
    \n-
    void postAdapt()
    clean up some markers
    Definition albertagrid.cc:356
    \n-
    Traits::template Codim< codim >::LeafIterator leafbegin() const
    return LeafIterator which points to first leaf entity
    \n-
    const LocalIdSet & localIdSet() const
    return local IdSet
    Definition agrid.hh:451
    \n-
    std::size_t numBoundarySegments() const
    number of boundary segments within the macro grid
    Definition agrid.hh:350
    \n-
    GridFamily::ctype ctype
    Definition agrid.hh:143
    \n-
    AlbertaGrid(const This &)=delete
    \n-
    Traits::template Codim< codim >::LeafIterator leafend() const
    return LeafIterator which points behind last leaf entity
    \n-
    const Traits::LevelIndexSet & levelIndexSet(int level) const
    return level index set for given level
    Definition albertagrid.cc:520
    \n-
    int alberta2generic(int codim, int i) const
    Definition agrid.hh:492
    \n-
    static int getTwist(const typename Traits::template Codim< codim >::Entity &entity)
    Definition agrid.hh:521
    \n-
    const Communication & comm() const
    return reference to communication, if MPI found this is specialisation for MPI
    Definition agrid.hh:405
    \n-
    ALBERTA MESH * getMesh() const
    Definition agrid.hh:457
    \n-
    int size(int level, int codim) const
    Number of grid entities per level and codim because lbegin and lend are none const,...
    Definition albertagrid.cc:490
    \n-
    Traits::HierarchicIndexSet HierarchicIndexSet
    type of hierarchic index set
    Definition agrid.hh:157
    \n-
    const Traits::LeafIndexSet & leafIndexSet() const
    return leaf index set
    Definition albertagrid.cc:535
    \n-
    Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
    return LeafIterator which points behind last leaf entity
    \n-
    bool writeGrid(const std::string &filename, ctype time) const
    write Grid to file in Xdr
    Definition albertagrid.cc:575
    \n-
    Traits::LevelGridView levelGridView(int level) const
    View for a grid level for All_Partition.
    Definition agrid.hh:356
    \n-
    int alberta2dune(int codim, int i) const
    Definition agrid.hh:482
    \n-
    This & operator=(const This &)=delete
    \n-
    AlbertaGridFamily< dim, dimworld >::Traits Traits
    Definition agrid.hh:149
    \n-
    static int getTwist(const typename Traits::template Codim< 0 >::Entity &entity, int subEntity)
    Definition agrid.hh:528
    \n-
    Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
    Iterator to first entity of given codim on level.
    \n-
    const GlobalIdSet & globalIdSet() const
    return global IdSet
    Definition agrid.hh:445
    \n-
    void globalRefine(int refCount)
    uses the interface, mark on entity and refineLocal
    Definition albertagrid.cc:304
    \n-
    int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
    returns adaptation mark for given entity
    Definition albertagrid.cc:408
    \n-
    Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
    obtain Entity from EntitySeed.
    Definition agrid.hh:420
    \n-
    ~AlbertaGrid()
    destructor
    Definition albertagrid.cc:196
    \n-
    bool preAdapt()
    returns true, if a least one element is marked for coarsening
    Definition albertagrid.cc:348
    \n-
    bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
    Marks an entity to be refined/coarsened in a subsequent adapt.
    Definition albertagrid.cc:385
    \n-
    const MeshPointer & meshPointer() const
    Definition agrid.hh:462
    \n-
    Definition coordcache.hh:25
    \n-
    Definition albertagrid/datahandle.hh:27
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Implementation & impl()
    access to the underlying implementation
    Definition common/intersection.hh:178
    \n \n-\n-\n-
    Definition treeiterator.hh:189
    \n-
    Definition hierarchiciterator.hh:29
    \n-
    Definition albertagrid/intersection.hh:105
    \n-
    Definition albertagrid/intersectioniterator.hh:27
    \n-
    Definition albertagrid/entity.hh:46
    \n-
    Definition albertagrid/indexsets.hh:42
    \n-
    hierarchic index set of AlbertaGrid
    Definition albertagrid/indexsets.hh:518
    \n-
    Definition albertagrid/indexsets.hh:329
    \n-
    Definition albertagrid/gridfamily.hh:83
    \n-
    static const int dimension
    Definition albertagrid/gridfamily.hh:88
    \n-
    static const int dimensionworld
    Definition albertagrid/gridfamily.hh:89
    \n-
    AlbertaGridIndexSet< dim, dimworld > LeafIndexSetImp
    Definition albertagrid/gridfamily.hh:92
    \n-
    Alberta::Real ctype
    Definition albertagrid/gridfamily.hh:86
    \n-
    Definition albertagrid/gridfamily.hh:98
    \n-
    Dune::Communication< No_Comm > Communication
    Definition albertagrid/gridfamily.hh:148
    \n-
    Definition albertagrid/gridfamily.hh:117
    \n-
    Definition albertagrid/gridview.hh:76
    \n-
    Definition albertagrid/gridview.hh:287
    \n-
    Definition albertagrid/intersection.hh:32
    \n-\n-\n-\n-
    int alberta2dune(int codim, int i) const
    Definition misc.hh:397
    \n-
    int dune2alberta(int codim, int i) const
    Definition misc.hh:390
    \n-
    Definition albertagrid/projection.hh:80
    \n-
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n-
    Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
    Definition adaptcallback.hh:33
    \n-
    Store a reference to an entity with a minimal memory footprint.
    Definition common/entityseed.hh:26
    \n-
    Implementation & impl()
    access to the underlying implementation
    Definition common/entityseed.hh:59
    \n-
    Definition common/grid.hh:848
    \n-
    bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
    Marks an entity to be refined/coarsened in a subsequent adapt.
    Definition common/grid.hh:929
    \n-
    int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
    returns adaptation mark for given entity, i.e. here the default implementation returns 0.
    Definition common/grid.hh:941
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-
    Definition common/grid.hh:1121
    \n-
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    organizes the caching of sizes for one grid and one GeometryType
    Definition sizecache.hh:33
    \n-\n-\n-\n-\n-\n-\n-
    Provide a generic factory class for unstructured grids.
    \n-
    provides the GridFamily for AlbertaGrid
    \n-\n-\n-
    Implementation of the IntersectionIterator for AlbertaGrid.
    \n-
    Different resources needed by all grid implementations.
    \n+
    Definition elementinfo.hh:43
    \n+
    ElementInfo leafNeighbor(const int face) const
    Definition elementinfo.hh:585
    \n+
    bool isLeaf() const
    Definition elementinfo.hh:488
    \n+
    static ElementInfo createFake(const MeshPointer &mesh, const Element *element, int level, int type=0)
    Definition elementinfo.hh:752
    \n+
    ElementInfo child(int i) const
    Definition elementinfo.hh:470
    \n+
    int level() const
    Definition elementinfo.hh:533
    \n+
    bool mightVanish() const
    Definition elementinfo.hh:526
    \n+
    static const int numFaces
    Definition elementinfo.hh:56
    \n+
    int twist(int subEntity) const
    Definition elementinfo.hh:605
    \n+
    int twistInNeighbor(int face) const
    Definition elementinfo.hh:612
    \n+
    Alberta::MacroElement< dimension > MacroElement
    Definition elementinfo.hh:58
    \n+
    BasicNodeProjection * boundaryProjection(int face) const
    Definition elementinfo.hh:664
    \n+
    const MacroElement & macroElement() const
    Definition elementinfo.hh:440
    \n+
    static const int maxLevelNeighbors
    Definition elementinfo.hh:64
    \n+
    ElementInfo father() const
    Definition elementinfo.hh:449
    \n+
    ElementInfo(const ElementInfo &other)
    Definition elementinfo.hh:382
    \n+
    GeometryCacheProxy< dim > GeometryCache
    Definition elementinfo.hh:67
    \n+
    ElementInfo & operator=(const ElementInfo &other)
    Definition elementinfo.hh:405
    \n+
    bool hasLeafNeighbor(const int face) const
    Definition elementinfo.hh:570
    \n+
    bool operator==(const ElementInfo &other) const
    Definition elementinfo.hh:424
    \n+
    static const int dimension
    Definition elementinfo.hh:53
    \n+
    void hierarchicTraverse(Functor &functor) const
    Definition elementinfo.hh:695
    \n+
    int type() const
    Definition elementinfo.hh:540
    \n+
    static const int maxNeighbors
    Definition elementinfo.hh:62
    \n+
    void setMark(int refCount) const
    Definition elementinfo.hh:561
    \n+
    ~ElementInfo()
    Definition elementinfo.hh:397
    \n+
    const GlobalVector & coordinate(int vertex) const
    Definition elementinfo.hh:685
    \n+
    static const int numVertices
    Definition elementinfo.hh:55
    \n+
    int getMark() const
    Definition elementinfo.hh:554
    \n+
    void leafTraverse(Functor &functor) const
    Definition elementinfo.hh:708
    \n+
    Alberta::MeshPointer< dimension > MeshPointer
    Definition elementinfo.hh:59
    \n+
    const Element * neighbor(int face) const
    Definition elementinfo.hh:728
    \n+
    static ElementInfo createFake(const ALBERTA EL_INFO &elInfo)
    Definition elementinfo.hh:773
    \n+
    ElementInfo()
    Definition elementinfo.hh:310
    \n+
    int boundaryId(int face) const
    Definition elementinfo.hh:635
    \n+
    bool operator!=(const ElementInfo &other) const
    Definition elementinfo.hh:432
    \n+
    Alberta::FillFlags< dimension > FillFlags
    Definition elementinfo.hh:60
    \n+
    ElementInfo(const MeshPointer &mesh, const MacroElement &macroElement, typename FillFlags::Flags fillFlags=FillFlags::standard)
    Definition elementinfo.hh:319
    \n+
    AffineTransformation * transformation(int face) const
    Definition elementinfo.hh:651
    \n+
    bool isBoundary(int face) const
    Definition elementinfo.hh:620
    \n+
    int indexInFather() const
    Definition elementinfo.hh:457
    \n+
    Seed seed() const
    Definition elementinfo.hh:496
    \n+
    Element * el() const
    Definition elementinfo.hh:737
    \n+
    const Element * element() const
    Definition elementinfo.hh:721
    \n+
    ALBERTA EL_INFO & elInfo() const
    Definition elementinfo.hh:744
    \n+
    MeshPointer mesh() const
    Definition elementinfo.hh:519
    \n+
    GeometryCache geometryCache() const
    Definition elementinfo.hh:140
    \n+
    bool hasCoordinates() const
    Definition elementinfo.hh:679
    \n+
    int levelNeighbors(const int face, ElementInfo(&neighbor)[maxLevelNeighbors], int(&faceInNeighbor)[maxLevelNeighbors]) const
    Definition elementinfo.hh:596
    \n+
    ElementInfo(ElementInfo &&other)
    Definition elementinfo.hh:389
    \n+
    ElementInfo(const MeshPointer &mesh, const Seed &seed, typename FillFlags::Flags fillFlags=FillFlags::standard)
    Definition elementinfo.hh:340
    \n+
    Definition elementinfo.hh:185
    \n+
    InstancePtr & parent()
    Definition elementinfo.hh:189
    \n+
    Alberta::GeometryCache< dim > geometryCache
    Definition elementinfo.hh:199
    \n+
    ALBERTA EL_INFO elInfo
    Definition elementinfo.hh:186
    \n+
    unsigned int refCount
    Definition elementinfo.hh:187
    \n+
    Definition elementinfo.hh:210
    \n+
    InstancePtr null()
    Definition elementinfo.hh:907
    \n+
    ~Stack()
    Definition elementinfo.hh:871
    \n+
    void release(InstancePtr &p)
    Definition elementinfo.hh:897
    \n+
    Stack()
    Definition elementinfo.hh:861
    \n+
    InstancePtr allocate()
    Definition elementinfo.hh:884
    \n+
    Definition elementinfo.hh:255
    \n+
    Seed(const int macroIndex, const int level, const unsigned long path)
    Definition elementinfo.hh:260
    \n+
    Seed()
    Definition elementinfo.hh:256
    \n+
    int level() const
    Definition elementinfo.hh:287
    \n+
    bool isValid() const
    Definition elementinfo.hh:284
    \n+
    unsigned long path() const
    Definition elementinfo.hh:288
    \n+
    int macroIndex() const
    Definition elementinfo.hh:286
    \n+
    Definition geometrycache.hh:24
    \n+
    Definition geometrycache.hh:91
    \n+
    Definition macroelement.hh:24
    \n+
    Definition misc.hh:148
    \n+
    Definition misc.hh:231
    \n+
    static const Flags nothing
    Definition misc.hh:234
    \n+
    static const Flags boundaryId
    Definition misc.hh:246
    \n+
    ALBERTA FLAGS Flags
    Definition misc.hh:232
    \n+
    static const Flags coords
    Definition misc.hh:236
    \n+
    static const Flags standard
    Definition misc.hh:258
    \n+
    static const Flags neighbor
    Definition misc.hh:238
    \n+
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:538
    \n+
    Definition albertagrid/projection.hh:208
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,1036 +1,1211 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-agrid.hh\n+elementinfo.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTAGRID_IMP_HH\n-6#define DUNE_ALBERTAGRID_IMP_HH\n+5#ifndef DUNE_ALBERTA_ELEMENTINFO_HH\n+6#define DUNE_ALBERTA_ELEMENTINFO_HH\n 7\n-13#if HAVE_ALBERTA || DOXYGEN\n-14\n-15#include \n-16#include \n-17\n-18#include \n-19#include \n-20#include \n-21#include \n-22#include \n-23\n-24// Dune includes\n-25#include \n-26#include \n-27#include \n-28#include \n-29\n-30#include \n-31#include \n-32#include \n-33#include \n-34\n-35//- Local includes\n-36// some cpp defines and include of alberta.h\n-37#include \"albertaheader.hh\"\n-38\n-39#include \n-40#include \n-41#include \n-42\n-43#include \n-44#include \n-45#include \n-46#include \n-47#include \n-48#include \n-49#include \n-50\n-51#include \"indexsets.hh\"\n-52#include \"geometry.hh\"\n-53#include \"entity.hh\"\n-54#include \"hierarchiciterator.hh\"\n-55#include \"treeiterator.hh\"\n-56#include \"leveliterator.hh\"\n-57#include \"leafiterator.hh\"\n-58\n-59namespace Dune\n-60{\n+13#include \n+14#include \n+15#include \n+16\n+17#include \n+18#include \n+19\n+20#if HAVE_ALBERTA\n+21\n+22namespace Dune\n+23{\n+24\n+25 namespace Alberta\n+26 {\n+27\n+28 // External Forward Declarations\n+29 // -----------------------------\n+30\n+31 template< int dim >\n+32 class MeshPointer;\n+33\n+34 struct BasicNodeProjection;\n+35\n+36\n+37\n+38 // ElementInfo\n+39 // -----------\n+40\n+41 template< int dim >\n+42 class ElementInfo\n+43 {\n+44 struct Instance;\n+45 class Stack;\n+46\n+47 template< int >\n+48 struct Library;\n+49\n+50 typedef Instance *InstancePtr;\n+51\n+52 public:\n+53 static const int dimension = dim;\n+54\n+55 static const int numVertices = NumSubEntities<_dimension,_dimension_>::\n+value;\n+56 static const int numFaces = NumSubEntities<_dimension,_1_>::value;\n+57\n+58 typedef Alberta::MacroElement<_dimension_> MacroElement;\n+59 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n+60 typedef Alberta::FillFlags<_dimension_> FillFlags;\n 61\n-62 // External Forward Declarations\n-63 // -----------------------------\n-64\n-65 template< class Grid >\n-66 struct DGFGridFactory;\n-67\n-68\n+62 static const int maxNeighbors = N_NEIGH_MAX;\n+63\n+64 static const int maxLevelNeighbors = Library< dimWorld >::maxLevelNeighbors;\n+65\n+66#if !DUNE_ALBERTA_CACHE_COORDINATES\n+67 typedef GeometryCacheProxy<_dim_> GeometryCache;\n+68#endif\n 69\n-70 // AlbertaGrid\n-71 // -----------\n-72\n-105 template< int dim, int dimworld = Alberta::dimWorld >\n-106 class AlbertaGrid\n-107 : public GridDefaultImplementation\n-108 < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >\n-109 {\n-110 typedef AlbertaGrid<_dim,_dimworld_> This;\n-111 typedef GridDefaultImplementation\n-112 < dim, dimworld, Alberta::Real, AlbertaGridFamily<_dim,_dimworld_> >\n-113 Base;\n-114\n-115 template< int, int, class > friend class AlbertaGridEntity;\n-116 template< class > friend class AlbertaLevelGridView;\n-117 template< class > friend class AlbertaLeafGridView;\n-118 template< int, class, bool > friend class AlbertaGridTreeIterator;\n-119 template< class > friend class AlbertaGridHierarchicIterator;\n-120\n-121 friend class GridFactory< This >;\n-122 friend struct DGFGridFactory< This >;\n-123\n-124 friend class AlbertaGridIntersectionBase< const This >;\n-125 friend class AlbertaGridLeafIntersection< const This >;\n-126\n-127 friend class AlbertaMarkerVector< dim, dimworld >;\n-128#if (__GNUC__ < 4) && !(defined __ICC)\n-129 // add additional friend decls for gcc 3.4\n-130 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities;\n-131 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities;\n-132#endif\n-133 friend class AlbertaGridIndexSet< dim, dimworld >;\n-134 friend class AlbertaGridHierarchicIndexSet< dim, dimworld >;\n-135\n-136 template< class, class >\n-137 friend class Alberta::AdaptRestrictProlongHandler;\n-138\n-139 public:\n-141 typedef AlbertaGridFamily< dim, dimworld > GridFamily;\n-142\n-143 typedef typename GridFamily::ctype ctype;\n-144\n-145 static const int dimension = GridFamily::dimension;\n-146 static const int dimensionworld = GridFamily::dimensionworld;\n-147\n-148 // the Traits\n-149 typedef typename AlbertaGridFamily< dim, dimworld >::Traits Traits;\n-150\n-152 typedef typename Traits::LeafIndexSet LeafIndexSet;\n-154 typedef typename Traits::LevelIndexSet LevelIndexSet;\n-155\n-157 typedef typename Traits::HierarchicIndexSet HierarchicIndexSet;\n-158\n-160 typedef typename Traits::GlobalIdSet GlobalIdSet;\n-162 typedef typename Traits::LocalIdSet LocalIdSet;\n-163\n-165 typedef typename Traits::Communication Communication;\n-166\n-167 private:\n-169 typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;\n-170\n-172 typedef AlbertaGridIdSet IdSetImp;\n-173\n-175 struct AdaptationState\n-176 {\n-177 enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };\n+70 struct Seed;\n+71\n+72 private:\n+73 explicit ElementInfo ( const InstancePtr &instance );\n+74\n+75 public:\n+76 ElementInfo ();\n+77 ElementInfo ( const MeshPointer &mesh, const MacroElement ¯oElement,\n+78 typename FillFlags::Flags fillFlags = FillFlags::standard );\n+79 ElementInfo ( const MeshPointer &mesh, const Seed &seed,\n+80 typename FillFlags::Flags fillFlags = FillFlags::standard );\n+81 ElementInfo ( const ElementInfo &other );\n+82 ElementInfo ( ElementInfo&& other );\n+83\n+84 ~ElementInfo ();\n+85\n+86 ElementInfo &operator=_( const ElementInfo &other );\n+87 ElementInfo &operator=_( ElementInfo &&other );\n+88\n+89 explicit operator bool () const { return (instance_ != null()); }\n+90\n+91 bool operator==_( const ElementInfo &other ) const;\n+92 bool operator!=_( const ElementInfo &other ) const;\n+93\n+94 const MacroElement ¯oElement () const;\n+95 ElementInfo father () const;\n+96 int indexInFather () const;\n+97 ElementInfo child ( int i ) const;\n+98 bool isLeaf () const;\n+99\n+100 Seed seed () const;\n+101\n+102 MeshPointer mesh () const;\n+103\n+104 bool mightVanish () const;\n+105\n+106 int level () const;\n+107 // see ALBERTA documentation for definition of element type\n+108 // values are 0, 1, 2\n+109 int type () const;\n+110\n+111 int getMark () const;\n+112 void setMark ( int refCount ) const;\n+113\n+114 bool hasLeafNeighbor ( const int face ) const;\n+115 ElementInfo leafNeighbor ( const int face ) const;\n+116\n+117 /* obtain all level neighbors of a face\n+118 *\n+119 * param[in] face face for which the neighbors are desired\n+120 * param[out] neighbor array storing the neighbors\n+121 * param[out] faceInNeighbor array storing the faces in neighbor\n+122 * (-1, if this neighbor does not exist)\n+123 *\n+124 * returns (potential) number of neighbors (i.e., the number of valid\n+125 * entries in the output arrays\n+126 */\n+127 int levelNeighbors ( const int face, ElementInfo (&neighbor)\n+[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const;\n+128\n+129 template< int codim >\n+130 int twist ( int subEntity ) const;\n+131 int twistInNeighbor ( int face ) const;\n+132 bool isBoundary ( int face ) const;\n+133 int boundaryId ( int face ) const;\n+134 AffineTransformation *transformation ( int face ) const;\n+135 BasicNodeProjection *boundaryProjection ( int face ) const;\n+136\n+137 bool hasCoordinates () const;\n+138 const GlobalVector &coordinate ( int vertex ) const;\n+139#if !DUNE_ALBERTA_CACHE_COORDINATES\n+140 GeometryCache geometryCache () const\n+141 {\n+142 return GeometryCache( instance_->geometryCache, instance_->elInfo );\n+143 }\n+144#endif\n+145\n+146 template< class Functor >\n+147 void hierarchicTraverse ( Functor &functor ) const;\n+148\n+149 template< class Functor >\n+150 void leafTraverse ( Functor &functor ) const;\n+151\n+152 const Element *element () const;\n+153 const Element *neighbor ( int face ) const;\n+154 Element *el () const;\n+155 ALBERTA EL_INFO &elInfo () const;\n+156\n+157 static ElementInfo\n+158 createFake ( const MeshPointer &mesh,\n+159 const Element *element, int level, int type = 0 );\n+160 static ElementInfo createFake ( const ALBERTA EL_INFO &elInfo );\n+161\n+162 private:\n+163 static bool isLeaf ( Element *element );\n+164 static bool mightVanish ( Element *element, int depth );\n+165\n+166 static void fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO\n+&elInfo );\n+167 static void fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA\n+EL_INFO &elInfo );\n+168\n+169 void addReference () const;\n+170 void removeReference () const;\n+171\n+172 static InstancePtr null ();\n+173 static Stack &stack ();\n+174\n+175 InstancePtr instance_;\n+176 };\n+177\n 178\n-179 private:\n-180 Phase phase_;\n-181 int coarsenMarked_;\n-182 int refineMarked_;\n-183\n-184 public:\n-185 AdaptationState ()\n-186 : phase_( ComputationPhase ),\n-187 coarsenMarked_( 0 ),\n-188 refineMarked_( 0 )\n-189 {}\n-190\n-191 void mark ( int count )\n-192 {\n-193 if( count < 0 )\n-194 ++coarsenMarked_;\n-195 if( count > 0 )\n-196 refineMarked_ += (2 << count);\n-197 }\n-198\n-199 void unmark ( int count )\n-200 {\n-201 if( count < 0 )\n-202 --coarsenMarked_;\n-203 if( count > 0 )\n-204 refineMarked_ -= (2 << count);\n-205 }\n-206\n-207 bool coarsen () const\n-208 {\n-209 return (coarsenMarked_ > 0);\n-210 }\n-211\n-212 int refineMarked () const\n-213 {\n-214 return refineMarked_;\n-215 }\n-216\n-217 void preAdapt ()\n-218 {\n-219 if( phase_ != ComputationPhase )\n-220 error( \"preAdapt may only be called in computation phase.\" );\n-221 phase_ = PreAdaptationPhase;\n-222 }\n+179\n+180 // ElementInfo::Instance\n+181 // ---------------------\n+182\n+183 template< int dim >\n+184 struct ElementInfo< dim >::Instance\n+185 {\n+186 ALBERTA EL_INFO elInfo;\n+187 unsigned int refCount;\n+188\n+189 InstancePtr &parent ()\n+190 {\n+191 return parent_;\n+192 }\n+193\n+194 private:\n+195 InstancePtr parent_;\n+196\n+197#if !DUNE_ALBERTA_CACHE_COORDINATES\n+198 public:\n+199 Alberta::GeometryCache<_dim_> geometryCache;\n+200#endif\n+201 };\n+202\n+203\n+204\n+205 // ElementInfo::Stack\n+206 // ------------------\n+207\n+208 template< int dim >\n+209 class ElementInfo< dim >::Stack\n+210 {\n+211 InstancePtr top_;\n+212 Instance null_;\n+213\n+214 public:\n+215 Stack ();\n+216 ~Stack ();\n+217\n+218 InstancePtr allocate ();\n+219 void release ( InstancePtr &p );\n+220 InstancePtr null ();\n+221 };\n+222\n 223\n-224 void adapt ()\n-225 {\n-226 if( phase_ != PreAdaptationPhase )\n-227 error( \"adapt may only be called in preadapdation phase.\" );\n-228 phase_ = PostAdaptationPhase;\n-229 }\n-230\n-231 void postAdapt ()\n-232 {\n-233 if( phase_ != PostAdaptationPhase )\n-234 error( \"postAdapt may only be called in postadaptation phase.\" );\n-235 phase_ = ComputationPhase;\n-236\n-237 coarsenMarked_ = 0;\n-238 refineMarked_ = 0;\n-239 }\n-240\n-241 private:\n-242 void error ( const std::string &message )\n-243 {\n-244 DUNE_THROW( InvalidStateException, message );\n-245 }\n+224\n+225 // ElementInfo::Library\n+226 // --------------------\n+227\n+228 template< int dim >\n+229 template< int >\n+230 struct ElementInfo< dim >::Library\n+231 {\n+232 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n+233\n+234 static const int maxLevelNeighbors = (1 << (dim-1));\n+235\n+236 static int\n+237 leafNeighbor ( const ElementInfo &element, const int face, ElementInfo\n+&neighbor );\n+238\n+239 static int\n+240 levelNeighbors ( const ElementInfo &element, const int face,\n+241 ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)\n+[ maxLevelNeighbors ] );\n+242\n+243 private:\n+244 static int\n+245 macroNeighbor ( const ElementInfo &element, const int face, ElementInfo\n+&neighbor );\n 246 };\n 247\n-248 template< class DataHandler >\n-249 struct AdaptationCallback;\n-250\n-251 // max number of allowed levels is 64\n-252 static const int MAXL = 64;\n-253\n-254 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-255 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n-256 typedef Alberta::HierarchyDofNumbering<_dimension_> DofNumbering;\n-257 typedef AlbertaGridLevelProvider<_dimension_> LevelProvider;\n-258\n-259 public:\n-260 AlbertaGrid ( const This & ) = delete;\n-261 This &operator=_( const This & ) = delete;\n-262\n-264 AlbertaGrid ();\n-265\n-271 AlbertaGrid ( const Alberta::MacroData<_dimension_> ¯oData,\n-272 const std::shared_ptr< DuneBoundaryProjection<_dimensionworld_> >\n-&projection\n-273 = std::shared_ptr< DuneBoundaryProjection<_dimensionworld_> >() );\n-274\n-275 template< class Proj, class Impl >\n-276 AlbertaGrid ( const Alberta::MacroData<_dimension_> ¯oData,\n-277 const Alberta::ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory\n-);\n+248\n+249\n+250 // ElementInfo::Seed\n+251 // -----------------\n+252\n+253 template< int dim >\n+254 struct ElementInfo< dim >::Seed\n+255 {\n+256 Seed ()\n+257 : macroIndex_( -1 ), level_( 0 ), path_( 0 )\n+258 {}\n+259\n+260 Seed ( const int macroIndex, const int level, const unsigned long path )\n+261 : macroIndex_( macroIndex ), level_( level ), path_( path )\n+262 {}\n+263\n+264 bool operator==_( const Seed &other ) const\n+265 {\n+266 return (macroIndex() == other.macroIndex()) && (level() == other.level())\n+&& (path() == other.path());\n+267 }\n+268\n+269 bool operator< ( const Seed &other ) const\n+270 {\n+271 const bool ml = (macroIndex() < other.macroIndex());\n+272 const bool me = (macroIndex() == other.macroIndex());\n+273 const bool ll = (level() < other.level());\n+274 const bool le = (level() == other.level());\n+275 const bool pl = (path() < other.path());\n+276 return ml | (me & (ll | (le & pl)));\n+277 }\n 278\n-283 AlbertaGrid ( const std::string ¯oGridFileName );\n-284\n-286 ~AlbertaGrid ();\n-287\n-290 int maxLevel () const;\n-291\n-293 template\n-294 typename Traits::template Codim::template Partition::\n-LevelIterator\n-295 lbegin (int level) const;\n+279 bool operator!=_( const Seed &other ) const { return !(*this == other); }\n+280 bool operator<= ( const Seed &other ) const { return !(other < *this); }\n+281 bool operator> ( const Seed &other ) const { return (other < *this); }\n+282 bool operator>= ( const Seed &other ) const { return !(*this < other); }\n+283\n+284 bool isValid ( ) const { return macroIndex_ != -1; }\n+285\n+286 int macroIndex () const { return macroIndex_; }\n+287 int level () const { return level_; }\n+288 unsigned long path () const { return path_; }\n+289\n+290 private:\n+291 int macroIndex_;\n+292 int level_;\n+293 unsigned long path_;\n+294 };\n+295\n 296\n-298 template\n-299 typename Traits::template Codim::template Partition::\n-LevelIterator\n-300 lend (int level) const;\n-301\n-303 template< int codim >\n-304 typename Traits::template Codim<_codim_>::LevelIterator\n-305 lbegin ( int level ) const;\n-306\n-308 template< int codim >\n-309 typename Traits::template Codim<_codim_>::LevelIterator\n-310 lend ( int level ) const;\n-311\n-313 template< int codim, PartitionIteratorType pitype >\n-314 typename Traits\n-315 ::template Codim<_codim_>::template Partition< pitype >::LeafIterator\n-316 leafbegin () const;\n-317\n-319 template< int codim, PartitionIteratorType pitype >\n-320 typename Traits\n-321 ::template Codim<_codim_>::template Partition< pitype >::LeafIterator\n-322 leafend () const;\n-323\n-325 template< int codim >\n-326 typename Traits::template Codim<_codim_>::LeafIterator\n-327 leafbegin () const;\n-328\n-330 template< int codim >\n-331 typename Traits::template Codim<_codim_>::LeafIterator\n-332 leafend () const;\n+297\n+298 // Implementation of ElementInfo\n+299 // -----------------------------\n+300\n+301 template< int dim >\n+302 inline ElementInfo<_dim_>::ElementInfo ( const InstancePtr &instance )\n+303 : instance_( instance )\n+304 {\n+305 addReference();\n+306 }\n+307\n+308\n+309 template< int dim >\n+310 inline ElementInfo<_dim_>::ElementInfo ()\n+311 : instance_( null() )\n+312 {\n+313 addReference();\n+314 }\n+315\n+316\n+317 template< int dim >\n+318 inline ElementInfo<_dim_>\n+319_::ElementInfo ( const MeshPointer &mesh, const MacroElement ¯oElement,\n+320 typename FillFlags::Flags fillFlags )\n+321 {\n+322 instance_ = stack().allocate();\n+323 instance_->parent() = null();\n+324 ++(instance_->parent()->refCount);\n+325\n+326 addReference();\n+327\n+328 elInfo().fill_flag = fillFlags;\n+329\n+330 // Alberta fills opp_vertex only if there is a neighbor\n+331 for( int k = 0; k < maxNeighbors; ++k )\n+332 elInfo().opp_vertex[ k ] = -1;\n 333\n-338 int size (int level, int codim) const;\n-339\n-341 int size (int level, GeometryType type) const;\n-342\n-344 int size (int codim) const;\n-345\n-347 int size (GeometryType type) const;\n+334 fill( mesh, ¯oElement, elInfo() );\n+335 }\n+336\n+337\n+338 template< int dim >\n+339 inline ElementInfo<_dim_>\n+340_::ElementInfo ( const MeshPointer &mesh, const Seed &seed,\n+341 typename FillFlags::Flags fillFlags )\n+342 {\n+343 instance_ = stack().allocate();\n+344 instance_->parent() = null();\n+345 ++(instance_->parent()->refCount);\n+346\n+347 addReference();\n 348\n-350 std::size_t numBoundarySegments () const\n-351 {\n-352 return numBoundarySegments_;\n-353 }\n-354\n-356 typename Traits::LevelGridView levelGridView ( int level ) const\n-357 {\n-358 typedef typename Traits::LevelGridView View;\n-359 typedef typename View::GridViewImp ViewImp;\n-360 return View( ViewImp( *this, level ) );\n-361 }\n-362\n-364 typename Traits::LeafGridView leafGridView () const\n-365 {\n-366 typedef typename Traits::LeafGridView View;\n-367 typedef typename View::GridViewImp ViewImp;\n-368 return View( ViewImp( *this ) );\n-369 }\n+349 // fill in macro element info\n+350 elInfo().fill_flag = fillFlags;\n+351\n+352 // Alberta fills opp_vertex only if there is a neighbor\n+353 for( int k = 0; k < maxNeighbors; ++k )\n+354 elInfo().opp_vertex[ k ] = -1;\n+355\n+356 fill( mesh, ((Mesh *)mesh)->macro_els + seed.macroIndex(), elInfo() );\n+357\n+358 // traverse the seed's path\n+359 unsigned long path = seed.path();\n+360 for( int i = 0; i < seed.level(); ++i )\n+361 {\n+362 InstancePtr child = stack().allocate();\n+363 child->parent() = instance_;\n+364\n+365 // Alberta fills opp_vertex only if there is a neighbor\n+366 for( int k = 0; k < maxNeighbors; ++k )\n+367 child->elInfo.opp_vertex[ k ] = -2;\n+368\n+369 fill( path & 1, elInfo(), child->elInfo );\n 370\n-371 public:\n-372 //***************************************************************\n-373 // Interface for Adaptation\n-374 //***************************************************************\n-375 using Base::getMark;\n-376 using Base::mark;\n-377\n-379 int getMark ( const typename Traits::template Codim< 0 >::Entity &e )\n-const;\n+371 instance_ = child;\n+372 addReference();\n+373\n+374 path = path >> 1;\n+375 }\n+376\n+377 assert( this->seed() == seed );\n+378 }\n+379\n 380\n-382 bool mark ( int refCount, const typename Traits::template Codim< 0 >::\n-Entity &e );\n-383\n-385 void globalRefine ( int refCount );\n-386\n-387 template< class DataHandle >\n-388 void globalRefine ( int refCount, AdaptDataHandleInterface<_This,\n-DataHandle_> &handle );\n-389\n-391 bool adapt ();\n-392\n-394 template< class DataHandle >\n-395 bool adapt ( AdaptDataHandleInterface<_This,_DataHandle_> &handle );\n-396\n-398 bool preAdapt ();\n-399\n-401 void postAdapt();\n+381 template< int dim >\n+382 inline ElementInfo<_dim_>::ElementInfo ( const ElementInfo &other )\n+383 : instance_( other.instance_ )\n+384 {\n+385 addReference();\n+386 }\n+387\n+388 template< int dim >\n+389 inline ElementInfo<_dim_>::ElementInfo ( ElementInfo &&other )\n+390 : instance_( NULL )\n+391 {\n+392 using std::swap;\n+393 swap( instance_, other.instance_ );\n+394 }\n+395\n+396 template< int dim >\n+397 inline ElementInfo<_dim_>::~ElementInfo ()\n+398 {\n+399 removeReference();\n+400 }\n+401\n 402\n-405 const Communication &comm () const\n+403 template< int dim >\n+404 inline ElementInfo<_dim_> &\n+405 ElementInfo<_dim_>::operator=_( const ElementInfo<_dim_> &other )\n 406 {\n-407 return comm_;\n-408 }\n-409\n-410 static std::string typeName ()\n-411 {\n-412 std::ostringstream s;\n-413 s << \"AlbertaGrid< \" << dim << \", \" << dimworld << \" >\";\n-414 return s.str();\n-415 }\n-416\n-418 template< class EntitySeed >\n-419 typename Traits::template Codim< EntitySeed::codimension >::Entity\n-420 entity ( const EntitySeed &seed ) const\n-421 {\n-422 typedef typename Traits::template Codim<_EntitySeed::codimension_>::\n-EntityImpl EntityImpl;\n-423 return EntityImpl( *this, seed.impl().elementInfo( meshPointer() ),\n-seed.impl().subEntity() );\n-424 }\n-425\n-426 //**********************************************************\n-427 // End of Interface Methods\n-428 //**********************************************************\n-430 bool writeGrid( const std::string &filename, ctype time ) const;\n-431\n-433 bool readGrid( const std::string &filename, ctype &time );\n-434\n-435 // return hierarchic index set\n-436 const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_;\n-}\n+407 other.addReference();\n+408 removeReference();\n+409 instance_ = other.instance_;\n+410 return *this;\n+411 }\n+412\n+413 template< int dim >\n+414 inline ElementInfo<_dim_> &\n+415 ElementInfo<_dim_>::operator=_( ElementInfo<_dim_> &&other )\n+416 {\n+417 using std::swap;\n+418 swap( instance_, other.instance_ );\n+419 return *this;\n+420 }\n+421\n+422 template< int dim >\n+423 inline bool\n+424 ElementInfo<_dim_>::operator==_( const ElementInfo<_dim_> &other ) const\n+425 {\n+426 return (instance_->elInfo.el == other.instance_->elInfo.el);\n+427 }\n+428\n+429\n+430 template< int dim >\n+431 inline bool\n+432 ElementInfo<_dim_>::operator!=_( const ElementInfo<_dim_> &other ) const\n+433 {\n+434 return (instance_->elInfo.el != other.instance_->elInfo.el);\n+435 }\n+436\n 437\n-439 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;\n-440\n-442 const typename Traits :: LeafIndexSet & leafIndexSet () const;\n-443\n-445 const GlobalIdSet &globalIdSet () const\n-446 {\n-447 return idSet_;\n-448 }\n-449\n-451 const LocalIdSet &localIdSet () const\n-452 {\n-453 return idSet_;\n-454 }\n+438 template< int dim >\n+439 inline const typename ElementInfo<_dim_>::MacroElement &\n+440 ElementInfo<_dim_>::macroElement () const\n+441 {\n+442 assert( !!(*this) );\n+443 assert( elInfo().macro_el != NULL );\n+444 return static_cast< const MacroElement & >( *(elInfo().macro_el) );\n+445 }\n+446\n+447\n+448 template< int dim >\n+449 inline ElementInfo<_dim_> ElementInfo<_dim_>::father () const\n+450 {\n+451 assert( !!(*this) );\n+452 return ElementInfo<_dim_>( instance_->parent() );\n+453 }\n+454\n 455\n-456 // access to mesh pointer, needed by some methods\n-457 ALBERTA MESH* getMesh () const\n+456 template< int dim >\n+457 inline int ElementInfo<_dim_>::indexInFather () const\n 458 {\n-459 return mesh_;\n-460 };\n-461\n-462 const MeshPointer &meshPointer () const\n-463 {\n-464 return mesh_;\n-465 }\n-466\n-467 const DofNumbering &dofNumbering () const\n-468 {\n-469 return dofNumbering_;\n-470 }\n-471\n-472 const LevelProvider &levelProvider () const\n-473 {\n-474 return levelProvider_;\n-475 }\n-476\n-477 int dune2alberta ( int codim, int i ) const\n-478 {\n-479 return numberingMap_.dune2alberta( codim, i );\n-480 }\n+459 const Element *element = elInfo().el;\n+460 const Element *father = elInfo().parent->el;\n+461 assert( father != NULL );\n+462\n+463 const int index = (father->child[ 0 ] == element ? 0 : 1);\n+464 assert( father->child[ index ] == element );\n+465 return index;\n+466 }\n+467\n+468\n+469 template< int dim >\n+470 inline ElementInfo<_dim_> ElementInfo<_dim_>::child ( int i ) const\n+471 {\n+472 assert( !isLeaf() );\n+473\n+474 InstancePtr child = stack().allocate();\n+475 child->parent() = instance_;\n+476 addReference();\n+477\n+478 // Alberta fills opp_vertex only if there is a neighbor\n+479 for( int k = 0; k < maxNeighbors; ++k )\n+480 child->elInfo.opp_vertex[ k ] = -2;\n 481\n-482 int alberta2dune ( int codim, int i ) const\n-483 {\n-484 return numberingMap_.alberta2dune( codim, i );\n-485 }\n+482 fill( i, elInfo(), child->elInfo );\n+483 return ElementInfo<_dim_>( child );\n+484 }\n+485\n 486\n-487 int generic2alberta ( int codim, int i ) const\n-488 {\n-489 return genericNumberingMap_.dune2alberta( codim, i );\n-490 }\n-491\n-492 int alberta2generic ( int codim, int i ) const\n-493 {\n-494 return genericNumberingMap_.alberta2dune( codim, i );\n-495 }\n-496\n-497 private:\n-498 typedef std::vector ArrayType;\n+487 template< int dim >\n+488 inline bool ElementInfo<_dim_>::isLeaf () const\n+489 {\n+490 assert( !(*this) == false );\n+491 return isLeaf( el() );\n+492 }\n+493\n+494\n+495 template< int dim >\n+496 inline typename ElementInfo<_dim_>::Seed ElementInfo<_dim_>::seed () const\n+497 {\n+498 assert( !!(*this) );\n 499\n-500 void setup ();\n-501\n-502 // make the calculation of indexOnLevel and so on.\n-503 // extra method because of Reihenfolge\n-504 void calcExtras();\n-505\n-506 private:\n-507 // delete mesh and all vectors\n-508 void removeMesh();\n-509\n-510 //***********************************************************************\n-511 // MemoryManagement for Entities and Geometries\n-512 //**********************************************************************\n-513 typedef MakeableInterfaceObject<_typename_Traits::template_Codim<_0_>::\n-Entity >\n-514 EntityObject;\n-515\n-516 public:\n-517 friend class AlbertaGridLeafIntersectionIterator< const This >;\n-518\n-519 template< int codim >\n-520 static int\n-521 getTwist ( const typename Traits::template Codim<_codim_>::Entity &entity )\n-522 {\n-523 return entity.impl().twist();\n-524 }\n-525\n-526 template< int codim >\n-527 static int\n-528 getTwist ( const typename Traits::template Codim<_0_>::Entity &entity, int\n-subEntity )\n-529 {\n-530 return entity.impl().template twist<_codim_>( subEntity );\n-531 }\n-532\n-533 static int\n-534 getTwistInInside ( const typename Traits::LeafIntersection &intersection )\n-535 {\n-536 return intersection.impl().twistInInside();\n-537 }\n+500 int level = 0;\n+501 unsigned long path = 0;\n+502 for( InstancePtr p = instance_; p->parent() != null(); p = p->parent() )\n+503 {\n+504 const Element *element = p->elInfo.el;\n+505 const Element *father = p->parent()->elInfo.el;\n+506 const unsigned long child = static_cast< unsigned long >( father->child[ 1\n+] == element );\n+507 path = (path << 1) | child;\n+508 ++level;\n+509 }\n+510\n+511 if( level != elInfo().level )\n+512 DUNE_THROW( NotImplemented, \"Seed for fake elements not implemented.\" );\n+513\n+514 return Seed( macroElement().index, level, path );\n+515 }\n+516\n+517\n+518 template< int dim >\n+519 inline typename ElementInfo<_dim_>::MeshPointer ElementInfo<_dim_>::mesh ()\n+const\n+520 {\n+521 return MeshPointer( elInfo().mesh );\n+522 }\n+523\n+524\n+525 template< int dim >\n+526 inline bool ElementInfo<_dim_>::mightVanish () const\n+527 {\n+528 return mightVanish( el(), 0 );\n+529 }\n+530\n+531\n+532 template< int dim >\n+533 inline int ElementInfo<_dim_>::level () const\n+534 {\n+535 return elInfo().level;\n+536 }\n+537\n 538\n-539 static int\n-540 getTwistInOutside ( const typename Traits::LeafIntersection &intersection )\n+539 template< int dim >\n+540 inline int ElementInfo<_dim_>::type () const\n 541 {\n-542 return intersection.impl().twistInOutside();\n+542 return 0;\n 543 }\n 544\n-545 public:\n-546 // read global element number from elNumbers_\n-547 const Alberta::GlobalVector &\n-548 getCoord ( const ElementInfo &elementInfo, int vertex ) const;\n-549\n-550 private:\n-551 // pointer to an Albert Mesh, which contains the data\n-552 MeshPointer mesh_;\n-553\n-554 // communication\n-555 Communication comm_;\n-556\n-557 // maximum level of the mesh\n-558 int maxlevel_;\n+545\n+546 template<>\n+547 inline int ElementInfo<_3_>::type () const\n+548 {\n+549 return instance_->elInfo.el_type;\n+550 }\n+551\n+552\n+553 template< int dim >\n+554 inline int ElementInfo<_dim_>::getMark () const\n+555 {\n+556 return el()->mark;\n+557 }\n+558\n 559\n-560 // number of boundary segments within the macro grid\n-561 size_t numBoundarySegments_;\n-562\n-563 // map between ALBERTA and DUNE numbering\n-564 Alberta::NumberingMap<_dimension,_Alberta::Dune2AlbertaNumbering_>\n-numberingMap_;\n-565 Alberta::NumberingMap<_dimension,_Alberta::Generic2AlbertaNumbering_>\n-genericNumberingMap_;\n-566\n-567 DofNumbering dofNumbering_;\n+560 template< int dim >\n+561 inline void ElementInfo<_dim_>::setMark ( int refCount ) const\n+562 {\n+563 assert( isLeaf() );\n+564 assert( (refCount >= -128) && (refCount < 127) );\n+565 el()->mark = refCount;\n+566 }\n+567\n 568\n-569 LevelProvider levelProvider_;\n-570\n-571 // hierarchical numbering of AlbertaGrid, unique per codim\n-572 HierarchicIndexSet hIndexSet_;\n-573\n-574 // the id set of this grid\n-575 IdSetImp idSet_;\n-576\n-577 // the level index set, is generated from the HierarchicIndexSet\n-578 // is generated, when accessed\n-579 mutable std::vector< typename GridFamily::LevelIndexSetImp * >\n-levelIndexVec_;\n-580\n-581 // the leaf index set, is generated from the HierarchicIndexSet\n-582 // is generated, when accessed\n-583 mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;\n-584\n-585 SizeCache<_This_> sizeCache_;\n-586\n-587 typedef AlbertaMarkerVector<_dim,_dimworld_> MarkerVector;\n-588\n-589 // needed for VertexIterator, mark on which element a vertex is treated\n-590 mutable MarkerVector leafMarkerVector_;\n-591\n-592 // needed for VertexIterator, mark on which element a vertex is treated\n-593 mutable std::vector< MarkerVector > levelMarkerVector_;\n-594\n-595#if DUNE_ALBERTA_CACHE_COORDINATES\n-596 Alberta::CoordCache<_dimension_> coordCache_;\n-597#endif\n-598\n-599 // current state of adaptation\n-600 AdaptationState adaptationState_;\n-601 };\n+569 template< int dim >\n+570 inline bool ElementInfo<_dim_>::hasLeafNeighbor ( const int face ) const\n+571 {\n+572 assert( !!(*this) );\n+573 assert( (face >= 0) && (face < maxNeighbors) );\n+574\n+575 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n+576 const int macroFace = elInfo().macro_wall[ face ];\n+577 if( macroFace >= 0 )\n+578 return (macroElement().neighbor( macroFace ) != NULL);\n+579 else\n+580 return true;\n+581 }\n+582\n+583\n+584 template< int dim >\n+585 inline ElementInfo<_dim_> ElementInfo<_dim_>::leafNeighbor ( const int face\n+) const\n+586 {\n+587 assert( (face >= 0) && (face < numFaces) );\n+588 ElementInfo neighbor;\n+589 Library< dimWorld >::leafNeighbor( *this, face, neighbor );\n+590 return neighbor;\n+591 }\n+592\n+593\n+594 template< int dim >\n+595 inline int ElementInfo<_dim_>\n+596_::levelNeighbors ( const int face, ElementInfo (&neighbor)\n+[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const\n+597 {\n+598 assert( (face >= 0) && (face < numFaces) );\n+599 return Library< dimWorld >::levelNeighbors( *this, face, neighbor,\n+faceInNeighbor );\n+600 }\n+601\n 602\n-603} // namespace Dune\n-604\n-605#include \"albertagrid.cc\"\n-606\n-607// undef all dangerous defines\n-608#undef DIM\n-609#undef DIM_OF_WORLD\n+603 template< int dim >\n+604 template< int codim >\n+605 inline int ElementInfo<_dim_>::twist ( int subEntity ) const\n+606 {\n+607 return Twist<_dim,_dim-codim_>::twist( element(), subEntity );\n+608 }\n+609\n 610\n-611#ifdef _ABS_NOT_DEFINED_\n-612#undef ABS\n-613#endif\n-614\n-615#ifdef _MIN_NOT_DEFINED_\n-616#undef MIN\n-617#endif\n+611 template< int dim >\n+612 inline int ElementInfo<_dim_>::twistInNeighbor ( const int face ) const\n+613 {\n+614 assert( neighbor( face ) != NULL );\n+615 return Twist<_dim,_dim-1_>::twist( neighbor( face ), elInfo().opp_vertex\n+[ face ] );\n+616 }\n+617\n 618\n-619#ifdef _MAX_NOT_DEFINED_\n-620#undef MAX\n-621#endif\n-622\n-623#ifdef obstack_chunk_alloc\n-624#undef obstack_chunk_alloc\n-625#endif\n-626#ifdef obstack_chunk_free\n-627#undef obstack_chunk_free\n-628#endif\n-629#include \n-630\n-631// We use MEM_ALLOC, so undefine it here.\n-632#undef MEM_ALLOC\n+619 template< int dim >\n+620 inline bool ElementInfo<_dim_>::isBoundary ( int face ) const\n+621 {\n+622 assert( !!(*this) );\n+623 assert( (face >= 0) && (face < maxNeighbors) );\n+624\n+625 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n+626 const int macroFace = elInfo().macro_wall[ face ];\n+627 if( macroFace >= 0 )\n+628 return macroElement().isBoundary( macroFace );\n+629 else\n+630 return false;\n+631 }\n+632\n 633\n-634// We use MEM_REALLOC, so undefine it here.\n-635#undef MEM_REALLOC\n-636\n-637// We use MEM_CALLOC, so undefine it here.\n-638#undef MEM_CALLOC\n+634 template< int dim >\n+635 inline int ElementInfo<_dim_>::boundaryId ( int face ) const\n+636 {\n+637 assert( !!(*this) );\n+638 assert( (face >= 0) && (face < N_WALLS_MAX) );\n 639\n-640// We use MEM_FREE, so undefine it here.\n-641#undef MEM_FREE\n-642\n-643// Macro ERROR may be defined by alberta_util.h. If so, undefine it.\n-644#ifdef ERROR\n-645#undef ERROR\n-646#endif // #ifdef ERROR\n+640 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n+641 const int macroFace = elInfo().macro_wall[ face ];\n+642 const int id = macroElement().boundaryId( macroFace );\n+643 // this assertion is only allowed, if FILL_BOUND is set\n+644 // assert( id == elInfo().wall_bound[ face ] );\n+645 return id;\n+646 }\n 647\n-648// Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.\n-649#ifdef ERROR_EXIT\n-650#undef ERROR_EXIT\n-651#endif // #ifdef ERROR_EXIT\n-652\n-653// Macro WARNING may be defined by alberta_util.h. If so, undefine it.\n-654#ifdef WARNING\n-655#undef WARNING\n-656#endif // #ifdef WARNING\n-657\n-658// Macro TEST may be defined by alberta_util.h. If so, undefine it.\n-659#ifdef TEST\n-660#undef TEST\n-661#endif // #ifdef TEST\n-662\n-663// Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.\n-664#ifdef TEST_EXIT\n-665#undef TEST_EXIT\n-666#endif // #ifdef TEST_EXIT\n-667\n-668// Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.\n-669#ifdef DEBUG_TEST\n-670#undef DEBUG_TEST\n-671#endif // #ifdef DEBUG_TEST\n-672\n-673// Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine\n-it.\n-674#ifdef DEBUG_TEST_EXIT\n-675#undef DEBUG_TEST_EXIT\n-676#endif // #ifdef DEBUG_TEST_EXIT\n+648\n+649 template< int dim >\n+650 inline AffineTransformation *\n+651 ElementInfo<_dim_>::transformation ( int face ) const\n+652 {\n+653 assert( !!(*this) );\n+654 assert( (face >= 0) && (face < N_WALLS_MAX) );\n+655\n+656 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n+657 const int macroFace = elInfo().macro_wall[ face ];\n+658 return (macroFace < 0 ? NULL : macroElement().wall_trafo[ macroFace ]);\n+659 }\n+660\n+661\n+662 template< int dim >\n+663 inline BasicNodeProjection *\n+664 ElementInfo<_dim_>::boundaryProjection ( int face ) const\n+665 {\n+666 assert( !!(*this) );\n+667 assert( (face >= 0) && (face < N_WALLS_MAX) );\n+668\n+669 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n+670 const int macroFace = elInfo().macro_wall[ face ];\n+671 if( macroFace >= 0 )\n+672 return static_cast< BasicNodeProjection * >( macroElement().projection\n+[ macroFace+1 ] );\n+673 else\n+674 return 0;\n+675 }\n+676\n 677\n-678// Macro INFO may be defined by alberta_util.h. If so, undefine it.\n-679#ifdef INFO\n-680#undef INFO\n-681#endif // #ifdef INFO\n-682\n-683// Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.\n-684#ifdef PRINT_INFO\n-685#undef PRINT_INFO\n-686#endif // #ifdef PRINT_INFO\n-687\n-688// Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.\n-689#ifdef PRINT_INT_VEC\n-690#undef PRINT_INT_VEC\n-691#endif // #ifdef PRINT_INT_VEC\n+678 template< int dim >\n+679 inline bool ElementInfo<_dim_>::hasCoordinates () const\n+680 {\n+681 return ((elInfo().fill_flag & FillFlags::coords) != 0);\n+682 }\n+683\n+684 template< int dim >\n+685 inline const GlobalVector &ElementInfo<_dim_>::coordinate ( int vertex )\n+const\n+686 {\n+687 assert( hasCoordinates() );\n+688 assert( (vertex >= 0) && (vertex < numVertices) );\n+689 return elInfo().coord[ vertex ];\n+690 }\n+691\n 692\n-693// Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine\n-it.\n-694#ifdef PRINT_REAL_VEC\n-695#undef PRINT_REAL_VEC\n-696#endif // #ifdef PRINT_REAL_VEC\n-697\n-698// Macro WAIT may be defined by alberta_util.h. If so, undefine it.\n-699#ifdef WAIT\n-700#undef WAIT\n-701#endif // #ifdef WAIT\n-702\n-703// Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.\n-704#ifdef WAIT_REALLY\n-705#undef WAIT_REALLY\n-706#endif // #ifdef WAIT_REALLY\n-707\n-708// Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.\n-709#ifdef GET_WORKSPACE\n-710#undef GET_WORKSPACE\n-711#endif // #ifdef GET_WORKSPACE\n-712\n-713// Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine\n-it.\n-714#ifdef FREE_WORKSPACE\n-715#undef FREE_WORKSPACE\n-716#endif // #ifdef FREE_WORKSPACE\n-717\n-718// Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.\n-719#ifdef MAT_ALLOC\n-720#undef MAT_ALLOC\n-721#endif // #ifdef MAT_ALLOC\n-722\n-723// Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.\n-724#ifdef MAT_FREE\n-725#undef MAT_FREE\n-726#endif // #ifdef MAT_FREE\n-727\n-728// Macro NAME may be defined by alberta_util.h. If so, undefine it.\n-729#ifdef NAME\n-730#undef NAME\n-731#endif // #ifdef NAME\n-732\n-733// Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.\n-734#ifdef GET_STRUCT\n-735#undef GET_STRUCT\n-736#endif // #ifdef GET_STRUCT\n-737\n-738// Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.\n-739#ifdef ADD_PARAMETER\n-740#undef ADD_PARAMETER\n-741#endif // #ifdef ADD_PARAMETER\n+693 template< int dim >\n+694 template< class Functor >\n+695 inline void ElementInfo<_dim_>::hierarchicTraverse ( Functor &functor )\n+const\n+696 {\n+697 functor( *this );\n+698 if( !isLeaf() )\n+699 {\n+700 child( 0 ).hierarchicTraverse( functor );\n+701 child( 1 ).hierarchicTraverse( functor );\n+702 }\n+703 }\n+704\n+705\n+706 template< int dim >\n+707 template< class Functor >\n+708 inline void ElementInfo<_dim_>::leafTraverse ( Functor &functor ) const\n+709 {\n+710 if( !isLeaf() )\n+711 {\n+712 child( 0 ).leafTraverse( functor );\n+713 child( 1 ).leafTraverse( functor );\n+714 }\n+715 else\n+716 functor( *this );\n+717 }\n+718\n+719\n+720 template< int dim >\n+721 inline const Element *ElementInfo<_dim_>::element () const\n+722 {\n+723 return elInfo().el;\n+724 }\n+725\n+726\n+727 template< int dim >\n+728 inline const Element *ElementInfo<_dim_>::neighbor ( int face ) const\n+729 {\n+730 assert( (face >= 0) && (face < numFaces) );\n+731 assert( (elInfo().fill_flag & FillFlags::neighbor) != 0 );\n+732 return elInfo().neigh[ face ];\n+733 }\n+734\n+735\n+736 template< int dim >\n+737 inline Element *ElementInfo<_dim_>::el () const\n+738 {\n+739 return elInfo().el;\n+740 }\n+741\n 742\n-743// Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.\n-744#ifdef GET_PARAMETER\n-745#undef GET_PARAMETER\n-746#endif // #ifdef GET_PARAMETER\n-747\n-748#define _ALBERTA_H_\n+743 template< int dim >\n+744 inline ALBERTA EL_INFO &ElementInfo<_dim_>::elInfo () const\n+745 {\n+746 return (instance_->elInfo);\n+747 }\n+748\n 749\n-750#endif // HAVE_ALBERTA || DOXYGEN\n-751\n-752#endif\n-adaptcallback.hh\n-interfaces and wrappers needed for the callback adaptation provided by\n-AlbertaGrid and dune-ALUGrid\n-sizecache.hh\n-Provides size cache classes to implement the grids size method efficiently.\n-hierarchiciterator.hh\n-misc.hh\n-leafiterator.hh\n-level.hh\n-undefine-3.0.hh\n-Contains #undefs for all preprocessor macros defined by alberta.\n-coordcache.hh\n-treeiterator.hh\n-albertagrid.cc\n-albertaheader.hh\n+750 template< int dim >\n+751 inline ElementInfo<_dim_>\n+752 ElementInfo<_dim_>::createFake ( const MeshPointer &mesh,\n+753 const Element *element, int level, int type )\n+754 {\n+755 InstancePtr instance = stack().allocate();\n+756 instance->parent() = null();\n+757 ++(instance->parent()->refCount);\n+758\n+759 instance->elInfo.mesh = mesh;\n+760 instance->elInfo.macro_el = NULL;\n+761 instance->elInfo.el = const_cast< Element * >( element );\n+762 instance->elInfo.parent = NULL;\n+763 instance->elInfo.fill_flag = FillFlags::nothing;\n+764 instance->elInfo.level = level;\n+765 instance->elInfo.el_type = type;\n+766\n+767 return ElementInfo<_dim_>( instance );\n+768 }\n+769\n+770\n+771 template< int dim >\n+772 inline ElementInfo<_dim_>\n+773 ElementInfo<_dim_>::createFake ( const ALBERTA EL_INFO &elInfo )\n+774 {\n+775 InstancePtr instance = stack().allocate();\n+776 instance->parent() = null();\n+777 ++(instance->parent()->refCount);\n+778\n+779 instance->elInfo = elInfo;\n+780 return ElementInfo<_dim_>( instance );\n+781 }\n+782\n+783\n+784 template< int dim >\n+785 inline bool ElementInfo<_dim_>::isLeaf ( Element *element )\n+786 {\n+787 return IS_LEAF_EL( element );\n+788 }\n+789\n+790\n+791 template< int dim >\n+792 inline bool ElementInfo<_dim_>::mightVanish ( Alberta::Element *element,\n+int depth )\n+793 {\n+794 if( isLeaf( element ) )\n+795 return (element->mark < depth);\n+796 else\n+797 return (mightVanish( element->child[ 0 ], depth-1 ) && mightVanish\n+( element->child[ 1 ], depth-1 ));\n+798 }\n+799\n+800\n+801 template< int dim >\n+802 inline void ElementInfo< dim >\n+803 ::fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO &elInfo )\n+804 {\n+805 ALBERTA fill_macro_info( mesh, mel, &elInfo );\n+806 }\n+807\n+808 template< int dim >\n+809 inline void ElementInfo< dim >\n+810 ::fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA EL_INFO\n+&elInfo )\n+811 {\n+812 ALBERTA fill_elinfo( ichild, FILL_ANY, &parentInfo, &elInfo );\n+813 }\n+814\n+815\n+816 template< int dim >\n+817 inline void ElementInfo< dim >::addReference () const\n+818 {\n+819 ++(instance_->refCount);\n+820 }\n+821\n+822\n+823 template< int dim >\n+824 inline void ElementInfo< dim >::removeReference () const\n+825 {\n+826 // short-circuit for rvalues that have been drained as argument to a move\n+operation\n+827 if ( !instance_ )\n+828 return;\n+829 // this loop breaks when instance becomes null()\n+830 for( InstancePtr instance = instance_; --(instance->refCount) == 0; )\n+831 {\n+832 const InstancePtr parent = instance->parent();\n+833 stack().release( instance );\n+834 instance = parent;\n+835 }\n+836 }\n+837\n+838\n+839 template< int dim >\n+840 inline typename ElementInfo< dim >::InstancePtr\n+841 ElementInfo< dim >::null ()\n+842 {\n+843 return stack().null();\n+844 }\n+845\n+846\n+847 template< int dim >\n+848 inline typename ElementInfo< dim >::Stack &\n+849 ElementInfo< dim >::stack ()\n+850 {\n+851 static Stack s;\n+852 return s;\n+853 }\n+854\n+855\n+856\n+857 // Implementation of ElementInfo::Stack\n+858 // ------------------------------------\n+859\n+860 template< int dim >\n+861 inline ElementInfo<_dim_>::Stack::Stack ()\n+862 : top_( 0 )\n+863 {\n+864 null_.elInfo.el = NULL;\n+865 null_.refCount = 1;\n+866 null_.parent() = 0;\n+867 }\n+868\n+869\n+870 template< int dim >\n+871 inline ElementInfo<_dim_>::Stack::~Stack ()\n+872 {\n+873 while( top_ != 0 )\n+874 {\n+875 InstancePtr p = top_;\n+876 top_ = p->parent();\n+877 delete p;\n+878 }\n+879 }\n+880\n+881\n+882 template< int dim >\n+883 inline typename ElementInfo<_dim_>::InstancePtr\n+884 ElementInfo<_dim_>::Stack::allocate ()\n+885 {\n+886 InstancePtr p = top_;\n+887 if( p != 0 )\n+888 top_ = p->parent();\n+889 else\n+890 p = new Instance;\n+891 p->refCount = 0;\n+892 return p;\n+893 }\n+894\n+895\n+896 template< int dim >\n+897 inline void ElementInfo<_dim_>::Stack::release ( InstancePtr &p )\n+898 {\n+899 assert( (p != null()) && (p->refCount == 0) );\n+900 p->parent() = top_;\n+901 top_ = p;\n+902 }\n+903\n+904\n+905 template< int dim >\n+906 inline typename ElementInfo<_dim_>::InstancePtr\n+907 ElementInfo<_dim_>::Stack::null ()\n+908 {\n+909 return &null_;\n+910 }\n+911\n+912 } // namespace Alberta\n+913\n+914} // namespace Dune\n+915\n+916#endif // #if HAVE_ALBERTA\n+917\n+918#endif // #ifndef DUNE_ALBERTA_ELEMENTINFO_HH\n+geometrycache.hh\n+macroelement.hh\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n-leveliterator.hh\n+std::swap\n+void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n+> &b)\n+Definition utility/persistentcontainer.hh:83\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::Real\n-ALBERTA REAL Real\n-Definition misc.hh:48\n+Dune::Alberta::Mesh\n+ALBERTA MESH Mesh\n+Definition misc.hh:53\n+Dune::Alberta::AffineTransformation\n+ALBERTA AFF_TRAFO AffineTransformation\n+Definition misc.hh:52\n+Dune::Alberta::Element\n+ALBERTA EL Element\n+Definition misc.hh:54\n Dune::Alberta::GlobalVector\n ALBERTA REAL_D GlobalVector\n Definition misc.hh:50\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::AlbertaGrid\n-[ provides Dune::Grid ]\n-Definition agrid.hh:109\n-Dune::AlbertaGrid::readGrid\n-bool readGrid(const std::string &filename, ctype &time)\n-read Grid from file filename and store time of mesh in time\n-Definition albertagrid.cc:585\n-Dune::AlbertaGrid::dofNumbering\n-const DofNumbering & dofNumbering() const\n-Definition agrid.hh:467\n-Dune::AlbertaGrid::generic2alberta\n-int generic2alberta(int codim, int i) const\n-Definition agrid.hh:487\n-Dune::AlbertaGrid::typeName\n-static std::string typeName()\n-Definition agrid.hh:410\n-Dune::AlbertaGrid::leafbegin\n-Traits::template Codim< codim >::template Partition< pitype >::LeafIterator\n-leafbegin() const\n-return LeafIterator which points to first leaf entity\n-Dune::AlbertaGrid::hierarchicIndexSet\n-const HierarchicIndexSet & hierarchicIndexSet() const\n-Definition agrid.hh:436\n-Dune::AlbertaGrid::lend\n-Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend\n-(int level) const\n-one past the end on this level\n-Dune::AlbertaGrid::dimension\n-static const int dimension\n-Definition agrid.hh:145\n-Dune::AlbertaGrid::dune2alberta\n-int dune2alberta(int codim, int i) const\n-Definition agrid.hh:477\n-Dune::AlbertaGrid::Communication\n-Traits::Communication Communication\n-type of communication\n-Definition agrid.hh:165\n-Dune::AlbertaGrid::maxLevel\n-int maxLevel() const\n-Definition albertagrid.cc:483\n-Dune::AlbertaGrid::AlbertaGrid\n-AlbertaGrid()\n-create an empty grid\n-Definition albertagrid.cc:42\n-Dune::AlbertaGrid::lbegin\n-Traits::template Codim< codim >::LevelIterator lbegin(int level) const\n-Iterator to first entity of given codim on level.\n-Dune::AlbertaGrid::levelProvider\n-const LevelProvider & levelProvider() const\n-Definition agrid.hh:472\n-Dune::AlbertaGrid::getTwistInOutside\n-static int getTwistInOutside(const typename Traits::LeafIntersection\n-&intersection)\n-Definition agrid.hh:540\n-Dune::AlbertaGrid::getCoord\n-const Alberta::GlobalVector & getCoord(const ElementInfo &elementInfo, int\n-vertex) const\n-Definition albertagrid.cc:471\n-Dune::AlbertaGrid::lend\n-Traits::template Codim< codim >::LevelIterator lend(int level) const\n-one past the end on this level\n-Dune::AlbertaGrid::leafGridView\n-Traits::LeafGridView leafGridView() const\n-View for the leaf grid for All_Partition.\n-Definition agrid.hh:364\n-Dune::AlbertaGrid::adapt\n-bool adapt()\n-Refine all positive marked leaf entities, coarsen all negative marked entities\n-if possible.\n-Definition albertagrid.cc:415\n-Dune::AlbertaGrid::dimensionworld\n-static const int dimensionworld\n-Definition agrid.hh:146\n-Dune::AlbertaGrid::getTwistInInside\n-static int getTwistInInside(const typename Traits::LeafIntersection\n-&intersection)\n-Definition agrid.hh:534\n-Dune::AlbertaGrid::postAdapt\n-void postAdapt()\n-clean up some markers\n-Definition albertagrid.cc:356\n-Dune::AlbertaGrid::leafbegin\n-Traits::template Codim< codim >::LeafIterator leafbegin() const\n-return LeafIterator which points to first leaf entity\n-Dune::AlbertaGrid::localIdSet\n-const LocalIdSet & localIdSet() const\n-return local IdSet\n-Definition agrid.hh:451\n-Dune::AlbertaGrid::numBoundarySegments\n-std::size_t numBoundarySegments() const\n-number of boundary segments within the macro grid\n-Definition agrid.hh:350\n-Dune::AlbertaGrid::ctype\n-GridFamily::ctype ctype\n-Definition agrid.hh:143\n-Dune::AlbertaGrid::AlbertaGrid\n-AlbertaGrid(const This &)=delete\n-Dune::AlbertaGrid::leafend\n-Traits::template Codim< codim >::LeafIterator leafend() const\n-return LeafIterator which points behind last leaf entity\n-Dune::AlbertaGrid::levelIndexSet\n-const Traits::LevelIndexSet & levelIndexSet(int level) const\n-return level index set for given level\n-Definition albertagrid.cc:520\n-Dune::AlbertaGrid::alberta2generic\n-int alberta2generic(int codim, int i) const\n-Definition agrid.hh:492\n-Dune::AlbertaGrid::getTwist\n-static int getTwist(const typename Traits::template Codim< codim >::Entity\n-&entity)\n-Definition agrid.hh:521\n-Dune::AlbertaGrid::comm\n-const Communication & comm() const\n-return reference to communication, if MPI found this is specialisation for MPI\n-Definition agrid.hh:405\n-Dune::AlbertaGrid::getMesh\n-ALBERTA MESH * getMesh() const\n-Definition agrid.hh:457\n-Dune::AlbertaGrid::size\n-int size(int level, int codim) const\n-Number of grid entities per level and codim because lbegin and lend are none\n-const,...\n-Definition albertagrid.cc:490\n-Dune::AlbertaGrid::HierarchicIndexSet\n-Traits::HierarchicIndexSet HierarchicIndexSet\n-type of hierarchic index set\n-Definition agrid.hh:157\n-Dune::AlbertaGrid::leafIndexSet\n-const Traits::LeafIndexSet & leafIndexSet() const\n-return leaf index set\n-Definition albertagrid.cc:535\n-Dune::AlbertaGrid::leafend\n-Traits::template Codim< codim >::template Partition< pitype >::LeafIterator\n-leafend() const\n-return LeafIterator which points behind last leaf entity\n-Dune::AlbertaGrid::writeGrid\n-bool writeGrid(const std::string &filename, ctype time) const\n-write Grid to file in Xdr\n-Definition albertagrid.cc:575\n-Dune::AlbertaGrid::levelGridView\n-Traits::LevelGridView levelGridView(int level) const\n-View for a grid level for All_Partition.\n-Definition agrid.hh:356\n-Dune::AlbertaGrid::alberta2dune\n-int alberta2dune(int codim, int i) const\n-Definition agrid.hh:482\n-Dune::AlbertaGrid::operator=\n-This & operator=(const This &)=delete\n-Dune::AlbertaGrid::Traits\n-AlbertaGridFamily< dim, dimworld >::Traits Traits\n-Definition agrid.hh:149\n-Dune::AlbertaGrid::getTwist\n-static int getTwist(const typename Traits::template Codim< 0 >::Entity &entity,\n-int subEntity)\n-Definition agrid.hh:528\n-Dune::AlbertaGrid::lbegin\n-Traits::template Codim< cd >::template Partition< pitype >::LevelIterator\n-lbegin(int level) const\n-Iterator to first entity of given codim on level.\n-Dune::AlbertaGrid::globalIdSet\n-const GlobalIdSet & globalIdSet() const\n-return global IdSet\n-Definition agrid.hh:445\n-Dune::AlbertaGrid::globalRefine\n-void globalRefine(int refCount)\n-uses the interface, mark on entity and refineLocal\n-Definition albertagrid.cc:304\n-Dune::AlbertaGrid::getMark\n-int getMark(const typename Traits::template Codim< 0 >::Entity &e) const\n-returns adaptation mark for given entity\n-Definition albertagrid.cc:408\n-Dune::AlbertaGrid::entity\n-Traits::template Codim< EntitySeed::codimension >::Entity entity(const\n-EntitySeed &seed) const\n-obtain Entity from EntitySeed.\n-Definition agrid.hh:420\n-Dune::AlbertaGrid::~AlbertaGrid\n-~AlbertaGrid()\n-destructor\n-Definition albertagrid.cc:196\n-Dune::AlbertaGrid::preAdapt\n-bool preAdapt()\n-returns true, if a least one element is marked for coarsening\n-Definition albertagrid.cc:348\n-Dune::AlbertaGrid::mark\n-bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)\n-Marks an entity to be refined/coarsened in a subsequent adapt.\n-Definition albertagrid.cc:385\n-Dune::AlbertaGrid::meshPointer\n-const MeshPointer & meshPointer() const\n-Definition agrid.hh:462\n-Dune::Alberta::CoordCache\n-Definition coordcache.hh:25\n-Dune::Alberta::AdaptRestrictProlongHandler\n-Definition albertagrid/datahandle.hh:27\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::impl\n-Implementation & impl()\n-access to the underlying implementation\n-Definition common/intersection.hh:178\n Dune::Alberta::MeshPointer<_dimension_>\n-Dune::Alberta::HierarchyDofNumbering<_dimension_>\n-Dune::Alberta::ElementInfo<_dimension_>\n-Dune::AlbertaGridTreeIterator\n-Definition treeiterator.hh:189\n-Dune::AlbertaGridHierarchicIterator\n-Definition hierarchiciterator.hh:29\n-Dune::AlbertaGridLeafIntersection\n-Definition albertagrid/intersection.hh:105\n-Dune::AlbertaGridLeafIntersectionIterator\n-Definition albertagrid/intersectioniterator.hh:27\n-Dune::AlbertaGridEntity\n-Definition albertagrid/entity.hh:46\n-Dune::AlbertaGridHierarchicIndexSet\n-Definition albertagrid/indexsets.hh:42\n-Dune::AlbertaGridIdSet\n-hierarchic index set of AlbertaGrid\n-Definition albertagrid/indexsets.hh:518\n-Dune::AlbertaGridIndexSet\n-Definition albertagrid/indexsets.hh:329\n-Dune::AlbertaGridFamily\n-Definition albertagrid/gridfamily.hh:83\n-Dune::AlbertaGridFamily::dimension\n+Dune::Alberta::ElementInfo\n+Definition elementinfo.hh:43\n+Dune::Alberta::ElementInfo::leafNeighbor\n+ElementInfo leafNeighbor(const int face) const\n+Definition elementinfo.hh:585\n+Dune::Alberta::ElementInfo::isLeaf\n+bool isLeaf() const\n+Definition elementinfo.hh:488\n+Dune::Alberta::ElementInfo::createFake\n+static ElementInfo createFake(const MeshPointer &mesh, const Element *element,\n+int level, int type=0)\n+Definition elementinfo.hh:752\n+Dune::Alberta::ElementInfo::child\n+ElementInfo child(int i) const\n+Definition elementinfo.hh:470\n+Dune::Alberta::ElementInfo::level\n+int level() const\n+Definition elementinfo.hh:533\n+Dune::Alberta::ElementInfo::mightVanish\n+bool mightVanish() const\n+Definition elementinfo.hh:526\n+Dune::Alberta::ElementInfo::numFaces\n+static const int numFaces\n+Definition elementinfo.hh:56\n+Dune::Alberta::ElementInfo::twist\n+int twist(int subEntity) const\n+Definition elementinfo.hh:605\n+Dune::Alberta::ElementInfo::twistInNeighbor\n+int twistInNeighbor(int face) const\n+Definition elementinfo.hh:612\n+Dune::Alberta::ElementInfo::MacroElement\n+Alberta::MacroElement< dimension > MacroElement\n+Definition elementinfo.hh:58\n+Dune::Alberta::ElementInfo::boundaryProjection\n+BasicNodeProjection * boundaryProjection(int face) const\n+Definition elementinfo.hh:664\n+Dune::Alberta::ElementInfo::macroElement\n+const MacroElement & macroElement() const\n+Definition elementinfo.hh:440\n+Dune::Alberta::ElementInfo::maxLevelNeighbors\n+static const int maxLevelNeighbors\n+Definition elementinfo.hh:64\n+Dune::Alberta::ElementInfo::father\n+ElementInfo father() const\n+Definition elementinfo.hh:449\n+Dune::Alberta::ElementInfo::ElementInfo\n+ElementInfo(const ElementInfo &other)\n+Definition elementinfo.hh:382\n+Dune::Alberta::ElementInfo::GeometryCache\n+GeometryCacheProxy< dim > GeometryCache\n+Definition elementinfo.hh:67\n+Dune::Alberta::ElementInfo::operator=\n+ElementInfo & operator=(const ElementInfo &other)\n+Definition elementinfo.hh:405\n+Dune::Alberta::ElementInfo::hasLeafNeighbor\n+bool hasLeafNeighbor(const int face) const\n+Definition elementinfo.hh:570\n+Dune::Alberta::ElementInfo::operator==\n+bool operator==(const ElementInfo &other) const\n+Definition elementinfo.hh:424\n+Dune::Alberta::ElementInfo::dimension\n static const int dimension\n-Definition albertagrid/gridfamily.hh:88\n-Dune::AlbertaGridFamily::dimensionworld\n-static const int dimensionworld\n-Definition albertagrid/gridfamily.hh:89\n-Dune::AlbertaGridFamily::LeafIndexSetImp\n-AlbertaGridIndexSet< dim, dimworld > LeafIndexSetImp\n-Definition albertagrid/gridfamily.hh:92\n-Dune::AlbertaGridFamily::ctype\n-Alberta::Real ctype\n-Definition albertagrid/gridfamily.hh:86\n-Dune::AlbertaGridFamily::Traits\n-Definition albertagrid/gridfamily.hh:98\n-Dune::AlbertaGridFamily::Traits::Communication\n-Dune::Communication< No_Comm > Communication\n-Definition albertagrid/gridfamily.hh:148\n-Dune::AlbertaGridFamily::Traits::Codim\n-Definition albertagrid/gridfamily.hh:117\n-Dune::AlbertaLevelGridView\n-Definition albertagrid/gridview.hh:76\n-Dune::AlbertaLeafGridView\n-Definition albertagrid/gridview.hh:287\n-Dune::AlbertaGridIntersectionBase\n-Definition albertagrid/intersection.hh:32\n-Dune::AlbertaGridLevelProvider<_dimension_>\n-Dune::Alberta::MacroData<_dimension_>\n-Dune::Alberta::NumberingMap<_dimension,_Alberta::Dune2AlbertaNumbering_>\n-Dune::Alberta::NumberingMap::alberta2dune\n-int alberta2dune(int codim, int i) const\n-Definition misc.hh:397\n-Dune::Alberta::NumberingMap::dune2alberta\n-int dune2alberta(int codim, int i) const\n-Definition misc.hh:390\n-Dune::Alberta::ProjectionFactoryInterface\n-Definition albertagrid/projection.hh:80\n-Dune::AlbertaMarkerVector\n-marker assigning subentities to one element containing them\n-Definition treeiterator.hh:35\n-Dune::AdaptDataHandleInterface\n-Interface class for the Grid's adapt method where the parameter is a\n-AdaptDataHandleInterface.\n-Definition adaptcallback.hh:33\n-Dune::EntitySeed\n-Store a reference to an entity with a minimal memory footprint.\n-Definition common/entityseed.hh:26\n-Dune::EntitySeed::impl\n-Implementation & impl()\n-access to the underlying implementation\n-Definition common/entityseed.hh:59\n-Dune::GridDefaultImplementation\n-Definition common/grid.hh:848\n-Dune::GridDefaultImplementation<_dim,_dimworld,_Alberta::Real,\n-AlbertaGridFamily<_dim,_dimworld_>_>::mark\n-bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)\n-Marks an entity to be refined/coarsened in a subsequent adapt.\n-Definition common/grid.hh:929\n-Dune::GridDefaultImplementation<_dim,_dimworld,_Alberta::Real,\n-AlbertaGridFamily<_dim,_dimworld_>_>::getMark\n-int getMark(const typename Traits::template Codim< 0 >::Entity &e) const\n-returns adaptation mark for given entity, i.e. here the default implementation\n-returns 0.\n-Definition common/grid.hh:941\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-Dune::MakeableInterfaceObject\n-Definition common/grid.hh:1121\n-Dune::GridFactory\n-Provide a generic factory class for unstructured grids.\n-Definition common/gridfactory.hh:275\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::SizeCache\n-organizes the caching of sizes for one grid and one GeometryType\n-Definition sizecache.hh:33\n-backuprestore.hh\n-capabilities.hh\n-datahandle.hh\n-entity.hh\n-entityseed.hh\n-geometry.hh\n-gridfactory.hh\n-Provide a generic factory class for unstructured grids.\n-gridfamily.hh\n-provides the GridFamily for AlbertaGrid\n-indexsets.hh\n-intersection.hh\n-intersectioniterator.hh\n-Implementation of the IntersectionIterator for AlbertaGrid.\n-grid.hh\n-Different resources needed by all grid implementations.\n+Definition elementinfo.hh:53\n+Dune::Alberta::ElementInfo::hierarchicTraverse\n+void hierarchicTraverse(Functor &functor) const\n+Definition elementinfo.hh:695\n+Dune::Alberta::ElementInfo::type\n+int type() const\n+Definition elementinfo.hh:540\n+Dune::Alberta::ElementInfo::maxNeighbors\n+static const int maxNeighbors\n+Definition elementinfo.hh:62\n+Dune::Alberta::ElementInfo::setMark\n+void setMark(int refCount) const\n+Definition elementinfo.hh:561\n+Dune::Alberta::ElementInfo::~ElementInfo\n+~ElementInfo()\n+Definition elementinfo.hh:397\n+Dune::Alberta::ElementInfo::coordinate\n+const GlobalVector & coordinate(int vertex) const\n+Definition elementinfo.hh:685\n+Dune::Alberta::ElementInfo::numVertices\n+static const int numVertices\n+Definition elementinfo.hh:55\n+Dune::Alberta::ElementInfo::getMark\n+int getMark() const\n+Definition elementinfo.hh:554\n+Dune::Alberta::ElementInfo::leafTraverse\n+void leafTraverse(Functor &functor) const\n+Definition elementinfo.hh:708\n+Dune::Alberta::ElementInfo::MeshPointer\n+Alberta::MeshPointer< dimension > MeshPointer\n+Definition elementinfo.hh:59\n+Dune::Alberta::ElementInfo::neighbor\n+const Element * neighbor(int face) const\n+Definition elementinfo.hh:728\n+Dune::Alberta::ElementInfo::createFake\n+static ElementInfo createFake(const ALBERTA EL_INFO &elInfo)\n+Definition elementinfo.hh:773\n+Dune::Alberta::ElementInfo::ElementInfo\n+ElementInfo()\n+Definition elementinfo.hh:310\n+Dune::Alberta::ElementInfo::boundaryId\n+int boundaryId(int face) const\n+Definition elementinfo.hh:635\n+Dune::Alberta::ElementInfo::operator!=\n+bool operator!=(const ElementInfo &other) const\n+Definition elementinfo.hh:432\n+Dune::Alberta::ElementInfo::FillFlags\n+Alberta::FillFlags< dimension > FillFlags\n+Definition elementinfo.hh:60\n+Dune::Alberta::ElementInfo::ElementInfo\n+ElementInfo(const MeshPointer &mesh, const MacroElement ¯oElement, typename\n+FillFlags::Flags fillFlags=FillFlags::standard)\n+Definition elementinfo.hh:319\n+Dune::Alberta::ElementInfo::transformation\n+AffineTransformation * transformation(int face) const\n+Definition elementinfo.hh:651\n+Dune::Alberta::ElementInfo::isBoundary\n+bool isBoundary(int face) const\n+Definition elementinfo.hh:620\n+Dune::Alberta::ElementInfo::indexInFather\n+int indexInFather() const\n+Definition elementinfo.hh:457\n+Dune::Alberta::ElementInfo::seed\n+Seed seed() const\n+Definition elementinfo.hh:496\n+Dune::Alberta::ElementInfo::el\n+Element * el() const\n+Definition elementinfo.hh:737\n+Dune::Alberta::ElementInfo::element\n+const Element * element() const\n+Definition elementinfo.hh:721\n+Dune::Alberta::ElementInfo::elInfo\n+ALBERTA EL_INFO & elInfo() const\n+Definition elementinfo.hh:744\n+Dune::Alberta::ElementInfo::mesh\n+MeshPointer mesh() const\n+Definition elementinfo.hh:519\n+Dune::Alberta::ElementInfo::geometryCache\n+GeometryCache geometryCache() const\n+Definition elementinfo.hh:140\n+Dune::Alberta::ElementInfo::hasCoordinates\n+bool hasCoordinates() const\n+Definition elementinfo.hh:679\n+Dune::Alberta::ElementInfo::levelNeighbors\n+int levelNeighbors(const int face, ElementInfo(&neighbor)[maxLevelNeighbors],\n+int(&faceInNeighbor)[maxLevelNeighbors]) const\n+Definition elementinfo.hh:596\n+Dune::Alberta::ElementInfo::ElementInfo\n+ElementInfo(ElementInfo &&other)\n+Definition elementinfo.hh:389\n+Dune::Alberta::ElementInfo::ElementInfo\n+ElementInfo(const MeshPointer &mesh, const Seed &seed, typename FillFlags::\n+Flags fillFlags=FillFlags::standard)\n+Definition elementinfo.hh:340\n+Dune::Alberta::ElementInfo::Instance\n+Definition elementinfo.hh:185\n+Dune::Alberta::ElementInfo::Instance::parent\n+InstancePtr & parent()\n+Definition elementinfo.hh:189\n+Dune::Alberta::ElementInfo::Instance::geometryCache\n+Alberta::GeometryCache< dim > geometryCache\n+Definition elementinfo.hh:199\n+Dune::Alberta::ElementInfo::Instance::elInfo\n+ALBERTA EL_INFO elInfo\n+Definition elementinfo.hh:186\n+Dune::Alberta::ElementInfo::Instance::refCount\n+unsigned int refCount\n+Definition elementinfo.hh:187\n+Dune::Alberta::ElementInfo::Stack\n+Definition elementinfo.hh:210\n+Dune::Alberta::ElementInfo::Stack::null\n+InstancePtr null()\n+Definition elementinfo.hh:907\n+Dune::Alberta::ElementInfo::Stack::~Stack\n+~Stack()\n+Definition elementinfo.hh:871\n+Dune::Alberta::ElementInfo::Stack::release\n+void release(InstancePtr &p)\n+Definition elementinfo.hh:897\n+Dune::Alberta::ElementInfo::Stack::Stack\n+Stack()\n+Definition elementinfo.hh:861\n+Dune::Alberta::ElementInfo::Stack::allocate\n+InstancePtr allocate()\n+Definition elementinfo.hh:884\n+Dune::Alberta::ElementInfo::Seed\n+Definition elementinfo.hh:255\n+Dune::Alberta::ElementInfo::Seed::Seed\n+Seed(const int macroIndex, const int level, const unsigned long path)\n+Definition elementinfo.hh:260\n+Dune::Alberta::ElementInfo::Seed::Seed\n+Seed()\n+Definition elementinfo.hh:256\n+Dune::Alberta::ElementInfo::Seed::level\n+int level() const\n+Definition elementinfo.hh:287\n+Dune::Alberta::ElementInfo::Seed::isValid\n+bool isValid() const\n+Definition elementinfo.hh:284\n+Dune::Alberta::ElementInfo::Seed::path\n+unsigned long path() const\n+Definition elementinfo.hh:288\n+Dune::Alberta::ElementInfo::Seed::macroIndex\n+int macroIndex() const\n+Definition elementinfo.hh:286\n+Dune::Alberta::GeometryCache\n+Definition geometrycache.hh:24\n+Dune::Alberta::GeometryCacheProxy\n+Definition geometrycache.hh:91\n+Dune::Alberta::MacroElement\n+Definition macroelement.hh:24\n+Dune::Alberta::NumSubEntities\n+Definition misc.hh:148\n+Dune::Alberta::FillFlags\n+Definition misc.hh:231\n+Dune::Alberta::FillFlags::nothing\n+static const Flags nothing\n+Definition misc.hh:234\n+Dune::Alberta::FillFlags::boundaryId\n+static const Flags boundaryId\n+Definition misc.hh:246\n+Dune::Alberta::FillFlags::Flags\n+ALBERTA FLAGS Flags\n+Definition misc.hh:232\n+Dune::Alberta::FillFlags::coords\n+static const Flags coords\n+Definition misc.hh:236\n+Dune::Alberta::FillFlags::standard\n+static const Flags standard\n+Definition misc.hh:258\n+Dune::Alberta::FillFlags::neighbor\n+static const Flags neighbor\n+Definition misc.hh:238\n+Dune::Alberta::Twist::twist\n+static int twist(const Element *element, int subEntity)\n+Definition misc.hh:538\n+Dune::Alberta::BasicNodeProjection\n+Definition albertagrid/projection.hh:208\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00662.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00662.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: geometrycache.hh File Reference\n+dune-grid: macrodata.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,46 @@\n
  • dune
  • grid
  • albertagrid
  • \n
    \n
    \n
    \n \n-
    geometrycache.hh File Reference
    \n+
    macrodata.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/algebra.hh>
    \n+\n+

    provides a wrapper for ALBERTA's macro_data structure \n+More...

    \n+
    #include <dune/common/fvector.hh>
    \n+#include <dune/common/fmatrix.hh>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/algebra.hh>
    \n+#include <dune/grid/albertagrid/albertaheader.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::Alberta::GeometryCache< dim >
    class  Dune::Alberta::MacroData< dim >
     
    struct  Dune::Alberta::GeometryCacheProxy< dim >
    struct  Dune::Alberta::MacroData< dim >::Library< int >
     
    \n \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-
    \n+

    Detailed Description

    \n+

    provides a wrapper for ALBERTA's macro_data structure

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,24 +2,32 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n Classes | Namespaces\n-geometrycache.hh File Reference\n+macrodata.hh File Reference\n+provides a wrapper for ALBERTA's macro_data structure More...\n+#include \n+#include \n #include \n #include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::Alberta::GeometryCache<_dim_>\n+ class \u00a0 Dune::Alberta::MacroData<_dim_>\n \u00a0\n-struct \u00a0 Dune::Alberta::GeometryCacheProxy<_dim_>\n+struct \u00a0 Dune::Alberta::MacroData<_dim_>::Library<_int_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n+***** Detailed Description *****\n+provides a wrapper for ALBERTA's macro_data structure\n+ Author\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00662_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00662_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: geometrycache.hh Source File\n+dune-grid: macrodata.hh Source File\n \n \n \n \n \n \n \n@@ -74,187 +74,518 @@\n \n \n
    \n
    \n-
    geometrycache.hh
    \n+
    macrodata.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH
    \n-
    6#define DUNE_ALBERTA_GEOMETRYCACHE_HH
    \n+
    5#ifndef DUNE_ALBERTA_MACRODATA_HH
    \n+
    6#define DUNE_ALBERTA_MACRODATA_HH
    \n
    7
    \n-\n-\n-
    10
    \n-
    11#if HAVE_ALBERTA
    \n-
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n+
    13#include <dune/common/fvector.hh>
    \n+
    14#include <dune/common/fmatrix.hh>
    \n
    15
    \n-
    16 namespace Alberta
    \n-
    17 {
    \n-
    18
    \n-
    19 // GeometryCache
    \n-
    20 // -------------
    \n+\n+\n+\n+
    19
    \n+
    20#if HAVE_ALBERTA
    \n
    21
    \n-
    22 template< int dim >
    \n-
    \n-\n-
    24 {
    \n-
    25 static const unsigned int flagIntegrationElement = (1 << 0);
    \n-
    26 static const unsigned int flagJacobianTransposed = (1 << 1);
    \n-
    27 static const unsigned int flagJacobianInverseTransposed = (1 << 2);
    \n-
    28
    \n-
    29 public:
    \n-
    30 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;
    \n-
    31 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;
    \n+
    22namespace Dune
    \n+
    23{
    \n+
    24
    \n+
    25 namespace Alberta
    \n+
    26 {
    \n+
    27
    \n+
    28 template< int dim >
    \n+
    \n+\n+
    30 {
    \n+
    31 typedef MacroData< dim > This;
    \n
    32
    \n-
    \n-\n-
    34 : flags_( 0 )
    \n-
    35 {}
    \n-
    \n-
    36
    \n-
    \n-
    37 const Real &integrationElement ( const ALBERTA EL_INFO &elInfo )
    \n-
    38 {
    \n-
    39 if( (flags_ & flagIntegrationElement) == 0 )
    \n-
    40 {
    \n-
    41 integrationElement_ = std::abs( determinant( jacobianTransposed( elInfo ) ) );
    \n-
    42 assert( integrationElement_ > 1e-14 );
    \n-
    43 flags_ |= flagIntegrationElement;
    \n-
    44 }
    \n-
    45 return integrationElement_;
    \n-
    46 }
    \n-
    \n-
    47
    \n-
    \n-
    48 const JacobianTransposed &jacobianTransposed ( const ALBERTA EL_INFO &elInfo )
    \n-
    49 {
    \n-
    50 if( (flags_ & flagJacobianTransposed) == 0 )
    \n-
    51 {
    \n-
    52 assert( (elInfo.fill_flag & FillFlags< dim >::coords) != 0 );
    \n-
    53 const GlobalVector &x = elInfo.coord[ 0 ];
    \n-
    54 for( int i = 0; i < dim; ++i )
    \n-
    55 {
    \n-
    56 const GlobalVector &y = elInfo.coord[ i+1 ];
    \n-
    57 for( int j = 0; j < dimWorld; ++j )
    \n-
    58 jacobianTransposed_[ i ][ j ] = y[ j ] - x[ j ];
    \n-
    59 }
    \n-
    60 flags_ |= flagJacobianTransposed;
    \n-
    61 }
    \n-
    62 return jacobianTransposed_;
    \n-
    63 }
    \n-
    \n-
    64
    \n-\n-
    \n-
    66 jacobianInverseTransposed ( const ALBERTA EL_INFO &elInfo )
    \n-
    67 {
    \n-
    68 if( (flags_ & flagJacobianInverseTransposed) == 0 )
    \n-
    69 {
    \n-
    70 integrationElement_ = std::abs( invert( jacobianTransposed( elInfo ), jacobianInverseTransposed_ ) );
    \n-
    71 assert( integrationElement_ > 1e-14 );
    \n-
    72 flags_ |= flagIntegrationElement | flagJacobianInverseTransposed;
    \n-
    73 }
    \n-
    74 return jacobianInverseTransposed_;
    \n-
    75 }
    \n-
    \n-
    76
    \n-
    77 private:
    \n-
    78 unsigned int flags_;
    \n-
    79 Real integrationElement_;
    \n-
    80 FieldMatrix< Real, dim, dimWorld > jacobianTransposed_;
    \n-
    81 FieldMatrix< Real, dimWorld, dim > jacobianInverseTransposed_;
    \n-
    82 };
    \n-
    \n+
    33 typedef ALBERTA MACRO_DATA Data;
    \n+
    34
    \n+
    35 static const int dimension = dim;
    \n+
    36 static const int numVertices = NumSubEntities< dimension, dimension >::value;
    \n+
    37 static const int numEdges = NumSubEntities< dimension, dimension-1 >::value;
    \n+
    38
    \n+
    39 static const int initialSize = 4096;
    \n+
    40
    \n+
    41 public:
    \n+
    42 template< int >
    \n+
    43 struct Library;
    \n+
    44
    \n+
    45 template< int > friend struct InstantiateMacroDataLibrary;
    \n+
    46
    \n+
    47 public:
    \n+
    48 typedef int ElementId[ numVertices ];
    \n+
    49
    \n+
    50 static const int supportPeriodicity = 1;
    \n+
    51
    \n+
    \n+\n+
    53 : data_( NULL ),
    \n+
    54 vertexCount_( -1 ),
    \n+
    55 elementCount_( -1 )
    \n+
    56 {}
    \n+
    \n+
    57
    \n+
    \n+
    58 operator Data * () const
    \n+
    59 {
    \n+
    60 return data_;
    \n+
    61 }
    \n+
    \n+
    62
    \n+
    \n+
    63 int vertexCount () const
    \n+
    64 {
    \n+
    65 return (vertexCount_ < 0 ? data_->n_total_vertices : vertexCount_);
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    \n+
    68 int elementCount () const
    \n+
    69 {
    \n+
    70 return (elementCount_ < 0 ? data_->n_macro_elements : elementCount_);
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    \n+
    73 ElementId &element ( int i ) const;
    \n+
    \n+
    74 GlobalVector &vertex ( int i ) const;
    \n+
    \n+
    75 int &neighbor ( int element, int i ) const;
    \n+
    \n+
    76 BoundaryId &boundaryId ( int element, int i ) const;
    \n+
    77
    \n+
    \n+
    82 void create ();
    \n
    83
    \n-
    84
    \n-
    85
    \n-
    86 // GeometryCacheProxy
    \n-
    87 // ------------------
    \n-
    88
    \n-
    89 template< int dim >
    \n-
    \n-\n-
    91 {
    \n-
    92 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;
    \n-
    93 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;
    \n-
    94
    \n-
    \n-
    95 GeometryCacheProxy ( GeometryCache< dim > &geometryCache, const ALBERTA EL_INFO &elInfo )
    \n-
    96 : geometryCache_( geometryCache ),
    \n-
    97 elInfo_( elInfo )
    \n-
    98 {}
    \n-
    \n-
    99
    \n-
    \n-\n-
    101 {
    \n-
    102 return geometryCache_.integrationElement( elInfo_ );
    \n-
    103 }
    \n-
    \n-
    104
    \n-
    \n-\n-
    106 {
    \n-
    107 return geometryCache_.jacobianTransposed( elInfo_ );
    \n-
    108 }
    \n-
    \n-
    109
    \n-
    \n-\n-
    111 {
    \n-
    112 return geometryCache_.jacobianInverseTransposed( elInfo_ );
    \n-
    113 }
    \n-
    \n-
    114
    \n-
    115 private:
    \n-
    116 GeometryCache< dim > &geometryCache_;
    \n-
    117 const ALBERTA EL_INFO &elInfo_;
    \n-
    118 };
    \n-
    \n-
    119
    \n-
    120 } // namespace Alberta
    \n-
    121
    \n-
    122} // namespace Dune
    \n-
    123
    \n-
    124#endif // #if HAVE_ALBERTA
    \n+
    \n+
    92 void finalize ();
    \n+
    93
    \n+
    \n+\n+
    103
    \n+
    \n+
    112 void setOrientation ( const Real orientation );
    \n+
    113
    \n+
    \n+
    124 bool checkNeighbors () const;
    \n
    125
    \n-
    126#endif // #ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH
    \n-\n-\n+
    \n+
    127 void release ()
    \n+
    128 {
    \n+
    129 if( data_ != NULL )
    \n+
    130 {
    \n+
    131 ALBERTA free_macro_data( data_ );
    \n+
    132 data_ = NULL;
    \n+
    133 }
    \n+
    134 vertexCount_ = elementCount_ = -1;
    \n+
    135 }
    \n+
    \n+
    136
    \n+
    \n+
    142 int insertElement ( const ElementId &id );
    \n+
    143
    \n+
    \n+
    149 int insertVertex ( const GlobalVector &coords )
    \n+
    150 {
    \n+
    151 assert( vertexCount_ >= 0 );
    \n+
    152 if( vertexCount_ >= data_->n_total_vertices )
    \n+
    153 resizeVertices( 2*vertexCount_ );
    \n+
    154 copy( coords, vertex( vertexCount_ ) );
    \n+
    155 return vertexCount_++;
    \n+
    156 }
    \n+
    \n+
    157
    \n+
    \n+
    163 int insertVertex ( const FieldVector< Real, dimWorld > &coords )
    \n+
    164 {
    \n+
    165 assert( vertexCount_ >= 0 );
    \n+
    166 if( vertexCount_ >= data_->n_total_vertices )
    \n+
    167 resizeVertices( 2*vertexCount_ );
    \n+
    168 copy( coords, vertex( vertexCount_ ) );
    \n+
    169 return vertexCount_++;
    \n+
    170 }
    \n+
    \n+
    171
    \n+
    \n+
    172 void insertWallTrafo ( const GlobalMatrix &m, const GlobalVector &t );
    \n+
    \n+
    173 void insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld > &matrix,
    \n+
    174 const FieldVector< Real, dimWorld > &shift );
    \n+
    175
    \n+
    \n+
    176 void checkCycles ();
    \n+
    177
    \n+
    \n+
    178 void read ( const std::string &filename, bool binary = false );
    \n+
    179
    \n+
    \n+
    180 bool write ( const std::string &filename, bool binary = false ) const
    \n+
    181 {
    \n+
    182 if( binary )
    \n+
    183 return ALBERTA write_macro_data_xdr( data_, filename.c_str() );
    \n+
    184 else
    \n+
    185 return ALBERTA write_macro_data( data_, filename.c_str() );
    \n+
    186 }
    \n+
    \n+
    187
    \n+
    188 private:
    \n+
    189 template< class Vector >
    \n+
    190 void copy ( const Vector &x, GlobalVector &y )
    \n+
    191 {
    \n+
    192 for( int i = 0; i < dimWorld; ++i )
    \n+
    193 y[ i ] = x[ i ];
    \n+
    194 }
    \n+
    195
    \n+
    196 void resizeElements ( const int newSize );
    \n+
    197
    \n+
    198 void resizeVertices ( const int newSize )
    \n+
    199 {
    \n+
    200 const int oldSize = data_->n_total_vertices;
    \n+
    201 data_->n_total_vertices = newSize;
    \n+
    202 data_->coords = memReAlloc< GlobalVector >( data_->coords, oldSize, newSize );
    \n+
    203 assert( (data_->coords != NULL) || (newSize == 0) );
    \n+
    204 }
    \n+
    205
    \n+
    206 private:
    \n+
    207 Data *data_;
    \n+
    208 int vertexCount_;
    \n+
    209 int elementCount_;
    \n+
    210 };
    \n+
    211
    \n+
    212
    \n+
    213
    \n+
    214 // MacroData::Library
    \n+
    215 // ------------------
    \n+
    216
    \n+
    217 template< int dim >
    \n+
    218 template< int >
    \n+
    \n+
    219 struct MacroData< dim >::Library
    \n+
    220 {
    \n+\n+
    222
    \n+
    223 static bool checkNeighbors ( const MacroData &macroData );
    \n+
    224 static void markLongestEdge ( MacroData &macroData );
    \n+
    225 static void setOrientation ( [[maybe_unused]] MacroData &macroData,
    \n+
    226 [[maybe_unused]] const Real orientation );
    \n+
    227
    \n+
    228 private:
    \n+
    229 static Real edgeLength ( const MacroData &macroData, const ElementId &e, int edge );
    \n+
    230 static int longestEdge ( const MacroData &macroData, const ElementId &e );
    \n+
    231
    \n+
    232 template< class Type >
    \n+
    233 static void rotate ( Type *array, int i, int shift );
    \n+
    234
    \n+
    235 static void rotate ( MacroData &macroData, int i, int shift );
    \n+
    236 static void swap ( MacroData &macroData, int el, int v1, int v2 );
    \n+
    237 };
    \n+
    \n+
    238
    \n+
    239
    \n+
    240
    \n+
    241 // Implementation of MacroData
    \n+
    242 // ---------------------------
    \n+
    243
    \n+
    244 template< int dim >
    \n+
    245 inline typename MacroData< dim >::ElementId &
    \n+
    \n+\n+
    247 {
    \n+
    248 assert( (i >= 0) && (i < data_->n_macro_elements) );
    \n+
    249 const int offset = i * numVertices;
    \n+
    250 return *reinterpret_cast< ElementId * >( data_->mel_vertices + offset );
    \n+
    251 }
    \n+
    \n+
    252
    \n+
    253
    \n+
    254 template< int dim >
    \n+
    \n+\n+
    256 {
    \n+
    257 assert( (i >= 0) && (i < data_->n_total_vertices) );
    \n+
    258 return data_->coords[ i ];
    \n+
    259 }
    \n+
    \n+
    260
    \n+
    261
    \n+
    262 template< int dim >
    \n+
    \n+
    263 inline int &MacroData< dim >::neighbor ( int element, int i ) const
    \n+
    264 {
    \n+
    265 assert( (element >= 0) && (element < data_->n_macro_elements) );
    \n+
    266 assert( (i >= 0) && (i < numVertices) );
    \n+
    267 return data_->neigh[ element*numVertices + i ];
    \n+
    268 }
    \n+
    \n+
    269
    \n+
    270
    \n+
    271 template< int dim >
    \n+
    \n+
    272 inline BoundaryId &MacroData< dim >::boundaryId ( int element, int i ) const
    \n+
    273 {
    \n+
    274 assert( (element >= 0) && (element < data_->n_macro_elements) );
    \n+
    275 assert( (i >= 0) && (i < numVertices) );
    \n+
    276 return data_->boundary[ element*numVertices + i ];
    \n+
    277 }
    \n+
    \n+
    278
    \n+
    279
    \n+
    280 template< int dim >
    \n+
    \n+\n+
    282 {
    \n+
    283 release();
    \n+
    284 data_ = ALBERTA alloc_macro_data( dim, initialSize, initialSize );
    \n+
    285 data_->boundary = memAlloc< BoundaryId >( initialSize*numVertices );
    \n+
    286 if( dim == 3 )
    \n+
    287 data_->el_type = memAlloc< ElementType >( initialSize );
    \n+
    288 vertexCount_ = elementCount_ = 0;
    \n+
    289 elementCount_ = 0;
    \n+
    290 }
    \n+
    \n+
    291
    \n+
    292
    \n+
    293 template< int dim >
    \n+
    \n+\n+
    295 {
    \n+
    296 if( (vertexCount_ >= 0) && (elementCount_ >= 0) )
    \n+
    297 {
    \n+
    298 resizeVertices( vertexCount_ );
    \n+
    299 resizeElements( elementCount_ );
    \n+
    300 ALBERTA compute_neigh_fast( data_ );
    \n+
    301
    \n+
    302 // assign default boundary id (if none is assigned)
    \n+
    303 for( int element = 0; element < elementCount_; ++element )
    \n+
    304 {
    \n+
    305 for( int i = 0; i < numVertices; ++i )
    \n+
    306 {
    \n+
    307 BoundaryId &id = boundaryId( element, i );
    \n+
    308 if( neighbor( element, i ) >= 0 )
    \n+
    309 {
    \n+
    310 assert( id == InteriorBoundary );
    \n+
    311 id = InteriorBoundary;
    \n+
    312 }
    \n+
    313 else
    \n+
    314 id = (id == InteriorBoundary ? DirichletBoundary : id);
    \n+
    315 }
    \n+
    316 }
    \n+
    317
    \n+
    318 vertexCount_ = elementCount_ = -1;
    \n+
    319 }
    \n+
    320 assert( (vertexCount_ < 0) && (elementCount_ < 0) );
    \n+
    321 }
    \n+
    \n+
    322
    \n+
    323
    \n+
    324 template< int dim >
    \n+
    \n+\n+
    326 {
    \n+\n+
    328 }
    \n+
    \n+
    329
    \n+
    330
    \n+
    331 template< int dim >
    \n+
    \n+
    332 inline void MacroData< dim >::setOrientation ( const Real orientation )
    \n+
    333 {
    \n+
    334 Library< dimWorld >::setOrientation( *this, orientation );
    \n+
    335 }
    \n+
    \n+
    336
    \n+
    337
    \n+
    338 template< int dim >
    \n+
    \n+\n+
    340 {
    \n+\n+
    342 }
    \n+
    \n+
    343
    \n+
    344
    \n+
    345 template< int dim >
    \n+
    \n+
    346 inline int MacroData< dim >::insertElement ( const ElementId &id )
    \n+
    347 {
    \n+
    348 assert( elementCount_ >= 0 );
    \n+
    349 if( elementCount_ >= data_->n_macro_elements )
    \n+
    350 resizeElements( 2*elementCount_ );
    \n+
    351
    \n+
    352 ElementId &e = element( elementCount_ );
    \n+
    353 for( int i = 0; i < numVertices; ++i )
    \n+
    354 {
    \n+
    355 e[ i ] = id[ i ];
    \n+
    356 boundaryId( elementCount_, i ) = InteriorBoundary;
    \n+
    357 }
    \n+
    358 if( dim == 3 )
    \n+
    359 data_->el_type[ elementCount_ ] = 0;
    \n+
    360
    \n+
    361 return elementCount_++;
    \n+
    362 }
    \n+
    \n+
    363
    \n+
    364
    \n+
    365 template< int dim >
    \n+
    366 inline void MacroData< dim >
    \n+
    \n+
    367 ::insertWallTrafo ( const GlobalMatrix &matrix, const GlobalVector &shift )
    \n+
    368 {
    \n+
    369 int &count = data_->n_wall_trafos;
    \n+
    370 AffineTransformation *&array = data_->wall_trafos;
    \n+
    371
    \n+
    372 // resize wall trafo array
    \n+
    373 array = memReAlloc< AffineTransformation >( array, count, count+1 );
    \n+
    374 assert( data_->wall_trafos != NULL );
    \n+
    375
    \n+
    376 // copy matrix and shift
    \n+
    377 for( int i = 0; i < dimWorld; ++i )
    \n+
    378 copy( matrix[ i ], array[ count ].M[ i ] );
    \n+
    379 copy( shift, array[ count ].t );
    \n+
    380 ++count;
    \n+
    381 }
    \n+
    \n+
    382
    \n+
    383 template< int dim >
    \n+
    384 inline void MacroData< dim >
    \n+
    \n+
    385 ::insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld > &matrix,
    \n+
    386 const FieldVector< Real, dimWorld > &shift )
    \n+
    387 {
    \n+
    388 int &count = data_->n_wall_trafos;
    \n+
    389 AffineTransformation *&array = data_->wall_trafos;
    \n+
    390
    \n+
    391 // resize wall trafo array
    \n+
    392 array = memReAlloc< AffineTransformation >( array, count, count+1 );
    \n+
    393 assert( data_->wall_trafos != NULL );
    \n+
    394
    \n+
    395 // copy matrix and shift
    \n+
    396 for( int i = 0; i < dimWorld; ++i )
    \n+
    397 copy( matrix[ i ], array[ count ].M[ i ] );
    \n+
    398 copy( shift, array[ count ].t );
    \n+
    399 ++count;
    \n+
    400 }
    \n+
    \n+
    401
    \n+
    402
    \n+
    403 template< int dim >
    \n+
    \n+\n+
    405 {
    \n+
    406 // ensure that the macro data has been finalized
    \n+
    407 finalize();
    \n+
    408 ALBERTA macro_test( data_, NULL );
    \n+
    409 }
    \n+
    \n+
    410
    \n+
    411
    \n+
    412 template< int dim >
    \n+
    \n+
    413 inline void MacroData< dim >::read ( const std::string &filename, bool binary )
    \n+
    414 {
    \n+
    415 release();
    \n+
    416 if( binary )
    \n+
    417 data_ = ALBERTA read_macro_xdr( filename.c_str() );
    \n+
    418 else
    \n+
    419 data_ = ALBERTA read_macro( filename.c_str() );
    \n+
    420 }
    \n+
    \n+
    \n+
    421
    \n+
    422
    \n+
    423 template< int dim >
    \n+
    424 inline void MacroData< dim >::resizeElements ( const int newSize )
    \n+
    425 {
    \n+
    426 const int oldSize = data_->n_macro_elements;
    \n+
    427 data_->n_macro_elements = newSize;
    \n+
    428 data_->mel_vertices = memReAlloc( data_->mel_vertices, oldSize*numVertices, newSize*numVertices );
    \n+
    429 data_->boundary = memReAlloc( data_->boundary, oldSize*numVertices, newSize*numVertices );
    \n+
    430 if( dim == 3 )
    \n+
    431 data_->el_type = memReAlloc( data_->el_type, oldSize, newSize );
    \n+
    432 assert( (newSize == 0) || (data_->mel_vertices != NULL) );
    \n+
    433 }
    \n+
    434
    \n+
    435 }
    \n+
    436
    \n+
    437}
    \n+
    438
    \n+
    439#endif // #if HAVE_ALBERTA
    \n+
    440
    \n+
    441#endif
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+\n+\n+\n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n+
    ALBERTA REAL_DD GlobalMatrix
    Definition misc.hh:51
    \n+
    ALBERTA AFF_TRAFO AffineTransformation
    Definition misc.hh:52
    \n+
    ALBERTA BNDRY_TYPE BoundaryId
    Definition misc.hh:61
    \n+
    static const int InteriorBoundary
    Definition misc.hh:59
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n-
    static K determinant(const FieldMatrix< K, 0, m > &matrix)
    Definition algebra.hh:30
    \n-
    static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 > &inverse)
    Definition algebra.hh:81
    \n+
    Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)
    Definition misc.hh:85
    \n+
    static const int DirichletBoundary
    Definition misc.hh:60
    \n
    static const int dimWorld
    Definition misc.hh:46
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition geometrycache.hh:24
    \n-
    GeometryCache()
    Definition geometrycache.hh:33
    \n-
    const Real & integrationElement(const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:37
    \n-
    FieldMatrix< Real, dim, dimWorld > JacobianTransposed
    Definition geometrycache.hh:31
    \n-
    const JacobianTransposed & jacobianTransposed(const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:48
    \n-
    const JacobianInverseTransposed & jacobianInverseTransposed(const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:66
    \n-
    FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed
    Definition geometrycache.hh:30
    \n-
    Definition geometrycache.hh:91
    \n-
    const JacobianTransposed & jacobianTransposed()
    Definition geometrycache.hh:105
    \n-
    FieldMatrix< Real, dim, dimWorld > JacobianTransposed
    Definition geometrycache.hh:93
    \n-
    FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed
    Definition geometrycache.hh:92
    \n-
    const Real & integrationElement()
    Definition geometrycache.hh:100
    \n-
    GeometryCacheProxy(GeometryCache< dim > &geometryCache, const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:95
    \n-
    const JacobianInverseTransposed & jacobianInverseTransposed()
    Definition geometrycache.hh:110
    \n-
    Definition misc.hh:231
    \n+
    Definition macrodata.hh:30
    \n+
    friend struct InstantiateMacroDataLibrary
    Definition macrodata.hh:45
    \n+
    BoundaryId & boundaryId(int element, int i) const
    Definition macrodata.hh:272
    \n+
    int insertVertex(const GlobalVector &coords)
    insert vertex
    Definition macrodata.hh:149
    \n+
    int ElementId[numVertices]
    Definition macrodata.hh:48
    \n+
    static const int supportPeriodicity
    Definition macrodata.hh:50
    \n+
    void release()
    release the macro data structure
    Definition macrodata.hh:127
    \n+
    int elementCount() const
    Definition macrodata.hh:68
    \n+
    GlobalVector & vertex(int i) const
    Definition macrodata.hh:255
    \n+
    int vertexCount() const
    Definition macrodata.hh:63
    \n+
    void markLongestEdge()
    mark the longest edge of all elements as refinement edges
    Definition macrodata.hh:325
    \n+
    int insertVertex(const FieldVector< Real, dimWorld > &coords)
    insert vertex
    Definition macrodata.hh:163
    \n+
    bool checkNeighbors() const
    check the neighbor information
    Definition macrodata.hh:339
    \n+
    void insertWallTrafo(const FieldMatrix< Real, dimWorld, dimWorld > &matrix, const FieldVector< Real, dimWorld > &shift)
    Definition macrodata.hh:385
    \n+
    ElementId & element(int i) const
    Definition macrodata.hh:246
    \n+
    void checkCycles()
    Definition macrodata.hh:404
    \n+
    int & neighbor(int element, int i) const
    Definition macrodata.hh:263
    \n+
    MacroData()
    Definition macrodata.hh:52
    \n+
    void finalize()
    compress macro data structure
    Definition macrodata.hh:294
    \n+
    void insertWallTrafo(const GlobalMatrix &m, const GlobalVector &t)
    Definition macrodata.hh:367
    \n+
    void setOrientation(const Real orientation)
    set the orientation of all elements
    Definition macrodata.hh:332
    \n+
    void create()
    create a new macro data structure
    Definition macrodata.hh:281
    \n+
    int insertElement(const ElementId &id)
    insert element
    Definition macrodata.hh:346
    \n+
    bool write(const std::string &filename, bool binary=false) const
    Definition macrodata.hh:180
    \n+
    void read(const std::string &filename, bool binary=false)
    Definition macrodata.hh:413
    \n+
    Definition macrodata.hh:220
    \n+
    static void markLongestEdge(MacroData &macroData)
    \n+
    Alberta::MacroData< dim > MacroData
    Definition macrodata.hh:221
    \n+
    Definition misc.hh:148
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,210 +1,531 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-geometrycache.hh\n+macrodata.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH\n-6#define DUNE_ALBERTA_GEOMETRYCACHE_HH\n+5#ifndef DUNE_ALBERTA_MACRODATA_HH\n+6#define DUNE_ALBERTA_MACRODATA_HH\n 7\n-8#include \n-9#include \n-10\n-11#if HAVE_ALBERTA\n-12\n-13namespace Dune\n-14{\n+13#include \n+14#include \n 15\n-16 namespace Alberta\n-17 {\n-18\n-19 // GeometryCache\n-20 // -------------\n+16#include \n+17#include \n+18#include \n+19\n+20#if HAVE_ALBERTA\n 21\n-22 template< int dim >\n-23 class GeometryCache\n-24 {\n-25 static const unsigned int flagIntegrationElement = (1 << 0);\n-26 static const unsigned int flagJacobianTransposed = (1 << 1);\n-27 static const unsigned int flagJacobianInverseTransposed = (1 << 2);\n-28\n-29 public:\n-30 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;\n-31 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;\n+22namespace Dune\n+23{\n+24\n+25 namespace Alberta\n+26 {\n+27\n+28 template< int dim >\n+29 class MacroData\n+30 {\n+31 typedef MacroData<_dim_> This;\n 32\n-33 GeometryCache ()\n-34 : flags_( 0 )\n-35 {}\n-36\n-37 const Real &integrationElement ( const ALBERTA EL_INFO &elInfo )\n-38 {\n-39 if( (flags_ & flagIntegrationElement) == 0 )\n-40 {\n-41 integrationElement_ = std::abs( determinant( jacobianTransposed( elInfo ) )\n-);\n-42 assert( integrationElement_ > 1e-14 );\n-43 flags_ |= flagIntegrationElement;\n-44 }\n-45 return integrationElement_;\n-46 }\n-47\n-48 const JacobianTransposed &jacobianTransposed ( const ALBERTA EL_INFO &elInfo\n-)\n-49 {\n-50 if( (flags_ & flagJacobianTransposed) == 0 )\n-51 {\n-52 assert( (elInfo.fill_flag & FillFlags<_dim_>::coords) != 0 );\n-53 const GlobalVector &x = elInfo.coord[ 0 ];\n-54 for( int i = 0; i < dim; ++i )\n-55 {\n-56 const GlobalVector &y = elInfo.coord[ i+1 ];\n-57 for( int j = 0; j < dimWorld; ++j )\n-58 jacobianTransposed_[ i ][ j ] = y[ j ] - x[ j ];\n-59 }\n-60 flags_ |= flagJacobianTransposed;\n+33 typedef ALBERTA MACRO_DATA Data;\n+34\n+35 static const int dimension = dim;\n+36 static const int numVertices = NumSubEntities<_dimension,_dimension_>::\n+value;\n+37 static const int numEdges = NumSubEntities< dimension, dimension-1 >::value;\n+38\n+39 static const int initialSize = 4096;\n+40\n+41 public:\n+42 template< int >\n+43 struct Library;\n+44\n+45 template< int > friend struct InstantiateMacroDataLibrary;\n+46\n+47 public:\n+48 typedef int ElementId[ numVertices ];\n+49\n+50 static const int supportPeriodicity = 1;\n+51\n+52 MacroData ()\n+53 : data_( NULL ),\n+54 vertexCount_( -1 ),\n+55 elementCount_( -1 )\n+56 {}\n+57\n+58 operator Data * () const\n+59 {\n+60 return data_;\n 61 }\n-62 return jacobianTransposed_;\n-63 }\n-64\n-65 const JacobianInverseTransposed &\n-66 jacobianInverseTransposed ( const ALBERTA EL_INFO &elInfo )\n-67 {\n-68 if( (flags_ & flagJacobianInverseTransposed) == 0 )\n+62\n+63 int vertexCount () const\n+64 {\n+65 return (vertexCount_ < 0 ? data_->n_total_vertices : vertexCount_);\n+66 }\n+67\n+68 int elementCount () const\n 69 {\n-70 integrationElement_ = std::abs( invert( jacobianTransposed( elInfo ),\n-jacobianInverseTransposed_ ) );\n-71 assert( integrationElement_ > 1e-14 );\n-72 flags_ |= flagIntegrationElement | flagJacobianInverseTransposed;\n-73 }\n-74 return jacobianInverseTransposed_;\n-75 }\n-76\n-77 private:\n-78 unsigned int flags_;\n-79 Real integrationElement_;\n-80 FieldMatrix< Real, dim, dimWorld > jacobianTransposed_;\n-81 FieldMatrix< Real, dimWorld, dim > jacobianInverseTransposed_;\n-82 };\n+70 return (elementCount_ < 0 ? data_->n_macro_elements : elementCount_);\n+71 }\n+72\n+73 ElementId &element ( int i ) const;\n+74 GlobalVector &vertex ( int i ) const;\n+75 int &neighbor ( int element, int i ) const;\n+76 BoundaryId &boundaryId ( int element, int i ) const;\n+77\n+82 void create ();\n 83\n-84\n-85\n-86 // GeometryCacheProxy\n-87 // ------------------\n-88\n-89 template< int dim >\n-90 struct GeometryCacheProxy\n-91 {\n-92 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;\n-93 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;\n-94\n-95 GeometryCacheProxy ( GeometryCache<_dim_> &geometryCache, const ALBERTA EL_\n-INFO &elInfo )\n-96 : geometryCache_( geometryCache ),\n-97 elInfo_( elInfo )\n-98 {}\n-99\n-100 const Real &integrationElement ()\n-101 {\n-102 return geometryCache_.integrationElement( elInfo_ );\n-103 }\n-104\n-105 const JacobianTransposed &jacobianTransposed ()\n-106 {\n-107 return geometryCache_.jacobianTransposed( elInfo_ );\n-108 }\n-109\n-110 const JacobianInverseTransposed &jacobianInverseTransposed ()\n-111 {\n-112 return geometryCache_.jacobianInverseTransposed( elInfo_ );\n-113 }\n-114\n-115 private:\n-116 GeometryCache<_dim_> &geometryCache_;\n-117 const ALBERTA EL_INFO &elInfo_;\n-118 };\n-119\n-120 } // namespace Alberta\n-121\n-122} // namespace Dune\n-123\n-124#endif // #if HAVE_ALBERTA\n+92 void finalize ();\n+93\n+102 void markLongestEdge ();\n+103\n+112 void setOrientation ( const Real orientation );\n+113\n+124 bool checkNeighbors () const;\n 125\n-126#endif // #ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH\n-misc.hh\n+127 void release ()\n+128 {\n+129 if( data_ != NULL )\n+130 {\n+131 ALBERTA free_macro_data( data_ );\n+132 data_ = NULL;\n+133 }\n+134 vertexCount_ = elementCount_ = -1;\n+135 }\n+136\n+142 int insertElement ( const ElementId &id );\n+143\n+149 int insertVertex ( const GlobalVector &coords )\n+150 {\n+151 assert( vertexCount_ >= 0 );\n+152 if( vertexCount_ >= data_->n_total_vertices )\n+153 resizeVertices( 2*vertexCount_ );\n+154 copy( coords, vertex( vertexCount_ ) );\n+155 return vertexCount_++;\n+156 }\n+157\n+163 int insertVertex ( const FieldVector< Real, dimWorld > &coords )\n+164 {\n+165 assert( vertexCount_ >= 0 );\n+166 if( vertexCount_ >= data_->n_total_vertices )\n+167 resizeVertices( 2*vertexCount_ );\n+168 copy( coords, vertex( vertexCount_ ) );\n+169 return vertexCount_++;\n+170 }\n+171\n+172 void insertWallTrafo ( const GlobalMatrix &m, const GlobalVector &t );\n+173 void insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld >\n+&matrix,\n+174 const FieldVector< Real, dimWorld > &shift );\n+175\n+176 void checkCycles ();\n+177\n+178 void read ( const std::string &filename, bool binary = false );\n+179\n+180 bool write ( const std::string &filename, bool binary = false ) const\n+181 {\n+182 if( binary )\n+183 return ALBERTA write_macro_data_xdr( data_, filename.c_str() );\n+184 else\n+185 return ALBERTA write_macro_data( data_, filename.c_str() );\n+186 }\n+187\n+188 private:\n+189 template< class Vector >\n+190 void copy ( const Vector &x, GlobalVector &y )\n+191 {\n+192 for( int i = 0; i < dimWorld; ++i )\n+193 y[ i ] = x[ i ];\n+194 }\n+195\n+196 void resizeElements ( const int newSize );\n+197\n+198 void resizeVertices ( const int newSize )\n+199 {\n+200 const int oldSize = data_->n_total_vertices;\n+201 data_->n_total_vertices = newSize;\n+202 data_->coords = memReAlloc< GlobalVector >( data_->coords, oldSize, newSize\n+);\n+203 assert( (data_->coords != NULL) || (newSize == 0) );\n+204 }\n+205\n+206 private:\n+207 Data *data_;\n+208 int vertexCount_;\n+209 int elementCount_;\n+210 };\n+211\n+212\n+213\n+214 // MacroData::Library\n+215 // ------------------\n+216\n+217 template< int dim >\n+218 template< int >\n+219 struct MacroData< dim >::Library\n+220 {\n+221 typedef Alberta::MacroData<_dim_> MacroData;\n+222\n+223 static bool checkNeighbors ( const MacroData ¯oData );\n+224 static void markLongestEdge ( MacroData ¯oData );\n+225 static void setOrientation ( [[maybe_unused]] MacroData ¯oData,\n+226 [[maybe_unused]] const Real orientation );\n+227\n+228 private:\n+229 static Real edgeLength ( const MacroData ¯oData, const ElementId &e,\n+int edge );\n+230 static int longestEdge ( const MacroData ¯oData, const ElementId &e );\n+231\n+232 template< class Type >\n+233 static void rotate ( Type *array, int i, int shift );\n+234\n+235 static void rotate ( MacroData ¯oData, int i, int shift );\n+236 static void swap ( MacroData ¯oData, int el, int v1, int v2 );\n+237 };\n+238\n+239\n+240\n+241 // Implementation of MacroData\n+242 // ---------------------------\n+243\n+244 template< int dim >\n+245 inline typename MacroData<_dim_>::ElementId &\n+246 MacroData<_dim_>::element ( int i ) const\n+247 {\n+248 assert( (i >= 0) && (i < data_->n_macro_elements) );\n+249 const int offset = i * numVertices;\n+250 return *reinterpret_cast< ElementId * >( data_->mel_vertices + offset );\n+251 }\n+252\n+253\n+254 template< int dim >\n+255 inline GlobalVector &MacroData<_dim_>::vertex ( int i ) const\n+256 {\n+257 assert( (i >= 0) && (i < data_->n_total_vertices) );\n+258 return data_->coords[ i ];\n+259 }\n+260\n+261\n+262 template< int dim >\n+263 inline int &MacroData<_dim_>::neighbor ( int element, int i ) const\n+264 {\n+265 assert( (element >= 0) && (element < data_->n_macro_elements) );\n+266 assert( (i >= 0) && (i < numVertices) );\n+267 return data_->neigh[ element*numVertices + i ];\n+268 }\n+269\n+270\n+271 template< int dim >\n+272 inline BoundaryId &MacroData<_dim_>::boundaryId ( int element, int i )\n+const\n+273 {\n+274 assert( (element >= 0) && (element < data_->n_macro_elements) );\n+275 assert( (i >= 0) && (i < numVertices) );\n+276 return data_->boundary[ element*numVertices + i ];\n+277 }\n+278\n+279\n+280 template< int dim >\n+281 inline void MacroData<_dim_>::create ()\n+282 {\n+283 release();\n+284 data_ = ALBERTA alloc_macro_data( dim, initialSize, initialSize );\n+285 data_->boundary = memAlloc< BoundaryId >( initialSize*numVertices );\n+286 if( dim == 3 )\n+287 data_->el_type = memAlloc< ElementType >( initialSize );\n+288 vertexCount_ = elementCount_ = 0;\n+289 elementCount_ = 0;\n+290 }\n+291\n+292\n+293 template< int dim >\n+294 inline void MacroData<_dim_>::finalize ()\n+295 {\n+296 if( (vertexCount_ >= 0) && (elementCount_ >= 0) )\n+297 {\n+298 resizeVertices( vertexCount_ );\n+299 resizeElements( elementCount_ );\n+300 ALBERTA compute_neigh_fast( data_ );\n+301\n+302 // assign default boundary id (if none is assigned)\n+303 for( int element = 0; element < elementCount_; ++element )\n+304 {\n+305 for( int i = 0; i < numVertices; ++i )\n+306 {\n+307 BoundaryId &id = boundaryId( element, i );\n+308 if( neighbor( element, i ) >= 0 )\n+309 {\n+310 assert( id == InteriorBoundary );\n+311 id = InteriorBoundary;\n+312 }\n+313 else\n+314 id = (id == InteriorBoundary ? DirichletBoundary : id);\n+315 }\n+316 }\n+317\n+318 vertexCount_ = elementCount_ = -1;\n+319 }\n+320 assert( (vertexCount_ < 0) && (elementCount_ < 0) );\n+321 }\n+322\n+323\n+324 template< int dim >\n+325 inline void MacroData<_dim_>::markLongestEdge ()\n+326 {\n+327 Library<_dimWorld_>::markLongestEdge( *this );\n+328 }\n+329\n+330\n+331 template< int dim >\n+332 inline void MacroData<_dim_>::setOrientation ( const Real orientation )\n+333 {\n+334 Library<_dimWorld_>::setOrientation( *this, orientation );\n+335 }\n+336\n+337\n+338 template< int dim >\n+339 inline bool MacroData<_dim_>::checkNeighbors () const\n+340 {\n+341 return Library<_dimWorld_>::checkNeighbors( *this );\n+342 }\n+343\n+344\n+345 template< int dim >\n+346 inline int MacroData<_dim_>::insertElement ( const ElementId &id )\n+347 {\n+348 assert( elementCount_ >= 0 );\n+349 if( elementCount_ >= data_->n_macro_elements )\n+350 resizeElements( 2*elementCount_ );\n+351\n+352 ElementId &e = element( elementCount_ );\n+353 for( int i = 0; i < numVertices; ++i )\n+354 {\n+355 e[ i ] = id[ i ];\n+356 boundaryId( elementCount_, i ) = InteriorBoundary;\n+357 }\n+358 if( dim == 3 )\n+359 data_->el_type[ elementCount_ ] = 0;\n+360\n+361 return elementCount_++;\n+362 }\n+363\n+364\n+365 template< int dim >\n+366 inline void MacroData<_dim_>\n+367_::insertWallTrafo ( const GlobalMatrix &matrix, const GlobalVector &shift )\n+368 {\n+369 int &count = data_->n_wall_trafos;\n+370 AffineTransformation *&array = data_->wall_trafos;\n+371\n+372 // resize wall trafo array\n+373 array = memReAlloc< AffineTransformation >( array, count, count+1 );\n+374 assert( data_->wall_trafos != NULL );\n+375\n+376 // copy matrix and shift\n+377 for( int i = 0; i < dimWorld; ++i )\n+378 copy( matrix[ i ], array[ count ].M[ i ] );\n+379 copy( shift, array[ count ].t );\n+380 ++count;\n+381 }\n+382\n+383 template< int dim >\n+384 inline void MacroData<_dim_>\n+385_::insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld > &matrix,\n+386 const FieldVector< Real, dimWorld > &shift )\n+387 {\n+388 int &count = data_->n_wall_trafos;\n+389 AffineTransformation *&array = data_->wall_trafos;\n+390\n+391 // resize wall trafo array\n+392 array = memReAlloc< AffineTransformation >( array, count, count+1 );\n+393 assert( data_->wall_trafos != NULL );\n+394\n+395 // copy matrix and shift\n+396 for( int i = 0; i < dimWorld; ++i )\n+397 copy( matrix[ i ], array[ count ].M[ i ] );\n+398 copy( shift, array[ count ].t );\n+399 ++count;\n+400 }\n+401\n+402\n+403 template< int dim >\n+404 inline void MacroData<_dim_>::checkCycles ()\n+405 {\n+406 // ensure that the macro data has been finalized\n+407 finalize();\n+408 ALBERTA macro_test( data_, NULL );\n+409 }\n+410\n+411\n+412 template< int dim >\n+413 inline void MacroData<_dim_>::read ( const std::string &filename, bool\n+binary )\n+414 {\n+415 release();\n+416 if( binary )\n+417 data_ = ALBERTA read_macro_xdr( filename.c_str() );\n+418 else\n+419 data_ = ALBERTA read_macro( filename.c_str() );\n+420 }\n+421\n+422\n+423 template< int dim >\n+424 inline void MacroData<_dim_>::resizeElements ( const int newSize )\n+425 {\n+426 const int oldSize = data_->n_macro_elements;\n+427 data_->n_macro_elements = newSize;\n+428 data_->mel_vertices = memReAlloc( data_->mel_vertices, oldSize*numVertices,\n+newSize*numVertices );\n+429 data_->boundary = memReAlloc( data_->boundary, oldSize*numVertices,\n+newSize*numVertices );\n+430 if( dim == 3 )\n+431 data_->el_type = memReAlloc( data_->el_type, oldSize, newSize );\n+432 assert( (newSize == 0) || (data_->mel_vertices != NULL) );\n+433 }\n+434\n+435 }\n+436\n+437}\n+438\n+439#endif // #if HAVE_ALBERTA\n+440\n+441#endif\n algebra.hh\n+misc.hh\n+albertaheader.hh\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n+Dune::Alberta::GlobalMatrix\n+ALBERTA REAL_DD GlobalMatrix\n+Definition misc.hh:51\n+Dune::Alberta::AffineTransformation\n+ALBERTA AFF_TRAFO AffineTransformation\n+Definition misc.hh:52\n+Dune::Alberta::BoundaryId\n+ALBERTA BNDRY_TYPE BoundaryId\n+Definition misc.hh:61\n+Dune::Alberta::InteriorBoundary\n+static const int InteriorBoundary\n+Definition misc.hh:59\n Dune::Alberta::Real\n ALBERTA REAL Real\n Definition misc.hh:48\n-Dune::Alberta::determinant\n-static K determinant(const FieldMatrix< K, 0, m > &matrix)\n-Definition algebra.hh:30\n-Dune::Alberta::invert\n-static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 >\n-&inverse)\n-Definition algebra.hh:81\n+Dune::Alberta::memReAlloc\n+Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)\n+Definition misc.hh:85\n+Dune::Alberta::DirichletBoundary\n+static const int DirichletBoundary\n+Definition misc.hh:60\n Dune::Alberta::dimWorld\n static const int dimWorld\n Definition misc.hh:46\n Dune::Alberta::GlobalVector\n ALBERTA REAL_D GlobalVector\n Definition misc.hh:50\n-Dune::Alberta::GeometryCache\n-Definition geometrycache.hh:24\n-Dune::Alberta::GeometryCache::GeometryCache\n-GeometryCache()\n-Definition geometrycache.hh:33\n-Dune::Alberta::GeometryCache::integrationElement\n-const Real & integrationElement(const ALBERTA EL_INFO &elInfo)\n-Definition geometrycache.hh:37\n-Dune::Alberta::GeometryCache::JacobianTransposed\n-FieldMatrix< Real, dim, dimWorld > JacobianTransposed\n-Definition geometrycache.hh:31\n-Dune::Alberta::GeometryCache::jacobianTransposed\n-const JacobianTransposed & jacobianTransposed(const ALBERTA EL_INFO &elInfo)\n-Definition geometrycache.hh:48\n-Dune::Alberta::GeometryCache::jacobianInverseTransposed\n-const JacobianInverseTransposed & jacobianInverseTransposed(const ALBERTA EL_\n-INFO &elInfo)\n-Definition geometrycache.hh:66\n-Dune::Alberta::GeometryCache::JacobianInverseTransposed\n-FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed\n-Definition geometrycache.hh:30\n-Dune::Alberta::GeometryCacheProxy\n-Definition geometrycache.hh:91\n-Dune::Alberta::GeometryCacheProxy::jacobianTransposed\n-const JacobianTransposed & jacobianTransposed()\n-Definition geometrycache.hh:105\n-Dune::Alberta::GeometryCacheProxy::JacobianTransposed\n-FieldMatrix< Real, dim, dimWorld > JacobianTransposed\n-Definition geometrycache.hh:93\n-Dune::Alberta::GeometryCacheProxy::JacobianInverseTransposed\n-FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed\n-Definition geometrycache.hh:92\n-Dune::Alberta::GeometryCacheProxy::integrationElement\n-const Real & integrationElement()\n-Definition geometrycache.hh:100\n-Dune::Alberta::GeometryCacheProxy::GeometryCacheProxy\n-GeometryCacheProxy(GeometryCache< dim > &geometryCache, const ALBERTA EL_INFO\n-&elInfo)\n-Definition geometrycache.hh:95\n-Dune::Alberta::GeometryCacheProxy::jacobianInverseTransposed\n-const JacobianInverseTransposed & jacobianInverseTransposed()\n-Definition geometrycache.hh:110\n-Dune::Alberta::FillFlags\n-Definition misc.hh:231\n+Dune::Alberta::MacroData\n+Definition macrodata.hh:30\n+Dune::Alberta::MacroData::InstantiateMacroDataLibrary\n+friend struct InstantiateMacroDataLibrary\n+Definition macrodata.hh:45\n+Dune::Alberta::MacroData::boundaryId\n+BoundaryId & boundaryId(int element, int i) const\n+Definition macrodata.hh:272\n+Dune::Alberta::MacroData::insertVertex\n+int insertVertex(const GlobalVector &coords)\n+insert vertex\n+Definition macrodata.hh:149\n+Dune::Alberta::MacroData::ElementId\n+int ElementId[numVertices]\n+Definition macrodata.hh:48\n+Dune::Alberta::MacroData::supportPeriodicity\n+static const int supportPeriodicity\n+Definition macrodata.hh:50\n+Dune::Alberta::MacroData::release\n+void release()\n+release the macro data structure\n+Definition macrodata.hh:127\n+Dune::Alberta::MacroData::elementCount\n+int elementCount() const\n+Definition macrodata.hh:68\n+Dune::Alberta::MacroData::vertex\n+GlobalVector & vertex(int i) const\n+Definition macrodata.hh:255\n+Dune::Alberta::MacroData::vertexCount\n+int vertexCount() const\n+Definition macrodata.hh:63\n+Dune::Alberta::MacroData::markLongestEdge\n+void markLongestEdge()\n+mark the longest edge of all elements as refinement edges\n+Definition macrodata.hh:325\n+Dune::Alberta::MacroData::insertVertex\n+int insertVertex(const FieldVector< Real, dimWorld > &coords)\n+insert vertex\n+Definition macrodata.hh:163\n+Dune::Alberta::MacroData::checkNeighbors\n+bool checkNeighbors() const\n+check the neighbor information\n+Definition macrodata.hh:339\n+Dune::Alberta::MacroData::insertWallTrafo\n+void insertWallTrafo(const FieldMatrix< Real, dimWorld, dimWorld > &matrix,\n+const FieldVector< Real, dimWorld > &shift)\n+Definition macrodata.hh:385\n+Dune::Alberta::MacroData::element\n+ElementId & element(int i) const\n+Definition macrodata.hh:246\n+Dune::Alberta::MacroData::checkCycles\n+void checkCycles()\n+Definition macrodata.hh:404\n+Dune::Alberta::MacroData::neighbor\n+int & neighbor(int element, int i) const\n+Definition macrodata.hh:263\n+Dune::Alberta::MacroData::MacroData\n+MacroData()\n+Definition macrodata.hh:52\n+Dune::Alberta::MacroData::finalize\n+void finalize()\n+compress macro data structure\n+Definition macrodata.hh:294\n+Dune::Alberta::MacroData::insertWallTrafo\n+void insertWallTrafo(const GlobalMatrix &m, const GlobalVector &t)\n+Definition macrodata.hh:367\n+Dune::Alberta::MacroData::setOrientation\n+void setOrientation(const Real orientation)\n+set the orientation of all elements\n+Definition macrodata.hh:332\n+Dune::Alberta::MacroData::create\n+void create()\n+create a new macro data structure\n+Definition macrodata.hh:281\n+Dune::Alberta::MacroData::insertElement\n+int insertElement(const ElementId &id)\n+insert element\n+Definition macrodata.hh:346\n+Dune::Alberta::MacroData::write\n+bool write(const std::string &filename, bool binary=false) const\n+Definition macrodata.hh:180\n+Dune::Alberta::MacroData::read\n+void read(const std::string &filename, bool binary=false)\n+Definition macrodata.hh:413\n+Dune::Alberta::MacroData::Library\n+Definition macrodata.hh:220\n+Dune::Alberta::MacroData::Library::markLongestEdge\n+static void markLongestEdge(MacroData ¯oData)\n+Dune::Alberta::MacroData::Library::MacroData\n+Alberta::MacroData< dim > MacroData\n+Definition macrodata.hh:221\n+Dune::Alberta::NumSubEntities\n+Definition misc.hh:148\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00665.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00665.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: treeiterator.hh File Reference\n+dune-grid: geometry.cc File Reference\n \n \n \n \n \n \n \n@@ -71,42 +71,58 @@\n \n
    \n \n
    \n \n-
    treeiterator.hh File Reference
    \n+Namespaces |\n+Macros
    \n+
    geometry.cc File Reference
    \n \n
    \n-
    #include <utility>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/grid/albertagrid/elementinfo.hh>
    \n-#include <dune/grid/albertagrid/meshpointer.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::AlbertaMarkerVector< dim, dimworld >
     marker assigning subentities to one element containing them More...
    struct  Dune::AlbertaGridLocalGeometryProvider< Grid >::GeoInFatherCoordReader< Grid >
     
    struct  Dune::AlbertaMarkerVector< dim, dimworld >::MarkSubEntities< bool >::Codim< codim >
     
    class  Dune::AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    struct  Dune::AlbertaGridLocalGeometryProvider< Grid >::FaceCoordReader< Grid >
     
    \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n

    \n+Macros

    #define DUNE_ALBERTA_GEOMETRY_CC
     
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_ALBERTA_GEOMETRY_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_ALBERTA_GEOMETRY_CC
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,30 +1,32 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-treeiterator.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Macros\n+geometry.cc File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::AlbertaMarkerVector<_dim,_dimworld_>\n-\u00a0 marker assigning subentities to one element containing them More...\n+struct \u00a0 Dune::AlbertaGridLocalGeometryProvider<_Grid_>::\n+ GeoInFatherCoordReader<_Grid_>\n \u00a0\n-struct \u00a0 Dune::AlbertaMarkerVector<_dim,_dimworld_>::MarkSubEntities<_bool_>::\n- Codim<_codim_>\n-\u00a0\n- class \u00a0 Dune::AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n+struct \u00a0 Dune::AlbertaGridLocalGeometryProvider<_Grid_>::FaceCoordReader<_Grid\n+ >\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+Macros\n+#define\u00a0 DUNE_ALBERTA_GEOMETRY_CC\n+\u00a0\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_ALBERTA_GEOMETRY_CC *****\n+#define DUNE_ALBERTA_GEOMETRY_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00665_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00665_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: treeiterator.hh Source File\n+dune-grid: geometry.cc Source File\n \n \n \n \n \n \n \n@@ -74,647 +74,344 @@\n \n \n
    \n
    \n-
    treeiterator.hh
    \n+
    geometry.cc
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_ALBERTA_TREEITERATOR_HH
    \n-
    7#define DUNE_ALBERTA_TREEITERATOR_HH
    \n-
    8
    \n-
    9#include <utility>
    \n-
    10
    \n-
    11#include <dune/common/hybridutilities.hh>
    \n-
    12#include <dune/common/typetraits.hh>
    \n-
    13
    \n-\n-\n-
    16
    \n-
    17#if HAVE_ALBERTA
    \n-
    18
    \n-
    19namespace Dune
    \n-
    20{
    \n-
    21
    \n-
    22 // AlbertaMarkerVector
    \n-
    23 // -------------------
    \n-
    24
    \n-
    33 template< int dim, int dimworld >
    \n-
    \n-\n-
    35 {
    \n-\n-
    37
    \n-\n-
    39
    \n-
    40 //friend class AlbertaGrid< dim, dimworld >;
    \n+
    5#ifndef DUNE_ALBERTA_GEOMETRY_CC
    \n+
    6#define DUNE_ALBERTA_GEOMETRY_CC
    \n+
    7
    \n+\n+\n+\n+
    11
    \n+
    12namespace Dune
    \n+
    13{
    \n+
    14
    \n+
    15 // AlbertaGridGeometry
    \n+
    16 // -------------------
    \n+
    17
    \n+
    18 // print the GeometryInformation
    \n+
    19 template <int mydim, int cdim, class GridImp>
    \n+
    \n+
    20 inline void AlbertaGridGeometry<mydim,cdim,GridImp>::print (std::ostream& ss) const
    \n+
    21 {
    \n+
    22 ss << "AlbertaGridGeometry<" << mydim << "," << cdim << "> = { \\n";
    \n+
    23 for(int i=0; i<corners(); i++)
    \n+
    24 {
    \n+
    25 ss << " corner " << i << " = ";
    \n+
    26 ss << ((*this)[i]); ss << "\\n";
    \n+
    27 }
    \n+
    28 ss << "} \\n";
    \n+
    29 }
    \n+
    \n+
    30
    \n+
    31
    \n+
    32 template< int mydim, int cdim, class GridImp >
    \n+\n+
    \n+\n+
    35 {
    \n+
    36 GlobalCoordinate y = corner( 0 );
    \n+
    37 jacobianTransposed().umtv( local, y );
    \n+
    38 return y;
    \n+
    39 }
    \n+
    \n+
    40
    \n
    41
    \n-
    42 static const int dimension = Grid::dimension;
    \n-
    43
    \n-\n-\n-
    46
    \n-
    47 template< bool >
    \n-
    48 struct NoMarkSubEntities;
    \n-
    49 template< bool >
    \n-
    50 struct MarkSubEntities;
    \n+
    42 //local implementation for mydim < cdim
    \n+
    43 template< int mydim, int cdim, class GridImp >
    \n+\n+
    \n+\n+
    46 {
    \n+\n+
    48 jacobianInverseTransposed().mtv( global - corner( 0 ), x );
    \n+
    49 return x;
    \n+
    50 }
    \n+
    \n
    51
    \n-
    52 public:
    \n-
    \n-
    54 explicit AlbertaMarkerVector ( const DofNumbering &dofNumbering )
    \n-
    55 : dofNumbering_( dofNumbering )
    \n-
    56 {
    \n-
    57 for( int codim = 0; codim <= dimension; ++codim )
    \n-
    58 marker_[ codim ] = 0;
    \n-
    59 }
    \n-
    \n-
    60
    \n-
    \n-
    61 AlbertaMarkerVector ( const This &other )
    \n-
    62 : dofNumbering_( other.dofNumbering_ )
    \n-
    63 {
    \n-
    64 for( int codim = 0; codim <= dimension; ++codim )
    \n-
    65 marker_[ codim ] = 0;
    \n+
    52
    \n+
    53 template< int mydim, int cdim, class GridImp >
    \n+\n+
    \n+\n+
    56 {
    \n+
    57 if( !builtJT_ )
    \n+
    58 {
    \n+
    59 const FieldVector< ctype, coorddimension > &origin = coord_[ 0 ];
    \n+
    60 for( int i = 0; i < mydimension; ++i )
    \n+
    61 {
    \n+
    62 jT_[ i ] = coord_[ i+1 ];
    \n+
    63 jT_[ i ] -= origin;
    \n+
    64 }
    \n+
    65 builtJT_ = true;
    \n
    66 }
    \n+
    67 return jT_;
    \n+
    68 }
    \n+
    \n+
    69
    \n+
    70
    \n+
    71 template< int mydim, int cdim, class GridImp >
    \n+\n+
    \n+\n+
    74 {
    \n+
    75 if( !builtJTInv_ )
    \n+
    76 {
    \n+
    77 elDet_ = std::abs( Alberta::invert( jacobianTransposed(), jTInv_ ) );
    \n+
    78 assert( elDet_ > 1.0e-25 );
    \n+
    79 calcedDet_ = true;
    \n+
    80 builtJTInv_ = true;
    \n+
    81 }
    \n+
    82 return jTInv_;
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    85
    \n+
    86 // built Geometry
    \n+
    87 template< int mydim, int cdim, class GridImp >
    \n+
    88 template< class CoordReader >
    \n+\n+
    \n+
    90 ::build ( const CoordReader &coordReader )
    \n+
    91 {
    \n+
    92 builtJT_ = false;
    \n+
    93 builtJTInv_ = false;
    \n+
    94
    \n+
    95 // copy corners
    \n+
    96 for( int i = 0; i < numCorners; ++i )
    \n+
    97 coordReader.coordinate( i, coord_[ i ] );
    \n+
    98
    \n+
    99 // calculate centroid
    \n+
    100 centroid_ = coord_[ 0 ];
    \n+
    101 for( int i = 1; i < numCorners; ++i )
    \n+
    102 centroid_ += coord_[ i ];
    \n+
    103 centroid_ *= 1.0 / numCorners;
    \n+
    104
    \n+
    105 elDet_ = (coordReader.hasDeterminant() ? coordReader.determinant() : elDeterminant());
    \n+
    106 assert( std::abs( elDet_ ) > 0.0 );
    \n+
    107 calcedDet_ = true;
    \n+
    108 }
    \n
    \n-
    67
    \n-
    \n-\n-
    69 {
    \n-
    70 clear();
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    73 private:
    \n-
    74 This &operator= ( const This & );
    \n-
    75
    \n-
    76 public:
    \n-
    78 template< int codim >
    \n-
    \n-
    79 bool subEntityOnElement ( const ElementInfo &elementInfo, int subEntity ) const;
    \n-
    80
    \n-
    81 template< int firstCodim, class Iterator >
    \n-
    \n-
    82 void markSubEntities ( const Iterator &begin, const Iterator &end );
    \n-
    83
    \n-
    \n-
    84 void clear ()
    \n-
    85 {
    \n-
    86 for( int codim = 0; codim <= dimension; ++codim )
    \n-
    87 {
    \n-
    88 if( marker_[ codim ] != 0 )
    \n-
    89 delete[] marker_[ codim ];
    \n-
    90 marker_[ codim ] = 0;
    \n-
    91 }
    \n-
    92 }
    \n-
    \n-
    93
    \n-
    \n-
    95 bool up2Date () const
    \n-
    96 {
    \n-
    97 return (marker_[ dimension ] != 0);
    \n-
    98 }
    \n-
    \n-
    99
    \n-
    \n-
    101 void print ( std::ostream &out = std::cout ) const;
    \n-
    102
    \n-
    103 private:
    \n-
    104 const DofNumbering &dofNumbering_;
    \n-
    105 int *marker_[ dimension+1 ];
    \n-
    106 };
    \n-
    107
    \n-
    108
    \n
    109
    \n-
    110 // AlbertaMarkerVector::NoMarkSubEntities
    \n-
    111 // --------------------------------------
    \n-
    112
    \n-
    113 template< int dim, int dimworld >
    \n-
    114 template< bool >
    \n-
    115 struct AlbertaMarkerVector< dim, dimworld >::NoMarkSubEntities
    \n-
    116 {
    \n-
    117 template< int firstCodim, class Iterator >
    \n-
    118 static void mark ( [[maybe_unused]] const DofNumbering & dofNumbering,
    \n-
    119 [[maybe_unused]] int *(&marker)[ dimension + 1 ],
    \n-
    120 [[maybe_unused]] const Iterator &begin,
    \n-
    121 [[maybe_unused]] const Iterator &end )
    \n-
    122 {}
    \n-
    123 };
    \n-
    124
    \n-
    125
    \n-
    126
    \n-
    127 // AlbertaMarkerVector::MarkSubEntities
    \n-
    128 // ------------------------------------
    \n-
    129
    \n-
    130 template< int dim, int dimworld >
    \n-
    131 template< bool >
    \n-
    132 struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities
    \n-
    133 {
    \n-
    134 template< int codim >
    \n-
    \n-
    135 struct Codim
    \n-
    136 {
    \n-
    137 static const int numSubEntities = Alberta::NumSubEntities< dimension, codim >::value;
    \n-
    138
    \n-\n-
    140
    \n-
    \n-
    141 static void apply ( const DofNumbering &dofNumbering,
    \n-
    142 int *(&marker)[ dimension + 1 ],
    \n-
    143 const ElementInfo &elementInfo )
    \n+
    110
    \n+
    111#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    112 template< int dim, int cdim >
    \n+\n+
    114 AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::global ( const LocalCoordinate &local ) const
    \n+
    115 {
    \n+
    116 GlobalCoordinate y = corner( 0 );
    \n+
    117 jacobianTransposed().umtv( local, y );
    \n+
    118 return y;
    \n+
    119 }
    \n+
    120
    \n+
    121
    \n+
    122 //local implementation for mydim < cdim
    \n+
    123 template< int dim, int cdim >
    \n+
    124 inline typename AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::LocalCoordinate
    \n+
    125 AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::local ( const GlobalCoordinate &global ) const
    \n+
    126 {
    \n+
    127 LocalCoordinate x;
    \n+
    128 jacobianInverseTransposed().mtv( global - corner( 0 ), x );
    \n+
    129 return x;
    \n+
    130 }
    \n+
    131#endif // #if !DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    132
    \n+
    133
    \n+
    134
    \n+
    135 // AlbertaGridLocalGeometryProvider
    \n+
    136 // --------------------------------
    \n+
    137
    \n+
    138 template< class Grid >
    \n+
    139 void AlbertaGridLocalGeometryProvider< Grid >::buildGeometryInFather ()
    \n+
    140 {
    \n+
    141 for( int child = 0; child < numChildren; ++child )
    \n+
    142 {
    \n+
    143 for( int orientation = 0; orientation < 2; ++orientation )
    \n
    144 {
    \n-
    145 int *array = marker[ codim ];
    \n-
    146
    \n-
    147 const int index = dofNumbering( elementInfo, 0, 0 );
    \n-
    148 for( int i = 0; i < numSubEntities; ++i )
    \n-
    149 {
    \n-
    150 int &mark = array[ dofNumbering( elementInfo, codim, i ) ];
    \n-
    151 mark = std::max( index, mark );
    \n-
    152 }
    \n-
    153 }
    \n-
    \n-
    154 };
    \n-
    \n-
    155
    \n-
    156 template< int firstCodim, class Iterator >
    \n-
    157 static void mark ( const DofNumbering &dofNumbering, int *(&marker)[ dimension + 1 ],
    \n-
    158 const Iterator &begin, const Iterator &end )
    \n-
    159 {
    \n-
    160 for( int codim = firstCodim; codim <= dimension; ++codim )
    \n-
    161 {
    \n-
    162 const int size = dofNumbering.size( codim );
    \n-
    163 marker[ codim ] = new int[ size ];
    \n+
    145 const GeoInFatherCoordReader coordReader( child, orientation );
    \n+
    146 geometryInFather_[ child ][ orientation ] = new LocalElementGeometry( coordReader );
    \n+
    147 }
    \n+
    148 }
    \n+
    149 }
    \n+
    150
    \n+
    151
    \n+
    152 template< class Grid >
    \n+
    153 void AlbertaGridLocalGeometryProvider< Grid >::buildFaceGeometry ()
    \n+
    154 {
    \n+
    155 for( int face = 0; face < numFaces; ++face )
    \n+
    156 {
    \n+
    157 for( int twist = minFaceTwist; twist <= maxFaceTwist; ++twist )
    \n+
    158 {
    \n+
    159 const FaceCoordReader coordReader( face, twist );
    \n+
    160 faceGeometry_[ face ][ twist - minFaceTwist ] = new LocalFaceGeometry( coordReader );
    \n+
    161 }
    \n+
    162 }
    \n+
    163 }
    \n
    164
    \n-
    165 int *array = marker[ codim ];
    \n-
    166 for( int i = 0; i < size; ++i )
    \n-
    167 array[ i ] = -1;
    \n-
    168 }
    \n+
    165
    \n+
    166
    \n+
    167 // AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader
    \n+
    168 // --------------------------------------------------------
    \n
    169
    \n-
    170 for( Iterator it = begin; it != end; ++it )
    \n-
    171 {
    \n-
    172 const ElementInfo &elementInfo = it->impl().elementInfo();
    \n-
    173 Hybrid::forEach( std::make_index_sequence< dimension+1-firstCodim >{},
    \n-
    174 [ & ]( auto i ){ Codim< i+firstCodim >::apply( dofNumbering, marker, elementInfo ); } );
    \n-
    175 }
    \n-
    176 }
    \n-
    177 };
    \n-
    178
    \n+
    170 template< class Grid >
    \n+
    \n+\n+
    172 {
    \n+\n+
    174
    \n+\n+
    176
    \n+
    177 private:
    \n+\n
    179
    \n-
    180
    \n-
    181 // AlbertaGridTreeIterator
    \n-
    182 // -----------------------
    \n-
    183
    \n-
    187 template< int codim, class GridImp, bool leafIterator >
    \n-
    \n-\n-
    189 {
    \n-\n-
    191
    \n-
    192 public:
    \n-
    193 static const int dimension = GridImp::dimension;
    \n-
    194 static const int codimension = codim;
    \n-
    195 static const int dimensionworld = GridImp::dimensionworld;
    \n-
    196
    \n-
    197 private:
    \n-
    198 friend class AlbertaGrid< dimension, dimensionworld >;
    \n-
    199
    \n-
    200 static const int numSubEntities
    \n-\n-
    202
    \n-
    203 public:
    \n-\n-
    205 typedef typename MeshPointer::MacroIterator MacroIterator;
    \n-
    206
    \n-
    207 typedef typename GridImp::template Codim< codim >::Entity Entity;
    \n-\n-\n-
    210 typedef typename EntityImp::ElementInfo ElementInfo;
    \n-
    211
    \n-\n+
    180 public:
    \n+
    \n+
    181 GeoInFatherCoordReader ( int child, int orientation )
    \n+
    182 : child_( child ),
    \n+
    183 orientation_( orientation )
    \n+
    184 {}
    \n+
    \n+
    185
    \n+
    \n+
    186 void coordinate ( int i, Coordinate &x ) const
    \n+
    187 {
    \n+
    188 const typename GeoInFather::LocalVector &coord
    \n+
    189 = GeoInFather::coordinate( child_, orientation_, i );
    \n+
    190 for( int j = 0; j < dimension; ++j )
    \n+
    191 x[ j ] = coord[ j ];
    \n+
    192 }
    \n+
    \n+
    193
    \n+
    \n+
    194 bool hasDeterminant () const
    \n+
    195 {
    \n+
    196 return false;
    \n+
    197 }
    \n+
    \n+
    198
    \n+
    \n+\n+
    200 {
    \n+
    201 return ctype( 0 );
    \n+
    202 }
    \n+
    \n+
    203
    \n+
    204 private:
    \n+
    205 const int child_;
    \n+
    206 const int orientation_;
    \n+
    207 };
    \n+
    \n+
    208
    \n+
    209
    \n+
    210
    \n+
    211 // AlbertaGridLocalGeometryProvider::FaceCoordReader
    \n+
    212 // -------------------------------------------------
    \n
    213
    \n-
    \n-\n-
    215
    \n-
    \n-\n+
    214 template< class Grid >
    \n+
    \n+\n+
    216 {
    \n+\n
    218
    \n-
    \n-
    220 This &operator= ( const This &other );
    \n-
    221
    \n-
    \n-
    223 AlbertaGridTreeIterator ( const GridImp &grid, int travLevel );
    \n-
    224
    \n+\n+
    220
    \n+
    \n+
    221 FaceCoordReader ( const int face, const int twist = 0 )
    \n+
    222 : face_( face ),
    \n+
    223 twist_( twist )
    \n+
    224 {}
    \n+
    \n+
    225
    \n
    \n-\n-
    227 const MarkerVector *marker,
    \n-
    228 int travLevel );
    \n-
    229
    \n-
    \n-
    231 bool equals ( const This &other ) const
    \n-
    232 {
    \n-
    233 return entity_.impl().equals( other.entity_.impl() );
    \n-
    234 }
    \n-
    \n-
    235
    \n-
    \n-\n-
    238 {
    \n-
    239 return entity_;
    \n-
    240 }
    \n-
    \n-
    241
    \n-
    \n-
    243 int level () const
    \n-
    244 {
    \n-
    245 return entity_.impl().level();
    \n-
    246 }
    \n-
    \n-
    247
    \n-
    \n-
    249 void increment();
    \n+
    226 void coordinate ( const int i, Coordinate &x ) const
    \n+
    227 {
    \n+
    228 const int ti = Alberta::applyInverseTwist< dimension-1 >( twist_, i );
    \n+
    229 const int j = mapVertices< 1 >( face_, ti );
    \n+
    230 refCorner( j, x );
    \n+
    231 }
    \n+
    \n+
    232
    \n+
    \n+
    233 bool hasDeterminant () const
    \n+
    234 {
    \n+
    235 return false;
    \n+
    236 }
    \n+
    \n+
    237
    \n+
    \n+\n+
    239 {
    \n+
    240 return ctype( 0 );
    \n+
    241 }
    \n+
    \n+
    242
    \n+
    243 private:
    \n+
    244 static void refCorner ( const int i, Coordinate &x )
    \n+
    245 {
    \n+
    246 x = ctype( 0 );
    \n+
    247 if( i > 0 )
    \n+
    248 x[ i-1 ] = ctype( 1 );
    \n+
    249 }
    \n
    250
    \n-
    251 protected:
    \n-
    \n-
    253 const GridImp &grid () const
    \n-
    254 {
    \n-
    255 return entity_.impl().grid();
    \n-
    256 }
    \n-
    \n-
    257
    \n-
    258 private:
    \n-
    259 void nextElement ( ElementInfo &elementInfo );
    \n-
    260 void nextElementStop (ElementInfo &elementInfo );
    \n-
    261 bool stopAtElement ( const ElementInfo &elementInfo ) const;
    \n-
    262
    \n-
    263 void goNext ( ElementInfo &elementInfo );
    \n-
    264 void goNext ( const std::integral_constant< int, 0 > cdVariable,
    \n-
    265 ElementInfo &elementInfo );
    \n-
    266 void goNext ( const std::integral_constant< int, 1 > cdVariable,
    \n-
    267 ElementInfo &elementInfo );
    \n-
    268 template< int cd >
    \n-
    269 void goNext ( const std::integral_constant< int, cd > cdVariable,
    \n-
    270 ElementInfo &elementInfo );
    \n-
    271
    \n-
    272 mutable Entity entity_;
    \n-
    273
    \n-
    275 int level_;
    \n-
    276
    \n-
    278 int subEntity_;
    \n-
    279
    \n-
    280 MacroIterator macroIterator_;
    \n-
    281
    \n-
    282 // knows on which element a point,edge,face is viewed
    \n-
    283 const MarkerVector *marker_;
    \n-
    284 };
    \n-
    285
    \n-
    286
    \n-
    287
    \n-
    288 // Implementation of AlbertaMarkerVector
    \n-
    289 // -------------------------------------
    \n-
    290
    \n-
    291 template< int dim, int dimworld >
    \n-
    292 template< int codim >
    \n-
    293 inline bool AlbertaMarkerVector< dim, dimworld >
    \n-
    \n-
    294 ::subEntityOnElement ( const ElementInfo &elementInfo, int subEntity ) const
    \n-
    295 {
    \n-
    296 assert( marker_[ codim ] != 0 );
    \n-
    297
    \n-
    298 const int subIndex = dofNumbering_( elementInfo, codim, subEntity );
    \n-
    299 const int markIndex = marker_[ codim ][ subIndex ];
    \n-
    300 assert( (markIndex >= 0) );
    \n-
    301
    \n-
    302 const int index = dofNumbering_( elementInfo, 0, 0 );
    \n-
    303 return (markIndex == index);
    \n-
    304 }
    \n-
    \n-
    305
    \n-
    306
    \n-
    307 template< int dim, int dimworld >
    \n-
    308 template< int firstCodim, class Iterator >
    \n-\n-
    \n-
    310 ::markSubEntities ( const Iterator &begin, const Iterator &end )
    \n-
    311 {
    \n-
    312 clear();
    \n-
    313 std::conditional< (firstCodim <= dimension), MarkSubEntities<true>, NoMarkSubEntities<false> >::type
    \n-
    314 ::template mark< firstCodim, Iterator >( dofNumbering_, marker_, begin, end );
    \n-
    315 }
    \n-
    \n-
    316
    \n-
    317
    \n-
    318 template< int dim, int dimworld >
    \n-
    \n-
    319 inline void AlbertaMarkerVector< dim, dimworld >::print ( std::ostream &out ) const
    \n-
    320 {
    \n-
    321 for( int codim = 1; codim <= dimension; ++codim )
    \n-
    322 {
    \n-
    323 int *marker = marker_[ codim ];
    \n-
    324 if( marker != 0 )
    \n-
    325 {
    \n-
    326 const int size = dofNumbering_.size( codim );
    \n-
    327 out << std::endl;
    \n-
    328 out << "Codimension " << codim << " (" << size << " entries)" << std::endl;
    \n-
    329 for( int i = 0; i < size; ++i )
    \n-
    330 out << "subentity " << i << " visited on Element " << marker[ i ] << std::endl;
    \n-
    331 }
    \n-
    332 }
    \n-
    333 }
    \n-
    \n-
    334
    \n-
    335
    \n-
    336
    \n-
    337 // Implementation of AlbertaGridTreeIterator
    \n-
    338 // -----------------------------------------
    \n-
    339
    \n-
    340 template< int codim, class GridImp, bool leafIterator >
    \n-\n-
    \n-\n-
    343 : entity_(),
    \n-
    344 level_( -1 ),
    \n-
    345 subEntity_( -1 ),
    \n-
    346 macroIterator_(),
    \n-
    347 marker_( NULL )
    \n-
    348 {}
    \n-
    \n-
    349
    \n-
    350 template< int codim, class GridImp, bool leafIterator >
    \n-\n-
    \n-
    352 ::AlbertaGridTreeIterator ( const GridImp &grid,
    \n-
    353 const MarkerVector *marker,
    \n-
    354 int travLevel )
    \n-
    355 : entity_( EntityImp( grid ) ),
    \n-
    356 level_( travLevel ),
    \n-
    357 subEntity_( (codim == 0 ? 0 : -1) ),
    \n-
    358 macroIterator_( grid.meshPointer().begin() ),
    \n-
    359 marker_( marker )
    \n-
    360 {
    \n-
    361 ElementInfo elementInfo = *macroIterator_;
    \n-
    362 nextElementStop( elementInfo );
    \n-
    363 if( codim > 0 )
    \n-
    364 goNext( elementInfo );
    \n-
    365 // it is ok to set the invalid ElementInfo
    \n-
    366 entity_.impl().setElement( elementInfo, subEntity_ );
    \n-
    367 }
    \n-
    \n-
    368
    \n-
    369
    \n-
    370 // Make LevelIterator with point to element from previous iterations
    \n-
    371 template< int codim, class GridImp, bool leafIterator >
    \n-\n-
    \n-
    373 ::AlbertaGridTreeIterator ( const GridImp &grid,
    \n-
    374 int travLevel )
    \n-
    375 : entity_( EntityImp( grid ) ),
    \n-
    376 level_( travLevel ),
    \n-
    377 subEntity_( -1 ),
    \n-
    378 macroIterator_( grid.meshPointer().end() ),
    \n-
    379 marker_( 0 )
    \n-
    380 {}
    \n-
    \n-
    381
    \n-
    382
    \n-
    383 // Make LevelIterator with point to element from previous iterations
    \n-
    384 template< int codim, class GridImp, bool leafIterator >
    \n-\n-
    \n-\n-
    387 : entity_( other.entity_ ),
    \n-
    388 level_( other.level_ ),
    \n-
    389 subEntity_( other.subEntity_ ),
    \n-
    390 macroIterator_( other.macroIterator_ ),
    \n-
    391 marker_( other.marker_ )
    \n-
    392 {}
    \n-
    \n-
    393
    \n-
    394
    \n-
    395 // Make LevelIterator with point to element from previous iterations
    \n-
    396 template< int codim, class GridImp, bool leafIterator >
    \n-\n-
    \n-\n-
    399 {
    \n-
    400 entity_ = other.entity_;
    \n-
    401 level_ = other.level_;
    \n-
    402 subEntity_ = other.subEntity_;
    \n-
    403 macroIterator_ = other.macroIterator_;
    \n-
    404 marker_ = other.marker_;
    \n-
    405
    \n-
    406 return *this;
    \n-
    407 }
    \n-
    \n-
    408
    \n-
    409
    \n-
    410 template< int codim, class GridImp, bool leafIterator >
    \n-
    \n-\n-
    412 {
    \n-
    413 ElementInfo elementInfo = entity_.impl().elementInfo_;
    \n-
    414 goNext ( elementInfo );
    \n-
    415 // it is ok to set the invalid ElementInfo
    \n-
    416 entity_.impl().setElement( elementInfo, subEntity_ );
    \n-
    417 }
    \n-
    \n-
    \n-
    418
    \n-
    419
    \n-
    420 template< int codim, class GridImp, bool leafIterator >
    \n-\n-
    422 ::nextElement ( ElementInfo &elementInfo )
    \n-
    423 {
    \n-
    424 if( elementInfo.isLeaf() || (elementInfo.level() >= level_) )
    \n-
    425 {
    \n-
    426 while( (elementInfo.level() > 0) && (elementInfo.indexInFather() == 1) )
    \n-
    427 elementInfo = elementInfo.father();
    \n-
    428 if( elementInfo.level() == 0 )
    \n-
    429 {
    \n-
    430 ++macroIterator_;
    \n-
    431 elementInfo = *macroIterator_;
    \n-
    432 }
    \n-
    433 else
    \n-
    434 elementInfo = elementInfo.father().child( 1 );
    \n-
    435 }
    \n-
    436 else
    \n-
    437 elementInfo = elementInfo.child( 0 );
    \n-
    438 }
    \n-
    439
    \n-
    440
    \n-
    441 template< int codim, class GridImp, bool leafIterator >
    \n-
    442 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n-
    443 ::nextElementStop ( ElementInfo &elementInfo )
    \n-
    444 {
    \n-
    445 while( !(!elementInfo || stopAtElement( elementInfo )) )
    \n-
    446 nextElement( elementInfo );
    \n-
    447 }
    \n-
    448
    \n-
    449
    \n-
    450 template< int codim, class GridImp, bool leafIterator >
    \n-
    451 inline bool AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n-
    452 ::stopAtElement ( const ElementInfo &elementInfo ) const
    \n-
    453 {
    \n-
    454 if( !elementInfo )
    \n-
    455 return true;
    \n-
    456 return (leafIterator ? elementInfo.isLeaf() : (level_ == elementInfo.level()));
    \n-
    457 }
    \n-
    458
    \n-
    459
    \n-
    460 template< int codim, class GridImp, bool leafIterator >
    \n-
    461 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n-
    462 ::goNext ( ElementInfo &elementInfo )
    \n-
    463 {
    \n-
    464 std::integral_constant< int, codim > codimVariable;
    \n-
    465 goNext( codimVariable, elementInfo );
    \n-
    466 }
    \n-
    467
    \n-
    468 template< int codim, class GridImp, bool leafIterator >
    \n-
    469 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n-
    470 ::goNext ( const std::integral_constant< int, 0 > /* cdVariable */,
    \n-
    471 ElementInfo &elementInfo )
    \n-
    472 {
    \n-
    473 assert( stopAtElement( elementInfo ) );
    \n-
    474
    \n-
    475 nextElement( elementInfo );
    \n-
    476 nextElementStop( elementInfo );
    \n-
    477 }
    \n-
    478
    \n-
    479 template< int codim, class GridImp, bool leafIterator >
    \n-
    480 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n-
    481 ::goNext ( const std::integral_constant< int, 1 > cdVariable,
    \n-
    482 ElementInfo &elementInfo )
    \n-
    483 {
    \n-
    484 assert( stopAtElement( elementInfo ) );
    \n-
    485
    \n-
    486 ++subEntity_;
    \n-
    487 if( subEntity_ >= numSubEntities )
    \n-
    488 {
    \n-
    489 subEntity_ = 0;
    \n-
    490 nextElement( elementInfo );
    \n-
    491 nextElementStop( elementInfo );
    \n-
    492 if( !elementInfo )
    \n-
    493 return;
    \n-
    494 }
    \n-
    495
    \n-
    496 if( leafIterator )
    \n-
    497 {
    \n-
    498 const int face = (dimension == 1 ? (numSubEntities-1)-subEntity_ : subEntity_);
    \n-
    499
    \n-
    500 const ALBERTA EL *neighbor = elementInfo.elInfo().neigh[ face ];
    \n-
    501 if( (neighbor != NULL) && !elementInfo.isBoundary( face ) )
    \n-
    502 {
    \n-
    503 // face is reached from element with largest number
    \n-
    504 const int elIndex = grid().dofNumbering() ( elementInfo, 0, 0 );
    \n-
    505 const int nbIndex = grid().dofNumbering() ( neighbor, 0, 0 );
    \n-
    506 if( elIndex < nbIndex )
    \n-
    507 goNext( cdVariable, elementInfo );
    \n-
    508 }
    \n-
    509 // uncomment this assertion only if codimension 1 entities are marked
    \n-
    510 // assert( marker_->template subEntityOnElement< 1 >( elementInfo, subEntity_ ) );
    \n-
    511 }
    \n-
    512 else
    \n-
    513 {
    \n-
    514 assert( marker_ != 0 );
    \n-
    515 if( !marker_->template subEntityOnElement< 1 >( elementInfo, subEntity_ ) )
    \n-
    516 goNext( cdVariable, elementInfo );
    \n-
    517 }
    \n-
    518 }
    \n-
    519
    \n-
    520 template< int codim, class GridImp, bool leafIterator >
    \n-
    521 template< int cd >
    \n-
    522 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n-
    523 ::goNext ( const std::integral_constant< int, cd > cdVariable,
    \n-
    524 ElementInfo &elementInfo )
    \n-
    525 {
    \n-
    526 assert( stopAtElement( elementInfo ) );
    \n-
    527
    \n-
    528 ++subEntity_;
    \n-
    529 if( subEntity_ >= numSubEntities )
    \n-
    530 {
    \n-
    531 subEntity_ = 0;
    \n-
    532 nextElement( elementInfo );
    \n-
    533 nextElementStop( elementInfo );
    \n-
    534 if( !elementInfo )
    \n-
    535 return;
    \n-
    536 }
    \n-
    537
    \n-
    538 assert( marker_ != 0 );
    \n-
    539 if( !marker_->template subEntityOnElement< cd >( elementInfo, subEntity_ ) )
    \n-
    540 goNext( cdVariable, elementInfo );
    \n-
    541 }
    \n-
    542
    \n-
    543}
    \n-
    544
    \n-
    545#endif // #if HAVE_ALBERTA
    \n-
    546
    \n-
    547#endif // #ifndef DUNE_ALBERTA_TREEITERATOR_HH
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-
    provides a wrapper for ALBERTA's mesh structure
    \n-
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+
    251 int face_;
    \n+
    252 int twist_;
    \n+
    253 };
    \n+
    \n+
    254
    \n+
    255} // namespace Dune
    \n+
    256
    \n+
    257#endif // #ifndef DUNE_ALBERTA_GEOMETRY_CC
    \n+
    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-\n-
    static const int dimension
    Definition agrid.hh:145
    \n-\n-\n-
    int size(int codim) const
    Definition dofadmin.hh:163
    \n-\n-
    Definition treeiterator.hh:189
    \n-
    bool equals(const This &other) const
    equality
    Definition treeiterator.hh:231
    \n-
    MakeableInterfaceObject< Entity > EntityObject
    Definition treeiterator.hh:208
    \n-
    Alberta::MeshPointer< dimension > MeshPointer
    Definition treeiterator.hh:204
    \n-
    AlbertaGridTreeIterator(const GridImp &grid, const MarkerVector *marker, int travLevel)
    Constructor making begin iterator.
    Definition treeiterator.hh:352
    \n-
    AlbertaGridTreeIterator(const GridImp &grid, int travLevel)
    Constructor making end iterator.
    Definition treeiterator.hh:373
    \n-
    EntityObject::ImplementationType EntityImp
    Definition treeiterator.hh:209
    \n-
    static const int codimension
    Definition treeiterator.hh:194
    \n-
    MeshPointer::MacroIterator MacroIterator
    Definition treeiterator.hh:205
    \n-
    This & operator=(const This &other)
    Constructor making end iterator.
    Definition treeiterator.hh:398
    \n-
    Entity & dereference() const
    dereferencing
    Definition treeiterator.hh:237
    \n-
    AlbertaMarkerVector< dimension, dimensionworld > MarkerVector
    Definition treeiterator.hh:212
    \n-
    GridImp::template Codim< codim >::Entity Entity
    Definition treeiterator.hh:207
    \n-
    int level() const
    ask for level of entities
    Definition treeiterator.hh:243
    \n-
    static const int dimensionworld
    Definition treeiterator.hh:195
    \n-
    AlbertaGridTreeIterator()
    Definition treeiterator.hh:342
    \n-
    void increment()
    increment
    Definition treeiterator.hh:411
    \n-
    const GridImp & grid() const
    obtain a reference to the grid
    Definition treeiterator.hh:253
    \n-
    static const int dimension
    Definition treeiterator.hh:193
    \n-
    AlbertaGridTreeIterator(const This &other)
    Constructor making end iterator.
    Definition treeiterator.hh:386
    \n-
    EntityImp::ElementInfo ElementInfo
    Definition treeiterator.hh:210
    \n-
    Definition misc.hh:148
    \n-
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n-
    AlbertaMarkerVector(const DofNumbering &dofNumbering)
    create AlbertaMarkerVector with empty vectors
    Definition treeiterator.hh:54
    \n-
    bool up2Date() const
    return true if marking is up to date
    Definition treeiterator.hh:95
    \n-
    bool subEntityOnElement(const ElementInfo &elementInfo, int subEntity) const
    visit subentity on this element?
    Definition treeiterator.hh:294
    \n-
    void markSubEntities(const Iterator &begin, const Iterator &end)
    Definition treeiterator.hh:310
    \n-
    ~AlbertaMarkerVector()
    Definition treeiterator.hh:68
    \n-
    void clear()
    Definition treeiterator.hh:84
    \n-
    AlbertaMarkerVector(const This &other)
    Definition treeiterator.hh:61
    \n-
    void print(std::ostream &out=std::cout) const
    print for debugin' only
    Definition treeiterator.hh:319
    \n-\n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition treeiterator.hh:139
    \n-
    static void apply(const DofNumbering &dofNumbering, int *(&marker)[dimension+1], const ElementInfo &elementInfo)
    Definition treeiterator.hh:141
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-\n-
    InterfaceType::Implementation ImplementationType
    Definition common/grid.hh:1122
    \n+
    int applyInverseTwist(int twist, int i)
    Definition misc.hh:637
    \n+
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 > &inverse)
    Definition algebra.hh:81
    \n+\n+
    FieldVector< ctype, dimension > Coordinate
    Definition geometry.cc:175
    \n+\n+
    void coordinate(int i, Coordinate &x) const
    Definition geometry.cc:186
    \n+
    GeoInFatherCoordReader(int child, int orientation)
    Definition geometry.cc:181
    \n+
    bool hasDeterminant() const
    Definition geometry.cc:194
    \n+
    ctype determinant() const
    Definition geometry.cc:199
    \n+\n+
    FaceCoordReader(const int face, const int twist=0)
    Definition geometry.cc:221
    \n+
    void coordinate(const int i, Coordinate &x) const
    Definition geometry.cc:226
    \n+
    ctype determinant() const
    Definition geometry.cc:238
    \n+
    FieldVector< ctype, dimension > Coordinate
    Definition geometry.cc:219
    \n+
    bool hasDeterminant() const
    Definition geometry.cc:233
    \n+
    Alberta::Real ctype
    Definition geometry.cc:217
    \n+
    geometry implementation for AlbertaGrid
    Definition albertagrid/geometry.hh:108
    \n+
    const JacobianTransposed & jacobianTransposed() const
    transposed of the geometry mapping's Jacobian
    Definition geometry.cc:55
    \n+
    LocalCoordinate local(const GlobalCoordinate &global) const
    map a point from the geometry to the reference element
    Definition geometry.cc:45
    \n+
    const JacobianInverseTransposed & jacobianInverseTransposed() const
    transposed inverse of the geometry mapping's Jacobian
    Definition geometry.cc:73
    \n+
    FieldVector< ctype, mydimension > LocalCoordinate
    Definition albertagrid/geometry.hh:126
    \n+
    FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
    Definition albertagrid/geometry.hh:130
    \n+
    void print(std::ostream &out) const
    Definition geometry.cc:20
    \n+
    GlobalCoordinate global(const LocalCoordinate &local) const
    map a point from the reference element to the geometry
    Definition geometry.cc:34
    \n+
    FieldVector< ctype, coorddimension > GlobalCoordinate
    Definition albertagrid/geometry.hh:127
    \n+
    FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
    Definition albertagrid/geometry.hh:129
    \n+
    Definition albertagrid/geometry.hh:303
    \n+
    Definition albertagrid/geometry.hh:504
    \n+
    static constexpr int dimension
    Definition albertagrid/geometry.hh:510
    \n+
    Grid::ctype ctype
    Definition albertagrid/geometry.hh:508
    \n+
    Definition albertagrid/geometry.hh:514
    \n+
    Definition refinement.hh:292
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,690 +1,393 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-treeiterator.hh\n+geometry.cc\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_ALBERTA_TREEITERATOR_HH\n-7#define DUNE_ALBERTA_TREEITERATOR_HH\n-8\n-9#include \n-10\n-11#include \n-12#include \n-13\n-14#include \n-15#include \n-16\n-17#if HAVE_ALBERTA\n-18\n-19namespace Dune\n-20{\n-21\n-22 // AlbertaMarkerVector\n-23 // -------------------\n-24\n-33 template< int dim, int dimworld >\n-34 class AlbertaMarkerVector\n+5#ifndef DUNE_ALBERTA_GEOMETRY_CC\n+6#define DUNE_ALBERTA_GEOMETRY_CC\n+7\n+8#include \n+9#include \n+10#include \n+11\n+12namespace Dune\n+13{\n+14\n+15 // AlbertaGridGeometry\n+16 // -------------------\n+17\n+18 // print the GeometryInformation\n+19 template \n+20 inline void AlbertaGridGeometry::print (std::ostream&\n+ss) const\n+21 {\n+22 ss << \"AlbertaGridGeometry<\" << mydim << \",\" << cdim << \"> = { \\n\";\n+23 for(int i=0; i\n+33 inline typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::\n+GlobalCoordinate\n+34 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::global ( const LocalCoordinate\n+&local ) const\n 35 {\n-36 typedef AlbertaMarkerVector<_dim,_dimworld_> This;\n-37\n-38 typedef AlbertaGrid<_dim,_dimworld_> Grid;\n-39\n-40 //friend class AlbertaGrid< dim, dimworld >;\n+36 GlobalCoordinate y = corner( 0 );\n+37 jacobianTransposed().umtv( local, y );\n+38 return y;\n+39 }\n+40\n 41\n-42 static const int dimension = Grid::dimension;\n-43\n-44 typedef Alberta::HierarchyDofNumbering<_dimension_> DofNumbering;\n-45 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-46\n-47 template< bool >\n-48 struct NoMarkSubEntities;\n-49 template< bool >\n-50 struct MarkSubEntities;\n+42 //local implementation for mydim < cdim\n+43 template< int mydim, int cdim, class GridImp >\n+44 inline typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::LocalCoordinate\n+45 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::local ( const GlobalCoordinate\n+&global ) const\n+46 {\n+47 LocalCoordinate x;\n+48 jacobianInverseTransposed().mtv( global - corner( 0 ), x );\n+49 return x;\n+50 }\n 51\n-52 public:\n-54 explicit AlbertaMarkerVector ( const DofNumbering &dofNumbering )\n-55 : dofNumbering_( dofNumbering )\n+52\n+53 template< int mydim, int cdim, class GridImp >\n+54 inline const typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::\n+JacobianTransposed &\n+55 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::jacobianTransposed () const\n 56 {\n-57 for( int codim = 0; codim <= dimension; ++codim )\n-58 marker_[ codim ] = 0;\n-59 }\n-60\n-61 AlbertaMarkerVector ( const This &other )\n-62 : dofNumbering_( other.dofNumbering_ )\n-63 {\n-64 for( int codim = 0; codim <= dimension; ++codim )\n-65 marker_[ codim ] = 0;\n+57 if( !builtJT_ )\n+58 {\n+59 const FieldVector< ctype, coorddimension > &origin = coord_[ 0 ];\n+60 for( int i = 0; i < mydimension; ++i )\n+61 {\n+62 jT_[ i ] = coord_[ i+1 ];\n+63 jT_[ i ] -= origin;\n+64 }\n+65 builtJT_ = true;\n 66 }\n-67\n-68 ~AlbertaMarkerVector ()\n-69 {\n-70 clear();\n-71 }\n-72\n-73 private:\n-74 This &operator= ( const This & );\n-75\n-76 public:\n-78 template< int codim >\n-79 bool subEntityOnElement ( const ElementInfo &elementInfo, int subEntity )\n-const;\n-80\n-81 template< int firstCodim, class Iterator >\n-82 void markSubEntities ( const Iterator &begin, const Iterator &end );\n-83\n-84 void clear ()\n-85 {\n-86 for( int codim = 0; codim <= dimension; ++codim )\n-87 {\n-88 if( marker_[ codim ] != 0 )\n-89 delete[] marker_[ codim ];\n-90 marker_[ codim ] = 0;\n-91 }\n-92 }\n-93\n-95 bool up2Date () const\n-96 {\n-97 return (marker_[ dimension ] != 0);\n-98 }\n-99\n-101 void print ( std::ostream &out = std::cout ) const;\n-102\n-103 private:\n-104 const DofNumbering &dofNumbering_;\n-105 int *marker_[ dimension+1 ];\n-106 };\n-107\n-108\n+67 return jT_;\n+68 }\n+69\n+70\n+71 template< int mydim, int cdim, class GridImp >\n+72 inline const typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::\n+JacobianInverseTransposed &\n+73 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::jacobianInverseTransposed ()\n+const\n+74 {\n+75 if( !builtJTInv_ )\n+76 {\n+77 elDet_ = std::abs( Alberta::invert( jacobianTransposed(), jTInv_ ) );\n+78 assert( elDet_ > 1.0e-25 );\n+79 calcedDet_ = true;\n+80 builtJTInv_ = true;\n+81 }\n+82 return jTInv_;\n+83 }\n+84\n+85\n+86 // built Geometry\n+87 template< int mydim, int cdim, class GridImp >\n+88 template< class CoordReader >\n+89 inline void AlbertaGridGeometry<_mydim,_cdim,_GridImp_>\n+90_::build ( const CoordReader &coordReader )\n+91 {\n+92 builtJT_ = false;\n+93 builtJTInv_ = false;\n+94\n+95 // copy corners\n+96 for( int i = 0; i < numCorners; ++i )\n+97 coordReader.coordinate( i, coord_[ i ] );\n+98\n+99 // calculate centroid\n+100 centroid_ = coord_[ 0 ];\n+101 for( int i = 1; i < numCorners; ++i )\n+102 centroid_ += coord_[ i ];\n+103 centroid_ *= 1.0 / numCorners;\n+104\n+105 elDet_ = (coordReader.hasDeterminant() ? coordReader.determinant() :\n+elDeterminant());\n+106 assert( std::abs( elDet_ ) > 0.0 );\n+107 calcedDet_ = true;\n+108 }\n 109\n-110 // AlbertaMarkerVector::NoMarkSubEntities\n-111 // --------------------------------------\n-112\n-113 template< int dim, int dimworld >\n-114 template< bool >\n-115 struct AlbertaMarkerVector< dim, dimworld >::NoMarkSubEntities\n-116 {\n-117 template< int firstCodim, class Iterator >\n-118 static void mark ( [[maybe_unused]] const DofNumbering & dofNumbering,\n-119 [[maybe_unused]] int *(&marker)[ dimension + 1 ],\n-120 [[maybe_unused]] const Iterator &begin,\n-121 [[maybe_unused]] const Iterator &end )\n-122 {}\n-123 };\n-124\n-125\n-126\n-127 // AlbertaMarkerVector::MarkSubEntities\n-128 // ------------------------------------\n-129\n-130 template< int dim, int dimworld >\n-131 template< bool >\n-132 struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities\n-133 {\n-134 template< int codim >\n-135 struct Codim\n-136 {\n-137 static const int numSubEntities = Alberta::NumSubEntities<_dimension,_codim\n->::value;\n-138\n-139 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-140\n-141 static void apply ( const DofNumbering &dofNumbering,\n-142 int *(&marker)[ dimension + 1 ],\n-143 const ElementInfo &elementInfo )\n+110\n+111#if !DUNE_ALBERTA_CACHE_COORDINATES\n+112 template< int dim, int cdim >\n+113 inline typename AlbertaGridGlobalGeometry<_dim,_cdim,_const_AlbertaGrid<\n+dim,_cdim_> >::GlobalCoordinate\n+114 AlbertaGridGlobalGeometry<_dim,_cdim,_const_AlbertaGrid<_dim,_cdim_> >::\n+global ( const LocalCoordinate &local ) const\n+115 {\n+116 GlobalCoordinate y = corner( 0 );\n+117 jacobianTransposed().umtv( local, y );\n+118 return y;\n+119 }\n+120\n+121\n+122 //local implementation for mydim < cdim\n+123 template< int dim, int cdim >\n+124 inline typename AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid<\n+dim, cdim > >::LocalCoordinate\n+125 AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::\n+local ( const GlobalCoordinate &global ) const\n+126 {\n+127 LocalCoordinate x;\n+128 jacobianInverseTransposed().mtv( global - corner( 0 ), x );\n+129 return x;\n+130 }\n+131#endif // #if !DUNE_ALBERTA_CACHE_COORDINATES\n+132\n+133\n+134\n+135 // AlbertaGridLocalGeometryProvider\n+136 // --------------------------------\n+137\n+138 template< class Grid >\n+139 void AlbertaGridLocalGeometryProvider< Grid >::buildGeometryInFather ()\n+140 {\n+141 for( int child = 0; child < numChildren; ++child )\n+142 {\n+143 for( int orientation = 0; orientation < 2; ++orientation )\n 144 {\n-145 int *array = marker[ codim ];\n-146\n-147 const int index = dofNumbering( elementInfo, 0, 0 );\n-148 for( int i = 0; i < numSubEntities; ++i )\n-149 {\n-150 int &mark = array[ dofNumbering( elementInfo, codim, i ) ];\n-151 mark = std::max( index, mark );\n-152 }\n-153 }\n-154 };\n-155\n-156 template< int firstCodim, class Iterator >\n-157 static void mark ( const DofNumbering &dofNumbering, int *(&marker)\n-[ dimension + 1 ],\n-158 const Iterator &begin, const Iterator &end )\n-159 {\n-160 for( int codim = firstCodim; codim <= dimension; ++codim )\n-161 {\n-162 const int size = dofNumbering.size( codim );\n-163 marker[ codim ] = new int[ size ];\n+145 const GeoInFatherCoordReader coordReader( child, orientation );\n+146 geometryInFather_[ child ][ orientation ] = new LocalElementGeometry\n+( coordReader );\n+147 }\n+148 }\n+149 }\n+150\n+151\n+152 template< class Grid >\n+153 void AlbertaGridLocalGeometryProvider< Grid >::buildFaceGeometry ()\n+154 {\n+155 for( int face = 0; face < numFaces; ++face )\n+156 {\n+157 for( int twist = minFaceTwist; twist <= maxFaceTwist; ++twist )\n+158 {\n+159 const FaceCoordReader coordReader( face, twist );\n+160 faceGeometry_[ face ][ twist - minFaceTwist ] = new LocalFaceGeometry\n+( coordReader );\n+161 }\n+162 }\n+163 }\n 164\n-165 int *array = marker[ codim ];\n-166 for( int i = 0; i < size; ++i )\n-167 array[ i ] = -1;\n-168 }\n+165\n+166\n+167 // AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader\n+168 // --------------------------------------------------------\n 169\n-170 for( Iterator it = begin; it != end; ++it )\n-171 {\n-172 const ElementInfo &elementInfo = it->impl().elementInfo();\n-173 Hybrid::forEach( std::make_index_sequence< dimension+1-firstCodim >{},\n-174 [ & ]( auto i ){ Codim< i+firstCodim >::apply( dofNumbering, marker,\n-elementInfo ); } );\n-175 }\n-176 }\n-177 };\n-178\n+170 template< class Grid >\n+171 struct AlbertaGridLocalGeometryProvider< Grid >::GeoInFatherCoordReader\n+172 {\n+173 typedef Alberta::Real ctype;\n+174\n+175 typedef FieldVector<_ctype,_dimension_> Coordinate;\n+176\n+177 private:\n+178 typedef Alberta::GeometryInFather<_dimension_> GeoInFather;\n 179\n-180\n-181 // AlbertaGridTreeIterator\n-182 // -----------------------\n-183\n-187 template< int codim, class GridImp, bool leafIterator >\n-188 class AlbertaGridTreeIterator\n-189 {\n-190 typedef AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_> This;\n-191\n-192 public:\n-193 static const int dimension = GridImp::dimension;\n-194 static const int codimension = codim;\n-195 static const int dimensionworld = GridImp::dimensionworld;\n-196\n-197 private:\n-198 friend class AlbertaGrid< dimension, dimensionworld >;\n-199\n-200 static const int numSubEntities\n-201 = Alberta::NumSubEntities<_dimension,_codimension_>::value;\n-202\n-203 public:\n-204 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n-205 typedef typename MeshPointer::MacroIterator MacroIterator;\n-206\n-207 typedef typename GridImp::template Codim< codim >::Entity Entity;\n-208 typedef MakeableInterfaceObject<_Entity_> EntityObject;\n-209 typedef typename EntityObject::ImplementationType EntityImp;\n-210 typedef typename EntityImp::ElementInfo ElementInfo;\n-211\n-212 typedef AlbertaMarkerVector<_dimension,_dimensionworld_> MarkerVector;\n+180 public:\n+181 GeoInFatherCoordReader ( int child, int orientation )\n+182 : child_( child ),\n+183 orientation_( orientation )\n+184 {}\n+185\n+186 void coordinate ( int i, Coordinate &x ) const\n+187 {\n+188 const typename GeoInFather::LocalVector &coord\n+189 = GeoInFather::coordinate( child_, orientation_, i );\n+190 for( int j = 0; j < dimension; ++j )\n+191 x[ j ] = coord[ j ];\n+192 }\n+193\n+194 bool hasDeterminant () const\n+195 {\n+196 return false;\n+197 }\n+198\n+199 ctype determinant () const\n+200 {\n+201 return ctype( 0 );\n+202 }\n+203\n+204 private:\n+205 const int child_;\n+206 const int orientation_;\n+207 };\n+208\n+209\n+210\n+211 // AlbertaGridLocalGeometryProvider::FaceCoordReader\n+212 // -------------------------------------------------\n 213\n-214 AlbertaGridTreeIterator ();\n-215\n-217 AlbertaGridTreeIterator ( const This &other );\n+214 template< class Grid >\n+215 struct AlbertaGridLocalGeometryProvider< Grid >::FaceCoordReader\n+216 {\n+217 typedef Alberta::Real ctype;\n 218\n-220 This &operator=_( const This &other );\n-221\n-223 AlbertaGridTreeIterator ( const GridImp &grid, int travLevel );\n-224\n-226 AlbertaGridTreeIterator ( const GridImp &grid,\n-227 const MarkerVector *marker,\n-228 int travLevel );\n-229\n-231 bool equals ( const This &other ) const\n-232 {\n-233 return entity_.impl().equals( other.entity_.impl() );\n-234 }\n-235\n-237 Entity &dereference () const\n-238 {\n-239 return entity_;\n-240 }\n-241\n-243 int level () const\n-244 {\n-245 return entity_.impl().level();\n-246 }\n-247\n-249 void increment();\n+219 typedef FieldVector<_ctype,_dimension_> Coordinate;\n+220\n+221 FaceCoordReader ( const int face, const int twist = 0 )\n+222 : face_( face ),\n+223 twist_( twist )\n+224 {}\n+225\n+226 void coordinate ( const int i, Coordinate &x ) const\n+227 {\n+228 const int ti = Alberta::applyInverseTwist< dimension-1 >( twist_, i );\n+229 const int j = mapVertices<_1_>( face_, ti );\n+230 refCorner( j, x );\n+231 }\n+232\n+233 bool hasDeterminant () const\n+234 {\n+235 return false;\n+236 }\n+237\n+238 ctype determinant () const\n+239 {\n+240 return ctype( 0 );\n+241 }\n+242\n+243 private:\n+244 static void refCorner ( const int i, Coordinate &x )\n+245 {\n+246 x = ctype( 0 );\n+247 if( i > 0 )\n+248 x[ i-1 ] = ctype( 1 );\n+249 }\n 250\n-251 protected:\n-253 const GridImp &grid () const\n-254 {\n-255 return entity_.impl().grid();\n-256 }\n-257\n-258 private:\n-259 void nextElement ( ElementInfo &elementInfo );\n-260 void nextElementStop (ElementInfo &elementInfo );\n-261 bool stopAtElement ( const ElementInfo &elementInfo ) const;\n-262\n-263 void goNext ( ElementInfo &elementInfo );\n-264 void goNext ( const std::integral_constant< int, 0 > cdVariable,\n-265 ElementInfo &elementInfo );\n-266 void goNext ( const std::integral_constant< int, 1 > cdVariable,\n-267 ElementInfo &elementInfo );\n-268 template< int cd >\n-269 void goNext ( const std::integral_constant< int, cd > cdVariable,\n-270 ElementInfo &elementInfo );\n-271\n-272 mutable Entity entity_;\n-273\n-275 int level_;\n-276\n-278 int subEntity_;\n-279\n-280 MacroIterator macroIterator_;\n-281\n-282 // knows on which element a point,edge,face is viewed\n-283 const MarkerVector *marker_;\n-284 };\n-285\n-286\n-287\n-288 // Implementation of AlbertaMarkerVector\n-289 // -------------------------------------\n-290\n-291 template< int dim, int dimworld >\n-292 template< int codim >\n-293 inline bool AlbertaMarkerVector< dim, dimworld >\n-294 ::subEntityOnElement ( const ElementInfo &elementInfo, int subEntity )\n-const\n-295 {\n-296 assert( marker_[ codim ] != 0 );\n-297\n-298 const int subIndex = dofNumbering_( elementInfo, codim, subEntity );\n-299 const int markIndex = marker_[ codim ][ subIndex ];\n-300 assert( (markIndex >= 0) );\n-301\n-302 const int index = dofNumbering_( elementInfo, 0, 0 );\n-303 return (markIndex == index);\n-304 }\n-305\n-306\n-307 template< int dim, int dimworld >\n-308 template< int firstCodim, class Iterator >\n-309 inline void AlbertaMarkerVector<_dim,_dimworld_>\n-310_::markSubEntities ( const Iterator &begin, const Iterator &end )\n-311 {\n-312 clear();\n-313 std::conditional< (firstCodim <= dimension), MarkSubEntities,\n-NoMarkSubEntities >::type\n-314 ::template mark< firstCodim, Iterator >( dofNumbering_, marker_, begin, end\n-);\n-315 }\n-316\n-317\n-318 template< int dim, int dimworld >\n-319 inline void AlbertaMarkerVector<_dim,_dimworld_>::print ( std::ostream &out\n-) const\n-320 {\n-321 for( int codim = 1; codim <= dimension; ++codim )\n-322 {\n-323 int *marker = marker_[ codim ];\n-324 if( marker != 0 )\n-325 {\n-326 const int size = dofNumbering_.size( codim );\n-327 out << std::endl;\n-328 out << \"Codimension \" << codim << \" (\" << size << \" entries)\" << std::endl;\n-329 for( int i = 0; i < size; ++i )\n-330 out << \"subentity \" << i << \" visited on Element \" << marker[ i ] << std::\n-endl;\n-331 }\n-332 }\n-333 }\n-334\n-335\n-336\n-337 // Implementation of AlbertaGridTreeIterator\n-338 // -----------------------------------------\n-339\n-340 template< int codim, class GridImp, bool leafIterator >\n-341 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n-342_::AlbertaGridTreeIterator ()\n-343 : entity_(),\n-344 level_( -1 ),\n-345 subEntity_( -1 ),\n-346 macroIterator_(),\n-347 marker_( NULL )\n-348 {}\n-349\n-350 template< int codim, class GridImp, bool leafIterator >\n-351 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n-352_::AlbertaGridTreeIterator ( const GridImp &grid,\n-353 const MarkerVector *marker,\n-354 int travLevel )\n-355 : entity_( EntityImp( grid ) ),\n-356 level_( travLevel ),\n-357 subEntity_( (codim == 0 ? 0 : -1) ),\n-358 macroIterator_( grid.meshPointer().begin() ),\n-359 marker_( marker )\n-360 {\n-361 ElementInfo elementInfo = *macroIterator_;\n-362 nextElementStop( elementInfo );\n-363 if( codim > 0 )\n-364 goNext( elementInfo );\n-365 // it is ok to set the invalid ElementInfo\n-366 entity_.impl().setElement( elementInfo, subEntity_ );\n-367 }\n-368\n-369\n-370 // Make LevelIterator with point to element from previous iterations\n-371 template< int codim, class GridImp, bool leafIterator >\n-372 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n-373_::AlbertaGridTreeIterator ( const GridImp &grid,\n-374 int travLevel )\n-375 : entity_( EntityImp( grid ) ),\n-376 level_( travLevel ),\n-377 subEntity_( -1 ),\n-378 macroIterator_( grid.meshPointer().end() ),\n-379 marker_( 0 )\n-380 {}\n-381\n-382\n-383 // Make LevelIterator with point to element from previous iterations\n-384 template< int codim, class GridImp, bool leafIterator >\n-385 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n-386_::AlbertaGridTreeIterator( const This &other )\n-387 : entity_( other.entity_ ),\n-388 level_( other.level_ ),\n-389 subEntity_( other.subEntity_ ),\n-390 macroIterator_( other.macroIterator_ ),\n-391 marker_( other.marker_ )\n-392 {}\n-393\n-394\n-395 // Make LevelIterator with point to element from previous iterations\n-396 template< int codim, class GridImp, bool leafIterator >\n-397 inline typename AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>::\n-This &\n-398 AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>::operator=_( const\n-This &other )\n-399 {\n-400 entity_ = other.entity_;\n-401 level_ = other.level_;\n-402 subEntity_ = other.subEntity_;\n-403 macroIterator_ = other.macroIterator_;\n-404 marker_ = other.marker_;\n-405\n-406 return *this;\n-407 }\n-408\n-409\n-410 template< int codim, class GridImp, bool leafIterator >\n-411 inline void AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>::\n-increment ()\n-412 {\n-413 ElementInfo elementInfo = entity_.impl().elementInfo_;\n-414 goNext ( elementInfo );\n-415 // it is ok to set the invalid ElementInfo\n-416 entity_.impl().setElement( elementInfo, subEntity_ );\n-417 }\n-418\n-419\n-420 template< int codim, class GridImp, bool leafIterator >\n-421 inline void AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n-422_::nextElement ( ElementInfo &elementInfo )\n-423 {\n-424 if( elementInfo.isLeaf() || (elementInfo.level() >= level_) )\n-425 {\n-426 while( (elementInfo.level() > 0) && (elementInfo.indexInFather() == 1) )\n-427 elementInfo = elementInfo.father();\n-428 if( elementInfo.level() == 0 )\n-429 {\n-430 ++macroIterator_;\n-431 elementInfo = *macroIterator_;\n-432 }\n-433 else\n-434 elementInfo = elementInfo.father().child( 1 );\n-435 }\n-436 else\n-437 elementInfo = elementInfo.child( 0 );\n-438 }\n-439\n-440\n-441 template< int codim, class GridImp, bool leafIterator >\n-442 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n-443 ::nextElementStop ( ElementInfo &elementInfo )\n-444 {\n-445 while( !(!elementInfo || stopAtElement( elementInfo )) )\n-446 nextElement( elementInfo );\n-447 }\n-448\n-449\n-450 template< int codim, class GridImp, bool leafIterator >\n-451 inline bool AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n-452 ::stopAtElement ( const ElementInfo &elementInfo ) const\n-453 {\n-454 if( !elementInfo )\n-455 return true;\n-456 return (leafIterator ? elementInfo.isLeaf() : (level_ == elementInfo.level\n-()));\n-457 }\n-458\n-459\n-460 template< int codim, class GridImp, bool leafIterator >\n-461 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n-462 ::goNext ( ElementInfo &elementInfo )\n-463 {\n-464 std::integral_constant< int, codim > codimVariable;\n-465 goNext( codimVariable, elementInfo );\n-466 }\n-467\n-468 template< int codim, class GridImp, bool leafIterator >\n-469 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n-470 ::goNext ( const std::integral_constant< int, 0 > /* cdVariable */,\n-471 ElementInfo &elementInfo )\n-472 {\n-473 assert( stopAtElement( elementInfo ) );\n-474\n-475 nextElement( elementInfo );\n-476 nextElementStop( elementInfo );\n-477 }\n-478\n-479 template< int codim, class GridImp, bool leafIterator >\n-480 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n-481 ::goNext ( const std::integral_constant< int, 1 > cdVariable,\n-482 ElementInfo &elementInfo )\n-483 {\n-484 assert( stopAtElement( elementInfo ) );\n-485\n-486 ++subEntity_;\n-487 if( subEntity_ >= numSubEntities )\n-488 {\n-489 subEntity_ = 0;\n-490 nextElement( elementInfo );\n-491 nextElementStop( elementInfo );\n-492 if( !elementInfo )\n-493 return;\n-494 }\n-495\n-496 if( leafIterator )\n-497 {\n-498 const int face = (dimension == 1 ? (numSubEntities-1)-subEntity_ :\n-subEntity_);\n-499\n-500 const ALBERTA EL *neighbor = elementInfo.elInfo().neigh[ face ];\n-501 if( (neighbor != NULL) && !elementInfo.isBoundary( face ) )\n-502 {\n-503 // face is reached from element with largest number\n-504 const int elIndex = grid().dofNumbering() ( elementInfo, 0, 0 );\n-505 const int nbIndex = grid().dofNumbering() ( neighbor, 0, 0 );\n-506 if( elIndex < nbIndex )\n-507 goNext( cdVariable, elementInfo );\n-508 }\n-509 // uncomment this assertion only if codimension 1 entities are marked\n-510 // assert( marker_->template subEntityOnElement< 1 >( elementInfo,\n-subEntity_ ) );\n-511 }\n-512 else\n-513 {\n-514 assert( marker_ != 0 );\n-515 if( !marker_->template subEntityOnElement< 1 >( elementInfo, subEntity_ ) )\n-516 goNext( cdVariable, elementInfo );\n-517 }\n-518 }\n-519\n-520 template< int codim, class GridImp, bool leafIterator >\n-521 template< int cd >\n-522 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n-523 ::goNext ( const std::integral_constant< int, cd > cdVariable,\n-524 ElementInfo &elementInfo )\n-525 {\n-526 assert( stopAtElement( elementInfo ) );\n-527\n-528 ++subEntity_;\n-529 if( subEntity_ >= numSubEntities )\n-530 {\n-531 subEntity_ = 0;\n-532 nextElement( elementInfo );\n-533 nextElementStop( elementInfo );\n-534 if( !elementInfo )\n-535 return;\n-536 }\n-537\n-538 assert( marker_ != 0 );\n-539 if( !marker_->template subEntityOnElement< cd >( elementInfo, subEntity_ )\n-)\n-540 goNext( cdVariable, elementInfo );\n-541 }\n-542\n-543}\n-544\n-545#endif // #if HAVE_ALBERTA\n-546\n-547#endif // #ifndef DUNE_ALBERTA_TREEITERATOR_HH\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n-meshpointer.hh\n-provides a wrapper for ALBERTA's mesh structure\n-ALBERTA\n-#define ALBERTA\n-Definition albertaheader.hh:29\n+251 int face_;\n+252 int twist_;\n+253 };\n+254\n+255} // namespace Dune\n+256\n+257#endif // #ifndef DUNE_ALBERTA_GEOMETRY_CC\n+refinement.hh\n+provides a wrapper for ALBERTA's refinement patches and the corners for\n+geometryInFather\n+algebra.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::AlbertaGrid<_dim,_dimworld_>\n-Dune::AlbertaGrid<_dim,_dimworld_>::dimension\n-static const int dimension\n-Definition agrid.hh:145\n-Dune::Alberta::MeshPointer<_dimension_>\n-Dune::Alberta::HierarchyDofNumbering<_dimension_>\n-Dune::Alberta::HierarchyDofNumbering::size\n-int size(int codim) const\n-Definition dofadmin.hh:163\n-Dune::Alberta::ElementInfo<_dimension_>\n-Dune::AlbertaGridTreeIterator\n-Definition treeiterator.hh:189\n-Dune::AlbertaGridTreeIterator::equals\n-bool equals(const This &other) const\n-equality\n-Definition treeiterator.hh:231\n-Dune::AlbertaGridTreeIterator::EntityObject\n-MakeableInterfaceObject< Entity > EntityObject\n-Definition treeiterator.hh:208\n-Dune::AlbertaGridTreeIterator::MeshPointer\n-Alberta::MeshPointer< dimension > MeshPointer\n-Definition treeiterator.hh:204\n-Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n-AlbertaGridTreeIterator(const GridImp &grid, const MarkerVector *marker, int\n-travLevel)\n-Constructor making begin iterator.\n-Definition treeiterator.hh:352\n-Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n-AlbertaGridTreeIterator(const GridImp &grid, int travLevel)\n-Constructor making end iterator.\n-Definition treeiterator.hh:373\n-Dune::AlbertaGridTreeIterator::EntityImp\n-EntityObject::ImplementationType EntityImp\n-Definition treeiterator.hh:209\n-Dune::AlbertaGridTreeIterator::codimension\n-static const int codimension\n-Definition treeiterator.hh:194\n-Dune::AlbertaGridTreeIterator::MacroIterator\n-MeshPointer::MacroIterator MacroIterator\n-Definition treeiterator.hh:205\n-Dune::AlbertaGridTreeIterator::operator=\n-This & operator=(const This &other)\n-Constructor making end iterator.\n-Definition treeiterator.hh:398\n-Dune::AlbertaGridTreeIterator::dereference\n-Entity & dereference() const\n-dereferencing\n-Definition treeiterator.hh:237\n-Dune::AlbertaGridTreeIterator::MarkerVector\n-AlbertaMarkerVector< dimension, dimensionworld > MarkerVector\n-Definition treeiterator.hh:212\n-Dune::AlbertaGridTreeIterator::Entity\n-GridImp::template Codim< codim >::Entity Entity\n-Definition treeiterator.hh:207\n-Dune::AlbertaGridTreeIterator::level\n-int level() const\n-ask for level of entities\n-Definition treeiterator.hh:243\n-Dune::AlbertaGridTreeIterator::dimensionworld\n-static const int dimensionworld\n-Definition treeiterator.hh:195\n-Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n-AlbertaGridTreeIterator()\n-Definition treeiterator.hh:342\n-Dune::AlbertaGridTreeIterator::increment\n-void increment()\n-increment\n-Definition treeiterator.hh:411\n-Dune::AlbertaGridTreeIterator::grid\n-const GridImp & grid() const\n-obtain a reference to the grid\n-Definition treeiterator.hh:253\n-Dune::AlbertaGridTreeIterator::dimension\n-static const int dimension\n-Definition treeiterator.hh:193\n-Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n-AlbertaGridTreeIterator(const This &other)\n-Constructor making end iterator.\n-Definition treeiterator.hh:386\n-Dune::AlbertaGridTreeIterator::ElementInfo\n-EntityImp::ElementInfo ElementInfo\n-Definition treeiterator.hh:210\n-Dune::Alberta::NumSubEntities\n-Definition misc.hh:148\n-Dune::AlbertaMarkerVector\n-marker assigning subentities to one element containing them\n-Definition treeiterator.hh:35\n-Dune::AlbertaMarkerVector::AlbertaMarkerVector\n-AlbertaMarkerVector(const DofNumbering &dofNumbering)\n-create AlbertaMarkerVector with empty vectors\n-Definition treeiterator.hh:54\n-Dune::AlbertaMarkerVector::up2Date\n-bool up2Date() const\n-return true if marking is up to date\n-Definition treeiterator.hh:95\n-Dune::AlbertaMarkerVector::subEntityOnElement\n-bool subEntityOnElement(const ElementInfo &elementInfo, int subEntity) const\n-visit subentity on this element?\n-Definition treeiterator.hh:294\n-Dune::AlbertaMarkerVector::markSubEntities\n-void markSubEntities(const Iterator &begin, const Iterator &end)\n-Definition treeiterator.hh:310\n-Dune::AlbertaMarkerVector::~AlbertaMarkerVector\n-~AlbertaMarkerVector()\n-Definition treeiterator.hh:68\n-Dune::AlbertaMarkerVector::clear\n-void clear()\n-Definition treeiterator.hh:84\n-Dune::AlbertaMarkerVector::AlbertaMarkerVector\n-AlbertaMarkerVector(const This &other)\n-Definition treeiterator.hh:61\n-Dune::AlbertaMarkerVector::print\n-void print(std::ostream &out=std::cout) const\n-print for debugin' only\n-Definition treeiterator.hh:319\n-Dune::AlbertaMarkerVector::MarkSubEntities::Codim\n-Definition treeiterator.hh:136\n-Dune::AlbertaMarkerVector::MarkSubEntities::Codim::ElementInfo\n-Alberta::ElementInfo< dimension > ElementInfo\n-Definition treeiterator.hh:139\n-Dune::AlbertaMarkerVector::MarkSubEntities::Codim::apply\n-static void apply(const DofNumbering &dofNumbering, int *(&marker)\n-[dimension+1], const ElementInfo &elementInfo)\n-Definition treeiterator.hh:141\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::MakeableInterfaceObject<_Entity_>\n-Dune::MakeableInterfaceObject<_Entity_>::ImplementationType\n-InterfaceType::Implementation ImplementationType\n-Definition common/grid.hh:1122\n+Dune::Alberta::applyInverseTwist\n+int applyInverseTwist(int twist, int i)\n+Definition misc.hh:637\n+Dune::Alberta::Real\n+ALBERTA REAL Real\n+Definition misc.hh:48\n+Dune::Alberta::invert\n+static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 >\n+&inverse)\n+Definition algebra.hh:81\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader\n+Definition geometry.cc:172\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::Coordinate\n+FieldVector< ctype, dimension > Coordinate\n+Definition geometry.cc:175\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::ctype\n+Alberta::Real ctype\n+Definition geometry.cc:173\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::coordinate\n+void coordinate(int i, Coordinate &x) const\n+Definition geometry.cc:186\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::\n+GeoInFatherCoordReader\n+GeoInFatherCoordReader(int child, int orientation)\n+Definition geometry.cc:181\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::hasDeterminant\n+bool hasDeterminant() const\n+Definition geometry.cc:194\n+Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::determinant\n+ctype determinant() const\n+Definition geometry.cc:199\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader\n+Definition geometry.cc:216\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::FaceCoordReader\n+FaceCoordReader(const int face, const int twist=0)\n+Definition geometry.cc:221\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::coordinate\n+void coordinate(const int i, Coordinate &x) const\n+Definition geometry.cc:226\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::determinant\n+ctype determinant() const\n+Definition geometry.cc:238\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::Coordinate\n+FieldVector< ctype, dimension > Coordinate\n+Definition geometry.cc:219\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::hasDeterminant\n+bool hasDeterminant() const\n+Definition geometry.cc:233\n+Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::ctype\n+Alberta::Real ctype\n+Definition geometry.cc:217\n+Dune::AlbertaGridGeometry\n+geometry implementation for AlbertaGrid\n+Definition albertagrid/geometry.hh:108\n+Dune::AlbertaGridGeometry::jacobianTransposed\n+const JacobianTransposed & jacobianTransposed() const\n+transposed of the geometry mapping's Jacobian\n+Definition geometry.cc:55\n+Dune::AlbertaGridGeometry::local\n+LocalCoordinate local(const GlobalCoordinate &global) const\n+map a point from the geometry to the reference element\n+Definition geometry.cc:45\n+Dune::AlbertaGridGeometry::jacobianInverseTransposed\n+const JacobianInverseTransposed & jacobianInverseTransposed() const\n+transposed inverse of the geometry mapping's Jacobian\n+Definition geometry.cc:73\n+Dune::AlbertaGridGeometry::LocalCoordinate\n+FieldVector< ctype, mydimension > LocalCoordinate\n+Definition albertagrid/geometry.hh:126\n+Dune::AlbertaGridGeometry::JacobianInverseTransposed\n+FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed\n+Definition albertagrid/geometry.hh:130\n+Dune::AlbertaGridGeometry::print\n+void print(std::ostream &out) const\n+Definition geometry.cc:20\n+Dune::AlbertaGridGeometry::global\n+GlobalCoordinate global(const LocalCoordinate &local) const\n+map a point from the reference element to the geometry\n+Definition geometry.cc:34\n+Dune::AlbertaGridGeometry::GlobalCoordinate\n+FieldVector< ctype, coorddimension > GlobalCoordinate\n+Definition albertagrid/geometry.hh:127\n+Dune::AlbertaGridGeometry::JacobianTransposed\n+FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed\n+Definition albertagrid/geometry.hh:129\n+Dune::AlbertaGridGlobalGeometry\n+Definition albertagrid/geometry.hh:303\n+Dune::AlbertaGridLocalGeometryProvider\n+Definition albertagrid/geometry.hh:504\n+Dune::AlbertaGridLocalGeometryProvider::dimension\n+static constexpr int dimension\n+Definition albertagrid/geometry.hh:510\n+Dune::AlbertaGridLocalGeometryProvider::ctype\n+Grid::ctype ctype\n+Definition albertagrid/geometry.hh:508\n+Dune::AlbertaGridLocalGeometryProvider::Codim\n+Definition albertagrid/geometry.hh:514\n+Dune::Alberta::GeometryInFather\n+Definition refinement.hh:292\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+geometry.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00668.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00668.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dofvector.hh File Reference\n+dune-grid: albertareader.hh File Reference\n \n \n \n \n \n \n \n@@ -71,58 +71,35 @@\n \n \n \n
    \n \n-
    dofvector.hh File Reference
    \n+Namespaces
    \n+
    albertareader.hh File Reference
    \n \n
    \n-
    #include <cstdlib>
    \n-#include <limits>
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/elementinfo.hh>
    \n-#include <dune/grid/albertagrid/refinement.hh>
    \n+
    #include <dune/geometry/type.hh>
    \n+#include <dune/grid/common/grid.hh>
    \n+#include <dune/grid/common/gridfactory.hh>
    \n+#include <dune/grid/albertagrid/macrodata.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 Classes

    struct  Dune::Alberta::DofVectorProvider< int >
     
    struct  Dune::Alberta::DofVectorProvider< signed char >
     
    struct  Dune::Alberta::DofVectorProvider< unsigned char >
     
    struct  Dune::Alberta::DofVectorProvider< Real >
     
    struct  Dune::Alberta::DofVectorProvider< GlobalVector >
     
    class  Dune::Alberta::DofVectorPointer< Dof >
    class  Dune::AlbertaReader< Grid >
     
    \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

    void Dune::Alberta::abs (const DofVectorPointer< int > &dofVector)
     
    int Dune::Alberta::max (const DofVectorPointer< int > &dofVector)
     
    int Dune::Alberta::min (const DofVectorPointer< int > &dofVector)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,43 +1,23 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces | Functions\n-dofvector.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces\n+albertareader.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::Alberta::DofVectorProvider<_int_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::DofVectorProvider<_signed_char_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::DofVectorProvider<_unsigned_char_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::DofVectorProvider<_Real_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::DofVectorProvider<_GlobalVector_>\n-\u00a0\n- class \u00a0 Dune::Alberta::DofVectorPointer<_Dof_>\n+class \u00a0 Dune::AlbertaReader<_Grid_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::Alberta\n-\u00a0\n-Functions\n-void\u00a0 Dune::Alberta::abs (const DofVectorPointer< int > &dofVector)\n-\u00a0\n- int\u00a0 Dune::Alberta::max (const DofVectorPointer< int > &dofVector)\n-\u00a0\n- int\u00a0 Dune::Alberta::min (const DofVectorPointer< int > &dofVector)\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00668_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00668_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dofvector.hh Source File\n+dune-grid: albertareader.hh Source File\n \n \n \n \n \n \n \n@@ -74,532 +74,134 @@\n \n \n
    \n
    \n-
    dofvector.hh
    \n+
    albertareader.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_DOFVECTOR_HH
    \n-
    6#define DUNE_ALBERTA_DOFVECTOR_HH
    \n+
    5#ifndef DUNE_ALBERTA_ALBERTAREADER_HH
    \n+
    6#define DUNE_ALBERTA_ALBERTAREADER_HH
    \n
    7
    \n-
    8#include <cstdlib>
    \n-
    9#include <limits>
    \n-
    10
    \n-\n-\n-\n+
    8#include <dune/geometry/type.hh>
    \n+
    9
    \n+\n+\n+
    12
    \n+\n
    14
    \n
    15#if HAVE_ALBERTA
    \n
    16
    \n
    17namespace Dune
    \n
    18{
    \n
    19
    \n-
    20 namespace Alberta
    \n-
    21 {
    \n-
    22
    \n-
    23 // External Forward Declarations
    \n-
    24 // -----------------------------
    \n-
    25
    \n-
    26 template< int dim >
    \n-
    27 class MeshPointer;
    \n-
    28
    \n+
    20 template< class Grid >
    \n+
    \n+\n+
    22 {
    \n+\n+
    24
    \n+
    25 public:
    \n+\n+
    27
    \n+
    28 typedef typename Grid::ctype ctype;
    \n
    29
    \n-
    30
    \n-
    31 // DofVectorProvider
    \n-
    32 // -----------------
    \n-
    33
    \n-
    34 template< class Dof >
    \n-\n+
    30 static const int dimension = Grid::dimension;
    \n+\n+
    32
    \n+
    33 private:
    \n+
    34 static_assert(dimensionworld == Alberta::dimWorld,
    \n+
    35 "AlbertaReader: world dimension must match ALBERTA's world dimension.");
    \n
    36
    \n-
    37 template<>
    \n-
    \n-
    38 struct DofVectorProvider< int >
    \n-
    39 {
    \n-
    40 typedef ALBERTA DOF_INT_VEC DofVector;
    \n-
    41
    \n-
    \n-
    42 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n-
    43 {
    \n-
    44 return ALBERTA get_dof_int_vec( name.c_str(), dofSpace );
    \n-
    45 }
    \n-
    \n-
    46
    \n-
    \n-
    47 static void free ( DofVector *dofVector )
    \n-
    48 {
    \n-
    49 ALBERTA free_dof_int_vec( dofVector );
    \n-
    50 }
    \n-
    \n-
    51
    \n-
    \n-
    52 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n-
    53 {
    \n-
    54 return ALBERTA read_dof_int_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n-
    55 }
    \n-
    \n-
    56
    \n-
    \n-
    57 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n-
    58 {
    \n-
    59 int success = ALBERTA write_dof_int_vec_xdr( dofVector, filename.c_str() );
    \n-
    60 return (success == 0);
    \n-
    61 }
    \n-
    \n-
    62 };
    \n-
    \n+\n+
    38
    \n+
    39 MacroData macroData_;
    \n+
    40
    \n+
    41 AlbertaReader ( const This & );
    \n+
    42 This &operator= ( const This & );
    \n+
    43
    \n+
    44 public:
    \n+
    \n+\n+
    46 {}
    \n+
    \n+
    47
    \n+
    \n+
    48 void readGrid ( const std::string &fileName, GridFactory &factory )
    \n+
    49 {
    \n+
    50 // read ALBERTA macro triangulation
    \n+
    51 macroData_.read( fileName, false );
    \n+
    52
    \n+
    53 // insert all vertices into the factory
    \n+
    54 const int numVertices = macroData_.vertexCount();
    \n+
    55 for( int i = 0; i < numVertices; ++i )
    \n+
    56 {
    \n+
    57 FieldVector< ctype, dimensionworld > v;
    \n+
    58 const Alberta::GlobalVector &coords = macroData_.vertex( i );
    \n+
    59 for( int j = 0; j < dimensionworld; ++j )
    \n+
    60 v[ j ] = coords[ j ];
    \n+
    61 factory.insertVertex( v );
    \n+
    62 }
    \n
    63
    \n-
    64 template<>
    \n-
    \n-
    65 struct DofVectorProvider< signed char >
    \n-
    66 {
    \n-
    67 typedef ALBERTA DOF_SCHAR_VEC DofVector;
    \n-
    68
    \n-
    \n-
    69 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n-
    70 {
    \n-
    71 return ALBERTA get_dof_schar_vec( name.c_str(), dofSpace );
    \n-
    72 }
    \n-
    \n-
    73
    \n-
    \n-
    74 static void free ( DofVector *dofVector )
    \n-
    75 {
    \n-
    76 ALBERTA free_dof_schar_vec( dofVector );
    \n-
    77 }
    \n-
    \n-
    78
    \n-
    \n-
    79 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n-
    80 {
    \n-
    81 return ALBERTA read_dof_schar_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n-
    82 }
    \n-
    \n+
    64 // insert all elements into the factory
    \n+
    65 std::vector< unsigned int > vertices( dimension+1 );
    \n+
    66 const int numElements = macroData_.elementCount();
    \n+
    67 for( int i = 0; i < numElements; ++i )
    \n+
    68 {
    \n+
    69 const typename MacroData::ElementId &id = macroData_.element( i );
    \n+
    70 for( int j = 0; j <= dimension; ++j )
    \n+
    71 vertices[ j ] = id[ j ];
    \n+
    72 factory.insertElement( GeometryTypes::simplex( dimension ), vertices );
    \n+
    73 }
    \n+
    74
    \n+
    75 // release ALBERTA macro data
    \n+
    76 macroData_.release();
    \n+
    77 }
    \n+
    \n+
    78 };
    \n+
    \n+
    79
    \n+
    80}
    \n+
    81
    \n+
    82#endif // #if HAVE_ALBERTA
    \n
    83
    \n-
    \n-
    84 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n-
    85 {
    \n-
    86 int success = ALBERTA write_dof_schar_vec_xdr( dofVector, filename.c_str() );
    \n-
    87 return (success == 0);
    \n-
    88 }
    \n-
    \n-
    89 };
    \n-
    \n-
    90
    \n-
    91 template<>
    \n-
    \n-
    92 struct DofVectorProvider< unsigned char >
    \n-
    93 {
    \n-
    94 typedef ALBERTA DOF_UCHAR_VEC DofVector;
    \n-
    95
    \n-
    \n-
    96 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n-
    97 {
    \n-
    98 return ALBERTA get_dof_uchar_vec( name.c_str(), dofSpace );
    \n-
    99 }
    \n-
    \n-
    100
    \n-
    \n-
    101 static void free ( DofVector *dofVector )
    \n-
    102 {
    \n-
    103 ALBERTA free_dof_uchar_vec( dofVector );
    \n-
    104 }
    \n-
    \n-
    105
    \n-
    \n-
    106 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n-
    107 {
    \n-
    108 return ALBERTA read_dof_uchar_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n-
    109 }
    \n-
    \n-
    110
    \n-
    \n-
    111 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n-
    112 {
    \n-
    113 int success = ALBERTA write_dof_uchar_vec_xdr( dofVector, filename.c_str() );
    \n-
    114 return (success == 0);
    \n-
    115 }
    \n-
    \n-
    116 };
    \n-
    \n-
    117
    \n-
    118 template<>
    \n-
    \n-\n-
    120 {
    \n-
    121 typedef ALBERTA DOF_REAL_VEC DofVector;
    \n-
    122
    \n-
    \n-
    123 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n-
    124 {
    \n-
    125 return ALBERTA get_dof_real_vec( name.c_str(), dofSpace );
    \n-
    126 }
    \n-
    \n-
    127
    \n-
    \n-
    128 static void free ( DofVector *dofVector )
    \n-
    129 {
    \n-
    130 ALBERTA free_dof_real_vec( dofVector );
    \n-
    131 }
    \n-
    \n-
    132
    \n-
    \n-
    133 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n-
    134 {
    \n-
    135 return ALBERTA read_dof_real_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n-
    136 }
    \n-
    \n-
    137
    \n-
    \n-
    138 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n-
    139 {
    \n-
    140 int success = ALBERTA write_dof_real_vec_xdr( dofVector, filename.c_str() );
    \n-
    141 return (success == 0);
    \n-
    142 }
    \n-
    \n-
    143 };
    \n-
    \n-
    144
    \n-
    145 template<>
    \n-
    \n-\n-
    147 {
    \n-
    148 typedef ALBERTA DOF_REAL_D_VEC DofVector;
    \n-
    149
    \n-
    \n-
    150 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n-
    151 {
    \n-
    152 return ALBERTA get_dof_real_d_vec( name.c_str(), dofSpace );
    \n-
    153 }
    \n-
    \n-
    154
    \n-
    \n-
    155 static void free ( DofVector *dofVector )
    \n-
    156 {
    \n-
    157 ALBERTA free_dof_real_d_vec( dofVector );
    \n-
    158 }
    \n-
    \n-
    159
    \n-
    \n-
    160 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n-
    161 {
    \n-
    162 return ALBERTA read_dof_real_d_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n-
    163 }
    \n-
    \n-
    164
    \n-
    \n-
    165 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n-
    166 {
    \n-
    167 int success = ALBERTA write_dof_real_d_vec_xdr( dofVector, filename.c_str() );
    \n-
    168 return (success == 0);
    \n-
    169 }
    \n-
    \n-
    170 };
    \n-
    \n-
    171
    \n-
    172
    \n-
    173
    \n-
    174 // DofVectorPointer
    \n-
    175 // ----------------
    \n-
    176
    \n-
    177 template< class Dof >
    \n-
    \n-\n-
    179 {
    \n-\n-
    181
    \n-\n-
    183
    \n-
    184 public:
    \n-
    185 typedef typename DofVectorProvider::DofVector DofVector;
    \n-
    186
    \n-
    187 static const bool supportsAdaptationData = true;
    \n-
    188
    \n-
    189 private:
    \n-
    190 DofVector *dofVector_;
    \n-
    191
    \n-
    192 public:
    \n-
    \n-\n-
    194 : dofVector_( NULL )
    \n-
    195 {}
    \n-
    \n-
    196
    \n-
    \n-\n-
    198 const std::string &name = "" )
    \n-
    199 : dofVector_ ( DofVectorProvider::get( dofSpace, name ) )
    \n-
    200 {}
    \n-
    \n-
    201
    \n-
    \n-
    202 explicit DofVectorPointer ( DofVector *dofVector )
    \n-
    203 : dofVector_( dofVector )
    \n-
    204 {}
    \n-
    \n-
    205
    \n-
    \n-
    206 explicit operator bool () const
    \n-
    207 {
    \n-
    208 return (bool)dofVector_;
    \n-
    209 }
    \n-
    \n-
    210
    \n-
    \n-
    211 operator DofVector * () const
    \n-
    212 {
    \n-
    213 return dofVector_;
    \n-
    214 }
    \n-
    \n-
    215
    \n-
    \n-
    216 operator Dof * () const
    \n-
    217 {
    \n-
    218 Dof *ptr = NULL;
    \n-
    219 GET_DOF_VEC( ptr, dofVector_ );
    \n-
    220 return ptr;
    \n-
    221 }
    \n-
    \n-
    222
    \n-
    \n-
    223 const DofSpace *dofSpace () const
    \n-
    224 {
    \n-
    225 return dofVector_->fe_space;
    \n-
    226 }
    \n-
    \n-
    227
    \n-
    \n-
    228 std::string name () const
    \n-
    229 {
    \n-
    230 if( dofVector_ )
    \n-
    231 return dofVector_->name;
    \n-
    232 else
    \n-
    233 return std::string();
    \n-
    234 }
    \n-
    \n-
    235
    \n-
    \n-
    236 void create ( const DofSpace *dofSpace, const std::string &name = "" )
    \n-
    237 {
    \n-
    238 release();
    \n-
    239 dofVector_ = DofVectorProvider::get( dofSpace, name );
    \n-
    240 }
    \n-
    \n-
    241
    \n-
    242 template< int dim >
    \n-
    \n-
    243 void read ( const std::string &filename, const MeshPointer< dim > &meshPointer )
    \n-
    244 {
    \n-
    245 release();
    \n-
    246 dofVector_ = DofVectorProvider::read( filename, meshPointer, NULL );
    \n-
    247 }
    \n-
    \n-
    248
    \n-
    \n-
    249 bool write ( const std::string &filename ) const
    \n-
    250 {
    \n-
    251 return DofVectorProvider::write( dofVector_, filename );
    \n-
    252 }
    \n-
    \n-
    253
    \n-
    \n-
    254 void release ()
    \n-
    255 {
    \n-
    256 if( dofVector_ )
    \n-
    257 {
    \n-
    258 DofVectorProvider::free( dofVector_ );
    \n-
    259 dofVector_ = NULL;
    \n-
    260 }
    \n-
    261 }
    \n-
    \n-
    262
    \n-
    263 template< class Functor >
    \n-
    \n-
    264 void forEach ( Functor &functor ) const
    \n-
    265 {
    \n-
    266 Dof *array = (Dof *)(*this);
    \n-
    267 FOR_ALL_DOFS( dofSpace()->admin, functor( array[ dof ] ) );
    \n-
    268 }
    \n-
    \n-
    269
    \n-
    \n-
    270 void initialize ( const Dof &value )
    \n-
    271 {
    \n-
    272 Dof *array = (Dof *)(*this);
    \n-
    273 FOR_ALL_DOFS( dofSpace()->admin, array[ dof ] = value );
    \n-
    274 }
    \n-
    \n-
    275
    \n-
    276 template< class AdaptationData >
    \n-
    \n-
    277 AdaptationData *getAdaptationData () const
    \n-
    278 {
    \n-
    279 assert( dofVector_ );
    \n-
    280 assert( dofVector_->user_data );
    \n-
    281 return static_cast< AdaptationData * >( dofVector_->user_data );
    \n-
    282 }
    \n-
    \n-
    283
    \n-
    284 template< class AdaptationData >
    \n-
    \n-
    285 void setAdaptationData ( AdaptationData *adaptationData )
    \n-
    286 {
    \n-
    287 assert( dofVector_ );
    \n-
    288 dofVector_->user_data = adaptationData;
    \n-
    289 }
    \n-
    \n-
    290
    \n-
    291 template< class Interpolation >
    \n-
    \n-\n-
    293 {
    \n-
    294 assert( dofVector_ );
    \n-
    295 dofVector_->refine_interpol = &refineInterpolate< Interpolation >;
    \n-
    296 }
    \n-
    \n-
    297
    \n-
    298 template< class Restriction >
    \n-
    \n-\n-
    300 {
    \n-
    301 assert( dofVector_ );
    \n-
    302 dofVector_->coarse_restrict = &coarsenRestrict< Restriction >;
    \n-
    303 }
    \n-
    \n-
    304
    \n-
    305 private:
    \n-
    306 template< class Interpolation >
    \n-
    307 static void refineInterpolate ( DofVector *dofVector, RC_LIST_EL *list, int n )
    \n-
    308 {
    \n-
    309 const This dofVectorPointer( dofVector );
    \n-
    310 typename Interpolation::Patch patch( list, n );
    \n-
    311 Interpolation::interpolateVector( dofVectorPointer, patch );
    \n-
    312 }
    \n-
    313
    \n-
    314 template< class Restriction >
    \n-
    315 static void coarsenRestrict ( DofVector *dofVector, RC_LIST_EL *list, int n )
    \n-
    316 {
    \n-
    317 const This dofVectorPointer( dofVector );
    \n-
    318 typename Restriction::Patch patch( list, n );
    \n-
    319 Restriction::restrictVector( dofVectorPointer, patch );
    \n-
    320 }
    \n-
    321 };
    \n-
    \n-
    322
    \n-
    323
    \n-
    324
    \n-
    325 // Auxiliary Functions
    \n-
    326 // --------------------
    \n-
    327
    \n-
    \n-
    328 inline void abs ( const DofVectorPointer< int > &dofVector )
    \n-
    329 {
    \n-
    330 assert( !dofVector == false );
    \n-
    331 int *array = (int *)dofVector;
    \n-
    332 FOR_ALL_DOFS( dofVector.dofSpace()->admin,
    \n-
    333 array[ dof ] = std::abs( array[ dof ] ) );
    \n-
    334 }
    \n-
    \n-
    335
    \n-
    336
    \n-
    \n-
    337 inline int max ( const DofVectorPointer< int > &dofVector )
    \n-
    338 {
    \n-
    339 assert( !dofVector == false );
    \n-
    340 int *array = (int *)dofVector;
    \n-
    341 int result = std::numeric_limits< int >::min();
    \n-
    342 FOR_ALL_DOFS( dofVector.dofSpace()->admin,
    \n-
    343 result = std::max( result, array[ dof ] ) );
    \n-
    344 return result;
    \n-
    345 }
    \n-
    \n-
    346
    \n-
    347
    \n-
    \n-
    348 inline int min ( const DofVectorPointer< int > &dofVector )
    \n-
    349 {
    \n-
    350 assert( !dofVector == false );
    \n-
    351 int *array = (int *)dofVector;
    \n-
    352 int result = std::numeric_limits< int >::max();
    \n-
    353 FOR_ALL_DOFS( dofVector.dofSpace()->admin,
    \n-
    354 result = std::min( result, array[ dof ] ) );
    \n-
    355 return result;
    \n-
    356 }
    \n-
    \n-
    357
    \n-
    358 } // namespace Alberta
    \n-
    359
    \n-
    360} // namespace Dune
    \n-
    361
    \n-
    362#endif // #if HAVE_ALBERTA
    \n-
    363
    \n-
    364#endif // #ifndef DUNE_ALBERTA_DOFVECTOR_HH
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n-
    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
    \n-
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+
    84#endif
    \n+
    provides a wrapper for ALBERTA's macro_data structure
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA MESH Mesh
    Definition misc.hh:53
    \n-
    void abs(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:328
    \n-
    ALBERTA REAL Real
    Definition misc.hh:48
    \n-
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n-
    int min(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:348
    \n-
    int max(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:337
    \n+
    static const int dimWorld
    Definition misc.hh:46
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition meshpointer.hh:40
    \n-
    Definition dofvector.hh:35
    \n-
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:42
    \n-
    ALBERTA DOF_INT_VEC DofVector
    Definition dofvector.hh:40
    \n-
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:57
    \n-
    static void free(DofVector *dofVector)
    Definition dofvector.hh:47
    \n-
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:52
    \n-
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:84
    \n-
    static void free(DofVector *dofVector)
    Definition dofvector.hh:74
    \n-
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:69
    \n-
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:79
    \n-
    ALBERTA DOF_SCHAR_VEC DofVector
    Definition dofvector.hh:67
    \n-
    static void free(DofVector *dofVector)
    Definition dofvector.hh:101
    \n-
    ALBERTA DOF_UCHAR_VEC DofVector
    Definition dofvector.hh:94
    \n-
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:106
    \n-
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:96
    \n-
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:111
    \n-
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:123
    \n-
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:133
    \n-
    static void free(DofVector *dofVector)
    Definition dofvector.hh:128
    \n-
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:138
    \n-
    ALBERTA DOF_REAL_VEC DofVector
    Definition dofvector.hh:121
    \n-
    ALBERTA DOF_REAL_D_VEC DofVector
    Definition dofvector.hh:148
    \n-
    static void free(DofVector *dofVector)
    Definition dofvector.hh:155
    \n-
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:165
    \n-
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:160
    \n-
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:150
    \n-
    Definition dofvector.hh:179
    \n-
    DofVectorProvider::DofVector DofVector
    Definition dofvector.hh:185
    \n-
    void setupInterpolation()
    Definition dofvector.hh:292
    \n-
    void initialize(const Dof &value)
    Definition dofvector.hh:270
    \n-
    void read(const std::string &filename, const MeshPointer< dim > &meshPointer)
    Definition dofvector.hh:243
    \n-
    void create(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:236
    \n-
    void release()
    Definition dofvector.hh:254
    \n-
    AdaptationData * getAdaptationData() const
    Definition dofvector.hh:277
    \n-
    void setupRestriction()
    Definition dofvector.hh:299
    \n-
    DofVectorPointer()
    Definition dofvector.hh:193
    \n-
    void setAdaptationData(AdaptationData *adaptationData)
    Definition dofvector.hh:285
    \n-
    bool write(const std::string &filename) const
    Definition dofvector.hh:249
    \n-
    DofVectorPointer(DofVector *dofVector)
    Definition dofvector.hh:202
    \n-
    const DofSpace * dofSpace() const
    Definition dofvector.hh:223
    \n-
    static const bool supportsAdaptationData
    Definition dofvector.hh:187
    \n-
    std::string name() const
    Definition dofvector.hh:228
    \n-
    void forEach(Functor &functor) const
    Definition dofvector.hh:264
    \n-
    DofVectorPointer(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:197
    \n+
    Definition albertareader.hh:22
    \n+
    Grid::ctype ctype
    Definition albertareader.hh:28
    \n+
    static const int dimensionworld
    Definition albertareader.hh:31
    \n+
    static const int dimension
    Definition albertareader.hh:30
    \n+
    Dune::GridFactory< Grid > GridFactory
    Definition albertareader.hh:26
    \n+
    AlbertaReader()
    Definition albertareader.hh:45
    \n+
    void readGrid(const std::string &fileName, GridFactory &factory)
    Definition albertareader.hh:48
    \n+\n+
    int ElementId[numVertices]
    Definition macrodata.hh:48
    \n+
    void release()
    release the macro data structure
    Definition macrodata.hh:127
    \n+
    int elementCount() const
    Definition macrodata.hh:68
    \n+
    GlobalVector & vertex(int i) const
    Definition macrodata.hh:255
    \n+
    int vertexCount() const
    Definition macrodata.hh:63
    \n+
    ElementId & element(int i) const
    Definition macrodata.hh:246
    \n+
    void read(const std::string &filename, bool binary=false)
    Definition macrodata.hh:413
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n+
    ct ctype
    Define type used for coordinates in grid module.
    Definition common/grid.hh:518
    \n+\n+
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
    Insert an element into the coarse grid.
    Definition common/gridfactory.hh:307
    \n+
    virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
    Insert a vertex into the coarse grid.
    Definition common/gridfactory.hh:296
    \n+
    Provide a generic factory class for unstructured grids.
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,563 +1,176 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-dofvector.hh\n+albertareader.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_DOFVECTOR_HH\n-6#define DUNE_ALBERTA_DOFVECTOR_HH\n+5#ifndef DUNE_ALBERTA_ALBERTAREADER_HH\n+6#define DUNE_ALBERTA_ALBERTAREADER_HH\n 7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13#include \n+8#include \n+9\n+10#include \n+11#include \n+12\n+13#include \n 14\n 15#if HAVE_ALBERTA\n 16\n 17namespace Dune\n 18{\n 19\n-20 namespace Alberta\n-21 {\n-22\n-23 // External Forward Declarations\n-24 // -----------------------------\n-25\n-26 template< int dim >\n-27 class MeshPointer;\n-28\n+20 template< class Grid >\n+21 class AlbertaReader\n+22 {\n+23 typedef AlbertaReader<_Grid_> This;\n+24\n+25 public:\n+26 typedef Dune::GridFactory<_Grid_> GridFactory;\n+27\n+28 typedef typename Grid::ctype ctype;\n 29\n-30\n-31 // DofVectorProvider\n-32 // -----------------\n-33\n-34 template< class Dof >\n-35 struct DofVectorProvider;\n+30 static const int dimension = Grid::dimension;\n+31 static const int dimensionworld = Grid::dimensionworld;\n+32\n+33 private:\n+34 static_assert(dimensionworld == Alberta::dimWorld,\n+35 \"AlbertaReader: world dimension must match ALBERTA's world dimension.\");\n 36\n-37 template<>\n-38 struct DofVectorProvider< int >\n-39 {\n-40 typedef ALBERTA DOF_INT_VEC DofVector;\n-41\n-42 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n-43 {\n-44 return ALBERTA get_dof_int_vec( name.c_str(), dofSpace );\n-45 }\n-46\n-47 static void free ( DofVector *dofVector )\n-48 {\n-49 ALBERTA free_dof_int_vec( dofVector );\n-50 }\n-51\n-52 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace )\n-53 {\n-54 return ALBERTA read_dof_int_vec_xdr( filename.c_str(), mesh, dofSpace );\n-55 }\n-56\n-57 static bool write ( const DofVector *dofVector, const std::string &filename\n-)\n-58 {\n-59 int success = ALBERTA write_dof_int_vec_xdr( dofVector, filename.c_str() );\n-60 return (success == 0);\n-61 }\n-62 };\n+37 typedef Alberta::MacroData<_dimension_> MacroData;\n+38\n+39 MacroData macroData_;\n+40\n+41 AlbertaReader ( const This & );\n+42 This &operator= ( const This & );\n+43\n+44 public:\n+45 AlbertaReader ()\n+46 {}\n+47\n+48 void readGrid ( const std::string &fileName, GridFactory &factory )\n+49 {\n+50 // read ALBERTA macro triangulation\n+51 macroData_.read( fileName, false );\n+52\n+53 // insert all vertices into the factory\n+54 const int numVertices = macroData_.vertexCount();\n+55 for( int i = 0; i < numVertices; ++i )\n+56 {\n+57 FieldVector< ctype, dimensionworld > v;\n+58 const Alberta::GlobalVector &coords = macroData_.vertex( i );\n+59 for( int j = 0; j < dimensionworld; ++j )\n+60 v[ j ] = coords[ j ];\n+61 factory.insertVertex( v );\n+62 }\n 63\n-64 template<>\n-65 struct DofVectorProvider< signed char >\n-66 {\n-67 typedef ALBERTA DOF_SCHAR_VEC DofVector;\n-68\n-69 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n-70 {\n-71 return ALBERTA get_dof_schar_vec( name.c_str(), dofSpace );\n-72 }\n-73\n-74 static void free ( DofVector *dofVector )\n-75 {\n-76 ALBERTA free_dof_schar_vec( dofVector );\n+64 // insert all elements into the factory\n+65 std::vector< unsigned int > vertices( dimension+1 );\n+66 const int numElements = macroData_.elementCount();\n+67 for( int i = 0; i < numElements; ++i )\n+68 {\n+69 const typename MacroData::ElementId &id = macroData_.element( i );\n+70 for( int j = 0; j <= dimension; ++j )\n+71 vertices[ j ] = id[ j ];\n+72 factory.insertElement( GeometryTypes::simplex( dimension ), vertices );\n+73 }\n+74\n+75 // release ALBERTA macro data\n+76 macroData_.release();\n 77 }\n-78\n-79 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace )\n-80 {\n-81 return ALBERTA read_dof_schar_vec_xdr( filename.c_str(), mesh, dofSpace );\n-82 }\n+78 };\n+79\n+80}\n+81\n+82#endif // #if HAVE_ALBERTA\n 83\n-84 static bool write ( const DofVector *dofVector, const std::string &filename\n-)\n-85 {\n-86 int success = ALBERTA write_dof_schar_vec_xdr( dofVector, filename.c_str()\n-);\n-87 return (success == 0);\n-88 }\n-89 };\n-90\n-91 template<>\n-92 struct DofVectorProvider< unsigned char >\n-93 {\n-94 typedef ALBERTA DOF_UCHAR_VEC DofVector;\n-95\n-96 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n-97 {\n-98 return ALBERTA get_dof_uchar_vec( name.c_str(), dofSpace );\n-99 }\n-100\n-101 static void free ( DofVector *dofVector )\n-102 {\n-103 ALBERTA free_dof_uchar_vec( dofVector );\n-104 }\n-105\n-106 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace )\n-107 {\n-108 return ALBERTA read_dof_uchar_vec_xdr( filename.c_str(), mesh, dofSpace );\n-109 }\n-110\n-111 static bool write ( const DofVector *dofVector, const std::string &filename\n-)\n-112 {\n-113 int success = ALBERTA write_dof_uchar_vec_xdr( dofVector, filename.c_str()\n-);\n-114 return (success == 0);\n-115 }\n-116 };\n-117\n-118 template<>\n-119 struct DofVectorProvider< Real >\n-120 {\n-121 typedef ALBERTA DOF_REAL_VEC DofVector;\n-122\n-123 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n-124 {\n-125 return ALBERTA get_dof_real_vec( name.c_str(), dofSpace );\n-126 }\n-127\n-128 static void free ( DofVector *dofVector )\n-129 {\n-130 ALBERTA free_dof_real_vec( dofVector );\n-131 }\n-132\n-133 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace )\n-134 {\n-135 return ALBERTA read_dof_real_vec_xdr( filename.c_str(), mesh, dofSpace );\n-136 }\n-137\n-138 static bool write ( const DofVector *dofVector, const std::string &filename\n-)\n-139 {\n-140 int success = ALBERTA write_dof_real_vec_xdr( dofVector, filename.c_str()\n-);\n-141 return (success == 0);\n-142 }\n-143 };\n-144\n-145 template<>\n-146 struct DofVectorProvider< GlobalVector >\n-147 {\n-148 typedef ALBERTA DOF_REAL_D_VEC DofVector;\n-149\n-150 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n-151 {\n-152 return ALBERTA get_dof_real_d_vec( name.c_str(), dofSpace );\n-153 }\n-154\n-155 static void free ( DofVector *dofVector )\n-156 {\n-157 ALBERTA free_dof_real_d_vec( dofVector );\n-158 }\n-159\n-160 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace )\n-161 {\n-162 return ALBERTA read_dof_real_d_vec_xdr( filename.c_str(), mesh, dofSpace );\n-163 }\n-164\n-165 static bool write ( const DofVector *dofVector, const std::string &filename\n-)\n-166 {\n-167 int success = ALBERTA write_dof_real_d_vec_xdr( dofVector, filename.c_str()\n-);\n-168 return (success == 0);\n-169 }\n-170 };\n-171\n-172\n-173\n-174 // DofVectorPointer\n-175 // ----------------\n-176\n-177 template< class Dof >\n-178 class DofVectorPointer\n-179 {\n-180 typedef DofVectorPointer<_Dof_> This;\n-181\n-182 typedef Alberta::DofVectorProvider<_Dof_> DofVectorProvider;\n-183\n-184 public:\n-185 typedef typename DofVectorProvider::DofVector DofVector;\n-186\n-187 static const bool supportsAdaptationData = true;\n-188\n-189 private:\n-190 DofVector *dofVector_;\n-191\n-192 public:\n-193 DofVectorPointer ()\n-194 : dofVector_( NULL )\n-195 {}\n-196\n-197 explicit DofVectorPointer ( const DofSpace *dofSpace,\n-198 const std::string &name = \"\" )\n-199 : dofVector_ ( DofVectorProvider::get( dofSpace, name ) )\n-200 {}\n-201\n-202 explicit DofVectorPointer ( DofVector *dofVector )\n-203 : dofVector_( dofVector )\n-204 {}\n-205\n-206 explicit operator bool () const\n-207 {\n-208 return (bool)dofVector_;\n-209 }\n-210\n-211 operator DofVector * () const\n-212 {\n-213 return dofVector_;\n-214 }\n-215\n-216 operator Dof * () const\n-217 {\n-218 Dof *ptr = NULL;\n-219 GET_DOF_VEC( ptr, dofVector_ );\n-220 return ptr;\n-221 }\n-222\n-223 const DofSpace *dofSpace () const\n-224 {\n-225 return dofVector_->fe_space;\n-226 }\n-227\n-228 std::string name () const\n-229 {\n-230 if( dofVector_ )\n-231 return dofVector_->name;\n-232 else\n-233 return std::string();\n-234 }\n-235\n-236 void create ( const DofSpace *dofSpace, const std::string &name = \"\" )\n-237 {\n-238 release();\n-239 dofVector_ = DofVectorProvider::get( dofSpace, name );\n-240 }\n-241\n-242 template< int dim >\n-243 void read ( const std::string &filename, const MeshPointer<_dim_>\n-&meshPointer )\n-244 {\n-245 release();\n-246 dofVector_ = DofVectorProvider::read( filename, meshPointer, NULL );\n-247 }\n-248\n-249 bool write ( const std::string &filename ) const\n-250 {\n-251 return DofVectorProvider::write( dofVector_, filename );\n-252 }\n-253\n-254 void release ()\n-255 {\n-256 if( dofVector_ )\n-257 {\n-258 DofVectorProvider::free( dofVector_ );\n-259 dofVector_ = NULL;\n-260 }\n-261 }\n-262\n-263 template< class Functor >\n-264 void forEach ( Functor &functor ) const\n-265 {\n-266 Dof *array = (Dof *)(*this);\n-267 FOR_ALL_DOFS( dofSpace()->admin, functor( array[ dof ] ) );\n-268 }\n-269\n-270 void initialize ( const Dof &value )\n-271 {\n-272 Dof *array = (Dof *)(*this);\n-273 FOR_ALL_DOFS( dofSpace()->admin, array[ dof ] = value );\n-274 }\n-275\n-276 template< class AdaptationData >\n-277 AdaptationData *getAdaptationData () const\n-278 {\n-279 assert( dofVector_ );\n-280 assert( dofVector_->user_data );\n-281 return static_cast< AdaptationData * >( dofVector_->user_data );\n-282 }\n-283\n-284 template< class AdaptationData >\n-285 void setAdaptationData ( AdaptationData *adaptationData )\n-286 {\n-287 assert( dofVector_ );\n-288 dofVector_->user_data = adaptationData;\n-289 }\n-290\n-291 template< class Interpolation >\n-292 void setupInterpolation ()\n-293 {\n-294 assert( dofVector_ );\n-295 dofVector_->refine_interpol = &refineInterpolate< Interpolation >;\n-296 }\n-297\n-298 template< class Restriction >\n-299 void setupRestriction ()\n-300 {\n-301 assert( dofVector_ );\n-302 dofVector_->coarse_restrict = &coarsenRestrict< Restriction >;\n-303 }\n-304\n-305 private:\n-306 template< class Interpolation >\n-307 static void refineInterpolate ( DofVector *dofVector, RC_LIST_EL *list, int\n-n )\n-308 {\n-309 const This dofVectorPointer( dofVector );\n-310 typename Interpolation::Patch patch( list, n );\n-311 Interpolation::interpolateVector( dofVectorPointer, patch );\n-312 }\n-313\n-314 template< class Restriction >\n-315 static void coarsenRestrict ( DofVector *dofVector, RC_LIST_EL *list, int n\n-)\n-316 {\n-317 const This dofVectorPointer( dofVector );\n-318 typename Restriction::Patch patch( list, n );\n-319 Restriction::restrictVector( dofVectorPointer, patch );\n-320 }\n-321 };\n-322\n-323\n-324\n-325 // Auxiliary Functions\n-326 // --------------------\n-327\n-328 inline void abs ( const DofVectorPointer<_int_> &dofVector )\n-329 {\n-330 assert( !dofVector == false );\n-331 int *array = (int *)dofVector;\n-332 FOR_ALL_DOFS( dofVector.dofSpace()->admin,\n-333 array[ dof ] = std::abs( array[ dof ] ) );\n-334 }\n-335\n-336\n-337 inline int max ( const DofVectorPointer<_int_> &dofVector )\n-338 {\n-339 assert( !dofVector == false );\n-340 int *array = (int *)dofVector;\n-341 int result = std::numeric_limits< int >::min();\n-342 FOR_ALL_DOFS( dofVector.dofSpace()->admin,\n-343 result = std::max( result, array[ dof ] ) );\n-344 return result;\n-345 }\n-346\n-347\n-348 inline int min ( const DofVectorPointer<_int_> &dofVector )\n-349 {\n-350 assert( !dofVector == false );\n-351 int *array = (int *)dofVector;\n-352 int result = std::numeric_limits< int >::max();\n-353 FOR_ALL_DOFS( dofVector.dofSpace()->admin,\n-354 result = std::min( result, array[ dof ] ) );\n-355 return result;\n-356 }\n-357\n-358 } // namespace Alberta\n-359\n-360} // namespace Dune\n-361\n-362#endif // #if HAVE_ALBERTA\n-363\n-364#endif // #ifndef DUNE_ALBERTA_DOFVECTOR_HH\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n-misc.hh\n-refinement.hh\n-provides a wrapper for ALBERTA's refinement patches and the corners for\n-geometryInFather\n-ALBERTA\n-#define ALBERTA\n-Definition albertaheader.hh:29\n+84#endif\n+macrodata.hh\n+provides a wrapper for ALBERTA's macro_data structure\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::Mesh\n-ALBERTA MESH Mesh\n-Definition misc.hh:53\n-Dune::Alberta::abs\n-void abs(const DofVectorPointer< int > &dofVector)\n-Definition dofvector.hh:328\n-Dune::Alberta::Real\n-ALBERTA REAL Real\n-Definition misc.hh:48\n-Dune::Alberta::DofSpace\n-ALBERTA FE_SPACE DofSpace\n-Definition misc.hh:65\n-Dune::Alberta::min\n-int min(const DofVectorPointer< int > &dofVector)\n-Definition dofvector.hh:348\n-Dune::Alberta::max\n-int max(const DofVectorPointer< int > &dofVector)\n-Definition dofvector.hh:337\n+Dune::Alberta::dimWorld\n+static const int dimWorld\n+Definition misc.hh:46\n Dune::Alberta::GlobalVector\n ALBERTA REAL_D GlobalVector\n Definition misc.hh:50\n-Dune::Alberta::MeshPointer\n-Definition meshpointer.hh:40\n-Dune::Alberta::DofVectorProvider\n-Definition dofvector.hh:35\n-Dune::Alberta::DofVectorProvider<_int_>::get\n-static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n-Definition dofvector.hh:42\n-Dune::Alberta::DofVectorProvider<_int_>::DofVector\n-ALBERTA DOF_INT_VEC DofVector\n-Definition dofvector.hh:40\n-Dune::Alberta::DofVectorProvider<_int_>::write\n-static bool write(const DofVector *dofVector, const std::string &filename)\n-Definition dofvector.hh:57\n-Dune::Alberta::DofVectorProvider<_int_>::free\n-static void free(DofVector *dofVector)\n-Definition dofvector.hh:47\n-Dune::Alberta::DofVectorProvider<_int_>::read\n-static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace)\n-Definition dofvector.hh:52\n-Dune::Alberta::DofVectorProvider<_signed_char_>::write\n-static bool write(const DofVector *dofVector, const std::string &filename)\n-Definition dofvector.hh:84\n-Dune::Alberta::DofVectorProvider<_signed_char_>::free\n-static void free(DofVector *dofVector)\n-Definition dofvector.hh:74\n-Dune::Alberta::DofVectorProvider<_signed_char_>::get\n-static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n-Definition dofvector.hh:69\n-Dune::Alberta::DofVectorProvider<_signed_char_>::read\n-static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace)\n-Definition dofvector.hh:79\n-Dune::Alberta::DofVectorProvider<_signed_char_>::DofVector\n-ALBERTA DOF_SCHAR_VEC DofVector\n-Definition dofvector.hh:67\n-Dune::Alberta::DofVectorProvider<_unsigned_char_>::free\n-static void free(DofVector *dofVector)\n-Definition dofvector.hh:101\n-Dune::Alberta::DofVectorProvider<_unsigned_char_>::DofVector\n-ALBERTA DOF_UCHAR_VEC DofVector\n-Definition dofvector.hh:94\n-Dune::Alberta::DofVectorProvider<_unsigned_char_>::read\n-static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace)\n-Definition dofvector.hh:106\n-Dune::Alberta::DofVectorProvider<_unsigned_char_>::get\n-static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n-Definition dofvector.hh:96\n-Dune::Alberta::DofVectorProvider<_unsigned_char_>::write\n-static bool write(const DofVector *dofVector, const std::string &filename)\n-Definition dofvector.hh:111\n-Dune::Alberta::DofVectorProvider<_Real_>::get\n-static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n-Definition dofvector.hh:123\n-Dune::Alberta::DofVectorProvider<_Real_>::read\n-static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace)\n-Definition dofvector.hh:133\n-Dune::Alberta::DofVectorProvider<_Real_>::free\n-static void free(DofVector *dofVector)\n-Definition dofvector.hh:128\n-Dune::Alberta::DofVectorProvider<_Real_>::write\n-static bool write(const DofVector *dofVector, const std::string &filename)\n-Definition dofvector.hh:138\n-Dune::Alberta::DofVectorProvider<_Real_>::DofVector\n-ALBERTA DOF_REAL_VEC DofVector\n-Definition dofvector.hh:121\n-Dune::Alberta::DofVectorProvider<_GlobalVector_>::DofVector\n-ALBERTA DOF_REAL_D_VEC DofVector\n-Definition dofvector.hh:148\n-Dune::Alberta::DofVectorProvider<_GlobalVector_>::free\n-static void free(DofVector *dofVector)\n-Definition dofvector.hh:155\n-Dune::Alberta::DofVectorProvider<_GlobalVector_>::write\n-static bool write(const DofVector *dofVector, const std::string &filename)\n-Definition dofvector.hh:165\n-Dune::Alberta::DofVectorProvider<_GlobalVector_>::read\n-static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n-*dofSpace)\n-Definition dofvector.hh:160\n-Dune::Alberta::DofVectorProvider<_GlobalVector_>::get\n-static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n-Definition dofvector.hh:150\n-Dune::Alberta::DofVectorPointer\n-Definition dofvector.hh:179\n-Dune::Alberta::DofVectorPointer::DofVector\n-DofVectorProvider::DofVector DofVector\n-Definition dofvector.hh:185\n-Dune::Alberta::DofVectorPointer::setupInterpolation\n-void setupInterpolation()\n-Definition dofvector.hh:292\n-Dune::Alberta::DofVectorPointer::initialize\n-void initialize(const Dof &value)\n-Definition dofvector.hh:270\n-Dune::Alberta::DofVectorPointer::read\n-void read(const std::string &filename, const MeshPointer< dim > &meshPointer)\n-Definition dofvector.hh:243\n-Dune::Alberta::DofVectorPointer::create\n-void create(const DofSpace *dofSpace, const std::string &name=\"\")\n-Definition dofvector.hh:236\n-Dune::Alberta::DofVectorPointer::release\n+Dune::AlbertaReader\n+Definition albertareader.hh:22\n+Dune::AlbertaReader::ctype\n+Grid::ctype ctype\n+Definition albertareader.hh:28\n+Dune::AlbertaReader::dimensionworld\n+static const int dimensionworld\n+Definition albertareader.hh:31\n+Dune::AlbertaReader::dimension\n+static const int dimension\n+Definition albertareader.hh:30\n+Dune::AlbertaReader::GridFactory\n+Dune::GridFactory< Grid > GridFactory\n+Definition albertareader.hh:26\n+Dune::AlbertaReader::AlbertaReader\n+AlbertaReader()\n+Definition albertareader.hh:45\n+Dune::AlbertaReader::readGrid\n+void readGrid(const std::string &fileName, GridFactory &factory)\n+Definition albertareader.hh:48\n+Dune::Alberta::MacroData<_dimension_>\n+Dune::Alberta::MacroData<_dimension_>::ElementId\n+int ElementId[numVertices]\n+Definition macrodata.hh:48\n+Dune::Alberta::MacroData::release\n void release()\n-Definition dofvector.hh:254\n-Dune::Alberta::DofVectorPointer::getAdaptationData\n-AdaptationData * getAdaptationData() const\n-Definition dofvector.hh:277\n-Dune::Alberta::DofVectorPointer::setupRestriction\n-void setupRestriction()\n-Definition dofvector.hh:299\n-Dune::Alberta::DofVectorPointer::DofVectorPointer\n-DofVectorPointer()\n-Definition dofvector.hh:193\n-Dune::Alberta::DofVectorPointer::setAdaptationData\n-void setAdaptationData(AdaptationData *adaptationData)\n-Definition dofvector.hh:285\n-Dune::Alberta::DofVectorPointer::write\n-bool write(const std::string &filename) const\n-Definition dofvector.hh:249\n-Dune::Alberta::DofVectorPointer::DofVectorPointer\n-DofVectorPointer(DofVector *dofVector)\n-Definition dofvector.hh:202\n-Dune::Alberta::DofVectorPointer::dofSpace\n-const DofSpace * dofSpace() const\n-Definition dofvector.hh:223\n-Dune::Alberta::DofVectorPointer::supportsAdaptationData\n-static const bool supportsAdaptationData\n-Definition dofvector.hh:187\n-Dune::Alberta::DofVectorPointer::name\n-std::string name() const\n-Definition dofvector.hh:228\n-Dune::Alberta::DofVectorPointer::forEach\n-void forEach(Functor &functor) const\n-Definition dofvector.hh:264\n-Dune::Alberta::DofVectorPointer::DofVectorPointer\n-DofVectorPointer(const DofSpace *dofSpace, const std::string &name=\"\")\n-Definition dofvector.hh:197\n+release the macro data structure\n+Definition macrodata.hh:127\n+Dune::Alberta::MacroData::elementCount\n+int elementCount() const\n+Definition macrodata.hh:68\n+Dune::Alberta::MacroData::vertex\n+GlobalVector & vertex(int i) const\n+Definition macrodata.hh:255\n+Dune::Alberta::MacroData::vertexCount\n+int vertexCount() const\n+Definition macrodata.hh:63\n+Dune::Alberta::MacroData::element\n+ElementId & element(int i) const\n+Definition macrodata.hh:246\n+Dune::Alberta::MacroData::read\n+void read(const std::string &filename, bool binary=false)\n+Definition macrodata.hh:413\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/grid.hh:390\n+Dune::Grid::ctype\n+ct ctype\n+Define type used for coordinates in grid module.\n+Definition common/grid.hh:518\n+Dune::GridFactory<_Grid_>\n+Dune::GridFactory::insertElement\n+virtual void insertElement(const GeometryType &type, const std::vector<\n+unsigned int > &vertices)\n+Insert an element into the coarse grid.\n+Definition common/gridfactory.hh:307\n+Dune::GridFactory::insertVertex\n+virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)\n+Insert a vertex into the coarse grid.\n+Definition common/gridfactory.hh:296\n+gridfactory.hh\n+Provide a generic factory class for unstructured grids.\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00671.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00671.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: meshpointer.hh File Reference\n+dune-grid: algebra.hh File Reference\n \n \n \n \n \n \n \n@@ -70,49 +70,77 @@\n \n \n
    \n \n-
    meshpointer.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    algebra.hh File Reference
    \n \n
    \n-\n-

    provides a wrapper for ALBERTA's mesh structure \n-More...

    \n-
    #include <limits>
    \n-#include <string>
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/elementinfo.hh>
    \n-#include <dune/grid/albertagrid/macrodata.hh>
    \n-#include <dune/grid/albertagrid/projection.hh>
    \n+
    #include <dune/common/fvector.hh>
    \n+#include <dune/common/fmatrix.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::Alberta::MeshPointer< dim >
     
    class  Dune::Alberta::MeshPointer< dim >::MacroIterator
     
    \n \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    template<class K >
    static FieldVector< K, 3 > Dune::Alberta::vectorProduct (const FieldVector< K, 3 > &u, const FieldVector< K, 3 > &v)
     
    template<class K , int m>
    static K Dune::Alberta::determinant (const FieldMatrix< K, 0, m > &matrix)
     
    template<class K >
    static K Dune::Alberta::determinant (const FieldMatrix< K, 1, 1 > &matrix)
     
    template<class K , int m>
    static K Dune::Alberta::determinant (const FieldMatrix< K, 1, m > &matrix)
     
    template<class K >
    static K Dune::Alberta::determinant (const FieldMatrix< K, 2, 2 > &matrix)
     
    template<class K >
    static K Dune::Alberta::determinant (const FieldMatrix< K, 2, 3 > &matrix)
     
    template<class K , int m>
    static K Dune::Alberta::determinant (const FieldMatrix< K, 2, m > &matrix)
     
    template<class K >
    static K Dune::Alberta::determinant (const FieldMatrix< K, 3, 3 > &matrix)
     
    template<class K , int m>
    static K Dune::Alberta::invert (const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 > &inverse)
     
    template<class K >
    static K Dune::Alberta::invert (const FieldMatrix< K, 1, 1 > &matrix, FieldMatrix< K, 1, 1 > &inverse)
     
    template<class K , int m>
    static K Dune::Alberta::invert (const FieldMatrix< K, 1, m > &matrix, FieldMatrix< K, m, 1 > &inverse)
     
    template<class K >
    static K Dune::Alberta::invert (const FieldMatrix< K, 2, 2 > &matrix, FieldMatrix< K, 2, 2 > &inverse)
     
    template<class K , int m>
    static K Dune::Alberta::invert (const FieldMatrix< K, 2, m > &matrix, FieldMatrix< K, m, 2 > &inverse)
     
    template<class K >
    static K Dune::Alberta::invert (const FieldMatrix< K, 3, 3 > &matrix, FieldMatrix< K, 3, 3 > &inverse)
     
    \n-

    Detailed Description

    \n-

    provides a wrapper for ALBERTA's mesh structure

    \n-
    Author
    Martin Nolte
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,34 +1,77 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-meshpointer.hh File Reference\n-provides a wrapper for ALBERTA's mesh structure More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+Namespaces | Functions\n+algebra.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::Alberta::MeshPointer<_dim_>\n-\u00a0\n-class \u00a0 Dune::Alberta::MeshPointer<_dim_>::MacroIterator\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n-***** Detailed Description *****\n-provides a wrapper for ALBERTA's mesh structure\n- Author\n- Martin Nolte\n+Functions\n+template\n+static FieldVector< K, 3 >\u00a0 Dune::Alberta::vectorProduct (const FieldVector< K,\n+ 3 > &u, const FieldVector< K, 3 > &v)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 0, m > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 1, 1 > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 1, m > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 2, 2 > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 2, 3 > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 2, m > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::determinant (const FieldMatrix< K,\n+ 3, 3 > &matrix)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::invert (const FieldMatrix< K, 0, m >\n+ &matrix, FieldMatrix< K, m, 0 > &inverse)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::invert (const FieldMatrix< K, 1, 1 >\n+ &matrix, FieldMatrix< K, 1, 1 > &inverse)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::invert (const FieldMatrix< K, 1, m >\n+ &matrix, FieldMatrix< K, m, 1 > &inverse)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::invert (const FieldMatrix< K, 2, 2 >\n+ &matrix, FieldMatrix< K, 2, 2 > &inverse)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::invert (const FieldMatrix< K, 2, m >\n+ &matrix, FieldMatrix< K, m, 2 > &inverse)\n+\u00a0\n+template\n+ static K\u00a0 Dune::Alberta::invert (const FieldMatrix< K, 3, 3 >\n+ &matrix, FieldMatrix< K, 3, 3 > &inverse)\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00671_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00671_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: meshpointer.hh Source File\n+dune-grid: algebra.hh Source File\n \n \n \n \n \n \n \n@@ -74,623 +74,197 @@\n \n \n \n
    \n-
    meshpointer.hh
    \n+
    algebra.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_MESHPOINTER_HH
    \n-
    6#define DUNE_ALBERTA_MESHPOINTER_HH
    \n+
    5#ifndef DUNE_ALBERTA_ALGEBRA_HH
    \n+
    6#define DUNE_ALBERTA_ALGEBRA_HH
    \n
    7
    \n-
    13#include <limits>
    \n-
    14#include <string>
    \n-
    15
    \n-\n-\n-\n-\n-
    20
    \n-
    21#if HAVE_ALBERTA
    \n-
    22
    \n-
    23namespace Dune
    \n-
    24{
    \n-
    25
    \n-
    26 namespace Alberta
    \n-
    27 {
    \n+
    8#include <dune/common/fvector.hh>
    \n+
    9#include <dune/common/fmatrix.hh>
    \n+
    10
    \n+
    11namespace Dune
    \n+
    12{
    \n+
    13
    \n+
    14 namespace Alberta
    \n+
    15 {
    \n+
    16
    \n+
    17 template< class K >
    \n+
    18 inline static FieldVector< K, 3 >
    \n+
    \n+
    19 vectorProduct ( const FieldVector< K, 3 > &u, const FieldVector< K, 3 > &v )
    \n+
    20 {
    \n+
    21 FieldVector< K, 3 > w;
    \n+
    22 w[ 0 ] = u[ 1 ] * v[ 2 ] - u[ 2 ] * v[ 1 ];
    \n+
    23 w[ 1 ] = u[ 2 ] * v[ 0 ] - u[ 0 ] * v[ 2 ];
    \n+
    24 w[ 2 ] = u[ 0 ] * v[ 1 ] - u[ 1 ] * v[ 0 ];
    \n+
    25 return w;
    \n+
    26 }
    \n+
    \n+
    27
    \n
    28
    \n-
    29 // External Forward Declarations
    \n-
    30 // -----------------------------
    \n-
    31
    \n-
    32 template< int dim >
    \n-
    33 class HierarchyDofNumbering;
    \n+
    29 template< class K, int m >
    \n+
    \n+
    30 inline static K determinant ( [[maybe_unused]] const FieldMatrix< K, 0, m > &matrix )
    \n+
    31 {
    \n+
    32 return K( 1 );
    \n+
    33 }
    \n+
    \n
    34
    \n-
    35 // MeshPointer
    \n-
    36 // -----------
    \n-
    37
    \n-
    38 template< int dim >
    \n-
    \n-\n-
    40 {
    \n-\n-\n-
    43 typedef typename ElementInfo::FillFlags FillFlags;
    \n-
    44
    \n-
    45 class BoundaryProvider;
    \n-
    46
    \n-
    47 template< int dimWorld >
    \n-
    48 struct Library;
    \n-
    49
    \n-
    50 public:
    \n-
    51 class MacroIterator;
    \n-
    52
    \n-
    \n-\n-
    54 : mesh_( 0 )
    \n-
    55 {}
    \n+
    35 template< class K >
    \n+
    \n+
    36 inline static K determinant ( const FieldMatrix< K, 1, 1 > &matrix )
    \n+
    37 {
    \n+
    38 return matrix[ 0 ][ 0 ];
    \n+
    39 }
    \n+
    \n+
    40
    \n+
    41 template< class K, int m >
    \n+
    \n+
    42 inline static K determinant ( const FieldMatrix< K, 1, m > &matrix )
    \n+
    43 {
    \n+
    44 using std::sqrt;
    \n+
    45 K sum = matrix[ 0 ][ 0 ] * matrix[ 0 ][ 0 ];
    \n+
    46 for( int i = 1; i < m; ++i )
    \n+
    47 sum += matrix[ 0 ][ i ] * matrix[ 0 ][ i ];
    \n+
    48 return sqrt( sum );
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    51 template< class K >
    \n+
    \n+
    52 inline static K determinant ( const FieldMatrix< K, 2, 2 > &matrix )
    \n+
    53 {
    \n+
    54 return matrix[ 0 ][ 0 ] * matrix[ 1 ][ 1 ] - matrix[ 0 ][ 1 ] * matrix[ 1 ][ 0 ];
    \n+
    55 }
    \n
    \n
    56
    \n-
    \n-
    57 explicit MeshPointer ( Mesh *mesh )
    \n-
    58 : mesh_( mesh )
    \n-
    59 {}
    \n-
    \n-
    60
    \n-
    \n-
    61 operator Mesh * () const
    \n-
    62 {
    \n-
    63 return mesh_;
    \n-
    64 }
    \n-
    \n-
    65
    \n-
    \n-
    66 explicit operator bool () const
    \n-
    67 {
    \n-
    68 return (bool)mesh_;
    \n-
    69 }
    \n-
    \n-
    70
    \n-
    \n-\n-
    72 {
    \n-
    73 return MacroIterator( *this, false );
    \n-
    74 }
    \n-
    \n-
    75
    \n-
    \n-\n-
    77 {
    \n-
    78 return MacroIterator( *this, true );
    \n-
    79 }
    \n-
    \n-
    80
    \n+
    57 template< class K >
    \n+
    \n+
    58 inline static K determinant ( const FieldMatrix< K, 2, 3 > &matrix )
    \n+
    59 {
    \n+
    60 return vectorProduct( matrix[ 0 ], matrix[ 1 ] ).two_norm();
    \n+
    61 }
    \n+
    \n+
    62
    \n+
    63 template< class K, int m >
    \n+
    \n+
    64 inline static K determinant ( const FieldMatrix< K, 2, m > &matrix )
    \n+
    65 {
    \n+
    66 using std::sqrt;
    \n+
    67 const K tmpA = matrix[ 0 ].two_norm2();
    \n+
    68 const K tmpB = matrix[ 1 ].two_norm2();
    \n+
    69 const K tmpC = matrix[ 0 ] * matrix[ 1 ];
    \n+
    70 return sqrt( tmpA * tmpB - tmpC * tmpC );
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    73 template< class K >
    \n+
    \n+
    74 inline static K determinant ( const FieldMatrix< K, 3, 3 > &matrix )
    \n+
    75 {
    \n+
    76 return matrix[ 0 ] * vectorProduct( matrix[ 1 ], matrix[ 2 ] );
    \n+
    77 }
    \n+
    \n+
    78
    \n+
    79
    \n+
    80 template< class K, int m >
    \n
    \n-
    81 int numMacroElements () const;
    \n-
    82 int size ( int codim ) const;
    \n-
    83
    \n-
    84 // create a mesh from a macrodata structure
    \n-
    85 // params: macroData - macro data structure
    \n-
    86 // returns: number of boundary segments
    \n-
    \n-
    87 unsigned int create ( const MacroData< dim > &macroData );
    \n-
    88
    \n-
    89 // create a mesh from a macrodata structure, adding projections
    \n-
    90 // params: macroData - macro data structure
    \n-
    91 // projectionFactory - factory for the projections
    \n-
    92 // returns: number of boundary segments
    \n-
    93 template< class Proj, class Impl >
    \n-
    \n-
    94 unsigned int create ( const MacroData< dim > &macroData,
    \n-
    95 const ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
    \n-
    96
    \n-
    97 // create a mesh from a file
    \n-
    98 // params: filename - file name of an Alberta macro triangulation
    \n-
    99 // binary - read binary?
    \n-
    100 // returns: number of boundary segments
    \n-
    \n-
    101 unsigned int create ( const std::string &filename, bool binary = false );
    \n-
    102
    \n-
    103 // read back a mesh from a file
    \n-
    104 // params: filename - file name of an Alberta save file
    \n-
    105 // time - variable to receive the time stored in the file
    \n-
    106 // returns: number of boundary segments
    \n-
    107 //
    \n-
    108 // notes: - projections are not preserved
    \n-
    109 // - we assume that projections are added in the same order they
    \n-
    110 // inserted in when the grid was created (otherwise the boundary
    \n-
    111 // indices change)
    \n-
    \n-
    112 unsigned int read ( const std::string &filename, Real &time );
    \n-
    113
    \n-
    \n-
    114 bool write ( const std::string &filename, Real time ) const;
    \n-
    115
    \n-
    \n-
    116 void release ();
    \n-
    117
    \n-
    118 template< class Functor >
    \n-
    \n-
    119 void hierarchicTraverse ( Functor &functor,
    \n-
    120 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;
    \n-
    121
    \n-
    122 template< class Functor >
    \n-
    \n-
    123 void leafTraverse ( Functor &functor,
    \n-
    124 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;
    \n-
    125
    \n-
    \n-
    126 bool coarsen ( typename FillFlags::Flags fillFlags = FillFlags::nothing );
    \n-
    127
    \n-
    \n-
    128 bool refine ( typename FillFlags::Flags fillFlags = FillFlags::nothing );
    \n-
    129
    \n-
    130 private:
    \n-
    131 static ALBERTA NODE_PROJECTION *
    \n-
    132 initNodeProjection ( [[maybe_unused]] Mesh *mesh, ALBERTA MACRO_EL *macroElement, int n );
    \n-
    133 template< class ProjectionProvider >
    \n-
    134 static ALBERTA NODE_PROJECTION *
    \n-
    135 initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroElement, int n );
    \n-
    136
    \n-
    137 Mesh *mesh_;
    \n-
    138 };
    \n-
    139
    \n-
    140
    \n-
    141
    \n-
    142 // MeshPointer::Library
    \n-
    143 // --------------------
    \n-
    144
    \n-
    145 template< int dim >
    \n-
    146 template< int dimWorld >
    \n-
    147 struct MeshPointer< dim >::Library
    \n-
    148 {
    \n-\n-
    150
    \n-
    151 static inline unsigned int boundaryCount = 0;
    \n-
    152 static inline const void *projectionFactory = nullptr;
    \n-
    153
    \n-
    154 static void
    \n-
    155 create ( MeshPointer &ptr, const MacroData< dim > &macroData,
    \n-
    156 ALBERTA NODE_PROJECTION *(*initNodeProjection)( Mesh *, ALBERTA MACRO_EL *, int ) );
    \n-
    157 static void release ( MeshPointer &ptr );
    \n-
    158 };
    \n-
    159
    \n-
    160
    \n-
    161
    \n-
    162 // MeshPointer::MacroIterator
    \n-
    163 // --------------------------
    \n-
    164
    \n-
    165 template< int dim >
    \n-
    \n-\n-
    167 {
    \n-\n-
    169
    \n-
    170 friend class MeshPointer< dim >;
    \n-
    171
    \n-
    172 public:
    \n-\n-\n-
    175
    \n-
    \n-\n-
    177 : mesh_(),
    \n-
    178 index_( -1 )
    \n-
    179 {}
    \n-
    \n-
    180
    \n-
    181 private:
    \n-
    182
    \n-
    183 explicit MacroIterator ( const MeshPointer &mesh, bool end = false )
    \n-
    184 : mesh_( mesh ),
    \n-
    185 index_( end ? mesh.numMacroElements() : 0 )
    \n-
    186 {}
    \n-
    187
    \n-
    188 public:
    \n-
    \n-
    189 bool done () const
    \n-
    190 {
    \n-
    191 return (index_ >= mesh().numMacroElements());
    \n-
    192 }
    \n-
    \n-
    193
    \n-
    \n-
    194 bool equals ( const MacroIterator &other ) const
    \n-
    195 {
    \n-
    196 return (index_ == other.index_);
    \n-
    197 }
    \n-
    \n-
    198
    \n-
    \n-
    199 void increment ()
    \n-
    200 {
    \n-
    201 assert( !done() );
    \n-
    202 ++index_;
    \n-
    203 }
    \n-
    \n-
    204
    \n-
    \n-\n-
    206 {
    \n-
    207 assert( !done() );
    \n-
    208 return static_cast< const MacroElement & >( mesh().mesh_->macro_els[ index_ ] );
    \n-
    209 }
    \n-
    \n-
    210
    \n-
    \n-
    211 const MeshPointer &mesh () const
    \n-
    212 {
    \n-
    213 return mesh_;
    \n-
    214 }
    \n-
    \n-
    215
    \n-
    \n-
    216 This &operator++ ()
    \n-
    217 {
    \n-
    218 increment();
    \n-
    219 return *this;
    \n-
    220 }
    \n-
    \n-
    221
    \n-
    \n-
    222 ElementInfo operator* () const
    \n-
    223 {
    \n-
    224 return elementInfo();
    \n-
    225 }
    \n-
    \n-
    226
    \n-
    \n-
    227 bool operator== ( const MacroIterator &other ) const
    \n-
    228 {
    \n-
    229 return equals( other );
    \n-
    230 }
    \n-
    \n-
    231
    \n-
    \n-
    232 bool operator!= ( const MacroIterator &other ) const
    \n-
    233 {
    \n-
    234 return !equals( other );
    \n-
    235 }
    \n-
    \n-
    236
    \n-\n-
    \n-
    238 elementInfo ( typename FillFlags::Flags fillFlags = FillFlags::standard ) const
    \n-
    239 {
    \n-
    240 if( done() )
    \n-
    241 return ElementInfo();
    \n-
    242 else
    \n-
    243 return ElementInfo( mesh(), macroElement(), fillFlags );
    \n-
    244 }
    \n-
    \n-
    245
    \n-
    246 private:
    \n-
    247 MeshPointer mesh_;
    \n-
    248 int index_;
    \n-
    249 };
    \n-
    \n-
    250
    \n-
    251
    \n-
    252
    \n-
    253 // Implementation of MeshPointer
    \n-
    254 // -----------------------------
    \n-
    255
    \n-
    256 template< int dim >
    \n-
    \n-\n-
    258 {
    \n-
    259 return (mesh_ ? mesh_->n_macro_el : 0);
    \n-
    260 }
    \n-
    \n-
    261
    \n-
    262
    \n-
    263 template<>
    \n-
    \n-
    264 inline int MeshPointer< 1 >::size( int codim ) const
    \n-
    265 {
    \n-
    266 assert( (codim >= 0) && (codim <= 1) );
    \n-
    267 return (codim == 0 ? mesh_->n_elements : mesh_->n_vertices);
    \n-
    268 }
    \n-
    \n-
    269
    \n-
    270 template<>
    \n-
    \n-
    271 inline int MeshPointer< 2 >::size( int codim ) const
    \n-
    272 {
    \n-
    273 assert( (codim >= 0) && (codim <= 2) );
    \n-
    274 if( codim == 0 )
    \n-
    275 return mesh_->n_elements;
    \n-
    276 else if( codim == 2 )
    \n-
    277 return mesh_->n_vertices;
    \n-
    278 else
    \n-
    279 return mesh_->n_edges;
    \n-
    280 }
    \n-
    \n-
    281
    \n-
    282 template<>
    \n-
    \n-
    283 inline int MeshPointer< 3 >::size( int codim ) const
    \n-
    284 {
    \n-
    285 assert( (codim >= 0) && (codim <= 3) );
    \n-
    286 if( codim == 0 )
    \n-
    287 return mesh_->n_elements;
    \n-
    288 else if( codim == 3 )
    \n-
    289 return mesh_->n_vertices;
    \n-
    290 else if( codim == 1 )
    \n-
    291 return mesh_->n_faces;
    \n-
    292 else
    \n-
    293 return mesh_->n_edges;
    \n-
    294 }
    \n-
    \n-
    295
    \n-
    296
    \n-
    297 template< int dim >
    \n-
    298 inline unsigned int MeshPointer< dim >
    \n-
    \n-
    299 ::create ( const MacroData< dim > &macroData )
    \n-
    300 {
    \n-
    301 release();
    \n-
    302
    \n-
    303 Library< dimWorld >::boundaryCount = 0;
    \n-
    304 Library< dimWorld >::create( *this, macroData, &initNodeProjection );
    \n-
    305 return Library< dimWorld >::boundaryCount;
    \n-
    306 }
    \n-
    \n-
    307
    \n-
    308
    \n-
    309 template< int dim >
    \n-
    310 template< class Proj, class Impl >
    \n-
    311 inline unsigned int MeshPointer< dim >
    \n-
    \n-
    312 ::create ( const MacroData< dim > &macroData,
    \n-
    313 const ProjectionFactoryInterface< Proj, Impl > &projectionFactory )
    \n-
    314 {
    \n-\n-
    316
    \n-
    317 release();
    \n-
    318
    \n-
    319 Library< dimWorld >::boundaryCount = 0;
    \n-
    320 Library< dimWorld >::projectionFactory = &projectionFactory;
    \n-
    321 Library< dimWorld >::create( *this, macroData, &initNodeProjection< ProjectionFactory > );
    \n-
    322 Library< dimWorld >::projectionFactory = nullptr;
    \n-
    323 return Library< dimWorld >::boundaryCount;
    \n-
    324 }
    \n-
    \n-
    325
    \n-
    326
    \n-
    327
    \n-
    328
    \n-
    329 template< int dim >
    \n-
    330 inline unsigned int MeshPointer< dim >
    \n-
    \n-
    331 ::create ( const std::string &filename, bool binary )
    \n-
    332 {
    \n-
    333 MacroData< dim > macroData;
    \n-
    334 macroData.read( filename, binary );
    \n-
    335 const unsigned int boundaryCount = create( macroData );
    \n-
    336 macroData.release();
    \n-
    337 return boundaryCount;
    \n-
    338 }
    \n-
    \n-
    339
    \n-
    340
    \n-
    341 template< int dim >
    \n-
    \n-
    342 inline unsigned int MeshPointer< dim >::read ( const std::string &filename, Real &time )
    \n-
    343 {
    \n-
    344 release();
    \n-
    345
    \n-
    346 Library< dimWorld >::boundaryCount = 0;
    \n-
    347 mesh_ = ALBERTA read_mesh_xdr( filename.c_str(), &time, NULL, NULL );
    \n-
    348 return Library< dimWorld >::boundaryCount;
    \n-
    349 }
    \n-
    \n-
    350
    \n-
    351
    \n-
    352 template< int dim >
    \n-
    \n-
    353 inline bool MeshPointer< dim >::write ( const std::string &filename, Real time ) const
    \n-
    354 {
    \n-
    355 int success = ALBERTA write_mesh_xdr( mesh_, filename.c_str(), time );
    \n-
    356 return (success == 0);
    \n-
    357 }
    \n-
    \n-
    358
    \n-
    359
    \n-
    360 template< int dim >
    \n-
    \n-\n-
    362 {
    \n-
    363 Library< dimWorld >::release( *this );
    \n-
    364 }
    \n-
    \n-
    365
    \n-
    366
    \n-
    367 template< int dim >
    \n-
    368 template< class Functor >
    \n-
    369 inline void MeshPointer< dim >
    \n-
    \n-
    370 ::hierarchicTraverse ( Functor &functor,
    \n-
    371 typename FillFlags::Flags fillFlags ) const
    \n-
    372 {
    \n-
    373 const MacroIterator eit = end();
    \n-
    374 for( MacroIterator it = begin(); it != eit; ++it )
    \n-
    375 {
    \n-
    376 const ElementInfo info = it.elementInfo( fillFlags );
    \n-
    377 info.hierarchicTraverse( functor );
    \n-
    378 }
    \n-
    379 }
    \n-
    \n-
    380
    \n-
    381
    \n-
    382 template< int dim >
    \n-
    383 template< class Functor >
    \n-
    384 inline void MeshPointer< dim >
    \n-
    \n-
    385 ::leafTraverse ( Functor &functor,
    \n-
    386 typename FillFlags::Flags fillFlags ) const
    \n-
    387 {
    \n-
    388 const MacroIterator eit = end();
    \n-
    389 for( MacroIterator it = begin(); it != eit; ++it )
    \n-
    390 {
    \n-
    391 const ElementInfo info = it.elementInfo( fillFlags );
    \n-
    392 info.leafTraverse( functor );
    \n-
    393 }
    \n-
    394 }
    \n-
    \n-
    395
    \n-
    396
    \n-
    397 template< int dim >
    \n-
    \n-
    398 inline bool MeshPointer< dim >::coarsen ( typename FillFlags::Flags fillFlags )
    \n-
    399 {
    \n-
    400 const bool coarsened = (ALBERTA coarsen( mesh_, fillFlags ) == meshCoarsened);
    \n-
    401 if( coarsened )
    \n-
    402 ALBERTA dof_compress( mesh_ );
    \n-
    403 return coarsened;
    \n-
    404 }
    \n-
    \n-
    405
    \n-
    406 template< int dim >
    \n-
    \n-
    407 inline bool MeshPointer< dim >::refine ( typename FillFlags::Flags fillFlags )
    \n-
    408 {
    \n-
    409 return (ALBERTA refine( mesh_, fillFlags ) == meshRefined);
    \n-
    410 }
    \n-
    \n-
    \n-
    411
    \n-
    412
    \n-
    413 template< int dim >
    \n-
    414 inline ALBERTA NODE_PROJECTION *
    \n-
    415 MeshPointer< dim >::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroEl, int n )
    \n-
    416 {
    \n-
    417 const MacroElement &macroElement = static_cast< const MacroElement & >( *macroEl );
    \n-
    418 if( (n > 0) && macroElement.isBoundary( n-1 ) )
    \n-
    419 return new BasicNodeProjection( Library< dimWorld >::boundaryCount++ );
    \n-
    420 else
    \n-
    421 return 0;
    \n-
    422 }
    \n-
    423
    \n-
    424
    \n-
    425 template< int dim >
    \n-
    426 template< class ProjectionFactory >
    \n-
    427 inline ALBERTA NODE_PROJECTION *
    \n-
    428 MeshPointer< dim >::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroEl, int n )
    \n-
    429 {
    \n-
    430 typedef typename ProjectionFactory::Projection Projection;
    \n-
    431
    \n-
    432 const MacroElement &macroElement = static_cast< const MacroElement & >( *macroEl );
    \n-
    433
    \n-
    434 MeshPointer< dim > meshPointer( mesh );
    \n-
    435 ElementInfo elementInfo( meshPointer, macroElement, FillFlags::standard );
    \n-
    436 const ProjectionFactory &projectionFactory = *static_cast< const ProjectionFactory * >( Library< dimWorld >::projectionFactory );
    \n-
    437 if( (n > 0) && macroElement.isBoundary( n-1 ) )
    \n-
    438 {
    \n-
    439 const unsigned int boundaryIndex = Library< dimWorld >::boundaryCount++;
    \n-
    440 if( projectionFactory.hasProjection( elementInfo, n-1 ) )
    \n-
    441 {
    \n-
    442 Projection projection = projectionFactory.projection( elementInfo, n-1 );
    \n-
    443 return new NodeProjection< dim, Projection >( boundaryIndex, projection );
    \n-
    444 }
    \n-
    445 else
    \n-
    446 return new BasicNodeProjection( boundaryIndex );
    \n-
    447 }
    \n-
    448 else if( (dim < dimWorld) && (n == 0) )
    \n-
    449 {
    \n-
    450 const unsigned int boundaryIndex = std::numeric_limits< unsigned int >::max();
    \n-
    451 if( projectionFactory.hasProjection( elementInfo ) )
    \n-
    452 {
    \n-
    453 Projection projection = projectionFactory.projection( elementInfo );
    \n-
    454 return new NodeProjection< dim, Projection >( boundaryIndex, projection );
    \n-
    455 }
    \n-
    456 else
    \n-
    457 return 0;
    \n-
    458 }
    \n-
    459 else
    \n-
    460 return 0;
    \n-
    461 }
    \n-
    462
    \n-
    463 } // namespace Alberta
    \n-
    464
    \n-
    465} // namespace Dune
    \n-
    466
    \n-
    467#endif // #if HAVE_ALBERTA
    \n-
    468
    \n-
    469#endif // #ifndef DUNE_ALBERTA_MESHPOINTER_HH
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n-
    provides a wrapper for ALBERTA's macro_data structure
    \n-
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+
    81 inline static K invert ( [[maybe_unused]] const FieldMatrix< K, 0, m > &matrix,
    \n+
    82 [[maybe_unused]] FieldMatrix< K, m, 0 > &inverse )
    \n+
    83 {
    \n+
    84 return K( 1 );
    \n+
    85 }
    \n+
    \n+
    86
    \n+
    87 template< class K >
    \n+
    \n+
    88 inline static K invert ( const FieldMatrix< K, 1, 1 > &matrix,
    \n+
    89 FieldMatrix< K, 1, 1 > &inverse )
    \n+
    90 {
    \n+
    91 inverse[ 0 ][ 0 ] = K( 1 ) / matrix[ 0 ][ 0 ];
    \n+
    92 return matrix[ 0 ][ 0 ];
    \n+
    93 }
    \n+
    \n+
    94
    \n+
    95 template< class K, int m >
    \n+
    \n+
    96 inline static K invert ( const FieldMatrix< K, 1, m > &matrix,
    \n+
    97 FieldMatrix< K, m, 1 > &inverse )
    \n+
    98 {
    \n+
    99 using std::sqrt;
    \n+
    100 K detSqr = matrix[ 0 ].two_norm2();
    \n+
    101 K invDetSqr = K( 1 ) / detSqr;
    \n+
    102 for( int i = 0; i < m; ++i )
    \n+
    103 inverse[ i ][ 0 ] = invDetSqr * matrix[ 0 ][ i ];
    \n+
    104 return sqrt( detSqr );
    \n+
    105 }
    \n+
    \n+
    106
    \n+
    107 template< class K >
    \n+
    \n+
    108 inline static K invert ( const FieldMatrix< K, 2, 2 > &matrix,
    \n+
    109 FieldMatrix< K, 2, 2 > &inverse )
    \n+
    110 {
    \n+
    111 K det = determinant( matrix );
    \n+
    112 K invDet = K( 1 ) / det;
    \n+
    113 inverse[ 0 ][ 0 ] = invDet * matrix[ 1 ][ 1 ];
    \n+
    114 inverse[ 0 ][ 1 ] = - invDet * matrix[ 0 ][ 1 ];
    \n+
    115 inverse[ 1 ][ 0 ] = - invDet * matrix[ 1 ][ 0 ];
    \n+
    116 inverse[ 1 ][ 1 ] = invDet * matrix[ 0 ][ 0 ];
    \n+
    117 return det;
    \n+
    118 }
    \n+
    \n+
    119
    \n+
    120 template< class K, int m >
    \n+
    \n+
    121 inline static K invert ( const FieldMatrix< K, 2, m > &matrix,
    \n+
    122 FieldMatrix< K, m, 2 > &inverse )
    \n+
    123 {
    \n+
    124 using std::sqrt;
    \n+
    125 const K tmpA = matrix[ 0 ].two_norm2();
    \n+
    126 const K tmpB = matrix[ 1 ].two_norm2();
    \n+
    127 const K tmpC = matrix[ 0 ] * matrix[ 1 ];
    \n+
    128 const K detSqr = tmpA * tmpB - tmpC * tmpC;
    \n+
    129 const K invDetSqr = K( 1 ) / detSqr;
    \n+
    130 for( int i = 0; i < m; ++i )
    \n+
    131 {
    \n+
    132 inverse[ i ][ 0 ] = invDetSqr * (tmpB * matrix[ 0 ][ i ] - tmpC * matrix[ 1 ][ i ]);
    \n+
    133 inverse[ i ][ 1 ] = invDetSqr * (tmpA * matrix[ 1 ][ i ] - tmpC * matrix[ 0 ][ i ]);
    \n+
    134 }
    \n+
    135 return sqrt( detSqr );
    \n+
    136 }
    \n+
    \n+
    137
    \n+
    138 template< class K >
    \n+
    \n+
    139 inline static K invert ( const FieldMatrix< K, 3, 3 > &matrix,
    \n+
    140 FieldMatrix< K, 3, 3 > &inverse )
    \n+
    141 {
    \n+
    142 return FMatrixHelp::invertMatrix( matrix, inverse );
    \n+
    143 }
    \n+
    \n+
    144 }
    \n+
    145
    \n+
    146}
    \n+
    147
    \n+
    148#endif // #ifndef DUNE_ALBERTA_ALGEBRA_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA MESH Mesh
    Definition misc.hh:53
    \n-
    ALBERTA REAL Real
    Definition misc.hh:48
    \n-
    static const int meshRefined
    Definition misc.hh:56
    \n-
    static const int dimWorld
    Definition misc.hh:46
    \n-
    static const int meshCoarsened
    Definition misc.hh:57
    \n-
    Definition meshpointer.hh:40
    \n-
    int numMacroElements() const
    Definition meshpointer.hh:257
    \n-
    unsigned int create(const MacroData< dim > &macroData, const ProjectionFactoryInterface< Proj, Impl > &projectionFactory)
    Definition meshpointer.hh:312
    \n-
    void release()
    Definition meshpointer.hh:361
    \n-
    unsigned int read(const std::string &filename, Real &time)
    Definition meshpointer.hh:342
    \n-
    MacroIterator end() const
    Definition meshpointer.hh:76
    \n-
    bool coarsen(typename FillFlags::Flags fillFlags=FillFlags::nothing)
    Definition meshpointer.hh:398
    \n-
    int size(int codim) const
    \n-
    unsigned int create(const std::string &filename, bool binary=false)
    Definition meshpointer.hh:331
    \n-
    void leafTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:385
    \n-
    unsigned int create(const MacroData< dim > &macroData)
    Definition meshpointer.hh:299
    \n-
    MacroIterator begin() const
    Definition meshpointer.hh:71
    \n-
    MeshPointer(Mesh *mesh)
    Definition meshpointer.hh:57
    \n-
    bool write(const std::string &filename, Real time) const
    Definition meshpointer.hh:353
    \n-
    bool refine(typename FillFlags::Flags fillFlags=FillFlags::nothing)
    Definition meshpointer.hh:407
    \n-
    MeshPointer()
    Definition meshpointer.hh:53
    \n-
    void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:370
    \n-
    Definition elementinfo.hh:43
    \n-
    void hierarchicTraverse(Functor &functor) const
    Definition elementinfo.hh:695
    \n-
    void leafTraverse(Functor &functor) const
    Definition elementinfo.hh:708
    \n-
    Definition macrodata.hh:30
    \n-
    void release()
    release the macro data structure
    Definition macrodata.hh:127
    \n-
    void read(const std::string &filename, bool binary=false)
    Definition macrodata.hh:413
    \n-
    Definition macroelement.hh:24
    \n-
    bool isBoundary(const int face) const
    Definition macroelement.hh:42
    \n-
    Definition meshpointer.hh:167
    \n-
    const MeshPointer & mesh() const
    Definition meshpointer.hh:211
    \n-
    const MacroElement & macroElement() const
    Definition meshpointer.hh:205
    \n-
    Alberta::ElementInfo< dim > ElementInfo
    Definition meshpointer.hh:174
    \n-
    Alberta::MeshPointer< dim > MeshPointer
    Definition meshpointer.hh:173
    \n-
    ElementInfo elementInfo(typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:238
    \n-
    bool done() const
    Definition meshpointer.hh:189
    \n-
    void increment()
    Definition meshpointer.hh:199
    \n-
    bool equals(const MacroIterator &other) const
    Definition meshpointer.hh:194
    \n-
    MacroIterator()
    Definition meshpointer.hh:176
    \n-
    Definition misc.hh:231
    \n-
    static const Flags nothing
    Definition misc.hh:234
    \n-
    ALBERTA FLAGS Flags
    Definition misc.hh:232
    \n-
    static const Flags standard
    Definition misc.hh:258
    \n-
    Definition albertagrid/projection.hh:135
    \n-
    Base::Projection Projection
    Definition albertagrid/projection.hh:140
    \n-
    Definition albertagrid/projection.hh:80
    \n-
    Definition albertagrid/projection.hh:208
    \n-\n+
    static K determinant(const FieldMatrix< K, 0, m > &matrix)
    Definition algebra.hh:30
    \n+
    static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 > &inverse)
    Definition algebra.hh:81
    \n+
    static FieldVector< K, 3 > vectorProduct(const FieldVector< K, 3 > &u, const FieldVector< K, 3 > &v)
    Definition algebra.hh:19
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,643 +1,179 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-meshpointer.hh\n+algebra.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_MESHPOINTER_HH\n-6#define DUNE_ALBERTA_MESHPOINTER_HH\n+5#ifndef DUNE_ALBERTA_ALGEBRA_HH\n+6#define DUNE_ALBERTA_ALGEBRA_HH\n 7\n-13#include \n-14#include \n-15\n-16#include \n-17#include \n-18#include \n-19#include \n-20\n-21#if HAVE_ALBERTA\n-22\n-23namespace Dune\n-24{\n-25\n-26 namespace Alberta\n-27 {\n+8#include \n+9#include \n+10\n+11namespace Dune\n+12{\n+13\n+14 namespace Alberta\n+15 {\n+16\n+17 template< class K >\n+18 inline static FieldVector< K, 3 >\n+19 vectorProduct ( const FieldVector< K, 3 > &u, const FieldVector< K, 3 > &v )\n+20 {\n+21 FieldVector< K, 3 > w;\n+22 w[ 0 ] = u[ 1 ] * v[ 2 ] - u[ 2 ] * v[ 1 ];\n+23 w[ 1 ] = u[ 2 ] * v[ 0 ] - u[ 0 ] * v[ 2 ];\n+24 w[ 2 ] = u[ 0 ] * v[ 1 ] - u[ 1 ] * v[ 0 ];\n+25 return w;\n+26 }\n+27\n 28\n-29 // External Forward Declarations\n-30 // -----------------------------\n-31\n-32 template< int dim >\n-33 class HierarchyDofNumbering;\n+29 template< class K, int m >\n+30 inline static K determinant ( [[maybe_unused]] const FieldMatrix< K, 0, m >\n+&matrix )\n+31 {\n+32 return K( 1 );\n+33 }\n 34\n-35 // MeshPointer\n-36 // -----------\n-37\n-38 template< int dim >\n-39 class MeshPointer\n-40 {\n-41 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n-42 typedef typename ElementInfo::MacroElement MacroElement;\n-43 typedef typename ElementInfo::FillFlags FillFlags;\n-44\n-45 class BoundaryProvider;\n-46\n-47 template< int dimWorld >\n-48 struct Library;\n-49\n-50 public:\n-51 class MacroIterator;\n-52\n-53 MeshPointer ()\n-54 : mesh_( 0 )\n-55 {}\n+35 template< class K >\n+36 inline static K determinant ( const FieldMatrix< K, 1, 1 > &matrix )\n+37 {\n+38 return matrix[ 0 ][ 0 ];\n+39 }\n+40\n+41 template< class K, int m >\n+42 inline static K determinant ( const FieldMatrix< K, 1, m > &matrix )\n+43 {\n+44 using std::sqrt;\n+45 K sum = matrix[ 0 ][ 0 ] * matrix[ 0 ][ 0 ];\n+46 for( int i = 1; i < m; ++i )\n+47 sum += matrix[ 0 ][ i ] * matrix[ 0 ][ i ];\n+48 return sqrt( sum );\n+49 }\n+50\n+51 template< class K >\n+52 inline static K determinant ( const FieldMatrix< K, 2, 2 > &matrix )\n+53 {\n+54 return matrix[ 0 ][ 0 ] * matrix[ 1 ][ 1 ] - matrix[ 0 ][ 1 ] * matrix[ 1 ]\n+[ 0 ];\n+55 }\n 56\n-57 explicit MeshPointer ( Mesh *mesh )\n-58 : mesh_( mesh )\n-59 {}\n-60\n-61 operator Mesh * () const\n-62 {\n-63 return mesh_;\n-64 }\n-65\n-66 explicit operator bool () const\n-67 {\n-68 return (bool)mesh_;\n-69 }\n-70\n-71 MacroIterator begin () const\n-72 {\n-73 return MacroIterator( *this, false );\n-74 }\n-75\n-76 MacroIterator end () const\n-77 {\n-78 return MacroIterator( *this, true );\n-79 }\n-80\n-81 int numMacroElements () const;\n-82 int size ( int codim ) const;\n-83\n-84 // create a mesh from a macrodata structure\n-85 // params: macroData - macro data structure\n-86 // returns: number of boundary segments\n-87 unsigned int create ( const MacroData<_dim_> ¯oData );\n-88\n-89 // create a mesh from a macrodata structure, adding projections\n-90 // params: macroData - macro data structure\n-91 // projectionFactory - factory for the projections\n-92 // returns: number of boundary segments\n-93 template< class Proj, class Impl >\n-94 unsigned int create ( const MacroData<_dim_> ¯oData,\n-95 const ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory );\n-96\n-97 // create a mesh from a file\n-98 // params: filename - file name of an Alberta macro triangulation\n-99 // binary - read binary?\n-100 // returns: number of boundary segments\n-101 unsigned int create ( const std::string &filename, bool binary = false );\n-102\n-103 // read back a mesh from a file\n-104 // params: filename - file name of an Alberta save file\n-105 // time - variable to receive the time stored in the file\n-106 // returns: number of boundary segments\n-107 //\n-108 // notes: - projections are not preserved\n-109 // - we assume that projections are added in the same order they\n-110 // inserted in when the grid was created (otherwise the boundary\n-111 // indices change)\n-112 unsigned int read ( const std::string &filename, Real &time );\n-113\n-114 bool write ( const std::string &filename, Real time ) const;\n-115\n-116 void release ();\n-117\n-118 template< class Functor >\n-119 void hierarchicTraverse ( Functor &functor,\n-120 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;\n-121\n-122 template< class Functor >\n-123 void leafTraverse ( Functor &functor,\n-124 typename FillFlags::Flags fillFlags = FillFlags::standard ) const;\n-125\n-126 bool coarsen ( typename FillFlags::Flags fillFlags = FillFlags::nothing );\n-127\n-128 bool refine ( typename FillFlags::Flags fillFlags = FillFlags::nothing );\n-129\n-130 private:\n-131 static ALBERTA NODE_PROJECTION *\n-132 initNodeProjection ( [[maybe_unused]] Mesh *mesh, ALBERTA MACRO_EL\n-*macroElement, int n );\n-133 template< class ProjectionProvider >\n-134 static ALBERTA NODE_PROJECTION *\n-135 initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL *macroElement, int n );\n-136\n-137 Mesh *mesh_;\n-138 };\n-139\n-140\n-141\n-142 // MeshPointer::Library\n-143 // --------------------\n-144\n-145 template< int dim >\n-146 template< int dimWorld >\n-147 struct MeshPointer< dim >::Library\n-148 {\n-149 typedef Alberta::MeshPointer<_dim_> MeshPointer;\n-150\n-151 static inline unsigned int boundaryCount = 0;\n-152 static inline const void *projectionFactory = nullptr;\n-153\n-154 static void\n-155 create ( MeshPointer &ptr, const MacroData<_dim_> ¯oData,\n-156 ALBERTA NODE_PROJECTION *(*initNodeProjection)( Mesh *, ALBERTA MACRO_EL *,\n-int ) );\n-157 static void release ( MeshPointer &ptr );\n-158 };\n-159\n-160\n-161\n-162 // MeshPointer::MacroIterator\n-163 // --------------------------\n-164\n-165 template< int dim >\n-166 class MeshPointer< dim >::MacroIterator\n-167 {\n-168 typedef MacroIterator This;\n-169\n-170 friend class MeshPointer< dim >;\n-171\n-172 public:\n-173 typedef Alberta::MeshPointer<_dim_> MeshPointer;\n-174 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n-175\n-176 MacroIterator ()\n-177 : mesh_(),\n-178 index_( -1 )\n-179 {}\n-180\n-181 private:\n-182\n-183 explicit MacroIterator ( const MeshPointer &mesh, bool end = false )\n-184 : mesh_( mesh ),\n-185 index_( end ? mesh.numMacroElements() : 0 )\n-186 {}\n-187\n-188 public:\n-189 bool done () const\n-190 {\n-191 return (index_ >= mesh().numMacroElements());\n-192 }\n-193\n-194 bool equals ( const MacroIterator &other ) const\n-195 {\n-196 return (index_ == other.index_);\n-197 }\n-198\n-199 void increment ()\n-200 {\n-201 assert( !done() );\n-202 ++index_;\n-203 }\n-204\n-205 const MacroElement ¯oElement () const\n-206 {\n-207 assert( !done() );\n-208 return static_cast< const MacroElement & >( mesh().mesh_->macro_els[ index_\n-] );\n-209 }\n-210\n-211 const MeshPointer &mesh () const\n-212 {\n-213 return mesh_;\n-214 }\n-215\n-216 This &operator++ ()\n-217 {\n-218 increment();\n-219 return *this;\n-220 }\n-221\n-222 ElementInfo operator* () const\n-223 {\n-224 return elementInfo();\n-225 }\n-226\n-227 bool operator== ( const MacroIterator &other ) const\n-228 {\n-229 return equals( other );\n-230 }\n-231\n-232 bool operator!= ( const MacroIterator &other ) const\n-233 {\n-234 return !equals( other );\n-235 }\n-236\n-237 ElementInfo\n-238 elementInfo ( typename FillFlags::Flags fillFlags = FillFlags::standard )\n-const\n-239 {\n-240 if( done() )\n-241 return ElementInfo();\n-242 else\n-243 return ElementInfo( mesh(), macroElement(), fillFlags );\n-244 }\n-245\n-246 private:\n-247 MeshPointer mesh_;\n-248 int index_;\n-249 };\n-250\n-251\n-252\n-253 // Implementation of MeshPointer\n-254 // -----------------------------\n-255\n-256 template< int dim >\n-257 inline int MeshPointer<_dim_>::numMacroElements () const\n-258 {\n-259 return (mesh_ ? mesh_->n_macro_el : 0);\n-260 }\n-261\n-262\n-263 template<>\n-264 inline int MeshPointer<_1_>::size( int codim ) const\n-265 {\n-266 assert( (codim >= 0) && (codim <= 1) );\n-267 return (codim == 0 ? mesh_->n_elements : mesh_->n_vertices);\n-268 }\n-269\n-270 template<>\n-271 inline int MeshPointer<_2_>::size( int codim ) const\n-272 {\n-273 assert( (codim >= 0) && (codim <= 2) );\n-274 if( codim == 0 )\n-275 return mesh_->n_elements;\n-276 else if( codim == 2 )\n-277 return mesh_->n_vertices;\n-278 else\n-279 return mesh_->n_edges;\n-280 }\n-281\n-282 template<>\n-283 inline int MeshPointer<_3_>::size( int codim ) const\n-284 {\n-285 assert( (codim >= 0) && (codim <= 3) );\n-286 if( codim == 0 )\n-287 return mesh_->n_elements;\n-288 else if( codim == 3 )\n-289 return mesh_->n_vertices;\n-290 else if( codim == 1 )\n-291 return mesh_->n_faces;\n-292 else\n-293 return mesh_->n_edges;\n-294 }\n-295\n-296\n-297 template< int dim >\n-298 inline unsigned int MeshPointer<_dim_>\n-299_::create ( const MacroData<_dim_> ¯oData )\n-300 {\n-301 release();\n-302\n-303 Library< dimWorld >::boundaryCount = 0;\n-304 Library< dimWorld >::create( *this, macroData, &initNodeProjection );\n-305 return Library< dimWorld >::boundaryCount;\n-306 }\n-307\n-308\n-309 template< int dim >\n-310 template< class Proj, class Impl >\n-311 inline unsigned int MeshPointer<_dim_>\n-312_::create ( const MacroData<_dim_> ¯oData,\n-313 const ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory )\n-314 {\n-315 typedef ProjectionFactoryInterface<_Proj,_Impl_> ProjectionFactory;\n-316\n-317 release();\n-318\n-319 Library< dimWorld >::boundaryCount = 0;\n-320 Library< dimWorld >::projectionFactory = &projectionFactory;\n-321 Library< dimWorld >::create( *this, macroData, &initNodeProjection<\n-ProjectionFactory > );\n-322 Library< dimWorld >::projectionFactory = nullptr;\n-323 return Library< dimWorld >::boundaryCount;\n-324 }\n-325\n-326\n-327\n-328\n-329 template< int dim >\n-330 inline unsigned int MeshPointer<_dim_>\n-331_::create ( const std::string &filename, bool binary )\n-332 {\n-333 MacroData<_dim_> macroData;\n-334 macroData.read( filename, binary );\n-335 const unsigned int boundaryCount = create( macroData );\n-336 macroData.release();\n-337 return boundaryCount;\n-338 }\n-339\n-340\n-341 template< int dim >\n-342 inline unsigned int MeshPointer<_dim_>::read ( const std::string &filename,\n-Real &time )\n-343 {\n-344 release();\n-345\n-346 Library< dimWorld >::boundaryCount = 0;\n-347 mesh_ = ALBERTA read_mesh_xdr( filename.c_str(), &time, NULL, NULL );\n-348 return Library< dimWorld >::boundaryCount;\n-349 }\n-350\n-351\n-352 template< int dim >\n-353 inline bool MeshPointer<_dim_>::write ( const std::string &filename, Real\n-time ) const\n-354 {\n-355 int success = ALBERTA write_mesh_xdr( mesh_, filename.c_str(), time );\n-356 return (success == 0);\n-357 }\n-358\n-359\n-360 template< int dim >\n-361 inline void MeshPointer<_dim_>::release ()\n-362 {\n-363 Library< dimWorld >::release( *this );\n-364 }\n-365\n-366\n-367 template< int dim >\n-368 template< class Functor >\n-369 inline void MeshPointer<_dim_>\n-370_::hierarchicTraverse ( Functor &functor,\n-371 typename FillFlags::Flags fillFlags ) const\n-372 {\n-373 const MacroIterator eit = end();\n-374 for( MacroIterator it = begin(); it != eit; ++it )\n-375 {\n-376 const ElementInfo info = it.elementInfo( fillFlags );\n-377 info.hierarchicTraverse( functor );\n-378 }\n-379 }\n-380\n-381\n-382 template< int dim >\n-383 template< class Functor >\n-384 inline void MeshPointer<_dim_>\n-385_::leafTraverse ( Functor &functor,\n-386 typename FillFlags::Flags fillFlags ) const\n-387 {\n-388 const MacroIterator eit = end();\n-389 for( MacroIterator it = begin(); it != eit; ++it )\n-390 {\n-391 const ElementInfo info = it.elementInfo( fillFlags );\n-392 info.leafTraverse( functor );\n-393 }\n-394 }\n-395\n-396\n-397 template< int dim >\n-398 inline bool MeshPointer<_dim_>::coarsen ( typename FillFlags::Flags\n-fillFlags )\n-399 {\n-400 const bool coarsened = (ALBERTA coarsen( mesh_, fillFlags ) ==\n-meshCoarsened);\n-401 if( coarsened )\n-402 ALBERTA dof_compress( mesh_ );\n-403 return coarsened;\n-404 }\n-405\n-406 template< int dim >\n-407 inline bool MeshPointer<_dim_>::refine ( typename FillFlags::Flags\n-fillFlags )\n-408 {\n-409 return (ALBERTA refine( mesh_, fillFlags ) == meshRefined);\n-410 }\n-411\n-412\n-413 template< int dim >\n-414 inline ALBERTA NODE_PROJECTION *\n-415 MeshPointer<_dim_>::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL\n-*macroEl, int n )\n-416 {\n-417 const MacroElement ¯oElement = static_cast< const MacroElement & >\n-( *macroEl );\n-418 if( (n > 0) && macroElement.isBoundary( n-1 ) )\n-419 return new BasicNodeProjection( Library< dimWorld >::boundaryCount++ );\n-420 else\n-421 return 0;\n-422 }\n-423\n-424\n-425 template< int dim >\n-426 template< class ProjectionFactory >\n-427 inline ALBERTA NODE_PROJECTION *\n-428 MeshPointer< dim >::initNodeProjection ( Mesh *mesh, ALBERTA MACRO_EL\n-*macroEl, int n )\n-429 {\n-430 typedef typename ProjectionFactory::Projection Projection;\n-431\n-432 const MacroElement ¯oElement = static_cast< const MacroElement & >\n-( *macroEl );\n-433\n-434 MeshPointer< dim > meshPointer( mesh );\n-435 ElementInfo elementInfo( meshPointer, macroElement, FillFlags::standard );\n-436 const ProjectionFactory &projectionFactory = *static_cast< const\n-ProjectionFactory * >( Library< dimWorld >::projectionFactory );\n-437 if( (n > 0) && macroElement.isBoundary( n-1 ) )\n-438 {\n-439 const unsigned int boundaryIndex = Library< dimWorld >::boundaryCount++;\n-440 if( projectionFactory.hasProjection( elementInfo, n-1 ) )\n-441 {\n-442 Projection projection = projectionFactory.projection( elementInfo, n-1 );\n-443 return new NodeProjection< dim, Projection >( boundaryIndex, projection );\n-444 }\n-445 else\n-446 return new BasicNodeProjection( boundaryIndex );\n-447 }\n-448 else if( (dim < dimWorld) && (n == 0) )\n-449 {\n-450 const unsigned int boundaryIndex = std::numeric_limits< unsigned int >::max\n-();\n-451 if( projectionFactory.hasProjection( elementInfo ) )\n-452 {\n-453 Projection projection = projectionFactory.projection( elementInfo );\n-454 return new NodeProjection< dim, Projection >( boundaryIndex, projection );\n-455 }\n-456 else\n-457 return 0;\n-458 }\n-459 else\n-460 return 0;\n-461 }\n-462\n-463 } // namespace Alberta\n-464\n-465} // namespace Dune\n-466\n-467#endif // #if HAVE_ALBERTA\n-468\n-469#endif // #ifndef DUNE_ALBERTA_MESHPOINTER_HH\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n-misc.hh\n-macrodata.hh\n-provides a wrapper for ALBERTA's macro_data structure\n-ALBERTA\n-#define ALBERTA\n-Definition albertaheader.hh:29\n+57 template< class K >\n+58 inline static K determinant ( const FieldMatrix< K, 2, 3 > &matrix )\n+59 {\n+60 return vectorProduct( matrix[ 0 ], matrix[ 1 ] ).two_norm();\n+61 }\n+62\n+63 template< class K, int m >\n+64 inline static K determinant ( const FieldMatrix< K, 2, m > &matrix )\n+65 {\n+66 using std::sqrt;\n+67 const K tmpA = matrix[ 0 ].two_norm2();\n+68 const K tmpB = matrix[ 1 ].two_norm2();\n+69 const K tmpC = matrix[ 0 ] * matrix[ 1 ];\n+70 return sqrt( tmpA * tmpB - tmpC * tmpC );\n+71 }\n+72\n+73 template< class K >\n+74 inline static K determinant ( const FieldMatrix< K, 3, 3 > &matrix )\n+75 {\n+76 return matrix[ 0 ] * vectorProduct( matrix[ 1 ], matrix[ 2 ] );\n+77 }\n+78\n+79\n+80 template< class K, int m >\n+81 inline static K invert ( [[maybe_unused]] const FieldMatrix< K, 0, m >\n+&matrix,\n+82 [[maybe_unused]] FieldMatrix< K, m, 0 > &inverse )\n+83 {\n+84 return K( 1 );\n+85 }\n+86\n+87 template< class K >\n+88 inline static K invert ( const FieldMatrix< K, 1, 1 > &matrix,\n+89 FieldMatrix< K, 1, 1 > &inverse )\n+90 {\n+91 inverse[ 0 ][ 0 ] = K( 1 ) / matrix[ 0 ][ 0 ];\n+92 return matrix[ 0 ][ 0 ];\n+93 }\n+94\n+95 template< class K, int m >\n+96 inline static K invert ( const FieldMatrix< K, 1, m > &matrix,\n+97 FieldMatrix< K, m, 1 > &inverse )\n+98 {\n+99 using std::sqrt;\n+100 K detSqr = matrix[ 0 ].two_norm2();\n+101 K invDetSqr = K( 1 ) / detSqr;\n+102 for( int i = 0; i < m; ++i )\n+103 inverse[ i ][ 0 ] = invDetSqr * matrix[ 0 ][ i ];\n+104 return sqrt( detSqr );\n+105 }\n+106\n+107 template< class K >\n+108 inline static K invert ( const FieldMatrix< K, 2, 2 > &matrix,\n+109 FieldMatrix< K, 2, 2 > &inverse )\n+110 {\n+111 K det = determinant( matrix );\n+112 K invDet = K( 1 ) / det;\n+113 inverse[ 0 ][ 0 ] = invDet * matrix[ 1 ][ 1 ];\n+114 inverse[ 0 ][ 1 ] = - invDet * matrix[ 0 ][ 1 ];\n+115 inverse[ 1 ][ 0 ] = - invDet * matrix[ 1 ][ 0 ];\n+116 inverse[ 1 ][ 1 ] = invDet * matrix[ 0 ][ 0 ];\n+117 return det;\n+118 }\n+119\n+120 template< class K, int m >\n+121 inline static K invert ( const FieldMatrix< K, 2, m > &matrix,\n+122 FieldMatrix< K, m, 2 > &inverse )\n+123 {\n+124 using std::sqrt;\n+125 const K tmpA = matrix[ 0 ].two_norm2();\n+126 const K tmpB = matrix[ 1 ].two_norm2();\n+127 const K tmpC = matrix[ 0 ] * matrix[ 1 ];\n+128 const K detSqr = tmpA * tmpB - tmpC * tmpC;\n+129 const K invDetSqr = K( 1 ) / detSqr;\n+130 for( int i = 0; i < m; ++i )\n+131 {\n+132 inverse[ i ][ 0 ] = invDetSqr * (tmpB * matrix[ 0 ][ i ] - tmpC * matrix[ 1\n+][ i ]);\n+133 inverse[ i ][ 1 ] = invDetSqr * (tmpA * matrix[ 1 ][ i ] - tmpC * matrix[ 0\n+][ i ]);\n+134 }\n+135 return sqrt( detSqr );\n+136 }\n+137\n+138 template< class K >\n+139 inline static K invert ( const FieldMatrix< K, 3, 3 > &matrix,\n+140 FieldMatrix< K, 3, 3 > &inverse )\n+141 {\n+142 return FMatrixHelp::invertMatrix( matrix, inverse );\n+143 }\n+144 }\n+145\n+146}\n+147\n+148#endif // #ifndef DUNE_ALBERTA_ALGEBRA_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::Mesh\n-ALBERTA MESH Mesh\n-Definition misc.hh:53\n-Dune::Alberta::Real\n-ALBERTA REAL Real\n-Definition misc.hh:48\n-Dune::Alberta::meshRefined\n-static const int meshRefined\n-Definition misc.hh:56\n-Dune::Alberta::dimWorld\n-static const int dimWorld\n-Definition misc.hh:46\n-Dune::Alberta::meshCoarsened\n-static const int meshCoarsened\n-Definition misc.hh:57\n-Dune::Alberta::MeshPointer\n-Definition meshpointer.hh:40\n-Dune::Alberta::MeshPointer::numMacroElements\n-int numMacroElements() const\n-Definition meshpointer.hh:257\n-Dune::Alberta::MeshPointer::create\n-unsigned int create(const MacroData< dim > ¯oData, const\n-ProjectionFactoryInterface< Proj, Impl > &projectionFactory)\n-Definition meshpointer.hh:312\n-Dune::Alberta::MeshPointer::release\n-void release()\n-Definition meshpointer.hh:361\n-Dune::Alberta::MeshPointer::read\n-unsigned int read(const std::string &filename, Real &time)\n-Definition meshpointer.hh:342\n-Dune::Alberta::MeshPointer::end\n-MacroIterator end() const\n-Definition meshpointer.hh:76\n-Dune::Alberta::MeshPointer::coarsen\n-bool coarsen(typename FillFlags::Flags fillFlags=FillFlags::nothing)\n-Definition meshpointer.hh:398\n-Dune::Alberta::MeshPointer::size\n-int size(int codim) const\n-Dune::Alberta::MeshPointer::create\n-unsigned int create(const std::string &filename, bool binary=false)\n-Definition meshpointer.hh:331\n-Dune::Alberta::MeshPointer::leafTraverse\n-void leafTraverse(Functor &functor, typename FillFlags::Flags\n-fillFlags=FillFlags::standard) const\n-Definition meshpointer.hh:385\n-Dune::Alberta::MeshPointer::create\n-unsigned int create(const MacroData< dim > ¯oData)\n-Definition meshpointer.hh:299\n-Dune::Alberta::MeshPointer::begin\n-MacroIterator begin() const\n-Definition meshpointer.hh:71\n-Dune::Alberta::MeshPointer::MeshPointer\n-MeshPointer(Mesh *mesh)\n-Definition meshpointer.hh:57\n-Dune::Alberta::MeshPointer::write\n-bool write(const std::string &filename, Real time) const\n-Definition meshpointer.hh:353\n-Dune::Alberta::MeshPointer::refine\n-bool refine(typename FillFlags::Flags fillFlags=FillFlags::nothing)\n-Definition meshpointer.hh:407\n-Dune::Alberta::MeshPointer::MeshPointer\n-MeshPointer()\n-Definition meshpointer.hh:53\n-Dune::Alberta::MeshPointer::hierarchicTraverse\n-void hierarchicTraverse(Functor &functor, typename FillFlags::Flags\n-fillFlags=FillFlags::standard) const\n-Definition meshpointer.hh:370\n-Dune::Alberta::ElementInfo\n-Definition elementinfo.hh:43\n-Dune::Alberta::ElementInfo::hierarchicTraverse\n-void hierarchicTraverse(Functor &functor) const\n-Definition elementinfo.hh:695\n-Dune::Alberta::ElementInfo::leafTraverse\n-void leafTraverse(Functor &functor) const\n-Definition elementinfo.hh:708\n-Dune::Alberta::MacroData\n-Definition macrodata.hh:30\n-Dune::Alberta::MacroData::release\n-void release()\n-release the macro data structure\n-Definition macrodata.hh:127\n-Dune::Alberta::MacroData::read\n-void read(const std::string &filename, bool binary=false)\n-Definition macrodata.hh:413\n-Dune::Alberta::MacroElement\n-Definition macroelement.hh:24\n-Dune::Alberta::MacroElement::isBoundary\n-bool isBoundary(const int face) const\n-Definition macroelement.hh:42\n-Dune::Alberta::MeshPointer::MacroIterator\n-Definition meshpointer.hh:167\n-Dune::Alberta::MeshPointer::MacroIterator::mesh\n-const MeshPointer & mesh() const\n-Definition meshpointer.hh:211\n-Dune::Alberta::MeshPointer::MacroIterator::macroElement\n-const MacroElement & macroElement() const\n-Definition meshpointer.hh:205\n-Dune::Alberta::MeshPointer::MacroIterator::ElementInfo\n-Alberta::ElementInfo< dim > ElementInfo\n-Definition meshpointer.hh:174\n-Dune::Alberta::MeshPointer::MacroIterator::MeshPointer\n-Alberta::MeshPointer< dim > MeshPointer\n-Definition meshpointer.hh:173\n-Dune::Alberta::MeshPointer::MacroIterator::elementInfo\n-ElementInfo elementInfo(typename FillFlags::Flags fillFlags=FillFlags::\n-standard) const\n-Definition meshpointer.hh:238\n-Dune::Alberta::MeshPointer::MacroIterator::done\n-bool done() const\n-Definition meshpointer.hh:189\n-Dune::Alberta::MeshPointer::MacroIterator::increment\n-void increment()\n-Definition meshpointer.hh:199\n-Dune::Alberta::MeshPointer::MacroIterator::equals\n-bool equals(const MacroIterator &other) const\n-Definition meshpointer.hh:194\n-Dune::Alberta::MeshPointer::MacroIterator::MacroIterator\n-MacroIterator()\n-Definition meshpointer.hh:176\n-Dune::Alberta::FillFlags\n-Definition misc.hh:231\n-Dune::Alberta::FillFlags::nothing\n-static const Flags nothing\n-Definition misc.hh:234\n-Dune::Alberta::FillFlags::Flags\n-ALBERTA FLAGS Flags\n-Definition misc.hh:232\n-Dune::Alberta::FillFlags::standard\n-static const Flags standard\n-Definition misc.hh:258\n-Dune::Alberta::ProjectionFactory\n-Definition albertagrid/projection.hh:135\n-Dune::Alberta::ProjectionFactory::Projection\n-Base::Projection Projection\n-Definition albertagrid/projection.hh:140\n-Dune::Alberta::ProjectionFactoryInterface\n-Definition albertagrid/projection.hh:80\n-Dune::Alberta::BasicNodeProjection\n-Definition albertagrid/projection.hh:208\n-projection.hh\n+Dune::Alberta::determinant\n+static K determinant(const FieldMatrix< K, 0, m > &matrix)\n+Definition algebra.hh:30\n+Dune::Alberta::invert\n+static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 >\n+&inverse)\n+Definition algebra.hh:81\n+Dune::Alberta::vectorProduct\n+static FieldVector< K, 3 > vectorProduct(const FieldVector< K, 3 > &u, const\n+FieldVector< K, 3 > &v)\n+Definition algebra.hh:19\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00674.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00674.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: albertareader.hh File Reference\n+dune-grid: indexstack.hh File Reference\n \n \n \n \n \n \n \n@@ -72,35 +72,41 @@\n
  • dune
  • grid
  • albertagrid
  • \n \n \n
    \n \n-
    albertareader.hh File Reference
    \n+
    indexstack.hh File Reference
    \n
    \n
    \n-
    #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/grid.hh>
    \n-#include <dune/grid/common/gridfactory.hh>
    \n-#include <dune/grid/albertagrid/macrodata.hh>
    \n+\n+

    Provides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid) \n+More...

    \n+
    #include <assert.h>
    \n+#include <stack>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/reservedvector.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::AlbertaReader< Grid >
    class  Dune::IndexStack< T, length >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    Provides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid)

    \n+
    Author
    Robert Kloefkorn
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,22 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n Classes | Namespaces\n-albertareader.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+indexstack.hh File Reference\n+Provides an index stack that supplies indices for element numbering for a grid\n+(i.e. AlbertaGrid and ALUGrid) More...\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::AlbertaReader<_Grid_>\n+class \u00a0 Dune::IndexStack<_T,_length_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+***** Detailed Description *****\n+Provides an index stack that supplies indices for element numbering for a grid\n+(i.e. AlbertaGrid and ALUGrid)\n+ Author\n+ Robert Kloefkorn\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00674_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00674_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: albertareader.hh Source File\n+dune-grid: indexstack.hh Source File\n \n \n \n \n \n \n \n@@ -74,134 +74,257 @@\n \n \n \n
    \n-
    albertareader.hh
    \n+
    indexstack.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_ALBERTAREADER_HH
    \n-
    6#define DUNE_ALBERTA_ALBERTAREADER_HH
    \n+
    5#ifndef DUNE_ALBERTAGRID_INDEXSTACK_HH
    \n+
    6#define DUNE_ALBERTAGRID_INDEXSTACK_HH
    \n
    7
    \n-
    8#include <dune/geometry/type.hh>
    \n-
    9
    \n-\n-\n-
    12
    \n-\n-
    14
    \n-
    15#if HAVE_ALBERTA
    \n-
    16
    \n-
    17namespace Dune
    \n-
    18{
    \n-
    19
    \n-
    20 template< class Grid >
    \n-
    \n-\n-
    22 {
    \n-\n-
    24
    \n-
    25 public:
    \n-\n-
    27
    \n-
    28 typedef typename Grid::ctype ctype;
    \n-
    29
    \n-
    30 static const int dimension = Grid::dimension;
    \n-\n-
    32
    \n-
    33 private:
    \n-
    34 static_assert(dimensionworld == Alberta::dimWorld,
    \n-
    35 "AlbertaReader: world dimension must match ALBERTA's world dimension.");
    \n+
    8#include <assert.h>
    \n+
    9#include <stack>
    \n+
    10
    \n+
    11#include <dune/common/exceptions.hh>
    \n+
    12#include <dune/common/reservedvector.hh>
    \n+
    13
    \n+
    20namespace Dune {
    \n+
    21
    \n+
    24 template <class T, int length>
    \n+
    \n+\n+
    26 {
    \n+
    27 class MyFiniteStack : public ReservedVector<T,length>
    \n+
    28 {
    \n+
    29 typedef ReservedVector<T,length> BaseType ;
    \n+
    30 public:
    \n+
    32 bool full () const { return this->size() >= length; }
    \n+
    33
    \n+
    35 void push( const T& t ) { BaseType :: push_back( t ); }
    \n
    36
    \n-\n-
    38
    \n-
    39 MacroData macroData_;
    \n-
    40
    \n-
    41 AlbertaReader ( const This & );
    \n-
    42 This &operator= ( const This & );
    \n-
    43
    \n-
    44 public:
    \n-
    \n-\n-
    46 {}
    \n-
    \n-
    47
    \n-
    \n-
    48 void readGrid ( const std::string &fileName, GridFactory &factory )
    \n-
    49 {
    \n-
    50 // read ALBERTA macro triangulation
    \n-
    51 macroData_.read( fileName, false );
    \n-
    52
    \n-
    53 // insert all vertices into the factory
    \n-
    54 const int numVertices = macroData_.vertexCount();
    \n-
    55 for( int i = 0; i < numVertices; ++i )
    \n-
    56 {
    \n-
    57 FieldVector< ctype, dimensionworld > v;
    \n-
    58 const Alberta::GlobalVector &coords = macroData_.vertex( i );
    \n-
    59 for( int j = 0; j < dimensionworld; ++j )
    \n-
    60 v[ j ] = coords[ j ];
    \n-
    61 factory.insertVertex( v );
    \n-
    62 }
    \n-
    63
    \n-
    64 // insert all elements into the factory
    \n-
    65 std::vector< unsigned int > vertices( dimension+1 );
    \n-
    66 const int numElements = macroData_.elementCount();
    \n-
    67 for( int i = 0; i < numElements; ++i )
    \n-
    68 {
    \n-
    69 const typename MacroData::ElementId &id = macroData_.element( i );
    \n-
    70 for( int j = 0; j <= dimension; ++j )
    \n-
    71 vertices[ j ] = id[ j ];
    \n-
    72 factory.insertElement( GeometryTypes::simplex( dimension ), vertices );
    \n-
    73 }
    \n+
    38 T topAndPop ()
    \n+
    39 {
    \n+
    40 assert( !this->empty() );
    \n+
    41 assert( this->size() <= length );
    \n+
    42 // This code is not slower than using the array structure directly.
    \n+
    43 // The compiler removes the temporary completely. I measured this.
    \n+
    44 // See the commit message for revision 7837 for more details.
    \n+
    45 T tmp = this->back();
    \n+
    46 this->pop_back();
    \n+
    47 return tmp;
    \n+
    48 }
    \n+
    49 };
    \n+
    50
    \n+
    51 typedef MyFiniteStack StackType;
    \n+
    52 typedef typename std::stack < StackType * > StackListType;
    \n+
    53
    \n+
    54 StackListType fullStackList_;
    \n+
    55 StackListType emptyStackList_;
    \n+
    56
    \n+
    57 //typedef typename StackListType::Iterator DListIteratorType;
    \n+
    58 StackType * stack_;
    \n+
    59
    \n+
    60 // current maxIndex
    \n+
    61 int maxIndex_;
    \n+
    62 public:
    \n+
    64 inline IndexStack();
    \n+
    65
    \n+
    67 inline ~IndexStack ();
    \n+
    68
    \n+
    70 inline void checkAndSetMax(T index) { if(index > maxIndex_) maxIndex_ = index;}
    \n+
    71
    \n+
    73 inline void setMaxIndex(T index) { maxIndex_ = index; }
    \n
    74
    \n-
    75 // release ALBERTA macro data
    \n-
    76 macroData_.release();
    \n-
    77 }
    \n-
    \n-
    78 };
    \n-
    \n-
    79
    \n-
    80}
    \n-
    81
    \n-
    82#endif // #if HAVE_ALBERTA
    \n+
    76 inline int getMaxIndex() const { return maxIndex_; }
    \n+
    77
    \n+
    79 inline int size() const { return getMaxIndex(); }
    \n+
    80
    \n+
    82 inline T getIndex ();
    \n
    83
    \n-
    84#endif
    \n-
    provides a wrapper for ALBERTA's macro_data structure
    \n+
    85 inline void freeIndex(T index);
    \n+
    86
    \n+
    88 inline void test ();
    \n+
    89
    \n+
    90 // backup set to out stream
    \n+
    91 inline void backupIndexSet ( std::ostream & os );
    \n+
    92
    \n+
    93 // restore from in stream
    \n+
    94 inline void restoreIndexSet ( std::istream & is );
    \n+
    95 private:
    \n+
    96 // no copy constructor allowed
    \n+
    97 IndexStack( const IndexStack<T,length> & s) : maxIndex_ (0) , stack_(0) {}
    \n+
    98
    \n+
    99 // no assignment operator allowed
    \n+
    100 IndexStack<T,length> & operator = ( const IndexStack<T,length> & s)
    \n+
    101 {
    \n+
    102 DUNE_THROW(Exception, "IndexStack::operator = () not allowed!");
    \n+
    103 return *this;
    \n+
    104 }
    \n+
    105
    \n+
    106 // clear fullStacks
    \n+
    107 void clearStack ();
    \n+
    108
    \n+
    109 }; // end class IndexStack
    \n+
    \n+
    110
    \n+
    111 //****************************************************************
    \n+
    112 // Inline implementation
    \n+
    113 // ***************************************************************
    \n+
    114 template <class T, int length>
    \n+
    \n+\n+
    116 : stack_ ( new StackType () ) , maxIndex_ (0) {}
    \n+
    \n+
    117
    \n+
    118 template <class T, int length>
    \n+
    \n+\n+
    120 {
    \n+
    121 if(stack_) delete stack_;
    \n+
    122 stack_ = 0;
    \n+
    123
    \n+
    124 while( !fullStackList_.empty() )
    \n+
    125 {
    \n+
    126 StackType * st = fullStackList_.top();
    \n+
    127 if(st) delete st;
    \n+
    128 fullStackList_.pop();
    \n+
    129 }
    \n+
    130 while( !emptyStackList_.empty() )
    \n+
    131 {
    \n+
    132 StackType * st = emptyStackList_.top();
    \n+
    133 if(st) delete st;
    \n+
    134 emptyStackList_.pop();
    \n+
    135 }
    \n+
    136 }
    \n+
    \n+
    137
    \n+
    138 template <class T, int length>
    \n+
    \n+\n+
    140 {
    \n+
    141 if((*stack_).empty())
    \n+
    142 {
    \n+
    143 if( fullStackList_.size() <= 0)
    \n+
    144 {
    \n+
    145 return maxIndex_++;
    \n+
    146 }
    \n+
    147 else
    \n+
    148 {
    \n+
    149 emptyStackList_.push( stack_ );
    \n+
    150 stack_ = fullStackList_.top();
    \n+
    151 fullStackList_.pop();
    \n+
    152 }
    \n+
    153 }
    \n+
    154 return (*stack_).topAndPop();
    \n+
    155 }
    \n+
    \n+
    156
    \n+
    157 template <class T, int length>
    \n+
    \n+
    158 inline void IndexStack<T,length>::freeIndex ( T index )
    \n+
    159 {
    \n+
    160 if((*stack_).full())
    \n+
    161 {
    \n+
    162 fullStackList_.push( stack_ );
    \n+
    163 if(emptyStackList_.size() <= 0)
    \n+
    164 {
    \n+
    165 stack_ = new StackType ();
    \n+
    166 }
    \n+
    167 else
    \n+
    168 {
    \n+
    169 stack_ = emptyStackList_.top();
    \n+
    170 emptyStackList_.pop();
    \n+
    171 }
    \n+
    172 }
    \n+
    173 (*stack_).push(index);
    \n+
    174 }
    \n+
    \n+
    175
    \n+
    176 template <class T, int length>
    \n+
    \n+\n+
    178 {
    \n+
    179 T vec[2*length];
    \n+
    180
    \n+
    181 for(int i=0; i<2*length; i++)
    \n+
    182 vec[i] = getIndex();
    \n+
    183
    \n+
    184 for(int i=0; i<2*length; i++)
    \n+
    185 freeIndex(vec[i]);
    \n+
    186
    \n+
    187 for(int i=0; i<2*length; i++)
    \n+
    188 vec[i] = getIndex();
    \n+
    189
    \n+
    190 for(int i=0; i<2*length; i++)
    \n+
    191 printf(" index [%d] = %d \\n",i,vec[i]);
    \n+
    192 }
    \n+
    \n+
    193
    \n+
    194 template <class T, int length>
    \n+
    \n+
    195 inline void IndexStack<T,length>::backupIndexSet ( std::ostream & os )
    \n+
    196 {
    \n+
    197 // holes are not stored at the moment
    \n+
    198 os.write( ((const char *) &maxIndex_ ), sizeof(int) ) ;
    \n+
    199 return ;
    \n+
    200 }
    \n+
    \n+
    201
    \n+
    202 template <class T, int length>
    \n+
    \n+
    203 inline void IndexStack<T,length>::restoreIndexSet ( std::istream & is )
    \n+
    204 {
    \n+
    205 is.read ( ((char *) &maxIndex_), sizeof(int) );
    \n+
    206 clearStack ();
    \n+
    207
    \n+
    208 return ;
    \n+
    209 }
    \n+
    \n+
    210
    \n+
    211 template <class T, int length>
    \n+\n+
    213 {
    \n+
    214 if(stack_)
    \n+
    215 {
    \n+
    216 delete stack_;
    \n+
    217 stack_ = new StackType();
    \n+
    218 assert(stack_);
    \n+
    219 }
    \n+
    220
    \n+
    221 while( !fullStackList_.empty() )
    \n+
    222 {
    \n+
    223 StackType * st = fullStackList_.top();
    \n+
    224 if(st) delete st;
    \n+
    225 fullStackList_.pop();
    \n+
    226 }
    \n+
    227 return;
    \n+
    228 }
    \n+
    229
    \n+
    230} // end namespace Dune
    \n+
    231#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    static const int dimWorld
    Definition misc.hh:46
    \n-
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition albertareader.hh:22
    \n-
    Grid::ctype ctype
    Definition albertareader.hh:28
    \n-
    static const int dimensionworld
    Definition albertareader.hh:31
    \n-
    static const int dimension
    Definition albertareader.hh:30
    \n-
    Dune::GridFactory< Grid > GridFactory
    Definition albertareader.hh:26
    \n-
    AlbertaReader()
    Definition albertareader.hh:45
    \n-
    void readGrid(const std::string &fileName, GridFactory &factory)
    Definition albertareader.hh:48
    \n-\n-
    int ElementId[numVertices]
    Definition macrodata.hh:48
    \n-
    void release()
    release the macro data structure
    Definition macrodata.hh:127
    \n-
    int elementCount() const
    Definition macrodata.hh:68
    \n-
    GlobalVector & vertex(int i) const
    Definition macrodata.hh:255
    \n-
    int vertexCount() const
    Definition macrodata.hh:63
    \n-
    ElementId & element(int i) const
    Definition macrodata.hh:246
    \n-
    void read(const std::string &filename, bool binary=false)
    Definition macrodata.hh:413
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n-
    ct ctype
    Define type used for coordinates in grid module.
    Definition common/grid.hh:518
    \n-\n-
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
    Insert an element into the coarse grid.
    Definition common/gridfactory.hh:307
    \n-
    virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
    Insert a vertex into the coarse grid.
    Definition common/gridfactory.hh:296
    \n-
    Provide a generic factory class for unstructured grids.
    \n-
    Different resources needed by all grid implementations.
    \n+
    Definition indexstack.hh:26
    \n+
    void restoreIndexSet(std::istream &is)
    Definition indexstack.hh:203
    \n+
    void checkAndSetMax(T index)
    set index as maxIndex if index is bigger than maxIndex
    Definition indexstack.hh:70
    \n+
    void backupIndexSet(std::ostream &os)
    Definition indexstack.hh:195
    \n+
    ~IndexStack()
    Destructor, deleting all stacks.
    Definition indexstack.hh:119
    \n+
    T getIndex()
    restore index from stack or create new index
    Definition indexstack.hh:139
    \n+
    IndexStack()
    Constructor, create new IndexStack.
    Definition indexstack.hh:115
    \n+
    void setMaxIndex(T index)
    set index as maxIndex
    Definition indexstack.hh:73
    \n+
    int size() const
    return maxIndex which is also the
    Definition indexstack.hh:79
    \n+
    void test()
    test stack functionality
    Definition indexstack.hh:177
    \n+
    void freeIndex(T index)
    store index on stack
    Definition indexstack.hh:158
    \n+
    int getMaxIndex() const
    return maxIndex which is also the
    Definition indexstack.hh:76
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,176 +1,271 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-albertareader.hh\n+indexstack.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_ALBERTAREADER_HH\n-6#define DUNE_ALBERTA_ALBERTAREADER_HH\n+5#ifndef DUNE_ALBERTAGRID_INDEXSTACK_HH\n+6#define DUNE_ALBERTAGRID_INDEXSTACK_HH\n 7\n-8#include \n-9\n-10#include \n-11#include \n-12\n-13#include \n-14\n-15#if HAVE_ALBERTA\n-16\n-17namespace Dune\n-18{\n-19\n-20 template< class Grid >\n-21 class AlbertaReader\n-22 {\n-23 typedef AlbertaReader<_Grid_> This;\n-24\n-25 public:\n-26 typedef Dune::GridFactory<_Grid_> GridFactory;\n-27\n-28 typedef typename Grid::ctype ctype;\n-29\n-30 static const int dimension = Grid::dimension;\n-31 static const int dimensionworld = Grid::dimensionworld;\n-32\n-33 private:\n-34 static_assert(dimensionworld == Alberta::dimWorld,\n-35 \"AlbertaReader: world dimension must match ALBERTA's world dimension.\");\n+8#include \n+9#include \n+10\n+11#include \n+12#include \n+13\n+20namespace Dune {\n+21\n+24 template \n+25 class IndexStack\n+26 {\n+27 class MyFiniteStack : public ReservedVector\n+28 {\n+29 typedef ReservedVector BaseType ;\n+30 public:\n+32 bool full () const { return this->size() >= length; }\n+33\n+35 void push( const T& t ) { BaseType :: push_back( t ); }\n 36\n-37 typedef Alberta::MacroData<_dimension_> MacroData;\n-38\n-39 MacroData macroData_;\n-40\n-41 AlbertaReader ( const This & );\n-42 This &operator= ( const This & );\n-43\n-44 public:\n-45 AlbertaReader ()\n-46 {}\n-47\n-48 void readGrid ( const std::string &fileName, GridFactory &factory )\n-49 {\n-50 // read ALBERTA macro triangulation\n-51 macroData_.read( fileName, false );\n-52\n-53 // insert all vertices into the factory\n-54 const int numVertices = macroData_.vertexCount();\n-55 for( int i = 0; i < numVertices; ++i )\n-56 {\n-57 FieldVector< ctype, dimensionworld > v;\n-58 const Alberta::GlobalVector &coords = macroData_.vertex( i );\n-59 for( int j = 0; j < dimensionworld; ++j )\n-60 v[ j ] = coords[ j ];\n-61 factory.insertVertex( v );\n-62 }\n-63\n-64 // insert all elements into the factory\n-65 std::vector< unsigned int > vertices( dimension+1 );\n-66 const int numElements = macroData_.elementCount();\n-67 for( int i = 0; i < numElements; ++i )\n-68 {\n-69 const typename MacroData::ElementId &id = macroData_.element( i );\n-70 for( int j = 0; j <= dimension; ++j )\n-71 vertices[ j ] = id[ j ];\n-72 factory.insertElement( GeometryTypes::simplex( dimension ), vertices );\n-73 }\n+38 T topAndPop ()\n+39 {\n+40 assert( !this->empty() );\n+41 assert( this->size() <= length );\n+42 // This code is not slower than using the array structure directly.\n+43 // The compiler removes the temporary completely. I measured this.\n+44 // See the commit message for revision 7837 for more details.\n+45 T tmp = this->back();\n+46 this->pop_back();\n+47 return tmp;\n+48 }\n+49 };\n+50\n+51 typedef MyFiniteStack StackType;\n+52 typedef typename std::stack < StackType * > StackListType;\n+53\n+54 StackListType fullStackList_;\n+55 StackListType emptyStackList_;\n+56\n+57 //typedef typename StackListType::Iterator DListIteratorType;\n+58 StackType * stack_;\n+59\n+60 // current maxIndex\n+61 int maxIndex_;\n+62 public:\n+64 inline IndexStack();\n+65\n+67 inline ~IndexStack ();\n+68\n+70 inline void checkAndSetMax(T index) { if(index > maxIndex_) maxIndex_ =\n+index;}\n+71\n+73 inline void setMaxIndex(T index) { maxIndex_ = index; }\n 74\n-75 // release ALBERTA macro data\n-76 macroData_.release();\n-77 }\n-78 };\n-79\n-80}\n-81\n-82#endif // #if HAVE_ALBERTA\n+76 inline int getMaxIndex() const { return maxIndex_; }\n+77\n+79 inline int size() const { return getMaxIndex(); }\n+80\n+82 inline T getIndex ();\n 83\n-84#endif\n-macrodata.hh\n-provides a wrapper for ALBERTA's macro_data structure\n+85 inline void freeIndex(T index);\n+86\n+88 inline void test ();\n+89\n+90 // backup set to out stream\n+91 inline void backupIndexSet ( std::ostream & os );\n+92\n+93 // restore from in stream\n+94 inline void restoreIndexSet ( std::istream & is );\n+95 private:\n+96 // no copy constructor allowed\n+97 IndexStack( const IndexStack & s) : maxIndex_ (0) , stack_(0) {}\n+98\n+99 // no assignment operator allowed\n+100 IndexStack & operator = ( const IndexStack & s)\n+101 {\n+102 DUNE_THROW(Exception, \"IndexStack::operator = () not allowed!\");\n+103 return *this;\n+104 }\n+105\n+106 // clear fullStacks\n+107 void clearStack ();\n+108\n+109 }; // end class IndexStack\n+110\n+111 //****************************************************************\n+112 // Inline implementation\n+113 // ***************************************************************\n+114 template \n+115 inline IndexStack::IndexStack()\n+116 : stack_ ( new StackType () ) , maxIndex_ (0) {}\n+117\n+118 template \n+119 inline IndexStack::~IndexStack ()\n+120 {\n+121 if(stack_) delete stack_;\n+122 stack_ = 0;\n+123\n+124 while( !fullStackList_.empty() )\n+125 {\n+126 StackType * st = fullStackList_.top();\n+127 if(st) delete st;\n+128 fullStackList_.pop();\n+129 }\n+130 while( !emptyStackList_.empty() )\n+131 {\n+132 StackType * st = emptyStackList_.top();\n+133 if(st) delete st;\n+134 emptyStackList_.pop();\n+135 }\n+136 }\n+137\n+138 template \n+139 inline T IndexStack::getIndex ()\n+140 {\n+141 if((*stack_).empty())\n+142 {\n+143 if( fullStackList_.size() <= 0)\n+144 {\n+145 return maxIndex_++;\n+146 }\n+147 else\n+148 {\n+149 emptyStackList_.push( stack_ );\n+150 stack_ = fullStackList_.top();\n+151 fullStackList_.pop();\n+152 }\n+153 }\n+154 return (*stack_).topAndPop();\n+155 }\n+156\n+157 template \n+158 inline void IndexStack::freeIndex ( T index )\n+159 {\n+160 if((*stack_).full())\n+161 {\n+162 fullStackList_.push( stack_ );\n+163 if(emptyStackList_.size() <= 0)\n+164 {\n+165 stack_ = new StackType ();\n+166 }\n+167 else\n+168 {\n+169 stack_ = emptyStackList_.top();\n+170 emptyStackList_.pop();\n+171 }\n+172 }\n+173 (*stack_).push(index);\n+174 }\n+175\n+176 template \n+177 inline void IndexStack::test ()\n+178 {\n+179 T vec[2*length];\n+180\n+181 for(int i=0; i<2*length; i++)\n+182 vec[i] = getIndex();\n+183\n+184 for(int i=0; i<2*length; i++)\n+185 freeIndex(vec[i]);\n+186\n+187 for(int i=0; i<2*length; i++)\n+188 vec[i] = getIndex();\n+189\n+190 for(int i=0; i<2*length; i++)\n+191 printf(\" index [%d] = %d \\n\",i,vec[i]);\n+192 }\n+193\n+194 template \n+195 inline void IndexStack::backupIndexSet ( std::ostream & os )\n+196 {\n+197 // holes are not stored at the moment\n+198 os.write( ((const char *) &maxIndex_ ), sizeof(int) ) ;\n+199 return ;\n+200 }\n+201\n+202 template \n+203 inline void IndexStack::restoreIndexSet ( std::istream & is )\n+204 {\n+205 is.read ( ((char *) &maxIndex_), sizeof(int) );\n+206 clearStack ();\n+207\n+208 return ;\n+209 }\n+210\n+211 template \n+212 inline void IndexStack::clearStack ()\n+213 {\n+214 if(stack_)\n+215 {\n+216 delete stack_;\n+217 stack_ = new StackType();\n+218 assert(stack_);\n+219 }\n+220\n+221 while( !fullStackList_.empty() )\n+222 {\n+223 StackType * st = fullStackList_.top();\n+224 if(st) delete st;\n+225 fullStackList_.pop();\n+226 }\n+227 return;\n+228 }\n+229\n+230} // end namespace Dune\n+231#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::dimWorld\n-static const int dimWorld\n-Definition misc.hh:46\n-Dune::Alberta::GlobalVector\n-ALBERTA REAL_D GlobalVector\n-Definition misc.hh:50\n-Dune::AlbertaReader\n-Definition albertareader.hh:22\n-Dune::AlbertaReader::ctype\n-Grid::ctype ctype\n-Definition albertareader.hh:28\n-Dune::AlbertaReader::dimensionworld\n-static const int dimensionworld\n-Definition albertareader.hh:31\n-Dune::AlbertaReader::dimension\n-static const int dimension\n-Definition albertareader.hh:30\n-Dune::AlbertaReader::GridFactory\n-Dune::GridFactory< Grid > GridFactory\n-Definition albertareader.hh:26\n-Dune::AlbertaReader::AlbertaReader\n-AlbertaReader()\n-Definition albertareader.hh:45\n-Dune::AlbertaReader::readGrid\n-void readGrid(const std::string &fileName, GridFactory &factory)\n-Definition albertareader.hh:48\n-Dune::Alberta::MacroData<_dimension_>\n-Dune::Alberta::MacroData<_dimension_>::ElementId\n-int ElementId[numVertices]\n-Definition macrodata.hh:48\n-Dune::Alberta::MacroData::release\n-void release()\n-release the macro data structure\n-Definition macrodata.hh:127\n-Dune::Alberta::MacroData::elementCount\n-int elementCount() const\n-Definition macrodata.hh:68\n-Dune::Alberta::MacroData::vertex\n-GlobalVector & vertex(int i) const\n-Definition macrodata.hh:255\n-Dune::Alberta::MacroData::vertexCount\n-int vertexCount() const\n-Definition macrodata.hh:63\n-Dune::Alberta::MacroData::element\n-ElementId & element(int i) const\n-Definition macrodata.hh:246\n-Dune::Alberta::MacroData::read\n-void read(const std::string &filename, bool binary=false)\n-Definition macrodata.hh:413\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/grid.hh:390\n-Dune::Grid::ctype\n-ct ctype\n-Define type used for coordinates in grid module.\n-Definition common/grid.hh:518\n-Dune::GridFactory<_Grid_>\n-Dune::GridFactory::insertElement\n-virtual void insertElement(const GeometryType &type, const std::vector<\n-unsigned int > &vertices)\n-Insert an element into the coarse grid.\n-Definition common/gridfactory.hh:307\n-Dune::GridFactory::insertVertex\n-virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)\n-Insert a vertex into the coarse grid.\n-Definition common/gridfactory.hh:296\n-gridfactory.hh\n-Provide a generic factory class for unstructured grids.\n-grid.hh\n-Different resources needed by all grid implementations.\n+Dune::IndexStack\n+Definition indexstack.hh:26\n+Dune::IndexStack::restoreIndexSet\n+void restoreIndexSet(std::istream &is)\n+Definition indexstack.hh:203\n+Dune::IndexStack::checkAndSetMax\n+void checkAndSetMax(T index)\n+set index as maxIndex if index is bigger than maxIndex\n+Definition indexstack.hh:70\n+Dune::IndexStack::backupIndexSet\n+void backupIndexSet(std::ostream &os)\n+Definition indexstack.hh:195\n+Dune::IndexStack::~IndexStack\n+~IndexStack()\n+Destructor, deleting all stacks.\n+Definition indexstack.hh:119\n+Dune::IndexStack::getIndex\n+T getIndex()\n+restore index from stack or create new index\n+Definition indexstack.hh:139\n+Dune::IndexStack::IndexStack\n+IndexStack()\n+Constructor, create new IndexStack.\n+Definition indexstack.hh:115\n+Dune::IndexStack::setMaxIndex\n+void setMaxIndex(T index)\n+set index as maxIndex\n+Definition indexstack.hh:73\n+Dune::IndexStack::size\n+int size() const\n+return maxIndex which is also the\n+Definition indexstack.hh:79\n+Dune::IndexStack::test\n+void test()\n+test stack functionality\n+Definition indexstack.hh:177\n+Dune::IndexStack::freeIndex\n+void freeIndex(T index)\n+store index on stack\n+Definition indexstack.hh:158\n+Dune::IndexStack::getMaxIndex\n+int getMaxIndex() const\n+return maxIndex which is also the\n+Definition indexstack.hh:76\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00683.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00683.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: elementinfo.cc File Reference\n+dune-grid: misc.hh File Reference\n \n \n \n \n \n \n \n@@ -70,35 +70,188 @@\n \n \n
    \n \n-
    elementinfo.cc File Reference
    \n+Classes |\n+Namespaces |\n+Macros |\n+Typedefs |\n+Functions |\n+Variables
    \n+
    misc.hh File Reference
    \n \n
    \n-\n-

    provides a wrapper for ALBERTA's el_info structure \n-More...

    \n-\n+
    #include <cassert>
    \n+#include <utility>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/albertagrid/albertaheader.hh>
    \n+
    \n+

    Go to the source code of this file.

    \n+
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\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::AlbertaError
     
    class  Dune::AlbertaIOError
     
    class  Dune::Alberta::GlobalSpace
     
    struct  Dune::Alberta::NumSubEntities< dim, 0 >
     
    struct  Dune::Alberta::NumSubEntities< dim, dim >
     
    struct  Dune::Alberta::NumSubEntities< 0, 0 >
     
    struct  Dune::Alberta::NumSubEntities< 2, 1 >
     
    struct  Dune::Alberta::NumSubEntities< 3, 1 >
     
    struct  Dune::Alberta::NumSubEntities< 3, 2 >
     
    struct  Dune::Alberta::CodimType< dim, 0 >
     
    struct  Dune::Alberta::CodimType< dim, dim >
     
    struct  Dune::Alberta::CodimType< 2, 1 >
     
    struct  Dune::Alberta::CodimType< 3, 1 >
     
    struct  Dune::Alberta::CodimType< 3, 2 >
     
    struct  Dune::Alberta::FillFlags< dim >
     
    struct  Dune::Alberta::RefinementEdge< dim >
     
    struct  Dune::Alberta::RefinementEdge< 2 >
     
    struct  Dune::Alberta::Dune2AlbertaNumbering< dim, codim >
     
    struct  Dune::Alberta::Dune2AlbertaNumbering< 3, 2 >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< dim, codim >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< dim, 1 >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< 1, 1 >
     
    struct  Dune::Alberta::Generic2AlbertaNumbering< 3, 2 >
     
    class  Dune::Alberta::NumberingMap< dim, Numbering >
     
    struct  Dune::Alberta::MapVertices< dim, 0 >
     
    struct  Dune::Alberta::MapVertices< 2, 1 >
     
    struct  Dune::Alberta::MapVertices< 3, 1 >
     
    struct  Dune::Alberta::MapVertices< 3, 2 >
     
    struct  Dune::Alberta::MapVertices< dim, dim >
     
    struct  Dune::Alberta::Twist< dim, subdim >
     
    struct  Dune::Alberta::Twist< dim, 1 >
     
    struct  Dune::Alberta::Twist< 1, 1 >
     
    struct  Dune::Alberta::Twist< dim, 2 >
     
    struct  Dune::Alberta::Twist< 2, 2 >
     
    \n \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+\n+\n+\n+

    \n+Macros

    #define DUNE_ALBERTA_CACHE_COORDINATES   1
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Typedefs

    typedef ALBERTA REAL Dune::Alberta::Real
     
    typedef ALBERTA REAL_B Dune::Alberta::LocalVector
     
    typedef ALBERTA REAL_D Dune::Alberta::GlobalVector
     
    typedef ALBERTA REAL_DD Dune::Alberta::GlobalMatrix
     
    typedef ALBERTA AFF_TRAFO Dune::Alberta::AffineTransformation
     
    typedef ALBERTA MESH Dune::Alberta::Mesh
     
    typedef ALBERTA EL Dune::Alberta::Element
     
    typedef ALBERTA BNDRY_TYPE Dune::Alberta::BoundaryId
     
    typedef U_CHAR Dune::Alberta::ElementType
     
    typedef ALBERTA FE_SPACE Dune::Alberta::DofSpace
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Functions

    template<class Data >
    Data * Dune::Alberta::memAlloc (size_t size)
     
    template<class Data >
    Data * Dune::Alberta::memCAlloc (size_t size)
     
    template<class Data >
    Data * Dune::Alberta::memReAlloc (Data *ptr, size_t oldSize, size_t newSize)
     
    template<class Data >
    void Dune::Alberta::memFree (Data *ptr, size_t size)
     
    template<int dim>
    int Dune::Alberta::applyTwist (int twist, int i)
     
    template<int dim>
    int Dune::Alberta::applyInverseTwist (int twist, int i)
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Variables

    static const int Dune::Alberta::dimWorld = DIM_OF_WORLD
     
    static const int Dune::Alberta::meshRefined = MESH_REFINED
     
    static const int Dune::Alberta::meshCoarsened = MESH_COARSENED
     
    static const int Dune::Alberta::InteriorBoundary = INTERIOR
     
    static const int Dune::Alberta::DirichletBoundary = DIRICHLET
     
    \n-

    Detailed Description

    \n-

    provides a wrapper for ALBERTA's el_info structure

    \n-
    Author
    Martin Nolte
    \n-
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_ALBERTA_CACHE_COORDINATES

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_ALBERTA_CACHE_COORDINATES   1
    \n+
    \n+\n+
    \n+
    \n+\n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,24 +1,150 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Namespaces\n-elementinfo.cc File Reference\n-provides a wrapper for ALBERTA's el_info structure More...\n-#include \n-#include \n+Classes | Namespaces | Macros | Typedefs | Functions | Variables\n+misc.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+ class \u00a0 Dune::AlbertaError\n+\u00a0\n+ class \u00a0 Dune::AlbertaIOError\n+\u00a0\n+ class \u00a0 Dune::Alberta::GlobalSpace\n+\u00a0\n+struct \u00a0 Dune::Alberta::NumSubEntities<_dim,_0_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::NumSubEntities<_dim,_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::NumSubEntities<_0,_0_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::NumSubEntities<_2,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::NumSubEntities<_3,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::NumSubEntities<_3,_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::CodimType<_dim,_0_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::CodimType<_dim,_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::CodimType<_2,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::CodimType<_3,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::CodimType<_3,_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::FillFlags<_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::RefinementEdge<_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::RefinementEdge<_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Dune2AlbertaNumbering<_dim,_codim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Dune2AlbertaNumbering<_3,_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_dim,_codim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_dim,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_1,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Generic2AlbertaNumbering<_3,_2_>\n+\u00a0\n+ class \u00a0 Dune::Alberta::NumberingMap<_dim,_Numbering_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::MapVertices<_dim,_0_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::MapVertices<_2,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::MapVertices<_3,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::MapVertices<_3,_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::MapVertices<_dim,_dim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Twist<_dim,_subdim_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Twist<_dim,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Twist<_1,_1_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Twist<_dim,_2_>\n+\u00a0\n+struct \u00a0 Dune::Alberta::Twist<_2,_2_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n-***** Detailed Description *****\n-provides a wrapper for ALBERTA's el_info structure\n- Author\n- Martin Nolte\n+Macros\n+#define\u00a0 DUNE_ALBERTA_CACHE_COORDINATES\u00a0\u00a0\u00a01\n+\u00a0\n+Typedefs\n+ typedef ALBERTA REAL\u00a0 Dune::Alberta::Real\n+\u00a0\n+ typedef ALBERTA REAL_B\u00a0 Dune::Alberta::LocalVector\n+\u00a0\n+ typedef ALBERTA REAL_D\u00a0 Dune::Alberta::GlobalVector\n+\u00a0\n+ typedef ALBERTA REAL_DD\u00a0 Dune::Alberta::GlobalMatrix\n+\u00a0\n+ typedef ALBERTA AFF_TRAFO\u00a0 Dune::Alberta::AffineTransformation\n+\u00a0\n+ typedef ALBERTA MESH\u00a0 Dune::Alberta::Mesh\n+\u00a0\n+ typedef ALBERTA EL\u00a0 Dune::Alberta::Element\n+\u00a0\n+typedef ALBERTA BNDRY_TYPE\u00a0 Dune::Alberta::BoundaryId\n+\u00a0\n+ typedef U_CHAR\u00a0 Dune::Alberta::ElementType\n+\u00a0\n+ typedef ALBERTA FE_SPACE\u00a0 Dune::Alberta::DofSpace\n+\u00a0\n+Functions\n+template\n+Data *\u00a0 Dune::Alberta::memAlloc (size_t size)\n+\u00a0\n+template\n+Data *\u00a0 Dune::Alberta::memCAlloc (size_t size)\n+\u00a0\n+template\n+Data *\u00a0 Dune::Alberta::memReAlloc (Data *ptr, size_t oldSize, size_t newSize)\n+\u00a0\n+template\n+ void\u00a0 Dune::Alberta::memFree (Data *ptr, size_t size)\n+\u00a0\n+template\n+ int\u00a0 Dune::Alberta::applyTwist (int twist, int i)\n+\u00a0\n+template\n+ int\u00a0 Dune::Alberta::applyInverseTwist (int twist, int i)\n+\u00a0\n+Variables\n+static const int\u00a0 Dune::Alberta::dimWorld = DIM_OF_WORLD\n+\u00a0\n+static const int\u00a0 Dune::Alberta::meshRefined = MESH_REFINED\n+\u00a0\n+static const int\u00a0 Dune::Alberta::meshCoarsened = MESH_COARSENED\n+\u00a0\n+static const int\u00a0 Dune::Alberta::InteriorBoundary = INTERIOR\n+\u00a0\n+static const int\u00a0 Dune::Alberta::DirichletBoundary = DIRICHLET\n+\u00a0\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_ALBERTA_CACHE_COORDINATES *****\n+#define DUNE_ALBERTA_CACHE_COORDINATES\u00a0\u00a0\u00a01\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00686.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00686.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macroelement.hh File Reference\n+dune-grid: coordcache.hh File Reference\n \n \n \n \n \n \n \n@@ -72,24 +72,30 @@\n
  • dune
  • grid
  • albertagrid
  • \n \n \n
    \n \n-
    macroelement.hh File Reference
    \n+
    coordcache.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/albertagrid/misc.hh>
    \n+\n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::Alberta::MacroElement< dim >
    class  Dune::Alberta::CoordCache< dim >
     
    class  Dune::Alberta::CoordCache< dim >::LocalCaching
     
    struct  Dune::Alberta::CoordCache< dim >::Interpolation
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,19 +2,25 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n Classes | Namespaces\n-macroelement.hh File Reference\n-#include \n+coordcache.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::Alberta::MacroElement<_dim_>\n+ class \u00a0 Dune::Alberta::CoordCache<_dim_>\n+\u00a0\n+ class \u00a0 Dune::Alberta::CoordCache<_dim_>::LocalCaching\n+\u00a0\n+struct \u00a0 Dune::Alberta::CoordCache<_dim_>::Interpolation\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00686_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00686_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macroelement.hh Source File\n+dune-grid: coordcache.hh Source File\n \n \n \n \n \n \n \n@@ -74,105 +74,225 @@\n \n \n \n
    \n-
    macroelement.hh
    \n+
    coordcache.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_MACROELEMENT_HH
    \n-
    6#define DUNE_ALBERTA_MACROELEMENT_HH
    \n+
    5#ifndef DUNE_ALBERTA_COORDCACHE_HH
    \n+
    6#define DUNE_ALBERTA_COORDCACHE_HH
    \n
    7
    \n-\n-
    9
    \n-
    10#if HAVE_ALBERTA
    \n+\n+\n+\n
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    15 namespace Alberta
    \n-
    16 {
    \n-
    17
    \n-
    18 // MacroElement
    \n-
    19 // ------------
    \n-
    20
    \n-
    21 template< int dim >
    \n-
    \n-\n-
    23 : public ALBERTA MACRO_EL
    \n-
    24 {
    \n-
    25 const GlobalVector &coordinate ( const int vertex ) const;
    \n-
    26
    \n-
    27 int boundaryId ( const int face ) const;
    \n-
    28 bool isBoundary ( const int face ) const;
    \n-
    29 const MacroElement< dim > *neighbor ( const int face ) const;
    \n-
    30 };
    \n-
    \n+
    12#if HAVE_ALBERTA
    \n+
    13
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17 namespace Alberta
    \n+
    18 {
    \n+
    19
    \n+
    20 // CoordCache
    \n+
    21 // ----------
    \n+
    22
    \n+
    23 template< int dim >
    \n+
    \n+\n+
    25 {
    \n+\n+\n+
    28
    \n+
    29 class LocalCaching;
    \n+
    30 struct Interpolation;
    \n
    31
    \n-
    32
    \n-
    33 template< int dim >
    \n-
    \n-
    34 inline const GlobalVector &MacroElement< dim >::coordinate ( const int vertex ) const
    \n-
    35 {
    \n-
    36 assert( (vertex >= 0) && (vertex < N_VERTICES_MAX) );
    \n-
    37 return *coord[ vertex ];
    \n-
    38 }
    \n-
    \n-
    39
    \n-
    40
    \n-
    41 template< int dim >
    \n-
    \n-
    42 inline bool MacroElement< dim >::isBoundary ( const int face ) const
    \n-
    43 {
    \n-
    44 return (boundaryId( face ) != InteriorBoundary);
    \n-
    45 }
    \n-
    \n-
    46
    \n-
    47
    \n-
    48 template< int dim >
    \n-
    \n-
    49 inline int MacroElement< dim >::boundaryId ( const int face ) const
    \n-
    50 {
    \n-
    51 return wall_bound[ face ];
    \n-
    52 }
    \n-
    \n-
    53
    \n-
    54
    \n-
    55 template< int dim >
    \n-
    \n-
    56 const MacroElement< dim > *MacroElement< dim >::neighbor ( const int face ) const
    \n-
    57 {
    \n-
    58 assert( (face >= 0) && (face < N_NEIGH_MAX) );
    \n-
    59 return static_cast< const MacroElement * >( neigh[ face ] );
    \n-
    60 }
    \n+
    32 public:
    \n+
    33 static const int dimension = dim;
    \n+
    34
    \n+\n+\n+\n+
    38
    \n+
    \n+
    39 GlobalVector &operator() ( const Element *element, int vertex ) const
    \n+
    40 {
    \n+
    41 assert( !(!coords_) );
    \n+
    42 GlobalVector *array = (GlobalVector *)coords_;
    \n+
    43 return array[ dofAccess_( element, vertex ) ];
    \n+
    44 }
    \n+
    \n+
    45
    \n+
    \n+
    46 GlobalVector &operator() ( const ElementInfo &elementInfo, int vertex ) const
    \n+
    47 {
    \n+
    48 return (*this)( elementInfo.el(), vertex );
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    \n+
    51 void create ( const DofNumbering &dofNumbering )
    \n+
    52 {
    \n+
    53 MeshPointer mesh = dofNumbering.mesh();
    \n+
    54 const DofSpace *dofSpace = dofNumbering.dofSpace( dimension );
    \n+
    55
    \n+
    56 coords_.create( dofSpace, "Coordinate Cache" );
    \n+
    57 LocalCaching localCaching( coords_ );
    \n+\n+
    59 coords_.template setupInterpolation< Interpolation >();
    \n+
    60
    \n+
    61 dofAccess_ = DofAccess( dofSpace );
    \n+
    62 }
    \n
    \n-
    61
    \n-
    62 }
    \n
    63
    \n-
    64}
    \n-
    65
    \n-
    66#endif // #if HAVE_ALBERTA
    \n-
    67
    \n-
    68#endif // #ifndef DUNE_ALBERTA_MACROELEMENT_HH
    \n-\n-
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+
    \n+
    64 void release ()
    \n+
    65 {
    \n+
    66 coords_.release();
    \n+
    67 }
    \n+
    \n+
    68
    \n+
    69 private:
    \n+
    70 CoordVectorPointer coords_;
    \n+
    71 DofAccess dofAccess_;
    \n+
    72 };
    \n+
    \n+
    73
    \n+
    74
    \n+
    75
    \n+
    76 // CoordCache::LocalCaching
    \n+
    77 // ------------------------
    \n+
    78
    \n+
    79 template< int dim >
    \n+
    \n+\n+
    81 {
    \n+
    82 CoordVectorPointer coords_;
    \n+
    83 DofAccess dofAccess_;
    \n+
    84
    \n+
    85 public:
    \n+
    \n+
    86 explicit LocalCaching ( const CoordVectorPointer &coords )
    \n+
    87 : coords_( coords ),
    \n+
    88 dofAccess_( coords.dofSpace() )
    \n+
    89 {}
    \n+
    \n+
    90
    \n+
    \n+
    91 void operator() ( const ElementInfo &elementInfo ) const
    \n+
    92 {
    \n+
    93 GlobalVector *array = (GlobalVector *)coords_;
    \n+
    94 for( int i = 0; i < DofAccess::numSubEntities; ++i )
    \n+
    95 {
    \n+
    96 const GlobalVector &x = elementInfo.coordinate( i );
    \n+
    97 GlobalVector &y = array[ dofAccess_( elementInfo.el(), i ) ];
    \n+
    98 for( int i = 0; i < dimWorld; ++i )
    \n+
    99 y[ i ] = x[ i ];
    \n+
    100 }
    \n+
    101 }
    \n+
    \n+
    102 };
    \n+
    \n+
    103
    \n+
    104
    \n+
    105
    \n+
    106 // CoordCache::Interpolation
    \n+
    107 // -------------------------
    \n+
    108
    \n+
    109 template< int dim >
    \n+
    \n+\n+
    111 {
    \n+
    112 static const int dimension = dim;
    \n+
    113
    \n+\n+
    115
    \n+
    116 static void
    \n+
    \n+
    117 interpolateVector ( const CoordVectorPointer &dofVector, const Patch &patch )
    \n+
    118 {
    \n+
    119 DofAccess dofAccess( dofVector.dofSpace() );
    \n+
    120 GlobalVector *array = (GlobalVector *)dofVector;
    \n+
    121
    \n+
    122 const Element *element = patch[ 0 ];
    \n+
    123
    \n+
    124 // new vertex is always the last one
    \n+
    125 assert( element->child[ 0 ] != NULL );
    \n+
    126 GlobalVector &newCoord = array[ dofAccess( element->child[ 0 ], dimension ) ];
    \n+
    127
    \n+
    128 if( element->new_coord != NULL )
    \n+
    129 {
    \n+
    130 for( int j = 0; j < dimWorld; ++j )
    \n+
    131 newCoord[ j ] = element->new_coord[ j ];
    \n+
    132 }
    \n+
    133 else
    \n+
    134 {
    \n+
    135 // new coordinate is the average of of old ones on the same edge
    \n+
    136 // refinement edge is always between vertices 0 and 1
    \n+
    137 const GlobalVector &coord0 = array[ dofAccess( element, 0 ) ];
    \n+
    138 const GlobalVector &coord1 = array[ dofAccess( element, 1 ) ];
    \n+
    139 for( int j = 0; j < dimWorld; ++j )
    \n+
    140 newCoord[ j ] = 0.5 * (coord0[ j ] + coord1[ j ]);
    \n+
    141 }
    \n+
    142 }
    \n+
    \n+
    143 };
    \n+
    \n+
    144
    \n+
    145 }
    \n+
    146
    \n+
    147}
    \n+
    148
    \n+
    149#endif // #if HAVE_ALBERTA
    \n+
    150
    \n+
    151#endif // #ifndef DUNE_ALBERTA_COORDCACHE_HH
    \n+
    provides a wrapper for ALBERTA's mesh structure
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    static const int InteriorBoundary
    Definition misc.hh:59
    \n+
    ALBERTA EL Element
    Definition misc.hh:54
    \n+
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n+
    static const int dimWorld
    Definition misc.hh:46
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition macroelement.hh:24
    \n-
    bool isBoundary(const int face) const
    Definition macroelement.hh:42
    \n-
    const MacroElement< dim > * neighbor(const int face) const
    Definition macroelement.hh:56
    \n-
    int boundaryId(const int face) const
    Definition macroelement.hh:49
    \n-
    const GlobalVector & coordinate(const int vertex) const
    Definition macroelement.hh:34
    \n+
    Definition coordcache.hh:25
    \n+
    static const int dimension
    Definition coordcache.hh:33
    \n+
    GlobalVector & operator()(const Element *element, int vertex) const
    Definition coordcache.hh:39
    \n+
    Alberta::MeshPointer< dimension > MeshPointer
    Definition coordcache.hh:36
    \n+
    void release()
    Definition coordcache.hh:64
    \n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition coordcache.hh:35
    \n+
    HierarchyDofNumbering< dimension > DofNumbering
    Definition coordcache.hh:37
    \n+
    void create(const DofNumbering &dofNumbering)
    Definition coordcache.hh:51
    \n+
    Definition coordcache.hh:81
    \n+
    LocalCaching(const CoordVectorPointer &coords)
    Definition coordcache.hh:86
    \n+
    Definition coordcache.hh:111
    \n+
    Alberta::Patch< dimension > Patch
    Definition coordcache.hh:114
    \n+
    static void interpolateVector(const CoordVectorPointer &dofVector, const Patch &patch)
    Definition coordcache.hh:117
    \n+\n+
    void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:370
    \n+\n+
    static const int numSubEntities
    Definition dofadmin.hh:40
    \n+\n+
    const MeshPointer & mesh() const
    Definition dofadmin.hh:158
    \n+
    const DofSpace * dofSpace(int codim) const
    Definition dofadmin.hh:145
    \n+\n+
    void create(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:236
    \n+
    void release()
    Definition dofvector.hh:254
    \n+
    const DofSpace * dofSpace() const
    Definition dofvector.hh:223
    \n+\n+
    const GlobalVector & coordinate(int vertex) const
    Definition elementinfo.hh:685
    \n+
    Element * el() const
    Definition elementinfo.hh:737
    \n+
    Definition misc.hh:231
    \n+
    Definition refinement.hh:40
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,109 +1,259 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-macroelement.hh\n+coordcache.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_MACROELEMENT_HH\n-6#define DUNE_ALBERTA_MACROELEMENT_HH\n+5#ifndef DUNE_ALBERTA_COORDCACHE_HH\n+6#define DUNE_ALBERTA_COORDCACHE_HH\n 7\n-8#include \n-9\n-10#if HAVE_ALBERTA\n+8#include \n+9#include \n+10#include \n 11\n-12namespace Dune\n-13{\n-14\n-15 namespace Alberta\n-16 {\n-17\n-18 // MacroElement\n-19 // ------------\n-20\n-21 template< int dim >\n-22 struct MacroElement\n-23 : public ALBERTA MACRO_EL\n-24 {\n-25 const GlobalVector &coordinate ( const int vertex ) const;\n-26\n-27 int boundaryId ( const int face ) const;\n-28 bool isBoundary ( const int face ) const;\n-29 const MacroElement<_dim_> *neighbor ( const int face ) const;\n-30 };\n+12#if HAVE_ALBERTA\n+13\n+14namespace Dune\n+15{\n+16\n+17 namespace Alberta\n+18 {\n+19\n+20 // CoordCache\n+21 // ----------\n+22\n+23 template< int dim >\n+24 class CoordCache\n+25 {\n+26 typedef DofVectorPointer<_GlobalVector_> CoordVectorPointer;\n+27 typedef Alberta::DofAccess<_dim,_dim_> DofAccess;\n+28\n+29 class LocalCaching;\n+30 struct Interpolation;\n 31\n-32\n-33 template< int dim >\n-34 inline const GlobalVector &MacroElement<_dim_>::coordinate ( const int\n-vertex ) const\n-35 {\n-36 assert( (vertex >= 0) && (vertex < N_VERTICES_MAX) );\n-37 return *coord[ vertex ];\n-38 }\n-39\n-40\n-41 template< int dim >\n-42 inline bool MacroElement<_dim_>::isBoundary ( const int face ) const\n-43 {\n-44 return (boundaryId( face ) != InteriorBoundary);\n-45 }\n-46\n-47\n-48 template< int dim >\n-49 inline int MacroElement<_dim_>::boundaryId ( const int face ) const\n-50 {\n-51 return wall_bound[ face ];\n-52 }\n-53\n-54\n-55 template< int dim >\n-56 const MacroElement<_dim_> *MacroElement<_dim_>::neighbor ( const int face )\n+32 public:\n+33 static const int dimension = dim;\n+34\n+35 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+36 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n+37 typedef HierarchyDofNumbering<_dimension_> DofNumbering;\n+38\n+39 GlobalVector &operator()_( const Element *element, int vertex ) const\n+40 {\n+41 assert( !(!coords_) );\n+42 GlobalVector *array = (GlobalVector *)coords_;\n+43 return array[ dofAccess_( element, vertex ) ];\n+44 }\n+45\n+46 GlobalVector &operator()_( const ElementInfo &elementInfo, int vertex )\n const\n-57 {\n-58 assert( (face >= 0) && (face < N_NEIGH_MAX) );\n-59 return static_cast< const MacroElement * >( neigh[ face ] );\n-60 }\n-61\n+47 {\n+48 return (*this)( elementInfo.el(), vertex );\n+49 }\n+50\n+51 void create ( const DofNumbering &dofNumbering )\n+52 {\n+53 MeshPointer mesh = dofNumbering.mesh();\n+54 const DofSpace *dofSpace = dofNumbering.dofSpace( dimension );\n+55\n+56 coords_.create( dofSpace, \"Coordinate Cache\" );\n+57 LocalCaching localCaching( coords_ );\n+58 mesh.hierarchicTraverse( localCaching, FillFlags<_dimension_>::coords );\n+59 coords_.template setupInterpolation< Interpolation >();\n+60\n+61 dofAccess_ = DofAccess( dofSpace );\n 62 }\n 63\n-64}\n-65\n-66#endif // #if HAVE_ALBERTA\n-67\n-68#endif // #ifndef DUNE_ALBERTA_MACROELEMENT_HH\n-misc.hh\n-ALBERTA\n-#define ALBERTA\n-Definition albertaheader.hh:29\n+64 void release ()\n+65 {\n+66 coords_.release();\n+67 }\n+68\n+69 private:\n+70 CoordVectorPointer coords_;\n+71 DofAccess dofAccess_;\n+72 };\n+73\n+74\n+75\n+76 // CoordCache::LocalCaching\n+77 // ------------------------\n+78\n+79 template< int dim >\n+80 class CoordCache< dim >::LocalCaching\n+81 {\n+82 CoordVectorPointer coords_;\n+83 DofAccess dofAccess_;\n+84\n+85 public:\n+86 explicit LocalCaching ( const CoordVectorPointer &coords )\n+87 : coords_( coords ),\n+88 dofAccess_( coords.dofSpace() )\n+89 {}\n+90\n+91 void operator()_( const ElementInfo &elementInfo ) const\n+92 {\n+93 GlobalVector *array = (GlobalVector *)coords_;\n+94 for( int i = 0; i < DofAccess::numSubEntities; ++i )\n+95 {\n+96 const GlobalVector &x = elementInfo.coordinate( i );\n+97 GlobalVector &y = array[ dofAccess_( elementInfo.el(), i ) ];\n+98 for( int i = 0; i < dimWorld; ++i )\n+99 y[ i ] = x[ i ];\n+100 }\n+101 }\n+102 };\n+103\n+104\n+105\n+106 // CoordCache::Interpolation\n+107 // -------------------------\n+108\n+109 template< int dim >\n+110 struct CoordCache< dim >::Interpolation\n+111 {\n+112 static const int dimension = dim;\n+113\n+114 typedef Alberta::Patch<_dimension_> Patch;\n+115\n+116 static void\n+117 interpolateVector ( const CoordVectorPointer &dofVector, const Patch &patch\n+)\n+118 {\n+119 DofAccess dofAccess( dofVector.dofSpace() );\n+120 GlobalVector *array = (GlobalVector *)dofVector;\n+121\n+122 const Element *element = patch[ 0 ];\n+123\n+124 // new vertex is always the last one\n+125 assert( element->child[ 0 ] != NULL );\n+126 GlobalVector &newCoord = array[ dofAccess( element->child[ 0 ], dimension )\n+];\n+127\n+128 if( element->new_coord != NULL )\n+129 {\n+130 for( int j = 0; j < dimWorld; ++j )\n+131 newCoord[ j ] = element->new_coord[ j ];\n+132 }\n+133 else\n+134 {\n+135 // new coordinate is the average of of old ones on the same edge\n+136 // refinement edge is always between vertices 0 and 1\n+137 const GlobalVector &coord0 = array[ dofAccess( element, 0 ) ];\n+138 const GlobalVector &coord1 = array[ dofAccess( element, 1 ) ];\n+139 for( int j = 0; j < dimWorld; ++j )\n+140 newCoord[ j ] = 0.5 * (coord0[ j ] + coord1[ j ]);\n+141 }\n+142 }\n+143 };\n+144\n+145 }\n+146\n+147}\n+148\n+149#endif // #if HAVE_ALBERTA\n+150\n+151#endif // #ifndef DUNE_ALBERTA_COORDCACHE_HH\n+meshpointer.hh\n+provides a wrapper for ALBERTA's mesh structure\n+dofadmin.hh\n+dofvector.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::InteriorBoundary\n-static const int InteriorBoundary\n-Definition misc.hh:59\n+Dune::Alberta::Element\n+ALBERTA EL Element\n+Definition misc.hh:54\n+Dune::Alberta::DofSpace\n+ALBERTA FE_SPACE DofSpace\n+Definition misc.hh:65\n+Dune::Alberta::dimWorld\n+static const int dimWorld\n+Definition misc.hh:46\n Dune::Alberta::GlobalVector\n ALBERTA REAL_D GlobalVector\n Definition misc.hh:50\n-Dune::Alberta::MacroElement\n-Definition macroelement.hh:24\n-Dune::Alberta::MacroElement::isBoundary\n-bool isBoundary(const int face) const\n-Definition macroelement.hh:42\n-Dune::Alberta::MacroElement::neighbor\n-const MacroElement< dim > * neighbor(const int face) const\n-Definition macroelement.hh:56\n-Dune::Alberta::MacroElement::boundaryId\n-int boundaryId(const int face) const\n-Definition macroelement.hh:49\n-Dune::Alberta::MacroElement::coordinate\n-const GlobalVector & coordinate(const int vertex) const\n-Definition macroelement.hh:34\n+Dune::Alberta::CoordCache\n+Definition coordcache.hh:25\n+Dune::Alberta::CoordCache::dimension\n+static const int dimension\n+Definition coordcache.hh:33\n+Dune::Alberta::CoordCache::operator()\n+GlobalVector & operator()(const Element *element, int vertex) const\n+Definition coordcache.hh:39\n+Dune::Alberta::CoordCache::MeshPointer\n+Alberta::MeshPointer< dimension > MeshPointer\n+Definition coordcache.hh:36\n+Dune::Alberta::CoordCache::release\n+void release()\n+Definition coordcache.hh:64\n+Dune::Alberta::CoordCache::ElementInfo\n+Alberta::ElementInfo< dimension > ElementInfo\n+Definition coordcache.hh:35\n+Dune::Alberta::CoordCache::DofNumbering\n+HierarchyDofNumbering< dimension > DofNumbering\n+Definition coordcache.hh:37\n+Dune::Alberta::CoordCache::create\n+void create(const DofNumbering &dofNumbering)\n+Definition coordcache.hh:51\n+Dune::Alberta::CoordCache::LocalCaching\n+Definition coordcache.hh:81\n+Dune::Alberta::CoordCache::LocalCaching::LocalCaching\n+LocalCaching(const CoordVectorPointer &coords)\n+Definition coordcache.hh:86\n+Dune::Alberta::CoordCache::Interpolation\n+Definition coordcache.hh:111\n+Dune::Alberta::CoordCache::Interpolation::Patch\n+Alberta::Patch< dimension > Patch\n+Definition coordcache.hh:114\n+Dune::Alberta::CoordCache::Interpolation::interpolateVector\n+static void interpolateVector(const CoordVectorPointer &dofVector, const Patch\n+&patch)\n+Definition coordcache.hh:117\n+Dune::Alberta::MeshPointer<_dimension_>\n+Dune::Alberta::MeshPointer::hierarchicTraverse\n+void hierarchicTraverse(Functor &functor, typename FillFlags::Flags\n+fillFlags=FillFlags::standard) const\n+Definition meshpointer.hh:370\n+Dune::Alberta::DofAccess<_dim,_dim_>\n+Dune::Alberta::DofAccess<_dim,_dim_>::numSubEntities\n+static const int numSubEntities\n+Definition dofadmin.hh:40\n+Dune::Alberta::HierarchyDofNumbering<_dimension_>\n+Dune::Alberta::HierarchyDofNumbering::mesh\n+const MeshPointer & mesh() const\n+Definition dofadmin.hh:158\n+Dune::Alberta::HierarchyDofNumbering::dofSpace\n+const DofSpace * dofSpace(int codim) const\n+Definition dofadmin.hh:145\n+Dune::Alberta::DofVectorPointer<_GlobalVector_>\n+Dune::Alberta::DofVectorPointer::create\n+void create(const DofSpace *dofSpace, const std::string &name=\"\")\n+Definition dofvector.hh:236\n+Dune::Alberta::DofVectorPointer::release\n+void release()\n+Definition dofvector.hh:254\n+Dune::Alberta::DofVectorPointer::dofSpace\n+const DofSpace * dofSpace() const\n+Definition dofvector.hh:223\n+Dune::Alberta::ElementInfo<_dimension_>\n+Dune::Alberta::ElementInfo::coordinate\n+const GlobalVector & coordinate(int vertex) const\n+Definition elementinfo.hh:685\n+Dune::Alberta::ElementInfo::el\n+Element * el() const\n+Definition elementinfo.hh:737\n+Dune::Alberta::FillFlags\n+Definition misc.hh:231\n+Dune::Alberta::Patch\n+Definition refinement.hh:40\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00689.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00689.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: albertagrid.cc File Reference\n+dune-grid: treeiterator.hh File Reference\n \n \n \n \n \n \n \n@@ -71,66 +71,42 @@\n \n
    \n \n
    \n \n-
    albertagrid.cc File Reference
    \n+Namespaces
    \n+
    treeiterator.hh File Reference
    \n \n
    \n-
    #include "geometry.cc"
    \n-#include "entity.cc"
    \n-#include "intersection.cc"
    \n+
    #include <utility>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/albertagrid/elementinfo.hh>
    \n+#include <dune/grid/albertagrid/meshpointer.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Classes

    class  Dune::AlbertaMarkerVector< dim, dimworld >
     marker assigning subentities to one element containing them More...
     
    struct  Dune::AlbertaMarkerVector< dim, dimworld >::MarkSubEntities< bool >::Codim< codim >
     
    class  Dune::AlbertaGridTreeIterator< codim, GridImp, leafIterator >
     
    \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-\n-\n-\n-

    \n-Macros

    #define DUNE_ALBERTAGRID_CC
     
    \n-\n-\n-\n-\n-

    \n-Functions

    template<int dim, int dimworld>
    static void Dune::checkAlbertaDimensions ()
     
    \n-\n-\n-\n

    \n-Variables

    static void * Dune::Alberta::adaptationDataHandler_
     
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_ALBERTAGRID_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_ALBERTAGRID_CC
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,34 +1,30 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces | Macros | Functions | Variables\n-albertagrid.cc File Reference\n-#include \"geometry.cc\"\n-#include \"entity.cc\"\n-#include \"intersection.cc\"\n+Classes | Namespaces\n+treeiterator.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n-namespace \u00a0 Dune::Alberta\n+Classes\n+ class \u00a0 Dune::AlbertaMarkerVector<_dim,_dimworld_>\n+\u00a0 marker assigning subentities to one element containing them More...\n \u00a0\n-Macros\n-#define\u00a0 DUNE_ALBERTAGRID_CC\n+struct \u00a0 Dune::AlbertaMarkerVector<_dim,_dimworld_>::MarkSubEntities<_bool_>::\n+ Codim<_codim_>\n \u00a0\n-Functions\n-template\n-static void\u00a0 Dune::checkAlbertaDimensions ()\n+ class \u00a0 Dune::AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n \u00a0\n-Variables\n-static void *\u00a0 Dune::Alberta::adaptationDataHandler_\n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n \u00a0\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_ALBERTAGRID_CC *****\n-#define DUNE_ALBERTAGRID_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00689_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00689_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: albertagrid.cc Source File\n+dune-grid: treeiterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,799 +74,647 @@\n \n \n
    \n
    \n-
    albertagrid.cc
    \n+
    treeiterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTAGRID_CC
    \n-
    6#define DUNE_ALBERTAGRID_CC
    \n-
    7
    \n-
    8//************************************************************************
    \n-
    9//
    \n-
    10// implementation of AlbertaGrid
    \n-
    11//
    \n-
    12// namespace Dune
    \n-
    13//
    \n-
    14//************************************************************************
    \n-
    15#include "geometry.cc"
    \n-
    16#include "entity.cc"
    \n-
    17#include "intersection.cc"
    \n+
    5
    \n+
    6#ifndef DUNE_ALBERTA_TREEITERATOR_HH
    \n+
    7#define DUNE_ALBERTA_TREEITERATOR_HH
    \n+
    8
    \n+
    9#include <utility>
    \n+
    10
    \n+
    11#include <dune/common/hybridutilities.hh>
    \n+
    12#include <dune/common/typetraits.hh>
    \n+
    13
    \n+\n+\n+
    16
    \n+
    17#if HAVE_ALBERTA
    \n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n-
    \n-
    22 namespace Alberta
    \n-
    23 {
    \n-\n-
    25 }
    \n-
    \n-
    26
    \n-
    27
    \n-
    28 template< int dim, int dimworld >
    \n-
    \n-\n-
    30 {
    \n-
    31 // If this check fails, define ALBERTA_DIM accordingly
    \n-
    32 static_assert((dimworld == Alberta::dimWorld),
    \n-
    33 "Template Parameter dimworld does not match "
    \n-
    34 "ALBERTA's DIM_OF_WORLD setting.");
    \n-
    35 }
    \n-
    \n-
    36
    \n+
    22 // AlbertaMarkerVector
    \n+
    23 // -------------------
    \n+
    24
    \n+
    33 template< int dim, int dimworld >
    \n+
    \n+\n+
    35 {
    \n+\n
    37
    \n-
    38 // AlbertaGrid
    \n-
    39 // -----------
    \n-
    40
    \n-
    41 template< int dim, int dimworld >
    \n-
    \n-\n-
    43 : mesh_(),
    \n-
    44 maxlevel_( 0 ),
    \n-
    45 numBoundarySegments_( 0 ),
    \n-
    46 hIndexSet_( dofNumbering_ ),
    \n-
    47 idSet_( hIndexSet_ ),
    \n-
    48 levelIndexVec_( (size_t)MAXL, 0 ),
    \n-
    49 leafIndexSet_( 0 ),
    \n-
    50 sizeCache_( *this ),
    \n-
    51 leafMarkerVector_( dofNumbering_ ),
    \n-
    52 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n-
    53 {
    \n-\n-
    55 }
    \n-
    \n-
    56
    \n-
    57
    \n-
    58 template< int dim, int dimworld >
    \n-
    59 template< class Proj, class Impl >
    \n-\n+\n+
    39
    \n+
    40 //friend class AlbertaGrid< dim, dimworld >;
    \n+
    41
    \n+
    42 static const int dimension = Grid::dimension;
    \n+
    43
    \n+\n+\n+
    46
    \n+
    47 template< bool >
    \n+
    48 struct NoMarkSubEntities;
    \n+
    49 template< bool >
    \n+
    50 struct MarkSubEntities;
    \n+
    51
    \n+
    52 public:
    \n+
    \n+
    54 explicit AlbertaMarkerVector ( const DofNumbering &dofNumbering )
    \n+
    55 : dofNumbering_( dofNumbering )
    \n+
    56 {
    \n+
    57 for( int codim = 0; codim <= dimension; ++codim )
    \n+
    58 marker_[ codim ] = 0;
    \n+
    59 }
    \n+
    \n+
    60
    \n
    \n-\n-\n-
    63 : mesh_(),
    \n-
    64 maxlevel_( 0 ),
    \n-
    65 numBoundarySegments_( 0 ),
    \n-
    66 hIndexSet_( dofNumbering_ ),
    \n-
    67 idSet_( hIndexSet_ ),
    \n-
    68 levelIndexVec_( (size_t)MAXL, 0 ),
    \n-
    69 leafIndexSet_ ( 0 ),
    \n-
    70 sizeCache_( *this ),
    \n-
    71 leafMarkerVector_( dofNumbering_ ),
    \n-
    72 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n-
    73 {
    \n-\n+
    61 AlbertaMarkerVector ( const This &other )
    \n+
    62 : dofNumbering_( other.dofNumbering_ )
    \n+
    63 {
    \n+
    64 for( int codim = 0; codim <= dimension; ++codim )
    \n+
    65 marker_[ codim ] = 0;
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    \n+\n+
    69 {
    \n+
    70 clear();
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    73 private:
    \n+
    74 This &operator= ( const This & );
    \n
    75
    \n-
    76 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );
    \n-
    77 if( !mesh_ )
    \n-
    78 DUNE_THROW( AlbertaError, "Invalid macro data structure." );
    \n-
    79
    \n-
    80 setup();
    \n-
    81 hIndexSet_.create();
    \n-
    82
    \n-
    83 calcExtras();
    \n-
    84 }
    \n-
    \n-
    85
    \n-
    86
    \n-
    87 template< int dim, int dimworld >
    \n-\n-
    \n-\n-
    90 const std::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection )
    \n-
    91 : mesh_(),
    \n-
    92 maxlevel_( 0 ),
    \n-
    93 numBoundarySegments_( 0 ),
    \n-
    94 hIndexSet_( dofNumbering_ ),
    \n-
    95 idSet_( hIndexSet_ ),
    \n-
    96 levelIndexVec_( (size_t)MAXL, 0 ),
    \n-
    97 leafIndexSet_ ( 0 ),
    \n-
    98 sizeCache_( *this ),
    \n-
    99 leafMarkerVector_( dofNumbering_ ),
    \n-
    100 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n-
    101 {
    \n-\n-
    103
    \n-
    104 if( projection != 0 )
    \n-
    105 {
    \n-
    106 Alberta::DuneGlobalBoundaryProjectionFactory< dimension > projectionFactory( projection );
    \n-
    107 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );
    \n-
    108 }
    \n-
    109 else
    \n-
    110 numBoundarySegments_ = mesh_.create( macroData );
    \n-
    111 if( !mesh_ )
    \n-
    112 DUNE_THROW( AlbertaError, "Invalid macro data structure." );
    \n-
    113
    \n-
    114 setup();
    \n-
    115 hIndexSet_.create();
    \n-
    116
    \n-
    117 calcExtras();
    \n-
    118 }
    \n-
    \n-
    119
    \n-
    120
    \n-
    121 template < int dim, int dimworld >
    \n-\n-
    \n-
    123 ::AlbertaGrid ( const std::string &macroGridFileName )
    \n-
    124 : mesh_(),
    \n-
    125 maxlevel_( 0 ),
    \n-
    126 hIndexSet_( dofNumbering_ ),
    \n-
    127 idSet_( hIndexSet_ ),
    \n-
    128 levelIndexVec_( (size_t)MAXL, 0 ),
    \n-
    129 leafIndexSet_ ( 0 ),
    \n-
    130 sizeCache_( *this ),
    \n-
    131 leafMarkerVector_( dofNumbering_ ),
    \n-
    132 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n+
    76 public:
    \n+
    78 template< int codim >
    \n+
    \n+
    79 bool subEntityOnElement ( const ElementInfo &elementInfo, int subEntity ) const;
    \n+
    80
    \n+
    81 template< int firstCodim, class Iterator >
    \n+
    \n+
    82 void markSubEntities ( const Iterator &begin, const Iterator &end );
    \n+
    83
    \n+
    \n+
    84 void clear ()
    \n+
    85 {
    \n+
    86 for( int codim = 0; codim <= dimension; ++codim )
    \n+
    87 {
    \n+
    88 if( marker_[ codim ] != 0 )
    \n+
    89 delete[] marker_[ codim ];
    \n+
    90 marker_[ codim ] = 0;
    \n+
    91 }
    \n+
    92 }
    \n+
    \n+
    93
    \n+
    \n+
    95 bool up2Date () const
    \n+
    96 {
    \n+
    97 return (marker_[ dimension ] != 0);
    \n+
    98 }
    \n+
    \n+
    99
    \n+
    \n+
    101 void print ( std::ostream &out = std::cout ) const;
    \n+
    102
    \n+
    103 private:
    \n+
    104 const DofNumbering &dofNumbering_;
    \n+
    105 int *marker_[ dimension+1 ];
    \n+
    106 };
    \n+
    107
    \n+
    108
    \n+
    109
    \n+
    110 // AlbertaMarkerVector::NoMarkSubEntities
    \n+
    111 // --------------------------------------
    \n+
    112
    \n+
    113 template< int dim, int dimworld >
    \n+
    114 template< bool >
    \n+
    115 struct AlbertaMarkerVector< dim, dimworld >::NoMarkSubEntities
    \n+
    116 {
    \n+
    117 template< int firstCodim, class Iterator >
    \n+
    118 static void mark ( [[maybe_unused]] const DofNumbering & dofNumbering,
    \n+
    119 [[maybe_unused]] int *(&marker)[ dimension + 1 ],
    \n+
    120 [[maybe_unused]] const Iterator &begin,
    \n+
    121 [[maybe_unused]] const Iterator &end )
    \n+
    122 {}
    \n+
    123 };
    \n+
    124
    \n+
    125
    \n+
    126
    \n+
    127 // AlbertaMarkerVector::MarkSubEntities
    \n+
    128 // ------------------------------------
    \n+
    129
    \n+
    130 template< int dim, int dimworld >
    \n+
    131 template< bool >
    \n+
    132 struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities
    \n
    133 {
    \n-\n-
    135
    \n-
    136 numBoundarySegments_ = mesh_.create( macroGridFileName );
    \n-
    137 if( !mesh_ )
    \n-
    138 {
    \n-\n-
    140 "Grid file '" << macroGridFileName
    \n-
    141 << "' is not in ALBERTA macro triangulation format." );
    \n-
    142 }
    \n-
    143
    \n-
    144 setup();
    \n-
    145 hIndexSet_.create();
    \n+
    134 template< int codim >
    \n+
    \n+
    135 struct Codim
    \n+
    136 {
    \n+
    137 static const int numSubEntities = Alberta::NumSubEntities< dimension, codim >::value;
    \n+
    138
    \n+\n+
    140
    \n+
    \n+
    141 static void apply ( const DofNumbering &dofNumbering,
    \n+
    142 int *(&marker)[ dimension + 1 ],
    \n+
    143 const ElementInfo &elementInfo )
    \n+
    144 {
    \n+
    145 int *array = marker[ codim ];
    \n
    146
    \n-
    147 calcExtras();
    \n-
    148
    \n-
    149 std::cout << typeName() << " created from macro grid file '"
    \n-
    150 << macroGridFileName << "'." << std::endl;
    \n-
    151 }
    \n-
    \n-
    152
    \n-
    153
    \n-
    154 template< int dim, int dimworld >
    \n-\n-
    156 {
    \n-
    157 dofNumbering_.create( mesh_ );
    \n-
    158
    \n-
    159 levelProvider_.create( dofNumbering_ );
    \n-
    160
    \n-
    161#if DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    162 coordCache_.create( dofNumbering_ );
    \n-
    163#endif
    \n-
    164 }
    \n-
    165
    \n-
    166
    \n-
    167 template< int dim, int dimworld >
    \n-
    168 inline void AlbertaGrid< dim, dimworld >::removeMesh ()
    \n-
    169 {
    \n-
    170 for( size_t i = 0; i < levelIndexVec_.size(); ++i )
    \n-
    171 {
    \n-
    172 if( levelIndexVec_[ i ] != 0 )
    \n-
    173 delete levelIndexVec_[ i ];
    \n-
    174 levelIndexVec_[ i ] = 0;
    \n-
    175 }
    \n-
    176
    \n-
    177 if( leafIndexSet_ != 0 )
    \n-
    178 delete leafIndexSet_;
    \n-
    179 leafIndexSet_ = 0;
    \n+
    147 const int index = dofNumbering( elementInfo, 0, 0 );
    \n+
    148 for( int i = 0; i < numSubEntities; ++i )
    \n+
    149 {
    \n+
    150 int &mark = array[ dofNumbering( elementInfo, codim, i ) ];
    \n+
    151 mark = std::max( index, mark );
    \n+
    152 }
    \n+
    153 }
    \n+
    \n+
    154 };
    \n+
    \n+
    155
    \n+
    156 template< int firstCodim, class Iterator >
    \n+
    157 static void mark ( const DofNumbering &dofNumbering, int *(&marker)[ dimension + 1 ],
    \n+
    158 const Iterator &begin, const Iterator &end )
    \n+
    159 {
    \n+
    160 for( int codim = firstCodim; codim <= dimension; ++codim )
    \n+
    161 {
    \n+
    162 const int size = dofNumbering.size( codim );
    \n+
    163 marker[ codim ] = new int[ size ];
    \n+
    164
    \n+
    165 int *array = marker[ codim ];
    \n+
    166 for( int i = 0; i < size; ++i )
    \n+
    167 array[ i ] = -1;
    \n+
    168 }
    \n+
    169
    \n+
    170 for( Iterator it = begin; it != end; ++it )
    \n+
    171 {
    \n+
    172 const ElementInfo &elementInfo = it->impl().elementInfo();
    \n+
    173 Hybrid::forEach( std::make_index_sequence< dimension+1-firstCodim >{},
    \n+
    174 [ & ]( auto i ){ Codim< i+firstCodim >::apply( dofNumbering, marker, elementInfo ); } );
    \n+
    175 }
    \n+
    176 }
    \n+
    177 };
    \n+
    178
    \n+
    179
    \n
    180
    \n-
    181 // release dof vectors
    \n-
    182 hIndexSet_.release();
    \n-
    183 levelProvider_.release();
    \n-
    184#if DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    185 coordCache_.release();
    \n-
    186#endif
    \n-
    187 dofNumbering_.release();
    \n-
    188
    \n-
    189 sizeCache_.reset();
    \n-
    190
    \n-
    191 mesh_.release();
    \n-
    192 }
    \n-
    193
    \n-
    194
    \n-
    195 template< int dim, int dimworld >
    \n-
    \n-\n-
    197 {
    \n-
    198 removeMesh();
    \n-
    199 }
    \n-
    \n-
    200
    \n-
    201
    \n-
    202 template< int dim, int dimworld >
    \n-
    203 template< int codim, PartitionIteratorType pitype >
    \n-\n-
    205 ::template Codim< codim >::template Partition<pitype>::LevelIterator
    \n-
    \n-\n-
    207 {
    \n-\n-
    209 assert( level >= 0 );
    \n-
    210
    \n-
    211 if( level > maxlevel_ )
    \n-
    212 return lend< codim, pitype >( level );
    \n-
    213 MarkerVector &markerVector = levelMarkerVector_[ level ];
    \n-
    214
    \n-
    215 if( (codim > 0) && !markerVector.up2Date() )
    \n-
    216 markerVector.template markSubEntities< 1 >( lbegin< 0 >( level ), lend< 0 >( level ) );
    \n-
    217
    \n-
    218 return LevelIteratorImp( *this, &markerVector, level );
    \n-
    219 }
    \n-
    \n-
    220
    \n+
    181 // AlbertaGridTreeIterator
    \n+
    182 // -----------------------
    \n+
    183
    \n+
    187 template< int codim, class GridImp, bool leafIterator >
    \n+
    \n+\n+
    189 {
    \n+\n+
    191
    \n+
    192 public:
    \n+
    193 static const int dimension = GridImp::dimension;
    \n+
    194 static const int codimension = codim;
    \n+
    195 static const int dimensionworld = GridImp::dimensionworld;
    \n+
    196
    \n+
    197 private:
    \n+
    198 friend class AlbertaGrid< dimension, dimensionworld >;
    \n+
    199
    \n+
    200 static const int numSubEntities
    \n+\n+
    202
    \n+
    203 public:
    \n+\n+
    205 typedef typename MeshPointer::MacroIterator MacroIterator;
    \n+
    206
    \n+
    207 typedef typename GridImp::template Codim< codim >::Entity Entity;
    \n+\n+\n+
    210 typedef typename EntityImp::ElementInfo ElementInfo;
    \n+
    211
    \n+\n+
    213
    \n+
    \n+\n+
    215
    \n+
    \n+\n+
    218
    \n+
    \n+
    220 This &operator= ( const This &other );
    \n
    221
    \n-
    222 template< int dim, int dimworld >
    \n-
    223 template< int codim, PartitionIteratorType pitype >
    \n-\n-
    225 ::template Codim< codim >::template Partition< pitype >::LevelIterator
    \n+
    \n+
    223 AlbertaGridTreeIterator ( const GridImp &grid, int travLevel );
    \n+
    224
    \n
    \n-\n-
    227 {
    \n-\n-
    229 assert( level >= 0 );
    \n-
    230
    \n-
    231 return LevelIteratorImp( *this, level );
    \n-
    232 }
    \n-
    \n-
    233
    \n-
    234
    \n-
    235 template< int dim, int dimworld >
    \n-
    236 template< int codim >
    \n-\n-
    238 ::template Codim< codim >::LevelIterator
    \n-
    \n-\n-
    240 {
    \n-
    241 return lbegin< codim, All_Partition >( level );
    \n-
    242 }
    \n-
    \n-
    243
    \n-
    244
    \n-
    245 template< int dim, int dimworld >
    \n-
    246 template< int codim >
    \n-\n-
    248 ::template Codim< codim >::LevelIterator
    \n+\n+
    227 const MarkerVector *marker,
    \n+
    228 int travLevel );
    \n+
    229
    \n+
    \n+
    231 bool equals ( const This &other ) const
    \n+
    232 {
    \n+
    233 return entity_.impl().equals( other.entity_.impl() );
    \n+
    234 }
    \n+
    \n+
    235
    \n+
    \n+\n+
    238 {
    \n+
    239 return entity_;
    \n+
    240 }
    \n+
    \n+
    241
    \n+
    \n+
    243 int level () const
    \n+
    244 {
    \n+
    245 return entity_.impl().level();
    \n+
    246 }
    \n+
    \n+
    247
    \n
    \n-\n-
    250 {
    \n-
    251 return lend< codim, All_Partition >( level );
    \n-
    252 }
    \n-
    \n-
    253
    \n-
    254
    \n-
    255 template< int dim, int dimworld >
    \n-
    256 template< int codim, PartitionIteratorType pitype >
    \n-\n-
    258 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n-
    \n-\n-
    260 {
    \n-\n+
    249 void increment();
    \n+
    250
    \n+
    251 protected:
    \n+
    \n+
    253 const GridImp &grid () const
    \n+
    254 {
    \n+
    255 return entity_.impl().grid();
    \n+
    256 }
    \n+
    \n+
    257
    \n+
    258 private:
    \n+
    259 void nextElement ( ElementInfo &elementInfo );
    \n+
    260 void nextElementStop (ElementInfo &elementInfo );
    \n+
    261 bool stopAtElement ( const ElementInfo &elementInfo ) const;
    \n
    262
    \n-
    263 MarkerVector &markerVector = leafMarkerVector_;
    \n-
    \n-
    264 const int firstMarkedCodim = 2;
    \n-
    265 if( (codim >= firstMarkedCodim) && !markerVector.up2Date() )
    \n-\n-
    267
    \n-
    268 return LeafIteratorImp( *this, &markerVector, maxlevel_ );
    \n-
    269 }
    \n-
    270
    \n-
    \n-\n-
    272 template< int dim, int dimworld >
    \n-
    273 template< int codim, PartitionIteratorType pitype >
    \n-\n-
    275 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n-
    \n-\n-
    277 {
    \n-\n-
    279 return LeafIteratorImp( *this, maxlevel_ );
    \n-
    280 }
    \n+
    263 void goNext ( ElementInfo &elementInfo );
    \n+
    264 void goNext ( const std::integral_constant< int, 0 > cdVariable,
    \n+
    265 ElementInfo &elementInfo );
    \n+
    266 void goNext ( const std::integral_constant< int, 1 > cdVariable,
    \n+
    267 ElementInfo &elementInfo );
    \n+
    268 template< int cd >
    \n+
    269 void goNext ( const std::integral_constant< int, cd > cdVariable,
    \n+
    270 ElementInfo &elementInfo );
    \n+
    271
    \n+
    272 mutable Entity entity_;
    \n+
    273
    \n+
    275 int level_;
    \n+
    276
    \n+
    278 int subEntity_;
    \n+
    279
    \n+
    280 MacroIterator macroIterator_;
    \n
    281
    \n-
    282
    \n-
    \n-
    283 template< int dim, int dimworld >
    \n-
    284 template< int codim >
    \n-\n-
    \n-\n-\n-
    291
    \n-
    292
    \n-
    293 template< int dim, int dimworld >
    \n-
    294 template< int codim >
    \n-\n-
    296 ::template Codim< codim >::LeafIterator
    \n-
    \n-\n-
    298 {
    \n-\n-
    300 }
    \n-
    \n+
    282 // knows on which element a point,edge,face is viewed
    \n+
    283 const MarkerVector *marker_;
    \n+
    284 };
    \n+
    285
    \n+
    286
    \n+
    287
    \n+
    288 // Implementation of AlbertaMarkerVector
    \n+
    289 // -------------------------------------
    \n+
    290
    \n+
    291 template< int dim, int dimworld >
    \n+
    292 template< int codim >
    \n+
    293 inline bool AlbertaMarkerVector< dim, dimworld >
    \n+
    \n+
    294 ::subEntityOnElement ( const ElementInfo &elementInfo, int subEntity ) const
    \n+
    295 {
    \n+
    296 assert( marker_[ codim ] != 0 );
    \n+
    297
    \n+
    298 const int subIndex = dofNumbering_( elementInfo, codim, subEntity );
    \n+
    299 const int markIndex = marker_[ codim ][ subIndex ];
    \n+
    300 assert( (markIndex >= 0) );
    \n
    301
    \n-
    302
    \n-
    303 template< int dim, int dimworld >
    \n-
    \n-\n-
    305 {
    \n-
    306 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
    \n-
    307
    \n-
    308 // only MAXL levels allowed
    \n-
    309 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );
    \n-
    310
    \n-
    311 for( int i = 0; i < refCount; ++i )
    \n-
    312 {
    \n-
    313 // mark all interior elements
    \n-
    314 const LeafIterator endit = leafend< 0 >();
    \n-
    315 for( LeafIterator it = leafbegin< 0 >(); it != endit; ++it )
    \n-
    316 mark( 1, *it );
    \n+
    302 const int index = dofNumbering_( elementInfo, 0, 0 );
    \n+
    303 return (markIndex == index);
    \n+
    304 }
    \n+
    \n+
    305
    \n+
    306
    \n+
    307 template< int dim, int dimworld >
    \n+
    308 template< int firstCodim, class Iterator >
    \n+\n+
    \n+
    310 ::markSubEntities ( const Iterator &begin, const Iterator &end )
    \n+
    311 {
    \n+
    312 clear();
    \n+
    313 std::conditional< (firstCodim <= dimension), MarkSubEntities<true>, NoMarkSubEntities<false> >::type
    \n+
    314 ::template mark< firstCodim, Iterator >( dofNumbering_, marker_, begin, end );
    \n+
    315 }
    \n+
    \n+
    316
    \n
    317
    \n-
    318 preAdapt();
    \n-
    319 adapt();
    \n-
    320 postAdapt();
    \n-
    321 }
    \n-
    322 }
    \n-
    \n-
    323
    \n-
    324
    \n-
    325 template< int dim, int dimworld >
    \n-
    326 template< class DataHandle >
    \n-\n-
    \n-\n-
    329 {
    \n-
    330 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
    \n-
    331
    \n-
    332 // only MAXL levels allowed
    \n-
    333 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );
    \n+
    318 template< int dim, int dimworld >
    \n+
    \n+
    319 inline void AlbertaMarkerVector< dim, dimworld >::print ( std::ostream &out ) const
    \n+
    320 {
    \n+
    321 for( int codim = 1; codim <= dimension; ++codim )
    \n+
    322 {
    \n+
    323 int *marker = marker_[ codim ];
    \n+
    324 if( marker != 0 )
    \n+
    325 {
    \n+
    326 const int size = dofNumbering_.size( codim );
    \n+
    327 out << std::endl;
    \n+
    328 out << "Codimension " << codim << " (" << size << " entries)" << std::endl;
    \n+
    329 for( int i = 0; i < size; ++i )
    \n+
    330 out << "subentity " << i << " visited on Element " << marker[ i ] << std::endl;
    \n+
    331 }
    \n+
    332 }
    \n+
    333 }
    \n+
    \n
    334
    \n-
    335 for( int i = 0; i < refCount; ++i )
    \n-
    336 {
    \n-
    337 // mark all interior elements
    \n-
    \n-
    338 const LeafIterator endit = leafend< 0 >();
    \n-
    339 for( LeafIterator it = leafbegin< 0 >(); it != endit; ++it )
    \n-
    340 mark( 1, *it );
    \n-
    \n-\n-
    342 adapt( handle );
    \n-
    343 }
    \n-
    \n-\n-
    345
    \n-
    346
    \n-
    \n-
    347 template< int dim, int dimworld >
    \n-
    \n-\n-
    349 {
    \n-
    350 adaptationState_.preAdapt();
    \n-
    351 return adaptationState_.coarsen();
    \n-
    352 }
    \n-
    \n-
    353
    \n-
    354
    \n-
    355 template < int dim, int dimworld >
    \n-
    \n-\n-
    357 {
    \n-
    358#ifndef NDEBUG
    \n-
    359 if( leafIndexSet_ != 0 )
    \n-
    360 {
    \n-
    361 bool consistent = true;
    \n-
    362 for( int codim = 0; codim <= dimension; ++codim )
    \n-
    363 {
    \n-
    364 if( int(leafIndexSet_->size( codim )) == mesh_.size( codim ) )
    \n-
    365 continue;
    \n-
    366 std::cerr << "Incorrect size of leaf index set for codimension "
    \n-
    367 << codim << "!" << std::endl;
    \n-
    368 std::cerr << "DUNE index set reports: " << leafIndexSet_->size( codim )
    \n-
    369 << std::endl;
    \n-
    370 std::cerr << "ALBERTA mesh reports: " << mesh_.size( codim ) << std::endl;
    \n-
    371 consistent = false;
    \n-
    372 }
    \n-
    373 if( !consistent )
    \n-
    374 abort();
    \n-
    375 }
    \n-
    376#endif
    \n-
    377
    \n-
    378 levelProvider_.markAllOld();
    \n-
    \n-
    379 adaptationState_.postAdapt();
    \n-
    380 }
    \n+
    335
    \n+
    336
    \n+
    337 // Implementation of AlbertaGridTreeIterator
    \n+
    338 // -----------------------------------------
    \n+
    339
    \n+
    340 template< int codim, class GridImp, bool leafIterator >
    \n+\n+
    \n+\n+
    343 : entity_(),
    \n+
    344 level_( -1 ),
    \n+
    345 subEntity_( -1 ),
    \n+
    346 macroIterator_(),
    \n+
    347 marker_( NULL )
    \n+
    348 {}
    \n+
    \n+
    349
    \n+
    350 template< int codim, class GridImp, bool leafIterator >
    \n+\n+
    \n+
    352 ::AlbertaGridTreeIterator ( const GridImp &grid,
    \n+
    353 const MarkerVector *marker,
    \n+
    354 int travLevel )
    \n+
    355 : entity_( EntityImp( grid ) ),
    \n+
    356 level_( travLevel ),
    \n+
    357 subEntity_( (codim == 0 ? 0 : -1) ),
    \n+
    358 macroIterator_( grid.meshPointer().begin() ),
    \n+
    359 marker_( marker )
    \n+
    360 {
    \n+
    361 ElementInfo elementInfo = *macroIterator_;
    \n+
    362 nextElementStop( elementInfo );
    \n+
    363 if( codim > 0 )
    \n+
    364 goNext( elementInfo );
    \n+
    365 // it is ok to set the invalid ElementInfo
    \n+
    366 entity_.impl().setElement( elementInfo, subEntity_ );
    \n+
    367 }
    \n+
    \n+
    368
    \n+
    369
    \n+
    370 // Make LevelIterator with point to element from previous iterations
    \n+
    371 template< int codim, class GridImp, bool leafIterator >
    \n+\n+
    \n+
    373 ::AlbertaGridTreeIterator ( const GridImp &grid,
    \n+
    374 int travLevel )
    \n+
    375 : entity_( EntityImp( grid ) ),
    \n+
    376 level_( travLevel ),
    \n+
    377 subEntity_( -1 ),
    \n+
    378 macroIterator_( grid.meshPointer().end() ),
    \n+
    379 marker_( 0 )
    \n+
    380 {}
    \n+
    \n
    381
    \n-
    \n-\n-
    383 template< int dim, int dimworld >
    \n-\n-
    \n-
    385 ::mark( int refCount, const typename Traits::template Codim< 0 >::Entity &e )
    \n-
    386 {
    \n-
    387 // if not leaf entity, leave method
    \n-
    \n-
    388 if( !e.isLeaf() )
    \n-
    389 return false;
    \n-
    390
    \n-
    \n-
    391 // don't mark macro elements for coarsening
    \n-
    392 if( refCount < -e.level() )
    \n-
    393 return false;
    \n+
    382
    \n+
    383 // Make LevelIterator with point to element from previous iterations
    \n+
    384 template< int codim, class GridImp, bool leafIterator >
    \n+\n+
    \n+\n+
    387 : entity_( other.entity_ ),
    \n+
    388 level_( other.level_ ),
    \n+
    389 subEntity_( other.subEntity_ ),
    \n+
    390 macroIterator_( other.macroIterator_ ),
    \n+
    391 marker_( other.marker_ )
    \n+
    392 {}
    \n+
    \n+
    393
    \n
    394
    \n-
    \n-
    395 // take back previous marking
    \n-
    396 adaptationState_.unmark( getMark( e ) );
    \n-
    397
    \n+
    395 // Make LevelIterator with point to element from previous iterations
    \n+
    396 template< int codim, class GridImp, bool leafIterator >
    \n+\n
    \n-
    398 // set new marking
    \n-
    399 adaptationState_.mark( refCount );
    \n-
    400 e.impl().elementInfo().setMark( refCount );
    \n-
    \n-\n-
    402 return true;
    \n-
    403 }
    \n-
    404
    \n+\n+
    399 {
    \n+
    400 entity_ = other.entity_;
    \n+
    401 level_ = other.level_;
    \n+
    402 subEntity_ = other.subEntity_;
    \n+
    403 macroIterator_ = other.macroIterator_;
    \n+
    404 marker_ = other.marker_;
    \n
    405
    \n-
    406 template< int dim, int dimworld >
    \n-\n-
    \n-\n-
    409 {
    \n-
    410 return e.impl().elementInfo().getMark();
    \n-
    411 }
    \n-
    \n-
    412
    \n-
    413
    \n-
    414 template< int dim, int dimworld >
    \n-
    \n-\n-
    416 {
    \n-
    417 // this is already done in postAdapt
    \n-
    418 //levelProvider_.markAllOld();
    \n+
    406 return *this;
    \n+
    407 }
    \n+
    \n+
    408
    \n+
    409
    \n+
    410 template< int codim, class GridImp, bool leafIterator >
    \n+
    \n+\n+
    412 {
    \n+
    413 ElementInfo elementInfo = entity_.impl().elementInfo_;
    \n+
    414 goNext ( elementInfo );
    \n+
    415 // it is ok to set the invalid ElementInfo
    \n+
    416 entity_.impl().setElement( elementInfo, subEntity_ );
    \n+
    417 }
    \n+
    \n+
    \n+
    418
    \n
    419
    \n-
    420 // adapt mesh
    \n-
    421 hIndexSet_.preAdapt();
    \n-
    422 const bool refined = mesh_.refine();
    \n-
    423 const bool coarsened = (adaptationState_.coarsen() ? mesh_.coarsen() : false);
    \n-
    424 adaptationState_.adapt();
    \n-
    425 hIndexSet_.postAdapt();
    \n-
    426
    \n-
    427 if( refined || coarsened )
    \n-
    428 calcExtras();
    \n-
    429
    \n-
    \n-
    430 // return true if elements were created
    \n-
    431 return refined;
    \n-
    432 }
    \n-
    \n-\n-
    434
    \n-
    435 template< int dim, int dimworld >
    \n-
    436 template< class DataHandle >
    \n-\n-
    \n-\n-
    \n-\n-
    440 preAdapt();
    \n-
    441
    \n-
    \n-\n-\n-\n-\n-
    446
    \n-\n-
    448 typename Callback::DofVectorPointer callbackVector;
    \n-
    449 callbackVector.create( dofNumbering_.emptyDofSpace(), "Adaptation Callback" );
    \n-\n-\n-
    452 if( Callback::DofVectorPointer::supportsAdaptationData )
    \n-
    453 callbackVector.setAdaptationData( &dataHandler );
    \n-
    454 else
    \n-
    455 Alberta::adaptationDataHandler_ = &dataHandler;
    \n-
    456
    \n-
    457 bool refined = adapt();
    \n+
    420 template< int codim, class GridImp, bool leafIterator >
    \n+\n+
    422 ::nextElement ( ElementInfo &elementInfo )
    \n+
    423 {
    \n+
    424 if( elementInfo.isLeaf() || (elementInfo.level() >= level_) )
    \n+
    425 {
    \n+
    426 while( (elementInfo.level() > 0) && (elementInfo.indexInFather() == 1) )
    \n+
    427 elementInfo = elementInfo.father();
    \n+
    428 if( elementInfo.level() == 0 )
    \n+
    429 {
    \n+
    430 ++macroIterator_;
    \n+
    431 elementInfo = *macroIterator_;
    \n+
    432 }
    \n+
    433 else
    \n+
    434 elementInfo = elementInfo.father().child( 1 );
    \n+
    435 }
    \n+
    436 else
    \n+
    437 elementInfo = elementInfo.child( 0 );
    \n+
    438 }
    \n+
    439
    \n+
    440
    \n+
    441 template< int codim, class GridImp, bool leafIterator >
    \n+
    442 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n+
    443 ::nextElementStop ( ElementInfo &elementInfo )
    \n+
    444 {
    \n+
    445 while( !(!elementInfo || stopAtElement( elementInfo )) )
    \n+
    446 nextElement( elementInfo );
    \n+
    447 }
    \n+
    448
    \n+
    449
    \n+
    450 template< int codim, class GridImp, bool leafIterator >
    \n+
    451 inline bool AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n+
    452 ::stopAtElement ( const ElementInfo &elementInfo ) const
    \n+
    453 {
    \n+
    454 if( !elementInfo )
    \n+
    455 return true;
    \n+
    456 return (leafIterator ? elementInfo.isLeaf() : (level_ == elementInfo.level()));
    \n+
    457 }
    \n
    458
    \n-
    459 if( !Callback::DofVectorPointer::supportsAdaptationData )
    \n-
    460 Alberta::adaptationDataHandler_ = 0;
    \n-
    461 callbackVector.release();
    \n-
    462
    \n-
    463 postAdapt();
    \n-
    464 return refined;
    \n-
    465 }
    \n-
    466
    \n+
    459
    \n+
    460 template< int codim, class GridImp, bool leafIterator >
    \n+
    461 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n+
    462 ::goNext ( ElementInfo &elementInfo )
    \n+
    463 {
    \n+
    464 std::integral_constant< int, codim > codimVariable;
    \n+
    465 goNext( codimVariable, elementInfo );
    \n+
    466 }
    \n
    467
    \n-
    468 template< int dim, int dimworld >
    \n-
    469 inline const Alberta::GlobalVector &
    \n-\n-
    \n-
    471 ::getCoord ( const ElementInfo &elementInfo, int vertex ) const
    \n-
    472 {
    \n-
    473 assert( (vertex >= 0) && (vertex <= dim) );
    \n-
    474#if DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    475 return coordCache_( elementInfo, vertex );
    \n-
    476#else
    \n-
    477 return elementInfo.coordinate( vertex );
    \n-
    478#endif
    \n-
    479 }
    \n-
    \n-
    480
    \n-
    481
    \n-
    482 template < int dim, int dimworld >
    \n-
    \n-\n-
    484 {
    \n-
    485 return maxlevel_;
    \n-
    486 }
    \n-
    \n-
    487
    \n-
    488
    \n-
    489 template< int dim, int dimworld >
    \n-
    \n-
    490 inline int AlbertaGrid< dim, dimworld >::size ( int level, int codim ) const
    \n-
    491 {
    \n-
    492 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level, codim ) : 0);
    \n-
    493 }
    \n-
    \n-
    494
    \n+
    468 template< int codim, class GridImp, bool leafIterator >
    \n+
    469 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n+
    470 ::goNext ( const std::integral_constant< int, 0 > /* cdVariable */,
    \n+
    471 ElementInfo &elementInfo )
    \n+
    472 {
    \n+
    473 assert( stopAtElement( elementInfo ) );
    \n+
    474
    \n+
    475 nextElement( elementInfo );
    \n+
    476 nextElementStop( elementInfo );
    \n+
    477 }
    \n+
    478
    \n+
    479 template< int codim, class GridImp, bool leafIterator >
    \n+
    480 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n+
    481 ::goNext ( const std::integral_constant< int, 1 > cdVariable,
    \n+
    482 ElementInfo &elementInfo )
    \n+
    483 {
    \n+
    484 assert( stopAtElement( elementInfo ) );
    \n+
    485
    \n+
    486 ++subEntity_;
    \n+
    487 if( subEntity_ >= numSubEntities )
    \n+
    488 {
    \n+
    489 subEntity_ = 0;
    \n+
    490 nextElement( elementInfo );
    \n+
    491 nextElementStop( elementInfo );
    \n+
    492 if( !elementInfo )
    \n+
    493 return;
    \n+
    494 }
    \n
    495
    \n-
    496 template< int dim, int dimworld >
    \n-
    \n-
    497 inline int AlbertaGrid< dim, dimworld >::size ( int level, GeometryType type ) const
    \n-
    498 {
    \n-
    499 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level, type ) : 0);
    \n-
    500 }
    \n-
    \n-
    501
    \n-
    502
    \n-
    503 template< int dim, int dimworld >
    \n-
    \n-
    504 inline int AlbertaGrid< dim, dimworld >::size ( int codim ) const
    \n-
    505 {
    \n-
    506 assert( sizeCache_.size( codim ) == mesh_.size( codim ) );
    \n-
    507 return mesh_.size( codim );
    \n-
    508 }
    \n-
    \n-
    509
    \n-
    510
    \n-
    511 template< int dim, int dimworld >
    \n-
    \n-
    512 inline int AlbertaGrid< dim, dimworld >::size ( GeometryType type ) const
    \n-
    513 {
    \n-
    514 return sizeCache_.size( type );
    \n-
    515 }
    \n-
    \n-
    516
    \n-
    517
    \n-
    518 template < int dim, int dimworld >
    \n-
    519 inline const typename AlbertaGrid < dim, dimworld > :: Traits :: LevelIndexSet &
    \n-
    \n-
    520 AlbertaGrid < dim, dimworld > :: levelIndexSet (int level) const
    \n-
    521 {
    \n-
    522 // assert that given level is in range
    \n-
    523 assert( (level >= 0) && (level < (int)levelIndexVec_.size()) );
    \n-
    524
    \n-
    525 if( levelIndexVec_[ level ] == 0 )
    \n-
    526 {
    \n-
    527 levelIndexVec_[ level ] = new typename GridFamily::LevelIndexSetImp ( dofNumbering_ );
    \n-
    528 levelIndexVec_[ level ]->update( lbegin< 0 >( level ), lend< 0 >( level ) );
    \n-
    529 }
    \n-
    530 return *(levelIndexVec_[ level ]);
    \n-
    531 }
    \n-
    \n-
    532
    \n-
    533 template < int dim, int dimworld >
    \n-
    534 inline const typename AlbertaGrid < dim, dimworld > :: Traits :: LeafIndexSet &
    \n-
    \n-
    535 AlbertaGrid < dim, dimworld > :: leafIndexSet () const
    \n-
    536 {
    \n-
    537 if( leafIndexSet_ == 0 )
    \n-
    538 {
    \n-
    539 leafIndexSet_ = new typename GridFamily::LeafIndexSetImp( dofNumbering_ );
    \n-
    540 leafIndexSet_->update( leafbegin< 0 >(), leafend< 0 >() );
    \n-
    541 }
    \n-
    542 return *leafIndexSet_;
    \n-
    543 }
    \n-
    \n-
    \n+
    496 if( leafIterator )
    \n+
    497 {
    \n+
    498 const int face = (dimension == 1 ? (numSubEntities-1)-subEntity_ : subEntity_);
    \n+
    499
    \n+
    500 const ALBERTA EL *neighbor = elementInfo.elInfo().neigh[ face ];
    \n+
    501 if( (neighbor != NULL) && !elementInfo.isBoundary( face ) )
    \n+
    502 {
    \n+
    503 // face is reached from element with largest number
    \n+
    504 const int elIndex = grid().dofNumbering() ( elementInfo, 0, 0 );
    \n+
    505 const int nbIndex = grid().dofNumbering() ( neighbor, 0, 0 );
    \n+
    506 if( elIndex < nbIndex )
    \n+
    507 goNext( cdVariable, elementInfo );
    \n+
    508 }
    \n+
    509 // uncomment this assertion only if codimension 1 entities are marked
    \n+
    510 // assert( marker_->template subEntityOnElement< 1 >( elementInfo, subEntity_ ) );
    \n+
    511 }
    \n+
    512 else
    \n+
    513 {
    \n+
    514 assert( marker_ != 0 );
    \n+
    515 if( !marker_->template subEntityOnElement< 1 >( elementInfo, subEntity_ ) )
    \n+
    516 goNext( cdVariable, elementInfo );
    \n+
    517 }
    \n+
    518 }
    \n+
    519
    \n+
    520 template< int codim, class GridImp, bool leafIterator >
    \n+
    521 template< int cd >
    \n+
    522 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >
    \n+
    523 ::goNext ( const std::integral_constant< int, cd > cdVariable,
    \n+
    524 ElementInfo &elementInfo )
    \n+
    525 {
    \n+
    526 assert( stopAtElement( elementInfo ) );
    \n+
    527
    \n+
    528 ++subEntity_;
    \n+
    529 if( subEntity_ >= numSubEntities )
    \n+
    530 {
    \n+
    531 subEntity_ = 0;
    \n+
    532 nextElement( elementInfo );
    \n+
    533 nextElementStop( elementInfo );
    \n+
    534 if( !elementInfo )
    \n+
    535 return;
    \n+
    536 }
    \n+
    537
    \n+
    538 assert( marker_ != 0 );
    \n+
    539 if( !marker_->template subEntityOnElement< cd >( elementInfo, subEntity_ ) )
    \n+
    540 goNext( cdVariable, elementInfo );
    \n+
    541 }
    \n+
    542
    \n+
    543}
    \n
    544
    \n-
    545
    \n-
    546 template < int dim, int dimworld >
    \n-
    547 inline void AlbertaGrid < dim, dimworld >::calcExtras ()
    \n-
    \n-\n-
    549 // determine new maxlevel
    \n-
    550 maxlevel_ = levelProvider_.maxLevel();
    \n-
    551 assert( (maxlevel_ >= 0) && (maxlevel_ < MAXL) );
    \n-
    552
    \n-
    553 // unset up2Dat status, if lbegin is called then this status is updated
    \n-
    554 for( int l = 0; l < MAXL; ++l )
    \n-
    555 levelMarkerVector_[ l ].clear();
    \n-
    556
    \n-
    557 // unset up2Dat status, if leafbegin is called then this status is updated
    \n-
    558 leafMarkerVector_.clear();
    \n-
    559
    \n-
    560 sizeCache_.reset();
    \n-
    561
    \n-
    562 // update index sets (if they exist)
    \n-
    563 if( leafIndexSet_ != 0 )
    \n-
    564 leafIndexSet_->update( leafbegin< 0 >(), leafend< 0 >() );
    \n-
    565 for( unsigned int level = 0; level < levelIndexVec_.size(); ++level )
    \n-
    566 {
    \n-
    567 if( levelIndexVec_[ level ] )
    \n-
    568 levelIndexVec_[ level ]->update( lbegin< 0 >( level ), lend< 0 >( level ) );
    \n-
    569 }
    \n-
    570 }
    \n-
    571
    \n-
    572
    \n-
    573 template< int dim, int dimworld >
    \n-\n-
    \n-
    575 ::writeGrid ( const std::string &filename, ctype time ) const
    \n-
    576 {
    \n-
    577 if( filename.size() <= 0 )
    \n-
    578 DUNE_THROW( AlbertaIOError, "No filename given to writeGridXdr." );
    \n-
    579 return (mesh_.write( filename, time ) && hIndexSet_.write( filename ));
    \n-
    580 }
    \n-
    \n-
    581
    \n-
    582
    \n-
    583 template< int dim, int dimworld >
    \n-\n-
    \n-
    585 ::readGrid ( const std::string &filename, ctype &time )
    \n-
    586 {
    \n-
    587 //removeMesh();
    \n-
    588
    \n-
    589 if( filename.size() <= 0 )
    \n-
    590 return false;
    \n-
    591
    \n-
    592 numBoundarySegments_ = mesh_.read( filename, time );
    \n-
    593 if( !mesh_ )
    \n-
    594 DUNE_THROW( AlbertaIOError, "Could not read grid file: " << filename << "." );
    \n-
    595
    \n-
    596 setup();
    \n-
    597 hIndexSet_.read( filename );
    \n-
    598
    \n-
    599 // calc maxlevel and indexOnLevel and so on
    \n-
    600 calcExtras();
    \n-
    601
    \n-
    602 return true;
    \n-
    603 }
    \n-
    \n-
    604
    \n-
    605
    \n-
    606 // AlbertaGrid::AdaptationCallback
    \n-
    607 // -------------------------------
    \n-
    608
    \n-
    609 template< int dim, int dimworld >
    \n-
    610 template< class DataHandler >
    \n-
    611 struct AlbertaGrid< dim, dimworld >::AdaptationCallback
    \n-
    612 {
    \n-
    613 static const int dimension = dim;
    \n-
    614
    \n-\n-
    616 typedef Alberta::Patch< dimension > Patch;
    \n-
    617
    \n-
    618 static DataHandler &getDataHandler ( const DofVectorPointer &dofVector )
    \n-
    619 {
    \n-
    620 DataHandler *dataHandler;
    \n-
    621 if( DofVectorPointer::supportsAdaptationData )
    \n-
    622 dataHandler = dofVector.getAdaptationData< DataHandler >();
    \n-
    623 else
    \n-
    624 dataHandler = (DataHandler *)Alberta::adaptationDataHandler_;
    \n-
    625 assert( dataHandler != 0 );
    \n-
    626 return *dataHandler;
    \n-
    627 }
    \n-
    628
    \n-
    629 static void interpolateVector ( const DofVectorPointer &dofVector,
    \n-
    630 const Patch &patch )
    \n-
    631 {
    \n-
    632 DataHandler &dataHandler = getDataHandler( dofVector );
    \n-
    633 for( int i = 0; i < patch.count(); ++i )
    \n-
    634 dataHandler.prolongLocal( patch, i );
    \n-
    635 }
    \n-
    636
    \n-
    637 static void restrictVector ( const DofVectorPointer &dofVector,
    \n-
    638 const Patch &patch )
    \n-
    639 {
    \n-
    640 DataHandler &dataHandler = getDataHandler( dofVector );
    \n-
    641 for( int i = 0; i < patch.count(); ++i )
    \n-
    642 dataHandler.restrictLocal( patch, i );
    \n-
    643 }
    \n-
    644 };
    \n-
    645
    \n-
    646} // namespace Dune
    \n-
    647
    \n-
    648#endif
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n+
    545#endif // #if HAVE_ALBERTA
    \n+
    546
    \n+
    547#endif // #ifndef DUNE_ALBERTA_TREEITERATOR_HH
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n-\n-\n-\n+
    provides a wrapper for ALBERTA's mesh structure
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n+
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    static void checkAlbertaDimensions()
    Definition albertagrid.cc:29
    \n-
    static const int dimWorld
    Definition misc.hh:46
    \n-
    static void * adaptationDataHandler_
    Definition albertagrid.cc:24
    \n-
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n-
    static std::string typeName()
    Definition agrid.hh:410
    \n-
    GridFamily::ctype ctype
    Definition agrid.hh:143
    \n-
    Definition albertagrid/datahandle.hh:27
    \n-
    unsigned int create(const MacroData< dim > &macroData)
    Definition meshpointer.hh:299
    \n-
    Definition dofvector.hh:179
    \n+\n+
    static const int dimension
    Definition agrid.hh:145
    \n+\n+\n+
    int size(int codim) const
    Definition dofadmin.hh:163
    \n \n-
    const GlobalVector & coordinate(int vertex) const
    Definition elementinfo.hh:685
    \n-
    void create()
    Definition indexsets.cc:133
    \n-
    Definition albertagrid/indexsets.hh:329
    \n-
    Definition albertagrid/gridfamily.hh:98
    \n-
    Definition albertagrid/gridfamily.hh:117
    \n-
    Definition macrodata.hh:30
    \n-
    Definition misc.hh:32
    \n-
    Definition misc.hh:36
    \n-
    Definition albertagrid/projection.hh:80
    \n-
    Definition albertagrid/projection.hh:163
    \n-
    Definition refinement.hh:40
    \n+
    Definition treeiterator.hh:189
    \n+
    bool equals(const This &other) const
    equality
    Definition treeiterator.hh:231
    \n+
    MakeableInterfaceObject< Entity > EntityObject
    Definition treeiterator.hh:208
    \n+
    Alberta::MeshPointer< dimension > MeshPointer
    Definition treeiterator.hh:204
    \n+
    AlbertaGridTreeIterator(const GridImp &grid, const MarkerVector *marker, int travLevel)
    Constructor making begin iterator.
    Definition treeiterator.hh:352
    \n+
    AlbertaGridTreeIterator(const GridImp &grid, int travLevel)
    Constructor making end iterator.
    Definition treeiterator.hh:373
    \n+
    EntityObject::ImplementationType EntityImp
    Definition treeiterator.hh:209
    \n+
    static const int codimension
    Definition treeiterator.hh:194
    \n+
    MeshPointer::MacroIterator MacroIterator
    Definition treeiterator.hh:205
    \n+
    This & operator=(const This &other)
    Constructor making end iterator.
    Definition treeiterator.hh:398
    \n+
    Entity & dereference() const
    dereferencing
    Definition treeiterator.hh:237
    \n+
    AlbertaMarkerVector< dimension, dimensionworld > MarkerVector
    Definition treeiterator.hh:212
    \n+
    GridImp::template Codim< codim >::Entity Entity
    Definition treeiterator.hh:207
    \n+
    int level() const
    ask for level of entities
    Definition treeiterator.hh:243
    \n+
    static const int dimensionworld
    Definition treeiterator.hh:195
    \n+
    AlbertaGridTreeIterator()
    Definition treeiterator.hh:342
    \n+
    void increment()
    increment
    Definition treeiterator.hh:411
    \n+
    const GridImp & grid() const
    obtain a reference to the grid
    Definition treeiterator.hh:253
    \n+
    static const int dimension
    Definition treeiterator.hh:193
    \n+
    AlbertaGridTreeIterator(const This &other)
    Constructor making end iterator.
    Definition treeiterator.hh:386
    \n+
    EntityImp::ElementInfo ElementInfo
    Definition treeiterator.hh:210
    \n+
    Definition misc.hh:148
    \n
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    AlbertaMarkerVector(const DofNumbering &dofNumbering)
    create AlbertaMarkerVector with empty vectors
    Definition treeiterator.hh:54
    \n+
    bool up2Date() const
    return true if marking is up to date
    Definition treeiterator.hh:95
    \n+
    bool subEntityOnElement(const ElementInfo &elementInfo, int subEntity) const
    visit subentity on this element?
    Definition treeiterator.hh:294
    \n+
    void markSubEntities(const Iterator &begin, const Iterator &end)
    Definition treeiterator.hh:310
    \n+
    ~AlbertaMarkerVector()
    Definition treeiterator.hh:68
    \n+
    void clear()
    Definition treeiterator.hh:84
    \n+
    AlbertaMarkerVector(const This &other)
    Definition treeiterator.hh:61
    \n+
    void print(std::ostream &out=std::cout) const
    print for debugin' only
    Definition treeiterator.hh:319
    \n+\n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition treeiterator.hh:139
    \n+
    static void apply(const DofNumbering &dofNumbering, int *(&marker)[dimension+1], const ElementInfo &elementInfo)
    Definition treeiterator.hh:141
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+\n+
    InterfaceType::Implementation ImplementationType
    Definition common/grid.hh:1122
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,748 +1,690 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-albertagrid.cc\n+treeiterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTAGRID_CC\n-6#define DUNE_ALBERTAGRID_CC\n-7\n-8//************************************************************************\n-9//\n-10// implementation of AlbertaGrid\n-11//\n-12// namespace Dune\n-13//\n-14//************************************************************************\n-15#include \"geometry.cc\"\n-16#include \"entity.cc\"\n-17#include \"intersection.cc\"\n+5\n+6#ifndef DUNE_ALBERTA_TREEITERATOR_HH\n+7#define DUNE_ALBERTA_TREEITERATOR_HH\n+8\n+9#include \n+10\n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16\n+17#if HAVE_ALBERTA\n 18\n 19namespace Dune\n 20{\n 21\n-22 namespace Alberta\n-23 {\n-24 static void *adaptationDataHandler_;\n-25 }\n-26\n-27\n-28 template< int dim, int dimworld >\n-29 static void checkAlbertaDimensions ()\n-30 {\n-31 // If this check fails, define ALBERTA_DIM accordingly\n-32 static_assert((dimworld == Alberta::dimWorld),\n-33 \"Template Parameter dimworld does not match \"\n-34 \"ALBERTA's DIM_OF_WORLD setting.\");\n-35 }\n-36\n+22 // AlbertaMarkerVector\n+23 // -------------------\n+24\n+33 template< int dim, int dimworld >\n+34 class AlbertaMarkerVector\n+35 {\n+36 typedef AlbertaMarkerVector<_dim,_dimworld_> This;\n 37\n-38 // AlbertaGrid\n-39 // -----------\n-40\n-41 template< int dim, int dimworld >\n-42 inline AlbertaGrid_<_dim,_dimworld_>::AlbertaGrid ()\n-43 : mesh_(),\n-44 maxlevel_( 0 ),\n-45 numBoundarySegments_( 0 ),\n-46 hIndexSet_( dofNumbering_ ),\n-47 idSet_( hIndexSet_ ),\n-48 levelIndexVec_( (size_t)MAXL, 0 ),\n-49 leafIndexSet_( 0 ),\n-50 sizeCache_( *this ),\n-51 leafMarkerVector_( dofNumbering_ ),\n-52 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n-53 {\n-54 checkAlbertaDimensions<_dim,_dimworld>();\n-55 }\n-56\n-57\n-58 template< int dim, int dimworld >\n-59 template< class Proj, class Impl >\n-60 inline AlbertaGrid<_dim,_dimworld_>\n-61_::AlbertaGrid ( const Alberta::MacroData<_dimension> ¯oData,\n-62 const Alberta::ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory )\n-63 : mesh_(),\n-64 maxlevel_( 0 ),\n-65 numBoundarySegments_( 0 ),\n-66 hIndexSet_( dofNumbering_ ),\n-67 idSet_( hIndexSet_ ),\n-68 levelIndexVec_( (size_t)MAXL, 0 ),\n-69 leafIndexSet_ ( 0 ),\n-70 sizeCache_( *this ),\n-71 leafMarkerVector_( dofNumbering_ ),\n-72 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n-73 {\n-74 checkAlbertaDimensions<_dim,_dimworld_>();\n+38 typedef AlbertaGrid<_dim,_dimworld_> Grid;\n+39\n+40 //friend class AlbertaGrid< dim, dimworld >;\n+41\n+42 static const int dimension = Grid::dimension;\n+43\n+44 typedef Alberta::HierarchyDofNumbering<_dimension_> DofNumbering;\n+45 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+46\n+47 template< bool >\n+48 struct NoMarkSubEntities;\n+49 template< bool >\n+50 struct MarkSubEntities;\n+51\n+52 public:\n+54 explicit AlbertaMarkerVector ( const DofNumbering &dofNumbering )\n+55 : dofNumbering_( dofNumbering )\n+56 {\n+57 for( int codim = 0; codim <= dimension; ++codim )\n+58 marker_[ codim ] = 0;\n+59 }\n+60\n+61 AlbertaMarkerVector ( const This &other )\n+62 : dofNumbering_( other.dofNumbering_ )\n+63 {\n+64 for( int codim = 0; codim <= dimension; ++codim )\n+65 marker_[ codim ] = 0;\n+66 }\n+67\n+68 ~AlbertaMarkerVector ()\n+69 {\n+70 clear();\n+71 }\n+72\n+73 private:\n+74 This &operator= ( const This & );\n 75\n-76 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );\n-77 if( !mesh_ )\n-78 DUNE_THROW( AlbertaError, \"Invalid macro data structure.\" );\n-79\n-80 setup();\n-81 hIndexSet_.create();\n-82\n-83 calcExtras();\n-84 }\n-85\n-86\n-87 template< int dim, int dimworld >\n-88 inline AlbertaGrid<_dim,_dimworld_>\n-89_::AlbertaGrid ( const Alberta::MacroData<_dimension> ¯oData,\n-90 const std::shared_ptr< DuneBoundaryProjection<_dimensionworld_> >\n-&projection )\n-91 : mesh_(),\n-92 maxlevel_( 0 ),\n-93 numBoundarySegments_( 0 ),\n-94 hIndexSet_( dofNumbering_ ),\n-95 idSet_( hIndexSet_ ),\n-96 levelIndexVec_( (size_t)MAXL, 0 ),\n-97 leafIndexSet_ ( 0 ),\n-98 sizeCache_( *this ),\n-99 leafMarkerVector_( dofNumbering_ ),\n-100 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n-101 {\n-102 checkAlbertaDimensions<_dim,_dimworld_>();\n-103\n-104 if( projection != 0 )\n-105 {\n-106 Alberta::DuneGlobalBoundaryProjectionFactory<_dimension_> projectionFactory\n-( projection );\n-107 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );\n-108 }\n-109 else\n-110 numBoundarySegments_ = mesh_.create( macroData );\n-111 if( !mesh_ )\n-112 DUNE_THROW( AlbertaError, \"Invalid macro data structure.\" );\n-113\n-114 setup();\n-115 hIndexSet_.create();\n-116\n-117 calcExtras();\n-118 }\n-119\n-120\n-121 template < int dim, int dimworld >\n-122 inline AlbertaGrid<_dim,_dimworld_>\n-123_::AlbertaGrid ( const std::string ¯oGridFileName )\n-124 : mesh_(),\n-125 maxlevel_( 0 ),\n-126 hIndexSet_( dofNumbering_ ),\n-127 idSet_( hIndexSet_ ),\n-128 levelIndexVec_( (size_t)MAXL, 0 ),\n-129 leafIndexSet_ ( 0 ),\n-130 sizeCache_( *this ),\n-131 leafMarkerVector_( dofNumbering_ ),\n-132 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n+76 public:\n+78 template< int codim >\n+79 bool subEntityOnElement ( const ElementInfo &elementInfo, int subEntity )\n+const;\n+80\n+81 template< int firstCodim, class Iterator >\n+82 void markSubEntities ( const Iterator &begin, const Iterator &end );\n+83\n+84 void clear ()\n+85 {\n+86 for( int codim = 0; codim <= dimension; ++codim )\n+87 {\n+88 if( marker_[ codim ] != 0 )\n+89 delete[] marker_[ codim ];\n+90 marker_[ codim ] = 0;\n+91 }\n+92 }\n+93\n+95 bool up2Date () const\n+96 {\n+97 return (marker_[ dimension ] != 0);\n+98 }\n+99\n+101 void print ( std::ostream &out = std::cout ) const;\n+102\n+103 private:\n+104 const DofNumbering &dofNumbering_;\n+105 int *marker_[ dimension+1 ];\n+106 };\n+107\n+108\n+109\n+110 // AlbertaMarkerVector::NoMarkSubEntities\n+111 // --------------------------------------\n+112\n+113 template< int dim, int dimworld >\n+114 template< bool >\n+115 struct AlbertaMarkerVector< dim, dimworld >::NoMarkSubEntities\n+116 {\n+117 template< int firstCodim, class Iterator >\n+118 static void mark ( [[maybe_unused]] const DofNumbering & dofNumbering,\n+119 [[maybe_unused]] int *(&marker)[ dimension + 1 ],\n+120 [[maybe_unused]] const Iterator &begin,\n+121 [[maybe_unused]] const Iterator &end )\n+122 {}\n+123 };\n+124\n+125\n+126\n+127 // AlbertaMarkerVector::MarkSubEntities\n+128 // ------------------------------------\n+129\n+130 template< int dim, int dimworld >\n+131 template< bool >\n+132 struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities\n 133 {\n-134 checkAlbertaDimensions<_dim,_dimworld_>();\n-135\n-136 numBoundarySegments_ = mesh_.create( macroGridFileName );\n-137 if( !mesh_ )\n-138 {\n-139 DUNE_THROW( AlbertaIOError,\n-140 \"Grid file '\" << macroGridFileName\n-141 << \"' is not in ALBERTA macro triangulation format.\" );\n-142 }\n-143\n-144 setup();\n-145 hIndexSet_.create();\n+134 template< int codim >\n+135 struct Codim\n+136 {\n+137 static const int numSubEntities = Alberta::NumSubEntities<_dimension,_codim\n+>::value;\n+138\n+139 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+140\n+141 static void apply ( const DofNumbering &dofNumbering,\n+142 int *(&marker)[ dimension + 1 ],\n+143 const ElementInfo &elementInfo )\n+144 {\n+145 int *array = marker[ codim ];\n 146\n-147 calcExtras();\n-148\n-149 std::cout << typeName() << \" created from macro grid file '\"\n-150 << macroGridFileName << \"'.\" << std::endl;\n-151 }\n-152\n-153\n-154 template< int dim, int dimworld >\n-155 inline void AlbertaGrid<_dim,_dimworld_>::setup ()\n-156 {\n-157 dofNumbering_.create( mesh_ );\n-158\n-159 levelProvider_.create( dofNumbering_ );\n-160\n-161#if DUNE_ALBERTA_CACHE_COORDINATES\n-162 coordCache_.create( dofNumbering_ );\n-163#endif\n-164 }\n-165\n-166\n-167 template< int dim, int dimworld >\n-168 inline void AlbertaGrid< dim, dimworld >::removeMesh ()\n-169 {\n-170 for( size_t i = 0; i < levelIndexVec_.size(); ++i )\n+147 const int index = dofNumbering( elementInfo, 0, 0 );\n+148 for( int i = 0; i < numSubEntities; ++i )\n+149 {\n+150 int &mark = array[ dofNumbering( elementInfo, codim, i ) ];\n+151 mark = std::max( index, mark );\n+152 }\n+153 }\n+154 };\n+155\n+156 template< int firstCodim, class Iterator >\n+157 static void mark ( const DofNumbering &dofNumbering, int *(&marker)\n+[ dimension + 1 ],\n+158 const Iterator &begin, const Iterator &end )\n+159 {\n+160 for( int codim = firstCodim; codim <= dimension; ++codim )\n+161 {\n+162 const int size = dofNumbering.size( codim );\n+163 marker[ codim ] = new int[ size ];\n+164\n+165 int *array = marker[ codim ];\n+166 for( int i = 0; i < size; ++i )\n+167 array[ i ] = -1;\n+168 }\n+169\n+170 for( Iterator it = begin; it != end; ++it )\n 171 {\n-172 if( levelIndexVec_[ i ] != 0 )\n-173 delete levelIndexVec_[ i ];\n-174 levelIndexVec_[ i ] = 0;\n+172 const ElementInfo &elementInfo = it->impl().elementInfo();\n+173 Hybrid::forEach( std::make_index_sequence< dimension+1-firstCodim >{},\n+174 [ & ]( auto i ){ Codim< i+firstCodim >::apply( dofNumbering, marker,\n+elementInfo ); } );\n 175 }\n-176\n-177 if( leafIndexSet_ != 0 )\n-178 delete leafIndexSet_;\n-179 leafIndexSet_ = 0;\n+176 }\n+177 };\n+178\n+179\n 180\n-181 // release dof vectors\n-182 hIndexSet_.release();\n-183 levelProvider_.release();\n-184#if DUNE_ALBERTA_CACHE_COORDINATES\n-185 coordCache_.release();\n-186#endif\n-187 dofNumbering_.release();\n-188\n-189 sizeCache_.reset();\n-190\n-191 mesh_.release();\n-192 }\n-193\n-194\n-195 template< int dim, int dimworld >\n-196 inline AlbertaGrid<_dim,_dimworld_>::~AlbertaGrid ()\n-197 {\n-198 removeMesh();\n-199 }\n-200\n-201\n-202 template< int dim, int dimworld >\n-203 template< int codim, PartitionIteratorType pitype >\n-204 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-205 ::template Codim< codim >::template Partition::LevelIterator\n-206 AlbertaGrid<_dim,_dimworld_>::lbegin ( int level ) const\n-207 {\n-208 typedef AlbertaGridLevelIterator<_codim,_pitype,_const_This_>\n-LevelIteratorImp;\n-209 assert( level >= 0 );\n-210\n-211 if( level > maxlevel_ )\n-212 return lend<_codim,_pitype_>( level );\n-213 MarkerVector &markerVector = levelMarkerVector_[ level ];\n-214\n-215 if( (codim > 0) && !markerVector.up2Date() )\n-216 markerVector.template markSubEntities<_1_>( lbegin<_0_>( level ), lend<_0_>\n-( level ) );\n-217\n-218 return LevelIteratorImp( *this, &markerVector, level );\n-219 }\n-220\n+181 // AlbertaGridTreeIterator\n+182 // -----------------------\n+183\n+187 template< int codim, class GridImp, bool leafIterator >\n+188 class AlbertaGridTreeIterator\n+189 {\n+190 typedef AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_> This;\n+191\n+192 public:\n+193 static const int dimension = GridImp::dimension;\n+194 static const int codimension = codim;\n+195 static const int dimensionworld = GridImp::dimensionworld;\n+196\n+197 private:\n+198 friend class AlbertaGrid< dimension, dimensionworld >;\n+199\n+200 static const int numSubEntities\n+201 = Alberta::NumSubEntities<_dimension,_codimension_>::value;\n+202\n+203 public:\n+204 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n+205 typedef typename MeshPointer::MacroIterator MacroIterator;\n+206\n+207 typedef typename GridImp::template Codim< codim >::Entity Entity;\n+208 typedef MakeableInterfaceObject<_Entity_> EntityObject;\n+209 typedef typename EntityObject::ImplementationType EntityImp;\n+210 typedef typename EntityImp::ElementInfo ElementInfo;\n+211\n+212 typedef AlbertaMarkerVector<_dimension,_dimensionworld_> MarkerVector;\n+213\n+214 AlbertaGridTreeIterator ();\n+215\n+217 AlbertaGridTreeIterator ( const This &other );\n+218\n+220 This &operator=_( const This &other );\n 221\n-222 template< int dim, int dimworld >\n-223 template< int codim, PartitionIteratorType pitype >\n-224 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-225 ::template Codim< codim >::template Partition< pitype >::LevelIterator\n-226 AlbertaGrid_<_dim,_dimworld_>::lend ( int level ) const\n-227 {\n-228 typedef AlbertaGridLevelIterator<_codim,_pitype,_const_This_>\n-LevelIteratorImp;\n-229 assert( level >= 0 );\n-230\n-231 return LevelIteratorImp( *this, level );\n-232 }\n-233\n-234\n-235 template< int dim, int dimworld >\n-236 template< int codim >\n-237 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-238 ::template Codim< codim >::LevelIterator\n-239 AlbertaGrid_<_dim,_dimworld_>::lbegin ( int level ) const\n-240 {\n-241 return lbegin<_codim,_All_Partition_>( level );\n-242 }\n-243\n-244\n-245 template< int dim, int dimworld >\n-246 template< int codim >\n-247 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-248 ::template Codim< codim >::LevelIterator\n-249 AlbertaGrid<_dim,_dimworld_>::lend ( int level ) const\n-250 {\n-251 return lend<_codim,_All_Partition_>( level );\n-252 }\n-253\n-254\n-255 template< int dim, int dimworld >\n-256 template< int codim, PartitionIteratorType pitype >\n-257 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-258 ::template Codim< codim >::template Partition< pitype >::LeafIterator\n-259 AlbertaGrid<_dim,_dimworld_>::leafbegin () const\n-260 {\n-261 typedef AlbertaGridLeafIterator<_codim,_pitype,_const_This_>\n-LeafIteratorImp;\n+223 AlbertaGridTreeIterator ( const GridImp &grid, int travLevel );\n+224\n+226 AlbertaGridTreeIterator ( const GridImp &grid,\n+227 const MarkerVector *marker,\n+228 int travLevel );\n+229\n+231 bool equals ( const This &other ) const\n+232 {\n+233 return entity_.impl().equals( other.entity_.impl() );\n+234 }\n+235\n+237 Entity &dereference () const\n+238 {\n+239 return entity_;\n+240 }\n+241\n+243 int level () const\n+244 {\n+245 return entity_.impl().level();\n+246 }\n+247\n+249 void increment();\n+250\n+251 protected:\n+253 const GridImp &grid () const\n+254 {\n+255 return entity_.impl().grid();\n+256 }\n+257\n+258 private:\n+259 void nextElement ( ElementInfo &elementInfo );\n+260 void nextElementStop (ElementInfo &elementInfo );\n+261 bool stopAtElement ( const ElementInfo &elementInfo ) const;\n 262\n-263 MarkerVector &markerVector = leafMarkerVector_;\n-264 const int firstMarkedCodim = 2;\n-265 if( (codim >= firstMarkedCodim) && !markerVector.up2Date() )\n-266 markerVector.template markSubEntities<_firstMarkedCodim_>( leafbegin<_0_>\n-(), leafend<_0_>() );\n-267\n-268 return LeafIteratorImp( *this, &markerVector, maxlevel_ );\n-269 }\n-270\n+263 void goNext ( ElementInfo &elementInfo );\n+264 void goNext ( const std::integral_constant< int, 0 > cdVariable,\n+265 ElementInfo &elementInfo );\n+266 void goNext ( const std::integral_constant< int, 1 > cdVariable,\n+267 ElementInfo &elementInfo );\n+268 template< int cd >\n+269 void goNext ( const std::integral_constant< int, cd > cdVariable,\n+270 ElementInfo &elementInfo );\n 271\n-272 template< int dim, int dimworld >\n-273 template< int codim, PartitionIteratorType pitype >\n-274 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-275 ::template Codim<_codim_>::template Partition< pitype >::LeafIterator\n-276 AlbertaGrid<_dim,_dimworld_>::leafend () const\n-277 {\n-278 typedef AlbertaGridLeafIterator<_codim,_pitype,_const_This_>\n-LeafIteratorImp;\n-279 return LeafIteratorImp( *this, maxlevel_ );\n-280 }\n+272 mutable Entity entity_;\n+273\n+275 int level_;\n+276\n+278 int subEntity_;\n+279\n+280 MacroIterator macroIterator_;\n 281\n-282\n-283 template< int dim, int dimworld >\n-284 template< int codim >\n-285 inline typename AlbertaGrid::Traits\n-286 ::template Codim<_codim_>::LeafIterator\n-287 AlbertaGrid<_dim,_dimworld_>::leafbegin () const\n-288 {\n-289 return leafbegin<_codim,_All_Partition_>();\n-290 }\n-291\n-292\n-293 template< int dim, int dimworld >\n-294 template< int codim >\n-295 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n-296 ::template Codim< codim >::LeafIterator\n-297 AlbertaGrid_<_dim,_dimworld_>::leafend () const\n-298 {\n-299 return leafend<_codim,_All_Partition_>();\n-300 }\n+282 // knows on which element a point,edge,face is viewed\n+283 const MarkerVector *marker_;\n+284 };\n+285\n+286\n+287\n+288 // Implementation of AlbertaMarkerVector\n+289 // -------------------------------------\n+290\n+291 template< int dim, int dimworld >\n+292 template< int codim >\n+293 inline bool AlbertaMarkerVector< dim, dimworld >\n+294 ::subEntityOnElement ( const ElementInfo &elementInfo, int subEntity )\n+const\n+295 {\n+296 assert( marker_[ codim ] != 0 );\n+297\n+298 const int subIndex = dofNumbering_( elementInfo, codim, subEntity );\n+299 const int markIndex = marker_[ codim ][ subIndex ];\n+300 assert( (markIndex >= 0) );\n 301\n-302\n-303 template< int dim, int dimworld >\n-304 inline void AlbertaGrid<_dim,_dimworld_>::globalRefine ( int refCount )\n-305 {\n-306 typedef typename Traits::template Codim<_0_>::LeafIterator LeafIterator;\n-307\n-308 // only MAXL levels allowed\n-309 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );\n-310\n-311 for( int i = 0; i < refCount; ++i )\n-312 {\n-313 // mark all interior elements\n-314 const LeafIterator endit = leafend<_0_>();\n-315 for( LeafIterator it = leafbegin<_0_>(); it != endit; ++it )\n-316 mark( 1, *it );\n+302 const int index = dofNumbering_( elementInfo, 0, 0 );\n+303 return (markIndex == index);\n+304 }\n+305\n+306\n+307 template< int dim, int dimworld >\n+308 template< int firstCodim, class Iterator >\n+309 inline void AlbertaMarkerVector<_dim,_dimworld_>\n+310_::markSubEntities ( const Iterator &begin, const Iterator &end )\n+311 {\n+312 clear();\n+313 std::conditional< (firstCodim <= dimension), MarkSubEntities,\n+NoMarkSubEntities >::type\n+314 ::template mark< firstCodim, Iterator >( dofNumbering_, marker_, begin, end\n+);\n+315 }\n+316\n 317\n-318 preAdapt();\n-319 adapt();\n-320 postAdapt();\n-321 }\n-322 }\n-323\n-324\n-325 template< int dim, int dimworld >\n-326 template< class DataHandle >\n-327 inline void AlbertaGrid<_dim,_dimworld_>\n-328_::globalRefine ( int refCount, AdaptDataHandleInterface<_This,_DataHandle_>\n-&handle )\n-329 {\n-330 typedef typename Traits::template Codim<_0_>::LeafIterator LeafIterator;\n-331\n-332 // only MAXL levels allowed\n-333 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );\n+318 template< int dim, int dimworld >\n+319 inline void AlbertaMarkerVector<_dim,_dimworld_>::print ( std::ostream &out\n+) const\n+320 {\n+321 for( int codim = 1; codim <= dimension; ++codim )\n+322 {\n+323 int *marker = marker_[ codim ];\n+324 if( marker != 0 )\n+325 {\n+326 const int size = dofNumbering_.size( codim );\n+327 out << std::endl;\n+328 out << \"Codimension \" << codim << \" (\" << size << \" entries)\" << std::endl;\n+329 for( int i = 0; i < size; ++i )\n+330 out << \"subentity \" << i << \" visited on Element \" << marker[ i ] << std::\n+endl;\n+331 }\n+332 }\n+333 }\n 334\n-335 for( int i = 0; i < refCount; ++i )\n-336 {\n-337 // mark all interior elements\n-338 const LeafIterator endit = leafend<_0_>();\n-339 for( LeafIterator it = leafbegin<_0_>(); it != endit; ++it )\n-340 mark( 1, *it );\n-341\n-342 adapt( handle );\n-343 }\n-344 }\n-345\n-346\n-347 template< int dim, int dimworld >\n-348 inline bool AlbertaGrid<_dim,_dimworld_>::preAdapt ()\n-349 {\n-350 adaptationState_.preAdapt();\n-351 return adaptationState_.coarsen();\n-352 }\n-353\n-354\n-355 template < int dim, int dimworld >\n-356 inline void AlbertaGrid_<_dim,_dimworld_>::postAdapt ()\n-357 {\n-358#ifndef NDEBUG\n-359 if( leafIndexSet_ != 0 )\n+335\n+336\n+337 // Implementation of AlbertaGridTreeIterator\n+338 // -----------------------------------------\n+339\n+340 template< int codim, class GridImp, bool leafIterator >\n+341 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n+342_::AlbertaGridTreeIterator ()\n+343 : entity_(),\n+344 level_( -1 ),\n+345 subEntity_( -1 ),\n+346 macroIterator_(),\n+347 marker_( NULL )\n+348 {}\n+349\n+350 template< int codim, class GridImp, bool leafIterator >\n+351 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n+352_::AlbertaGridTreeIterator ( const GridImp &grid,\n+353 const MarkerVector *marker,\n+354 int travLevel )\n+355 : entity_( EntityImp( grid ) ),\n+356 level_( travLevel ),\n+357 subEntity_( (codim == 0 ? 0 : -1) ),\n+358 macroIterator_( grid.meshPointer().begin() ),\n+359 marker_( marker )\n 360 {\n-361 bool consistent = true;\n-362 for( int codim = 0; codim <= dimension; ++codim )\n-363 {\n-364 if( int(leafIndexSet_->size( codim )) == mesh_.size( codim ) )\n-365 continue;\n-366 std::cerr << \"Incorrect size of leaf index set for codimension \"\n-367 << codim << \"!\" << std::endl;\n-368 std::cerr << \"DUNE index set reports: \" << leafIndexSet_->size( codim )\n-369 << std::endl;\n-370 std::cerr << \"ALBERTA mesh reports: \" << mesh_.size( codim ) << std::endl;\n-371 consistent = false;\n-372 }\n-373 if( !consistent )\n-374 abort();\n-375 }\n-376#endif\n-377\n-378 levelProvider_.markAllOld();\n-379 adaptationState_.postAdapt();\n-380 }\n+361 ElementInfo elementInfo = *macroIterator_;\n+362 nextElementStop( elementInfo );\n+363 if( codim > 0 )\n+364 goNext( elementInfo );\n+365 // it is ok to set the invalid ElementInfo\n+366 entity_.impl().setElement( elementInfo, subEntity_ );\n+367 }\n+368\n+369\n+370 // Make LevelIterator with point to element from previous iterations\n+371 template< int codim, class GridImp, bool leafIterator >\n+372 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n+373_::AlbertaGridTreeIterator ( const GridImp &grid,\n+374 int travLevel )\n+375 : entity_( EntityImp( grid ) ),\n+376 level_( travLevel ),\n+377 subEntity_( -1 ),\n+378 macroIterator_( grid.meshPointer().end() ),\n+379 marker_( 0 )\n+380 {}\n 381\n 382\n-383 template< int dim, int dimworld >\n-384 inline bool AlbertaGrid<_dim,_dimworld_>\n-385_::mark( int refCount, const typename Traits::template Codim<_0_>::Entity &e\n-)\n-386 {\n-387 // if not leaf entity, leave method\n-388 if( !e.isLeaf() )\n-389 return false;\n-390\n-391 // don't mark macro elements for coarsening\n-392 if( refCount < -e.level() )\n-393 return false;\n+383 // Make LevelIterator with point to element from previous iterations\n+384 template< int codim, class GridImp, bool leafIterator >\n+385 inline AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n+386_::AlbertaGridTreeIterator( const This &other )\n+387 : entity_( other.entity_ ),\n+388 level_( other.level_ ),\n+389 subEntity_( other.subEntity_ ),\n+390 macroIterator_( other.macroIterator_ ),\n+391 marker_( other.marker_ )\n+392 {}\n+393\n 394\n-395 // take back previous marking\n-396 adaptationState_.unmark( getMark( e ) );\n-397\n-398 // set new marking\n-399 adaptationState_.mark( refCount );\n-400 e.impl().elementInfo().setMark( refCount );\n-401\n-402 return true;\n-403 }\n-404\n+395 // Make LevelIterator with point to element from previous iterations\n+396 template< int codim, class GridImp, bool leafIterator >\n+397 inline typename AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>::\n+This &\n+398 AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>::operator=_( const\n+This &other )\n+399 {\n+400 entity_ = other.entity_;\n+401 level_ = other.level_;\n+402 subEntity_ = other.subEntity_;\n+403 macroIterator_ = other.macroIterator_;\n+404 marker_ = other.marker_;\n 405\n-406 template< int dim, int dimworld >\n-407 inline int AlbertaGrid<_dim,_dimworld_>\n-408_::getMark( const typename Traits::template Codim<_0_>::Entity &e ) const\n-409 {\n-410 return e.impl().elementInfo().getMark();\n-411 }\n-412\n-413\n-414 template< int dim, int dimworld >\n-415 inline bool AlbertaGrid<_dim,_dimworld_>::adapt ()\n-416 {\n-417 // this is already done in postAdapt\n-418 //levelProvider_.markAllOld();\n+406 return *this;\n+407 }\n+408\n+409\n+410 template< int codim, class GridImp, bool leafIterator >\n+411 inline void AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>::\n+increment ()\n+412 {\n+413 ElementInfo elementInfo = entity_.impl().elementInfo_;\n+414 goNext ( elementInfo );\n+415 // it is ok to set the invalid ElementInfo\n+416 entity_.impl().setElement( elementInfo, subEntity_ );\n+417 }\n+418\n 419\n-420 // adapt mesh\n-421 hIndexSet_.preAdapt();\n-422 const bool refined = mesh_.refine();\n-423 const bool coarsened = (adaptationState_.coarsen() ? mesh_.coarsen() :\n-false);\n-424 adaptationState_.adapt();\n-425 hIndexSet_.postAdapt();\n-426\n-427 if( refined || coarsened )\n-428 calcExtras();\n-429\n-430 // return true if elements were created\n-431 return refined;\n+420 template< int codim, class GridImp, bool leafIterator >\n+421 inline void AlbertaGridTreeIterator<_codim,_GridImp,_leafIterator_>\n+422_::nextElement ( ElementInfo &elementInfo )\n+423 {\n+424 if( elementInfo.isLeaf() || (elementInfo.level() >= level_) )\n+425 {\n+426 while( (elementInfo.level() > 0) && (elementInfo.indexInFather() == 1) )\n+427 elementInfo = elementInfo.father();\n+428 if( elementInfo.level() == 0 )\n+429 {\n+430 ++macroIterator_;\n+431 elementInfo = *macroIterator_;\n 432 }\n-433\n-434\n-435 template< int dim, int dimworld >\n-436 template< class DataHandle >\n-437 inline bool AlbertaGrid_<_dim,_dimworld_>\n-438 ::adapt ( AdaptDataHandleInterface<_This,_DataHandle_> &handle )\n-439 {\n-440 preAdapt();\n-441\n-442 typedef Alberta::AdaptRestrictProlongHandler\n-443 < This, AdaptDataHandleInterface<_This,_DataHandle_> >\n-444 DataHandler;\n-445 DataHandler dataHandler( *this, handle );\n-446\n-447 typedef AdaptationCallback<_DataHandler_> Callback;\n-448 typename Callback::DofVectorPointer callbackVector;\n-449 callbackVector.create( dofNumbering_.emptyDofSpace(), \"Adaptation Callback\"\n-);\n-450 callbackVector.template setupInterpolation<_Callback_>();\n-451 callbackVector.template setupRestriction<_Callback_>();\n-452 if( Callback::DofVectorPointer::supportsAdaptationData )\n-453 callbackVector.setAdaptationData( &dataHandler );\n-454 else\n-455 Alberta::adaptationDataHandler_ = &dataHandler;\n-456\n-457 bool refined = adapt();\n+433 else\n+434 elementInfo = elementInfo.father().child( 1 );\n+435 }\n+436 else\n+437 elementInfo = elementInfo.child( 0 );\n+438 }\n+439\n+440\n+441 template< int codim, class GridImp, bool leafIterator >\n+442 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n+443 ::nextElementStop ( ElementInfo &elementInfo )\n+444 {\n+445 while( !(!elementInfo || stopAtElement( elementInfo )) )\n+446 nextElement( elementInfo );\n+447 }\n+448\n+449\n+450 template< int codim, class GridImp, bool leafIterator >\n+451 inline bool AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n+452 ::stopAtElement ( const ElementInfo &elementInfo ) const\n+453 {\n+454 if( !elementInfo )\n+455 return true;\n+456 return (leafIterator ? elementInfo.isLeaf() : (level_ == elementInfo.level\n+()));\n+457 }\n 458\n-459 if( !Callback::DofVectorPointer::supportsAdaptationData )\n-460 Alberta::adaptationDataHandler_ = 0;\n-461 callbackVector.release();\n-462\n-463 postAdapt();\n-464 return refined;\n-465 }\n-466\n+459\n+460 template< int codim, class GridImp, bool leafIterator >\n+461 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n+462 ::goNext ( ElementInfo &elementInfo )\n+463 {\n+464 std::integral_constant< int, codim > codimVariable;\n+465 goNext( codimVariable, elementInfo );\n+466 }\n 467\n-468 template< int dim, int dimworld >\n-469 inline const Alberta::GlobalVector &\n-470 AlbertaGrid<_dim,_dimworld_>\n-471_::getCoord ( const ElementInfo &elementInfo, int vertex ) const\n+468 template< int codim, class GridImp, bool leafIterator >\n+469 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n+470 ::goNext ( const std::integral_constant< int, 0 > /* cdVariable */,\n+471 ElementInfo &elementInfo )\n 472 {\n-473 assert( (vertex >= 0) && (vertex <= dim) );\n-474#if DUNE_ALBERTA_CACHE_COORDINATES\n-475 return coordCache_( elementInfo, vertex );\n-476#else\n-477 return elementInfo.coordinate( vertex );\n-478#endif\n-479 }\n-480\n-481\n-482 template < int dim, int dimworld >\n-483 inline int AlbertaGrid_<_dim,_dimworld_>::maxLevel() const\n-484 {\n-485 return maxlevel_;\n-486 }\n-487\n-488\n-489 template< int dim, int dimworld >\n-490 inline int AlbertaGrid<_dim,_dimworld_>::size ( int level, int codim )\n-const\n-491 {\n-492 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level,\n-codim ) : 0);\n-493 }\n-494\n+473 assert( stopAtElement( elementInfo ) );\n+474\n+475 nextElement( elementInfo );\n+476 nextElementStop( elementInfo );\n+477 }\n+478\n+479 template< int codim, class GridImp, bool leafIterator >\n+480 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n+481 ::goNext ( const std::integral_constant< int, 1 > cdVariable,\n+482 ElementInfo &elementInfo )\n+483 {\n+484 assert( stopAtElement( elementInfo ) );\n+485\n+486 ++subEntity_;\n+487 if( subEntity_ >= numSubEntities )\n+488 {\n+489 subEntity_ = 0;\n+490 nextElement( elementInfo );\n+491 nextElementStop( elementInfo );\n+492 if( !elementInfo )\n+493 return;\n+494 }\n 495\n-496 template< int dim, int dimworld >\n-497 inline int AlbertaGrid<_dim,_dimworld_>::size ( int level, GeometryType\n-type ) const\n-498 {\n-499 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level, type\n-) : 0);\n-500 }\n-501\n-502\n-503 template< int dim, int dimworld >\n-504 inline int AlbertaGrid<_dim,_dimworld_>::size ( int codim ) const\n-505 {\n-506 assert( sizeCache_.size( codim ) == mesh_.size( codim ) );\n-507 return mesh_.size( codim );\n+496 if( leafIterator )\n+497 {\n+498 const int face = (dimension == 1 ? (numSubEntities-1)-subEntity_ :\n+subEntity_);\n+499\n+500 const ALBERTA EL *neighbor = elementInfo.elInfo().neigh[ face ];\n+501 if( (neighbor != NULL) && !elementInfo.isBoundary( face ) )\n+502 {\n+503 // face is reached from element with largest number\n+504 const int elIndex = grid().dofNumbering() ( elementInfo, 0, 0 );\n+505 const int nbIndex = grid().dofNumbering() ( neighbor, 0, 0 );\n+506 if( elIndex < nbIndex )\n+507 goNext( cdVariable, elementInfo );\n 508 }\n-509\n-510\n-511 template< int dim, int dimworld >\n-512 inline int AlbertaGrid<_dim,_dimworld_>::size ( GeometryType type ) const\n+509 // uncomment this assertion only if codimension 1 entities are marked\n+510 // assert( marker_->template subEntityOnElement< 1 >( elementInfo,\n+subEntity_ ) );\n+511 }\n+512 else\n 513 {\n-514 return sizeCache_.size( type );\n-515 }\n-516\n-517\n-518 template < int dim, int dimworld >\n-519 inline const typename AlbertaGrid < dim, dimworld > :: Traits ::\n-LevelIndexSet &\n-520 AlbertaGrid_<_dim,_dimworld_> :: levelIndexSet (int level) const\n-521 {\n-522 // assert that given level is in range\n-523 assert( (level >= 0) && (level < (int)levelIndexVec_.size()) );\n-524\n-525 if( levelIndexVec_[ level ] == 0 )\n-526 {\n-527 levelIndexVec_[ level ] = new typename GridFamily::LevelIndexSetImp\n-( dofNumbering_ );\n-528 levelIndexVec_[ level ]->update( lbegin<_0_>( level ), lend<_0_>( level )\n-);\n-529 }\n-530 return *(levelIndexVec_[ level ]);\n-531 }\n-532\n-533 template < int dim, int dimworld >\n-534 inline const typename AlbertaGrid < dim, dimworld > :: Traits ::\n-LeafIndexSet &\n-535 AlbertaGrid_<_dim,_dimworld_> :: leafIndexSet () const\n-536 {\n-537 if( leafIndexSet_ == 0 )\n-538 {\n-539 leafIndexSet_ = new typename GridFamily::LeafIndexSetImp( dofNumbering_ );\n-540 leafIndexSet_->update( leafbegin<_0_>(), leafend<_0_>() );\n+514 assert( marker_ != 0 );\n+515 if( !marker_->template subEntityOnElement< 1 >( elementInfo, subEntity_ ) )\n+516 goNext( cdVariable, elementInfo );\n+517 }\n+518 }\n+519\n+520 template< int codim, class GridImp, bool leafIterator >\n+521 template< int cd >\n+522 inline void AlbertaGridTreeIterator< codim, GridImp, leafIterator >\n+523 ::goNext ( const std::integral_constant< int, cd > cdVariable,\n+524 ElementInfo &elementInfo )\n+525 {\n+526 assert( stopAtElement( elementInfo ) );\n+527\n+528 ++subEntity_;\n+529 if( subEntity_ >= numSubEntities )\n+530 {\n+531 subEntity_ = 0;\n+532 nextElement( elementInfo );\n+533 nextElementStop( elementInfo );\n+534 if( !elementInfo )\n+535 return;\n+536 }\n+537\n+538 assert( marker_ != 0 );\n+539 if( !marker_->template subEntityOnElement< cd >( elementInfo, subEntity_ )\n+)\n+540 goNext( cdVariable, elementInfo );\n 541 }\n-542 return *leafIndexSet_;\n-543 }\n+542\n+543}\n 544\n-545\n-546 template < int dim, int dimworld >\n-547 inline void AlbertaGrid < dim, dimworld >::calcExtras ()\n-548 {\n-549 // determine new maxlevel\n-550 maxlevel_ = levelProvider_.maxLevel();\n-551 assert( (maxlevel_ >= 0) && (maxlevel_ < MAXL) );\n-552\n-553 // unset up2Dat status, if lbegin is called then this status is updated\n-554 for( int l = 0; l < MAXL; ++l )\n-555 levelMarkerVector_[ l ].clear();\n-556\n-557 // unset up2Dat status, if leafbegin is called then this status is updated\n-558 leafMarkerVector_.clear();\n-559\n-560 sizeCache_.reset();\n-561\n-562 // update index sets (if they exist)\n-563 if( leafIndexSet_ != 0 )\n-564 leafIndexSet_->update( leafbegin<_0_>(), leafend<_0_>() );\n-565 for( unsigned int level = 0; level < levelIndexVec_.size(); ++level )\n-566 {\n-567 if( levelIndexVec_[ level ] )\n-568 levelIndexVec_[ level ]->update( lbegin<_0_>( level ), lend<_0_>( level )\n-);\n-569 }\n-570 }\n-571\n-572\n-573 template< int dim, int dimworld >\n-574 inline bool AlbertaGrid<_dim,_dimworld_>\n-575_::writeGrid ( const std::string &filename, ctype time ) const\n-576 {\n-577 if( filename.size() <= 0 )\n-578 DUNE_THROW( AlbertaIOError, \"No filename given to writeGridXdr.\" );\n-579 return (mesh_.write( filename, time ) && hIndexSet_.write( filename ));\n-580 }\n-581\n-582\n-583 template< int dim, int dimworld >\n-584 inline bool AlbertaGrid<_dim,_dimworld_>\n-585_::readGrid ( const std::string &filename, ctype &time )\n-586 {\n-587 //removeMesh();\n-588\n-589 if( filename.size() <= 0 )\n-590 return false;\n-591\n-592 numBoundarySegments_ = mesh_.read( filename, time );\n-593 if( !mesh_ )\n-594 DUNE_THROW( AlbertaIOError, \"Could not read grid file: \" << filename << \".\"\n-);\n-595\n-596 setup();\n-597 hIndexSet_.read( filename );\n-598\n-599 // calc maxlevel and indexOnLevel and so on\n-600 calcExtras();\n-601\n-602 return true;\n-603 }\n-604\n-605\n-606 // AlbertaGrid::AdaptationCallback\n-607 // -------------------------------\n-608\n-609 template< int dim, int dimworld >\n-610 template< class DataHandler >\n-611 struct AlbertaGrid< dim, dimworld >::AdaptationCallback\n-612 {\n-613 static const int dimension = dim;\n-614\n-615 typedef Alberta::DofVectorPointer<_Alberta::GlobalVector_>\n-DofVectorPointer;\n-616 typedef Alberta::Patch<_dimension_> Patch;\n-617\n-618 static DataHandler &getDataHandler ( const DofVectorPointer &dofVector )\n-619 {\n-620 DataHandler *dataHandler;\n-621 if( DofVectorPointer::supportsAdaptationData )\n-622 dataHandler = dofVector.getAdaptationData< DataHandler >();\n-623 else\n-624 dataHandler = (DataHandler *)Alberta::adaptationDataHandler_;\n-625 assert( dataHandler != 0 );\n-626 return *dataHandler;\n-627 }\n-628\n-629 static void interpolateVector ( const DofVectorPointer &dofVector,\n-630 const Patch &patch )\n-631 {\n-632 DataHandler &dataHandler = getDataHandler( dofVector );\n-633 for( int i = 0; i < patch.count(); ++i )\n-634 dataHandler.prolongLocal( patch, i );\n-635 }\n-636\n-637 static void restrictVector ( const DofVectorPointer &dofVector,\n-638 const Patch &patch )\n-639 {\n-640 DataHandler &dataHandler = getDataHandler( dofVector );\n-641 for( int i = 0; i < patch.count(); ++i )\n-642 dataHandler.restrictLocal( patch, i );\n-643 }\n-644 };\n-645\n-646} // namespace Dune\n-647\n-648#endif\n-entity.cc\n-intersection.cc\n-geometry.cc\n+545#endif // #if HAVE_ALBERTA\n+546\n+547#endif // #ifndef DUNE_ALBERTA_TREEITERATOR_HH\n+meshpointer.hh\n+provides a wrapper for ALBERTA's mesh structure\n+elementinfo.hh\n+provides a wrapper for ALBERTA's el_info structure\n+ALBERTA\n+#define ALBERTA\n+Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::checkAlbertaDimensions\n-static void checkAlbertaDimensions()\n-Definition albertagrid.cc:29\n-Dune::Alberta::dimWorld\n-static const int dimWorld\n-Definition misc.hh:46\n-Dune::Alberta::adaptationDataHandler_\n-static void * adaptationDataHandler_\n-Definition albertagrid.cc:24\n-Dune::Alberta::GlobalVector\n-ALBERTA REAL_D GlobalVector\n-Definition misc.hh:50\n-Dune::AlbertaGrid\n-[ provides Dune::Grid ]\n-Definition agrid.hh:109\n-Dune::AlbertaGrid::typeName\n-static std::string typeName()\n-Definition agrid.hh:410\n-Dune::AlbertaGrid::ctype\n-GridFamily::ctype ctype\n-Definition agrid.hh:143\n-Dune::Alberta::AdaptRestrictProlongHandler\n-Definition albertagrid/datahandle.hh:27\n-Dune::Alberta::MeshPointer::create\n-unsigned int create(const MacroData< dim > ¯oData)\n-Definition meshpointer.hh:299\n-Dune::Alberta::DofVectorPointer\n-Definition dofvector.hh:179\n+Dune::AlbertaGrid<_dim,_dimworld_>\n+Dune::AlbertaGrid<_dim,_dimworld_>::dimension\n+static const int dimension\n+Definition agrid.hh:145\n+Dune::Alberta::MeshPointer<_dimension_>\n+Dune::Alberta::HierarchyDofNumbering<_dimension_>\n+Dune::Alberta::HierarchyDofNumbering::size\n+int size(int codim) const\n+Definition dofadmin.hh:163\n Dune::Alberta::ElementInfo<_dimension_>\n-Dune::Alberta::ElementInfo::coordinate\n-const GlobalVector & coordinate(int vertex) const\n-Definition elementinfo.hh:685\n-Dune::AlbertaGridHierarchicIndexSet::create\n-void create()\n-Definition indexsets.cc:133\n-Dune::AlbertaGridIndexSet\n-Definition albertagrid/indexsets.hh:329\n-Dune::AlbertaGridFamily::Traits\n-Definition albertagrid/gridfamily.hh:98\n-Dune::AlbertaGridFamily::Traits::Codim\n-Definition albertagrid/gridfamily.hh:117\n-Dune::Alberta::MacroData\n-Definition macrodata.hh:30\n-Dune::AlbertaError\n-Definition misc.hh:32\n-Dune::AlbertaIOError\n-Definition misc.hh:36\n-Dune::Alberta::ProjectionFactoryInterface\n-Definition albertagrid/projection.hh:80\n-Dune::Alberta::DuneGlobalBoundaryProjectionFactory\n-Definition albertagrid/projection.hh:163\n-Dune::Alberta::Patch\n-Definition refinement.hh:40\n+Dune::AlbertaGridTreeIterator\n+Definition treeiterator.hh:189\n+Dune::AlbertaGridTreeIterator::equals\n+bool equals(const This &other) const\n+equality\n+Definition treeiterator.hh:231\n+Dune::AlbertaGridTreeIterator::EntityObject\n+MakeableInterfaceObject< Entity > EntityObject\n+Definition treeiterator.hh:208\n+Dune::AlbertaGridTreeIterator::MeshPointer\n+Alberta::MeshPointer< dimension > MeshPointer\n+Definition treeiterator.hh:204\n+Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n+AlbertaGridTreeIterator(const GridImp &grid, const MarkerVector *marker, int\n+travLevel)\n+Constructor making begin iterator.\n+Definition treeiterator.hh:352\n+Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n+AlbertaGridTreeIterator(const GridImp &grid, int travLevel)\n+Constructor making end iterator.\n+Definition treeiterator.hh:373\n+Dune::AlbertaGridTreeIterator::EntityImp\n+EntityObject::ImplementationType EntityImp\n+Definition treeiterator.hh:209\n+Dune::AlbertaGridTreeIterator::codimension\n+static const int codimension\n+Definition treeiterator.hh:194\n+Dune::AlbertaGridTreeIterator::MacroIterator\n+MeshPointer::MacroIterator MacroIterator\n+Definition treeiterator.hh:205\n+Dune::AlbertaGridTreeIterator::operator=\n+This & operator=(const This &other)\n+Constructor making end iterator.\n+Definition treeiterator.hh:398\n+Dune::AlbertaGridTreeIterator::dereference\n+Entity & dereference() const\n+dereferencing\n+Definition treeiterator.hh:237\n+Dune::AlbertaGridTreeIterator::MarkerVector\n+AlbertaMarkerVector< dimension, dimensionworld > MarkerVector\n+Definition treeiterator.hh:212\n+Dune::AlbertaGridTreeIterator::Entity\n+GridImp::template Codim< codim >::Entity Entity\n+Definition treeiterator.hh:207\n+Dune::AlbertaGridTreeIterator::level\n+int level() const\n+ask for level of entities\n+Definition treeiterator.hh:243\n+Dune::AlbertaGridTreeIterator::dimensionworld\n+static const int dimensionworld\n+Definition treeiterator.hh:195\n+Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n+AlbertaGridTreeIterator()\n+Definition treeiterator.hh:342\n+Dune::AlbertaGridTreeIterator::increment\n+void increment()\n+increment\n+Definition treeiterator.hh:411\n+Dune::AlbertaGridTreeIterator::grid\n+const GridImp & grid() const\n+obtain a reference to the grid\n+Definition treeiterator.hh:253\n+Dune::AlbertaGridTreeIterator::dimension\n+static const int dimension\n+Definition treeiterator.hh:193\n+Dune::AlbertaGridTreeIterator::AlbertaGridTreeIterator\n+AlbertaGridTreeIterator(const This &other)\n+Constructor making end iterator.\n+Definition treeiterator.hh:386\n+Dune::AlbertaGridTreeIterator::ElementInfo\n+EntityImp::ElementInfo ElementInfo\n+Definition treeiterator.hh:210\n+Dune::Alberta::NumSubEntities\n+Definition misc.hh:148\n Dune::AlbertaMarkerVector\n marker assigning subentities to one element containing them\n Definition treeiterator.hh:35\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n+Dune::AlbertaMarkerVector::AlbertaMarkerVector\n+AlbertaMarkerVector(const DofNumbering &dofNumbering)\n+create AlbertaMarkerVector with empty vectors\n+Definition treeiterator.hh:54\n+Dune::AlbertaMarkerVector::up2Date\n+bool up2Date() const\n+return true if marking is up to date\n+Definition treeiterator.hh:95\n+Dune::AlbertaMarkerVector::subEntityOnElement\n+bool subEntityOnElement(const ElementInfo &elementInfo, int subEntity) const\n+visit subentity on this element?\n+Definition treeiterator.hh:294\n+Dune::AlbertaMarkerVector::markSubEntities\n+void markSubEntities(const Iterator &begin, const Iterator &end)\n+Definition treeiterator.hh:310\n+Dune::AlbertaMarkerVector::~AlbertaMarkerVector\n+~AlbertaMarkerVector()\n+Definition treeiterator.hh:68\n+Dune::AlbertaMarkerVector::clear\n+void clear()\n+Definition treeiterator.hh:84\n+Dune::AlbertaMarkerVector::AlbertaMarkerVector\n+AlbertaMarkerVector(const This &other)\n+Definition treeiterator.hh:61\n+Dune::AlbertaMarkerVector::print\n+void print(std::ostream &out=std::cout) const\n+print for debugin' only\n+Definition treeiterator.hh:319\n+Dune::AlbertaMarkerVector::MarkSubEntities::Codim\n+Definition treeiterator.hh:136\n+Dune::AlbertaMarkerVector::MarkSubEntities::Codim::ElementInfo\n+Alberta::ElementInfo< dimension > ElementInfo\n+Definition treeiterator.hh:139\n+Dune::AlbertaMarkerVector::MarkSubEntities::Codim::apply\n+static void apply(const DofNumbering &dofNumbering, int *(&marker)\n+[dimension+1], const ElementInfo &elementInfo)\n+Definition treeiterator.hh:141\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::MakeableInterfaceObject<_Entity_>\n+Dune::MakeableInterfaceObject<_Entity_>::ImplementationType\n+InterfaceType::Implementation ImplementationType\n+Definition common/grid.hh:1122\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00695.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00695.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macrodata.hh File Reference\n+dune-grid: intersection.cc File Reference\n \n \n \n \n \n \n \n@@ -71,47 +71,56 @@\n \n
    \n
    \n
    \n \n-
    macrodata.hh File Reference
    \n+Namespaces |\n+Macros
    \n+
    intersection.cc File Reference
    \n
    \n
    \n-\n-

    provides a wrapper for ALBERTA's macro_data structure \n-More...

    \n-
    #include <dune/common/fvector.hh>
    \n-#include <dune/common/fmatrix.hh>
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/algebra.hh>
    \n-#include <dune/grid/albertagrid/albertaheader.hh>
    \n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::Alberta::MacroData< dim >
    struct  Dune::AlbertaGridIntersectionBase< Grid >::GlobalCoordReader< GridImp >
     
    struct  Dune::Alberta::MacroData< dim >::Library< int >
    struct  Dune::AlbertaGridIntersectionBase< Grid >::LocalCoordReader< GridImp >
     
    \n \n \n \n \n-\n-\n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+\n+\n+\n

    \n+Macros

    #define DUNE_ALBERTA_INTERSECTION_CC
     
    \n-

    Detailed Description

    \n-

    provides a wrapper for ALBERTA's macro_data structure

    \n-
    Author
    Martin Nolte
    \n-
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_ALBERTA_INTERSECTION_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_ALBERTA_INTERSECTION_CC
    \n+
    \n+\n+
    \n+
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,33 +1,29 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-macrodata.hh File Reference\n-provides a wrapper for ALBERTA's macro_data structure More...\n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Macros\n+intersection.cc File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::Alberta::MacroData<_dim_>\n+struct \u00a0 Dune::AlbertaGridIntersectionBase<_Grid_>::GlobalCoordReader<_GridImp\n+ >\n \u00a0\n-struct \u00a0 Dune::Alberta::MacroData<_dim_>::Library<_int_>\n+struct \u00a0 Dune::AlbertaGridIntersectionBase<_Grid_>::LocalCoordReader<_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::Alberta\n+Macros\n+#define\u00a0 DUNE_ALBERTA_INTERSECTION_CC\n \u00a0\n-***** Detailed Description *****\n-provides a wrapper for ALBERTA's macro_data structure\n- Author\n- Martin Nolte\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_ALBERTA_INTERSECTION_CC *****\n+#define DUNE_ALBERTA_INTERSECTION_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00695_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00695_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macrodata.hh Source File\n+dune-grid: intersection.cc Source File\n \n \n \n \n \n \n \n@@ -74,518 +74,618 @@\n \n \n
    \n
    \n-
    macrodata.hh
    \n+
    intersection.cc
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_MACRODATA_HH
    \n-
    6#define DUNE_ALBERTA_MACRODATA_HH
    \n+
    5#ifndef DUNE_ALBERTA_INTERSECTION_CC
    \n+
    6#define DUNE_ALBERTA_INTERSECTION_CC
    \n
    7
    \n-
    13#include <dune/common/fvector.hh>
    \n-
    14#include <dune/common/fmatrix.hh>
    \n+\n+
    9
    \n+
    10namespace Dune
    \n+
    11{
    \n+
    12
    \n+
    13 // AlbertaGridIntersectionBase
    \n+
    14 // ---------------------------
    \n
    15
    \n-\n-\n-\n-
    19
    \n-
    20#if HAVE_ALBERTA
    \n-
    21
    \n-
    22namespace Dune
    \n-
    23{
    \n-
    24
    \n-
    25 namespace Alberta
    \n-
    26 {
    \n-
    27
    \n-
    28 template< int dim >
    \n-
    \n-\n-
    30 {
    \n-
    31 typedef MacroData< dim > This;
    \n+
    16 template< class Grid >
    \n+
    17 inline AlbertaGridIntersectionBase< Grid >
    \n+
    \n+
    18 ::AlbertaGridIntersectionBase ()
    \n+
    19 : grid_( nullptr ),
    \n+
    20 elementInfo_(),
    \n+
    21 oppVertex_( -1 ) // mark invalid intersection
    \n+
    22 {}
    \n+
    \n+
    23
    \n+
    24 template< class Grid >
    \n+\n+
    \n+
    26 ::AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex )
    \n+
    27 : grid_( &entity.grid() ),
    \n+
    28 elementInfo_( entity.elementInfo() ),
    \n+
    29 oppVertex_( oppVertex )
    \n+
    30 {}
    \n+
    \n+
    31
    \n
    32
    \n-
    33 typedef ALBERTA MACRO_DATA Data;
    \n-
    34
    \n-
    35 static const int dimension = dim;
    \n-
    36 static const int numVertices = NumSubEntities< dimension, dimension >::value;
    \n-
    37 static const int numEdges = NumSubEntities< dimension, dimension-1 >::value;
    \n-
    38
    \n-
    39 static const int initialSize = 4096;
    \n-
    40
    \n-
    41 public:
    \n-
    42 template< int >
    \n-
    43 struct Library;
    \n-
    44
    \n-
    45 template< int > friend struct InstantiateMacroDataLibrary;
    \n-
    46
    \n-
    47 public:
    \n-
    48 typedef int ElementId[ numVertices ];
    \n-
    49
    \n-
    50 static const int supportPeriodicity = 1;
    \n-
    51
    \n-
    \n-\n-
    53 : data_( NULL ),
    \n-
    54 vertexCount_( -1 ),
    \n-
    55 elementCount_( -1 )
    \n-
    56 {}
    \n-
    \n-
    57
    \n-
    \n-
    58 operator Data * () const
    \n-
    59 {
    \n-
    60 return data_;
    \n-
    61 }
    \n-
    \n-
    62
    \n-
    \n-
    63 int vertexCount () const
    \n-
    64 {
    \n-
    65 return (vertexCount_ < 0 ? data_->n_total_vertices : vertexCount_);
    \n-
    66 }
    \n+
    33 template< class Grid >
    \n+
    34 inline typename Grid::template Codim< 0 >::Entity
    \n+
    \n+\n+
    36 {
    \n+\n+
    38 return EntityImp( grid(), elementInfo(), 0 );
    \n+
    39 }
    \n
    \n-
    67
    \n+
    40
    \n+
    41
    \n+
    42 template< class Grid >
    \n+
    \n+\n+
    44 {
    \n+
    45 return elementInfo().isBoundary( oppVertex_ );
    \n+
    46 }
    \n+
    \n+
    47
    \n+
    48
    \n+
    49 template< class Grid >
    \n+
    \n+\n+
    51 {
    \n+
    52 if( boundary() )
    \n+
    53 {
    \n+
    54 const int id = elementInfo().boundaryId( oppVertex_ );
    \n+
    55 assert( id != 0 );
    \n+
    56 return id;
    \n+
    57 }
    \n+
    58 else
    \n+
    59 return 0;
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    \n+\n+
    63 template< class Grid >
    \n+
    \n+\n+
    65 {
    \n+
    \n+
    66 assert( boundary() );
    \n+
    67 const Alberta::BasicNodeProjection *projection = elementInfo().boundaryProjection( oppVertex_ );
    \n
    \n-
    68 int elementCount () const
    \n-
    69 {
    \n-
    70 return (elementCount_ < 0 ? data_->n_macro_elements : elementCount_);
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    \n-
    73 ElementId &element ( int i ) const;
    \n+
    68 assert( projection );
    \n+
    \n+
    69 return projection->boundaryIndex();
    \n+
    70 }
    \n+
    71
    \n+
    \n+\n+
    73 template< class Grid >
    \n
    \n-
    74 GlobalVector &vertex ( int i ) const;
    \n-
    \n-
    75 int &neighbor ( int element, int i ) const;
    \n+\n+
    75 {
    \n
    \n-
    76 BoundaryId &boundaryId ( int element, int i ) const;
    \n-
    77
    \n+
    76 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);
    \n+
    \n+
    77 return grid().alberta2generic( 1, face );
    \n+
    \n+
    78 }
    \n+
    79
    \n+
    \n+\n+
    \n+
    81 template< class Grid >
    \n
    \n-
    82 void create ();
    \n-
    83
    \n-
    \n-
    92 void finalize ();
    \n+
    82 inline GeometryType AlbertaGridIntersectionBase< Grid >::type () const
    \n+
    83 {
    \n+
    84 return GeometryTypes::simplex( dimension-1 );
    \n+
    85 }
    \n+
    \n+
    86
    \n+
    87
    \n+
    \n+
    88 template< class Grid >
    \n+
    \n+\n+
    \n+\n+
    91 {
    \n+
    92 const typename Entity::Geometry geoInside = inside().geometry();
    \n
    93
    \n-
    \n-\n-
    103
    \n-
    \n-
    112 void setOrientation ( const Real orientation );
    \n-
    113
    \n-
    \n-
    124 bool checkNeighbors () const;
    \n-
    125
    \n-
    \n-
    127 void release ()
    \n-
    128 {
    \n-
    129 if( data_ != NULL )
    \n-
    130 {
    \n-
    131 ALBERTA free_macro_data( data_ );
    \n-
    132 data_ = NULL;
    \n-
    133 }
    \n-
    134 vertexCount_ = elementCount_ = -1;
    \n-
    135 }
    \n-
    \n-
    136
    \n-
    \n-
    142 int insertElement ( const ElementId &id );
    \n-
    143
    \n-
    \n-
    149 int insertVertex ( const GlobalVector &coords )
    \n-
    150 {
    \n-
    151 assert( vertexCount_ >= 0 );
    \n-
    152 if( vertexCount_ >= data_->n_total_vertices )
    \n-
    153 resizeVertices( 2*vertexCount_ );
    \n-
    154 copy( coords, vertex( vertexCount_ ) );
    \n-
    155 return vertexCount_++;
    \n-
    156 }
    \n-
    \n+
    94 const int face = indexInInside();
    \n+
    95 auto refSimplex = ReferenceElements< ctype, dimension >::simplex();
    \n+
    96 FieldVector< ctype, dimension > refNormal = refSimplex.integrationOuterNormal( face );
    \n+
    97
    \n+
    98 const typename Entity::Geometry::JacobianInverseTransposed &jInvT
    \n+
    99 = geoInside.impl().jacobianInverseTransposed();
    \n+
    100
    \n+
    101 NormalVector normal;
    \n+
    102 jInvT.mv( refNormal, normal );
    \n+
    103 normal *= geoInside.impl().integrationElement();
    \n+
    104
    \n+
    105 return normal;
    \n+
    106 }
    \n+
    \n+
    107
    \n+
    108 template<>
    \n+\n+
    \n+
    110 AlbertaGridIntersectionBase< const AlbertaGrid< 1, 1 > >::centerIntegrationOuterNormal () const
    \n+
    111 {
    \n+
    112 const Alberta::GlobalVector &oppCoord = grid().getCoord( elementInfo(), oppVertex_ );
    \n+
    113 const Alberta::GlobalVector &myCoord = grid().getCoord( elementInfo(), 1-oppVertex_ );
    \n+
    114 NormalVector n;
    \n+
    115 n[ 0 ] = (myCoord[ 0 ] > oppCoord[ 0 ] ? ctype( 1 ) : -ctype( 1 ));
    \n+
    116 return n;
    \n+
    117 }
    \n+
    \n+
    118
    \n+
    119#if defined GRIDDIM && GRIDDIM > 1
    \n+
    120 template<>
    \n+\n+
    122 AlbertaGridIntersectionBase< const AlbertaGrid< 2, 2 > >::centerIntegrationOuterNormal () const
    \n+
    123 {
    \n+
    124 const Alberta::GlobalVector &coordOne = grid().getCoord( elementInfo(), (oppVertex_+1)%3 );
    \n+
    125 const Alberta::GlobalVector &coordTwo = grid().getCoord( elementInfo(), (oppVertex_+2)%3 );
    \n+
    126
    \n+
    127 NormalVector n;
    \n+
    128 n[ 0 ] = -(coordOne[ 1 ] - coordTwo[ 1 ]);
    \n+
    129 n[ 1 ] = coordOne[ 0 ] - coordTwo[ 0 ];
    \n+
    130 return n;
    \n+
    131 }
    \n+
    132#endif // defined GRIDDIM && GRIDDIM > 1
    \n+
    133
    \n+
    134 template<>
    \n+
    135 inline AlbertaGridIntersectionBase< const AlbertaGrid< 3, 3 > >::NormalVector
    \n+
    \n+
    136 AlbertaGridIntersectionBase< const AlbertaGrid< 3, 3 > >::centerIntegrationOuterNormal () const
    \n+
    137 {
    \n+
    138 // in this case the orientation is negative, multiply by -1
    \n+
    139 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();
    \n+
    140 const ctype val = (elInfo.orientation > 0) ? 1.0 : -1.0;
    \n+
    141
    \n+
    142 static const int faceVertices[ 4 ][ 3 ]
    \n+
    143 = { {1,3,2}, {0,2,3}, {0,3,1}, {0,1,2} };
    \n+
    144 const int *localFaces = faceVertices[ oppVertex_ ];
    \n+
    145
    \n+
    146 const Alberta::GlobalVector &coord0 = grid().getCoord( elementInfo(), localFaces[ 0 ] );
    \n+
    147 const Alberta::GlobalVector &coord1 = grid().getCoord( elementInfo(), localFaces[ 1 ] );
    \n+
    148 const Alberta::GlobalVector &coord2 = grid().getCoord( elementInfo(), localFaces[ 2 ] );
    \n+
    149
    \n+
    150 FieldVector< ctype, dimensionworld > u;
    \n+
    151 FieldVector< ctype, dimensionworld > v;
    \n+
    152 for( int i = 0; i < dimension; ++i )
    \n+
    153 {
    \n+
    154 v[ i ] = coord1[ i ] - coord0[ i ];
    \n+
    155 u[ i ] = coord2[ i ] - coord1[ i ];
    \n+
    156 }
    \n
    157
    \n-
    \n-
    163 int insertVertex ( const FieldVector< Real, dimWorld > &coords )
    \n-
    164 {
    \n-
    165 assert( vertexCount_ >= 0 );
    \n-
    166 if( vertexCount_ >= data_->n_total_vertices )
    \n-
    167 resizeVertices( 2*vertexCount_ );
    \n-
    168 copy( coords, vertex( vertexCount_ ) );
    \n-
    169 return vertexCount_++;
    \n-
    170 }
    \n-
    \n-
    171
    \n-
    \n-
    172 void insertWallTrafo ( const GlobalMatrix &m, const GlobalVector &t );
    \n-
    \n-
    173 void insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld > &matrix,
    \n-
    174 const FieldVector< Real, dimWorld > &shift );
    \n+
    158 NormalVector n;
    \n+
    159 for( int i = 0; i < dimension; ++i )
    \n+
    160 {
    \n+
    161 const int j = (i+1)%dimension;
    \n+
    162 const int k = (i+2)%dimension;
    \n+
    163 n[ i ] = val * (u[ j ] * v[ k ] - u[ k ] * v[ j ]);
    \n+
    164 }
    \n+
    165 return n;
    \n+
    166 }
    \n+
    \n+
    167
    \n+
    168
    \n+
    169 template< class Grid >
    \n+\n+
    \n+\n+
    172 {
    \n+
    173 return centerIntegrationOuterNormal();
    \n+
    174 }
    \n+
    \n
    175
    \n-
    \n-
    176 void checkCycles ();
    \n-
    177
    \n-
    \n-
    178 void read ( const std::string &filename, bool binary = false );
    \n-
    179
    \n-
    \n-
    180 bool write ( const std::string &filename, bool binary = false ) const
    \n-
    181 {
    \n-
    182 if( binary )
    \n-
    183 return ALBERTA write_macro_data_xdr( data_, filename.c_str() );
    \n-
    184 else
    \n-
    185 return ALBERTA write_macro_data( data_, filename.c_str() );
    \n-
    186 }
    \n-
    \n-
    187
    \n-
    188 private:
    \n-
    189 template< class Vector >
    \n-
    190 void copy ( const Vector &x, GlobalVector &y )
    \n-
    191 {
    \n-
    192 for( int i = 0; i < dimWorld; ++i )
    \n-
    193 y[ i ] = x[ i ];
    \n-
    194 }
    \n-
    195
    \n-
    196 void resizeElements ( const int newSize );
    \n-
    197
    \n-
    198 void resizeVertices ( const int newSize )
    \n-
    199 {
    \n-
    200 const int oldSize = data_->n_total_vertices;
    \n-
    201 data_->n_total_vertices = newSize;
    \n-
    202 data_->coords = memReAlloc< GlobalVector >( data_->coords, oldSize, newSize );
    \n-
    203 assert( (data_->coords != NULL) || (newSize == 0) );
    \n-
    204 }
    \n-
    205
    \n-
    206 private:
    \n-
    207 Data *data_;
    \n-
    208 int vertexCount_;
    \n-
    209 int elementCount_;
    \n-
    210 };
    \n-
    211
    \n-
    212
    \n-
    213
    \n-
    214 // MacroData::Library
    \n-
    215 // ------------------
    \n-
    216
    \n-
    217 template< int dim >
    \n-
    218 template< int >
    \n-
    \n-
    219 struct MacroData< dim >::Library
    \n-
    220 {
    \n-\n-
    222
    \n-
    223 static bool checkNeighbors ( const MacroData &macroData );
    \n-
    224 static void markLongestEdge ( MacroData &macroData );
    \n-
    225 static void setOrientation ( [[maybe_unused]] MacroData &macroData,
    \n-
    226 [[maybe_unused]] const Real orientation );
    \n-
    227
    \n-
    228 private:
    \n-
    229 static Real edgeLength ( const MacroData &macroData, const ElementId &e, int edge );
    \n-
    230 static int longestEdge ( const MacroData &macroData, const ElementId &e );
    \n-
    231
    \n-
    232 template< class Type >
    \n-
    233 static void rotate ( Type *array, int i, int shift );
    \n-
    234
    \n-
    235 static void rotate ( MacroData &macroData, int i, int shift );
    \n-
    236 static void swap ( MacroData &macroData, int el, int v1, int v2 );
    \n-
    237 };
    \n+
    176
    \n+
    177 template< class Grid >
    \n+\n+
    \n+\n+
    180 {
    \n+
    181 NormalVector normal = centerOuterNormal();
    \n+
    182 normal *= (1.0 / normal.two_norm());
    \n+
    183 return normal;
    \n+
    184 }
    \n+
    \n+
    185
    \n+
    186
    \n+
    187 template< class Grid >
    \n+\n+
    \n+\n+
    190 {
    \n+
    191 return centerIntegrationOuterNormal();
    \n+
    192 }
    \n+
    \n+
    193
    \n+
    194
    \n+
    195 template< class Grid >
    \n+\n+
    \n+\n+
    198 {
    \n+
    199 return centerOuterNormal();
    \n+
    200 }
    \n+
    \n+
    201
    \n+
    202
    \n+
    203 template< class Grid >
    \n+\n+
    \n+\n+
    206 {
    \n+
    207 return centerUnitOuterNormal();
    \n+
    208 }
    \n+
    \n+
    209
    \n+
    210
    \n+
    211 template< class Grid >
    \n+\n+
    \n+\n+
    214 {
    \n+
    215 return AlbertaTransformation( elementInfo().transformation( oppVertex_ ) );
    \n+
    216 }
    \n+
    \n+
    217
    \n+
    218
    \n+
    219 template< class Grid >
    \n+
    \n+\n+
    221 {
    \n+
    222 return *grid_;
    \n+
    223 }
    \n+
    \n+
    224
    \n+
    225
    \n+
    226 template< class Grid >
    \n+\n+
    \n+\n+
    229 {
    \n+
    230 assert( !!elementInfo_ );
    \n+
    231 return elementInfo_;
    \n+
    232 }
    \n
    \n+
    \n+
    233
    \n+
    234
    \n+
    235
    \n+
    236 // AlbertaGridIntersectionBase::GlobalCoordReader
    \n+
    237 // ----------------------------------------------
    \n
    238
    \n-
    239
    \n-
    240
    \n-
    241 // Implementation of MacroData
    \n-
    242 // ---------------------------
    \n+
    239 template< class GridImp >
    \n+
    \n+\n+
    241 {
    \n+
    242 typedef typename std::remove_const< GridImp >::type Grid;
    \n
    243
    \n-
    244 template< int dim >
    \n-
    245 inline typename MacroData< dim >::ElementId &
    \n-
    \n-\n-
    247 {
    \n-
    248 assert( (i >= 0) && (i < data_->n_macro_elements) );
    \n-
    249 const int offset = i * numVertices;
    \n-
    250 return *reinterpret_cast< ElementId * >( data_->mel_vertices + offset );
    \n-
    251 }
    \n-
    \n-
    252
    \n+
    244 static const int dimension = Grid::dimension;
    \n+
    245 static const int codimension = 1;
    \n+
    246 static const int mydimension = dimension - codimension;
    \n+
    247 static const int coorddimension = Grid::dimensionworld;
    \n+
    248
    \n+\n+
    250
    \n+\n+
    252 typedef FieldVector< ctype, coorddimension > Coordinate;
    \n
    253
    \n-
    254 template< int dim >
    \n-
    \n-\n-
    256 {
    \n-
    257 assert( (i >= 0) && (i < data_->n_total_vertices) );
    \n-
    258 return data_->coords[ i ];
    \n-
    259 }
    \n-
    \n-
    260
    \n-
    261
    \n-
    262 template< int dim >
    \n-
    \n-
    263 inline int &MacroData< dim >::neighbor ( int element, int i ) const
    \n-
    264 {
    \n-
    265 assert( (element >= 0) && (element < data_->n_macro_elements) );
    \n-
    266 assert( (i >= 0) && (i < numVertices) );
    \n-
    267 return data_->neigh[ element*numVertices + i ];
    \n-
    268 }
    \n+
    254 private:
    \n+
    255 const Grid &grid_;
    \n+\n+
    257 const int subEntity_;
    \n+
    258 const int twist_;
    \n+
    259
    \n+
    260 public:
    \n+
    \n+
    261 GlobalCoordReader ( const GridImp &grid,
    \n+\n+
    263 int subEntity )
    \n+
    264 : grid_( grid ),
    \n+\n+
    266 subEntity_( subEntity ),
    \n+
    267 twist_( elementInfo.template twist< codimension >( subEntity ) )
    \n+
    268 {}
    \n
    \n
    269
    \n-
    270
    \n-
    271 template< int dim >
    \n-
    \n-
    272 inline BoundaryId &MacroData< dim >::boundaryId ( int element, int i ) const
    \n-
    273 {
    \n-
    274 assert( (element >= 0) && (element < data_->n_macro_elements) );
    \n-
    275 assert( (i >= 0) && (i < numVertices) );
    \n-
    276 return data_->boundary[ element*numVertices + i ];
    \n-
    277 }
    \n-
    \n-
    278
    \n-
    279
    \n-
    280 template< int dim >
    \n-
    \n-\n-
    282 {
    \n-
    283 release();
    \n-
    284 data_ = ALBERTA alloc_macro_data( dim, initialSize, initialSize );
    \n-
    285 data_->boundary = memAlloc< BoundaryId >( initialSize*numVertices );
    \n-
    286 if( dim == 3 )
    \n-
    287 data_->el_type = memAlloc< ElementType >( initialSize );
    \n-
    288 vertexCount_ = elementCount_ = 0;
    \n-
    289 elementCount_ = 0;
    \n-
    290 }
    \n+
    \n+
    270 void coordinate ( int i, Coordinate &x ) const
    \n+
    271 {
    \n+
    272 assert( !elementInfo_ == false );
    \n+
    273 assert( (i >= 0) && (i <= mydimension) );
    \n+
    274
    \n+
    275 const int ti = Alberta::applyInverseTwist< mydimension >( twist_, i );
    \n+
    276 const int k = mapVertices( subEntity_, ti );
    \n+
    277 const Alberta::GlobalVector &coord = grid_.getCoord( elementInfo_, k );
    \n+
    278 for( int j = 0; j < coorddimension; ++j )
    \n+
    279 x[ j ] = coord[ j ];
    \n+
    280 }
    \n+
    \n+
    281
    \n+
    \n+
    282 bool hasDeterminant () const
    \n+
    283 {
    \n+
    284 return false;
    \n+
    285 }
    \n+
    \n+
    286
    \n+
    \n+\n+
    288 {
    \n+
    289 assert( false );
    \n+
    290 return ctype( 0 );
    \n+
    291 }
    \n
    \n-
    291
    \n
    292
    \n-
    293 template< int dim >
    \n-
    \n-\n+
    293 private:
    \n+
    294 static int mapVertices ( int subEntity, int i )
    \n
    295 {
    \n-
    296 if( (vertexCount_ >= 0) && (elementCount_ >= 0) )
    \n-
    297 {
    \n-
    298 resizeVertices( vertexCount_ );
    \n-
    299 resizeElements( elementCount_ );
    \n-
    300 ALBERTA compute_neigh_fast( data_ );
    \n+\n+
    297 }
    \n+
    298 };
    \n+
    \n+
    299
    \n+
    300
    \n
    301
    \n-
    302 // assign default boundary id (if none is assigned)
    \n-
    303 for( int element = 0; element < elementCount_; ++element )
    \n-
    304 {
    \n-
    305 for( int i = 0; i < numVertices; ++i )
    \n-
    306 {
    \n-
    307 BoundaryId &id = boundaryId( element, i );
    \n-
    308 if( neighbor( element, i ) >= 0 )
    \n-
    309 {
    \n-
    310 assert( id == InteriorBoundary );
    \n-
    311 id = InteriorBoundary;
    \n-
    312 }
    \n-
    313 else
    \n-
    314 id = (id == InteriorBoundary ? DirichletBoundary : id);
    \n-
    315 }
    \n-
    316 }
    \n+
    302
    \n+
    303 // AlbertaGridIntersectionBase::LocalCoordReader
    \n+
    304 // ---------------------------------------------
    \n+
    305
    \n+
    306 template< class GridImp >
    \n+
    \n+\n+
    308 {
    \n+
    309 typedef typename std::remove_const< GridImp >::type Grid;
    \n+
    310
    \n+
    311 static const int dimension = Grid::dimension;
    \n+
    312 static const int codimension = 1;
    \n+
    313 static const int mydimension = dimension - codimension;
    \n+
    314 static const int coorddimension = dimension;
    \n+
    315
    \n+\n
    317
    \n-
    318 vertexCount_ = elementCount_ = -1;
    \n-
    319 }
    \n-
    320 assert( (vertexCount_ < 0) && (elementCount_ < 0) );
    \n-
    321 }
    \n-
    \n+
    318 typedef FieldVector< ctype, coorddimension > Coordinate;
    \n+
    319
    \n+
    320 typedef typename Grid::template Codim< 0 >::Geometry ElementGeometry;
    \n+
    321 typedef typename Grid::template Codim< 1 >::Geometry FaceGeometry;
    \n
    322
    \n-
    323
    \n-
    324 template< int dim >
    \n-
    \n-\n-
    326 {
    \n-\n-
    328 }
    \n-
    \n-
    329
    \n-
    330
    \n-
    331 template< int dim >
    \n-
    \n-
    332 inline void MacroData< dim >::setOrientation ( const Real orientation )
    \n-
    333 {
    \n-
    334 Library< dimWorld >::setOrientation( *this, orientation );
    \n-
    335 }
    \n-
    \n-
    336
    \n-
    337
    \n-
    338 template< int dim >
    \n+
    323 private:
    \n+
    324 const ElementGeometry &elementGeometry_;
    \n+
    325 const FaceGeometry &faceGeometry_;
    \n+
    326
    \n+
    327 public:
    \n+
    \n+
    328 LocalCoordReader ( const ElementGeometry &elementGeometry,
    \n+
    329 const FaceGeometry &faceGeometry )
    \n+
    330 : elementGeometry_( elementGeometry ),
    \n+
    331 faceGeometry_( faceGeometry )
    \n+
    332 {}
    \n+
    \n+
    333
    \n+
    \n+
    334 void coordinate ( int i, Coordinate &x ) const
    \n+
    335 {
    \n+
    336 x = elementGeometry_.local( faceGeometry_.corner( i ) );
    \n+
    337 }
    \n+
    \n+
    338
    \n
    \n-\n+
    339 bool hasDeterminant () const
    \n
    340 {
    \n-\n+
    341 return false;
    \n
    342 }
    \n
    \n
    343
    \n-
    344
    \n-
    345 template< int dim >
    \n-
    \n-
    346 inline int MacroData< dim >::insertElement ( const ElementId &id )
    \n-
    347 {
    \n-
    348 assert( elementCount_ >= 0 );
    \n-
    349 if( elementCount_ >= data_->n_macro_elements )
    \n-
    350 resizeElements( 2*elementCount_ );
    \n+
    \n+\n+
    345 {
    \n+
    346 return ctype( 0 );
    \n+
    347 }
    \n+
    \n+
    348 };
    \n+
    \n+
    349
    \n+
    350
    \n
    351
    \n-
    352 ElementId &e = element( elementCount_ );
    \n-
    353 for( int i = 0; i < numVertices; ++i )
    \n-
    354 {
    \n-
    355 e[ i ] = id[ i ];
    \n-
    356 boundaryId( elementCount_, i ) = InteriorBoundary;
    \n-
    357 }
    \n-
    358 if( dim == 3 )
    \n-
    359 data_->el_type[ elementCount_ ] = 0;
    \n-
    360
    \n-
    361 return elementCount_++;
    \n-
    362 }
    \n-
    \n-
    363
    \n-
    364
    \n-
    365 template< int dim >
    \n-
    366 inline void MacroData< dim >
    \n-
    \n-
    367 ::insertWallTrafo ( const GlobalMatrix &matrix, const GlobalVector &shift )
    \n-
    368 {
    \n-
    369 int &count = data_->n_wall_trafos;
    \n-
    370 AffineTransformation *&array = data_->wall_trafos;
    \n-
    371
    \n-
    372 // resize wall trafo array
    \n-
    373 array = memReAlloc< AffineTransformation >( array, count, count+1 );
    \n-
    374 assert( data_->wall_trafos != NULL );
    \n+
    352 // AlbertaGridLeafIntersection
    \n+
    353 // ---------------------------
    \n+
    354
    \n+
    355 template< class GridImp >
    \n+
    \n+\n+
    357 {
    \n+
    358 assert( oppVertex_ <= dimension );
    \n+
    359 ++oppVertex_;
    \n+
    360 neighborInfo_ = ElementInfo();
    \n+
    361 }
    \n+
    \n+
    362
    \n+
    363 template< class GridImp >
    \n+
    364 inline typename GridImp::template Codim< 0 >::Entity
    \n+
    \n+\n+
    366 {
    \n+\n+
    368
    \n+
    369 if( !neighborInfo_ )
    \n+
    370 {
    \n+
    371 assert( neighbor() );
    \n+
    372
    \n+
    373 neighborInfo_ = elementInfo().leafNeighbor( oppVertex_ );
    \n+
    374 }
    \n
    375
    \n-
    376 // copy matrix and shift
    \n-
    377 for( int i = 0; i < dimWorld; ++i )
    \n-
    378 copy( matrix[ i ], array[ count ].M[ i ] );
    \n-
    379 copy( shift, array[ count ].t );
    \n-
    380 ++count;
    \n-
    381 }
    \n-
    \n-
    382
    \n-
    383 template< int dim >
    \n-
    384 inline void MacroData< dim >
    \n-
    \n-
    385 ::insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld > &matrix,
    \n-
    386 const FieldVector< Real, dimWorld > &shift )
    \n-
    387 {
    \n-
    388 int &count = data_->n_wall_trafos;
    \n-
    389 AffineTransformation *&array = data_->wall_trafos;
    \n-
    390
    \n-
    391 // resize wall trafo array
    \n-
    392 array = memReAlloc< AffineTransformation >( array, count, count+1 );
    \n-
    393 assert( data_->wall_trafos != NULL );
    \n-
    394
    \n-
    395 // copy matrix and shift
    \n-
    396 for( int i = 0; i < dimWorld; ++i )
    \n-
    397 copy( matrix[ i ], array[ count ].M[ i ] );
    \n-
    398 copy( shift, array[ count ].t );
    \n-
    399 ++count;
    \n-
    400 }
    \n-
    \n-
    401
    \n-
    402
    \n-
    403 template< int dim >
    \n-
    \n-\n-
    405 {
    \n-
    406 // ensure that the macro data has been finalized
    \n-
    407 finalize();
    \n-
    408 ALBERTA macro_test( data_, NULL );
    \n-
    409 }
    \n-
    \n-
    410
    \n-
    411
    \n-
    412 template< int dim >
    \n-
    \n-
    413 inline void MacroData< dim >::read ( const std::string &filename, bool binary )
    \n-
    414 {
    \n-
    415 release();
    \n-
    416 if( binary )
    \n-
    417 data_ = ALBERTA read_macro_xdr( filename.c_str() );
    \n-
    418 else
    \n-
    419 data_ = ALBERTA read_macro( filename.c_str() );
    \n-
    420 }
    \n-
    \n-
    \n-
    421
    \n-
    422
    \n-
    423 template< int dim >
    \n-
    424 inline void MacroData< dim >::resizeElements ( const int newSize )
    \n-
    425 {
    \n-
    426 const int oldSize = data_->n_macro_elements;
    \n-
    427 data_->n_macro_elements = newSize;
    \n-
    428 data_->mel_vertices = memReAlloc( data_->mel_vertices, oldSize*numVertices, newSize*numVertices );
    \n-
    429 data_->boundary = memReAlloc( data_->boundary, oldSize*numVertices, newSize*numVertices );
    \n-
    430 if( dim == 3 )
    \n-
    431 data_->el_type = memReAlloc( data_->el_type, oldSize, newSize );
    \n-
    432 assert( (newSize == 0) || (data_->mel_vertices != NULL) );
    \n-
    433 }
    \n-
    434
    \n-
    435 }
    \n-
    436
    \n-
    437}
    \n-
    438
    \n-
    439#endif // #if HAVE_ALBERTA
    \n-
    440
    \n-
    441#endif
    \n-
    \n+
    376 assert( !neighborInfo_ == false );
    \n+
    377 assert( neighborInfo_.el() != NULL );
    \n+
    378 return EntityImp( grid(), neighborInfo_, 0 );
    \n+
    379 }
    \n+
    \n+
    380
    \n+
    381 template< class GridImp >
    \n+
    \n+\n+
    383 {
    \n+
    384 assert( oppVertex_ <= dimension );
    \n+
    385 return elementInfo().hasLeafNeighbor( oppVertex_ );
    \n+
    386 }
    \n+
    \n+
    387
    \n+
    388
    \n+
    389 template< class GridImp >
    \n+\n+
    \n+\n+
    392 {
    \n+
    393 typedef AlbertaGridLocalGeometryProvider< GridImp > LocalGeoProvider;
    \n+
    394 const int twist = elementInfo().template twist< 1 >( oppVertex_ );
    \n+
    395 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);
    \n+
    396 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face, twist ) );
    \n+
    397 }
    \n+
    \n+
    398
    \n+
    399
    \n+
    400 template< class GridImp >
    \n+\n+
    \n+\n+
    403 {
    \n+
    404 assert( neighbor() );
    \n+
    405
    \n+
    406 typedef AlbertaGridLocalGeometryProvider< GridImp > LocalGeoProvider;
    \n+
    407 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();
    \n+
    408 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];
    \n+
    409 const int twist = elementInfo().twistInNeighbor( oppVertex_ );
    \n+
    410 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);
    \n+
    411 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face, twist ) );
    \n+
    412 }
    \n+
    \n+
    413
    \n+
    414
    \n+
    415 template< class GridImp >
    \n+\n+
    \n+\n+
    418 {
    \n+
    419 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);
    \n+
    420 const GlobalCoordReader coordReader( grid(), elementInfo(), face );
    \n+
    421 return Geometry( GeometryImpl( coordReader ) );
    \n+
    422 }
    \n+
    \n+
    423
    \n+
    424
    \n+
    425 template< class GridImp >
    \n+
    \n+\n+
    427 {
    \n+
    428 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();
    \n+
    429 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];
    \n+
    430 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);
    \n+
    431 return grid().alberta2generic( 1, face );
    \n+
    432 }
    \n+
    \n+
    433
    \n+
    434} // namespace Dune
    \n+
    435
    \n+
    436#endif // #ifndef DUNE_ALBERTA_INTERSECTION_CC
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n-\n-\n-\n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA REAL_DD GlobalMatrix
    Definition misc.hh:51
    \n-
    ALBERTA AFF_TRAFO AffineTransformation
    Definition misc.hh:52
    \n-
    ALBERTA BNDRY_TYPE BoundaryId
    Definition misc.hh:61
    \n-
    static const int InteriorBoundary
    Definition misc.hh:59
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n-
    Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)
    Definition misc.hh:85
    \n-
    static const int DirichletBoundary
    Definition misc.hh:60
    \n-
    static const int dimWorld
    Definition misc.hh:46
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    Definition macrodata.hh:30
    \n-
    friend struct InstantiateMacroDataLibrary
    Definition macrodata.hh:45
    \n-
    BoundaryId & boundaryId(int element, int i) const
    Definition macrodata.hh:272
    \n-
    int insertVertex(const GlobalVector &coords)
    insert vertex
    Definition macrodata.hh:149
    \n-
    int ElementId[numVertices]
    Definition macrodata.hh:48
    \n-
    static const int supportPeriodicity
    Definition macrodata.hh:50
    \n-
    void release()
    release the macro data structure
    Definition macrodata.hh:127
    \n-
    int elementCount() const
    Definition macrodata.hh:68
    \n-
    GlobalVector & vertex(int i) const
    Definition macrodata.hh:255
    \n-
    int vertexCount() const
    Definition macrodata.hh:63
    \n-
    void markLongestEdge()
    mark the longest edge of all elements as refinement edges
    Definition macrodata.hh:325
    \n-
    int insertVertex(const FieldVector< Real, dimWorld > &coords)
    insert vertex
    Definition macrodata.hh:163
    \n-
    bool checkNeighbors() const
    check the neighbor information
    Definition macrodata.hh:339
    \n-
    void insertWallTrafo(const FieldMatrix< Real, dimWorld, dimWorld > &matrix, const FieldVector< Real, dimWorld > &shift)
    Definition macrodata.hh:385
    \n-
    ElementId & element(int i) const
    Definition macrodata.hh:246
    \n-
    void checkCycles()
    Definition macrodata.hh:404
    \n-
    int & neighbor(int element, int i) const
    Definition macrodata.hh:263
    \n-
    MacroData()
    Definition macrodata.hh:52
    \n-
    void finalize()
    compress macro data structure
    Definition macrodata.hh:294
    \n-
    void insertWallTrafo(const GlobalMatrix &m, const GlobalVector &t)
    Definition macrodata.hh:367
    \n-
    void setOrientation(const Real orientation)
    set the orientation of all elements
    Definition macrodata.hh:332
    \n-
    void create()
    create a new macro data structure
    Definition macrodata.hh:281
    \n-
    int insertElement(const ElementId &id)
    insert element
    Definition macrodata.hh:346
    \n-
    bool write(const std::string &filename, bool binary=false) const
    Definition macrodata.hh:180
    \n-
    void read(const std::string &filename, bool binary=false)
    Definition macrodata.hh:413
    \n-
    Definition macrodata.hh:220
    \n-
    static void markLongestEdge(MacroData &macroData)
    \n-
    Alberta::MacroData< dim > MacroData
    Definition macrodata.hh:221
    \n-
    Definition misc.hh:148
    \n+\n+
    LocalGeometry geometryInOutside() const
    Definition intersection.cc:402
    \n+
    GridImp::template Codim< 0 >::Entity outside() const
    Definition intersection.cc:365
    \n+
    void next()
    Definition intersection.cc:356
    \n+
    Base::GeometryImpl GeometryImpl
    Definition albertagrid/intersection.hh:130
    \n+
    int indexInOutside() const
    Definition intersection.cc:426
    \n+
    LocalGeometry geometryInInside() const
    Definition intersection.cc:391
    \n+
    Base::GlobalCoordReader GlobalCoordReader
    Definition albertagrid/intersection.hh:133
    \n+
    Base::Geometry Geometry
    Definition albertagrid/intersection.hh:122
    \n+
    Geometry geometry() const
    Definition intersection.cc:417
    \n+
    bool neighbor() const
    Definition intersection.cc:382
    \n+
    Base::LocalGeometry LocalGeometry
    Definition albertagrid/intersection.hh:123
    \n+
    Definition albertagrid/entity.hh:46
    \n+
    Definition albertagrid/geometry.hh:504
    \n+\n+
    FieldVector< ctype, coorddimension > Coordinate
    Definition intersection.cc:252
    \n+
    Alberta::Real ctype
    Definition intersection.cc:249
    \n+
    std::remove_const< GridImp >::type Grid
    Definition intersection.cc:242
    \n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition intersection.cc:251
    \n+
    ctype determinant() const
    Definition intersection.cc:287
    \n+
    bool hasDeterminant() const
    Definition intersection.cc:282
    \n+
    GlobalCoordReader(const GridImp &grid, const ElementInfo &elementInfo, int subEntity)
    Definition intersection.cc:261
    \n+
    void coordinate(int i, Coordinate &x) const
    Definition intersection.cc:270
    \n+\n+
    Grid::template Codim< 1 >::Geometry FaceGeometry
    Definition intersection.cc:321
    \n+
    Alberta::Real ctype
    Definition intersection.cc:316
    \n+
    LocalCoordReader(const ElementGeometry &elementGeometry, const FaceGeometry &faceGeometry)
    Definition intersection.cc:328
    \n+
    std::remove_const< GridImp >::type Grid
    Definition intersection.cc:309
    \n+
    void coordinate(int i, Coordinate &x) const
    Definition intersection.cc:334
    \n+
    bool hasDeterminant() const
    Definition intersection.cc:339
    \n+
    ctype determinant() const
    Definition intersection.cc:344
    \n+
    FieldVector< ctype, coorddimension > Coordinate
    Definition intersection.cc:318
    \n+
    Grid::template Codim< 0 >::Geometry ElementGeometry
    Definition intersection.cc:320
    \n+
    Definition albertagrid/intersection.hh:32
    \n+
    NormalVector centerOuterNormal() const
    Definition intersection.cc:171
    \n+
    const ElementInfo & elementInfo() const
    Definition intersection.cc:228
    \n+
    FieldVector< ctype, dimensionworld > NormalVector
    Definition albertagrid/intersection.hh:41
    \n+
    NormalVector centerIntegrationOuterNormal() const
    Definition intersection.cc:90
    \n+
    Grid::ctype ctype
    Definition albertagrid/intersection.hh:36
    \n+
    NormalVector integrationOuterNormal(const LocalCoordType &local) const
    Definition intersection.cc:189
    \n+
    ElementInfo elementInfo_
    Definition albertagrid/intersection.hh:93
    \n+
    FieldVector< ctype, dimension-1 > LocalCoordType
    Definition albertagrid/intersection.hh:42
    \n+
    NormalVector centerUnitOuterNormal() const
    Definition intersection.cc:179
    \n+
    int indexInInside() const
    Definition intersection.cc:74
    \n+
    Entity inside() const
    Definition intersection.cc:35
    \n+
    NormalVector unitOuterNormal(const LocalCoordType &local) const
    Definition intersection.cc:205
    \n+
    const Grid & grid() const
    Definition intersection.cc:220
    \n+
    static const int dimension
    Definition albertagrid/intersection.hh:38
    \n+
    bool boundary() const
    Definition intersection.cc:43
    \n+
    size_t boundarySegmentIndex() const
    Definition intersection.cc:64
    \n+
    GeometryType type() const
    Definition intersection.cc:82
    \n+
    AlbertaTransformation transformation() const
    Definition intersection.cc:213
    \n+
    NormalVector outerNormal(const LocalCoordType &local) const
    Definition intersection.cc:197
    \n+
    int boundaryId() const
    Definition intersection.cc:50
    \n+
    const Grid * grid_
    Definition albertagrid/intersection.hh:92
    \n+
    Definition misc.hh:443
    \n+
    Definition albertagrid/projection.hh:208
    \n+
    unsigned int boundaryIndex() const
    Definition albertagrid/projection.hh:218
    \n+
    Definition transformation.hh:18
    \n+
    GridImp::template Codim< cd >::Geometry Geometry
    The corresponding geometry type.
    Definition common/entity.hh:100
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,531 +1,671 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-macrodata.hh\n+intersection.cc\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_MACRODATA_HH\n-6#define DUNE_ALBERTA_MACRODATA_HH\n+5#ifndef DUNE_ALBERTA_INTERSECTION_CC\n+6#define DUNE_ALBERTA_INTERSECTION_CC\n 7\n-13#include \n-14#include \n+8#include \n+9\n+10namespace Dune\n+11{\n+12\n+13 // AlbertaGridIntersectionBase\n+14 // ---------------------------\n 15\n-16#include \n-17#include \n-18#include \n-19\n-20#if HAVE_ALBERTA\n-21\n-22namespace Dune\n-23{\n-24\n-25 namespace Alberta\n-26 {\n-27\n-28 template< int dim >\n-29 class MacroData\n-30 {\n-31 typedef MacroData<_dim_> This;\n+16 template< class Grid >\n+17 inline AlbertaGridIntersectionBase< Grid >\n+18 ::AlbertaGridIntersectionBase ()\n+19 : grid_( nullptr ),\n+20 elementInfo_(),\n+21 oppVertex_( -1 ) // mark invalid intersection\n+22 {}\n+23\n+24 template< class Grid >\n+25 inline AlbertaGridIntersectionBase<_Grid_>\n+26_::AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex\n+)\n+27 : grid_( &entity.grid() ),\n+28 elementInfo_( entity.elementInfo() ),\n+29 oppVertex_( oppVertex )\n+30 {}\n+31\n 32\n-33 typedef ALBERTA MACRO_DATA Data;\n-34\n-35 static const int dimension = dim;\n-36 static const int numVertices = NumSubEntities<_dimension,_dimension_>::\n-value;\n-37 static const int numEdges = NumSubEntities< dimension, dimension-1 >::value;\n-38\n-39 static const int initialSize = 4096;\n+33 template< class Grid >\n+34 inline typename Grid::template Codim< 0 >::Entity\n+35 AlbertaGridIntersectionBase<_Grid_>::inside () const\n+36 {\n+37 typedef AlbertaGridEntity<_0,_Grid::dimension,_Grid_> EntityImp;\n+38 return EntityImp( grid(), elementInfo(), 0 );\n+39 }\n 40\n-41 public:\n-42 template< int >\n-43 struct Library;\n-44\n-45 template< int > friend struct InstantiateMacroDataLibrary;\n-46\n-47 public:\n-48 typedef int ElementId[ numVertices ];\n-49\n-50 static const int supportPeriodicity = 1;\n-51\n-52 MacroData ()\n-53 : data_( NULL ),\n-54 vertexCount_( -1 ),\n-55 elementCount_( -1 )\n-56 {}\n-57\n-58 operator Data * () const\n-59 {\n-60 return data_;\n-61 }\n+41\n+42 template< class Grid >\n+43 inline bool AlbertaGridIntersectionBase<_Grid_>::boundary () const\n+44 {\n+45 return elementInfo().isBoundary( oppVertex_ );\n+46 }\n+47\n+48\n+49 template< class Grid >\n+50 inline int AlbertaGridIntersectionBase<_Grid_>::boundaryId () const\n+51 {\n+52 if( boundary() )\n+53 {\n+54 const int id = elementInfo().boundaryId( oppVertex_ );\n+55 assert( id != 0 );\n+56 return id;\n+57 }\n+58 else\n+59 return 0;\n+60 }\n+61\n 62\n-63 int vertexCount () const\n-64 {\n-65 return (vertexCount_ < 0 ? data_->n_total_vertices : vertexCount_);\n-66 }\n-67\n-68 int elementCount () const\n-69 {\n-70 return (elementCount_ < 0 ? data_->n_macro_elements : elementCount_);\n-71 }\n+63 template< class Grid >\n+64 inline size_t AlbertaGridIntersectionBase<_Grid_>::boundarySegmentIndex ()\n+const\n+65 {\n+66 assert( boundary() );\n+67 const Alberta::BasicNodeProjection *projection = elementInfo\n+().boundaryProjection( oppVertex_ );\n+68 assert( projection );\n+69 return projection->boundaryIndex();\n+70 }\n+71\n 72\n-73 ElementId &element ( int i ) const;\n-74 GlobalVector &vertex ( int i ) const;\n-75 int &neighbor ( int element, int i ) const;\n-76 BoundaryId &boundaryId ( int element, int i ) const;\n-77\n-82 void create ();\n-83\n-92 void finalize ();\n+73 template< class Grid >\n+74 inline int AlbertaGridIntersectionBase<_Grid_>::indexInInside () const\n+75 {\n+76 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);\n+77 return grid().alberta2generic( 1, face );\n+78 }\n+79\n+80\n+81 template< class Grid >\n+82 inline GeometryType AlbertaGridIntersectionBase<_Grid_>::type () const\n+83 {\n+84 return GeometryTypes::simplex( dimension-1 );\n+85 }\n+86\n+87\n+88 template< class Grid >\n+89 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n+90 AlbertaGridIntersectionBase<_Grid_>::centerIntegrationOuterNormal () const\n+91 {\n+92 const typename Entity::Geometry geoInside = inside().geometry();\n 93\n-102 void markLongestEdge ();\n-103\n-112 void setOrientation ( const Real orientation );\n-113\n-124 bool checkNeighbors () const;\n-125\n-127 void release ()\n-128 {\n-129 if( data_ != NULL )\n-130 {\n-131 ALBERTA free_macro_data( data_ );\n-132 data_ = NULL;\n-133 }\n-134 vertexCount_ = elementCount_ = -1;\n-135 }\n-136\n-142 int insertElement ( const ElementId &id );\n-143\n-149 int insertVertex ( const GlobalVector &coords )\n-150 {\n-151 assert( vertexCount_ >= 0 );\n-152 if( vertexCount_ >= data_->n_total_vertices )\n-153 resizeVertices( 2*vertexCount_ );\n-154 copy( coords, vertex( vertexCount_ ) );\n-155 return vertexCount_++;\n+94 const int face = indexInInside();\n+95 auto refSimplex = ReferenceElements< ctype, dimension >::simplex();\n+96 FieldVector< ctype, dimension > refNormal =\n+refSimplex.integrationOuterNormal( face );\n+97\n+98 const typename Entity::Geometry::JacobianInverseTransposed &jInvT\n+99 = geoInside.impl().jacobianInverseTransposed();\n+100\n+101 NormalVector normal;\n+102 jInvT.mv( refNormal, normal );\n+103 normal *= geoInside.impl().integrationElement();\n+104\n+105 return normal;\n+106 }\n+107\n+108 template<>\n+109 inline AlbertaGridIntersectionBase<_const_AlbertaGrid<_1,_1_> >::\n+NormalVector\n+110 AlbertaGridIntersectionBase<_const_AlbertaGrid<_1,_1_> >::\n+centerIntegrationOuterNormal () const\n+111 {\n+112 const Alberta::GlobalVector &oppCoord = grid().getCoord( elementInfo(),\n+oppVertex_ );\n+113 const Alberta::GlobalVector &myCoord = grid().getCoord( elementInfo(), 1-\n+oppVertex_ );\n+114 NormalVector n;\n+115 n[ 0 ] = (myCoord[ 0 ] > oppCoord[ 0 ] ? ctype( 1 ) : -ctype( 1 ));\n+116 return n;\n+117 }\n+118\n+119#if defined GRIDDIM && GRIDDIM > 1\n+120 template<>\n+121 inline AlbertaGridIntersectionBase<_const_AlbertaGrid<_2,_2_> >::\n+NormalVector\n+122 AlbertaGridIntersectionBase<_const_AlbertaGrid<_2,_2_> >::\n+centerIntegrationOuterNormal () const\n+123 {\n+124 const Alberta::GlobalVector &coordOne = grid().getCoord( elementInfo(),\n+(oppVertex_+1)%3 );\n+125 const Alberta::GlobalVector &coordTwo = grid().getCoord( elementInfo(),\n+(oppVertex_+2)%3 );\n+126\n+127 NormalVector n;\n+128 n[ 0 ] = -(coordOne[ 1 ] - coordTwo[ 1 ]);\n+129 n[ 1 ] = coordOne[ 0 ] - coordTwo[ 0 ];\n+130 return n;\n+131 }\n+132#endif // defined GRIDDIM && GRIDDIM > 1\n+133\n+134 template<>\n+135 inline AlbertaGridIntersectionBase< const AlbertaGrid< 3, 3 > >::\n+NormalVector\n+136 AlbertaGridIntersectionBase<_const_AlbertaGrid<_3,_3_> >::\n+centerIntegrationOuterNormal () const\n+137 {\n+138 // in this case the orientation is negative, multiply by -1\n+139 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();\n+140 const ctype val = (elInfo.orientation > 0) ? 1.0 : -1.0;\n+141\n+142 static const int faceVertices[ 4 ][ 3 ]\n+143 = { {1,3,2}, {0,2,3}, {0,3,1}, {0,1,2} };\n+144 const int *localFaces = faceVertices[ oppVertex_ ];\n+145\n+146 const Alberta::GlobalVector &coord0 = grid().getCoord( elementInfo(),\n+localFaces[ 0 ] );\n+147 const Alberta::GlobalVector &coord1 = grid().getCoord( elementInfo(),\n+localFaces[ 1 ] );\n+148 const Alberta::GlobalVector &coord2 = grid().getCoord( elementInfo(),\n+localFaces[ 2 ] );\n+149\n+150 FieldVector< ctype, dimensionworld > u;\n+151 FieldVector< ctype, dimensionworld > v;\n+152 for( int i = 0; i < dimension; ++i )\n+153 {\n+154 v[ i ] = coord1[ i ] - coord0[ i ];\n+155 u[ i ] = coord2[ i ] - coord1[ i ];\n 156 }\n 157\n-163 int insertVertex ( const FieldVector< Real, dimWorld > &coords )\n-164 {\n-165 assert( vertexCount_ >= 0 );\n-166 if( vertexCount_ >= data_->n_total_vertices )\n-167 resizeVertices( 2*vertexCount_ );\n-168 copy( coords, vertex( vertexCount_ ) );\n-169 return vertexCount_++;\n-170 }\n-171\n-172 void insertWallTrafo ( const GlobalMatrix &m, const GlobalVector &t );\n-173 void insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld >\n-&matrix,\n-174 const FieldVector< Real, dimWorld > &shift );\n+158 NormalVector n;\n+159 for( int i = 0; i < dimension; ++i )\n+160 {\n+161 const int j = (i+1)%dimension;\n+162 const int k = (i+2)%dimension;\n+163 n[ i ] = val * (u[ j ] * v[ k ] - u[ k ] * v[ j ]);\n+164 }\n+165 return n;\n+166 }\n+167\n+168\n+169 template< class Grid >\n+170 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n+171 AlbertaGridIntersectionBase<_Grid_>::centerOuterNormal() const\n+172 {\n+173 return centerIntegrationOuterNormal();\n+174 }\n 175\n-176 void checkCycles ();\n-177\n-178 void read ( const std::string &filename, bool binary = false );\n-179\n-180 bool write ( const std::string &filename, bool binary = false ) const\n-181 {\n-182 if( binary )\n-183 return ALBERTA write_macro_data_xdr( data_, filename.c_str() );\n-184 else\n-185 return ALBERTA write_macro_data( data_, filename.c_str() );\n-186 }\n-187\n-188 private:\n-189 template< class Vector >\n-190 void copy ( const Vector &x, GlobalVector &y )\n-191 {\n-192 for( int i = 0; i < dimWorld; ++i )\n-193 y[ i ] = x[ i ];\n-194 }\n-195\n-196 void resizeElements ( const int newSize );\n-197\n-198 void resizeVertices ( const int newSize )\n-199 {\n-200 const int oldSize = data_->n_total_vertices;\n-201 data_->n_total_vertices = newSize;\n-202 data_->coords = memReAlloc< GlobalVector >( data_->coords, oldSize, newSize\n-);\n-203 assert( (data_->coords != NULL) || (newSize == 0) );\n-204 }\n-205\n-206 private:\n-207 Data *data_;\n-208 int vertexCount_;\n-209 int elementCount_;\n-210 };\n-211\n-212\n-213\n-214 // MacroData::Library\n-215 // ------------------\n-216\n-217 template< int dim >\n-218 template< int >\n-219 struct MacroData< dim >::Library\n-220 {\n-221 typedef Alberta::MacroData<_dim_> MacroData;\n-222\n-223 static bool checkNeighbors ( const MacroData ¯oData );\n-224 static void markLongestEdge ( MacroData ¯oData );\n-225 static void setOrientation ( [[maybe_unused]] MacroData ¯oData,\n-226 [[maybe_unused]] const Real orientation );\n-227\n-228 private:\n-229 static Real edgeLength ( const MacroData ¯oData, const ElementId &e,\n-int edge );\n-230 static int longestEdge ( const MacroData ¯oData, const ElementId &e );\n-231\n-232 template< class Type >\n-233 static void rotate ( Type *array, int i, int shift );\n+176\n+177 template< class Grid >\n+178 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n+179 AlbertaGridIntersectionBase<_Grid_>::centerUnitOuterNormal () const\n+180 {\n+181 NormalVector normal = centerOuterNormal();\n+182 normal *= (1.0 / normal.two_norm());\n+183 return normal;\n+184 }\n+185\n+186\n+187 template< class Grid >\n+188 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n+189 AlbertaGridIntersectionBase<_Grid_>::integrationOuterNormal ( const\n+LocalCoordType & ) const\n+190 {\n+191 return centerIntegrationOuterNormal();\n+192 }\n+193\n+194\n+195 template< class Grid >\n+196 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n+197 AlbertaGridIntersectionBase<_Grid_>::outerNormal( const LocalCoordType & )\n+const\n+198 {\n+199 return centerOuterNormal();\n+200 }\n+201\n+202\n+203 template< class Grid >\n+204 inline typename AlbertaGridIntersectionBase<_Grid_>::NormalVector\n+205 AlbertaGridIntersectionBase<_Grid_>::unitOuterNormal ( const LocalCoordType\n+& ) const\n+206 {\n+207 return centerUnitOuterNormal();\n+208 }\n+209\n+210\n+211 template< class Grid >\n+212 inline AlbertaTransformation\n+213 AlbertaGridIntersectionBase<_Grid_>::transformation () const\n+214 {\n+215 return AlbertaTransformation( elementInfo().transformation( oppVertex_ ) );\n+216 }\n+217\n+218\n+219 template< class Grid >\n+220 inline const Grid &AlbertaGridIntersectionBase<_Grid_>::grid () const\n+221 {\n+222 return *grid_;\n+223 }\n+224\n+225\n+226 template< class Grid >\n+227 inline const typename AlbertaGridIntersectionBase<_Grid_>::ElementInfo &\n+228 AlbertaGridIntersectionBase<_Grid_>::elementInfo () const\n+229 {\n+230 assert( !!elementInfo_ );\n+231 return elementInfo_;\n+232 }\n+233\n 234\n-235 static void rotate ( MacroData ¯oData, int i, int shift );\n-236 static void swap ( MacroData ¯oData, int el, int v1, int v2 );\n-237 };\n+235\n+236 // AlbertaGridIntersectionBase::GlobalCoordReader\n+237 // ----------------------------------------------\n 238\n-239\n-240\n-241 // Implementation of MacroData\n-242 // ---------------------------\n+239 template< class GridImp >\n+240 struct AlbertaGridIntersectionBase< GridImp >::GlobalCoordReader\n+241 {\n+242 typedef typename std::remove_const< GridImp >::type Grid;\n 243\n-244 template< int dim >\n-245 inline typename MacroData<_dim_>::ElementId &\n-246 MacroData<_dim_>::element ( int i ) const\n-247 {\n-248 assert( (i >= 0) && (i < data_->n_macro_elements) );\n-249 const int offset = i * numVertices;\n-250 return *reinterpret_cast< ElementId * >( data_->mel_vertices + offset );\n-251 }\n-252\n+244 static const int dimension = Grid::dimension;\n+245 static const int codimension = 1;\n+246 static const int mydimension = dimension - codimension;\n+247 static const int coorddimension = Grid::dimensionworld;\n+248\n+249 typedef Alberta::Real ctype;\n+250\n+251 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+252 typedef FieldVector< ctype, coorddimension > Coordinate;\n 253\n-254 template< int dim >\n-255 inline GlobalVector &MacroData<_dim_>::vertex ( int i ) const\n-256 {\n-257 assert( (i >= 0) && (i < data_->n_total_vertices) );\n-258 return data_->coords[ i ];\n-259 }\n-260\n-261\n-262 template< int dim >\n-263 inline int &MacroData<_dim_>::neighbor ( int element, int i ) const\n-264 {\n-265 assert( (element >= 0) && (element < data_->n_macro_elements) );\n-266 assert( (i >= 0) && (i < numVertices) );\n-267 return data_->neigh[ element*numVertices + i ];\n-268 }\n+254 private:\n+255 const Grid &grid_;\n+256 const ElementInfo &elementInfo_;\n+257 const int subEntity_;\n+258 const int twist_;\n+259\n+260 public:\n+261 GlobalCoordReader ( const GridImp &grid,\n+262 const ElementInfo &elementInfo,\n+263 int subEntity )\n+264 : grid_( grid ),\n+265 elementInfo_( elementInfo ),\n+266 subEntity_( subEntity ),\n+267 twist_( elementInfo.template twist< codimension >( subEntity ) )\n+268 {}\n 269\n-270\n-271 template< int dim >\n-272 inline BoundaryId &MacroData<_dim_>::boundaryId ( int element, int i )\n-const\n-273 {\n-274 assert( (element >= 0) && (element < data_->n_macro_elements) );\n-275 assert( (i >= 0) && (i < numVertices) );\n-276 return data_->boundary[ element*numVertices + i ];\n-277 }\n-278\n-279\n-280 template< int dim >\n-281 inline void MacroData<_dim_>::create ()\n-282 {\n-283 release();\n-284 data_ = ALBERTA alloc_macro_data( dim, initialSize, initialSize );\n-285 data_->boundary = memAlloc< BoundaryId >( initialSize*numVertices );\n-286 if( dim == 3 )\n-287 data_->el_type = memAlloc< ElementType >( initialSize );\n-288 vertexCount_ = elementCount_ = 0;\n-289 elementCount_ = 0;\n-290 }\n-291\n+270 void coordinate ( int i, Coordinate &x ) const\n+271 {\n+272 assert( !elementInfo_ == false );\n+273 assert( (i >= 0) && (i <= mydimension) );\n+274\n+275 const int ti = Alberta::applyInverseTwist< mydimension >( twist_, i );\n+276 const int k = mapVertices( subEntity_, ti );\n+277 const Alberta::GlobalVector &coord = grid_.getCoord( elementInfo_, k );\n+278 for( int j = 0; j < coorddimension; ++j )\n+279 x[ j ] = coord[ j ];\n+280 }\n+281\n+282 bool hasDeterminant () const\n+283 {\n+284 return false;\n+285 }\n+286\n+287 ctype determinant () const\n+288 {\n+289 assert( false );\n+290 return ctype( 0 );\n+291 }\n 292\n-293 template< int dim >\n-294 inline void MacroData<_dim_>::finalize ()\n+293 private:\n+294 static int mapVertices ( int subEntity, int i )\n 295 {\n-296 if( (vertexCount_ >= 0) && (elementCount_ >= 0) )\n-297 {\n-298 resizeVertices( vertexCount_ );\n-299 resizeElements( elementCount_ );\n-300 ALBERTA compute_neigh_fast( data_ );\n+296 return Alberta::MapVertices<_dimension,_codimension_>::apply( subEntity, i\n+);\n+297 }\n+298 };\n+299\n+300\n 301\n-302 // assign default boundary id (if none is assigned)\n-303 for( int element = 0; element < elementCount_; ++element )\n-304 {\n-305 for( int i = 0; i < numVertices; ++i )\n-306 {\n-307 BoundaryId &id = boundaryId( element, i );\n-308 if( neighbor( element, i ) >= 0 )\n-309 {\n-310 assert( id == InteriorBoundary );\n-311 id = InteriorBoundary;\n-312 }\n-313 else\n-314 id = (id == InteriorBoundary ? DirichletBoundary : id);\n-315 }\n-316 }\n+302\n+303 // AlbertaGridIntersectionBase::LocalCoordReader\n+304 // ---------------------------------------------\n+305\n+306 template< class GridImp >\n+307 struct AlbertaGridIntersectionBase< GridImp >::LocalCoordReader\n+308 {\n+309 typedef typename std::remove_const< GridImp >::type Grid;\n+310\n+311 static const int dimension = Grid::dimension;\n+312 static const int codimension = 1;\n+313 static const int mydimension = dimension - codimension;\n+314 static const int coorddimension = dimension;\n+315\n+316 typedef Alberta::Real ctype;\n 317\n-318 vertexCount_ = elementCount_ = -1;\n-319 }\n-320 assert( (vertexCount_ < 0) && (elementCount_ < 0) );\n-321 }\n+318 typedef FieldVector< ctype, coorddimension > Coordinate;\n+319\n+320 typedef typename Grid::template Codim< 0 >::Geometry ElementGeometry;\n+321 typedef typename Grid::template Codim< 1 >::Geometry FaceGeometry;\n 322\n-323\n-324 template< int dim >\n-325 inline void MacroData<_dim_>::markLongestEdge ()\n-326 {\n-327 Library<_dimWorld_>::markLongestEdge( *this );\n-328 }\n-329\n-330\n-331 template< int dim >\n-332 inline void MacroData<_dim_>::setOrientation ( const Real orientation )\n-333 {\n-334 Library<_dimWorld_>::setOrientation( *this, orientation );\n-335 }\n-336\n-337\n-338 template< int dim >\n-339 inline bool MacroData<_dim_>::checkNeighbors () const\n+323 private:\n+324 const ElementGeometry &elementGeometry_;\n+325 const FaceGeometry &faceGeometry_;\n+326\n+327 public:\n+328 LocalCoordReader ( const ElementGeometry &elementGeometry,\n+329 const FaceGeometry &faceGeometry )\n+330 : elementGeometry_( elementGeometry ),\n+331 faceGeometry_( faceGeometry )\n+332 {}\n+333\n+334 void coordinate ( int i, Coordinate &x ) const\n+335 {\n+336 x = elementGeometry_.local( faceGeometry_.corner( i ) );\n+337 }\n+338\n+339 bool hasDeterminant () const\n 340 {\n-341 return Library<_dimWorld_>::checkNeighbors( *this );\n+341 return false;\n 342 }\n 343\n-344\n-345 template< int dim >\n-346 inline int MacroData<_dim_>::insertElement ( const ElementId &id )\n-347 {\n-348 assert( elementCount_ >= 0 );\n-349 if( elementCount_ >= data_->n_macro_elements )\n-350 resizeElements( 2*elementCount_ );\n+344 ctype determinant () const\n+345 {\n+346 return ctype( 0 );\n+347 }\n+348 };\n+349\n+350\n 351\n-352 ElementId &e = element( elementCount_ );\n-353 for( int i = 0; i < numVertices; ++i )\n-354 {\n-355 e[ i ] = id[ i ];\n-356 boundaryId( elementCount_, i ) = InteriorBoundary;\n-357 }\n-358 if( dim == 3 )\n-359 data_->el_type[ elementCount_ ] = 0;\n-360\n-361 return elementCount_++;\n-362 }\n-363\n-364\n-365 template< int dim >\n-366 inline void MacroData<_dim_>\n-367_::insertWallTrafo ( const GlobalMatrix &matrix, const GlobalVector &shift )\n-368 {\n-369 int &count = data_->n_wall_trafos;\n-370 AffineTransformation *&array = data_->wall_trafos;\n-371\n-372 // resize wall trafo array\n-373 array = memReAlloc< AffineTransformation >( array, count, count+1 );\n-374 assert( data_->wall_trafos != NULL );\n+352 // AlbertaGridLeafIntersection\n+353 // ---------------------------\n+354\n+355 template< class GridImp >\n+356 inline void AlbertaGridLeafIntersection::next ()\n+357 {\n+358 assert( oppVertex_ <= dimension );\n+359 ++oppVertex_;\n+360 neighborInfo_ = ElementInfo();\n+361 }\n+362\n+363 template< class GridImp >\n+364 inline typename GridImp::template Codim< 0 >::Entity\n+365 AlbertaGridLeafIntersection<_GridImp_>::outside () const\n+366 {\n+367 typedef AlbertaGridEntity<_0,_GridImp::dimension,_GridImp_> EntityImp;\n+368\n+369 if( !neighborInfo_ )\n+370 {\n+371 assert( neighbor() );\n+372\n+373 neighborInfo_ = elementInfo().leafNeighbor( oppVertex_ );\n+374 }\n 375\n-376 // copy matrix and shift\n-377 for( int i = 0; i < dimWorld; ++i )\n-378 copy( matrix[ i ], array[ count ].M[ i ] );\n-379 copy( shift, array[ count ].t );\n-380 ++count;\n-381 }\n-382\n-383 template< int dim >\n-384 inline void MacroData<_dim_>\n-385_::insertWallTrafo ( const FieldMatrix< Real, dimWorld, dimWorld > &matrix,\n-386 const FieldVector< Real, dimWorld > &shift )\n-387 {\n-388 int &count = data_->n_wall_trafos;\n-389 AffineTransformation *&array = data_->wall_trafos;\n-390\n-391 // resize wall trafo array\n-392 array = memReAlloc< AffineTransformation >( array, count, count+1 );\n-393 assert( data_->wall_trafos != NULL );\n-394\n-395 // copy matrix and shift\n-396 for( int i = 0; i < dimWorld; ++i )\n-397 copy( matrix[ i ], array[ count ].M[ i ] );\n-398 copy( shift, array[ count ].t );\n-399 ++count;\n-400 }\n-401\n-402\n-403 template< int dim >\n-404 inline void MacroData<_dim_>::checkCycles ()\n-405 {\n-406 // ensure that the macro data has been finalized\n-407 finalize();\n-408 ALBERTA macro_test( data_, NULL );\n-409 }\n-410\n-411\n-412 template< int dim >\n-413 inline void MacroData<_dim_>::read ( const std::string &filename, bool\n-binary )\n-414 {\n-415 release();\n-416 if( binary )\n-417 data_ = ALBERTA read_macro_xdr( filename.c_str() );\n-418 else\n-419 data_ = ALBERTA read_macro( filename.c_str() );\n-420 }\n-421\n-422\n-423 template< int dim >\n-424 inline void MacroData<_dim_>::resizeElements ( const int newSize )\n-425 {\n-426 const int oldSize = data_->n_macro_elements;\n-427 data_->n_macro_elements = newSize;\n-428 data_->mel_vertices = memReAlloc( data_->mel_vertices, oldSize*numVertices,\n-newSize*numVertices );\n-429 data_->boundary = memReAlloc( data_->boundary, oldSize*numVertices,\n-newSize*numVertices );\n-430 if( dim == 3 )\n-431 data_->el_type = memReAlloc( data_->el_type, oldSize, newSize );\n-432 assert( (newSize == 0) || (data_->mel_vertices != NULL) );\n-433 }\n-434\n-435 }\n-436\n-437}\n-438\n-439#endif // #if HAVE_ALBERTA\n-440\n-441#endif\n-misc.hh\n-algebra.hh\n-albertaheader.hh\n+376 assert( !neighborInfo_ == false );\n+377 assert( neighborInfo_.el() != NULL );\n+378 return EntityImp( grid(), neighborInfo_, 0 );\n+379 }\n+380\n+381 template< class GridImp >\n+382 inline bool AlbertaGridLeafIntersection<_GridImp_>::neighbor () const\n+383 {\n+384 assert( oppVertex_ <= dimension );\n+385 return elementInfo().hasLeafNeighbor( oppVertex_ );\n+386 }\n+387\n+388\n+389 template< class GridImp >\n+390 inline typename AlbertaGridLeafIntersection<_GridImp_>::LocalGeometry\n+391 AlbertaGridLeafIntersection<_GridImp_>::geometryInInside () const\n+392 {\n+393 typedef AlbertaGridLocalGeometryProvider<_GridImp_> LocalGeoProvider;\n+394 const int twist = elementInfo().template twist< 1 >( oppVertex_ );\n+395 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);\n+396 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face,\n+twist ) );\n+397 }\n+398\n+399\n+400 template< class GridImp >\n+401 inline typename AlbertaGridLeafIntersection<_GridImp_>::LocalGeometry\n+402 AlbertaGridLeafIntersection<_GridImp_>::geometryInOutside () const\n+403 {\n+404 assert( neighbor() );\n+405\n+406 typedef AlbertaGridLocalGeometryProvider<_GridImp_> LocalGeoProvider;\n+407 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();\n+408 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];\n+409 const int twist = elementInfo().twistInNeighbor( oppVertex_ );\n+410 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);\n+411 return LocalGeometry( LocalGeoProvider::instance().faceGeometry( face,\n+twist ) );\n+412 }\n+413\n+414\n+415 template< class GridImp >\n+416 inline typename AlbertaGridLeafIntersection<_GridImp_>::Geometry\n+417 AlbertaGridLeafIntersection<_GridImp_>::geometry () const\n+418 {\n+419 const int face = (dimension > 1 ? oppVertex_ : 1-oppVertex_);\n+420 const GlobalCoordReader coordReader( grid(), elementInfo(), face );\n+421 return Geometry( GeometryImpl( coordReader ) );\n+422 }\n+423\n+424\n+425 template< class GridImp >\n+426 inline int AlbertaGridLeafIntersection<_GridImp_>::indexInOutside () const\n+427 {\n+428 const ALBERTA EL_INFO &elInfo = elementInfo().elInfo();\n+429 const int oppVertex = elInfo.opp_vertex[ oppVertex_ ];\n+430 const int face = (dimension > 1 ? oppVertex : 1-oppVertex);\n+431 return grid().alberta2generic( 1, face );\n+432 }\n+433\n+434} // namespace Dune\n+435\n+436#endif // #ifndef DUNE_ALBERTA_INTERSECTION_CC\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::GlobalMatrix\n-ALBERTA REAL_DD GlobalMatrix\n-Definition misc.hh:51\n-Dune::Alberta::AffineTransformation\n-ALBERTA AFF_TRAFO AffineTransformation\n-Definition misc.hh:52\n-Dune::Alberta::BoundaryId\n-ALBERTA BNDRY_TYPE BoundaryId\n-Definition misc.hh:61\n-Dune::Alberta::InteriorBoundary\n-static const int InteriorBoundary\n-Definition misc.hh:59\n Dune::Alberta::Real\n ALBERTA REAL Real\n Definition misc.hh:48\n-Dune::Alberta::memReAlloc\n-Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)\n-Definition misc.hh:85\n-Dune::Alberta::DirichletBoundary\n-static const int DirichletBoundary\n-Definition misc.hh:60\n-Dune::Alberta::dimWorld\n-static const int dimWorld\n-Definition misc.hh:46\n Dune::Alberta::GlobalVector\n ALBERTA REAL_D GlobalVector\n Definition misc.hh:50\n-Dune::Alberta::MacroData\n-Definition macrodata.hh:30\n-Dune::Alberta::MacroData::InstantiateMacroDataLibrary\n-friend struct InstantiateMacroDataLibrary\n-Definition macrodata.hh:45\n-Dune::Alberta::MacroData::boundaryId\n-BoundaryId & boundaryId(int element, int i) const\n-Definition macrodata.hh:272\n-Dune::Alberta::MacroData::insertVertex\n-int insertVertex(const GlobalVector &coords)\n-insert vertex\n-Definition macrodata.hh:149\n-Dune::Alberta::MacroData::ElementId\n-int ElementId[numVertices]\n-Definition macrodata.hh:48\n-Dune::Alberta::MacroData::supportPeriodicity\n-static const int supportPeriodicity\n-Definition macrodata.hh:50\n-Dune::Alberta::MacroData::release\n-void release()\n-release the macro data structure\n-Definition macrodata.hh:127\n-Dune::Alberta::MacroData::elementCount\n-int elementCount() const\n-Definition macrodata.hh:68\n-Dune::Alberta::MacroData::vertex\n-GlobalVector & vertex(int i) const\n-Definition macrodata.hh:255\n-Dune::Alberta::MacroData::vertexCount\n-int vertexCount() const\n-Definition macrodata.hh:63\n-Dune::Alberta::MacroData::markLongestEdge\n-void markLongestEdge()\n-mark the longest edge of all elements as refinement edges\n-Definition macrodata.hh:325\n-Dune::Alberta::MacroData::insertVertex\n-int insertVertex(const FieldVector< Real, dimWorld > &coords)\n-insert vertex\n-Definition macrodata.hh:163\n-Dune::Alberta::MacroData::checkNeighbors\n-bool checkNeighbors() const\n-check the neighbor information\n-Definition macrodata.hh:339\n-Dune::Alberta::MacroData::insertWallTrafo\n-void insertWallTrafo(const FieldMatrix< Real, dimWorld, dimWorld > &matrix,\n-const FieldVector< Real, dimWorld > &shift)\n-Definition macrodata.hh:385\n-Dune::Alberta::MacroData::element\n-ElementId & element(int i) const\n-Definition macrodata.hh:246\n-Dune::Alberta::MacroData::checkCycles\n-void checkCycles()\n-Definition macrodata.hh:404\n-Dune::Alberta::MacroData::neighbor\n-int & neighbor(int element, int i) const\n-Definition macrodata.hh:263\n-Dune::Alberta::MacroData::MacroData\n-MacroData()\n-Definition macrodata.hh:52\n-Dune::Alberta::MacroData::finalize\n-void finalize()\n-compress macro data structure\n-Definition macrodata.hh:294\n-Dune::Alberta::MacroData::insertWallTrafo\n-void insertWallTrafo(const GlobalMatrix &m, const GlobalVector &t)\n-Definition macrodata.hh:367\n-Dune::Alberta::MacroData::setOrientation\n-void setOrientation(const Real orientation)\n-set the orientation of all elements\n-Definition macrodata.hh:332\n-Dune::Alberta::MacroData::create\n-void create()\n-create a new macro data structure\n-Definition macrodata.hh:281\n-Dune::Alberta::MacroData::insertElement\n-int insertElement(const ElementId &id)\n-insert element\n-Definition macrodata.hh:346\n-Dune::Alberta::MacroData::write\n-bool write(const std::string &filename, bool binary=false) const\n-Definition macrodata.hh:180\n-Dune::Alberta::MacroData::read\n-void read(const std::string &filename, bool binary=false)\n-Definition macrodata.hh:413\n-Dune::Alberta::MacroData::Library\n-Definition macrodata.hh:220\n-Dune::Alberta::MacroData::Library::markLongestEdge\n-static void markLongestEdge(MacroData ¯oData)\n-Dune::Alberta::MacroData::Library::MacroData\n-Alberta::MacroData< dim > MacroData\n-Definition macrodata.hh:221\n-Dune::Alberta::NumSubEntities\n-Definition misc.hh:148\n+Dune::Alberta::ElementInfo<_dimension_>\n+Dune::AlbertaGridLeafIntersection::geometryInOutside\n+LocalGeometry geometryInOutside() const\n+Definition intersection.cc:402\n+Dune::AlbertaGridLeafIntersection::outside\n+GridImp::template Codim< 0 >::Entity outside() const\n+Definition intersection.cc:365\n+Dune::AlbertaGridLeafIntersection::next\n+void next()\n+Definition intersection.cc:356\n+Dune::AlbertaGridLeafIntersection::GeometryImpl\n+Base::GeometryImpl GeometryImpl\n+Definition albertagrid/intersection.hh:130\n+Dune::AlbertaGridLeafIntersection::indexInOutside\n+int indexInOutside() const\n+Definition intersection.cc:426\n+Dune::AlbertaGridLeafIntersection::geometryInInside\n+LocalGeometry geometryInInside() const\n+Definition intersection.cc:391\n+Dune::AlbertaGridLeafIntersection::GlobalCoordReader\n+Base::GlobalCoordReader GlobalCoordReader\n+Definition albertagrid/intersection.hh:133\n+Dune::AlbertaGridLeafIntersection::Geometry\n+Base::Geometry Geometry\n+Definition albertagrid/intersection.hh:122\n+Dune::AlbertaGridLeafIntersection::geometry\n+Geometry geometry() const\n+Definition intersection.cc:417\n+Dune::AlbertaGridLeafIntersection::neighbor\n+bool neighbor() const\n+Definition intersection.cc:382\n+Dune::AlbertaGridLeafIntersection::LocalGeometry\n+Base::LocalGeometry LocalGeometry\n+Definition albertagrid/intersection.hh:123\n+Dune::AlbertaGridEntity\n+Definition albertagrid/entity.hh:46\n+Dune::AlbertaGridLocalGeometryProvider\n+Definition albertagrid/geometry.hh:504\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader\n+Definition intersection.cc:241\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::Coordinate\n+FieldVector< ctype, coorddimension > Coordinate\n+Definition intersection.cc:252\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::ctype\n+Alberta::Real ctype\n+Definition intersection.cc:249\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::Grid\n+std::remove_const< GridImp >::type Grid\n+Definition intersection.cc:242\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::ElementInfo\n+Alberta::ElementInfo< dimension > ElementInfo\n+Definition intersection.cc:251\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::determinant\n+ctype determinant() const\n+Definition intersection.cc:287\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::hasDeterminant\n+bool hasDeterminant() const\n+Definition intersection.cc:282\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::GlobalCoordReader\n+GlobalCoordReader(const GridImp &grid, const ElementInfo &elementInfo, int\n+subEntity)\n+Definition intersection.cc:261\n+Dune::AlbertaGridIntersectionBase::GlobalCoordReader::coordinate\n+void coordinate(int i, Coordinate &x) const\n+Definition intersection.cc:270\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader\n+Definition intersection.cc:308\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::FaceGeometry\n+Grid::template Codim< 1 >::Geometry FaceGeometry\n+Definition intersection.cc:321\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::ctype\n+Alberta::Real ctype\n+Definition intersection.cc:316\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::LocalCoordReader\n+LocalCoordReader(const ElementGeometry &elementGeometry, const FaceGeometry\n+&faceGeometry)\n+Definition intersection.cc:328\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::Grid\n+std::remove_const< GridImp >::type Grid\n+Definition intersection.cc:309\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::coordinate\n+void coordinate(int i, Coordinate &x) const\n+Definition intersection.cc:334\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::hasDeterminant\n+bool hasDeterminant() const\n+Definition intersection.cc:339\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::determinant\n+ctype determinant() const\n+Definition intersection.cc:344\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::Coordinate\n+FieldVector< ctype, coorddimension > Coordinate\n+Definition intersection.cc:318\n+Dune::AlbertaGridIntersectionBase::LocalCoordReader::ElementGeometry\n+Grid::template Codim< 0 >::Geometry ElementGeometry\n+Definition intersection.cc:320\n+Dune::AlbertaGridIntersectionBase\n+Definition albertagrid/intersection.hh:32\n+Dune::AlbertaGridIntersectionBase::centerOuterNormal\n+NormalVector centerOuterNormal() const\n+Definition intersection.cc:171\n+Dune::AlbertaGridIntersectionBase::elementInfo\n+const ElementInfo & elementInfo() const\n+Definition intersection.cc:228\n+Dune::AlbertaGridIntersectionBase::NormalVector\n+FieldVector< ctype, dimensionworld > NormalVector\n+Definition albertagrid/intersection.hh:41\n+Dune::AlbertaGridIntersectionBase::centerIntegrationOuterNormal\n+NormalVector centerIntegrationOuterNormal() const\n+Definition intersection.cc:90\n+Dune::AlbertaGridIntersectionBase::ctype\n+Grid::ctype ctype\n+Definition albertagrid/intersection.hh:36\n+Dune::AlbertaGridIntersectionBase::integrationOuterNormal\n+NormalVector integrationOuterNormal(const LocalCoordType &local) const\n+Definition intersection.cc:189\n+Dune::AlbertaGridIntersectionBase::elementInfo_\n+ElementInfo elementInfo_\n+Definition albertagrid/intersection.hh:93\n+Dune::AlbertaGridIntersectionBase::LocalCoordType\n+FieldVector< ctype, dimension-1 > LocalCoordType\n+Definition albertagrid/intersection.hh:42\n+Dune::AlbertaGridIntersectionBase::centerUnitOuterNormal\n+NormalVector centerUnitOuterNormal() const\n+Definition intersection.cc:179\n+Dune::AlbertaGridIntersectionBase::indexInInside\n+int indexInInside() const\n+Definition intersection.cc:74\n+Dune::AlbertaGridIntersectionBase::inside\n+Entity inside() const\n+Definition intersection.cc:35\n+Dune::AlbertaGridIntersectionBase::unitOuterNormal\n+NormalVector unitOuterNormal(const LocalCoordType &local) const\n+Definition intersection.cc:205\n+Dune::AlbertaGridIntersectionBase::grid\n+const Grid & grid() const\n+Definition intersection.cc:220\n+Dune::AlbertaGridIntersectionBase::dimension\n+static const int dimension\n+Definition albertagrid/intersection.hh:38\n+Dune::AlbertaGridIntersectionBase::boundary\n+bool boundary() const\n+Definition intersection.cc:43\n+Dune::AlbertaGridIntersectionBase::boundarySegmentIndex\n+size_t boundarySegmentIndex() const\n+Definition intersection.cc:64\n+Dune::AlbertaGridIntersectionBase::type\n+GeometryType type() const\n+Definition intersection.cc:82\n+Dune::AlbertaGridIntersectionBase::transformation\n+AlbertaTransformation transformation() const\n+Definition intersection.cc:213\n+Dune::AlbertaGridIntersectionBase::outerNormal\n+NormalVector outerNormal(const LocalCoordType &local) const\n+Definition intersection.cc:197\n+Dune::AlbertaGridIntersectionBase::boundaryId\n+int boundaryId() const\n+Definition intersection.cc:50\n+Dune::AlbertaGridIntersectionBase::grid_\n+const Grid * grid_\n+Definition albertagrid/intersection.hh:92\n+Dune::Alberta::MapVertices\n+Definition misc.hh:443\n+Dune::Alberta::BasicNodeProjection\n+Definition albertagrid/projection.hh:208\n+Dune::Alberta::BasicNodeProjection::boundaryIndex\n+unsigned int boundaryIndex() const\n+Definition albertagrid/projection.hh:218\n+Dune::AlbertaTransformation\n+Definition transformation.hh:18\n+Dune::Entity::Geometry\n+GridImp::template Codim< cd >::Geometry Geometry\n+The corresponding geometry type.\n+Definition common/entity.hh:100\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/grid.hh:390\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00698.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00698.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: geometryreference.hh File Reference\n+dune-grid: agrid.hh File Reference\n \n \n \n \n \n \n \n@@ -71,42 +71,95 @@\n \n
    \n
    \n
    \n \n-
    geometryreference.hh File Reference
    \n+Namespaces |\n+Macros
    \n+
    agrid.hh File Reference
    \n
    \n
    \n \n-

    Wrapper and interface classes for element geometries. \n+

    provides the AlbertaGrid class \n More...

    \n-
    #include <dune/common/typetraits.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/geometry.hh>
    \n+
    #include <cassert>
    \n+#include <cstddef>
    \n+#include <algorithm>
    \n+#include <iostream>
    \n+#include <fstream>
    \n+#include <memory>
    \n+#include <vector>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/common/fmatrix.hh>
    \n+#include <dune/common/stdstreams.hh>
    \n+#include <dune/common/parallel/communication.hh>
    \n+#include <dune/grid/common/grid.hh>
    \n+#include <dune/grid/common/gridfactory.hh>
    \n+#include <dune/grid/common/adaptcallback.hh>
    \n+#include <dune/grid/common/sizecache.hh>
    \n+#include "albertaheader.hh"
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/capabilities.hh>
    \n+#include <dune/grid/albertagrid/backuprestore.hh>
    \n+#include <dune/grid/albertagrid/coordcache.hh>
    \n+#include <dune/grid/albertagrid/gridfamily.hh>
    \n+#include <dune/grid/albertagrid/level.hh>
    \n+#include <dune/grid/albertagrid/intersection.hh>
    \n+#include <dune/grid/albertagrid/intersectioniterator.hh>
    \n+#include <dune/grid/albertagrid/datahandle.hh>
    \n+#include <dune/grid/albertagrid/entityseed.hh>
    \n+#include "indexsets.hh"
    \n+#include "geometry.hh"
    \n+#include "entity.hh"
    \n+#include "hierarchiciterator.hh"
    \n+#include "treeiterator.hh"
    \n+#include "leveliterator.hh"
    \n+#include "leafiterator.hh"
    \n+#include "albertagrid.cc"
    \n+#include <dune/grid/albertagrid/undefine-3.0.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::GeometryReference< Implementation >
     
    class  Dune::LocalGeometryReference< mydim, cdim, Grid >
    class  Dune::AlbertaGrid< dim, dimworld >
     [ provides Dune::Grid ] More...
     
    \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n

    \n+Macros

    #define _ALBERTA_H_
     
    \n

    Detailed Description

    \n-

    Wrapper and interface classes for element geometries.

    \n-
    \n+

    provides the AlbertaGrid class

    \n+
    Author
    Robert Kloefkorn and Martin Nolte
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ _ALBERTA_H_

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define _ALBERTA_H_
    \n+
    \n+\n+
    \n+
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,27 +1,66 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-geometryreference.hh File Reference\n-Wrapper and interface classes for element geometries. More...\n-#include \n-#include \n-#include \n+Classes | Namespaces | Macros\n+agrid.hh File Reference\n+provides the AlbertaGrid class 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 \"albertaheader.hh\"\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \"indexsets.hh\"\n+#include \"geometry.hh\"\n+#include \"entity.hh\"\n+#include \"hierarchiciterator.hh\"\n+#include \"treeiterator.hh\"\n+#include \"leveliterator.hh\"\n+#include \"leafiterator.hh\"\n+#include \"albertagrid.cc\"\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::GeometryReference<_Implementation_>\n-\u00a0\n-class \u00a0 Dune::LocalGeometryReference<_mydim,_cdim,_Grid_>\n+class \u00a0 Dune::AlbertaGrid<_dim,_dimworld_>\n+\u00a0 [ provides Dune::Grid ] More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+Macros\n+#define\u00a0 _ALBERTA_H_\n+\u00a0\n ***** Detailed Description *****\n-Wrapper and interface classes for element geometries.\n+provides the AlbertaGrid class\n+ Author\n+ Robert Kloefkorn and Martin Nolte\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0_ALBERTA_H_ *****\n+#define _ALBERTA_H_\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00698_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00698_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: geometryreference.hh Source File\n+dune-grid: agrid.hh Source File\n \n \n \n \n \n \n \n@@ -74,225 +74,845 @@\n \n \n
    \n
    \n-
    geometryreference.hh
    \n+
    agrid.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
    \n-
    6#define DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
    \n+
    5#ifndef DUNE_ALBERTAGRID_IMP_HH
    \n+
    6#define DUNE_ALBERTAGRID_IMP_HH
    \n
    7
    \n-
    12#include <dune/common/typetraits.hh>
    \n-
    13
    \n-
    14#include <dune/geometry/type.hh>
    \n-
    15
    \n-\n+
    13#if HAVE_ALBERTA || DOXYGEN
    \n+
    14
    \n+
    15#include <cassert>
    \n+
    16#include <cstddef>
    \n
    17
    \n-
    18namespace Dune
    \n-
    19{
    \n-
    20
    \n-
    21 // GeometryReference
    \n-
    22 // -----------------
    \n+
    18#include <algorithm>
    \n+
    19#include <iostream>
    \n+
    20#include <fstream>
    \n+
    21#include <memory>
    \n+
    22#include <vector>
    \n
    23
    \n-
    24 template< class Implementation >
    \n-
    \n-\n-
    26 {
    \n-\n-
    28
    \n-
    29 public:
    \n-
    30 static const int mydimension = Implementation::mydimension;
    \n-
    31 static const int coorddimension = Implementation::coorddimension;
    \n-
    32
    \n-
    33 typedef typename Implementation::ctype ctype;
    \n+
    24// Dune includes
    \n+
    25#include <dune/common/fvector.hh>
    \n+
    26#include <dune/common/fmatrix.hh>
    \n+
    27#include <dune/common/stdstreams.hh>
    \n+
    28#include <dune/common/parallel/communication.hh>
    \n+
    29
    \n+\n+\n+\n+\n
    34
    \n-
    35 typedef typename Implementation::LocalCoordinate LocalCoordinate;
    \n-
    36 typedef typename Implementation::GlobalCoordinate GlobalCoordinate;
    \n-
    37
    \n-
    38 typedef typename Implementation::JacobianInverseTransposed JacobianInverseTransposed;
    \n-
    39 typedef typename Implementation::JacobianTransposed JacobianTransposed;
    \n-
    40
    \n-
    41 private:
    \n+
    35//- Local includes
    \n+
    36// some cpp defines and include of alberta.h
    \n+
    37#include "albertaheader.hh"
    \n+
    38
    \n+\n+\n+\n
    42
    \n-
    43 template<class Implementation_T>
    \n-
    44 using JacobianInverseOfImplementation = decltype(typename Implementation_T::JacobianInverse{std::declval<Implementation_T>().jacobianInverse(std::declval<LocalCoordinate>())});
    \n-
    45
    \n-
    46 using JacobianInverseDefault = decltype(transpose(std::declval<JacobianInverseTransposed>()));
    \n-
    47
    \n-
    48 template<class Implementation_T>
    \n-
    49 using JacobianOfImplementation = decltype(typename Implementation_T::Jacobian{std::declval<Implementation_T>().jacobian(std::declval<LocalCoordinate>())});
    \n+\n+\n+\n+\n+\n+\n+\n
    50
    \n-
    51 using JacobianDefault = decltype(transpose(std::declval<JacobianTransposed>()));
    \n-
    52
    \n-
    53
    \n-
    54 template <class I = Implementation>
    \n-
    55 [[deprecated("Geometry implementatons are required to provide a jacobian(local) method. The default implementation is deprecated and will be removed after release 2.9")]]
    \n-
    56 auto deprecatedDefaultJacobian ( const LocalCoordinate& local ) const {
    \n-
    57 return transpose(jacobianTransposed(local));
    \n-
    58 }
    \n-
    59
    \n-
    60 template <class I = Implementation>
    \n-
    61 [[deprecated("Geometry implementatons are required to provide a jacobianInverse(local) method. The default implementation is deprecated and will be removed after release 2.9")]]
    \n-
    62 auto deprecatedDefaultJacobianInverse ( const LocalCoordinate& local ) const {
    \n-
    63 return transpose(jacobianInverseTransposed(local));
    \n-
    64 }
    \n-
    65
    \n-
    66 public:
    \n+
    51#include "indexsets.hh"
    \n+
    52#include "geometry.hh"
    \n+
    53#include "entity.hh"
    \n+
    54#include "hierarchiciterator.hh"
    \n+
    55#include "treeiterator.hh"
    \n+
    56#include "leveliterator.hh"
    \n+
    57#include "leafiterator.hh"
    \n+
    58
    \n+
    \n+
    59namespace Dune
    \n+
    60{
    \n+
    61
    \n+
    62 // External Forward Declarations
    \n+
    63 // -----------------------------
    \n+
    64
    \n+
    65 template< class Grid >
    \n+
    66 struct DGFGridFactory;
    \n
    67
    \n-
    68 using Jacobian = Std::detected_or_t<JacobianDefault, JacobianOfImplementation, Implementation>;
    \n-
    69 using JacobianInverse = Std::detected_or_t<JacobianInverseDefault, JacobianInverseOfImplementation, Implementation>;
    \n-
    70
    \n-
    \n-
    71 explicit GeometryReference ( const Implementation &impl )
    \n-
    72 : impl_( &impl )
    \n-
    73 {}
    \n-
    \n-
    74
    \n-
    75 GeometryType type () const { return impl().type(); }
    \n-
    76
    \n-
    77 bool affine() const { return impl().affine(); }
    \n-
    78
    \n-
    79 int corners () const { return impl().corners(); }
    \n-
    80 GlobalCoordinate corner ( int i ) const { return impl().corner( i ); }
    \n-
    81 GlobalCoordinate center () const { return impl().center(); }
    \n-
    82
    \n-
    \n-\n-
    84 {
    \n-
    85 return impl().global( local );
    \n-
    86 }
    \n-
    \n-
    87
    \n-
    \n-\n-
    89 {
    \n-
    90 return impl().local( global );
    \n-
    91 }
    \n-
    \n-
    92
    \n-
    \n-\n-
    94 {
    \n-
    95 return impl().integrationElement( local );
    \n-
    96 }
    \n-
    \n-
    97
    \n-
    98 ctype volume () const { return impl().volume(); }
    \n-
    99
    \n-
    \n-\n-
    101 {
    \n-
    102 return impl().jacobianTransposed( local );
    \n-
    103 }
    \n-
    \n-
    104
    \n-
    \n-\n-
    106 {
    \n-
    107 return impl().jacobianInverseTransposed( local );
    \n-
    108 }
    \n-
    \n-
    109
    \n-
    \n-\n-
    111 {
    \n-
    112 if constexpr(Std::is_detected_v<JacobianOfImplementation, Implementation>)
    \n-
    113 return impl().jacobian(local);
    \n-
    114 else
    \n-
    115 return deprecatedDefaultJacobian(local);
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    \n-\n-
    119 {
    \n-
    120 if constexpr(Std::is_detected_v<JacobianInverseOfImplementation, Implementation>)
    \n-
    121 return impl().jacobianInverse(local);
    \n-
    122 else
    \n-
    123 return deprecatedDefaultJacobianInverse(local);
    \n-
    124 }
    \n-
    \n-
    125
    \n-
    126 const Implementation &impl () const { return *impl_; }
    \n-
    127
    \n-
    128 private:
    \n-
    129 const Implementation *impl_;
    \n-
    130 };
    \n-
    \n-
    131
    \n-
    132
    \n-
    133 // LocalGeometryReference
    \n-
    134 // -----------------------
    \n+
    68
    \n+
    69
    \n+
    70 // AlbertaGrid
    \n+
    71 // -----------
    \n+
    72
    \n+
    105 template< int dim, int dimworld = Alberta::dimWorld >
    \n+
    \n+\n+\n+
    108 < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
    \n+
    109 {
    \n+\n+\n+\n+
    113 Base;
    \n+
    114
    \n+
    115 template< int, int, class > friend class AlbertaGridEntity;
    \n+
    116 template< class > friend class AlbertaLevelGridView;
    \n+
    117 template< class > friend class AlbertaLeafGridView;
    \n+
    118 template< int, class, bool > friend class AlbertaGridTreeIterator;
    \n+
    119 template< class > friend class AlbertaGridHierarchicIterator;
    \n+
    120
    \n+
    121 friend class GridFactory< This >;
    \n+
    122 friend struct DGFGridFactory< This >;
    \n+
    123
    \n+
    124 friend class AlbertaGridIntersectionBase< const This >;
    \n+
    125 friend class AlbertaGridLeafIntersection< const This >;
    \n+
    126
    \n+
    127 friend class AlbertaMarkerVector< dim, dimworld >;
    \n+
    128#if (__GNUC__ < 4) && !(defined __ICC)
    \n+
    129 // add additional friend decls for gcc 3.4
    \n+
    130 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<true>;
    \n+
    131 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<false>;
    \n+
    132#endif
    \n+
    133 friend class AlbertaGridIndexSet< dim, dimworld >;
    \n+\n
    135
    \n-
    136 template< int mydim, int cdim, class Grid >
    \n-
    \n-\n-
    138 : public GeometryReference< typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl >
    \n-
    139 {
    \n-
    140 typedef typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl Implementation;
    \n-
    141
    \n-
    142 public:
    \n-
    \n-
    143 LocalGeometryReference ( const Implementation &impl )
    \n-
    144 : GeometryReference< Implementation >( impl )
    \n-
    145 {}
    \n-
    \n-
    146 };
    \n-
    \n+
    136 template< class, class >
    \n+\n+
    138
    \n+
    139 public:
    \n+\n+
    142
    \n+\n+
    144
    \n+\n+\n
    147
    \n-
    148
    \n-
    149
    \n-
    150 // Definitions of GeometryReference
    \n-
    151 // --------------------------------
    \n-
    152
    \n-
    153 template< class Implementation >
    \n-\n+
    148 // the Traits
    \n+\n+
    150
    \n+\n+\n
    155
    \n-
    156 template< class Implementation >
    \n-\n+\n
    158
    \n-
    159} // namespace Dune
    \n-
    160
    \n-
    161#endif // #ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
    \n+\n+\n+
    163
    \n+\n+
    166
    \n+
    167 private:
    \n+
    169 typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
    \n+
    170
    \n+
    172 typedef AlbertaGridIdSet<dim,dimworld> IdSetImp;
    \n+
    173
    \n+
    175 struct AdaptationState
    \n+
    176 {
    \n+
    177 enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };
    \n+
    178
    \n+
    179 private:
    \n+
    180 Phase phase_;
    \n+
    181 int coarsenMarked_;
    \n+
    182 int refineMarked_;
    \n+
    183
    \n+
    184 public:
    \n+
    185 AdaptationState ()
    \n+
    186 : phase_( ComputationPhase ),
    \n+
    187 coarsenMarked_( 0 ),
    \n+
    188 refineMarked_( 0 )
    \n+
    189 {}
    \n+
    190
    \n+
    191 void mark ( int count )
    \n+
    192 {
    \n+
    193 if( count < 0 )
    \n+
    194 ++coarsenMarked_;
    \n+
    195 if( count > 0 )
    \n+
    196 refineMarked_ += (2 << count);
    \n+
    197 }
    \n+
    198
    \n+
    199 void unmark ( int count )
    \n+
    200 {
    \n+
    201 if( count < 0 )
    \n+
    202 --coarsenMarked_;
    \n+
    203 if( count > 0 )
    \n+
    204 refineMarked_ -= (2 << count);
    \n+
    205 }
    \n+
    206
    \n+
    207 bool coarsen () const
    \n+
    208 {
    \n+
    209 return (coarsenMarked_ > 0);
    \n+
    210 }
    \n+
    211
    \n+
    212 int refineMarked () const
    \n+
    213 {
    \n+
    214 return refineMarked_;
    \n+
    215 }
    \n+
    216
    \n+
    217 void preAdapt ()
    \n+
    218 {
    \n+
    219 if( phase_ != ComputationPhase )
    \n+
    220 error( "preAdapt may only be called in computation phase." );
    \n+
    221 phase_ = PreAdaptationPhase;
    \n+
    222 }
    \n+
    223
    \n+
    224 void adapt ()
    \n+
    225 {
    \n+
    226 if( phase_ != PreAdaptationPhase )
    \n+
    227 error( "adapt may only be called in preadapdation phase." );
    \n+
    228 phase_ = PostAdaptationPhase;
    \n+
    229 }
    \n+
    230
    \n+
    231 void postAdapt ()
    \n+
    232 {
    \n+
    233 if( phase_ != PostAdaptationPhase )
    \n+
    234 error( "postAdapt may only be called in postadaptation phase." );
    \n+
    235 phase_ = ComputationPhase;
    \n+
    236
    \n+
    237 coarsenMarked_ = 0;
    \n+
    238 refineMarked_ = 0;
    \n+
    239 }
    \n+
    240
    \n+
    241 private:
    \n+
    242 void error ( const std::string &message )
    \n+
    243 {
    \n+\n+
    245 }
    \n+
    246 };
    \n+
    247
    \n+
    248 template< class DataHandler >
    \n+
    249 struct AdaptationCallback;
    \n+
    250
    \n+
    251 // max number of allowed levels is 64
    \n+
    252 static const int MAXL = 64;
    \n+
    253
    \n+
    254 typedef Alberta::ElementInfo< dimension > ElementInfo;
    \n+
    255 typedef Alberta::MeshPointer< dimension > MeshPointer;
    \n+\n+
    257 typedef AlbertaGridLevelProvider< dimension > LevelProvider;
    \n+
    258
    \n+
    259 public:
    \n+
    260 AlbertaGrid ( const This & ) = delete;
    \n+
    261 This &operator= ( const This & ) = delete;
    \n+
    262
    \n+
    264 AlbertaGrid ();
    \n+
    265
    \n+\n+
    272 const std::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection
    \n+
    273 = std::shared_ptr< DuneBoundaryProjection< dimensionworld > >() );
    \n+
    274
    \n+
    275 template< class Proj, class Impl >
    \n+\n+
    277 const Alberta::ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
    \n+
    278
    \n+
    283 AlbertaGrid ( const std::string &macroGridFileName );
    \n+
    284
    \n+
    286 ~AlbertaGrid ();
    \n+
    287
    \n+
    290 int maxLevel () const;
    \n+
    291
    \n+
    293 template<int cd, PartitionIteratorType pitype>
    \n+
    294 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
    \n+
    295 lbegin (int level) const;
    \n+
    296
    \n+
    298 template<int cd, PartitionIteratorType pitype>
    \n+
    299 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
    \n+
    300 lend (int level) const;
    \n+
    301
    \n+
    303 template< int codim >
    \n+\n+
    305 lbegin ( int level ) const;
    \n+
    306
    \n+
    308 template< int codim >
    \n+\n+
    310 lend ( int level ) const;
    \n+
    311
    \n+
    313 template< int codim, PartitionIteratorType pitype >
    \n+
    314 typename Traits
    \n+
    315 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n+
    316 leafbegin () const;
    \n+
    317
    \n+
    319 template< int codim, PartitionIteratorType pitype >
    \n+
    320 typename Traits
    \n+
    321 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n+
    322 leafend () const;
    \n+
    323
    \n+
    325 template< int codim >
    \n+\n+
    327 leafbegin () const;
    \n+
    328
    \n+
    330 template< int codim >
    \n+\n+
    332 leafend () const;
    \n+
    333
    \n+
    338 int size (int level, int codim) const;
    \n+
    339
    \n+
    341 int size (int level, GeometryType type) const;
    \n+
    342
    \n+
    344 int size (int codim) const;
    \n+
    345
    \n+
    347 int size (GeometryType type) const;
    \n+
    348
    \n+
    \n+
    350 std::size_t numBoundarySegments () const
    \n+
    351 {
    \n+
    352 return numBoundarySegments_;
    \n+
    353 }
    \n+
    \n+
    354
    \n+
    \n+
    356 typename Traits::LevelGridView levelGridView ( int level ) const
    \n+
    357 {
    \n+
    358 typedef typename Traits::LevelGridView View;
    \n+
    359 typedef typename View::GridViewImp ViewImp;
    \n+
    360 return View( ViewImp( *this, level ) );
    \n+
    361 }
    \n+
    \n+
    362
    \n+
    \n+\n+
    365 {
    \n+
    366 typedef typename Traits::LeafGridView View;
    \n+
    367 typedef typename View::GridViewImp ViewImp;
    \n+
    368 return View( ViewImp( *this ) );
    \n+
    369 }
    \n+
    \n+
    370
    \n+
    371 public:
    \n+
    372 //***************************************************************
    \n+
    373 // Interface for Adaptation
    \n+
    374 //***************************************************************
    \n+
    375 using Base::getMark;
    \n+
    376 using Base::mark;
    \n+
    377
    \n+
    379 int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const;
    \n+
    380
    \n+
    382 bool mark ( int refCount, const typename Traits::template Codim< 0 >::Entity &e );
    \n+
    383
    \n+
    385 void globalRefine ( int refCount );
    \n+
    386
    \n+
    387 template< class DataHandle >
    \n+
    388 void globalRefine ( int refCount, AdaptDataHandleInterface< This, DataHandle > &handle );
    \n+
    389
    \n+
    391 bool adapt ();
    \n+
    392
    \n+
    394 template< class DataHandle >
    \n+\n+
    396
    \n+
    398 bool preAdapt ();
    \n+
    399
    \n+
    401 void postAdapt();
    \n+
    402
    \n+
    \n+
    405 const Communication &comm () const
    \n+
    406 {
    \n+
    407 return comm_;
    \n+
    408 }
    \n+
    \n+
    409
    \n+
    \n+
    410 static std::string typeName ()
    \n+
    411 {
    \n+
    412 std::ostringstream s;
    \n+
    413 s << "AlbertaGrid< " << dim << ", " << dimworld << " >";
    \n+
    414 return s.str();
    \n+
    415 }
    \n+
    \n+
    416
    \n+
    418 template< class EntitySeed >
    \n+
    419 typename Traits::template Codim< EntitySeed::codimension >::Entity
    \n+
    \n+
    420 entity ( const EntitySeed &seed ) const
    \n+
    421 {
    \n+\n+
    423 return EntityImpl( *this, seed.impl().elementInfo( meshPointer() ), seed.impl().subEntity() );
    \n+
    424 }
    \n+
    \n+
    425
    \n+
    426 //**********************************************************
    \n+
    427 // End of Interface Methods
    \n+
    428 //**********************************************************
    \n+
    430 bool writeGrid( const std::string &filename, ctype time ) const;
    \n+
    431
    \n+
    433 bool readGrid( const std::string &filename, ctype &time );
    \n+
    434
    \n+
    435 // return hierarchic index set
    \n+
    436 const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
    \n+
    437
    \n+
    439 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
    \n+
    440
    \n+
    442 const typename Traits :: LeafIndexSet & leafIndexSet () const;
    \n+
    443
    \n+
    \n+
    445 const GlobalIdSet &globalIdSet () const
    \n+
    446 {
    \n+
    447 return idSet_;
    \n+
    448 }
    \n+
    \n+
    449
    \n+
    \n+
    451 const LocalIdSet &localIdSet () const
    \n+
    452 {
    \n+
    453 return idSet_;
    \n+
    454 }
    \n+
    \n+
    455
    \n+
    456 // access to mesh pointer, needed by some methods
    \n+
    \n+\n+
    458 {
    \n+
    459 return mesh_;
    \n+
    460 };
    \n+
    \n+
    461
    \n+
    \n+
    462 const MeshPointer &meshPointer () const
    \n+
    463 {
    \n+
    464 return mesh_;
    \n+
    465 }
    \n+
    \n+
    466
    \n+
    \n+\n+
    468 {
    \n+
    469 return dofNumbering_;
    \n+
    470 }
    \n+
    \n+
    471
    \n+
    \n+\n+
    473 {
    \n+
    474 return levelProvider_;
    \n+
    475 }
    \n+
    \n+
    476
    \n+
    \n+
    477 int dune2alberta ( int codim, int i ) const
    \n+
    478 {
    \n+
    479 return numberingMap_.dune2alberta( codim, i );
    \n+
    480 }
    \n+
    \n+
    481
    \n+
    \n+
    482 int alberta2dune ( int codim, int i ) const
    \n+
    483 {
    \n+
    484 return numberingMap_.alberta2dune( codim, i );
    \n+
    485 }
    \n+
    \n+
    486
    \n+
    \n+
    487 int generic2alberta ( int codim, int i ) const
    \n+
    488 {
    \n+
    489 return genericNumberingMap_.dune2alberta( codim, i );
    \n+
    490 }
    \n+
    \n+
    491
    \n+
    \n+
    492 int alberta2generic ( int codim, int i ) const
    \n+
    493 {
    \n+
    494 return genericNumberingMap_.alberta2dune( codim, i );
    \n+
    495 }
    \n+
    \n+
    496
    \n+
    497 private:
    \n+
    498 typedef std::vector<int> ArrayType;
    \n+
    499
    \n+
    500 void setup ();
    \n+
    501
    \n+
    502 // make the calculation of indexOnLevel and so on.
    \n+
    503 // extra method because of Reihenfolge
    \n+
    504 void calcExtras();
    \n+
    505
    \n+
    506 private:
    \n+
    507 // delete mesh and all vectors
    \n+
    508 void removeMesh();
    \n+
    509
    \n+
    510 //***********************************************************************
    \n+
    511 // MemoryManagement for Entities and Geometries
    \n+
    512 //**********************************************************************
    \n+\n+\n+
    515
    \n+
    516 public:
    \n+\n+
    518
    \n+
    519 template< int codim >
    \n+
    520 static int
    \n+
    \n+\n+
    522 {
    \n+
    523 return entity.impl().twist();
    \n+
    524 }
    \n+
    \n+
    525
    \n+
    526 template< int codim >
    \n+
    527 static int
    \n+
    \n+
    528 getTwist ( const typename Traits::template Codim< 0 >::Entity &entity, int subEntity )
    \n+
    529 {
    \n+
    530 return entity.impl().template twist< codim >( subEntity );
    \n+
    531 }
    \n+
    \n+
    532
    \n+
    533 static int
    \n+
    \n+
    534 getTwistInInside ( const typename Traits::LeafIntersection &intersection )
    \n+
    535 {
    \n+
    536 return intersection.impl().twistInInside();
    \n+
    537 }
    \n+
    \n+
    538
    \n+
    539 static int
    \n+
    \n+
    540 getTwistInOutside ( const typename Traits::LeafIntersection &intersection )
    \n+
    541 {
    \n+
    542 return intersection.impl().twistInOutside();
    \n+
    543 }
    \n+
    \n+
    544
    \n+
    545 public:
    \n+
    546 // read global element number from elNumbers_
    \n+\n+
    548 getCoord ( const ElementInfo &elementInfo, int vertex ) const;
    \n+
    549
    \n+
    550 private:
    \n+
    551 // pointer to an Albert Mesh, which contains the data
    \n+
    552 MeshPointer mesh_;
    \n+
    553
    \n+
    554 // communication
    \n+
    555 Communication comm_;
    \n+
    556
    \n+
    557 // maximum level of the mesh
    \n+
    558 int maxlevel_;
    \n+
    559
    \n+
    560 // number of boundary segments within the macro grid
    \n+
    561 size_t numBoundarySegments_;
    \n+
    562
    \n+
    563 // map between ALBERTA and DUNE numbering
    \n+\n+\n+
    566
    \n+
    567 DofNumbering dofNumbering_;
    \n+
    568
    \n+
    569 LevelProvider levelProvider_;
    \n+
    570
    \n+
    571 // hierarchical numbering of AlbertaGrid, unique per codim
    \n+
    572 HierarchicIndexSet hIndexSet_;
    \n+
    573
    \n+
    574 // the id set of this grid
    \n+
    575 IdSetImp idSet_;
    \n+
    576
    \n+
    577 // the level index set, is generated from the HierarchicIndexSet
    \n+
    578 // is generated, when accessed
    \n+
    579 mutable std::vector< typename GridFamily::LevelIndexSetImp * > levelIndexVec_;
    \n+
    580
    \n+
    581 // the leaf index set, is generated from the HierarchicIndexSet
    \n+
    582 // is generated, when accessed
    \n+
    583 mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;
    \n+
    584
    \n+
    585 SizeCache< This > sizeCache_;
    \n+
    586
    \n+
    587 typedef AlbertaMarkerVector< dim, dimworld > MarkerVector;
    \n+
    588
    \n+
    589 // needed for VertexIterator, mark on which element a vertex is treated
    \n+
    590 mutable MarkerVector leafMarkerVector_;
    \n+
    591
    \n+
    592 // needed for VertexIterator, mark on which element a vertex is treated
    \n+
    593 mutable std::vector< MarkerVector > levelMarkerVector_;
    \n+
    594
    \n+
    595#if DUNE_ALBERTA_CACHE_COORDINATES
    \n+\n+
    597#endif
    \n+
    598
    \n+
    599 // current state of adaptation
    \n+
    600 AdaptationState adaptationState_;
    \n+
    601 };
    \n+
    \n+
    602
    \n+
    603} // namespace Dune
    \n+
    \n+
    604
    \n+
    605#include "albertagrid.cc"
    \n+
    606
    \n+
    607// undef all dangerous defines
    \n+
    608#undef DIM
    \n+
    609#undef DIM_OF_WORLD
    \n+
    610
    \n+
    611#ifdef _ABS_NOT_DEFINED_
    \n+
    612#undef ABS
    \n+
    613#endif
    \n+
    614
    \n+
    615#ifdef _MIN_NOT_DEFINED_
    \n+
    616#undef MIN
    \n+
    617#endif
    \n+
    618
    \n+
    619#ifdef _MAX_NOT_DEFINED_
    \n+
    620#undef MAX
    \n+
    621#endif
    \n+
    622
    \n+
    623#ifdef obstack_chunk_alloc
    \n+
    624#undef obstack_chunk_alloc
    \n+
    625#endif
    \n+
    626#ifdef obstack_chunk_free
    \n+
    627#undef obstack_chunk_free
    \n+
    628#endif
    \n+\n+
    630
    \n+
    631// We use MEM_ALLOC, so undefine it here.
    \n+
    632#undef MEM_ALLOC
    \n+
    633
    \n+
    634// We use MEM_REALLOC, so undefine it here.
    \n+
    635#undef MEM_REALLOC
    \n+
    636
    \n+
    637// We use MEM_CALLOC, so undefine it here.
    \n+
    638#undef MEM_CALLOC
    \n+
    639
    \n+
    640// We use MEM_FREE, so undefine it here.
    \n+
    641#undef MEM_FREE
    \n+
    642
    \n+
    643// Macro ERROR may be defined by alberta_util.h. If so, undefine it.
    \n+
    644#ifdef ERROR
    \n+
    645#undef ERROR
    \n+
    646#endif // #ifdef ERROR
    \n+
    647
    \n+
    648// Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.
    \n+
    649#ifdef ERROR_EXIT
    \n+
    650#undef ERROR_EXIT
    \n+
    651#endif // #ifdef ERROR_EXIT
    \n+
    652
    \n+
    653// Macro WARNING may be defined by alberta_util.h. If so, undefine it.
    \n+
    654#ifdef WARNING
    \n+
    655#undef WARNING
    \n+
    656#endif // #ifdef WARNING
    \n+
    657
    \n+
    658// Macro TEST may be defined by alberta_util.h. If so, undefine it.
    \n+
    659#ifdef TEST
    \n+
    660#undef TEST
    \n+
    661#endif // #ifdef TEST
    \n+
    662
    \n+
    663// Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
    \n+
    664#ifdef TEST_EXIT
    \n+
    665#undef TEST_EXIT
    \n+
    666#endif // #ifdef TEST_EXIT
    \n+
    667
    \n+
    668// Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.
    \n+
    669#ifdef DEBUG_TEST
    \n+
    670#undef DEBUG_TEST
    \n+
    671#endif // #ifdef DEBUG_TEST
    \n+
    672
    \n+
    673// Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
    \n+
    674#ifdef DEBUG_TEST_EXIT
    \n+
    675#undef DEBUG_TEST_EXIT
    \n+
    676#endif // #ifdef DEBUG_TEST_EXIT
    \n+
    677
    \n+
    678// Macro INFO may be defined by alberta_util.h. If so, undefine it.
    \n+
    679#ifdef INFO
    \n+
    680#undef INFO
    \n+
    681#endif // #ifdef INFO
    \n+
    682
    \n+
    683// Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.
    \n+
    684#ifdef PRINT_INFO
    \n+
    685#undef PRINT_INFO
    \n+
    686#endif // #ifdef PRINT_INFO
    \n+
    687
    \n+
    688// Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.
    \n+
    689#ifdef PRINT_INT_VEC
    \n+
    690#undef PRINT_INT_VEC
    \n+
    691#endif // #ifdef PRINT_INT_VEC
    \n+
    692
    \n+
    693// Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine it.
    \n+
    694#ifdef PRINT_REAL_VEC
    \n+
    695#undef PRINT_REAL_VEC
    \n+
    696#endif // #ifdef PRINT_REAL_VEC
    \n+
    697
    \n+
    698// Macro WAIT may be defined by alberta_util.h. If so, undefine it.
    \n+
    699#ifdef WAIT
    \n+
    700#undef WAIT
    \n+
    701#endif // #ifdef WAIT
    \n+
    702
    \n+
    703// Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.
    \n+
    704#ifdef WAIT_REALLY
    \n+
    705#undef WAIT_REALLY
    \n+
    706#endif // #ifdef WAIT_REALLY
    \n+
    707
    \n+
    708// Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
    \n+
    709#ifdef GET_WORKSPACE
    \n+
    710#undef GET_WORKSPACE
    \n+
    711#endif // #ifdef GET_WORKSPACE
    \n+
    712
    \n+
    713// Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
    \n+
    714#ifdef FREE_WORKSPACE
    \n+
    715#undef FREE_WORKSPACE
    \n+
    716#endif // #ifdef FREE_WORKSPACE
    \n+
    717
    \n+
    718// Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.
    \n+
    719#ifdef MAT_ALLOC
    \n+
    720#undef MAT_ALLOC
    \n+
    721#endif // #ifdef MAT_ALLOC
    \n+
    722
    \n+
    723// Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.
    \n+
    724#ifdef MAT_FREE
    \n+
    725#undef MAT_FREE
    \n+
    726#endif // #ifdef MAT_FREE
    \n+
    727
    \n+
    728// Macro NAME may be defined by alberta_util.h. If so, undefine it.
    \n+
    729#ifdef NAME
    \n+
    730#undef NAME
    \n+
    731#endif // #ifdef NAME
    \n+
    732
    \n+
    733// Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.
    \n+
    734#ifdef GET_STRUCT
    \n+
    735#undef GET_STRUCT
    \n+
    736#endif // #ifdef GET_STRUCT
    \n+
    737
    \n+
    738// Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.
    \n+
    739#ifdef ADD_PARAMETER
    \n+
    740#undef ADD_PARAMETER
    \n+
    741#endif // #ifdef ADD_PARAMETER
    \n+
    742
    \n+
    743// Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.
    \n+
    744#ifdef GET_PARAMETER
    \n+
    745#undef GET_PARAMETER
    \n+
    746#endif // #ifdef GET_PARAMETER
    \n+
    747
    \n+
    748#define _ALBERTA_H_
    \n+
    749
    \n+
    750#endif // HAVE_ALBERTA || DOXYGEN
    \n+
    751
    \n+
    752#endif
    \n+
    interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
    \n+
    Provides size cache classes to implement the grids size method efficiently.
    \n+\n+
    Contains #undefs for all preprocessor macros defined by alberta.
    \n+\n+\n+\n+\n+\n+\n+\n+
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition geometryreference.hh:26
    \n-
    static const int mydimension
    Definition geometryreference.hh:30
    \n-
    ctype integrationElement(const LocalCoordinate &local) const
    Definition geometryreference.hh:93
    \n-
    ctype volume() const
    Definition geometryreference.hh:98
    \n-
    const Implementation & impl() const
    Definition geometryreference.hh:126
    \n-
    JacobianInverse jacobianInverse(const LocalCoordinate &local) const
    Definition geometryreference.hh:118
    \n-
    GlobalCoordinate center() const
    Definition geometryreference.hh:81
    \n-
    Implementation::JacobianTransposed JacobianTransposed
    Definition geometryreference.hh:39
    \n-
    GeometryReference(const Implementation &impl)
    Definition geometryreference.hh:71
    \n-
    Std::detected_or_t< JacobianInverseDefault, JacobianInverseOfImplementation, Implementation > JacobianInverse
    Definition geometryreference.hh:69
    \n-
    LocalCoordinate local(const GlobalCoordinate &global) const
    Definition geometryreference.hh:88
    \n-
    Implementation::GlobalCoordinate GlobalCoordinate
    Definition geometryreference.hh:36
    \n-
    static const int coorddimension
    Definition geometryreference.hh:31
    \n-
    bool affine() const
    Definition geometryreference.hh:77
    \n-
    GlobalCoordinate corner(int i) const
    Definition geometryreference.hh:80
    \n-
    JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
    Definition geometryreference.hh:105
    \n-
    JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
    Definition geometryreference.hh:100
    \n-
    int corners() const
    Definition geometryreference.hh:79
    \n-
    Implementation::LocalCoordinate LocalCoordinate
    Definition geometryreference.hh:35
    \n-
    GlobalCoordinate global(const LocalCoordinate &local) const
    Definition geometryreference.hh:83
    \n-
    Std::detected_or_t< JacobianDefault, JacobianOfImplementation, Implementation > Jacobian
    Definition geometryreference.hh:68
    \n-
    Implementation::ctype ctype
    Definition geometryreference.hh:33
    \n-
    Implementation::JacobianInverseTransposed JacobianInverseTransposed
    Definition geometryreference.hh:38
    \n-
    Jacobian jacobian(const LocalCoordinate &local) const
    Definition geometryreference.hh:110
    \n-
    GeometryType type() const
    Definition geometryreference.hh:75
    \n-
    Definition geometryreference.hh:139
    \n-
    LocalGeometryReference(const Implementation &impl)
    Definition geometryreference.hh:143
    \n-
    Wrapper and interface classes for element geometries.
    \n+
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n+
    bool readGrid(const std::string &filename, ctype &time)
    read Grid from file filename and store time of mesh in time
    Definition albertagrid.cc:585
    \n+
    const DofNumbering & dofNumbering() const
    Definition agrid.hh:467
    \n+
    int generic2alberta(int codim, int i) const
    Definition agrid.hh:487
    \n+
    static std::string typeName()
    Definition agrid.hh:410
    \n+
    Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
    return LeafIterator which points to first leaf entity
    \n+
    const HierarchicIndexSet & hierarchicIndexSet() const
    Definition agrid.hh:436
    \n+
    Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
    one past the end on this level
    \n+
    static const int dimension
    Definition agrid.hh:145
    \n+
    int dune2alberta(int codim, int i) const
    Definition agrid.hh:477
    \n+
    Traits::Communication Communication
    type of communication
    Definition agrid.hh:165
    \n+
    int maxLevel() const
    Definition albertagrid.cc:483
    \n+
    AlbertaGrid()
    create an empty grid
    Definition albertagrid.cc:42
    \n+
    Traits::template Codim< codim >::LevelIterator lbegin(int level) const
    Iterator to first entity of given codim on level.
    \n+
    const LevelProvider & levelProvider() const
    Definition agrid.hh:472
    \n+
    static int getTwistInOutside(const typename Traits::LeafIntersection &intersection)
    Definition agrid.hh:540
    \n+
    const Alberta::GlobalVector & getCoord(const ElementInfo &elementInfo, int vertex) const
    Definition albertagrid.cc:471
    \n+
    Traits::template Codim< codim >::LevelIterator lend(int level) const
    one past the end on this level
    \n+
    Traits::LeafGridView leafGridView() const
    View for the leaf grid for All_Partition.
    Definition agrid.hh:364
    \n+
    bool adapt()
    Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
    Definition albertagrid.cc:415
    \n+
    static const int dimensionworld
    Definition agrid.hh:146
    \n+
    static int getTwistInInside(const typename Traits::LeafIntersection &intersection)
    Definition agrid.hh:534
    \n+
    void postAdapt()
    clean up some markers
    Definition albertagrid.cc:356
    \n+
    Traits::template Codim< codim >::LeafIterator leafbegin() const
    return LeafIterator which points to first leaf entity
    \n+
    const LocalIdSet & localIdSet() const
    return local IdSet
    Definition agrid.hh:451
    \n+
    std::size_t numBoundarySegments() const
    number of boundary segments within the macro grid
    Definition agrid.hh:350
    \n+
    GridFamily::ctype ctype
    Definition agrid.hh:143
    \n+
    AlbertaGrid(const This &)=delete
    \n+
    Traits::template Codim< codim >::LeafIterator leafend() const
    return LeafIterator which points behind last leaf entity
    \n+
    const Traits::LevelIndexSet & levelIndexSet(int level) const
    return level index set for given level
    Definition albertagrid.cc:520
    \n+
    int alberta2generic(int codim, int i) const
    Definition agrid.hh:492
    \n+
    static int getTwist(const typename Traits::template Codim< codim >::Entity &entity)
    Definition agrid.hh:521
    \n+
    const Communication & comm() const
    return reference to communication, if MPI found this is specialisation for MPI
    Definition agrid.hh:405
    \n+
    ALBERTA MESH * getMesh() const
    Definition agrid.hh:457
    \n+
    int size(int level, int codim) const
    Number of grid entities per level and codim because lbegin and lend are none const,...
    Definition albertagrid.cc:490
    \n+
    Traits::HierarchicIndexSet HierarchicIndexSet
    type of hierarchic index set
    Definition agrid.hh:157
    \n+
    const Traits::LeafIndexSet & leafIndexSet() const
    return leaf index set
    Definition albertagrid.cc:535
    \n+
    Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
    return LeafIterator which points behind last leaf entity
    \n+
    bool writeGrid(const std::string &filename, ctype time) const
    write Grid to file in Xdr
    Definition albertagrid.cc:575
    \n+
    Traits::LevelGridView levelGridView(int level) const
    View for a grid level for All_Partition.
    Definition agrid.hh:356
    \n+
    int alberta2dune(int codim, int i) const
    Definition agrid.hh:482
    \n+
    This & operator=(const This &)=delete
    \n+
    AlbertaGridFamily< dim, dimworld >::Traits Traits
    Definition agrid.hh:149
    \n+
    static int getTwist(const typename Traits::template Codim< 0 >::Entity &entity, int subEntity)
    Definition agrid.hh:528
    \n+
    Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
    Iterator to first entity of given codim on level.
    \n+
    const GlobalIdSet & globalIdSet() const
    return global IdSet
    Definition agrid.hh:445
    \n+
    void globalRefine(int refCount)
    uses the interface, mark on entity and refineLocal
    Definition albertagrid.cc:304
    \n+
    int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
    returns adaptation mark for given entity
    Definition albertagrid.cc:408
    \n+
    Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
    obtain Entity from EntitySeed.
    Definition agrid.hh:420
    \n+
    ~AlbertaGrid()
    destructor
    Definition albertagrid.cc:196
    \n+
    bool preAdapt()
    returns true, if a least one element is marked for coarsening
    Definition albertagrid.cc:348
    \n+
    bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
    Marks an entity to be refined/coarsened in a subsequent adapt.
    Definition albertagrid.cc:385
    \n+
    const MeshPointer & meshPointer() const
    Definition agrid.hh:462
    \n+
    Definition coordcache.hh:25
    \n+
    Definition albertagrid/datahandle.hh:27
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    Implementation & impl()
    access to the underlying implementation
    Definition common/intersection.hh:178
    \n+\n+\n+\n+
    Definition treeiterator.hh:189
    \n+
    Definition hierarchiciterator.hh:29
    \n+
    Definition albertagrid/intersection.hh:105
    \n+
    Definition albertagrid/intersectioniterator.hh:27
    \n+
    Definition albertagrid/entity.hh:46
    \n+
    Definition albertagrid/indexsets.hh:42
    \n+
    hierarchic index set of AlbertaGrid
    Definition albertagrid/indexsets.hh:518
    \n+
    Definition albertagrid/indexsets.hh:329
    \n+
    Definition albertagrid/gridfamily.hh:83
    \n+
    static const int dimension
    Definition albertagrid/gridfamily.hh:88
    \n+
    static const int dimensionworld
    Definition albertagrid/gridfamily.hh:89
    \n+
    AlbertaGridIndexSet< dim, dimworld > LeafIndexSetImp
    Definition albertagrid/gridfamily.hh:92
    \n+
    Alberta::Real ctype
    Definition albertagrid/gridfamily.hh:86
    \n+
    Definition albertagrid/gridfamily.hh:98
    \n+
    Dune::Communication< No_Comm > Communication
    Definition albertagrid/gridfamily.hh:148
    \n+
    Definition albertagrid/gridfamily.hh:117
    \n+
    Definition albertagrid/gridview.hh:76
    \n+
    Definition albertagrid/gridview.hh:287
    \n+
    Definition albertagrid/intersection.hh:32
    \n+\n+\n+\n+
    int alberta2dune(int codim, int i) const
    Definition misc.hh:397
    \n+
    int dune2alberta(int codim, int i) const
    Definition misc.hh:390
    \n+
    Definition albertagrid/projection.hh:80
    \n+
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n+
    Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
    Definition adaptcallback.hh:33
    \n+
    Store a reference to an entity with a minimal memory footprint.
    Definition common/entityseed.hh:26
    \n+
    Implementation & impl()
    access to the underlying implementation
    Definition common/entityseed.hh:59
    \n+
    Definition common/grid.hh:848
    \n+
    bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
    Marks an entity to be refined/coarsened in a subsequent adapt.
    Definition common/grid.hh:929
    \n+
    int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
    returns adaptation mark for given entity, i.e. here the default implementation returns 0.
    Definition common/grid.hh:941
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    Definition common/grid.hh:1121
    \n+
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    organizes the caching of sizes for one grid and one GeometryType
    Definition sizecache.hh:33
    \n+\n+\n+\n+\n+\n+\n+
    Provide a generic factory class for unstructured grids.
    \n+
    provides the GridFamily for AlbertaGrid
    \n+\n+\n+
    Implementation of the IntersectionIterator for AlbertaGrid.
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,277 +1,1036 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-geometryreference.hh\n+agrid.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH\n-6#define DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH\n+5#ifndef DUNE_ALBERTAGRID_IMP_HH\n+6#define DUNE_ALBERTAGRID_IMP_HH\n 7\n-12#include \n-13\n-14#include \n-15\n-16#include \n+13#if HAVE_ALBERTA || DOXYGEN\n+14\n+15#include \n+16#include \n 17\n-18namespace Dune\n-19{\n-20\n-21 // GeometryReference\n-22 // -----------------\n+18#include \n+19#include \n+20#include \n+21#include \n+22#include \n 23\n-24 template< class Implementation >\n-25 class GeometryReference\n-26 {\n-27 typedef GeometryReference<_Implementation_> This;\n-28\n-29 public:\n-30 static const int mydimension = Implementation::mydimension;\n-31 static const int coorddimension = Implementation::coorddimension;\n-32\n-33 typedef typename Implementation::ctype ctype;\n+24// Dune includes\n+25#include \n+26#include \n+27#include \n+28#include \n+29\n+30#include \n+31#include \n+32#include \n+33#include \n 34\n-35 typedef typename Implementation::LocalCoordinate LocalCoordinate;\n-36 typedef typename Implementation::GlobalCoordinate GlobalCoordinate;\n-37\n-38 typedef typename Implementation::JacobianInverseTransposed\n-JacobianInverseTransposed;\n-39 typedef typename Implementation::JacobianTransposed JacobianTransposed;\n-40\n-41 private:\n+35//- Local includes\n+36// some cpp defines and include of alberta.h\n+37#include \"albertaheader.hh\"\n+38\n+39#include \n+40#include \n+41#include \n 42\n-43 template\n-44 using JacobianInverseOfImplementation = decltype(typename Implementation_T::\n-JacobianInverse{std::declval().jacobianInverse(std::\n-declval())});\n-45\n-46 using JacobianInverseDefault = decltype(transpose(std::\n-declval()));\n-47\n-48 template\n-49 using JacobianOfImplementation = decltype(typename Implementation_T::\n-Jacobian{std::declval().jacobian(std::\n-declval())});\n+43#include \n+44#include \n+45#include \n+46#include \n+47#include \n+48#include \n+49#include \n 50\n-51 using JacobianDefault = decltype(transpose(std::declval\n-()));\n-52\n-53\n-54 template \n-55 [[deprecated(\"Geometry implementatons are required to provide a jacobian\n-(local) method. The default implementation is deprecated and will be removed\n-after release 2.9\")]]\n-56 auto deprecatedDefaultJacobian ( const LocalCoordinate& local ) const {\n-57 return transpose(jacobianTransposed(local));\n-58 }\n-59\n-60 template \n-61 [[deprecated(\"Geometry implementatons are required to provide a\n-jacobianInverse(local) method. The default implementation is deprecated and\n-will be removed after release 2.9\")]]\n-62 auto deprecatedDefaultJacobianInverse ( const LocalCoordinate& local ) const\n-{\n-63 return transpose(jacobianInverseTransposed(local));\n-64 }\n-65\n-66 public:\n+51#include \"indexsets.hh\"\n+52#include \"geometry.hh\"\n+53#include \"entity.hh\"\n+54#include \"hierarchiciterator.hh\"\n+55#include \"treeiterator.hh\"\n+56#include \"leveliterator.hh\"\n+57#include \"leafiterator.hh\"\n+58\n+59namespace Dune\n+60{\n+61\n+62 // External Forward Declarations\n+63 // -----------------------------\n+64\n+65 template< class Grid >\n+66 struct DGFGridFactory;\n 67\n-68 using Jacobian = Std::detected_or_t;\n-69 using JacobianInverse = Std::detected_or_t;\n-70\n-71 explicit GeometryReference ( const Implementation &impl )\n-72 : impl_( &impl )\n-73 {}\n-74\n-75 GeometryType type () const { return impl().type(); }\n-76\n-77 bool affine() const { return impl().affine(); }\n-78\n-79 int corners () const { return impl().corners(); }\n-80 GlobalCoordinate corner ( int i ) const { return impl().corner( i ); }\n-81 GlobalCoordinate center () const { return impl().center(); }\n-82\n-83 GlobalCoordinate global ( const LocalCoordinate &local ) const\n-84 {\n-85 return impl().global( local );\n-86 }\n-87\n-88 LocalCoordinate local ( const GlobalCoordinate &global ) const\n-89 {\n-90 return impl().local( global );\n-91 }\n-92\n-93 ctype integrationElement ( const LocalCoordinate &local ) const\n-94 {\n-95 return impl().integrationElement( local );\n-96 }\n-97\n-98 ctype volume () const { return impl().volume(); }\n-99\n-100 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local )\n-const\n-101 {\n-102 return impl().jacobianTransposed( local );\n-103 }\n-104\n-105 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate\n-&local ) const\n-106 {\n-107 return impl().jacobianInverseTransposed( local );\n-108 }\n-109\n-110 Jacobian jacobian ( const LocalCoordinate& local ) const\n-111 {\n-112 if constexpr(Std::is_detected_v)\n-113 return impl().jacobian(local);\n-114 else\n-115 return deprecatedDefaultJacobian(local);\n-116 }\n-117\n-118 JacobianInverse jacobianInverse ( const LocalCoordinate &local ) const\n-119 {\n-120 if constexpr(Std::is_detected_v)\n-121 return impl().jacobianInverse(local);\n-122 else\n-123 return deprecatedDefaultJacobianInverse(local);\n-124 }\n-125\n-126 const Implementation &impl () const { return *impl_; }\n-127\n-128 private:\n-129 const Implementation *impl_;\n-130 };\n-131\n-132\n-133 // LocalGeometryReference\n-134 // -----------------------\n+68\n+69\n+70 // AlbertaGrid\n+71 // -----------\n+72\n+105 template< int dim, int dimworld = Alberta::dimWorld >\n+106 class AlbertaGrid\n+107 : public GridDefaultImplementation\n+108 < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >\n+109 {\n+110 typedef AlbertaGrid<_dim,_dimworld_> This;\n+111 typedef GridDefaultImplementation\n+112 < dim, dimworld, Alberta::Real, AlbertaGridFamily<_dim,_dimworld_> >\n+113 Base;\n+114\n+115 template< int, int, class > friend class AlbertaGridEntity;\n+116 template< class > friend class AlbertaLevelGridView;\n+117 template< class > friend class AlbertaLeafGridView;\n+118 template< int, class, bool > friend class AlbertaGridTreeIterator;\n+119 template< class > friend class AlbertaGridHierarchicIterator;\n+120\n+121 friend class GridFactory< This >;\n+122 friend struct DGFGridFactory< This >;\n+123\n+124 friend class AlbertaGridIntersectionBase< const This >;\n+125 friend class AlbertaGridLeafIntersection< const This >;\n+126\n+127 friend class AlbertaMarkerVector< dim, dimworld >;\n+128#if (__GNUC__ < 4) && !(defined __ICC)\n+129 // add additional friend decls for gcc 3.4\n+130 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities;\n+131 friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities;\n+132#endif\n+133 friend class AlbertaGridIndexSet< dim, dimworld >;\n+134 friend class AlbertaGridHierarchicIndexSet< dim, dimworld >;\n 135\n-136 template< int mydim, int cdim, class Grid >\n-137 class LocalGeometryReference\n-138 : public GeometryReference< typename std::remove_const< Grid >::type::\n-Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::\n-LocalGeometryImpl >\n-139 {\n-140 typedef typename std::remove_const< Grid >::type::Traits::template Codim<\n-std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl\n-Implementation;\n-141\n-142 public:\n-143 LocalGeometryReference ( const Implementation &impl )\n-144 : GeometryReference< Implementation >( impl )\n-145 {}\n-146 };\n+136 template< class, class >\n+137 friend class Alberta::AdaptRestrictProlongHandler;\n+138\n+139 public:\n+141 typedef AlbertaGridFamily< dim, dimworld > GridFamily;\n+142\n+143 typedef typename GridFamily::ctype ctype;\n+144\n+145 static const int dimension = GridFamily::dimension;\n+146 static const int dimensionworld = GridFamily::dimensionworld;\n 147\n-148\n-149\n-150 // Definitions of GeometryReference\n-151 // --------------------------------\n-152\n-153 template< class Implementation >\n-154 const int GeometryReference<_Implementation_>::mydimension;\n+148 // the Traits\n+149 typedef typename AlbertaGridFamily< dim, dimworld >::Traits Traits;\n+150\n+152 typedef typename Traits::LeafIndexSet LeafIndexSet;\n+154 typedef typename Traits::LevelIndexSet LevelIndexSet;\n 155\n-156 template< class Implementation >\n-157 const int GeometryReference<_Implementation_>::coorddimension;\n+157 typedef typename Traits::HierarchicIndexSet HierarchicIndexSet;\n 158\n-159} // namespace Dune\n-160\n-161#endif // #ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH\n+160 typedef typename Traits::GlobalIdSet GlobalIdSet;\n+162 typedef typename Traits::LocalIdSet LocalIdSet;\n+163\n+165 typedef typename Traits::Communication Communication;\n+166\n+167 private:\n+169 typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;\n+170\n+172 typedef AlbertaGridIdSet IdSetImp;\n+173\n+175 struct AdaptationState\n+176 {\n+177 enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };\n+178\n+179 private:\n+180 Phase phase_;\n+181 int coarsenMarked_;\n+182 int refineMarked_;\n+183\n+184 public:\n+185 AdaptationState ()\n+186 : phase_( ComputationPhase ),\n+187 coarsenMarked_( 0 ),\n+188 refineMarked_( 0 )\n+189 {}\n+190\n+191 void mark ( int count )\n+192 {\n+193 if( count < 0 )\n+194 ++coarsenMarked_;\n+195 if( count > 0 )\n+196 refineMarked_ += (2 << count);\n+197 }\n+198\n+199 void unmark ( int count )\n+200 {\n+201 if( count < 0 )\n+202 --coarsenMarked_;\n+203 if( count > 0 )\n+204 refineMarked_ -= (2 << count);\n+205 }\n+206\n+207 bool coarsen () const\n+208 {\n+209 return (coarsenMarked_ > 0);\n+210 }\n+211\n+212 int refineMarked () const\n+213 {\n+214 return refineMarked_;\n+215 }\n+216\n+217 void preAdapt ()\n+218 {\n+219 if( phase_ != ComputationPhase )\n+220 error( \"preAdapt may only be called in computation phase.\" );\n+221 phase_ = PreAdaptationPhase;\n+222 }\n+223\n+224 void adapt ()\n+225 {\n+226 if( phase_ != PreAdaptationPhase )\n+227 error( \"adapt may only be called in preadapdation phase.\" );\n+228 phase_ = PostAdaptationPhase;\n+229 }\n+230\n+231 void postAdapt ()\n+232 {\n+233 if( phase_ != PostAdaptationPhase )\n+234 error( \"postAdapt may only be called in postadaptation phase.\" );\n+235 phase_ = ComputationPhase;\n+236\n+237 coarsenMarked_ = 0;\n+238 refineMarked_ = 0;\n+239 }\n+240\n+241 private:\n+242 void error ( const std::string &message )\n+243 {\n+244 DUNE_THROW( InvalidStateException, message );\n+245 }\n+246 };\n+247\n+248 template< class DataHandler >\n+249 struct AdaptationCallback;\n+250\n+251 // max number of allowed levels is 64\n+252 static const int MAXL = 64;\n+253\n+254 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+255 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n+256 typedef Alberta::HierarchyDofNumbering<_dimension_> DofNumbering;\n+257 typedef AlbertaGridLevelProvider<_dimension_> LevelProvider;\n+258\n+259 public:\n+260 AlbertaGrid ( const This & ) = delete;\n+261 This &operator=_( const This & ) = delete;\n+262\n+264 AlbertaGrid ();\n+265\n+271 AlbertaGrid ( const Alberta::MacroData<_dimension_> ¯oData,\n+272 const std::shared_ptr< DuneBoundaryProjection<_dimensionworld_> >\n+&projection\n+273 = std::shared_ptr< DuneBoundaryProjection<_dimensionworld_> >() );\n+274\n+275 template< class Proj, class Impl >\n+276 AlbertaGrid ( const Alberta::MacroData<_dimension_> ¯oData,\n+277 const Alberta::ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory\n+);\n+278\n+283 AlbertaGrid ( const std::string ¯oGridFileName );\n+284\n+286 ~AlbertaGrid ();\n+287\n+290 int maxLevel () const;\n+291\n+293 template\n+294 typename Traits::template Codim::template Partition::\n+LevelIterator\n+295 lbegin (int level) const;\n+296\n+298 template\n+299 typename Traits::template Codim::template Partition::\n+LevelIterator\n+300 lend (int level) const;\n+301\n+303 template< int codim >\n+304 typename Traits::template Codim<_codim_>::LevelIterator\n+305 lbegin ( int level ) const;\n+306\n+308 template< int codim >\n+309 typename Traits::template Codim<_codim_>::LevelIterator\n+310 lend ( int level ) const;\n+311\n+313 template< int codim, PartitionIteratorType pitype >\n+314 typename Traits\n+315 ::template Codim<_codim_>::template Partition< pitype >::LeafIterator\n+316 leafbegin () const;\n+317\n+319 template< int codim, PartitionIteratorType pitype >\n+320 typename Traits\n+321 ::template Codim<_codim_>::template Partition< pitype >::LeafIterator\n+322 leafend () const;\n+323\n+325 template< int codim >\n+326 typename Traits::template Codim<_codim_>::LeafIterator\n+327 leafbegin () const;\n+328\n+330 template< int codim >\n+331 typename Traits::template Codim<_codim_>::LeafIterator\n+332 leafend () const;\n+333\n+338 int size (int level, int codim) const;\n+339\n+341 int size (int level, GeometryType type) const;\n+342\n+344 int size (int codim) const;\n+345\n+347 int size (GeometryType type) const;\n+348\n+350 std::size_t numBoundarySegments () const\n+351 {\n+352 return numBoundarySegments_;\n+353 }\n+354\n+356 typename Traits::LevelGridView levelGridView ( int level ) const\n+357 {\n+358 typedef typename Traits::LevelGridView View;\n+359 typedef typename View::GridViewImp ViewImp;\n+360 return View( ViewImp( *this, level ) );\n+361 }\n+362\n+364 typename Traits::LeafGridView leafGridView () const\n+365 {\n+366 typedef typename Traits::LeafGridView View;\n+367 typedef typename View::GridViewImp ViewImp;\n+368 return View( ViewImp( *this ) );\n+369 }\n+370\n+371 public:\n+372 //***************************************************************\n+373 // Interface for Adaptation\n+374 //***************************************************************\n+375 using Base::getMark;\n+376 using Base::mark;\n+377\n+379 int getMark ( const typename Traits::template Codim< 0 >::Entity &e )\n+const;\n+380\n+382 bool mark ( int refCount, const typename Traits::template Codim< 0 >::\n+Entity &e );\n+383\n+385 void globalRefine ( int refCount );\n+386\n+387 template< class DataHandle >\n+388 void globalRefine ( int refCount, AdaptDataHandleInterface<_This,\n+DataHandle_> &handle );\n+389\n+391 bool adapt ();\n+392\n+394 template< class DataHandle >\n+395 bool adapt ( AdaptDataHandleInterface<_This,_DataHandle_> &handle );\n+396\n+398 bool preAdapt ();\n+399\n+401 void postAdapt();\n+402\n+405 const Communication &comm () const\n+406 {\n+407 return comm_;\n+408 }\n+409\n+410 static std::string typeName ()\n+411 {\n+412 std::ostringstream s;\n+413 s << \"AlbertaGrid< \" << dim << \", \" << dimworld << \" >\";\n+414 return s.str();\n+415 }\n+416\n+418 template< class EntitySeed >\n+419 typename Traits::template Codim< EntitySeed::codimension >::Entity\n+420 entity ( const EntitySeed &seed ) const\n+421 {\n+422 typedef typename Traits::template Codim<_EntitySeed::codimension_>::\n+EntityImpl EntityImpl;\n+423 return EntityImpl( *this, seed.impl().elementInfo( meshPointer() ),\n+seed.impl().subEntity() );\n+424 }\n+425\n+426 //**********************************************************\n+427 // End of Interface Methods\n+428 //**********************************************************\n+430 bool writeGrid( const std::string &filename, ctype time ) const;\n+431\n+433 bool readGrid( const std::string &filename, ctype &time );\n+434\n+435 // return hierarchic index set\n+436 const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_;\n+}\n+437\n+439 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;\n+440\n+442 const typename Traits :: LeafIndexSet & leafIndexSet () const;\n+443\n+445 const GlobalIdSet &globalIdSet () const\n+446 {\n+447 return idSet_;\n+448 }\n+449\n+451 const LocalIdSet &localIdSet () const\n+452 {\n+453 return idSet_;\n+454 }\n+455\n+456 // access to mesh pointer, needed by some methods\n+457 ALBERTA MESH* getMesh () const\n+458 {\n+459 return mesh_;\n+460 };\n+461\n+462 const MeshPointer &meshPointer () const\n+463 {\n+464 return mesh_;\n+465 }\n+466\n+467 const DofNumbering &dofNumbering () const\n+468 {\n+469 return dofNumbering_;\n+470 }\n+471\n+472 const LevelProvider &levelProvider () const\n+473 {\n+474 return levelProvider_;\n+475 }\n+476\n+477 int dune2alberta ( int codim, int i ) const\n+478 {\n+479 return numberingMap_.dune2alberta( codim, i );\n+480 }\n+481\n+482 int alberta2dune ( int codim, int i ) const\n+483 {\n+484 return numberingMap_.alberta2dune( codim, i );\n+485 }\n+486\n+487 int generic2alberta ( int codim, int i ) const\n+488 {\n+489 return genericNumberingMap_.dune2alberta( codim, i );\n+490 }\n+491\n+492 int alberta2generic ( int codim, int i ) const\n+493 {\n+494 return genericNumberingMap_.alberta2dune( codim, i );\n+495 }\n+496\n+497 private:\n+498 typedef std::vector ArrayType;\n+499\n+500 void setup ();\n+501\n+502 // make the calculation of indexOnLevel and so on.\n+503 // extra method because of Reihenfolge\n+504 void calcExtras();\n+505\n+506 private:\n+507 // delete mesh and all vectors\n+508 void removeMesh();\n+509\n+510 //***********************************************************************\n+511 // MemoryManagement for Entities and Geometries\n+512 //**********************************************************************\n+513 typedef MakeableInterfaceObject<_typename_Traits::template_Codim<_0_>::\n+Entity >\n+514 EntityObject;\n+515\n+516 public:\n+517 friend class AlbertaGridLeafIntersectionIterator< const This >;\n+518\n+519 template< int codim >\n+520 static int\n+521 getTwist ( const typename Traits::template Codim<_codim_>::Entity &entity )\n+522 {\n+523 return entity.impl().twist();\n+524 }\n+525\n+526 template< int codim >\n+527 static int\n+528 getTwist ( const typename Traits::template Codim<_0_>::Entity &entity, int\n+subEntity )\n+529 {\n+530 return entity.impl().template twist<_codim_>( subEntity );\n+531 }\n+532\n+533 static int\n+534 getTwistInInside ( const typename Traits::LeafIntersection &intersection )\n+535 {\n+536 return intersection.impl().twistInInside();\n+537 }\n+538\n+539 static int\n+540 getTwistInOutside ( const typename Traits::LeafIntersection &intersection )\n+541 {\n+542 return intersection.impl().twistInOutside();\n+543 }\n+544\n+545 public:\n+546 // read global element number from elNumbers_\n+547 const Alberta::GlobalVector &\n+548 getCoord ( const ElementInfo &elementInfo, int vertex ) const;\n+549\n+550 private:\n+551 // pointer to an Albert Mesh, which contains the data\n+552 MeshPointer mesh_;\n+553\n+554 // communication\n+555 Communication comm_;\n+556\n+557 // maximum level of the mesh\n+558 int maxlevel_;\n+559\n+560 // number of boundary segments within the macro grid\n+561 size_t numBoundarySegments_;\n+562\n+563 // map between ALBERTA and DUNE numbering\n+564 Alberta::NumberingMap<_dimension,_Alberta::Dune2AlbertaNumbering_>\n+numberingMap_;\n+565 Alberta::NumberingMap<_dimension,_Alberta::Generic2AlbertaNumbering_>\n+genericNumberingMap_;\n+566\n+567 DofNumbering dofNumbering_;\n+568\n+569 LevelProvider levelProvider_;\n+570\n+571 // hierarchical numbering of AlbertaGrid, unique per codim\n+572 HierarchicIndexSet hIndexSet_;\n+573\n+574 // the id set of this grid\n+575 IdSetImp idSet_;\n+576\n+577 // the level index set, is generated from the HierarchicIndexSet\n+578 // is generated, when accessed\n+579 mutable std::vector< typename GridFamily::LevelIndexSetImp * >\n+levelIndexVec_;\n+580\n+581 // the leaf index set, is generated from the HierarchicIndexSet\n+582 // is generated, when accessed\n+583 mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;\n+584\n+585 SizeCache<_This_> sizeCache_;\n+586\n+587 typedef AlbertaMarkerVector<_dim,_dimworld_> MarkerVector;\n+588\n+589 // needed for VertexIterator, mark on which element a vertex is treated\n+590 mutable MarkerVector leafMarkerVector_;\n+591\n+592 // needed for VertexIterator, mark on which element a vertex is treated\n+593 mutable std::vector< MarkerVector > levelMarkerVector_;\n+594\n+595#if DUNE_ALBERTA_CACHE_COORDINATES\n+596 Alberta::CoordCache<_dimension_> coordCache_;\n+597#endif\n+598\n+599 // current state of adaptation\n+600 AdaptationState adaptationState_;\n+601 };\n+602\n+603} // namespace Dune\n+604\n+605#include \"albertagrid.cc\"\n+606\n+607// undef all dangerous defines\n+608#undef DIM\n+609#undef DIM_OF_WORLD\n+610\n+611#ifdef _ABS_NOT_DEFINED_\n+612#undef ABS\n+613#endif\n+614\n+615#ifdef _MIN_NOT_DEFINED_\n+616#undef MIN\n+617#endif\n+618\n+619#ifdef _MAX_NOT_DEFINED_\n+620#undef MAX\n+621#endif\n+622\n+623#ifdef obstack_chunk_alloc\n+624#undef obstack_chunk_alloc\n+625#endif\n+626#ifdef obstack_chunk_free\n+627#undef obstack_chunk_free\n+628#endif\n+629#include \n+630\n+631// We use MEM_ALLOC, so undefine it here.\n+632#undef MEM_ALLOC\n+633\n+634// We use MEM_REALLOC, so undefine it here.\n+635#undef MEM_REALLOC\n+636\n+637// We use MEM_CALLOC, so undefine it here.\n+638#undef MEM_CALLOC\n+639\n+640// We use MEM_FREE, so undefine it here.\n+641#undef MEM_FREE\n+642\n+643// Macro ERROR may be defined by alberta_util.h. If so, undefine it.\n+644#ifdef ERROR\n+645#undef ERROR\n+646#endif // #ifdef ERROR\n+647\n+648// Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.\n+649#ifdef ERROR_EXIT\n+650#undef ERROR_EXIT\n+651#endif // #ifdef ERROR_EXIT\n+652\n+653// Macro WARNING may be defined by alberta_util.h. If so, undefine it.\n+654#ifdef WARNING\n+655#undef WARNING\n+656#endif // #ifdef WARNING\n+657\n+658// Macro TEST may be defined by alberta_util.h. If so, undefine it.\n+659#ifdef TEST\n+660#undef TEST\n+661#endif // #ifdef TEST\n+662\n+663// Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.\n+664#ifdef TEST_EXIT\n+665#undef TEST_EXIT\n+666#endif // #ifdef TEST_EXIT\n+667\n+668// Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.\n+669#ifdef DEBUG_TEST\n+670#undef DEBUG_TEST\n+671#endif // #ifdef DEBUG_TEST\n+672\n+673// Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine\n+it.\n+674#ifdef DEBUG_TEST_EXIT\n+675#undef DEBUG_TEST_EXIT\n+676#endif // #ifdef DEBUG_TEST_EXIT\n+677\n+678// Macro INFO may be defined by alberta_util.h. If so, undefine it.\n+679#ifdef INFO\n+680#undef INFO\n+681#endif // #ifdef INFO\n+682\n+683// Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.\n+684#ifdef PRINT_INFO\n+685#undef PRINT_INFO\n+686#endif // #ifdef PRINT_INFO\n+687\n+688// Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.\n+689#ifdef PRINT_INT_VEC\n+690#undef PRINT_INT_VEC\n+691#endif // #ifdef PRINT_INT_VEC\n+692\n+693// Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine\n+it.\n+694#ifdef PRINT_REAL_VEC\n+695#undef PRINT_REAL_VEC\n+696#endif // #ifdef PRINT_REAL_VEC\n+697\n+698// Macro WAIT may be defined by alberta_util.h. If so, undefine it.\n+699#ifdef WAIT\n+700#undef WAIT\n+701#endif // #ifdef WAIT\n+702\n+703// Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.\n+704#ifdef WAIT_REALLY\n+705#undef WAIT_REALLY\n+706#endif // #ifdef WAIT_REALLY\n+707\n+708// Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.\n+709#ifdef GET_WORKSPACE\n+710#undef GET_WORKSPACE\n+711#endif // #ifdef GET_WORKSPACE\n+712\n+713// Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine\n+it.\n+714#ifdef FREE_WORKSPACE\n+715#undef FREE_WORKSPACE\n+716#endif // #ifdef FREE_WORKSPACE\n+717\n+718// Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.\n+719#ifdef MAT_ALLOC\n+720#undef MAT_ALLOC\n+721#endif // #ifdef MAT_ALLOC\n+722\n+723// Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.\n+724#ifdef MAT_FREE\n+725#undef MAT_FREE\n+726#endif // #ifdef MAT_FREE\n+727\n+728// Macro NAME may be defined by alberta_util.h. If so, undefine it.\n+729#ifdef NAME\n+730#undef NAME\n+731#endif // #ifdef NAME\n+732\n+733// Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.\n+734#ifdef GET_STRUCT\n+735#undef GET_STRUCT\n+736#endif // #ifdef GET_STRUCT\n+737\n+738// Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.\n+739#ifdef ADD_PARAMETER\n+740#undef ADD_PARAMETER\n+741#endif // #ifdef ADD_PARAMETER\n+742\n+743// Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.\n+744#ifdef GET_PARAMETER\n+745#undef GET_PARAMETER\n+746#endif // #ifdef GET_PARAMETER\n+747\n+748#define _ALBERTA_H_\n+749\n+750#endif // HAVE_ALBERTA || DOXYGEN\n+751\n+752#endif\n+adaptcallback.hh\n+interfaces and wrappers needed for the callback adaptation provided by\n+AlbertaGrid and dune-ALUGrid\n+sizecache.hh\n+Provides size cache classes to implement the grids size method efficiently.\n+leveliterator.hh\n+undefine-3.0.hh\n+Contains #undefs for all preprocessor macros defined by alberta.\n+leafiterator.hh\n+misc.hh\n+coordcache.hh\n+treeiterator.hh\n+hierarchiciterator.hh\n+level.hh\n+albertaheader.hh\n+ALBERTA\n+#define ALBERTA\n+Definition albertaheader.hh:29\n+albertagrid.cc\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::GeometryReference\n-Definition geometryreference.hh:26\n-Dune::GeometryReference::mydimension\n-static const int mydimension\n-Definition geometryreference.hh:30\n-Dune::GeometryReference::integrationElement\n-ctype integrationElement(const LocalCoordinate &local) const\n-Definition geometryreference.hh:93\n-Dune::GeometryReference::volume\n-ctype volume() const\n-Definition geometryreference.hh:98\n-Dune::GeometryReference::impl\n-const Implementation & impl() const\n-Definition geometryreference.hh:126\n-Dune::GeometryReference::jacobianInverse\n-JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n-Definition geometryreference.hh:118\n-Dune::GeometryReference::center\n-GlobalCoordinate center() const\n-Definition geometryreference.hh:81\n-Dune::GeometryReference::JacobianTransposed\n-Implementation::JacobianTransposed JacobianTransposed\n-Definition geometryreference.hh:39\n-Dune::GeometryReference::GeometryReference\n-GeometryReference(const Implementation &impl)\n-Definition geometryreference.hh:71\n-Dune::GeometryReference::JacobianInverse\n-Std::detected_or_t< JacobianInverseDefault, JacobianInverseOfImplementation,\n-Implementation > JacobianInverse\n-Definition geometryreference.hh:69\n-Dune::GeometryReference::local\n-LocalCoordinate local(const GlobalCoordinate &global) const\n-Definition geometryreference.hh:88\n-Dune::GeometryReference::GlobalCoordinate\n-Implementation::GlobalCoordinate GlobalCoordinate\n-Definition geometryreference.hh:36\n-Dune::GeometryReference::coorddimension\n-static const int coorddimension\n-Definition geometryreference.hh:31\n-Dune::GeometryReference::affine\n-bool affine() const\n-Definition geometryreference.hh:77\n-Dune::GeometryReference::corner\n-GlobalCoordinate corner(int i) const\n-Definition geometryreference.hh:80\n-Dune::GeometryReference::jacobianInverseTransposed\n-JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n-&local) const\n-Definition geometryreference.hh:105\n-Dune::GeometryReference::jacobianTransposed\n-JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n-Definition geometryreference.hh:100\n-Dune::GeometryReference::corners\n-int corners() const\n-Definition geometryreference.hh:79\n-Dune::GeometryReference::LocalCoordinate\n-Implementation::LocalCoordinate LocalCoordinate\n-Definition geometryreference.hh:35\n-Dune::GeometryReference::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-Definition geometryreference.hh:83\n-Dune::GeometryReference::Jacobian\n-Std::detected_or_t< JacobianDefault, JacobianOfImplementation, Implementation >\n-Jacobian\n-Definition geometryreference.hh:68\n-Dune::GeometryReference::ctype\n-Implementation::ctype ctype\n-Definition geometryreference.hh:33\n-Dune::GeometryReference::JacobianInverseTransposed\n-Implementation::JacobianInverseTransposed JacobianInverseTransposed\n-Definition geometryreference.hh:38\n-Dune::GeometryReference::jacobian\n-Jacobian jacobian(const LocalCoordinate &local) const\n-Definition geometryreference.hh:110\n-Dune::GeometryReference::type\n-GeometryType type() const\n-Definition geometryreference.hh:75\n-Dune::LocalGeometryReference\n-Definition geometryreference.hh:139\n-Dune::LocalGeometryReference::LocalGeometryReference\n-LocalGeometryReference(const Implementation &impl)\n-Definition geometryreference.hh:143\n+Dune::Alberta::Real\n+ALBERTA REAL Real\n+Definition misc.hh:48\n+Dune::Alberta::GlobalVector\n+ALBERTA REAL_D GlobalVector\n+Definition misc.hh:50\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::AlbertaGrid\n+[ provides Dune::Grid ]\n+Definition agrid.hh:109\n+Dune::AlbertaGrid::readGrid\n+bool readGrid(const std::string &filename, ctype &time)\n+read Grid from file filename and store time of mesh in time\n+Definition albertagrid.cc:585\n+Dune::AlbertaGrid::dofNumbering\n+const DofNumbering & dofNumbering() const\n+Definition agrid.hh:467\n+Dune::AlbertaGrid::generic2alberta\n+int generic2alberta(int codim, int i) const\n+Definition agrid.hh:487\n+Dune::AlbertaGrid::typeName\n+static std::string typeName()\n+Definition agrid.hh:410\n+Dune::AlbertaGrid::leafbegin\n+Traits::template Codim< codim >::template Partition< pitype >::LeafIterator\n+leafbegin() const\n+return LeafIterator which points to first leaf entity\n+Dune::AlbertaGrid::hierarchicIndexSet\n+const HierarchicIndexSet & hierarchicIndexSet() const\n+Definition agrid.hh:436\n+Dune::AlbertaGrid::lend\n+Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend\n+(int level) const\n+one past the end on this level\n+Dune::AlbertaGrid::dimension\n+static const int dimension\n+Definition agrid.hh:145\n+Dune::AlbertaGrid::dune2alberta\n+int dune2alberta(int codim, int i) const\n+Definition agrid.hh:477\n+Dune::AlbertaGrid::Communication\n+Traits::Communication Communication\n+type of communication\n+Definition agrid.hh:165\n+Dune::AlbertaGrid::maxLevel\n+int maxLevel() const\n+Definition albertagrid.cc:483\n+Dune::AlbertaGrid::AlbertaGrid\n+AlbertaGrid()\n+create an empty grid\n+Definition albertagrid.cc:42\n+Dune::AlbertaGrid::lbegin\n+Traits::template Codim< codim >::LevelIterator lbegin(int level) const\n+Iterator to first entity of given codim on level.\n+Dune::AlbertaGrid::levelProvider\n+const LevelProvider & levelProvider() const\n+Definition agrid.hh:472\n+Dune::AlbertaGrid::getTwistInOutside\n+static int getTwistInOutside(const typename Traits::LeafIntersection\n+&intersection)\n+Definition agrid.hh:540\n+Dune::AlbertaGrid::getCoord\n+const Alberta::GlobalVector & getCoord(const ElementInfo &elementInfo, int\n+vertex) const\n+Definition albertagrid.cc:471\n+Dune::AlbertaGrid::lend\n+Traits::template Codim< codim >::LevelIterator lend(int level) const\n+one past the end on this level\n+Dune::AlbertaGrid::leafGridView\n+Traits::LeafGridView leafGridView() const\n+View for the leaf grid for All_Partition.\n+Definition agrid.hh:364\n+Dune::AlbertaGrid::adapt\n+bool adapt()\n+Refine all positive marked leaf entities, coarsen all negative marked entities\n+if possible.\n+Definition albertagrid.cc:415\n+Dune::AlbertaGrid::dimensionworld\n+static const int dimensionworld\n+Definition agrid.hh:146\n+Dune::AlbertaGrid::getTwistInInside\n+static int getTwistInInside(const typename Traits::LeafIntersection\n+&intersection)\n+Definition agrid.hh:534\n+Dune::AlbertaGrid::postAdapt\n+void postAdapt()\n+clean up some markers\n+Definition albertagrid.cc:356\n+Dune::AlbertaGrid::leafbegin\n+Traits::template Codim< codim >::LeafIterator leafbegin() const\n+return LeafIterator which points to first leaf entity\n+Dune::AlbertaGrid::localIdSet\n+const LocalIdSet & localIdSet() const\n+return local IdSet\n+Definition agrid.hh:451\n+Dune::AlbertaGrid::numBoundarySegments\n+std::size_t numBoundarySegments() const\n+number of boundary segments within the macro grid\n+Definition agrid.hh:350\n+Dune::AlbertaGrid::ctype\n+GridFamily::ctype ctype\n+Definition agrid.hh:143\n+Dune::AlbertaGrid::AlbertaGrid\n+AlbertaGrid(const This &)=delete\n+Dune::AlbertaGrid::leafend\n+Traits::template Codim< codim >::LeafIterator leafend() const\n+return LeafIterator which points behind last leaf entity\n+Dune::AlbertaGrid::levelIndexSet\n+const Traits::LevelIndexSet & levelIndexSet(int level) const\n+return level index set for given level\n+Definition albertagrid.cc:520\n+Dune::AlbertaGrid::alberta2generic\n+int alberta2generic(int codim, int i) const\n+Definition agrid.hh:492\n+Dune::AlbertaGrid::getTwist\n+static int getTwist(const typename Traits::template Codim< codim >::Entity\n+&entity)\n+Definition agrid.hh:521\n+Dune::AlbertaGrid::comm\n+const Communication & comm() const\n+return reference to communication, if MPI found this is specialisation for MPI\n+Definition agrid.hh:405\n+Dune::AlbertaGrid::getMesh\n+ALBERTA MESH * getMesh() const\n+Definition agrid.hh:457\n+Dune::AlbertaGrid::size\n+int size(int level, int codim) const\n+Number of grid entities per level and codim because lbegin and lend are none\n+const,...\n+Definition albertagrid.cc:490\n+Dune::AlbertaGrid::HierarchicIndexSet\n+Traits::HierarchicIndexSet HierarchicIndexSet\n+type of hierarchic index set\n+Definition agrid.hh:157\n+Dune::AlbertaGrid::leafIndexSet\n+const Traits::LeafIndexSet & leafIndexSet() const\n+return leaf index set\n+Definition albertagrid.cc:535\n+Dune::AlbertaGrid::leafend\n+Traits::template Codim< codim >::template Partition< pitype >::LeafIterator\n+leafend() const\n+return LeafIterator which points behind last leaf entity\n+Dune::AlbertaGrid::writeGrid\n+bool writeGrid(const std::string &filename, ctype time) const\n+write Grid to file in Xdr\n+Definition albertagrid.cc:575\n+Dune::AlbertaGrid::levelGridView\n+Traits::LevelGridView levelGridView(int level) const\n+View for a grid level for All_Partition.\n+Definition agrid.hh:356\n+Dune::AlbertaGrid::alberta2dune\n+int alberta2dune(int codim, int i) const\n+Definition agrid.hh:482\n+Dune::AlbertaGrid::operator=\n+This & operator=(const This &)=delete\n+Dune::AlbertaGrid::Traits\n+AlbertaGridFamily< dim, dimworld >::Traits Traits\n+Definition agrid.hh:149\n+Dune::AlbertaGrid::getTwist\n+static int getTwist(const typename Traits::template Codim< 0 >::Entity &entity,\n+int subEntity)\n+Definition agrid.hh:528\n+Dune::AlbertaGrid::lbegin\n+Traits::template Codim< cd >::template Partition< pitype >::LevelIterator\n+lbegin(int level) const\n+Iterator to first entity of given codim on level.\n+Dune::AlbertaGrid::globalIdSet\n+const GlobalIdSet & globalIdSet() const\n+return global IdSet\n+Definition agrid.hh:445\n+Dune::AlbertaGrid::globalRefine\n+void globalRefine(int refCount)\n+uses the interface, mark on entity and refineLocal\n+Definition albertagrid.cc:304\n+Dune::AlbertaGrid::getMark\n+int getMark(const typename Traits::template Codim< 0 >::Entity &e) const\n+returns adaptation mark for given entity\n+Definition albertagrid.cc:408\n+Dune::AlbertaGrid::entity\n+Traits::template Codim< EntitySeed::codimension >::Entity entity(const\n+EntitySeed &seed) const\n+obtain Entity from EntitySeed.\n+Definition agrid.hh:420\n+Dune::AlbertaGrid::~AlbertaGrid\n+~AlbertaGrid()\n+destructor\n+Definition albertagrid.cc:196\n+Dune::AlbertaGrid::preAdapt\n+bool preAdapt()\n+returns true, if a least one element is marked for coarsening\n+Definition albertagrid.cc:348\n+Dune::AlbertaGrid::mark\n+bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)\n+Marks an entity to be refined/coarsened in a subsequent adapt.\n+Definition albertagrid.cc:385\n+Dune::AlbertaGrid::meshPointer\n+const MeshPointer & meshPointer() const\n+Definition agrid.hh:462\n+Dune::Alberta::CoordCache\n+Definition coordcache.hh:25\n+Dune::Alberta::AdaptRestrictProlongHandler\n+Definition albertagrid/datahandle.hh:27\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::impl\n+Implementation & impl()\n+access to the underlying implementation\n+Definition common/intersection.hh:178\n+Dune::Alberta::MeshPointer<_dimension_>\n+Dune::Alberta::HierarchyDofNumbering<_dimension_>\n+Dune::Alberta::ElementInfo<_dimension_>\n+Dune::AlbertaGridTreeIterator\n+Definition treeiterator.hh:189\n+Dune::AlbertaGridHierarchicIterator\n+Definition hierarchiciterator.hh:29\n+Dune::AlbertaGridLeafIntersection\n+Definition albertagrid/intersection.hh:105\n+Dune::AlbertaGridLeafIntersectionIterator\n+Definition albertagrid/intersectioniterator.hh:27\n+Dune::AlbertaGridEntity\n+Definition albertagrid/entity.hh:46\n+Dune::AlbertaGridHierarchicIndexSet\n+Definition albertagrid/indexsets.hh:42\n+Dune::AlbertaGridIdSet\n+hierarchic index set of AlbertaGrid\n+Definition albertagrid/indexsets.hh:518\n+Dune::AlbertaGridIndexSet\n+Definition albertagrid/indexsets.hh:329\n+Dune::AlbertaGridFamily\n+Definition albertagrid/gridfamily.hh:83\n+Dune::AlbertaGridFamily::dimension\n+static const int dimension\n+Definition albertagrid/gridfamily.hh:88\n+Dune::AlbertaGridFamily::dimensionworld\n+static const int dimensionworld\n+Definition albertagrid/gridfamily.hh:89\n+Dune::AlbertaGridFamily::LeafIndexSetImp\n+AlbertaGridIndexSet< dim, dimworld > LeafIndexSetImp\n+Definition albertagrid/gridfamily.hh:92\n+Dune::AlbertaGridFamily::ctype\n+Alberta::Real ctype\n+Definition albertagrid/gridfamily.hh:86\n+Dune::AlbertaGridFamily::Traits\n+Definition albertagrid/gridfamily.hh:98\n+Dune::AlbertaGridFamily::Traits::Communication\n+Dune::Communication< No_Comm > Communication\n+Definition albertagrid/gridfamily.hh:148\n+Dune::AlbertaGridFamily::Traits::Codim\n+Definition albertagrid/gridfamily.hh:117\n+Dune::AlbertaLevelGridView\n+Definition albertagrid/gridview.hh:76\n+Dune::AlbertaLeafGridView\n+Definition albertagrid/gridview.hh:287\n+Dune::AlbertaGridIntersectionBase\n+Definition albertagrid/intersection.hh:32\n+Dune::AlbertaGridLevelProvider<_dimension_>\n+Dune::Alberta::MacroData<_dimension_>\n+Dune::Alberta::NumberingMap<_dimension,_Alberta::Dune2AlbertaNumbering_>\n+Dune::Alberta::NumberingMap::alberta2dune\n+int alberta2dune(int codim, int i) const\n+Definition misc.hh:397\n+Dune::Alberta::NumberingMap::dune2alberta\n+int dune2alberta(int codim, int i) const\n+Definition misc.hh:390\n+Dune::Alberta::ProjectionFactoryInterface\n+Definition albertagrid/projection.hh:80\n+Dune::AlbertaMarkerVector\n+marker assigning subentities to one element containing them\n+Definition treeiterator.hh:35\n+Dune::AdaptDataHandleInterface\n+Interface class for the Grid's adapt method where the parameter is a\n+AdaptDataHandleInterface.\n+Definition adaptcallback.hh:33\n+Dune::EntitySeed\n+Store a reference to an entity with a minimal memory footprint.\n+Definition common/entityseed.hh:26\n+Dune::EntitySeed::impl\n+Implementation & impl()\n+access to the underlying implementation\n+Definition common/entityseed.hh:59\n+Dune::GridDefaultImplementation\n+Definition common/grid.hh:848\n+Dune::GridDefaultImplementation<_dim,_dimworld,_Alberta::Real,\n+AlbertaGridFamily<_dim,_dimworld_>_>::mark\n+bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)\n+Marks an entity to be refined/coarsened in a subsequent adapt.\n+Definition common/grid.hh:929\n+Dune::GridDefaultImplementation<_dim,_dimworld,_Alberta::Real,\n+AlbertaGridFamily<_dim,_dimworld_>_>::getMark\n+int getMark(const typename Traits::template Codim< 0 >::Entity &e) const\n+returns adaptation mark for given entity, i.e. here the default implementation\n+returns 0.\n+Definition common/grid.hh:941\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+Dune::MakeableInterfaceObject\n+Definition common/grid.hh:1121\n+Dune::GridFactory\n+Provide a generic factory class for unstructured grids.\n+Definition common/gridfactory.hh:275\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::SizeCache\n+organizes the caching of sizes for one grid and one GeometryType\n+Definition sizecache.hh:33\n+backuprestore.hh\n+capabilities.hh\n+datahandle.hh\n+entity.hh\n+entityseed.hh\n geometry.hh\n-Wrapper and interface classes for element geometries.\n+gridfactory.hh\n+Provide a generic factory class for unstructured grids.\n+gridfamily.hh\n+provides the GridFamily for AlbertaGrid\n+indexsets.hh\n+intersection.hh\n+intersectioniterator.hh\n+Implementation of the IntersectionIterator for AlbertaGrid.\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00704.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00704.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: refinement.hh File Reference\n+dune-grid: dofvector.hh File Reference\n \n \n \n \n \n \n \n@@ -71,59 +71,59 @@\n \n
    \n
    \n
    \n \n-
    refinement.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    dofvector.hh File Reference
    \n
    \n
    \n-\n-

    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather \n-More...

    \n-
    #include <cassert>
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/elementinfo.hh>
    \n+
    #include <cstdlib>
    \n+#include <limits>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/elementinfo.hh>
    \n+#include <dune/grid/albertagrid/refinement.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::Alberta::Patch< dim >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< dim, 0 >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< dim, dim >
    struct  Dune::Alberta::DofVectorProvider< int >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< 2, 1 >
    struct  Dune::Alberta::DofVectorProvider< signed char >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< 3, 1 >
    struct  Dune::Alberta::DofVectorProvider< unsigned char >
     
    struct  Dune::Alberta::ForEachInteriorSubChild< 3, 2 >
    struct  Dune::Alberta::DofVectorProvider< Real >
     
    struct  Dune::Alberta::GeometryInFather< 1 >
    struct  Dune::Alberta::DofVectorProvider< GlobalVector >
     
    struct  Dune::Alberta::GeometryInFather< 2 >
     
    struct  Dune::Alberta::GeometryInFather< 3 >
    class  Dune::Alberta::DofVectorPointer< Dof >
     
    \n \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    void Dune::Alberta::abs (const DofVectorPointer< int > &dofVector)
     
    int Dune::Alberta::max (const DofVectorPointer< int > &dofVector)
     
    int Dune::Alberta::min (const DofVectorPointer< int > &dofVector)
     
    \n-

    Detailed Description

    \n-

    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather

    \n-
    Author
    Martin Nolte
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,47 +1,43 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-refinement.hh File Reference\n-provides a wrapper for ALBERTA's refinement patches and the corners for\n-geometryInFather More...\n-#include \n+Classes | Namespaces | Functions\n+dofvector.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 \u00a0 Dune::Alberta::Patch<_dim_>\n+struct \u00a0 Dune::Alberta::DofVectorProvider<_int_>\n \u00a0\n-struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_dim,_0_>\n+struct \u00a0 Dune::Alberta::DofVectorProvider<_signed_char_>\n \u00a0\n-struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_dim,_dim_>\n+struct \u00a0 Dune::Alberta::DofVectorProvider<_unsigned_char_>\n \u00a0\n-struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_2,_1_>\n+struct \u00a0 Dune::Alberta::DofVectorProvider<_Real_>\n \u00a0\n-struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_3,_1_>\n+struct \u00a0 Dune::Alberta::DofVectorProvider<_GlobalVector_>\n \u00a0\n-struct \u00a0 Dune::Alberta::ForEachInteriorSubChild<_3,_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::GeometryInFather<_1_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::GeometryInFather<_2_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::GeometryInFather<_3_>\n+ class \u00a0 Dune::Alberta::DofVectorPointer<_Dof_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n-***** Detailed Description *****\n-provides a wrapper for ALBERTA's refinement patches and the corners for\n-geometryInFather\n- Author\n- Martin Nolte\n+Functions\n+void\u00a0 Dune::Alberta::abs (const DofVectorPointer< int > &dofVector)\n+\u00a0\n+ int\u00a0 Dune::Alberta::max (const DofVectorPointer< int > &dofVector)\n+\u00a0\n+ int\u00a0 Dune::Alberta::min (const DofVectorPointer< int > &dofVector)\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00704_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00704_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: refinement.hh Source File\n+dune-grid: dofvector.hh Source File\n \n \n \n \n \n \n \n@@ -74,454 +74,532 @@\n \n \n
    \n
    \n-
    refinement.hh
    \n+
    dofvector.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_REFINEMENT_HH
    \n-
    6#define DUNE_ALBERTA_REFINEMENT_HH
    \n+
    5#ifndef DUNE_ALBERTA_DOFVECTOR_HH
    \n+
    6#define DUNE_ALBERTA_DOFVECTOR_HH
    \n
    7
    \n-
    14#include <cassert>
    \n-
    15
    \n-\n-\n-
    18
    \n-
    19#if HAVE_ALBERTA
    \n-
    20
    \n-
    21namespace Dune
    \n-
    22{
    \n-
    23
    \n-
    24 namespace Alberta
    \n-
    25 {
    \n-
    26
    \n-
    27 // Internal Forward Declarations
    \n-
    28 // -----------------------------
    \n+
    8#include <cstdlib>
    \n+
    9#include <limits>
    \n+
    10
    \n+\n+\n+\n+
    14
    \n+
    15#if HAVE_ALBERTA
    \n+
    16
    \n+
    17namespace Dune
    \n+
    18{
    \n+
    19
    \n+
    20 namespace Alberta
    \n+
    21 {
    \n+
    22
    \n+
    23 // External Forward Declarations
    \n+
    24 // -----------------------------
    \n+
    25
    \n+
    26 template< int dim >
    \n+
    27 class MeshPointer;
    \n+
    28
    \n
    29
    \n-
    30 template< int dim, int codim >
    \n-\n-
    32
    \n+
    30
    \n+
    31 // DofVectorProvider
    \n+
    32 // -----------------
    \n
    33
    \n-
    34
    \n-
    35 // Patch
    \n-
    36 // -----
    \n-
    37
    \n-
    38 template< int dim >
    \n-
    \n-
    39 class Patch
    \n-
    40 {
    \n-
    41 typedef Patch< dim > This;
    \n-
    42
    \n-
    43 static_assert(((dim >= 1) && (dim <= 3)),
    \n-
    44 "Alberta supports only dimensions 1, 2, 3");
    \n-
    45
    \n-
    46 public:
    \n-
    47 static const int dimension = dim;
    \n-
    48
    \n-\n-
    50
    \n-
    51 typedef ALBERTA RC_LIST_EL ElementList;
    \n-
    52
    \n-
    53 private:
    \n-
    54 ElementList *list_;
    \n-
    55 int count_;
    \n+
    34 template< class Dof >
    \n+\n+
    36
    \n+
    37 template<>
    \n+
    \n+
    38 struct DofVectorProvider< int >
    \n+
    39 {
    \n+
    40 typedef ALBERTA DOF_INT_VEC DofVector;
    \n+
    41
    \n+
    \n+
    42 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n+
    43 {
    \n+
    44 return ALBERTA get_dof_int_vec( name.c_str(), dofSpace );
    \n+
    45 }
    \n+
    \n+
    46
    \n+
    \n+
    47 static void free ( DofVector *dofVector )
    \n+
    48 {
    \n+
    49 ALBERTA free_dof_int_vec( dofVector );
    \n+
    50 }
    \n+
    \n+
    51
    \n+
    \n+
    52 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n+
    53 {
    \n+
    54 return ALBERTA read_dof_int_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n+
    55 }
    \n+
    \n
    56
    \n-
    57 public:
    \n-
    \n-
    58 Patch ( ElementList *list, int count )
    \n-
    59 : list_( list ),
    \n-
    60 count_( count )
    \n-
    61 {
    \n-
    62 assert( count > 0 );
    \n-
    63 }
    \n-
    \n-
    64
    \n-
    65 Element *operator[] ( int i ) const;
    \n-
    66
    \n-
    \n-
    67 int count () const
    \n-
    68 {
    \n-
    69 return count_;
    \n-
    70 }
    \n-
    \n-
    71
    \n-
    72 template< class LevelProvider >
    \n-
    73 ElementInfo elementInfo ( int i, const LevelProvider &levelProvider ) const;
    \n-
    74
    \n-
    75 int elementType ( int i ) const;
    \n-
    76 bool hasNeighbor ( int i, int neighbor ) const;
    \n-
    77 int neighborIndex ( int i, int neighbor ) const;
    \n+
    \n+
    57 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n+
    58 {
    \n+
    59 int success = ALBERTA write_dof_int_vec_xdr( dofVector, filename.c_str() );
    \n+
    60 return (success == 0);
    \n+
    61 }
    \n+
    \n+
    62 };
    \n+
    \n+
    63
    \n+
    64 template<>
    \n+
    \n+
    65 struct DofVectorProvider< signed char >
    \n+
    66 {
    \n+
    67 typedef ALBERTA DOF_SCHAR_VEC DofVector;
    \n+
    68
    \n+
    \n+
    69 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n+
    70 {
    \n+
    71 return ALBERTA get_dof_schar_vec( name.c_str(), dofSpace );
    \n+
    72 }
    \n+
    \n+
    73
    \n+
    \n+
    74 static void free ( DofVector *dofVector )
    \n+
    75 {
    \n+
    76 ALBERTA free_dof_schar_vec( dofVector );
    \n+
    77 }
    \n+
    \n
    78
    \n-
    79 template< class Functor >
    \n-
    \n-
    80 void forEach ( Functor &functor ) const
    \n-
    81 {
    \n-
    82 for( int i = 0; i < count(); ++i )
    \n-
    83 functor( (*this)[ i ] );
    \n-
    84 }
    \n-
    \n-
    85
    \n-
    86 template< int codim, class Functor >
    \n-
    \n-
    87 void forEachInteriorSubChild ( Functor &functor ) const
    \n-
    88 {
    \n-\n-
    90 }
    \n-
    \n-
    91 };
    \n-
    \n-
    92
    \n-
    93
    \n-
    94 template< int dim >
    \n-
    \n-
    95 inline Element *Patch< dim >::operator[] ( int i ) const
    \n-
    96 {
    \n-
    97 assert( (i >= 0) && (i < count()) );
    \n-
    98 return list_[ i ].el_info.el;
    \n-
    99 }
    \n+
    \n+
    79 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n+
    80 {
    \n+
    81 return ALBERTA read_dof_schar_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n+
    82 }
    \n+
    \n+
    83
    \n+
    \n+
    84 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n+
    85 {
    \n+
    86 int success = ALBERTA write_dof_schar_vec_xdr( dofVector, filename.c_str() );
    \n+
    87 return (success == 0);
    \n+
    88 }
    \n+
    \n+
    89 };
    \n+
    \n+
    90
    \n+
    91 template<>
    \n+
    \n+
    92 struct DofVectorProvider< unsigned char >
    \n+
    93 {
    \n+
    94 typedef ALBERTA DOF_UCHAR_VEC DofVector;
    \n+
    95
    \n+
    \n+
    96 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n+
    97 {
    \n+
    98 return ALBERTA get_dof_uchar_vec( name.c_str(), dofSpace );
    \n+
    99 }
    \n
    \n
    100
    \n-
    101
    \n-
    102 template< int dim >
    \n-
    103 template< class LevelProvider >
    \n-
    104 inline typename Patch< dim >::ElementInfo
    \n-
    \n-
    105 Patch< dim >::elementInfo ( int i, const LevelProvider &levelProvider ) const
    \n-
    106 {
    \n-
    107 assert( (i >= 0) && (i < count()) );
    \n-
    108 return ElementInfo::createFake( list_[ i ].el_info );
    \n-
    109 }
    \n+
    \n+
    101 static void free ( DofVector *dofVector )
    \n+
    102 {
    \n+
    103 ALBERTA free_dof_uchar_vec( dofVector );
    \n+
    104 }
    \n+
    \n+
    105
    \n+
    \n+
    106 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n+
    107 {
    \n+
    108 return ALBERTA read_dof_uchar_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n+
    109 }
    \n
    \n
    110
    \n-
    111 template<>
    \n-
    112 template< class LevelProvider >
    \n-
    113 inline typename Patch< 2 >::ElementInfo
    \n-
    \n-
    114 Patch< 2 >::elementInfo ( int i, const LevelProvider &levelProvider ) const
    \n-
    115 {
    \n-
    116 assert( (i >= 0) && (i < count()) );
    \n-
    117 const MeshPointer< 2 > &mesh = levelProvider.mesh();
    \n-
    118 const Element *element = (*this)[ i ];
    \n-
    119 const int level = levelProvider( element );
    \n-
    120 return ElementInfo::createFake( mesh, element, level );
    \n-
    121 }
    \n-
    \n+
    \n+
    111 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n+
    112 {
    \n+
    113 int success = ALBERTA write_dof_uchar_vec_xdr( dofVector, filename.c_str() );
    \n+
    114 return (success == 0);
    \n+
    115 }
    \n+
    \n+
    116 };
    \n+
    \n+
    117
    \n+
    118 template<>
    \n+
    \n+\n+
    120 {
    \n+
    121 typedef ALBERTA DOF_REAL_VEC DofVector;
    \n
    122
    \n-
    123
    \n-
    124 template< int dim >
    \n-
    \n-
    125 inline int Patch< dim >::elementType ( int i ) const
    \n-
    126 {
    \n-
    127 assert( (i >= 0) && (i < count()) );
    \n-
    128 return list_[ i ].el_info.el_type;
    \n-
    129 }
    \n-
    \n-
    130
    \n-
    131
    \n-
    132 template< int dim >
    \n+
    \n+
    123 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n+
    124 {
    \n+
    125 return ALBERTA get_dof_real_vec( name.c_str(), dofSpace );
    \n+
    126 }
    \n+
    \n+
    127
    \n+
    \n+
    128 static void free ( DofVector *dofVector )
    \n+
    129 {
    \n+
    130 ALBERTA free_dof_real_vec( dofVector );
    \n+
    131 }
    \n+
    \n+
    132
    \n
    \n-
    133 inline bool Patch< dim >::hasNeighbor ( int i, int neighbor ) const
    \n-
    134 {
    \n-
    135 return (list_[ i ].neigh[ neighbor ] != NULL);
    \n-
    136 }
    \n+
    133 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n+
    134 {
    \n+
    135 return ALBERTA read_dof_real_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n+
    136 }
    \n
    \n
    137
    \n-
    138 template< int dim >
    \n-
    \n-
    139 inline int Patch< dim >::neighborIndex ( int i, int neighbor ) const
    \n-
    140 {
    \n-
    141 assert( hasNeighbor( i, neighbor ) );
    \n-
    142 return (list_[ i ].neigh[ neighbor ]->no);
    \n-
    143 }
    \n+
    \n+
    138 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n+
    139 {
    \n+
    140 int success = ALBERTA write_dof_real_vec_xdr( dofVector, filename.c_str() );
    \n+
    141 return (success == 0);
    \n+
    142 }
    \n+
    \n+
    143 };
    \n
    \n
    144
    \n-
    145
    \n-
    146
    \n-
    147 // ForEachInteriorSubChild
    \n-
    148 // -----------------------
    \n+
    145 template<>
    \n+
    \n+\n+
    147 {
    \n+
    148 typedef ALBERTA DOF_REAL_D_VEC DofVector;
    \n
    149
    \n-
    150 template< int dim >
    \n-
    \n-
    151 struct ForEachInteriorSubChild< dim, 0 >
    \n-
    152 {
    \n-
    153 template< class Functor >
    \n-
    \n-
    154 static void apply ( Functor &functor, const Patch< dim > &patch )
    \n-
    155 {
    \n-
    156 for( int i = 0; i < patch.count(); ++i )
    \n-
    157 {
    \n-
    158 Element *const father = patch[ i ];
    \n-
    159 functor( father->child[ 0 ], 0 );
    \n-
    160 functor( father->child[ 1 ], 0 );
    \n-
    161 }
    \n-
    162 }
    \n-
    \n-
    163 };
    \n+
    \n+
    150 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )
    \n+
    151 {
    \n+
    152 return ALBERTA get_dof_real_d_vec( name.c_str(), dofSpace );
    \n+
    153 }
    \n+
    \n+
    154
    \n+
    \n+
    155 static void free ( DofVector *dofVector )
    \n+
    156 {
    \n+
    157 ALBERTA free_dof_real_d_vec( dofVector );
    \n+
    158 }
    \n+
    \n+
    159
    \n+
    \n+
    160 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace *dofSpace )
    \n+
    161 {
    \n+
    162 return ALBERTA read_dof_real_d_vec_xdr( filename.c_str(), mesh, dofSpace );
    \n+
    163 }
    \n
    \n
    164
    \n-
    165 template< int dim >
    \n-
    \n-
    166 struct ForEachInteriorSubChild< dim, dim >
    \n-
    167 {
    \n-
    168 template< class Functor >
    \n-
    \n-
    169 static void apply ( Functor &functor, const Patch< dim > &patch )
    \n-
    170 {
    \n-
    171 functor( patch[ 0 ]->child[ 0 ], dim );
    \n-
    172 }
    \n-
    \n-
    173 };
    \n-
    \n-
    174
    \n-
    175 template<>
    \n-
    \n-\n-
    177 {
    \n-
    178 template< class Functor >
    \n-
    \n-
    179 static void apply ( Functor &functor, const Patch< 2 > &patch )
    \n-
    180 {
    \n-
    181 // see alberta/src/2d/lagrange_2_2d.c for details
    \n-
    182 Element *const firstFather = patch[ 0 ];
    \n+
    \n+
    165 static bool write ( const DofVector *dofVector, const std::string &filename )
    \n+
    166 {
    \n+
    167 int success = ALBERTA write_dof_real_d_vec_xdr( dofVector, filename.c_str() );
    \n+
    168 return (success == 0);
    \n+
    169 }
    \n+
    \n+
    170 };
    \n+
    \n+
    171
    \n+
    172
    \n+
    173
    \n+
    174 // DofVectorPointer
    \n+
    175 // ----------------
    \n+
    176
    \n+
    177 template< class Dof >
    \n+
    \n+\n+
    179 {
    \n+\n+
    181
    \n+\n
    183
    \n-
    184 Element *const firstChild = firstFather->child[ 0 ];
    \n-
    185 functor( firstChild, 0 );
    \n-
    186 functor( firstChild, 1 );
    \n-
    187
    \n-
    188 functor( firstFather->child[ 1 ], 1 );
    \n-
    189
    \n-
    190 if( patch.count() > 1 )
    \n-
    191 {
    \n-
    192 Element *const father = patch[ 1 ];
    \n-
    193 functor( father->child[ 0 ], 1 );
    \n-
    194 }
    \n-
    195 }
    \n-
    \n-
    196 };
    \n-
    \n-
    197
    \n-
    198 template<>
    \n-
    \n-\n-
    200 {
    \n-
    201 template< class Functor >
    \n+
    184 public:
    \n+
    185 typedef typename DofVectorProvider::DofVector DofVector;
    \n+
    186
    \n+
    187 static const bool supportsAdaptationData = true;
    \n+
    188
    \n+
    189 private:
    \n+
    190 DofVector *dofVector_;
    \n+
    191
    \n+
    192 public:
    \n+
    \n+\n+
    194 : dofVector_( NULL )
    \n+
    195 {}
    \n+
    \n+
    196
    \n+
    \n+\n+
    198 const std::string &name = "" )
    \n+
    199 : dofVector_ ( DofVectorProvider::get( dofSpace, name ) )
    \n+
    200 {}
    \n+
    \n+
    201
    \n
    \n-
    202 static void apply ( Functor &functor, const Patch< 3 > &patch )
    \n-
    203 {
    \n-
    204 // see alberta/src/3d/lagrange_3_3d.c for details
    \n-
    205 Element *const firstFather = patch[ 0 ];
    \n-
    206
    \n-
    207 Element *const firstChild = firstFather->child[ 0 ];
    \n-
    208 functor( firstChild, 0 );
    \n-
    209 functor( firstChild, 1 );
    \n-
    210 functor( firstChild, 2 );
    \n-
    211
    \n-
    212 Element *const secondChild = firstFather->child[ 1 ];
    \n-
    213 functor( secondChild, 1 );
    \n-
    214 functor( secondChild, 2 );
    \n+
    202 explicit DofVectorPointer ( DofVector *dofVector )
    \n+
    203 : dofVector_( dofVector )
    \n+
    204 {}
    \n+
    \n+
    205
    \n+
    \n+
    206 explicit operator bool () const
    \n+
    207 {
    \n+
    208 return (bool)dofVector_;
    \n+
    209 }
    \n+
    \n+
    210
    \n+
    \n+
    211 operator DofVector * () const
    \n+
    212 {
    \n+
    213 return dofVector_;
    \n+
    214 }
    \n+
    \n
    215
    \n-
    216 for( int i = 1; i < patch.count(); ++i )
    \n-
    217 {
    \n-
    218 Element *const father = patch[ i ];
    \n-
    219 const int type = patch.elementType( i );
    \n-
    220
    \n-
    221 int lr_set = 0;
    \n-
    222 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )
    \n-
    223 lr_set |= 1;
    \n-
    224 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )
    \n-
    225 lr_set |= 2;
    \n-
    226 assert( lr_set != 0 );
    \n+
    \n+
    216 operator Dof * () const
    \n+
    217 {
    \n+
    218 Dof *ptr = NULL;
    \n+
    219 GET_DOF_VEC( ptr, dofVector_ );
    \n+
    220 return ptr;
    \n+
    221 }
    \n+
    \n+
    222
    \n+
    \n+
    223 const DofSpace *dofSpace () const
    \n+
    224 {
    \n+
    225 return dofVector_->fe_space;
    \n+
    226 }
    \n+
    \n
    227
    \n-
    228 functor( father->child[ 0 ], 0 );
    \n-
    229 switch( lr_set )
    \n-
    230 {
    \n-
    231 case 1 :
    \n-
    232 functor( father->child[ 0 ], 2 );
    \n-
    233 functor( father->child[ 1 ], (type == 0 ? 1 : 2) );
    \n-
    234 break;
    \n+
    \n+
    228 std::string name () const
    \n+
    229 {
    \n+
    230 if( dofVector_ )
    \n+
    231 return dofVector_->name;
    \n+
    232 else
    \n+
    233 return std::string();
    \n+
    234 }
    \n+
    \n
    235
    \n-
    236 case 2 :
    \n-
    237 functor( father->child[ 0 ], 1 );
    \n-
    238 functor( father->child[ 1 ], (type == 0 ? 2 : 1) );
    \n-
    239 break;
    \n-
    240 }
    \n-
    241 }
    \n-
    242 }
    \n-
    \n-
    243 };
    \n-
    \n-
    244
    \n-
    245 template<>
    \n-
    \n-\n-
    247 {
    \n-
    248 template< class Functor >
    \n+
    \n+
    236 void create ( const DofSpace *dofSpace, const std::string &name = "" )
    \n+
    237 {
    \n+
    238 release();
    \n+
    239 dofVector_ = DofVectorProvider::get( dofSpace, name );
    \n+
    240 }
    \n+
    \n+
    241
    \n+
    242 template< int dim >
    \n+
    \n+
    243 void read ( const std::string &filename, const MeshPointer< dim > &meshPointer )
    \n+
    244 {
    \n+
    245 release();
    \n+
    246 dofVector_ = DofVectorProvider::read( filename, meshPointer, NULL );
    \n+
    247 }
    \n+
    \n+
    248
    \n
    \n-
    249 static void apply ( Functor &functor, const Patch< 3 > &patch )
    \n-
    250 {
    \n-
    251 // see alberta/src/3d/lagrange_2_3d.c for details
    \n-
    252 Element *const firstFather = patch[ 0 ];
    \n+
    249 bool write ( const std::string &filename ) const
    \n+
    250 {
    \n+
    251 return DofVectorProvider::write( dofVector_, filename );
    \n+
    252 }
    \n+
    \n
    253
    \n-
    254 Element *const firstChild = firstFather->child[ 0 ];
    \n-
    255 functor( firstChild, 2 );
    \n-
    256 functor( firstChild, 4 );
    \n-
    257 functor( firstChild, 5 );
    \n-
    258
    \n-
    259 functor( firstFather->child[ 1 ], 2 );
    \n-
    260
    \n-
    261 for( int i = 1; i < patch.count(); ++i )
    \n-
    262 {
    \n-
    263 Element *const father = patch[ i ];
    \n-
    264
    \n-
    265 int lr_set = 0;
    \n-
    266 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )
    \n-
    267 lr_set = 1;
    \n-
    268 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )
    \n-
    269 lr_set += 2;
    \n-
    270 assert( lr_set != 0 );
    \n-
    271
    \n-
    272 switch( lr_set )
    \n-
    273 {
    \n-
    274 case 1 :
    \n-
    275 functor( father->child[ 0 ], 4 );
    \n-
    276 break;
    \n-
    277
    \n-
    278 case 2 :
    \n-
    279 functor( father->child[ 0 ], 5 );
    \n-
    280 break;
    \n-
    281 }
    \n-
    282 }
    \n-
    283 }
    \n-
    \n-
    284 };
    \n-
    \n-
    285
    \n-
    286
    \n-
    287
    \n-
    288 // GeometryInFather
    \n-
    289 // ----------------
    \n+
    \n+
    254 void release ()
    \n+
    255 {
    \n+
    256 if( dofVector_ )
    \n+
    257 {
    \n+
    258 DofVectorProvider::free( dofVector_ );
    \n+
    259 dofVector_ = NULL;
    \n+
    260 }
    \n+
    261 }
    \n+
    \n+
    262
    \n+
    263 template< class Functor >
    \n+
    \n+
    264 void forEach ( Functor &functor ) const
    \n+
    265 {
    \n+
    266 Dof *array = (Dof *)(*this);
    \n+
    267 FOR_ALL_DOFS( dofSpace()->admin, functor( array[ dof ] ) );
    \n+
    268 }
    \n+
    \n+
    269
    \n+
    \n+
    270 void initialize ( const Dof &value )
    \n+
    271 {
    \n+
    272 Dof *array = (Dof *)(*this);
    \n+
    273 FOR_ALL_DOFS( dofSpace()->admin, array[ dof ] = value );
    \n+
    274 }
    \n+
    \n+
    275
    \n+
    276 template< class AdaptationData >
    \n+
    \n+
    277 AdaptationData *getAdaptationData () const
    \n+
    278 {
    \n+
    279 assert( dofVector_ );
    \n+
    280 assert( dofVector_->user_data );
    \n+
    281 return static_cast< AdaptationData * >( dofVector_->user_data );
    \n+
    282 }
    \n+
    \n+
    283
    \n+
    284 template< class AdaptationData >
    \n+
    \n+
    285 void setAdaptationData ( AdaptationData *adaptationData )
    \n+
    286 {
    \n+
    287 assert( dofVector_ );
    \n+
    288 dofVector_->user_data = adaptationData;
    \n+
    289 }
    \n+
    \n
    290
    \n-
    291 template< int dim >
    \n-\n-
    293
    \n-
    294 template<>
    \n-
    \n-\n-
    296 {
    \n-
    297 static const int dim = 1;
    \n-
    298
    \n-
    299 typedef Real LocalVector[ dim ];
    \n-
    300
    \n-
    301 static const LocalVector &
    \n-
    \n-
    302 coordinate ( int child, int /* orientation */, int i )
    \n-
    303 {
    \n-
    304 static const Real coords[ 2 ][ dim+1 ][ dim ]
    \n-
    305 = { { {0.0}, {0.5} }, { {0.5}, {1.0} } };
    \n-
    306 assert( (i >= 0) && (i <= dim) );
    \n-
    307 return coords[ child ][ i ];
    \n-
    308 }
    \n-
    \n-
    309 };
    \n-
    \n-
    310
    \n-
    311 template<>
    \n-
    \n-\n-
    313 {
    \n-
    314 static const int dim = 2;
    \n-
    315
    \n-
    316 typedef Real LocalVector[ dim ];
    \n-
    317
    \n-
    318 static const LocalVector &
    \n-
    \n-
    319 coordinate ( int child, int /* orientation */, int i )
    \n-
    320 {
    \n-
    321 static const Real coords[ 2 ][ dim+1 ][ dim ]
    \n-
    322 = { { {0.0, 1.0}, {0.0, 0.0}, {0.5, 0.0} },
    \n-
    323 { {1.0, 0.0}, {0.0, 1.0}, {0.5, 0.0} } };
    \n-
    324 assert( (i >= 0) && (i <= dim) );
    \n-
    325 return coords[ child ][ i ];
    \n-
    326 }
    \n-
    \n-
    327 };
    \n-
    \n-
    328
    \n-
    329 template<>
    \n-
    \n-\n-
    331 {
    \n-
    332 static const int dim = 3;
    \n-
    333
    \n-
    334 typedef Real LocalVector[ dim ];
    \n+
    291 template< class Interpolation >
    \n+
    \n+\n+
    293 {
    \n+
    294 assert( dofVector_ );
    \n+
    295 dofVector_->refine_interpol = &refineInterpolate< Interpolation >;
    \n+
    296 }
    \n+
    \n+
    297
    \n+
    298 template< class Restriction >
    \n+
    \n+\n+
    300 {
    \n+
    301 assert( dofVector_ );
    \n+
    302 dofVector_->coarse_restrict = &coarsenRestrict< Restriction >;
    \n+
    303 }
    \n+
    \n+
    304
    \n+
    305 private:
    \n+
    306 template< class Interpolation >
    \n+
    307 static void refineInterpolate ( DofVector *dofVector, RC_LIST_EL *list, int n )
    \n+
    308 {
    \n+
    309 const This dofVectorPointer( dofVector );
    \n+
    310 typename Interpolation::Patch patch( list, n );
    \n+
    311 Interpolation::interpolateVector( dofVectorPointer, patch );
    \n+
    312 }
    \n+
    313
    \n+
    314 template< class Restriction >
    \n+
    315 static void coarsenRestrict ( DofVector *dofVector, RC_LIST_EL *list, int n )
    \n+
    316 {
    \n+
    317 const This dofVectorPointer( dofVector );
    \n+
    318 typename Restriction::Patch patch( list, n );
    \n+
    319 Restriction::restrictVector( dofVectorPointer, patch );
    \n+
    320 }
    \n+
    321 };
    \n+
    \n+
    322
    \n+
    323
    \n+
    324
    \n+
    325 // Auxiliary Functions
    \n+
    326 // --------------------
    \n+
    327
    \n+
    \n+
    328 inline void abs ( const DofVectorPointer< int > &dofVector )
    \n+
    329 {
    \n+
    330 assert( !dofVector == false );
    \n+
    331 int *array = (int *)dofVector;
    \n+
    332 FOR_ALL_DOFS( dofVector.dofSpace()->admin,
    \n+
    333 array[ dof ] = std::abs( array[ dof ] ) );
    \n+
    334 }
    \n+
    \n
    335
    \n-
    336 static const LocalVector &
    \n+
    336
    \n
    \n-
    337 coordinate ( int child, int orientation, int i )
    \n-
    338 {
    \n-
    339 static const Real coords[ 2 ][ dim+1 ][ dim ]
    \n-
    340 = { { {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} },
    \n-
    341 { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} } };
    \n-
    342 static const int flip[ 2 ][ 2 ][ dim+1 ]
    \n-
    343 = { { {0, 1, 2, 3}, {0, 1, 2, 3} }, { {0, 2, 1, 3}, {0, 1, 2, 3} } };
    \n-
    344 assert( (i >= 0) && (i <= dim) );
    \n-
    345 i = flip[ child ][ orientation ][ i ];
    \n-
    346 return coords[ child ][ i ];
    \n-
    347 }
    \n-
    \n-
    348 };
    \n-
    \n-
    349
    \n-
    350 }
    \n-
    351
    \n-
    352}
    \n-
    353
    \n-
    354#endif // #if HAVE_ALBERTA
    \n-
    355
    \n-
    356#endif
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n+
    337 inline int max ( const DofVectorPointer< int > &dofVector )
    \n+
    338 {
    \n+
    339 assert( !dofVector == false );
    \n+
    340 int *array = (int *)dofVector;
    \n+
    341 int result = std::numeric_limits< int >::min();
    \n+
    342 FOR_ALL_DOFS( dofVector.dofSpace()->admin,
    \n+
    343 result = std::max( result, array[ dof ] ) );
    \n+
    344 return result;
    \n+
    345 }
    \n+
    \n+
    346
    \n+
    347
    \n+
    \n+
    348 inline int min ( const DofVectorPointer< int > &dofVector )
    \n+
    349 {
    \n+
    350 assert( !dofVector == false );
    \n+
    351 int *array = (int *)dofVector;
    \n+
    352 int result = std::numeric_limits< int >::max();
    \n+
    353 FOR_ALL_DOFS( dofVector.dofSpace()->admin,
    \n+
    354 result = std::min( result, array[ dof ] ) );
    \n+
    355 return result;
    \n+
    356 }
    \n+
    \n+
    357
    \n+
    358 } // namespace Alberta
    \n+
    359
    \n+
    360} // namespace Dune
    \n+
    361
    \n+
    362#endif // #if HAVE_ALBERTA
    \n+
    363
    \n+
    364#endif // #ifndef DUNE_ALBERTA_DOFVECTOR_HH
    \n+
    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n+\n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA REAL_B LocalVector
    Definition misc.hh:49
    \n-
    ALBERTA EL Element
    Definition misc.hh:54
    \n+
    ALBERTA MESH Mesh
    Definition misc.hh:53
    \n+
    void abs(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:328
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n+
    int min(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:348
    \n+
    int max(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:337
    \n+
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n
    Definition meshpointer.hh:40
    \n-\n-
    static ElementInfo createFake(const MeshPointer &mesh, const Element *element, int level, int type=0)
    Definition elementinfo.hh:752
    \n-
    Definition refinement.hh:31
    \n-
    Definition refinement.hh:40
    \n-
    int neighborIndex(int i, int neighbor) const
    Definition refinement.hh:139
    \n-
    int elementType(int i) const
    Definition refinement.hh:125
    \n-
    int count() const
    Definition refinement.hh:67
    \n-
    ElementInfo elementInfo(int i, const LevelProvider &levelProvider) const
    Definition refinement.hh:105
    \n-
    void forEach(Functor &functor) const
    Definition refinement.hh:80
    \n-
    Element * operator[](int i) const
    Definition refinement.hh:95
    \n-
    void forEachInteriorSubChild(Functor &functor) const
    Definition refinement.hh:87
    \n-
    static const int dimension
    Definition refinement.hh:47
    \n-
    bool hasNeighbor(int i, int neighbor) const
    Definition refinement.hh:133
    \n-
    Patch(ElementList *list, int count)
    Definition refinement.hh:58
    \n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition refinement.hh:49
    \n-
    ALBERTA RC_LIST_EL ElementList
    Definition refinement.hh:51
    \n-
    static void apply(Functor &functor, const Patch< dim > &patch)
    Definition refinement.hh:154
    \n-
    static void apply(Functor &functor, const Patch< dim > &patch)
    Definition refinement.hh:169
    \n-
    static void apply(Functor &functor, const Patch< 2 > &patch)
    Definition refinement.hh:179
    \n-
    static void apply(Functor &functor, const Patch< 3 > &patch)
    Definition refinement.hh:202
    \n-
    static void apply(Functor &functor, const Patch< 3 > &patch)
    Definition refinement.hh:249
    \n-
    Definition refinement.hh:292
    \n-
    static const LocalVector & coordinate(int child, int, int i)
    Definition refinement.hh:302
    \n-
    static const LocalVector & coordinate(int child, int, int i)
    Definition refinement.hh:319
    \n-
    static const LocalVector & coordinate(int child, int orientation, int i)
    Definition refinement.hh:337
    \n+
    Definition dofvector.hh:35
    \n+
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:42
    \n+
    ALBERTA DOF_INT_VEC DofVector
    Definition dofvector.hh:40
    \n+
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:57
    \n+
    static void free(DofVector *dofVector)
    Definition dofvector.hh:47
    \n+
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:52
    \n+
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:84
    \n+
    static void free(DofVector *dofVector)
    Definition dofvector.hh:74
    \n+
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:69
    \n+
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:79
    \n+
    ALBERTA DOF_SCHAR_VEC DofVector
    Definition dofvector.hh:67
    \n+
    static void free(DofVector *dofVector)
    Definition dofvector.hh:101
    \n+
    ALBERTA DOF_UCHAR_VEC DofVector
    Definition dofvector.hh:94
    \n+
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:106
    \n+
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:96
    \n+
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:111
    \n+
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:123
    \n+
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:133
    \n+
    static void free(DofVector *dofVector)
    Definition dofvector.hh:128
    \n+
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:138
    \n+
    ALBERTA DOF_REAL_VEC DofVector
    Definition dofvector.hh:121
    \n+
    ALBERTA DOF_REAL_D_VEC DofVector
    Definition dofvector.hh:148
    \n+
    static void free(DofVector *dofVector)
    Definition dofvector.hh:155
    \n+
    static bool write(const DofVector *dofVector, const std::string &filename)
    Definition dofvector.hh:165
    \n+
    static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace *dofSpace)
    Definition dofvector.hh:160
    \n+
    static DofVector * get(const DofSpace *dofSpace, const std::string &name)
    Definition dofvector.hh:150
    \n+
    Definition dofvector.hh:179
    \n+
    DofVectorProvider::DofVector DofVector
    Definition dofvector.hh:185
    \n+
    void setupInterpolation()
    Definition dofvector.hh:292
    \n+
    void initialize(const Dof &value)
    Definition dofvector.hh:270
    \n+
    void read(const std::string &filename, const MeshPointer< dim > &meshPointer)
    Definition dofvector.hh:243
    \n+
    void create(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:236
    \n+
    void release()
    Definition dofvector.hh:254
    \n+
    AdaptationData * getAdaptationData() const
    Definition dofvector.hh:277
    \n+
    void setupRestriction()
    Definition dofvector.hh:299
    \n+
    DofVectorPointer()
    Definition dofvector.hh:193
    \n+
    void setAdaptationData(AdaptationData *adaptationData)
    Definition dofvector.hh:285
    \n+
    bool write(const std::string &filename) const
    Definition dofvector.hh:249
    \n+
    DofVectorPointer(DofVector *dofVector)
    Definition dofvector.hh:202
    \n+
    const DofSpace * dofSpace() const
    Definition dofvector.hh:223
    \n+
    static const bool supportsAdaptationData
    Definition dofvector.hh:187
    \n+
    std::string name() const
    Definition dofvector.hh:228
    \n+
    void forEach(Functor &functor) const
    Definition dofvector.hh:264
    \n+
    DofVectorPointer(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:197
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,454 +1,563 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-refinement.hh\n+dofvector.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_REFINEMENT_HH\n-6#define DUNE_ALBERTA_REFINEMENT_HH\n+5#ifndef DUNE_ALBERTA_DOFVECTOR_HH\n+6#define DUNE_ALBERTA_DOFVECTOR_HH\n 7\n-14#include \n-15\n-16#include \n-17#include \n-18\n-19#if HAVE_ALBERTA\n-20\n-21namespace Dune\n-22{\n-23\n-24 namespace Alberta\n-25 {\n-26\n-27 // Internal Forward Declarations\n-28 // -----------------------------\n+8#include \n+9#include \n+10\n+11#include \n+12#include \n+13#include \n+14\n+15#if HAVE_ALBERTA\n+16\n+17namespace Dune\n+18{\n+19\n+20 namespace Alberta\n+21 {\n+22\n+23 // External Forward Declarations\n+24 // -----------------------------\n+25\n+26 template< int dim >\n+27 class MeshPointer;\n+28\n 29\n-30 template< int dim, int codim >\n-31 struct ForEachInteriorSubChild;\n-32\n+30\n+31 // DofVectorProvider\n+32 // -----------------\n 33\n-34\n-35 // Patch\n-36 // -----\n-37\n-38 template< int dim >\n-39 class Patch\n-40 {\n-41 typedef Patch<_dim_> This;\n-42\n-43 static_assert(((dim >= 1) && (dim <= 3)),\n-44 \"Alberta supports only dimensions 1, 2, 3\");\n-45\n-46 public:\n-47 static const int dimension = dim;\n-48\n-49 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-50\n-51 typedef ALBERTA RC_LIST_EL ElementList;\n-52\n-53 private:\n-54 ElementList *list_;\n-55 int count_;\n+34 template< class Dof >\n+35 struct DofVectorProvider;\n+36\n+37 template<>\n+38 struct DofVectorProvider< int >\n+39 {\n+40 typedef ALBERTA DOF_INT_VEC DofVector;\n+41\n+42 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n+43 {\n+44 return ALBERTA get_dof_int_vec( name.c_str(), dofSpace );\n+45 }\n+46\n+47 static void free ( DofVector *dofVector )\n+48 {\n+49 ALBERTA free_dof_int_vec( dofVector );\n+50 }\n+51\n+52 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace )\n+53 {\n+54 return ALBERTA read_dof_int_vec_xdr( filename.c_str(), mesh, dofSpace );\n+55 }\n 56\n-57 public:\n-58 Patch ( ElementList *list, int count )\n-59 : list_( list ),\n-60 count_( count )\n-61 {\n-62 assert( count > 0 );\n-63 }\n-64\n-65 Element *operator[]_( int i ) const;\n-66\n-67 int count () const\n-68 {\n-69 return count_;\n-70 }\n-71\n-72 template< class LevelProvider >\n-73 ElementInfo elementInfo ( int i, const LevelProvider &levelProvider ) const;\n-74\n-75 int elementType ( int i ) const;\n-76 bool hasNeighbor ( int i, int neighbor ) const;\n-77 int neighborIndex ( int i, int neighbor ) const;\n+57 static bool write ( const DofVector *dofVector, const std::string &filename\n+)\n+58 {\n+59 int success = ALBERTA write_dof_int_vec_xdr( dofVector, filename.c_str() );\n+60 return (success == 0);\n+61 }\n+62 };\n+63\n+64 template<>\n+65 struct DofVectorProvider< signed char >\n+66 {\n+67 typedef ALBERTA DOF_SCHAR_VEC DofVector;\n+68\n+69 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n+70 {\n+71 return ALBERTA get_dof_schar_vec( name.c_str(), dofSpace );\n+72 }\n+73\n+74 static void free ( DofVector *dofVector )\n+75 {\n+76 ALBERTA free_dof_schar_vec( dofVector );\n+77 }\n 78\n-79 template< class Functor >\n-80 void forEach ( Functor &functor ) const\n-81 {\n-82 for( int i = 0; i < count(); ++i )\n-83 functor( (*this)[ i ] );\n-84 }\n-85\n-86 template< int codim, class Functor >\n-87 void forEachInteriorSubChild ( Functor &functor ) const\n-88 {\n-89 ForEachInteriorSubChild<_dim,_codim_>::apply( functor, *this );\n-90 }\n-91 };\n-92\n-93\n-94 template< int dim >\n-95 inline Element *Patch<_dim_>::operator[]_( int i ) const\n-96 {\n-97 assert( (i >= 0) && (i < count()) );\n-98 return list_[ i ].el_info.el;\n+79 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace )\n+80 {\n+81 return ALBERTA read_dof_schar_vec_xdr( filename.c_str(), mesh, dofSpace );\n+82 }\n+83\n+84 static bool write ( const DofVector *dofVector, const std::string &filename\n+)\n+85 {\n+86 int success = ALBERTA write_dof_schar_vec_xdr( dofVector, filename.c_str()\n+);\n+87 return (success == 0);\n+88 }\n+89 };\n+90\n+91 template<>\n+92 struct DofVectorProvider< unsigned char >\n+93 {\n+94 typedef ALBERTA DOF_UCHAR_VEC DofVector;\n+95\n+96 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n+97 {\n+98 return ALBERTA get_dof_uchar_vec( name.c_str(), dofSpace );\n 99 }\n 100\n-101\n-102 template< int dim >\n-103 template< class LevelProvider >\n-104 inline typename Patch<_dim_>::ElementInfo\n-105 Patch<_dim_>::elementInfo ( int i, const LevelProvider &levelProvider )\n-const\n-106 {\n-107 assert( (i >= 0) && (i < count()) );\n-108 return ElementInfo::createFake( list_[ i ].el_info );\n+101 static void free ( DofVector *dofVector )\n+102 {\n+103 ALBERTA free_dof_uchar_vec( dofVector );\n+104 }\n+105\n+106 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace )\n+107 {\n+108 return ALBERTA read_dof_uchar_vec_xdr( filename.c_str(), mesh, dofSpace );\n 109 }\n 110\n-111 template<>\n-112 template< class LevelProvider >\n-113 inline typename Patch<_2_>::ElementInfo\n-114 Patch<_2_>::elementInfo ( int i, const LevelProvider &levelProvider ) const\n-115 {\n-116 assert( (i >= 0) && (i < count()) );\n-117 const MeshPointer<_2_> &mesh = levelProvider.mesh();\n-118 const Element *element = (*this)[ i ];\n-119 const int level = levelProvider( element );\n-120 return ElementInfo::createFake( mesh, element, level );\n-121 }\n+111 static bool write ( const DofVector *dofVector, const std::string &filename\n+)\n+112 {\n+113 int success = ALBERTA write_dof_uchar_vec_xdr( dofVector, filename.c_str()\n+);\n+114 return (success == 0);\n+115 }\n+116 };\n+117\n+118 template<>\n+119 struct DofVectorProvider< Real >\n+120 {\n+121 typedef ALBERTA DOF_REAL_VEC DofVector;\n 122\n-123\n-124 template< int dim >\n-125 inline int Patch<_dim_>::elementType ( int i ) const\n-126 {\n-127 assert( (i >= 0) && (i < count()) );\n-128 return list_[ i ].el_info.el_type;\n-129 }\n-130\n-131\n-132 template< int dim >\n-133 inline bool Patch<_dim_>::hasNeighbor ( int i, int neighbor ) const\n+123 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n+124 {\n+125 return ALBERTA get_dof_real_vec( name.c_str(), dofSpace );\n+126 }\n+127\n+128 static void free ( DofVector *dofVector )\n+129 {\n+130 ALBERTA free_dof_real_vec( dofVector );\n+131 }\n+132\n+133 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace )\n 134 {\n-135 return (list_[ i ].neigh[ neighbor ] != NULL);\n+135 return ALBERTA read_dof_real_vec_xdr( filename.c_str(), mesh, dofSpace );\n 136 }\n 137\n-138 template< int dim >\n-139 inline int Patch<_dim_>::neighborIndex ( int i, int neighbor ) const\n-140 {\n-141 assert( hasNeighbor( i, neighbor ) );\n-142 return (list_[ i ].neigh[ neighbor ]->no);\n-143 }\n+138 static bool write ( const DofVector *dofVector, const std::string &filename\n+)\n+139 {\n+140 int success = ALBERTA write_dof_real_vec_xdr( dofVector, filename.c_str()\n+);\n+141 return (success == 0);\n+142 }\n+143 };\n 144\n-145\n-146\n-147 // ForEachInteriorSubChild\n-148 // -----------------------\n+145 template<>\n+146 struct DofVectorProvider< GlobalVector >\n+147 {\n+148 typedef ALBERTA DOF_REAL_D_VEC DofVector;\n 149\n-150 template< int dim >\n-151 struct ForEachInteriorSubChild< dim, 0 >\n-152 {\n-153 template< class Functor >\n-154 static void apply ( Functor &functor, const Patch<_dim_> &patch )\n-155 {\n-156 for( int i = 0; i < patch.count(); ++i )\n-157 {\n-158 Element *const father = patch[ i ];\n-159 functor( father->child[ 0 ], 0 );\n-160 functor( father->child[ 1 ], 0 );\n-161 }\n-162 }\n-163 };\n+150 static DofVector *get ( const DofSpace *dofSpace, const std::string &name )\n+151 {\n+152 return ALBERTA get_dof_real_d_vec( name.c_str(), dofSpace );\n+153 }\n+154\n+155 static void free ( DofVector *dofVector )\n+156 {\n+157 ALBERTA free_dof_real_d_vec( dofVector );\n+158 }\n+159\n+160 static DofVector *read ( const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace )\n+161 {\n+162 return ALBERTA read_dof_real_d_vec_xdr( filename.c_str(), mesh, dofSpace );\n+163 }\n 164\n-165 template< int dim >\n-166 struct ForEachInteriorSubChild< dim, dim >\n-167 {\n-168 template< class Functor >\n-169 static void apply ( Functor &functor, const Patch<_dim_> &patch )\n-170 {\n-171 functor( patch[ 0 ]->child[ 0 ], dim );\n-172 }\n-173 };\n-174\n-175 template<>\n-176 struct ForEachInteriorSubChild< 2, 1 >\n-177 {\n-178 template< class Functor >\n-179 static void apply ( Functor &functor, const Patch<_2_> &patch )\n-180 {\n-181 // see alberta/src/2d/lagrange_2_2d.c for details\n-182 Element *const firstFather = patch[ 0 ];\n+165 static bool write ( const DofVector *dofVector, const std::string &filename\n+)\n+166 {\n+167 int success = ALBERTA write_dof_real_d_vec_xdr( dofVector, filename.c_str()\n+);\n+168 return (success == 0);\n+169 }\n+170 };\n+171\n+172\n+173\n+174 // DofVectorPointer\n+175 // ----------------\n+176\n+177 template< class Dof >\n+178 class DofVectorPointer\n+179 {\n+180 typedef DofVectorPointer<_Dof_> This;\n+181\n+182 typedef Alberta::DofVectorProvider<_Dof_> DofVectorProvider;\n 183\n-184 Element *const firstChild = firstFather->child[ 0 ];\n-185 functor( firstChild, 0 );\n-186 functor( firstChild, 1 );\n-187\n-188 functor( firstFather->child[ 1 ], 1 );\n-189\n-190 if( patch.count() > 1 )\n-191 {\n-192 Element *const father = patch[ 1 ];\n-193 functor( father->child[ 0 ], 1 );\n-194 }\n-195 }\n-196 };\n-197\n-198 template<>\n-199 struct ForEachInteriorSubChild< 3, 1 >\n-200 {\n-201 template< class Functor >\n-202 static void apply ( Functor &functor, const Patch<_3_> &patch )\n-203 {\n-204 // see alberta/src/3d/lagrange_3_3d.c for details\n-205 Element *const firstFather = patch[ 0 ];\n-206\n-207 Element *const firstChild = firstFather->child[ 0 ];\n-208 functor( firstChild, 0 );\n-209 functor( firstChild, 1 );\n-210 functor( firstChild, 2 );\n-211\n-212 Element *const secondChild = firstFather->child[ 1 ];\n-213 functor( secondChild, 1 );\n-214 functor( secondChild, 2 );\n+184 public:\n+185 typedef typename DofVectorProvider::DofVector DofVector;\n+186\n+187 static const bool supportsAdaptationData = true;\n+188\n+189 private:\n+190 DofVector *dofVector_;\n+191\n+192 public:\n+193 DofVectorPointer ()\n+194 : dofVector_( NULL )\n+195 {}\n+196\n+197 explicit DofVectorPointer ( const DofSpace *dofSpace,\n+198 const std::string &name = \"\" )\n+199 : dofVector_ ( DofVectorProvider::get( dofSpace, name ) )\n+200 {}\n+201\n+202 explicit DofVectorPointer ( DofVector *dofVector )\n+203 : dofVector_( dofVector )\n+204 {}\n+205\n+206 explicit operator bool () const\n+207 {\n+208 return (bool)dofVector_;\n+209 }\n+210\n+211 operator DofVector * () const\n+212 {\n+213 return dofVector_;\n+214 }\n 215\n-216 for( int i = 1; i < patch.count(); ++i )\n+216 operator Dof * () const\n 217 {\n-218 Element *const father = patch[ i ];\n-219 const int type = patch.elementType( i );\n-220\n-221 int lr_set = 0;\n-222 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )\n-223 lr_set |= 1;\n-224 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )\n-225 lr_set |= 2;\n-226 assert( lr_set != 0 );\n+218 Dof *ptr = NULL;\n+219 GET_DOF_VEC( ptr, dofVector_ );\n+220 return ptr;\n+221 }\n+222\n+223 const DofSpace *dofSpace () const\n+224 {\n+225 return dofVector_->fe_space;\n+226 }\n 227\n-228 functor( father->child[ 0 ], 0 );\n-229 switch( lr_set )\n-230 {\n-231 case 1 :\n-232 functor( father->child[ 0 ], 2 );\n-233 functor( father->child[ 1 ], (type == 0 ? 1 : 2) );\n-234 break;\n+228 std::string name () const\n+229 {\n+230 if( dofVector_ )\n+231 return dofVector_->name;\n+232 else\n+233 return std::string();\n+234 }\n 235\n-236 case 2 :\n-237 functor( father->child[ 0 ], 1 );\n-238 functor( father->child[ 1 ], (type == 0 ? 2 : 1) );\n-239 break;\n+236 void create ( const DofSpace *dofSpace, const std::string &name = \"\" )\n+237 {\n+238 release();\n+239 dofVector_ = DofVectorProvider::get( dofSpace, name );\n 240 }\n-241 }\n-242 }\n-243 };\n-244\n-245 template<>\n-246 struct ForEachInteriorSubChild< 3, 2 >\n-247 {\n-248 template< class Functor >\n-249 static void apply ( Functor &functor, const Patch<_3_> &patch )\n+241\n+242 template< int dim >\n+243 void read ( const std::string &filename, const MeshPointer<_dim_>\n+&meshPointer )\n+244 {\n+245 release();\n+246 dofVector_ = DofVectorProvider::read( filename, meshPointer, NULL );\n+247 }\n+248\n+249 bool write ( const std::string &filename ) const\n 250 {\n-251 // see alberta/src/3d/lagrange_2_3d.c for details\n-252 Element *const firstFather = patch[ 0 ];\n+251 return DofVectorProvider::write( dofVector_, filename );\n+252 }\n 253\n-254 Element *const firstChild = firstFather->child[ 0 ];\n-255 functor( firstChild, 2 );\n-256 functor( firstChild, 4 );\n-257 functor( firstChild, 5 );\n-258\n-259 functor( firstFather->child[ 1 ], 2 );\n-260\n-261 for( int i = 1; i < patch.count(); ++i )\n-262 {\n-263 Element *const father = patch[ i ];\n-264\n-265 int lr_set = 0;\n-266 if( patch.hasNeighbor( i, 0 ) && (patch.neighborIndex( i, 0 ) < i) )\n-267 lr_set = 1;\n-268 if( patch.hasNeighbor( i, 1 ) && (patch.neighborIndex( i, 1 ) < i) )\n-269 lr_set += 2;\n-270 assert( lr_set != 0 );\n-271\n-272 switch( lr_set )\n-273 {\n-274 case 1 :\n-275 functor( father->child[ 0 ], 4 );\n-276 break;\n-277\n-278 case 2 :\n-279 functor( father->child[ 0 ], 5 );\n-280 break;\n-281 }\n+254 void release ()\n+255 {\n+256 if( dofVector_ )\n+257 {\n+258 DofVectorProvider::free( dofVector_ );\n+259 dofVector_ = NULL;\n+260 }\n+261 }\n+262\n+263 template< class Functor >\n+264 void forEach ( Functor &functor ) const\n+265 {\n+266 Dof *array = (Dof *)(*this);\n+267 FOR_ALL_DOFS( dofSpace()->admin, functor( array[ dof ] ) );\n+268 }\n+269\n+270 void initialize ( const Dof &value )\n+271 {\n+272 Dof *array = (Dof *)(*this);\n+273 FOR_ALL_DOFS( dofSpace()->admin, array[ dof ] = value );\n+274 }\n+275\n+276 template< class AdaptationData >\n+277 AdaptationData *getAdaptationData () const\n+278 {\n+279 assert( dofVector_ );\n+280 assert( dofVector_->user_data );\n+281 return static_cast< AdaptationData * >( dofVector_->user_data );\n 282 }\n-283 }\n-284 };\n-285\n-286\n-287\n-288 // GeometryInFather\n-289 // ----------------\n+283\n+284 template< class AdaptationData >\n+285 void setAdaptationData ( AdaptationData *adaptationData )\n+286 {\n+287 assert( dofVector_ );\n+288 dofVector_->user_data = adaptationData;\n+289 }\n 290\n-291 template< int dim >\n-292 struct GeometryInFather;\n-293\n-294 template<>\n-295 struct GeometryInFather< 1 >\n-296 {\n-297 static const int dim = 1;\n-298\n-299 typedef Real LocalVector[ dim ];\n-300\n-301 static const LocalVector &\n-302 coordinate ( int child, int /* orientation */, int i )\n-303 {\n-304 static const Real coords[ 2 ][ dim+1 ][ dim ]\n-305 = { { {0.0}, {0.5} }, { {0.5}, {1.0} } };\n-306 assert( (i >= 0) && (i <= dim) );\n-307 return coords[ child ][ i ];\n-308 }\n-309 };\n-310\n-311 template<>\n-312 struct GeometryInFather< 2 >\n-313 {\n-314 static const int dim = 2;\n-315\n-316 typedef Real LocalVector[ dim ];\n-317\n-318 static const LocalVector &\n-319 coordinate ( int child, int /* orientation */, int i )\n-320 {\n-321 static const Real coords[ 2 ][ dim+1 ][ dim ]\n-322 = { { {0.0, 1.0}, {0.0, 0.0}, {0.5, 0.0} },\n-323 { {1.0, 0.0}, {0.0, 1.0}, {0.5, 0.0} } };\n-324 assert( (i >= 0) && (i <= dim) );\n-325 return coords[ child ][ i ];\n-326 }\n-327 };\n-328\n-329 template<>\n-330 struct GeometryInFather< 3 >\n-331 {\n-332 static const int dim = 3;\n-333\n-334 typedef Real LocalVector[ dim ];\n+291 template< class Interpolation >\n+292 void setupInterpolation ()\n+293 {\n+294 assert( dofVector_ );\n+295 dofVector_->refine_interpol = &refineInterpolate< Interpolation >;\n+296 }\n+297\n+298 template< class Restriction >\n+299 void setupRestriction ()\n+300 {\n+301 assert( dofVector_ );\n+302 dofVector_->coarse_restrict = &coarsenRestrict< Restriction >;\n+303 }\n+304\n+305 private:\n+306 template< class Interpolation >\n+307 static void refineInterpolate ( DofVector *dofVector, RC_LIST_EL *list, int\n+n )\n+308 {\n+309 const This dofVectorPointer( dofVector );\n+310 typename Interpolation::Patch patch( list, n );\n+311 Interpolation::interpolateVector( dofVectorPointer, patch );\n+312 }\n+313\n+314 template< class Restriction >\n+315 static void coarsenRestrict ( DofVector *dofVector, RC_LIST_EL *list, int n\n+)\n+316 {\n+317 const This dofVectorPointer( dofVector );\n+318 typename Restriction::Patch patch( list, n );\n+319 Restriction::restrictVector( dofVectorPointer, patch );\n+320 }\n+321 };\n+322\n+323\n+324\n+325 // Auxiliary Functions\n+326 // --------------------\n+327\n+328 inline void abs ( const DofVectorPointer<_int_> &dofVector )\n+329 {\n+330 assert( !dofVector == false );\n+331 int *array = (int *)dofVector;\n+332 FOR_ALL_DOFS( dofVector.dofSpace()->admin,\n+333 array[ dof ] = std::abs( array[ dof ] ) );\n+334 }\n 335\n-336 static const LocalVector &\n-337 coordinate ( int child, int orientation, int i )\n+336\n+337 inline int max ( const DofVectorPointer<_int_> &dofVector )\n 338 {\n-339 static const Real coords[ 2 ][ dim+1 ][ dim ]\n-340 = { { {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} },\n-341 { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {0.5, 0.0, 0.0} } };\n-342 static const int flip[ 2 ][ 2 ][ dim+1 ]\n-343 = { { {0, 1, 2, 3}, {0, 1, 2, 3} }, { {0, 2, 1, 3}, {0, 1, 2, 3} } };\n-344 assert( (i >= 0) && (i <= dim) );\n-345 i = flip[ child ][ orientation ][ i ];\n-346 return coords[ child ][ i ];\n-347 }\n-348 };\n-349\n-350 }\n-351\n-352}\n-353\n-354#endif // #if HAVE_ALBERTA\n-355\n-356#endif\n+339 assert( !dofVector == false );\n+340 int *array = (int *)dofVector;\n+341 int result = std::numeric_limits< int >::min();\n+342 FOR_ALL_DOFS( dofVector.dofSpace()->admin,\n+343 result = std::max( result, array[ dof ] ) );\n+344 return result;\n+345 }\n+346\n+347\n+348 inline int min ( const DofVectorPointer<_int_> &dofVector )\n+349 {\n+350 assert( !dofVector == false );\n+351 int *array = (int *)dofVector;\n+352 int result = std::numeric_limits< int >::max();\n+353 FOR_ALL_DOFS( dofVector.dofSpace()->admin,\n+354 result = std::min( result, array[ dof ] ) );\n+355 return result;\n+356 }\n+357\n+358 } // namespace Alberta\n+359\n+360} // namespace Dune\n+361\n+362#endif // #if HAVE_ALBERTA\n+363\n+364#endif // #ifndef DUNE_ALBERTA_DOFVECTOR_HH\n+refinement.hh\n+provides a wrapper for ALBERTA's refinement patches and the corners for\n+geometryInFather\n elementinfo.hh\n provides a wrapper for ALBERTA's el_info structure\n misc.hh\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::LocalVector\n-ALBERTA REAL_B LocalVector\n-Definition misc.hh:49\n-Dune::Alberta::Element\n-ALBERTA EL Element\n-Definition misc.hh:54\n+Dune::Alberta::Mesh\n+ALBERTA MESH Mesh\n+Definition misc.hh:53\n+Dune::Alberta::abs\n+void abs(const DofVectorPointer< int > &dofVector)\n+Definition dofvector.hh:328\n Dune::Alberta::Real\n ALBERTA REAL Real\n Definition misc.hh:48\n+Dune::Alberta::DofSpace\n+ALBERTA FE_SPACE DofSpace\n+Definition misc.hh:65\n+Dune::Alberta::min\n+int min(const DofVectorPointer< int > &dofVector)\n+Definition dofvector.hh:348\n+Dune::Alberta::max\n+int max(const DofVectorPointer< int > &dofVector)\n+Definition dofvector.hh:337\n+Dune::Alberta::GlobalVector\n+ALBERTA REAL_D GlobalVector\n+Definition misc.hh:50\n Dune::Alberta::MeshPointer\n Definition meshpointer.hh:40\n-Dune::Alberta::ElementInfo<_dimension_>\n-Dune::Alberta::ElementInfo::createFake\n-static ElementInfo createFake(const MeshPointer &mesh, const Element *element,\n-int level, int type=0)\n-Definition elementinfo.hh:752\n-Dune::Alberta::ForEachInteriorSubChild\n-Definition refinement.hh:31\n-Dune::Alberta::Patch\n-Definition refinement.hh:40\n-Dune::Alberta::Patch::neighborIndex\n-int neighborIndex(int i, int neighbor) const\n-Definition refinement.hh:139\n-Dune::Alberta::Patch::elementType\n-int elementType(int i) const\n-Definition refinement.hh:125\n-Dune::Alberta::Patch::count\n-int count() const\n-Definition refinement.hh:67\n-Dune::Alberta::Patch::elementInfo\n-ElementInfo elementInfo(int i, const LevelProvider &levelProvider) const\n-Definition refinement.hh:105\n-Dune::Alberta::Patch::forEach\n+Dune::Alberta::DofVectorProvider\n+Definition dofvector.hh:35\n+Dune::Alberta::DofVectorProvider<_int_>::get\n+static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n+Definition dofvector.hh:42\n+Dune::Alberta::DofVectorProvider<_int_>::DofVector\n+ALBERTA DOF_INT_VEC DofVector\n+Definition dofvector.hh:40\n+Dune::Alberta::DofVectorProvider<_int_>::write\n+static bool write(const DofVector *dofVector, const std::string &filename)\n+Definition dofvector.hh:57\n+Dune::Alberta::DofVectorProvider<_int_>::free\n+static void free(DofVector *dofVector)\n+Definition dofvector.hh:47\n+Dune::Alberta::DofVectorProvider<_int_>::read\n+static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace)\n+Definition dofvector.hh:52\n+Dune::Alberta::DofVectorProvider<_signed_char_>::write\n+static bool write(const DofVector *dofVector, const std::string &filename)\n+Definition dofvector.hh:84\n+Dune::Alberta::DofVectorProvider<_signed_char_>::free\n+static void free(DofVector *dofVector)\n+Definition dofvector.hh:74\n+Dune::Alberta::DofVectorProvider<_signed_char_>::get\n+static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n+Definition dofvector.hh:69\n+Dune::Alberta::DofVectorProvider<_signed_char_>::read\n+static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace)\n+Definition dofvector.hh:79\n+Dune::Alberta::DofVectorProvider<_signed_char_>::DofVector\n+ALBERTA DOF_SCHAR_VEC DofVector\n+Definition dofvector.hh:67\n+Dune::Alberta::DofVectorProvider<_unsigned_char_>::free\n+static void free(DofVector *dofVector)\n+Definition dofvector.hh:101\n+Dune::Alberta::DofVectorProvider<_unsigned_char_>::DofVector\n+ALBERTA DOF_UCHAR_VEC DofVector\n+Definition dofvector.hh:94\n+Dune::Alberta::DofVectorProvider<_unsigned_char_>::read\n+static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace)\n+Definition dofvector.hh:106\n+Dune::Alberta::DofVectorProvider<_unsigned_char_>::get\n+static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n+Definition dofvector.hh:96\n+Dune::Alberta::DofVectorProvider<_unsigned_char_>::write\n+static bool write(const DofVector *dofVector, const std::string &filename)\n+Definition dofvector.hh:111\n+Dune::Alberta::DofVectorProvider<_Real_>::get\n+static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n+Definition dofvector.hh:123\n+Dune::Alberta::DofVectorProvider<_Real_>::read\n+static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace)\n+Definition dofvector.hh:133\n+Dune::Alberta::DofVectorProvider<_Real_>::free\n+static void free(DofVector *dofVector)\n+Definition dofvector.hh:128\n+Dune::Alberta::DofVectorProvider<_Real_>::write\n+static bool write(const DofVector *dofVector, const std::string &filename)\n+Definition dofvector.hh:138\n+Dune::Alberta::DofVectorProvider<_Real_>::DofVector\n+ALBERTA DOF_REAL_VEC DofVector\n+Definition dofvector.hh:121\n+Dune::Alberta::DofVectorProvider<_GlobalVector_>::DofVector\n+ALBERTA DOF_REAL_D_VEC DofVector\n+Definition dofvector.hh:148\n+Dune::Alberta::DofVectorProvider<_GlobalVector_>::free\n+static void free(DofVector *dofVector)\n+Definition dofvector.hh:155\n+Dune::Alberta::DofVectorProvider<_GlobalVector_>::write\n+static bool write(const DofVector *dofVector, const std::string &filename)\n+Definition dofvector.hh:165\n+Dune::Alberta::DofVectorProvider<_GlobalVector_>::read\n+static DofVector * read(const std::string &filename, Mesh *mesh, DofSpace\n+*dofSpace)\n+Definition dofvector.hh:160\n+Dune::Alberta::DofVectorProvider<_GlobalVector_>::get\n+static DofVector * get(const DofSpace *dofSpace, const std::string &name)\n+Definition dofvector.hh:150\n+Dune::Alberta::DofVectorPointer\n+Definition dofvector.hh:179\n+Dune::Alberta::DofVectorPointer::DofVector\n+DofVectorProvider::DofVector DofVector\n+Definition dofvector.hh:185\n+Dune::Alberta::DofVectorPointer::setupInterpolation\n+void setupInterpolation()\n+Definition dofvector.hh:292\n+Dune::Alberta::DofVectorPointer::initialize\n+void initialize(const Dof &value)\n+Definition dofvector.hh:270\n+Dune::Alberta::DofVectorPointer::read\n+void read(const std::string &filename, const MeshPointer< dim > &meshPointer)\n+Definition dofvector.hh:243\n+Dune::Alberta::DofVectorPointer::create\n+void create(const DofSpace *dofSpace, const std::string &name=\"\")\n+Definition dofvector.hh:236\n+Dune::Alberta::DofVectorPointer::release\n+void release()\n+Definition dofvector.hh:254\n+Dune::Alberta::DofVectorPointer::getAdaptationData\n+AdaptationData * getAdaptationData() const\n+Definition dofvector.hh:277\n+Dune::Alberta::DofVectorPointer::setupRestriction\n+void setupRestriction()\n+Definition dofvector.hh:299\n+Dune::Alberta::DofVectorPointer::DofVectorPointer\n+DofVectorPointer()\n+Definition dofvector.hh:193\n+Dune::Alberta::DofVectorPointer::setAdaptationData\n+void setAdaptationData(AdaptationData *adaptationData)\n+Definition dofvector.hh:285\n+Dune::Alberta::DofVectorPointer::write\n+bool write(const std::string &filename) const\n+Definition dofvector.hh:249\n+Dune::Alberta::DofVectorPointer::DofVectorPointer\n+DofVectorPointer(DofVector *dofVector)\n+Definition dofvector.hh:202\n+Dune::Alberta::DofVectorPointer::dofSpace\n+const DofSpace * dofSpace() const\n+Definition dofvector.hh:223\n+Dune::Alberta::DofVectorPointer::supportsAdaptationData\n+static const bool supportsAdaptationData\n+Definition dofvector.hh:187\n+Dune::Alberta::DofVectorPointer::name\n+std::string name() const\n+Definition dofvector.hh:228\n+Dune::Alberta::DofVectorPointer::forEach\n void forEach(Functor &functor) const\n-Definition refinement.hh:80\n-Dune::Alberta::Patch::operator[]\n-Element * operator[](int i) const\n-Definition refinement.hh:95\n-Dune::Alberta::Patch::forEachInteriorSubChild\n-void forEachInteriorSubChild(Functor &functor) const\n-Definition refinement.hh:87\n-Dune::Alberta::Patch::dimension\n-static const int dimension\n-Definition refinement.hh:47\n-Dune::Alberta::Patch::hasNeighbor\n-bool hasNeighbor(int i, int neighbor) const\n-Definition refinement.hh:133\n-Dune::Alberta::Patch::Patch\n-Patch(ElementList *list, int count)\n-Definition refinement.hh:58\n-Dune::Alberta::Patch::ElementInfo\n-Alberta::ElementInfo< dimension > ElementInfo\n-Definition refinement.hh:49\n-Dune::Alberta::Patch::ElementList\n-ALBERTA RC_LIST_EL ElementList\n-Definition refinement.hh:51\n-Dune::Alberta::ForEachInteriorSubChild<_dim,_0_>::apply\n-static void apply(Functor &functor, const Patch< dim > &patch)\n-Definition refinement.hh:154\n-Dune::Alberta::ForEachInteriorSubChild<_dim,_dim_>::apply\n-static void apply(Functor &functor, const Patch< dim > &patch)\n-Definition refinement.hh:169\n-Dune::Alberta::ForEachInteriorSubChild<_2,_1_>::apply\n-static void apply(Functor &functor, const Patch< 2 > &patch)\n-Definition refinement.hh:179\n-Dune::Alberta::ForEachInteriorSubChild<_3,_1_>::apply\n-static void apply(Functor &functor, const Patch< 3 > &patch)\n-Definition refinement.hh:202\n-Dune::Alberta::ForEachInteriorSubChild<_3,_2_>::apply\n-static void apply(Functor &functor, const Patch< 3 > &patch)\n-Definition refinement.hh:249\n-Dune::Alberta::GeometryInFather\n-Definition refinement.hh:292\n-Dune::Alberta::GeometryInFather<_1_>::coordinate\n-static const LocalVector & coordinate(int child, int, int i)\n-Definition refinement.hh:302\n-Dune::Alberta::GeometryInFather<_2_>::coordinate\n-static const LocalVector & coordinate(int child, int, int i)\n-Definition refinement.hh:319\n-Dune::Alberta::GeometryInFather<_3_>::coordinate\n-static const LocalVector & coordinate(int child, int orientation, int i)\n-Definition refinement.hh:337\n+Definition dofvector.hh:264\n+Dune::Alberta::DofVectorPointer::DofVectorPointer\n+DofVectorPointer(const DofSpace *dofSpace, const std::string &name=\"\")\n+Definition dofvector.hh:197\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00707.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00707.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: indexsets.cc File Reference\n+dune-grid: level.hh File Reference\n \n \n \n \n \n \n \n@@ -70,21 +70,38 @@\n \n
    \n
    \n \n-
    indexsets.cc File Reference
    \n+
    level.hh File Reference
    \n
    \n
    \n-\n+
    #include <cassert>
    \n+#include <cstdlib>
    \n+#include <dune/grid/albertagrid/meshpointer.hh>
    \n+#include <dune/grid/albertagrid/dofadmin.hh>
    \n+#include <dune/grid/albertagrid/dofvector.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::AlbertaGridLevelProvider< dim >
     
    class  Dune::AlbertaGridLevelProvider< dim >::SetLocal
     
    class  Dune::AlbertaGridLevelProvider< dim >::CalcMaxLevel
     
    struct  Dune::AlbertaGridLevelProvider< dim >::Interpolation
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,17 +1,30 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Namespaces\n-indexsets.cc File Reference\n-#include \n-#include \n+Classes | Namespaces\n+level.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 \u00a0 Dune::AlbertaGridLevelProvider<_dim_>\n+\u00a0\n+ class \u00a0 Dune::AlbertaGridLevelProvider<_dim_>::SetLocal\n+\u00a0\n+ class \u00a0 Dune::AlbertaGridLevelProvider<_dim_>::CalcMaxLevel\n+\u00a0\n+struct \u00a0 Dune::AlbertaGridLevelProvider<_dim_>::Interpolation\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00710.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00710.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: undefine-2.0.hh File Reference\n+dune-grid: meshpointer.cc File Reference\n \n \n \n \n \n \n \n@@ -69,25 +69,29 @@\n \n \n
    \n
    \n-
    undefine-2.0.hh File Reference
    \n+ \n+
    meshpointer.cc File Reference
    \n
    \n
    \n-\n-

    Contains #undefs for all preprocessor macros defined by alberta. \n-More...

    \n-\n-

    Go to the source code of this file.

    \n-

    Detailed Description

    \n-

    Contains #undefs for all preprocessor macros defined by alberta.

    \n-

    This file is created automatically by the perl script undefAllMacros.pl.

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

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,15 +1,18 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-undefine-2.0.hh File Reference\n-Contains #undefs for all preprocessor macros defined by alberta. More...\n-Go_to_the_source_code_of_this_file.\n-***** Detailed Description *****\n-Contains #undefs for all preprocessor macros defined by alberta.\n-This file is created automatically by the perl script undefAllMacros.pl.\n+Namespaces\n+meshpointer.cc File Reference\n+#include \n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n+namespace \u00a0 Dune::Alberta\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00716.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00716.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macrodata.cc File Reference\n+dune-grid: albertagrid.cc File Reference\n \n \n \n \n \n \n \n@@ -70,37 +70,67 @@\n \n
    \n
    \n \n-
    macrodata.cc File Reference
    \n+Classes |\n+Namespaces |\n+Macros |\n+Functions |\n+Variables
    \n+
    albertagrid.cc File Reference
    \n
    \n
    \n-\n-

    provides a wrapper for ALBERTA's macro_data structure \n-More...

    \n-
    #include <vector>
    \n-#include <array>
    \n-#include <dune/grid/common/exceptions.hh>
    \n-#include <dune/grid/albertagrid/macrodata.hh>
    \n-
    \n+
    #include "geometry.cc"
    \n+#include "entity.cc"
    \n+#include "intersection.cc"
    \n+
    \n+

    Go to the source code of this file.

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

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+\n+\n+\n+

    \n+Macros

    #define DUNE_ALBERTAGRID_CC
     
    \n+\n+\n+\n+\n+

    \n+Functions

    template<int dim, int dimworld>
    static void Dune::checkAlbertaDimensions ()
     
    \n+\n+\n+\n

    \n+Variables

    static void * Dune::Alberta::adaptationDataHandler_
     
    \n-

    Detailed Description

    \n-

    provides a wrapper for ALBERTA's macro_data structure

    \n-
    Author
    Martin Nolte
    \n-
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_ALBERTAGRID_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_ALBERTAGRID_CC
    \n+
    \n+\n+
    \n+
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,26 +1,34 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Namespaces\n-macrodata.cc File Reference\n-provides a wrapper for ALBERTA's macro_data structure More...\n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Macros | Functions | Variables\n+albertagrid.cc File Reference\n+#include \"geometry.cc\"\n+#include \"entity.cc\"\n+#include \"intersection.cc\"\n+Go_to_the_source_code_of_this_file.\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::Alberta\n \u00a0\n-***** Detailed Description *****\n-provides a wrapper for ALBERTA's macro_data structure\n- Author\n- Martin Nolte\n+Macros\n+#define\u00a0 DUNE_ALBERTAGRID_CC\n+\u00a0\n+Functions\n+template\n+static void\u00a0 Dune::checkAlbertaDimensions ()\n+\u00a0\n+Variables\n+static void *\u00a0 Dune::Alberta::adaptationDataHandler_\n+\u00a0\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_ALBERTAGRID_CC *****\n+#define DUNE_ALBERTAGRID_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00719.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00719.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: leveliterator.hh File Reference\n+dune-grid: macrodata.cc File Reference\n \n \n \n \n \n \n \n@@ -70,37 +70,37 @@\n \n
    \n
    \n \n-
    leveliterator.hh File Reference
    \n+
    macrodata.cc File Reference
    \n
    \n
    \n-\n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::AlbertaGridLevelIterator< codim, pitype, GridImp >
     
    class  Dune::AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp >
     
    \n+\n+

    provides a wrapper for ALBERTA's macro_data structure \n+More...

    \n+
    #include <vector>
    \n+#include <array>
    \n+#include <dune/grid/common/exceptions.hh>
    \n+#include <dune/grid/albertagrid/macrodata.hh>
    \n+
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n-
    \n+

    Detailed Description

    \n+

    provides a wrapper for ALBERTA's macro_data structure

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,23 +1,26 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-Classes | Namespaces\n-leveliterator.hh File Reference\n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::AlbertaGridLevelIterator<_codim,_pitype,_GridImp_>\n-\u00a0\n-class \u00a0 Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>\n-\u00a0\n+Namespaces\n+macrodata.cc File Reference\n+provides a wrapper for ALBERTA's macro_data structure More...\n+#include \n+#include \n+#include \n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::Alberta\n+\u00a0\n+***** Detailed Description *****\n+provides a wrapper for ALBERTA's macro_data structure\n+ Author\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00722.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00722.html", "unified_diff": "@@ -72,15 +72,15 @@\n
  • dune
  • grid
  • \n \n \n
    \n
    albertagrid.hh File Reference
    \n
    \n
    \n-\n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00722_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00722_source.html", "unified_diff": "@@ -83,20 +83,20 @@\n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTAGRID_HH
    \n
    6#define DUNE_ALBERTAGRID_HH
    \n-\n+\n \n \n \n
    11#endif
    \n-
    provides the AlbertaGrid class
    \n+
    provides the AlbertaGrid class
    \n
    specialization of the generic GridFactory for AlbertaGrid
    \n \n
    specialization of the generic StructuredGridFactory for AlbertaGrid
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00731.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00731.html", "unified_diff": "@@ -83,22 +83,22 @@\n

    The IdentityGrid class. \n More...

    \n \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00731_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00731_source.html", "unified_diff": "@@ -92,22 +92,22 @@\n
    13#include <map>
    \n
    14
    \n
    15#include <dune/common/parallel/communication.hh>
    \n \n \n
    18
    \n
    19// The components of the IdentityGrid interface
    \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n
    28
    \n
    29namespace Dune
    \n
    30{
    \n
    31 // Forward declaration
    \n
    32 template <class HostGrid>
    \n
    33 class IdentityGrid;
    \n
    34
    \n@@ -578,22 +578,22 @@\n
    520 static const bool v = isLeafwiseConforming<HostGrid>::v;
    \n
    521 };
    \n
    522 } // end namespace Capabilities
    \n
    523
    \n
    524} // namespace Dune
    \n
    525
    \n
    526#endif // DUNE_GRID_IDENTITYGRID_HH
    \n-
    The IdentityGridLeafIterator class.
    \n-
    The IdentityGridEntity class.
    \n-
    The IdentityGridHierarchicIterator class.
    \n-
    The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes.
    \n-
    The IdentityGridEntitySeed class.
    \n-
    The IdentityGridLevelIterator class.
    \n-
    The index and id sets for the IdentityGrid class.
    \n-
    The IdentityGridGeometry class and its specializations.
    \n+
    The IdentityGridEntity class.
    \n+
    The IdentityGridHierarchicIterator class.
    \n+
    The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes.
    \n+
    The IdentityGridLeafIterator class.
    \n+
    The index and id sets for the IdentityGrid class.
    \n+
    The IdentityGridEntitySeed class.
    \n+
    The IdentityGridGeometry class and its specializations.
    \n+
    The IdentityGridLevelIterator class.
    \n
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    static const bool v
    Definition common/capabilities.hh:59
    \n
    static const bool v
    Definition common/capabilities.hh:75
    \n
    static const bool v
    Definition common/capabilities.hh:98
    \n
    static const bool v
    Definition common/capabilities.hh:107
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -452,31 +452,31 @@\n 520 static const bool v = isLeafwiseConforming::v;\n 521 };\n 522 } // end namespace Capabilities\n 523\n 524} // namespace Dune\n 525\n 526#endif // DUNE_GRID_IDENTITYGRID_HH\n-identitygridleafiterator.hh\n-The IdentityGridLeafIterator class.\n identitygridentity.hh\n The IdentityGridEntity class.\n identitygridhierarchiciterator.hh\n The IdentityGridHierarchicIterator class.\n identitygridintersectioniterator.hh\n The IdentityGridLeafIntersectionIterator and\n IdentityGridLevelIntersectionIterator classes.\n-identitygridentityseed.hh\n-The IdentityGridEntitySeed class.\n-identitygridleveliterator.hh\n-The IdentityGridLevelIterator class.\n+identitygridleafiterator.hh\n+The IdentityGridLeafIterator class.\n identitygridindexsets.hh\n The index and id sets for the IdentityGrid class.\n+identitygridentityseed.hh\n+The IdentityGridEntitySeed class.\n identitygridgeometry.hh\n The IdentityGridGeometry class and its specializations.\n+identitygridleveliterator.hh\n+The IdentityGridLevelIterator class.\n Dune::CommunicationDirection\n CommunicationDirection\n Define a type for communication direction parameter.\n Definition gridenums.hh:170\n Dune::InterfaceType\n InterfaceType\n Parameter to be used for the communication functions.\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00734.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00734.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridleafiterator.hh File Reference\n+dune-grid: identitygridentity.hh File Reference\n \n \n \n \n \n \n \n@@ -72,38 +72,41 @@\n
  • dune
  • grid
  • identitygrid
  • \n \n \n
    \n \n-
    identitygridleafiterator.hh File Reference
    \n+
    identitygridentity.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridLeafIterator class. \n+

    The IdentityGridEntity class. \n More...

    \n-

    \n Classes

    struct  Dune::IdentityGridFamily< dim, HostGrid >
     
    \n \n-\n-\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::IdentityGridLeafIterator< codim, pitype, GridImp >
     Iterator over all entities of a given codimension and level of a grid. More...
    class  Dune::IdentityGridEntity< codim, dim, GridImp >
     The implementation of entities in a IdentityGrid. More...
     
    class  Dune::IdentityGridEntity< 0, dim, GridImp >
     Specialization for codim-0-entities. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridLeafIterator class.

    \n+

    The IdentityGridEntity class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,24 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridleafiterator.hh File Reference\n-The IdentityGridLeafIterator class. More...\n-#include \n+identitygridentity.hh File Reference\n+The IdentityGridEntity class. More...\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridLeafIterator<_codim,_pitype,_GridImp_>\n-\u00a0 Iterator over all entities of a given codimension and level of a grid.\n- More...\n+class \u00a0 Dune::IdentityGridEntity<_codim,_dim,_GridImp_>\n+\u00a0 The implementation of entities in a IdentityGrid. More...\n+\u00a0\n+class \u00a0 Dune::IdentityGridEntity<_0,_dim,_GridImp_>\n+\u00a0 Specialization for codim-0-entities. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridLeafIterator class.\n+The IdentityGridEntity class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00734_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00734_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridleafiterator.hh Source File\n+dune-grid: identitygridentity.hh Source File\n \n \n \n \n \n \n \n@@ -74,100 +74,542 @@\n \n \n
    \n
    \n-
    identitygridleafiterator.hh
    \n+
    identitygridentity.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRIDLEAFITERATOR_HH
    \n-
    6#define DUNE_IDENTITYGRIDLEAFITERATOR_HH
    \n+
    5#ifndef DUNE_IDENTITYGRIDENTITY_HH
    \n+
    6#define DUNE_IDENTITYGRIDENTITY_HH
    \n
    7
    \n-\n-
    9
    \n+\n+
    13
    \n
    14namespace Dune {
    \n
    15
    \n
    16
    \n-
    20 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n-
    \n-\n-
    22 {
    \n-
    23 private:
    \n+
    17 // Forward declarations
    \n+
    18
    \n+
    19 template<int codim, int dim, class GridImp>
    \n+
    20 class IdentityGridEntity;
    \n+
    21
    \n+
    22 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n+
    23 class IdentityGridLevelIterator;
    \n
    24
    \n-
    25 // LevelIterator to the equivalent entity in the host grid
    \n-
    26 typedef typename GridImp::HostGridType::template Codim<codim>::template Partition<pitype>::LeafIterator HostGridLeafIterator;
    \n+
    25 template<class GridImp>
    \n+
    26 class IdentityGridLevelIntersectionIterator;
    \n
    27
    \n-
    28 public:
    \n-
    29
    \n-
    30 constexpr static int codimension = codim;
    \n-
    31
    \n-
    32 typedef typename GridImp::template Codim<codim>::Entity Entity;
    \n+
    28 template<class GridImp>
    \n+
    29 class IdentityGridLeafIntersectionIterator;
    \n+
    30
    \n+
    31 template<class GridImp>
    \n+
    32 class IdentityGridHierarchicIterator;
    \n
    33
    \n-
    \n-
    35 explicit IdentityGridLeafIterator(const GridImp* identityGrid) :
    \n-
    36 identityGrid_(identityGrid),
    \n-
    37 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template begin<codim,pitype>())
    \n-
    38 {}
    \n-
    \n+
    34
    \n+
    35 // External forward declarations
    \n+
    36 template< class Grid >
    \n+
    37 struct HostGridAccess;
    \n+
    38
    \n
    39
    \n-
    \n-
    44 explicit IdentityGridLeafIterator(const GridImp* identityGrid, [[maybe_unused]] bool endDummy) :
    \n-
    45 identityGrid_(identityGrid),
    \n-
    46 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template end<codim,pitype>())
    \n-
    47 {}
    \n-
    \n-
    48
    \n-
    49
    \n-
    \n-
    51 void increment() {
    \n-
    52 ++hostLeafIterator_;
    \n-
    53 }
    \n-
    \n-
    54
    \n-
    \n-\n-
    57 return Entity{{identityGrid_,*hostLeafIterator_}};
    \n-
    58 }
    \n-
    \n+
    40 //**********************************************************************
    \n+
    41 //
    \n+
    42 // --IdentityGridEntity
    \n+
    43 // --Entity
    \n+
    44 //
    \n+
    52 template<int codim, int dim, class GridImp>
    \n+
    \n+\n+
    54 public EntityDefaultImplementation <codim,dim,GridImp,IdentityGridEntity>
    \n+
    55 {
    \n+
    56
    \n+
    57 template <class GridImp_>
    \n+\n
    59
    \n-
    \n-
    61 bool equals(const IdentityGridLeafIterator& i) const {
    \n-
    62 return hostLeafIterator_ == i.hostLeafIterator_;
    \n-
    63 }
    \n-
    \n-
    64
    \n-
    65 private:
    \n-
    66 const GridImp* identityGrid_;
    \n-
    67
    \n-
    68 HostGridLeafIterator hostLeafIterator_;
    \n-
    69
    \n-
    70 };
    \n-
    \n+
    60 template <class GridImp_>
    \n+\n+
    62
    \n+
    63 template <class GridImp_>
    \n+\n+
    65
    \n+
    66 template <class GridImp_>
    \n+\n+
    68
    \n+
    69 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n+
    70
    \n
    71
    \n-
    72
    \n-
    73} // namespace Dune
    \n-
    74
    \n-
    75#endif
    \n-\n-
    Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
    leaf grid view for the given grid
    Definition common/grid.hh:805
    \n+
    72 private:
    \n+
    73
    \n+
    74 typedef typename GridImp::ctype ctype;
    \n+
    75
    \n+
    76 // The codimension of this entity wrt the host grid
    \n+
    77 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - GridImp::dimension + codim;
    \n+
    78
    \n+
    79 // equivalent entity in the host grid
    \n+
    80 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Entity HostGridEntity;
    \n+
    81
    \n+
    82
    \n+
    83 public:
    \n+
    84
    \n+
    85 typedef typename GridImp::template Codim<codim>::Geometry Geometry;
    \n+
    86
    \n+
    88 typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;
    \n+
    89
    \n+
    \n+\n+
    91 : identityGrid_(nullptr)
    \n+
    92 {}
    \n+
    \n+
    93
    \n+
    \n+
    94 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity& hostEntity)
    \n+
    95 : hostEntity_(hostEntity)
    \n+
    96 , identityGrid_(identityGrid)
    \n+
    97 {}
    \n+
    \n+
    98
    \n+
    \n+
    99 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&& hostEntity)
    \n+
    100 : hostEntity_(std::move(hostEntity))
    \n+
    101 , identityGrid_(identityGrid)
    \n+
    102 {}
    \n+
    \n+
    103
    \n+
    \n+\n+
    106 : hostEntity_(original.hostEntity_)
    \n+
    107 , identityGrid_(original.identityGrid_)
    \n+
    108 {}
    \n+
    \n+
    109
    \n+
    \n+\n+
    111 : hostEntity_(std::move(original.hostEntity_))
    \n+
    112 , identityGrid_(original.identityGrid_)
    \n+
    113 {}
    \n+
    \n+
    114
    \n+
    \n+\n+
    117 {
    \n+
    118 if (this != &original)
    \n+
    119 {
    \n+
    120 identityGrid_ = original.identityGrid_;
    \n+
    121 hostEntity_ = original.hostEntity_;
    \n+
    122 }
    \n+
    123 return *this;
    \n+
    124 }
    \n+
    \n+
    125
    \n+
    \n+\n+
    128 {
    \n+
    129 if (this != &original)
    \n+
    130 {
    \n+
    131 identityGrid_ = original.identityGrid_;
    \n+
    132 hostEntity_ = std::move(original.hostEntity_);
    \n+
    133 }
    \n+
    134 return *this;
    \n+
    135 }
    \n+
    \n+
    136
    \n+
    \n+
    137 bool equals(const IdentityGridEntity& other) const
    \n+
    138 {
    \n+
    139 return hostEntity_ == other.hostEntity_;
    \n+
    140 }
    \n+
    \n+
    141
    \n+
    \n+
    143 bool hasFather () const {
    \n+
    144 return hostEntity_.hasFather();
    \n+
    145 }
    \n+
    \n+
    146
    \n+
    \n+\n+
    149 {
    \n+
    150 return EntitySeed(hostEntity_);
    \n+
    151 }
    \n+
    \n+
    152
    \n+
    \n+
    154 int level () const {
    \n+
    155 return hostEntity_.level();
    \n+
    156 }
    \n+
    \n+
    157
    \n+
    158
    \n+
    \n+\n+
    162 return hostEntity_.partitionType();
    \n+
    163 }
    \n+
    \n+
    164
    \n+
    \n+
    167 unsigned int subEntities (unsigned int cc) const
    \n+
    168 {
    \n+
    169 return hostEntity_.subEntities(cc);
    \n+
    170 }
    \n+
    \n+
    171
    \n+
    \n+\n+
    174 {
    \n+
    175 return Geometry( hostEntity_.geometry() );
    \n+
    176 }
    \n+
    \n+
    177
    \n+
    178
    \n+
    179 HostGridEntity hostEntity_;
    \n+
    180
    \n+
    181 private:
    \n+
    182
    \n+
    183 const GridImp* identityGrid_;
    \n+
    184
    \n+
    185 };
    \n+
    \n+
    186
    \n+
    187
    \n+
    188
    \n+
    189
    \n+
    190 //***********************
    \n+
    191 //
    \n+
    192 // --IdentityGridEntity
    \n+
    193 //
    \n+
    194 //***********************
    \n+
    202 template<int dim, class GridImp>
    \n+
    \n+
    203 class IdentityGridEntity<0,dim,GridImp> :
    \n+
    204 public EntityDefaultImplementation<0,dim,GridImp, IdentityGridEntity>
    \n+
    205 {
    \n+
    206 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n+
    207
    \n+
    208 public:
    \n+
    209
    \n+
    210 // The codimension of this entitypointer wrt the host grid
    \n+
    211 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - GridImp::dimension;
    \n+
    212
    \n+
    213 // equivalent entity in the host grid
    \n+
    214 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Entity HostGridEntity;
    \n+
    215
    \n+
    216 typedef typename GridImp::template Codim<0>::Geometry Geometry;
    \n+
    217
    \n+
    218 typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;
    \n+
    219
    \n+\n+
    222
    \n+\n+
    225
    \n+\n+
    228
    \n+
    230 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
    \n+
    231
    \n+
    232
    \n+
    233
    \n+
    \n+\n+
    235 : identityGrid_(nullptr)
    \n+
    236 {}
    \n+
    \n+
    237
    \n+
    \n+
    238 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity& hostEntity)
    \n+
    239 : hostEntity_(hostEntity)
    \n+
    240 , identityGrid_(identityGrid)
    \n+
    241 {}
    \n+
    \n+
    242
    \n+
    \n+
    243 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&& hostEntity)
    \n+
    244 : hostEntity_(std::move(hostEntity))
    \n+
    245 , identityGrid_(identityGrid)
    \n+
    246 {}
    \n+
    \n+
    247
    \n+
    \n+\n+
    250 : hostEntity_(original.hostEntity_)
    \n+
    251 , identityGrid_(original.identityGrid_)
    \n+
    252 {}
    \n+
    \n+
    253
    \n+
    \n+\n+
    255 : hostEntity_(std::move(original.hostEntity_))
    \n+
    256 , identityGrid_(original.identityGrid_)
    \n+
    257 {}
    \n+
    \n+
    258
    \n+
    \n+\n+
    261 {
    \n+
    262 if (this != &original)
    \n+
    263 {
    \n+
    264 identityGrid_ = original.identityGrid_;
    \n+
    265 hostEntity_ = original.hostEntity_;
    \n+
    266 }
    \n+
    267 return *this;
    \n+
    268 }
    \n+
    \n+
    269
    \n+
    \n+\n+
    272 {
    \n+
    273 if (this != &original)
    \n+
    274 {
    \n+
    275 identityGrid_ = original.identityGrid_;
    \n+
    276 hostEntity_ = std::move(original.hostEntity_);
    \n+
    277 }
    \n+
    278 return *this;
    \n+
    279 }
    \n+
    \n+
    280
    \n+
    \n+
    281 bool equals(const IdentityGridEntity& other) const
    \n+
    282 {
    \n+
    283 return hostEntity_ == other.hostEntity_;
    \n+
    284 }
    \n+
    \n+
    285
    \n+
    \n+
    287 bool hasFather () const {
    \n+
    288 return hostEntity_.hasFather();
    \n+
    289 }
    \n+
    \n+
    290
    \n+
    \n+\n+
    293 {
    \n+
    294 return EntitySeed(hostEntity_);
    \n+
    295 }
    \n+
    \n+
    296
    \n+
    \n+
    298 int level () const
    \n+
    299 {
    \n+
    300 return hostEntity_.level();
    \n+
    301 }
    \n+
    \n+
    302
    \n+
    303
    \n+
    \n+\n+
    306 return hostEntity_.partitionType();
    \n+
    307 }
    \n+
    \n+
    308
    \n+
    309
    \n+
    \n+\n+
    312 {
    \n+
    313 return Geometry( hostEntity_.geometry() );
    \n+
    314 }
    \n+
    \n+
    315
    \n+
    316
    \n+
    \n+
    319 unsigned int subEntities (unsigned int codim) const
    \n+
    320 {
    \n+
    321 return hostEntity_.subEntities(codim);
    \n+
    322 }
    \n+
    \n+
    323
    \n+
    324
    \n+
    328 template<int cc>
    \n+
    \n+
    329 typename GridImp::template Codim<cc>::Entity subEntity (int i) const {
    \n+
    330 return IdentityGridEntity<cc,dim,GridImp>(identityGrid_, hostEntity_.template subEntity<cc>(i));
    \n+
    331 }
    \n+
    \n+
    332
    \n+
    333
    \n+
    \n+\n+\n+
    337 identityGrid_,
    \n+
    338 identityGrid_->getHostGrid().levelGridView(level()).ibegin(hostEntity_));
    \n+
    339 }
    \n+
    \n+
    340
    \n+
    341
    \n+
    \n+\n+\n+
    345 identityGrid_,
    \n+
    346 identityGrid_->getHostGrid().levelGridView(level()).iend(hostEntity_));
    \n+
    347 }
    \n+
    \n+
    348
    \n+
    349
    \n+
    \n+\n+\n+
    353 identityGrid_,
    \n+
    354 identityGrid_->getHostGrid().leafGridView().ibegin(hostEntity_));
    \n+
    355 }
    \n+
    \n+
    356
    \n+
    357
    \n+
    \n+\n+\n+
    361 identityGrid_,
    \n+
    362 identityGrid_->getHostGrid().leafGridView().iend(hostEntity_));
    \n+
    363 }
    \n+
    \n+
    364
    \n+
    365
    \n+
    \n+
    367 bool isLeaf() const {
    \n+
    368 return hostEntity_.isLeaf();
    \n+
    369 }
    \n+
    \n+
    370
    \n+
    371
    \n+
    \n+
    374 typename GridImp::template Codim<0>::Entity father () const {
    \n+
    375 return IdentityGridEntity(identityGrid_, hostEntity_.father());
    \n+
    376 }
    \n+
    \n+
    377
    \n+
    378
    \n+
    \n+\n+
    389 {
    \n+
    390 return LocalGeometry( hostEntity_.geometryInFather() );
    \n+
    391 }
    \n+
    \n+
    392
    \n+
    393
    \n+
    \n+\n+
    399 {
    \n+
    400 return IdentityGridHierarchicIterator<const GridImp>(identityGrid_, *this, maxLevel);
    \n+
    401 }
    \n+
    \n+
    402
    \n+
    403
    \n+
    \n+\n+
    406 {
    \n+
    407 return IdentityGridHierarchicIterator<const GridImp>(identityGrid_, *this, maxLevel, true);
    \n+
    408 }
    \n+
    \n+
    409
    \n+
    410
    \n+
    \n+
    412 bool wasRefined () const
    \n+
    413 {
    \n+
    414 if (identityGrid_->adaptationStep!=GridImp::adaptDone)
    \n+
    415 return false;
    \n+
    416
    \n+
    417 int level = this->level();
    \n+
    418 int index = identityGrid_->levelIndexSet(level).index(*this);
    \n+
    419 return identityGrid_->refinementMark_[level][index];
    \n+
    420 }
    \n+
    \n+
    421
    \n+
    422
    \n+
    \n+
    424 bool mightBeCoarsened () const
    \n+
    425 {
    \n+
    426 return true;
    \n+
    427 }
    \n+
    \n+
    428
    \n+
    429
    \n+
    430 // /////////////////////////////////////////
    \n+
    431 // Internal stuff
    \n+
    432 // /////////////////////////////////////////
    \n+
    433
    \n+
    434
    \n+\n+
    436 const GridImp* identityGrid_;
    \n+
    437
    \n+
    438 private:
    \n+
    439
    \n+
    440 typedef typename GridImp::ctype ctype;
    \n+
    441
    \n+
    442 }; // end of IdentityGridEntity codim = 0
    \n+
    \n+
    443
    \n+
    444
    \n+
    445} // namespace Dune
    \n+
    446
    \n+
    447
    \n+
    448#endif
    \n+
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n+
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Iterator over all entities of a given codimension and level of a grid.
    Definition identitygridleafiterator.hh:22
    \n-
    Entity dereference() const
    dereferencing
    Definition identitygridleafiterator.hh:56
    \n-
    bool equals(const IdentityGridLeafIterator &i) const
    equality
    Definition identitygridleafiterator.hh:61
    \n-
    IdentityGridLeafIterator(const GridImp *identityGrid, bool endDummy)
    Constructor which create the end iterator.
    Definition identitygridleafiterator.hh:44
    \n-
    static constexpr int codimension
    Definition identitygridleafiterator.hh:30
    \n-
    GridImp::template Codim< codim >::Entity Entity
    Definition identitygridleafiterator.hh:32
    \n-
    IdentityGridLeafIterator(const GridImp *identityGrid)
    Definition identitygridleafiterator.hh:35
    \n-
    void increment()
    prefix increment
    Definition identitygridleafiterator.hh:51
    \n+
    Default Implementations for EntityImp.
    Definition common/entity.hh:542
    \n+
    GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition common/entity.hh:576
    \n+
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n+
    The implementation of entities in a IdentityGrid.
    Definition identitygridentity.hh:55
    \n+
    IdentityGridEntity()
    Definition identitygridentity.hh:90
    \n+
    IdentityGridEntity & operator=(IdentityGridEntity &&original)
    Definition identitygridentity.hh:127
    \n+
    IdentityGridEntity(IdentityGridEntity &&original)
    Definition identitygridentity.hh:110
    \n+
    bool equals(const IdentityGridEntity &other) const
    Definition identitygridentity.hh:137
    \n+
    HostGridEntity hostEntity_
    Definition identitygridentity.hh:179
    \n+
    GridImp::template Codim< codim >::EntitySeed EntitySeed
    The type of the EntitySeed interface class.
    Definition identitygridentity.hh:88
    \n+
    EntitySeed seed() const
    Create EntitySeed.
    Definition identitygridentity.hh:148
    \n+
    IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity &hostEntity)
    Definition identitygridentity.hh:94
    \n+
    Geometry geometry() const
    geometry of this entity
    Definition identitygridentity.hh:173
    \n+
    PartitionType partitionType() const
    The partition type for parallel computing.
    Definition identitygridentity.hh:161
    \n+
    unsigned int subEntities(unsigned int cc) const
    Return the number of subEntities of codimension codim.
    Definition identitygridentity.hh:167
    \n+
    IdentityGridEntity(const IdentityGridEntity &original)
    Definition identitygridentity.hh:105
    \n+
    IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)
    Definition identitygridentity.hh:99
    \n+
    bool hasFather() const
    returns true if father entity exists
    Definition identitygridentity.hh:143
    \n+
    GridImp::template Codim< codim >::Geometry Geometry
    Definition identitygridentity.hh:85
    \n+
    IdentityGridEntity & operator=(const IdentityGridEntity &original)
    Definition identitygridentity.hh:116
    \n+
    int level() const
    level of this element
    Definition identitygridentity.hh:154
    \n+
    Definition identitygridintersectioniterator.hh:84
    \n+
    Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
    Definition identitygridintersectioniterator.hh:29
    \n+
    Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
    Definition identitygridhierarchiciterator.hh:26
    \n+
    unsigned int subEntities(unsigned int codim) const
    Return the number of subEntities of codimension codim.
    Definition identitygridentity.hh:319
    \n+
    IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)
    Definition identitygridentity.hh:243
    \n+
    bool isLeaf() const
    returns true if Entity has NO children
    Definition identitygridentity.hh:367
    \n+
    IdentityGridHierarchicIterator< GridImp > hbegin(int maxLevel) const
    Inter-level access to son elements on higher levels<=maxlevel. This is provided for sparsely stored n...
    Definition identitygridentity.hh:398
    \n+
    GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
    Definition identitygridentity.hh:218
    \n+
    GridImp::template Codim< 0 >::EntitySeed EntitySeed
    The type of the EntitySeed interface class.
    Definition identitygridentity.hh:230
    \n+
    EntitySeed seed() const
    Create EntitySeed.
    Definition identitygridentity.hh:292
    \n+
    IdentityGridLevelIntersectionIterator< GridImp > ilevelbegin() const
    First level intersection.
    Definition identitygridentity.hh:335
    \n+
    IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity &hostEntity)
    Definition identitygridentity.hh:238
    \n+
    int level() const
    Level of this element.
    Definition identitygridentity.hh:298
    \n+
    IdentityGridLeafIntersectionIterator< GridImp > ileafbegin() const
    First leaf intersection.
    Definition identitygridentity.hh:351
    \n+
    HostGridEntity hostEntity_
    Definition identitygridentity.hh:435
    \n+
    IdentityGridEntity & operator=(const IdentityGridEntity &original)
    Definition identitygridentity.hh:260
    \n+
    Geometry geometry() const
    Geometry of this entity.
    Definition identitygridentity.hh:311
    \n+
    IdentityGridLevelIntersectionIterator< GridImp > ilevelend() const
    Reference to one past the last neighbor.
    Definition identitygridentity.hh:343
    \n+
    IdentityGridEntity(const IdentityGridEntity &original)
    Definition identitygridentity.hh:249
    \n+
    IdentityGridHierarchicIterator< GridImp > hend(int maxLevel) const
    Returns iterator to one past the last son.
    Definition identitygridentity.hh:405
    \n+
    IdentityGridLeafIntersectionIterator< GridImp > ileafend() const
    Reference to one past the last leaf intersection.
    Definition identitygridentity.hh:359
    \n+
    bool wasRefined() const
    Definition identitygridentity.hh:412
    \n+
    IdentityGridEntity & operator=(IdentityGridEntity &&original)
    Definition identitygridentity.hh:271
    \n+
    bool hasFather() const
    returns true if father entity exists
    Definition identitygridentity.hh:287
    \n+
    GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Entity HostGridEntity
    Definition identitygridentity.hh:214
    \n+
    GridImp::template Codim< 0 >::Entity father() const
    Definition identitygridentity.hh:374
    \n+
    bool mightBeCoarsened() const
    Definition identitygridentity.hh:424
    \n+
    LocalGeometry geometryInFather() const
    Location of this element relative to the reference element element of the father. This is sufficient ...
    Definition identitygridentity.hh:388
    \n+
    const GridImp * identityGrid_
    Definition identitygridentity.hh:436
    \n+
    GridImp::template Codim< cc >::Entity subEntity(int i) const
    Provide access to sub entity i of given codimension. Entities are numbered 0 ... subEntities(cc)-1.
    Definition identitygridentity.hh:329
    \n+
    IdentityGridEntity(IdentityGridEntity &&original)
    Definition identitygridentity.hh:254
    \n+
    GridImp::template Codim< 0 >::Geometry Geometry
    Definition identitygridentity.hh:216
    \n+
    bool equals(const IdentityGridEntity &other) const
    Definition identitygridentity.hh:281
    \n+
    PartitionType partitionType() const
    The partition type for parallel computing.
    Definition identitygridentity.hh:305
    \n+
    Definition identitygridindexsets.hh:26
    \n+
    Definition identitygridindexsets.hh:96
    \n+
    Definition identitygridindexsets.hh:185
    \n+
    Definition identitygridindexsets.hh:237
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,113 +1,620 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridleafiterator.hh\n+identitygridentity.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRIDLEAFITERATOR_HH\n-6#define DUNE_IDENTITYGRIDLEAFITERATOR_HH\n+5#ifndef DUNE_IDENTITYGRIDENTITY_HH\n+6#define DUNE_IDENTITYGRIDENTITY_HH\n 7\n-8#include \n-9\n+12#include \n+13\n 14namespace Dune {\n 15\n 16\n-20 template\n-21 class IdentityGridLeafIterator\n-22 {\n-23 private:\n+17 // Forward declarations\n+18\n+19 template\n+20 class IdentityGridEntity;\n+21\n+22 template\n+23 class IdentityGridLevelIterator;\n 24\n-25 // LevelIterator to the equivalent entity in the host grid\n-26 typedef typename GridImp::HostGridType::template Codim::template\n-Partition::LeafIterator HostGridLeafIterator;\n+25 template\n+26 class IdentityGridLevelIntersectionIterator;\n 27\n-28 public:\n-29\n-30 constexpr static int codimension = codim;\n-31\n-32 typedef typename GridImp::template Codim::Entity Entity;\n+28 template\n+29 class IdentityGridLeafIntersectionIterator;\n+30\n+31 template\n+32 class IdentityGridHierarchicIterator;\n 33\n-35 explicit IdentityGridLeafIterator(const GridImp* identityGrid) :\n-36 identityGrid_(identityGrid),\n-37 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template\n-begin())\n-38 {}\n+34\n+35 // External forward declarations\n+36 template< class Grid >\n+37 struct HostGridAccess;\n+38\n 39\n-44 explicit IdentityGridLeafIterator(const GridImp* identityGrid, [[maybe_\n-unused]] bool endDummy) :\n-45 identityGrid_(identityGrid),\n-46 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template\n-end())\n-47 {}\n-48\n-49\n-51 void increment() {\n-52 ++hostLeafIterator_;\n-53 }\n-54\n-56 Entity dereference() const {\n-57 return Entity{{identityGrid_,*hostLeafIterator_}};\n-58 }\n+40 //**********************************************************************\n+41 //\n+42 // --IdentityGridEntity\n+43 // --Entity\n+44 //\n+52 template\n+53 class IdentityGridEntity :\n+54 public EntityDefaultImplementation \n+55 {\n+56\n+57 template \n+58 friend class IdentityGridLevelIndexSet;\n 59\n-61 bool equals(const IdentityGridLeafIterator& i) const {\n-62 return hostLeafIterator_ == i.hostLeafIterator_;\n-63 }\n-64\n-65 private:\n-66 const GridImp* identityGrid_;\n-67\n-68 HostGridLeafIterator hostLeafIterator_;\n-69\n-70 };\n+60 template \n+61 friend class IdentityGridLeafIndexSet;\n+62\n+63 template \n+64 friend class IdentityGridLocalIdSet;\n+65\n+66 template \n+67 friend class IdentityGridGlobalIdSet;\n+68\n+69 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;\n+70\n 71\n-72\n-73} // namespace Dune\n-74\n-75#endif\n-gridenums.hh\n-Dune::leafGridView\n-Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid<\n-dim, dimworld, ct, GridFamily > &grid)\n-leaf grid view for the given grid\n-Definition common/grid.hh:805\n+72 private:\n+73\n+74 typedef typename GridImp::ctype ctype;\n+75\n+76 // The codimension of this entity wrt the host grid\n+77 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension -\n+GridImp::dimension + codim;\n+78\n+79 // equivalent entity in the host grid\n+80 typedef typename GridImp::HostGridType::Traits::template\n+Codim::Entity HostGridEntity;\n+81\n+82\n+83 public:\n+84\n+85 typedef typename GridImp::template Codim::Geometry Geometry;\n+86\n+88 typedef typename GridImp::template Codim::EntitySeed EntitySeed;\n+89\n+90 IdentityGridEntity()\n+91 : identityGrid_(nullptr)\n+92 {}\n+93\n+94 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity&\n+hostEntity)\n+95 : hostEntity_(hostEntity)\n+96 , identityGrid_(identityGrid)\n+97 {}\n+98\n+99 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&& hostEntity)\n+100 : hostEntity_(std::move(hostEntity))\n+101 , identityGrid_(identityGrid)\n+102 {}\n+103\n+105 IdentityGridEntity(const IdentityGridEntity& original)\n+106 : hostEntity_(original.hostEntity_)\n+107 , identityGrid_(original.identityGrid_)\n+108 {}\n+109\n+110 IdentityGridEntity(IdentityGridEntity&& original)\n+111 : hostEntity_(std::move(original.hostEntity_))\n+112 , identityGrid_(original.identityGrid_)\n+113 {}\n+114\n+116 IdentityGridEntity& operator=(const IdentityGridEntity& original)\n+117 {\n+118 if (this != &original)\n+119 {\n+120 identityGrid_ = original.identityGrid_;\n+121 hostEntity_ = original.hostEntity_;\n+122 }\n+123 return *this;\n+124 }\n+125\n+127 IdentityGridEntity& operator=(IdentityGridEntity&& original)\n+128 {\n+129 if (this != &original)\n+130 {\n+131 identityGrid_ = original.identityGrid_;\n+132 hostEntity_ = std::move(original.hostEntity_);\n+133 }\n+134 return *this;\n+135 }\n+136\n+137 bool equals(const IdentityGridEntity& other) const\n+138 {\n+139 return hostEntity_ == other.hostEntity_;\n+140 }\n+141\n+143 bool hasFather () const {\n+144 return hostEntity_.hasFather();\n+145 }\n+146\n+148 EntitySeed seed () const\n+149 {\n+150 return EntitySeed(hostEntity_);\n+151 }\n+152\n+154 int level () const {\n+155 return hostEntity_.level();\n+156 }\n+157\n+158\n+161 PartitionType partitionType () const {\n+162 return hostEntity_.partitionType();\n+163 }\n+164\n+167 unsigned int subEntities (unsigned int cc) const\n+168 {\n+169 return hostEntity_.subEntities(cc);\n+170 }\n+171\n+173 Geometry geometry () const\n+174 {\n+175 return Geometry( hostEntity_.geometry() );\n+176 }\n+177\n+178\n+179 HostGridEntity hostEntity_;\n+180\n+181 private:\n+182\n+183 const GridImp* identityGrid_;\n+184\n+185 };\n+186\n+187\n+188\n+189\n+190 //***********************\n+191 //\n+192 // --IdentityGridEntity\n+193 //\n+194 //***********************\n+202 template\n+203 class IdentityGridEntity<0,dim,GridImp> :\n+204 public EntityDefaultImplementation<0,dim,GridImp, IdentityGridEntity>\n+205 {\n+206 friend struct HostGridAccess< typename std::remove_const< GridImp >::type\n+>;\n+207\n+208 public:\n+209\n+210 // The codimension of this entitypointer wrt the host grid\n+211 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension -\n+GridImp::dimension;\n+212\n+213 // equivalent entity in the host grid\n+214 typedef typename GridImp::HostGridType::Traits::template\n+Codim::Entity HostGridEntity;\n+215\n+216 typedef typename GridImp::template Codim<0>::Geometry Geometry;\n+217\n+218 typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;\n+219\n+221 typedef IdentityGridLevelIntersectionIterator\n+LevelIntersectionIterator;\n+222\n+224 typedef IdentityGridLeafIntersectionIterator\n+LeafIntersectionIterator;\n+225\n+227 typedef IdentityGridHierarchicIterator HierarchicIterator;\n+228\n+230 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;\n+231\n+232\n+233\n+234 IdentityGridEntity()\n+235 : identityGrid_(nullptr)\n+236 {}\n+237\n+238 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity&\n+hostEntity)\n+239 : hostEntity_(hostEntity)\n+240 , identityGrid_(identityGrid)\n+241 {}\n+242\n+243 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&&\n+hostEntity)\n+244 : hostEntity_(std::move(hostEntity))\n+245 , identityGrid_(identityGrid)\n+246 {}\n+247\n+249 IdentityGridEntity(const IdentityGridEntity& original)\n+250 : hostEntity_(original.hostEntity_)\n+251 , identityGrid_(original.identityGrid_)\n+252 {}\n+253\n+254 IdentityGridEntity(IdentityGridEntity&& original)\n+255 : hostEntity_(std::move(original.hostEntity_))\n+256 , identityGrid_(original.identityGrid_)\n+257 {}\n+258\n+260 IdentityGridEntity& operator=(const IdentityGridEntity& original)\n+261 {\n+262 if (this != &original)\n+263 {\n+264 identityGrid_ = original.identityGrid_;\n+265 hostEntity_ = original.hostEntity_;\n+266 }\n+267 return *this;\n+268 }\n+269\n+271 IdentityGridEntity& operator=(IdentityGridEntity&& original)\n+272 {\n+273 if (this != &original)\n+274 {\n+275 identityGrid_ = original.identityGrid_;\n+276 hostEntity_ = std::move(original.hostEntity_);\n+277 }\n+278 return *this;\n+279 }\n+280\n+281 bool equals(const IdentityGridEntity& other) const\n+282 {\n+283 return hostEntity_ == other.hostEntity_;\n+284 }\n+285\n+287 bool hasFather () const {\n+288 return hostEntity_.hasFather();\n+289 }\n+290\n+292 EntitySeed seed () const\n+293 {\n+294 return EntitySeed(hostEntity_);\n+295 }\n+296\n+298 int level () const\n+299 {\n+300 return hostEntity_.level();\n+301 }\n+302\n+303\n+305 PartitionType partitionType () const {\n+306 return hostEntity_.partitionType();\n+307 }\n+308\n+309\n+311 Geometry geometry () const\n+312 {\n+313 return Geometry( hostEntity_.geometry() );\n+314 }\n+315\n+316\n+319 unsigned int subEntities (unsigned int codim) const\n+320 {\n+321 return hostEntity_.subEntities(codim);\n+322 }\n+323\n+324\n+328 template\n+329 typename GridImp::template Codim::Entity subEntity (int i) const {\n+330 return IdentityGridEntity(identityGrid_,\n+hostEntity_.template subEntity(i));\n+331 }\n+332\n+333\n+335 IdentityGridLevelIntersectionIterator ilevelbegin () const {\n+336 return IdentityGridLevelIntersectionIterator(\n+337 identityGrid_,\n+338 identityGrid_->getHostGrid().levelGridView(level()).ibegin(hostEntity_));\n+339 }\n+340\n+341\n+343 IdentityGridLevelIntersectionIterator ilevelend () const {\n+344 return IdentityGridLevelIntersectionIterator(\n+345 identityGrid_,\n+346 identityGrid_->getHostGrid().levelGridView(level()).iend(hostEntity_));\n+347 }\n+348\n+349\n+351 IdentityGridLeafIntersectionIterator ileafbegin () const {\n+352 return IdentityGridLeafIntersectionIterator(\n+353 identityGrid_,\n+354 identityGrid_->getHostGrid().leafGridView().ibegin(hostEntity_));\n+355 }\n+356\n+357\n+359 IdentityGridLeafIntersectionIterator ileafend () const {\n+360 return IdentityGridLeafIntersectionIterator(\n+361 identityGrid_,\n+362 identityGrid_->getHostGrid().leafGridView().iend(hostEntity_));\n+363 }\n+364\n+365\n+367 bool isLeaf() const {\n+368 return hostEntity_.isLeaf();\n+369 }\n+370\n+371\n+374 typename GridImp::template Codim<0>::Entity father () const {\n+375 return IdentityGridEntity(identityGrid_, hostEntity_.father());\n+376 }\n+377\n+378\n+388 LocalGeometry geometryInFather () const\n+389 {\n+390 return LocalGeometry( hostEntity_.geometryInFather() );\n+391 }\n+392\n+393\n+398 IdentityGridHierarchicIterator hbegin (int maxLevel) const\n+399 {\n+400 return IdentityGridHierarchicIterator(identityGrid_, *this,\n+maxLevel);\n+401 }\n+402\n+403\n+405 IdentityGridHierarchicIterator hend (int maxLevel) const\n+406 {\n+407 return IdentityGridHierarchicIterator(identityGrid_, *this,\n+maxLevel, true);\n+408 }\n+409\n+410\n+412 bool wasRefined () const\n+413 {\n+414 if (identityGrid_->adaptationStep!=GridImp::adaptDone)\n+415 return false;\n+416\n+417 int level = this->level();\n+418 int index = identityGrid_->levelIndexSet(level).index(*this);\n+419 return identityGrid_->refinementMark_[level][index];\n+420 }\n+421\n+422\n+424 bool mightBeCoarsened () const\n+425 {\n+426 return true;\n+427 }\n+428\n+429\n+430 // /////////////////////////////////////////\n+431 // Internal stuff\n+432 // /////////////////////////////////////////\n+433\n+434\n+435 HostGridEntity hostEntity_;\n+436 const GridImp* identityGrid_;\n+437\n+438 private:\n+439\n+440 typedef typename GridImp::ctype ctype;\n+441\n+442 }; // end of IdentityGridEntity codim = 0\n+443\n+444\n+445} // namespace Dune\n+446\n+447\n+448#endif\n+Dune::PartitionType\n+PartitionType\n+Attributes used in the generic overlap model.\n+Definition gridenums.hh:30\n+std\n+STL namespace.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IdentityGridLeafIterator\n-Iterator over all entities of a given codimension and level of a grid.\n-Definition identitygridleafiterator.hh:22\n-Dune::IdentityGridLeafIterator::dereference\n-Entity dereference() const\n-dereferencing\n-Definition identitygridleafiterator.hh:56\n-Dune::IdentityGridLeafIterator::equals\n-bool equals(const IdentityGridLeafIterator &i) const\n-equality\n-Definition identitygridleafiterator.hh:61\n-Dune::IdentityGridLeafIterator::IdentityGridLeafIterator\n-IdentityGridLeafIterator(const GridImp *identityGrid, bool endDummy)\n-Constructor which create the end iterator.\n-Definition identitygridleafiterator.hh:44\n-Dune::IdentityGridLeafIterator::codimension\n-static constexpr int codimension\n-Definition identitygridleafiterator.hh:30\n-Dune::IdentityGridLeafIterator::Entity\n-GridImp::template Codim< codim >::Entity Entity\n-Definition identitygridleafiterator.hh:32\n-Dune::IdentityGridLeafIterator::IdentityGridLeafIterator\n-IdentityGridLeafIterator(const GridImp *identityGrid)\n-Definition identitygridleafiterator.hh:35\n-Dune::IdentityGridLeafIterator::increment\n-void increment()\n-prefix increment\n-Definition identitygridleafiterator.hh:51\n+Dune::EntityDefaultImplementation\n+Default Implementations for EntityImp.\n+Definition common/entity.hh:542\n+Dune::EntityDefaultImplementation<_codim,_dim,_GridImp,_IdentityGridEntity_>::\n+type\n+GeometryType type() const\n+Return the name of the reference element. The type can be used to access the\n+Dune::ReferenceElement.\n+Definition common/entity.hh:576\n+Dune::HostGridAccess\n+provides access to host grid objects from GeometryGrid\n+Definition identitygrid.hh:37\n+Dune::IdentityGridEntity\n+The implementation of entities in a IdentityGrid.\n+Definition identitygridentity.hh:55\n+Dune::IdentityGridEntity::IdentityGridEntity\n+IdentityGridEntity()\n+Definition identitygridentity.hh:90\n+Dune::IdentityGridEntity::operator=\n+IdentityGridEntity & operator=(IdentityGridEntity &&original)\n+Definition identitygridentity.hh:127\n+Dune::IdentityGridEntity::IdentityGridEntity\n+IdentityGridEntity(IdentityGridEntity &&original)\n+Definition identitygridentity.hh:110\n+Dune::IdentityGridEntity::equals\n+bool equals(const IdentityGridEntity &other) const\n+Definition identitygridentity.hh:137\n+Dune::IdentityGridEntity::hostEntity_\n+HostGridEntity hostEntity_\n+Definition identitygridentity.hh:179\n+Dune::IdentityGridEntity::EntitySeed\n+GridImp::template Codim< codim >::EntitySeed EntitySeed\n+The type of the EntitySeed interface class.\n+Definition identitygridentity.hh:88\n+Dune::IdentityGridEntity::seed\n+EntitySeed seed() const\n+Create EntitySeed.\n+Definition identitygridentity.hh:148\n+Dune::IdentityGridEntity::IdentityGridEntity\n+IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity\n+&hostEntity)\n+Definition identitygridentity.hh:94\n+Dune::IdentityGridEntity::geometry\n+Geometry geometry() const\n+geometry of this entity\n+Definition identitygridentity.hh:173\n+Dune::IdentityGridEntity::partitionType\n+PartitionType partitionType() const\n+The partition type for parallel computing.\n+Definition identitygridentity.hh:161\n+Dune::IdentityGridEntity::subEntities\n+unsigned int subEntities(unsigned int cc) const\n+Return the number of subEntities of codimension codim.\n+Definition identitygridentity.hh:167\n+Dune::IdentityGridEntity::IdentityGridEntity\n+IdentityGridEntity(const IdentityGridEntity &original)\n+Definition identitygridentity.hh:105\n+Dune::IdentityGridEntity::IdentityGridEntity\n+IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)\n+Definition identitygridentity.hh:99\n+Dune::IdentityGridEntity::hasFather\n+bool hasFather() const\n+returns true if father entity exists\n+Definition identitygridentity.hh:143\n+Dune::IdentityGridEntity::Geometry\n+GridImp::template Codim< codim >::Geometry Geometry\n+Definition identitygridentity.hh:85\n+Dune::IdentityGridEntity::operator=\n+IdentityGridEntity & operator=(const IdentityGridEntity &original)\n+Definition identitygridentity.hh:116\n+Dune::IdentityGridEntity::level\n+int level() const\n+level of this element\n+Definition identitygridentity.hh:154\n+Dune::IdentityGridLevelIntersectionIterator\n+Definition identitygridintersectioniterator.hh:84\n+Dune::IdentityGridLeafIntersectionIterator\n+Iterator over all element neighborsMesh entities of codimension 0 (\"elements\")\n+allow to visit all nei...\n+Definition identitygridintersectioniterator.hh:29\n+Dune::IdentityGridHierarchicIterator\n+Iterator over the descendants of an entity.Mesh entities of codimension 0\n+(\"elements\") allow to visit...\n+Definition identitygridhierarchiciterator.hh:26\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::subEntities\n+unsigned int subEntities(unsigned int codim) const\n+Return the number of subEntities of codimension codim.\n+Definition identitygridentity.hh:319\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n+IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)\n+Definition identitygridentity.hh:243\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::isLeaf\n+bool isLeaf() const\n+returns true if Entity has NO children\n+Definition identitygridentity.hh:367\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hbegin\n+IdentityGridHierarchicIterator< GridImp > hbegin(int maxLevel) const\n+Inter-level access to son elements on higher levels<=maxlevel. This is provided\n+for sparsely stored n...\n+Definition identitygridentity.hh:398\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::LocalGeometry\n+GridImp::template Codim< 0 >::LocalGeometry LocalGeometry\n+Definition identitygridentity.hh:218\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::EntitySeed\n+GridImp::template Codim< 0 >::EntitySeed EntitySeed\n+The type of the EntitySeed interface class.\n+Definition identitygridentity.hh:230\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::seed\n+EntitySeed seed() const\n+Create EntitySeed.\n+Definition identitygridentity.hh:292\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ilevelbegin\n+IdentityGridLevelIntersectionIterator< GridImp > ilevelbegin() const\n+First level intersection.\n+Definition identitygridentity.hh:335\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n+IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity\n+&hostEntity)\n+Definition identitygridentity.hh:238\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::level\n+int level() const\n+Level of this element.\n+Definition identitygridentity.hh:298\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ileafbegin\n+IdentityGridLeafIntersectionIterator< GridImp > ileafbegin() const\n+First leaf intersection.\n+Definition identitygridentity.hh:351\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hostEntity_\n+HostGridEntity hostEntity_\n+Definition identitygridentity.hh:435\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::operator=\n+IdentityGridEntity & operator=(const IdentityGridEntity &original)\n+Definition identitygridentity.hh:260\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::geometry\n+Geometry geometry() const\n+Geometry of this entity.\n+Definition identitygridentity.hh:311\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ilevelend\n+IdentityGridLevelIntersectionIterator< GridImp > ilevelend() const\n+Reference to one past the last neighbor.\n+Definition identitygridentity.hh:343\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n+IdentityGridEntity(const IdentityGridEntity &original)\n+Definition identitygridentity.hh:249\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hend\n+IdentityGridHierarchicIterator< GridImp > hend(int maxLevel) const\n+Returns iterator to one past the last son.\n+Definition identitygridentity.hh:405\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ileafend\n+IdentityGridLeafIntersectionIterator< GridImp > ileafend() const\n+Reference to one past the last leaf intersection.\n+Definition identitygridentity.hh:359\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::wasRefined\n+bool wasRefined() const\n+Definition identitygridentity.hh:412\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::operator=\n+IdentityGridEntity & operator=(IdentityGridEntity &&original)\n+Definition identitygridentity.hh:271\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hasFather\n+bool hasFather() const\n+returns true if father entity exists\n+Definition identitygridentity.hh:287\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::HostGridEntity\n+GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Entity\n+HostGridEntity\n+Definition identitygridentity.hh:214\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::father\n+GridImp::template Codim< 0 >::Entity father() const\n+Definition identitygridentity.hh:374\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::mightBeCoarsened\n+bool mightBeCoarsened() const\n+Definition identitygridentity.hh:424\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::geometryInFather\n+LocalGeometry geometryInFather() const\n+Location of this element relative to the reference element element of the\n+father. This is sufficient ...\n+Definition identitygridentity.hh:388\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::identityGrid_\n+const GridImp * identityGrid_\n+Definition identitygridentity.hh:436\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::subEntity\n+GridImp::template Codim< cc >::Entity subEntity(int i) const\n+Provide access to sub entity i of given codimension. Entities are numbered 0\n+... subEntities(cc)-1.\n+Definition identitygridentity.hh:329\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n+IdentityGridEntity(IdentityGridEntity &&original)\n+Definition identitygridentity.hh:254\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::Geometry\n+GridImp::template Codim< 0 >::Geometry Geometry\n+Definition identitygridentity.hh:216\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::equals\n+bool equals(const IdentityGridEntity &other) const\n+Definition identitygridentity.hh:281\n+Dune::IdentityGridEntity<_0,_dim,_GridImp_>::partitionType\n+PartitionType partitionType() const\n+The partition type for parallel computing.\n+Definition identitygridentity.hh:305\n+Dune::IdentityGridLevelIndexSet\n+Definition identitygridindexsets.hh:26\n+Dune::IdentityGridLeafIndexSet\n+Definition identitygridindexsets.hh:96\n+Dune::IdentityGridGlobalIdSet\n+Definition identitygridindexsets.hh:185\n+Dune::IdentityGridLocalIdSet\n+Definition identitygridindexsets.hh:237\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00737.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00737.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridintersections.hh File Reference\n+dune-grid: identitygridhierarchiciterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,41 +72,37 @@\n
  • dune
  • grid
  • identitygrid
  • \n \n \n
    \n \n-
    identitygridintersections.hh File Reference
    \n+
    identitygridhierarchiciterator.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes. \n+

    The IdentityGridHierarchicIterator class. \n More...

    \n-\n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdentityGridLeafIntersection< GridImp >
     An intersection with a leaf neighbor elementMesh entities of codimension 0 (\"elements\") allow to visit all neighbors, where a neighbor is an entity of codimension 0 which has a common entity of codimension 1 These neighbors are accessed via a IntersectionIterator. This allows the implement non-matching meshes. The number of neighbors may be different from the number of an element! More...
     
    class  Dune::IdentityGridLevelIntersection< GridImp >
    class  Dune::IdentityGridHierarchicIterator< GridImp >
     Iterator over the descendants of an entity.Mesh entities of codimension 0 (\"elements\") allow to visit all entities of codimension 0 obtained through nested, hierarchic refinement of the entity. Iteration over this set of entities is provided by the HierarchicIterator, starting from a given entity. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.

    \n+

    The IdentityGridHierarchicIterator class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,32 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridintersections.hh File Reference\n-The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.\n-More...\n-#include \"identitygridleafiterator.hh\"\n-#include \n+identitygridhierarchiciterator.hh File Reference\n+The IdentityGridHierarchicIterator class. More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridLeafIntersection<_GridImp_>\n- An intersection with a leaf neighbor elementMesh entities of\n- codimension 0 (\"elements\") allow to visit all neighbors, where a\n-\u00a0 neighbor is an entity of codimension 0 which has a common entity of\n- codimension 1 These neighbors are accessed via a IntersectionIterator.\n- This allows the implement non-matching meshes. The number of neighbors\n- may be different from the number of an element! More...\n-\u00a0\n-class \u00a0 Dune::IdentityGridLevelIntersection<_GridImp_>\n+class \u00a0 Dune::IdentityGridHierarchicIterator<_GridImp_>\n+ Iterator over the descendants of an entity.Mesh entities of codimension\n+ 0 (\"elements\") allow to visit all entities of codimension 0 obtained\n+\u00a0 through nested, hierarchic refinement of the entity. Iteration over\n+ this set of entities is provided by the HierarchicIterator, starting\n+ from a given entity. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.\n+The IdentityGridHierarchicIterator class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00737_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00737_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridintersections.hh Source File\n+dune-grid: identitygridhierarchiciterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,435 +74,99 @@\n \n \n
    \n
    \n-
    identitygridintersections.hh
    \n+
    identitygridhierarchiciterator.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRID_INTERSECTIONS_HH
    \n-
    6#define DUNE_IDENTITYGRID_INTERSECTIONS_HH
    \n+
    5#ifndef DUNE_IDENTITYGRIDHIERITERATOR_HH
    \n+
    6#define DUNE_IDENTITYGRIDHIERITERATOR_HH
    \n
    7
    \n-\n-\n-
    10
    \n-
    15namespace Dune {
    \n-
    16
    \n-
    17
    \n-
    18 // External forward declarations
    \n-
    19 template< class Grid >
    \n-
    20 struct HostGridAccess;
    \n-
    21
    \n-
    22
    \n-
    31 template<class GridImp>
    \n-
    \n-\n-
    33 {
    \n+
    12namespace Dune {
    \n+
    13
    \n+
    14
    \n+
    15 //**********************************************************************
    \n+
    16 //
    \n+
    24 template<class GridImp>
    \n+
    \n+\n+
    26 {
    \n+
    27
    \n+
    28 // Type of the corresponding HierarchicIterator in the host grid
    \n+
    29 typedef typename GridImp::HostGridType::template Codim<0>::Entity::HierarchicIterator HostGridHierarchicIterator;
    \n+
    30
    \n+
    31 public:
    \n+
    32
    \n+
    33 constexpr static int codimension = 0;
    \n
    34
    \n-
    35 friend class IdentityGridLeafIntersectionIterator<GridImp>;
    \n+
    35 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n
    36
    \n-
    37 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n-
    38
    \n-
    39 constexpr static int dim = GridImp::dimension;
    \n-
    40
    \n-
    41 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    \n+
    38 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const Entity& startEntity, int maxLevel) :
    \n+
    39 identityGrid_(identityGrid),
    \n+
    40 hostHierarchicIterator_(startEntity.impl().hostEntity_.hbegin(maxLevel))
    \n+
    41 {}
    \n+
    \n
    42
    \n-
    43 // The type used to store coordinates
    \n-
    44 typedef typename GridImp::ctype ctype;
    \n-
    45
    \n-
    46 typedef typename GridImp::HostGridType::LeafGridView::Intersection HostLeafIntersection;
    \n-
    47
    \n-
    48 public:
    \n+
    43
    \n+
    \n+
    45 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const Entity& startEntity, int maxLevel, [[maybe_unused]] bool endDummy) :
    \n+
    46 identityGrid_(identityGrid),
    \n+
    47 hostHierarchicIterator_(startEntity.impl().hostEntity_.hend(maxLevel))
    \n+
    48 {}
    \n+
    \n
    49
    \n-
    50 typedef typename GridImp::template Codim<1>::Geometry Geometry;
    \n-
    51 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
    \n-
    52 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    53 typedef FieldVector<ctype, dimworld> NormalVector;
    \n-
    54
    \n-
    \n-\n-
    56 {}
    \n+
    50
    \n+
    \n+
    52 void increment()
    \n+
    53 {
    \n+
    54 ++hostHierarchicIterator_;
    \n+
    55 }
    \n
    \n-
    57
    \n+
    56
    \n
    \n-
    58 IdentityGridLeafIntersection(const GridImp* identityGrid,
    \n-
    59 const HostLeafIntersection& hostIntersection)
    \n-
    60 : identityGrid_(identityGrid)
    \n-
    61 , hostIntersection_(hostIntersection)
    \n-
    62 {}
    \n-
    \n-
    63
    \n-
    \n-
    64 IdentityGridLeafIntersection(const GridImp* identityGrid,
    \n-
    65 HostLeafIntersection&& hostIntersection)
    \n-
    66 : identityGrid_(identityGrid)
    \n-
    67 , hostIntersection_(std::move(hostIntersection))
    \n-
    68 {}
    \n-
    \n+\n+
    59 return Entity{{identityGrid_,*hostHierarchicIterator_}};
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    \n+\n+
    64 return hostHierarchicIterator_ == i.hostHierarchicIterator_;
    \n+
    65 }
    \n+
    \n+
    66
    \n+
    67 private:
    \n+
    68 const GridImp* identityGrid_;
    \n
    69
    \n-
    \n-
    70 bool equals(const IdentityGridLeafIntersection& other) const
    \n-
    71 {
    \n-
    72 return hostIntersection_ == other.hostIntersection_;
    \n-
    73 }
    \n+
    70 HostGridHierarchicIterator hostHierarchicIterator_;
    \n+
    71
    \n+
    72 };
    \n
    \n+
    73
    \n
    74
    \n-
    \n-
    77 Entity inside() const {
    \n-
    78 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
    \n-
    79 }
    \n-
    \n-
    80
    \n-
    81
    \n-
    \n-
    84 Entity outside() const {
    \n-
    85 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
    \n-
    86 }
    \n-
    \n-
    87
    \n-
    88
    \n-
    \n-
    90 bool boundary () const {
    \n-
    91 return hostIntersection_.boundary();
    \n-
    92 }
    \n-
    \n-
    93
    \n-
    \n-\n-
    100 return hostIntersection_.centerUnitOuterNormal();
    \n-
    101 }
    \n-
    \n-
    102
    \n-
    \n-
    104 bool neighbor () const {
    \n-
    105 return hostIntersection_.neighbor();
    \n-
    106 }
    \n-
    \n-
    107
    \n-
    \n-
    109 size_t boundarySegmentIndex() const {
    \n-
    110 return hostIntersection_.boundarySegmentIndex();
    \n-
    111 }
    \n-
    \n-
    112
    \n-
    \n-
    114 bool conforming () const {
    \n-
    115 return hostIntersection_.conforming();
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    \n-
    119 GeometryType type () const {
    \n-
    120 return hostIntersection_.type();
    \n-
    121 }
    \n-
    \n-
    122
    \n-
    123
    \n-
    \n-\n-
    129 {
    \n-
    130 return LocalGeometry( hostIntersection_.geometryInInside() );
    \n-
    131 }
    \n-
    \n-
    132
    \n-
    \n-\n-
    136 {
    \n-
    137 return LocalGeometry( hostIntersection_.geometryInOutside() );
    \n-
    138 }
    \n-
    \n-
    139
    \n-
    \n-\n-
    143 {
    \n-
    144 return Geometry( hostIntersection_.geometry() );
    \n-
    145 }
    \n-
    \n-
    146
    \n-
    147
    \n-
    \n-
    149 int indexInInside () const {
    \n-
    150 return hostIntersection_.indexInInside();
    \n-
    151 }
    \n-
    \n-
    152
    \n-
    153
    \n-
    \n-
    155 int indexInOutside () const {
    \n-
    156 return hostIntersection_.indexInOutside();
    \n-
    157 }
    \n-
    \n-
    158
    \n-
    159
    \n-
    \n-
    161 FieldVector<ctype, GridImp::dimensionworld> outerNormal (const FieldVector<ctype, GridImp::dimension-1>& local) const {
    \n-
    162 return hostIntersection_.outerNormal(local);
    \n-
    163 }
    \n-
    \n-
    164
    \n-
    \n-
    166 FieldVector<ctype, GridImp::dimensionworld> integrationOuterNormal (const FieldVector<ctype, GridImp::dimension-1>& local) const {
    \n-
    167 return hostIntersection_.integrationOuterNormal(local);
    \n-
    168 }
    \n-
    \n-
    169
    \n-
    \n-
    171 FieldVector<ctype, GridImp::dimensionworld> unitOuterNormal (const FieldVector<ctype, GridImp::dimension-1>& local) const {
    \n-
    172 return hostIntersection_.unitOuterNormal(local);
    \n-
    173 }
    \n-
    \n-
    174
    \n-
    175
    \n-
    176 private:
    \n-
    177 //**********************************************************
    \n-
    178 // private methods
    \n-
    179 //**********************************************************
    \n-
    180
    \n-
    181 const GridImp* identityGrid_;
    \n-
    182
    \n-
    183 HostLeafIntersection hostIntersection_;
    \n-
    184 };
    \n-
    \n-
    185
    \n-
    186
    \n-
    187
    \n-
    188
    \n-
    190 template<class GridImp>
    \n-
    \n-\n-
    192 {
    \n-
    193
    \n-
    194 friend class IdentityGridLevelIntersectionIterator<GridImp>;
    \n-
    195
    \n-
    196 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n-
    197
    \n-
    198 constexpr static int dim = GridImp::dimension;
    \n-
    199
    \n-
    200 constexpr static int dimworld = GridImp::dimensionworld;
    \n-
    201
    \n-
    202 // The type used to store coordinates
    \n-
    203 typedef typename GridImp::ctype ctype;
    \n-
    204
    \n-
    205 typedef typename GridImp::HostGridType::LevelGridView::Intersection HostLevelIntersection;
    \n-
    206
    \n-
    207 public:
    \n-
    208
    \n-
    209 typedef typename GridImp::template Codim<1>::Geometry Geometry;
    \n-
    210 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
    \n-
    211 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    212 typedef FieldVector<ctype, dimworld> NormalVector;
    \n-
    213
    \n-\n-
    216
    \n-
    \n-
    217 IdentityGridLevelIntersection(const GridImp* identityGrid,
    \n-
    218 const HostLevelIntersection& hostIntersection)
    \n-
    219 : identityGrid_(identityGrid)
    \n-
    220 , hostIntersection_(hostIntersection)
    \n-
    221 {}
    \n-
    \n-
    222
    \n-
    \n-
    223 IdentityGridLevelIntersection(const GridImp* identityGrid,
    \n-
    224 HostLevelIntersection&& hostIntersection)
    \n-
    225 : identityGrid_(identityGrid)
    \n-
    226 , hostIntersection_(std::move(hostIntersection))
    \n-
    227 {}
    \n-
    \n-
    228
    \n-
    \n-
    229 bool equals(const IdentityGridLevelIntersection& other) const
    \n-
    230 {
    \n-
    231 return hostIntersection_ == other.hostIntersection_;
    \n-
    232 }
    \n-
    \n-
    233
    \n-
    \n-
    236 Entity inside() const {
    \n-
    237 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
    \n-
    238 }
    \n-
    \n-
    239
    \n-
    240
    \n-
    \n-
    243 Entity outside() const {
    \n-
    244 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
    \n-
    245 }
    \n-
    \n-
    246
    \n-
    247
    \n-
    \n-
    250 bool boundary () const {
    \n-
    251 return hostIntersection_.boundary();
    \n-
    252 }
    \n-
    \n-
    253
    \n-
    \n-\n-
    260 return hostIntersection_.centerUnitOuterNormal();
    \n-
    261 }
    \n-
    \n-
    262
    \n-
    \n-
    264 bool neighbor () const {
    \n-
    265 return hostIntersection_.neighbor();
    \n-
    266 }
    \n-
    \n-
    267
    \n-
    \n-
    269 size_t boundarySegmentIndex() const {
    \n-
    270 return hostIntersection_.boundarySegmentIndex();
    \n-
    271 }
    \n-
    \n-
    272
    \n-
    \n-
    274 bool conforming () const {
    \n-
    275 return hostIntersection_.conforming();
    \n-
    276 }
    \n-
    \n-
    277
    \n-
    \n-
    279 GeometryType type () const {
    \n-
    280 return hostIntersection_.type();
    \n-
    281 }
    \n-
    \n-
    282
    \n-
    283
    \n-
    \n-\n-
    289 {
    \n-
    290 return LocalGeometry( hostIntersection_.geometryInInside() );
    \n-
    291 }
    \n-
    \n-
    292
    \n-
    \n-\n-
    296 {
    \n-
    297 return LocalGeometry( hostIntersection_.geometryInOutside() );
    \n-
    298 }
    \n-
    \n-
    299
    \n-
    \n-\n-
    303 {
    \n-
    304 return Geometry( hostIntersection_.geometry() );
    \n-
    305 }
    \n-
    \n-
    306
    \n-
    307
    \n-
    \n-
    309 int indexInInside () const {
    \n-
    310 return hostIntersection_.indexInInside();
    \n-
    311 }
    \n-
    \n-
    312
    \n-
    313
    \n-
    \n-
    315 int indexInOutside () const {
    \n-
    316 return hostIntersection_.indexInOutside();
    \n-
    317 }
    \n-
    \n-
    318
    \n-
    319
    \n-
    \n-
    321 FieldVector<ctype, dimworld> outerNormal (const FieldVector<ctype, dim-1>& local) const {
    \n-
    322 return hostIntersection_.outerNormal(local);
    \n-
    323 }
    \n-
    \n-
    324
    \n-
    \n-
    326 FieldVector<ctype, dimworld> integrationOuterNormal (const FieldVector<ctype, dim-1>& local) const {
    \n-
    327 return hostIntersection_.integrationOuterNormal(local);
    \n-
    328 }
    \n-
    \n-
    329
    \n-
    \n-
    331 FieldVector<ctype, dimworld> unitOuterNormal (const FieldVector<ctype, dim-1>& local) const {
    \n-
    332 return hostIntersection_.unitOuterNormal(local);
    \n-
    333 }
    \n-
    \n-
    334
    \n-
    335 private:
    \n-
    336
    \n-
    337 const GridImp* identityGrid_;
    \n-
    338
    \n-
    339 HostLevelIntersection hostIntersection_;
    \n-
    340
    \n-
    341 };
    \n-
    \n-
    342
    \n-
    343
    \n-
    344} // namespace Dune
    \n-
    345
    \n-
    346#endif
    \n-
    The IdentityGridLeafIterator class.
    \n-
    The IdentityGridEntity class.
    \n-
    STL namespace.
    \n+
    75} // end namespace Dune
    \n+
    76
    \n+
    77#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n-
    The implementation of entities in a IdentityGrid.
    Definition identitygridentity.hh:55
    \n-
    Definition identitygridintersectioniterator.hh:84
    \n-
    Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
    Definition identitygridintersectioniterator.hh:29
    \n-
    An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
    Definition identitygridintersections.hh:33
    \n-
    Entity inside() const
    Definition identitygridintersections.hh:77
    \n-
    IdentityGridLeafIntersection(const GridImp *identityGrid, HostLeafIntersection &&hostIntersection)
    Definition identitygridintersections.hh:64
    \n-
    NormalVector centerUnitOuterNormal() const
    Return unit outer normal (length == 1)
    Definition identitygridintersections.hh:99
    \n-
    GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
    Definition identitygridintersections.hh:51
    \n-
    Geometry geometry() const
    Definition identitygridintersections.hh:142
    \n-
    Entity outside() const
    Definition identitygridintersections.hh:84
    \n-
    LocalGeometry geometryInOutside() const
    Definition identitygridintersections.hh:135
    \n-
    bool boundary() const
    return true if intersection is with boundary.
    Definition identitygridintersections.hh:90
    \n-
    GeometryType type() const
    Geometry type of an intersection.
    Definition identitygridintersections.hh:119
    \n-
    FieldVector< ctype, dimworld > NormalVector
    Definition identitygridintersections.hh:53
    \n-
    LocalGeometry geometryInInside() const
    Definition identitygridintersections.hh:128
    \n-
    bool conforming() const
    Return true if this is a conforming intersection.
    Definition identitygridintersections.hh:114
    \n-
    IdentityGridLeafIntersection(const GridImp *identityGrid, const HostLeafIntersection &hostIntersection)
    Definition identitygridintersections.hh:58
    \n-
    size_t boundarySegmentIndex() const
    return the boundary segment index
    Definition identitygridintersections.hh:109
    \n-
    bool equals(const IdentityGridLeafIntersection &other) const
    Definition identitygridintersections.hh:70
    \n-
    FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
    return outer normal
    Definition identitygridintersections.hh:161
    \n-
    int indexInOutside() const
    local number of codim 1 entity in neighbor where intersection is contained
    Definition identitygridintersections.hh:155
    \n-
    FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
    return outer normal multiplied by the integration element
    Definition identitygridintersections.hh:166
    \n-
    bool neighbor() const
    return true if across the edge an neighbor on this level exists
    Definition identitygridintersections.hh:104
    \n-
    FieldVector< ctype, GridImp::dimensionworld > unitOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
    return unit outer normal
    Definition identitygridintersections.hh:171
    \n-
    int indexInInside() const
    local number of codim 1 entity in self where intersection is contained in
    Definition identitygridintersections.hh:149
    \n-
    GridImp::template Codim< 1 >::Geometry Geometry
    Definition identitygridintersections.hh:50
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition identitygridintersections.hh:52
    \n-
    Definition identitygridintersections.hh:192
    \n-
    Geometry geometry() const
    Definition identitygridintersections.hh:302
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition identitygridintersections.hh:211
    \n-
    IdentityGridLevelIntersection(const GridImp *identityGrid, const HostLevelIntersection &hostIntersection)
    Definition identitygridintersections.hh:217
    \n-
    GridImp::template Codim< 1 >::Geometry Geometry
    Definition identitygridintersections.hh:209
    \n-
    bool equals(const IdentityGridLevelIntersection &other) const
    Definition identitygridintersections.hh:229
    \n-
    bool neighbor() const
    return true if across the edge an neighbor on this level exists
    Definition identitygridintersections.hh:264
    \n-
    NormalVector centerUnitOuterNormal() const
    Return unit outer normal (length == 1)
    Definition identitygridintersections.hh:259
    \n-
    bool conforming() const
    Return true if this is a conforming intersection.
    Definition identitygridintersections.hh:274
    \n-
    int indexInInside() const
    local number of codim 1 entity in self where intersection is contained in
    Definition identitygridintersections.hh:309
    \n-
    FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &local) const
    return outer normal
    Definition identitygridintersections.hh:321
    \n-
    GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
    Definition identitygridintersections.hh:210
    \n-
    FieldVector< ctype, dimworld > NormalVector
    Definition identitygridintersections.hh:212
    \n-
    bool boundary() const
    return true if intersection is with boundary.
    Definition identitygridintersections.hh:250
    \n-
    FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
    return outer normal multiplied by the integration element
    Definition identitygridintersections.hh:326
    \n-
    LocalGeometry geometryInOutside() const
    Definition identitygridintersections.hh:295
    \n-
    LocalGeometry geometryInInside() const
    Definition identitygridintersections.hh:288
    \n-
    int indexInOutside() const
    local number of codim 1 entity in neighbor where intersection is contained
    Definition identitygridintersections.hh:315
    \n-
    FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
    return unit outer normal
    Definition identitygridintersections.hh:331
    \n-
    size_t boundarySegmentIndex() const
    return the boundary segment index
    Definition identitygridintersections.hh:269
    \n-
    Entity outside() const
    Definition identitygridintersections.hh:243
    \n-
    Entity inside() const
    Definition identitygridintersections.hh:236
    \n-
    GeometryType type() const
    Geometry type of an intersection.
    Definition identitygridintersections.hh:279
    \n-
    IdentityGridLevelIntersection(const GridImp *identityGrid, HostLevelIntersection &&hostIntersection)
    Definition identitygridintersections.hh:223
    \n+
    Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
    Definition identitygridhierarchiciterator.hh:26
    \n+
    void increment()
    Definition identitygridhierarchiciterator.hh:52
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Definition identitygridhierarchiciterator.hh:35
    \n+
    bool equals(const IdentityGridHierarchicIterator &i) const
    equality
    Definition identitygridhierarchiciterator.hh:63
    \n+
    static constexpr int codimension
    Definition identitygridhierarchiciterator.hh:33
    \n+
    IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity &startEntity, int maxLevel, bool endDummy)
    Definition identitygridhierarchiciterator.hh:45
    \n+
    Entity dereference() const
    dereferencing
    Definition identitygridhierarchiciterator.hh:58
    \n+
    IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity &startEntity, int maxLevel)
    the default Constructor
    Definition identitygridhierarchiciterator.hh:38
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,500 +1,109 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridintersections.hh\n+identitygridhierarchiciterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRID_INTERSECTIONS_HH\n-6#define DUNE_IDENTITYGRID_INTERSECTIONS_HH\n+5#ifndef DUNE_IDENTITYGRIDHIERITERATOR_HH\n+6#define DUNE_IDENTITYGRIDHIERITERATOR_HH\n 7\n-8#include \"identitygridleafiterator.hh\"\n-9#include \n-10\n-15namespace Dune {\n-16\n-17\n-18 // External forward declarations\n-19 template< class Grid >\n-20 struct HostGridAccess;\n-21\n-22\n-31 template\n-32 class IdentityGridLeafIntersection\n-33 {\n+12namespace Dune {\n+13\n+14\n+15 //**********************************************************************\n+16 //\n+24 template\n+25 class IdentityGridHierarchicIterator\n+26 {\n+27\n+28 // Type of the corresponding HierarchicIterator in the host grid\n+29 typedef typename GridImp::HostGridType::template Codim<0>::Entity::\n+HierarchicIterator HostGridHierarchicIterator;\n+30\n+31 public:\n+32\n+33 constexpr static int codimension = 0;\n 34\n-35 friend class IdentityGridLeafIntersectionIterator;\n+35 typedef typename GridImp::template Codim<0>::Entity Entity;\n 36\n-37 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;\n-38\n-39 constexpr static int dim = GridImp::dimension;\n-40\n-41 constexpr static int dimworld = GridImp::dimensionworld;\n+38 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const\n+Entity& startEntity, int maxLevel) :\n+39 identityGrid_(identityGrid),\n+40 hostHierarchicIterator_(startEntity.impl().hostEntity_.hbegin(maxLevel))\n+41 {}\n 42\n-43 // The type used to store coordinates\n-44 typedef typename GridImp::ctype ctype;\n-45\n-46 typedef typename GridImp::HostGridType::LeafGridView::Intersection\n-HostLeafIntersection;\n-47\n-48 public:\n+43\n+45 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const\n+Entity& startEntity, int maxLevel, [[maybe_unused]] bool endDummy) :\n+46 identityGrid_(identityGrid),\n+47 hostHierarchicIterator_(startEntity.impl().hostEntity_.hend(maxLevel))\n+48 {}\n 49\n-50 typedef typename GridImp::template Codim<1>::Geometry Geometry;\n-51 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;\n-52 typedef typename GridImp::template Codim<0>::Entity Entity;\n-53 typedef FieldVector NormalVector;\n-54\n-55 IdentityGridLeafIntersection()\n-56 {}\n-57\n-58 IdentityGridLeafIntersection(const GridImp* identityGrid,\n-59 const HostLeafIntersection& hostIntersection)\n-60 : identityGrid_(identityGrid)\n-61 , hostIntersection_(hostIntersection)\n-62 {}\n-63\n-64 IdentityGridLeafIntersection(const GridImp* identityGrid,\n-65 HostLeafIntersection&& hostIntersection)\n-66 : identityGrid_(identityGrid)\n-67 , hostIntersection_(std::move(hostIntersection))\n-68 {}\n+50\n+52 void increment()\n+53 {\n+54 ++hostHierarchicIterator_;\n+55 }\n+56\n+58 Entity dereference() const {\n+59 return Entity{{identityGrid_,*hostHierarchicIterator_}};\n+60 }\n+61\n+63 bool equals(const IdentityGridHierarchicIterator& i) const {\n+64 return hostHierarchicIterator_ == i.hostHierarchicIterator_;\n+65 }\n+66\n+67 private:\n+68 const GridImp* identityGrid_;\n 69\n-70 bool equals(const IdentityGridLeafIntersection& other) const\n-71 {\n-72 return hostIntersection_ == other.hostIntersection_;\n-73 }\n+70 HostGridHierarchicIterator hostHierarchicIterator_;\n+71\n+72 };\n+73\n 74\n-77 Entity inside() const {\n-78 return IdentityGridEntity<0,dim,GridImp>\n-(identityGrid_,hostIntersection_.inside());\n-79 }\n-80\n-81\n-84 Entity outside() const {\n-85 return IdentityGridEntity<0,dim,GridImp>\n-(identityGrid_,hostIntersection_.outside());\n-86 }\n-87\n-88\n-90 bool boundary () const {\n-91 return hostIntersection_.boundary();\n-92 }\n-93\n-99 NormalVector centerUnitOuterNormal () const {\n-100 return hostIntersection_.centerUnitOuterNormal();\n-101 }\n-102\n-104 bool neighbor () const {\n-105 return hostIntersection_.neighbor();\n-106 }\n-107\n-109 size_t boundarySegmentIndex() const {\n-110 return hostIntersection_.boundarySegmentIndex();\n-111 }\n-112\n-114 bool conforming () const {\n-115 return hostIntersection_.conforming();\n-116 }\n-117\n-119 GeometryType type () const {\n-120 return hostIntersection_.type();\n-121 }\n-122\n-123\n-128 LocalGeometry geometryInInside () const\n-129 {\n-130 return LocalGeometry( hostIntersection_.geometryInInside() );\n-131 }\n-132\n-135 LocalGeometry geometryInOutside () const\n-136 {\n-137 return LocalGeometry( hostIntersection_.geometryInOutside() );\n-138 }\n-139\n-142 Geometry geometry () const\n-143 {\n-144 return Geometry( hostIntersection_.geometry() );\n-145 }\n-146\n-147\n-149 int indexInInside () const {\n-150 return hostIntersection_.indexInInside();\n-151 }\n-152\n-153\n-155 int indexInOutside () const {\n-156 return hostIntersection_.indexInOutside();\n-157 }\n-158\n-159\n-161 FieldVector outerNormal (const\n-FieldVector& local) const {\n-162 return hostIntersection_.outerNormal(local);\n-163 }\n-164\n-166 FieldVector integrationOuterNormal (const\n-FieldVector& local) const {\n-167 return hostIntersection_.integrationOuterNormal(local);\n-168 }\n-169\n-171 FieldVector unitOuterNormal (const\n-FieldVector& local) const {\n-172 return hostIntersection_.unitOuterNormal(local);\n-173 }\n-174\n-175\n-176 private:\n-177 //**********************************************************\n-178 // private methods\n-179 //**********************************************************\n-180\n-181 const GridImp* identityGrid_;\n-182\n-183 HostLeafIntersection hostIntersection_;\n-184 };\n-185\n-186\n-187\n-188\n-190 template\n-191 class IdentityGridLevelIntersection\n-192 {\n-193\n-194 friend class IdentityGridLevelIntersectionIterator;\n-195\n-196 friend struct HostGridAccess< typename std::remove_const< GridImp >::type\n->;\n-197\n-198 constexpr static int dim = GridImp::dimension;\n-199\n-200 constexpr static int dimworld = GridImp::dimensionworld;\n-201\n-202 // The type used to store coordinates\n-203 typedef typename GridImp::ctype ctype;\n-204\n-205 typedef typename GridImp::HostGridType::LevelGridView::Intersection\n-HostLevelIntersection;\n-206\n-207 public:\n-208\n-209 typedef typename GridImp::template Codim<1>::Geometry Geometry;\n-210 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;\n-211 typedef typename GridImp::template Codim<0>::Entity Entity;\n-212 typedef FieldVector NormalVector;\n-213\n-214 IdentityGridLevelIntersection()\n-215 {}\n-216\n-217 IdentityGridLevelIntersection(const GridImp* identityGrid,\n-218 const HostLevelIntersection& hostIntersection)\n-219 : identityGrid_(identityGrid)\n-220 , hostIntersection_(hostIntersection)\n-221 {}\n-222\n-223 IdentityGridLevelIntersection(const GridImp* identityGrid,\n-224 HostLevelIntersection&& hostIntersection)\n-225 : identityGrid_(identityGrid)\n-226 , hostIntersection_(std::move(hostIntersection))\n-227 {}\n-228\n-229 bool equals(const IdentityGridLevelIntersection& other) const\n-230 {\n-231 return hostIntersection_ == other.hostIntersection_;\n-232 }\n-233\n-236 Entity inside() const {\n-237 return IdentityGridEntity<0,dim,GridImp>\n-(identityGrid_,hostIntersection_.inside());\n-238 }\n-239\n-240\n-243 Entity outside() const {\n-244 return IdentityGridEntity<0,dim,GridImp>\n-(identityGrid_,hostIntersection_.outside());\n-245 }\n-246\n-247\n-250 bool boundary () const {\n-251 return hostIntersection_.boundary();\n-252 }\n-253\n-259 NormalVector centerUnitOuterNormal () const {\n-260 return hostIntersection_.centerUnitOuterNormal();\n-261 }\n-262\n-264 bool neighbor () const {\n-265 return hostIntersection_.neighbor();\n-266 }\n-267\n-269 size_t boundarySegmentIndex() const {\n-270 return hostIntersection_.boundarySegmentIndex();\n-271 }\n-272\n-274 bool conforming () const {\n-275 return hostIntersection_.conforming();\n-276 }\n-277\n-279 GeometryType type () const {\n-280 return hostIntersection_.type();\n-281 }\n-282\n-283\n-288 LocalGeometry geometryInInside () const\n-289 {\n-290 return LocalGeometry( hostIntersection_.geometryInInside() );\n-291 }\n-292\n-295 LocalGeometry geometryInOutside () const\n-296 {\n-297 return LocalGeometry( hostIntersection_.geometryInOutside() );\n-298 }\n-299\n-302 Geometry geometry () const\n-303 {\n-304 return Geometry( hostIntersection_.geometry() );\n-305 }\n-306\n-307\n-309 int indexInInside () const {\n-310 return hostIntersection_.indexInInside();\n-311 }\n-312\n-313\n-315 int indexInOutside () const {\n-316 return hostIntersection_.indexInOutside();\n-317 }\n-318\n-319\n-321 FieldVector outerNormal (const FieldVector&\n-local) const {\n-322 return hostIntersection_.outerNormal(local);\n-323 }\n-324\n-326 FieldVector integrationOuterNormal (const\n-FieldVector& local) const {\n-327 return hostIntersection_.integrationOuterNormal(local);\n-328 }\n-329\n-331 FieldVector unitOuterNormal (const FieldVector& local) const {\n-332 return hostIntersection_.unitOuterNormal(local);\n-333 }\n-334\n-335 private:\n-336\n-337 const GridImp* identityGrid_;\n-338\n-339 HostLevelIntersection hostIntersection_;\n-340\n-341 };\n-342\n-343\n-344} // namespace Dune\n-345\n-346#endif\n-identitygridleafiterator.hh\n-The IdentityGridLeafIterator class.\n-identitygridentity.hh\n-The IdentityGridEntity class.\n-std\n-STL namespace.\n+75} // end namespace Dune\n+76\n+77#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::HostGridAccess\n-provides access to host grid objects from GeometryGrid\n-Definition identitygrid.hh:37\n-Dune::IdentityGridEntity\n-The implementation of entities in a IdentityGrid.\n-Definition identitygridentity.hh:55\n-Dune::IdentityGridLevelIntersectionIterator\n-Definition identitygridintersectioniterator.hh:84\n-Dune::IdentityGridLeafIntersectionIterator\n-Iterator over all element neighborsMesh entities of codimension 0 (\"elements\")\n-allow to visit all nei...\n-Definition identitygridintersectioniterator.hh:29\n-Dune::IdentityGridLeafIntersection\n-An intersection with a leaf neighbor elementMesh entities of codimension 0\n-(\"elements\") allow to visi...\n-Definition identitygridintersections.hh:33\n-Dune::IdentityGridLeafIntersection::inside\n-Entity inside() const\n-Definition identitygridintersections.hh:77\n-Dune::IdentityGridLeafIntersection::IdentityGridLeafIntersection\n-IdentityGridLeafIntersection(const GridImp *identityGrid, HostLeafIntersection\n-&&hostIntersection)\n-Definition identitygridintersections.hh:64\n-Dune::IdentityGridLeafIntersection::centerUnitOuterNormal\n-NormalVector centerUnitOuterNormal() const\n-Return unit outer normal (length == 1)\n-Definition identitygridintersections.hh:99\n-Dune::IdentityGridLeafIntersection::LocalGeometry\n-GridImp::template Codim< 1 >::LocalGeometry LocalGeometry\n-Definition identitygridintersections.hh:51\n-Dune::IdentityGridLeafIntersection::geometry\n-Geometry geometry() const\n-Definition identitygridintersections.hh:142\n-Dune::IdentityGridLeafIntersection::outside\n-Entity outside() const\n-Definition identitygridintersections.hh:84\n-Dune::IdentityGridLeafIntersection::geometryInOutside\n-LocalGeometry geometryInOutside() const\n-Definition identitygridintersections.hh:135\n-Dune::IdentityGridLeafIntersection::boundary\n-bool boundary() const\n-return true if intersection is with boundary.\n-Definition identitygridintersections.hh:90\n-Dune::IdentityGridLeafIntersection::type\n-GeometryType type() const\n-Geometry type of an intersection.\n-Definition identitygridintersections.hh:119\n-Dune::IdentityGridLeafIntersection::NormalVector\n-FieldVector< ctype, dimworld > NormalVector\n-Definition identitygridintersections.hh:53\n-Dune::IdentityGridLeafIntersection::geometryInInside\n-LocalGeometry geometryInInside() const\n-Definition identitygridintersections.hh:128\n-Dune::IdentityGridLeafIntersection::conforming\n-bool conforming() const\n-Return true if this is a conforming intersection.\n-Definition identitygridintersections.hh:114\n-Dune::IdentityGridLeafIntersection::IdentityGridLeafIntersection\n-IdentityGridLeafIntersection(const GridImp *identityGrid, const\n-HostLeafIntersection &hostIntersection)\n-Definition identitygridintersections.hh:58\n-Dune::IdentityGridLeafIntersection::boundarySegmentIndex\n-size_t boundarySegmentIndex() const\n-return the boundary segment index\n-Definition identitygridintersections.hh:109\n-Dune::IdentityGridLeafIntersection::equals\n-bool equals(const IdentityGridLeafIntersection &other) const\n-Definition identitygridintersections.hh:70\n-Dune::IdentityGridLeafIntersection::outerNormal\n-FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector<\n-ctype, GridImp::dimension-1 > &local) const\n-return outer normal\n-Definition identitygridintersections.hh:161\n-Dune::IdentityGridLeafIntersection::indexInOutside\n-int indexInOutside() const\n-local number of codim 1 entity in neighbor where intersection is contained\n-Definition identitygridintersections.hh:155\n-Dune::IdentityGridLeafIntersection::integrationOuterNormal\n-FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const\n-FieldVector< ctype, GridImp::dimension-1 > &local) const\n-return outer normal multiplied by the integration element\n-Definition identitygridintersections.hh:166\n-Dune::IdentityGridLeafIntersection::neighbor\n-bool neighbor() const\n-return true if across the edge an neighbor on this level exists\n-Definition identitygridintersections.hh:104\n-Dune::IdentityGridLeafIntersection::unitOuterNormal\n-FieldVector< ctype, GridImp::dimensionworld > unitOuterNormal(const\n-FieldVector< ctype, GridImp::dimension-1 > &local) const\n-return unit outer normal\n-Definition identitygridintersections.hh:171\n-Dune::IdentityGridLeafIntersection::indexInInside\n-int indexInInside() const\n-local number of codim 1 entity in self where intersection is contained in\n-Definition identitygridintersections.hh:149\n-Dune::IdentityGridLeafIntersection::Geometry\n-GridImp::template Codim< 1 >::Geometry Geometry\n-Definition identitygridintersections.hh:50\n-Dune::IdentityGridLeafIntersection::Entity\n+Dune::IdentityGridHierarchicIterator\n+Iterator over the descendants of an entity.Mesh entities of codimension 0\n+(\"elements\") allow to visit...\n+Definition identitygridhierarchiciterator.hh:26\n+Dune::IdentityGridHierarchicIterator::increment\n+void increment()\n+Definition identitygridhierarchiciterator.hh:52\n+Dune::IdentityGridHierarchicIterator::Entity\n GridImp::template Codim< 0 >::Entity Entity\n-Definition identitygridintersections.hh:52\n-Dune::IdentityGridLevelIntersection\n-Definition identitygridintersections.hh:192\n-Dune::IdentityGridLevelIntersection::geometry\n-Geometry geometry() const\n-Definition identitygridintersections.hh:302\n-Dune::IdentityGridLevelIntersection::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Definition identitygridintersections.hh:211\n-Dune::IdentityGridLevelIntersection::IdentityGridLevelIntersection\n-IdentityGridLevelIntersection(const GridImp *identityGrid, const\n-HostLevelIntersection &hostIntersection)\n-Definition identitygridintersections.hh:217\n-Dune::IdentityGridLevelIntersection::Geometry\n-GridImp::template Codim< 1 >::Geometry Geometry\n-Definition identitygridintersections.hh:209\n-Dune::IdentityGridLevelIntersection::equals\n-bool equals(const IdentityGridLevelIntersection &other) const\n-Definition identitygridintersections.hh:229\n-Dune::IdentityGridLevelIntersection::neighbor\n-bool neighbor() const\n-return true if across the edge an neighbor on this level exists\n-Definition identitygridintersections.hh:264\n-Dune::IdentityGridLevelIntersection::centerUnitOuterNormal\n-NormalVector centerUnitOuterNormal() const\n-Return unit outer normal (length == 1)\n-Definition identitygridintersections.hh:259\n-Dune::IdentityGridLevelIntersection::conforming\n-bool conforming() const\n-Return true if this is a conforming intersection.\n-Definition identitygridintersections.hh:274\n-Dune::IdentityGridLevelIntersection::indexInInside\n-int indexInInside() const\n-local number of codim 1 entity in self where intersection is contained in\n-Definition identitygridintersections.hh:309\n-Dune::IdentityGridLevelIntersection::outerNormal\n-FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 >\n-&local) const\n-return outer normal\n-Definition identitygridintersections.hh:321\n-Dune::IdentityGridLevelIntersection::LocalGeometry\n-GridImp::template Codim< 1 >::LocalGeometry LocalGeometry\n-Definition identitygridintersections.hh:210\n-Dune::IdentityGridLevelIntersection::NormalVector\n-FieldVector< ctype, dimworld > NormalVector\n-Definition identitygridintersections.hh:212\n-Dune::IdentityGridLevelIntersection::boundary\n-bool boundary() const\n-return true if intersection is with boundary.\n-Definition identitygridintersections.hh:250\n-Dune::IdentityGridLevelIntersection::integrationOuterNormal\n-FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype,\n-dim-1 > &local) const\n-return outer normal multiplied by the integration element\n-Definition identitygridintersections.hh:326\n-Dune::IdentityGridLevelIntersection::geometryInOutside\n-LocalGeometry geometryInOutside() const\n-Definition identitygridintersections.hh:295\n-Dune::IdentityGridLevelIntersection::geometryInInside\n-LocalGeometry geometryInInside() const\n-Definition identitygridintersections.hh:288\n-Dune::IdentityGridLevelIntersection::indexInOutside\n-int indexInOutside() const\n-local number of codim 1 entity in neighbor where intersection is contained\n-Definition identitygridintersections.hh:315\n-Dune::IdentityGridLevelIntersection::unitOuterNormal\n-FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-\n-1 > &local) const\n-return unit outer normal\n-Definition identitygridintersections.hh:331\n-Dune::IdentityGridLevelIntersection::boundarySegmentIndex\n-size_t boundarySegmentIndex() const\n-return the boundary segment index\n-Definition identitygridintersections.hh:269\n-Dune::IdentityGridLevelIntersection::outside\n-Entity outside() const\n-Definition identitygridintersections.hh:243\n-Dune::IdentityGridLevelIntersection::inside\n-Entity inside() const\n-Definition identitygridintersections.hh:236\n-Dune::IdentityGridLevelIntersection::type\n-GeometryType type() const\n-Geometry type of an intersection.\n-Definition identitygridintersections.hh:279\n-Dune::IdentityGridLevelIntersection::IdentityGridLevelIntersection\n-IdentityGridLevelIntersection(const GridImp *identityGrid,\n-HostLevelIntersection &&hostIntersection)\n-Definition identitygridintersections.hh:223\n+Definition identitygridhierarchiciterator.hh:35\n+Dune::IdentityGridHierarchicIterator::equals\n+bool equals(const IdentityGridHierarchicIterator &i) const\n+equality\n+Definition identitygridhierarchiciterator.hh:63\n+Dune::IdentityGridHierarchicIterator::codimension\n+static constexpr int codimension\n+Definition identitygridhierarchiciterator.hh:33\n+Dune::IdentityGridHierarchicIterator::IdentityGridHierarchicIterator\n+IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity\n+&startEntity, int maxLevel, bool endDummy)\n+Definition identitygridhierarchiciterator.hh:45\n+Dune::IdentityGridHierarchicIterator::dereference\n+Entity dereference() const\n+dereferencing\n+Definition identitygridhierarchiciterator.hh:58\n+Dune::IdentityGridHierarchicIterator::IdentityGridHierarchicIterator\n+IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity\n+&startEntity, int maxLevel)\n+the default Constructor\n+Definition identitygridhierarchiciterator.hh:38\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00740.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00740.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridentity.hh File Reference\n+dune-grid: identitygridintersectioniterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,41 +72,42 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n
    \n
    \n \n-
    identitygridentity.hh File Reference
    \n+
    identitygridintersectioniterator.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridEntity class. \n+

    The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes. \n More...

    \n-
    #include <dune/grid/common/grid.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::IdentityGridEntity< codim, dim, GridImp >
     The implementation of entities in a IdentityGrid. More...
    class  Dune::IdentityGridLeafIntersectionIterator< GridImp >
     Iterator over all element neighborsMesh entities of codimension 0 (\"elements\") allow to visit all neighbors, where a neighbor is an entity of codimension 0 which has a common entity of codimension 1 These neighbors are accessed via a IntersectionIterator. This allows the implement non-matching meshes. The number of neighbors may be different from the number of an element! More...
     
    class  Dune::IdentityGridEntity< 0, dim, GridImp >
     Specialization for codim-0-entities. More...
    class  Dune::IdentityGridLevelIntersectionIterator< GridImp >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridEntity class.

    \n+

    The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,34 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridentity.hh File Reference\n-The IdentityGridEntity class. More...\n-#include \n+identitygridintersectioniterator.hh File Reference\n+The IdentityGridLeafIntersectionIterator and\n+IdentityGridLevelIntersectionIterator classes. More...\n+#include \"identitygridintersections.hh\"\n+#include \"identitygridentity.hh\"\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridEntity<_codim,_dim,_GridImp_>\n-\u00a0 The implementation of entities in a IdentityGrid. More...\n+class \u00a0 Dune::IdentityGridLeafIntersectionIterator<_GridImp_>\n+ Iterator over all element neighborsMesh entities of codimension 0\n+ (\"elements\") allow to visit all neighbors, where a neighbor is an\n+\u00a0 entity of codimension 0 which has a common entity of codimension 1\n+ These neighbors are accessed via a IntersectionIterator. This allows\n+ the implement non-matching meshes. The number of neighbors may be\n+ different from the number of an element! More...\n \u00a0\n-class \u00a0 Dune::IdentityGridEntity<_0,_dim,_GridImp_>\n-\u00a0 Specialization for codim-0-entities. More...\n+class \u00a0 Dune::IdentityGridLevelIntersectionIterator<_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridEntity class.\n+The IdentityGridLeafIntersectionIterator and\n+IdentityGridLevelIntersectionIterator classes.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00740_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00740_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridentity.hh Source File\n+dune-grid: identitygridintersectioniterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,542 +74,177 @@\n \n \n
    \n
    \n-
    identitygridentity.hh
    \n+
    identitygridintersectioniterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRIDENTITY_HH
    \n-
    6#define DUNE_IDENTITYGRIDENTITY_HH
    \n+
    5#ifndef DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
    \n+
    6#define DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
    \n
    7
    \n-\n-
    13
    \n-
    14namespace Dune {
    \n-
    15
    \n-
    16
    \n-
    17 // Forward declarations
    \n+\n+\n+
    10
    \n+\n+
    12
    \n+
    17namespace Dune {
    \n
    18
    \n-
    19 template<int codim, int dim, class GridImp>
    \n-
    20 class IdentityGridEntity;
    \n-
    21
    \n-
    22 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n-
    23 class IdentityGridLevelIterator;
    \n-
    24
    \n-
    25 template<class GridImp>
    \n-
    26 class IdentityGridLevelIntersectionIterator;
    \n-
    27
    \n-
    28 template<class GridImp>
    \n-
    29 class IdentityGridLeafIntersectionIterator;
    \n+
    27 template<class GridImp>
    \n+
    \n+\n+
    29 {
    \n
    30
    \n-
    31 template<class GridImp>
    \n-
    32 class IdentityGridHierarchicIterator;
    \n-
    33
    \n+
    31 constexpr static int dim = GridImp::dimension;
    \n+
    32
    \n+
    33 constexpr static int dimworld = GridImp::dimensionworld;
    \n
    34
    \n-
    35 // External forward declarations
    \n-
    36 template< class Grid >
    \n-
    37 struct HostGridAccess;
    \n-
    38
    \n+
    35 // The type used to store coordinates
    \n+
    36 typedef typename GridImp::ctype ctype;
    \n+
    37
    \n+
    38 typedef typename GridImp::HostGridType::LeafGridView::IntersectionIterator HostLeafIntersectionIterator;
    \n
    39
    \n-
    40 //**********************************************************************
    \n-
    41 //
    \n-
    42 // --IdentityGridEntity
    \n-
    43 // --Entity
    \n-
    44 //
    \n-
    52 template<int codim, int dim, class GridImp>
    \n-
    \n-\n-
    54 public EntityDefaultImplementation <codim,dim,GridImp,IdentityGridEntity>
    \n-
    55 {
    \n-
    56
    \n-
    57 template <class GridImp_>
    \n-\n-
    59
    \n-
    60 template <class GridImp_>
    \n-\n-
    62
    \n-
    63 template <class GridImp_>
    \n-\n-
    65
    \n-
    66 template <class GridImp_>
    \n-\n+
    40 public:
    \n+
    41
    \n+\n+
    43
    \n+\n+
    46
    \n+
    \n+
    47 IdentityGridLeafIntersectionIterator(const GridImp* identityGrid,
    \n+
    48 const HostLeafIntersectionIterator& hostIterator)
    \n+
    49 : identityGrid_(identityGrid)
    \n+
    50 , hostIterator_(hostIterator)
    \n+
    51 {}
    \n+
    \n+
    52
    \n+
    \n+\n+
    55 return hostIterator_ == other.hostIterator_;
    \n+
    56 }
    \n+
    \n+
    57
    \n+
    58
    \n+
    \n+
    60 void increment() {
    \n+
    61 ++hostIterator_;
    \n+
    62 }
    \n+
    \n+
    63
    \n+
    \n+\n+
    66 return IdentityGridLeafIntersection<GridImp>(identityGrid_,*hostIterator_);
    \n+
    67 }
    \n+
    \n
    68
    \n-
    69 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n-
    70
    \n-
    71
    \n-
    72 private:
    \n+
    69 private:
    \n+
    70 //**********************************************************
    \n+
    71 // private data
    \n+
    72 //**********************************************************
    \n
    73
    \n-
    74 typedef typename GridImp::ctype ctype;
    \n-
    75
    \n-
    76 // The codimension of this entity wrt the host grid
    \n-
    77 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - GridImp::dimension + codim;
    \n+
    74 const GridImp* identityGrid_ = nullptr;
    \n+
    75 HostLeafIntersectionIterator hostIterator_ = {};
    \n+
    76 };
    \n+
    \n+
    77
    \n
    78
    \n-
    79 // equivalent entity in the host grid
    \n-
    80 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Entity HostGridEntity;
    \n-
    81
    \n-
    82
    \n-
    83 public:
    \n-
    84
    \n-
    85 typedef typename GridImp::template Codim<codim>::Geometry Geometry;
    \n+
    79
    \n+
    80
    \n+
    82 template<class GridImp>
    \n+
    \n+\n+
    84 {
    \n+
    85 constexpr static int dim = GridImp::dimension;
    \n
    86
    \n-
    88 typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;
    \n-
    89
    \n-
    \n-\n-
    91 : identityGrid_(nullptr)
    \n-
    92 {}
    \n-
    \n+
    87 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    88
    \n+
    89 // The type used to store coordinates
    \n+
    90 typedef typename GridImp::ctype ctype;
    \n+
    91
    \n+
    92 typedef typename GridImp::HostGridType::LevelGridView::IntersectionIterator HostLevelIntersectionIterator;
    \n
    93
    \n-
    \n-
    94 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity& hostEntity)
    \n-
    95 : hostEntity_(hostEntity)
    \n-
    96 , identityGrid_(identityGrid)
    \n-
    97 {}
    \n-
    \n-
    98
    \n-
    \n-
    99 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&& hostEntity)
    \n-
    100 : hostEntity_(std::move(hostEntity))
    \n-
    101 , identityGrid_(identityGrid)
    \n-
    102 {}
    \n-
    \n-
    103
    \n-
    \n-\n-
    106 : hostEntity_(original.hostEntity_)
    \n-
    107 , identityGrid_(original.identityGrid_)
    \n-
    108 {}
    \n-
    \n-
    109
    \n-
    \n-\n-
    111 : hostEntity_(std::move(original.hostEntity_))
    \n-
    112 , identityGrid_(original.identityGrid_)
    \n-
    113 {}
    \n-
    \n-
    114
    \n-
    \n-\n-
    117 {
    \n-
    118 if (this != &original)
    \n-
    119 {
    \n-
    120 identityGrid_ = original.identityGrid_;
    \n-
    121 hostEntity_ = original.hostEntity_;
    \n-
    122 }
    \n-
    123 return *this;
    \n-
    124 }
    \n-
    \n+
    94 public:
    \n+
    95
    \n+\n+
    97
    \n+\n+
    100
    \n+
    \n+
    101 IdentityGridLevelIntersectionIterator(const GridImp* identityGrid,
    \n+
    102 const HostLevelIntersectionIterator& hostIterator)
    \n+
    103 : identityGrid_(identityGrid)
    \n+
    104 , hostIterator_(hostIterator)
    \n+
    105 {}
    \n+
    \n+
    106
    \n+
    \n+\n+
    109 return hostIterator_ == other.hostIterator_;
    \n+
    110 }
    \n+
    \n+
    111
    \n+
    112
    \n+
    \n+
    114 void increment() {
    \n+
    115 ++hostIterator_;
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    \n+\n+
    120 return IdentityGridLevelIntersection<GridImp>(identityGrid_,*hostIterator_);
    \n+
    121 }
    \n+
    \n+
    122
    \n+
    123 private:
    \n+
    124
    \n
    125
    \n-
    \n-\n-
    128 {
    \n-
    129 if (this != &original)
    \n-
    130 {
    \n-
    131 identityGrid_ = original.identityGrid_;
    \n-
    132 hostEntity_ = std::move(original.hostEntity_);
    \n-
    133 }
    \n-
    134 return *this;
    \n-
    135 }
    \n-
    \n-
    136
    \n-
    \n-
    137 bool equals(const IdentityGridEntity& other) const
    \n-
    138 {
    \n-
    139 return hostEntity_ == other.hostEntity_;
    \n-
    140 }
    \n-
    \n-
    141
    \n-
    \n-
    143 bool hasFather () const {
    \n-
    144 return hostEntity_.hasFather();
    \n-
    145 }
    \n-
    \n-
    146
    \n-
    \n-\n-
    149 {
    \n-
    150 return EntitySeed(hostEntity_);
    \n-
    151 }
    \n-
    \n-
    152
    \n-
    \n-
    154 int level () const {
    \n-
    155 return hostEntity_.level();
    \n-
    156 }
    \n-
    \n-
    157
    \n-
    158
    \n-
    \n-\n-
    162 return hostEntity_.partitionType();
    \n-
    163 }
    \n-
    \n-
    164
    \n-
    \n-
    167 unsigned int subEntities (unsigned int cc) const
    \n-
    168 {
    \n-
    169 return hostEntity_.subEntities(cc);
    \n-
    170 }
    \n-
    \n-
    171
    \n-
    \n-\n-
    174 {
    \n-
    175 return Geometry( hostEntity_.geometry() );
    \n-
    176 }
    \n-
    \n-
    177
    \n-
    178
    \n-
    179 HostGridEntity hostEntity_;
    \n-
    180
    \n-
    181 private:
    \n-
    182
    \n-
    183 const GridImp* identityGrid_;
    \n-
    184
    \n-
    185 };
    \n-
    \n-
    186
    \n-
    187
    \n-
    188
    \n-
    189
    \n-
    190 //***********************
    \n-
    191 //
    \n-
    192 // --IdentityGridEntity
    \n-
    193 //
    \n-
    194 //***********************
    \n-
    202 template<int dim, class GridImp>
    \n-
    \n-
    203 class IdentityGridEntity<0,dim,GridImp> :
    \n-
    204 public EntityDefaultImplementation<0,dim,GridImp, IdentityGridEntity>
    \n-
    205 {
    \n-
    206 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n-
    207
    \n-
    208 public:
    \n-
    209
    \n-
    210 // The codimension of this entitypointer wrt the host grid
    \n-
    211 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - GridImp::dimension;
    \n-
    212
    \n-
    213 // equivalent entity in the host grid
    \n-
    214 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Entity HostGridEntity;
    \n-
    215
    \n-
    216 typedef typename GridImp::template Codim<0>::Geometry Geometry;
    \n-
    217
    \n-
    218 typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;
    \n-
    219
    \n-\n-
    222
    \n-\n-
    225
    \n-\n-
    228
    \n-
    230 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
    \n-
    231
    \n-
    232
    \n-
    233
    \n-
    \n-\n-
    235 : identityGrid_(nullptr)
    \n-
    236 {}
    \n-
    \n-
    237
    \n-
    \n-
    238 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity& hostEntity)
    \n-
    239 : hostEntity_(hostEntity)
    \n-
    240 , identityGrid_(identityGrid)
    \n-
    241 {}
    \n-
    \n-
    242
    \n-
    \n-
    243 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&& hostEntity)
    \n-
    244 : hostEntity_(std::move(hostEntity))
    \n-
    245 , identityGrid_(identityGrid)
    \n-
    246 {}
    \n-
    \n-
    247
    \n-
    \n-\n-
    250 : hostEntity_(original.hostEntity_)
    \n-
    251 , identityGrid_(original.identityGrid_)
    \n-
    252 {}
    \n-
    \n-
    253
    \n-
    \n-\n-
    255 : hostEntity_(std::move(original.hostEntity_))
    \n-
    256 , identityGrid_(original.identityGrid_)
    \n-
    257 {}
    \n-
    \n-
    258
    \n-
    \n-\n-
    261 {
    \n-
    262 if (this != &original)
    \n-
    263 {
    \n-
    264 identityGrid_ = original.identityGrid_;
    \n-
    265 hostEntity_ = original.hostEntity_;
    \n-
    266 }
    \n-
    267 return *this;
    \n-
    268 }
    \n-
    \n-
    269
    \n-
    \n-\n-
    272 {
    \n-
    273 if (this != &original)
    \n-
    274 {
    \n-
    275 identityGrid_ = original.identityGrid_;
    \n-
    276 hostEntity_ = std::move(original.hostEntity_);
    \n-
    277 }
    \n-
    278 return *this;
    \n-
    279 }
    \n-
    \n-
    280
    \n-
    \n-
    281 bool equals(const IdentityGridEntity& other) const
    \n-
    282 {
    \n-
    283 return hostEntity_ == other.hostEntity_;
    \n-
    284 }
    \n-
    \n-
    285
    \n-
    \n-
    287 bool hasFather () const {
    \n-
    288 return hostEntity_.hasFather();
    \n-
    289 }
    \n-
    \n-
    290
    \n-
    \n-\n-
    293 {
    \n-
    294 return EntitySeed(hostEntity_);
    \n-
    295 }
    \n-
    \n-
    296
    \n-
    \n-
    298 int level () const
    \n-
    299 {
    \n-
    300 return hostEntity_.level();
    \n-
    301 }
    \n-
    \n-
    302
    \n-
    303
    \n-
    \n-\n-
    306 return hostEntity_.partitionType();
    \n-
    307 }
    \n-
    \n-
    308
    \n-
    309
    \n-
    \n-\n-
    312 {
    \n-
    313 return Geometry( hostEntity_.geometry() );
    \n-
    314 }
    \n-
    \n-
    315
    \n-
    316
    \n-
    \n-
    319 unsigned int subEntities (unsigned int codim) const
    \n-
    320 {
    \n-
    321 return hostEntity_.subEntities(codim);
    \n-
    322 }
    \n-
    \n-
    323
    \n-
    324
    \n-
    328 template<int cc>
    \n-
    \n-
    329 typename GridImp::template Codim<cc>::Entity subEntity (int i) const {
    \n-
    330 return IdentityGridEntity<cc,dim,GridImp>(identityGrid_, hostEntity_.template subEntity<cc>(i));
    \n-
    331 }
    \n-
    \n-
    332
    \n-
    333
    \n-
    \n-\n-\n-
    337 identityGrid_,
    \n-
    338 identityGrid_->getHostGrid().levelGridView(level()).ibegin(hostEntity_));
    \n-
    339 }
    \n-
    \n-
    340
    \n-
    341
    \n-
    \n-\n-\n-
    345 identityGrid_,
    \n-
    346 identityGrid_->getHostGrid().levelGridView(level()).iend(hostEntity_));
    \n-
    347 }
    \n-
    \n-
    348
    \n-
    349
    \n-
    \n-\n-\n-
    353 identityGrid_,
    \n-
    354 identityGrid_->getHostGrid().leafGridView().ibegin(hostEntity_));
    \n-
    355 }
    \n-
    \n-
    356
    \n-
    357
    \n-
    \n-\n-\n-
    361 identityGrid_,
    \n-
    362 identityGrid_->getHostGrid().leafGridView().iend(hostEntity_));
    \n-
    363 }
    \n-
    \n-
    364
    \n-
    365
    \n-
    \n-
    367 bool isLeaf() const {
    \n-
    368 return hostEntity_.isLeaf();
    \n-
    369 }
    \n-
    \n-
    370
    \n-
    371
    \n-
    \n-
    374 typename GridImp::template Codim<0>::Entity father () const {
    \n-
    375 return IdentityGridEntity(identityGrid_, hostEntity_.father());
    \n-
    376 }
    \n-
    \n-
    377
    \n-
    378
    \n-
    \n-\n-
    389 {
    \n-
    390 return LocalGeometry( hostEntity_.geometryInFather() );
    \n-
    391 }
    \n-
    \n-
    392
    \n-
    393
    \n-
    \n-\n-
    399 {
    \n-
    400 return IdentityGridHierarchicIterator<const GridImp>(identityGrid_, *this, maxLevel);
    \n-
    401 }
    \n-
    \n-
    402
    \n-
    403
    \n-
    \n-\n-
    406 {
    \n-
    407 return IdentityGridHierarchicIterator<const GridImp>(identityGrid_, *this, maxLevel, true);
    \n-
    408 }
    \n-
    \n-
    409
    \n-
    410
    \n-
    \n-
    412 bool wasRefined () const
    \n-
    413 {
    \n-
    414 if (identityGrid_->adaptationStep!=GridImp::adaptDone)
    \n-
    415 return false;
    \n-
    416
    \n-
    417 int level = this->level();
    \n-
    418 int index = identityGrid_->levelIndexSet(level).index(*this);
    \n-
    419 return identityGrid_->refinementMark_[level][index];
    \n-
    420 }
    \n-
    \n-
    421
    \n-
    422
    \n-
    \n-
    424 bool mightBeCoarsened () const
    \n-
    425 {
    \n-
    426 return true;
    \n-
    427 }
    \n-
    \n-
    428
    \n-
    429
    \n-
    430 // /////////////////////////////////////////
    \n-
    431 // Internal stuff
    \n-
    432 // /////////////////////////////////////////
    \n-
    433
    \n-
    434
    \n-\n-
    436 const GridImp* identityGrid_;
    \n-
    437
    \n-
    438 private:
    \n-
    439
    \n-
    440 typedef typename GridImp::ctype ctype;
    \n-
    441
    \n-
    442 }; // end of IdentityGridEntity codim = 0
    \n-
    \n-
    443
    \n-
    444
    \n-
    445} // namespace Dune
    \n-
    446
    \n-
    447
    \n-
    448#endif
    \n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    STL namespace.
    \n+
    126 const GridImp* identityGrid_ = nullptr;
    \n+
    127 HostLevelIntersectionIterator hostIterator_ = {};
    \n+
    128
    \n+
    129 };
    \n+
    \n+
    130
    \n+
    131
    \n+
    132} // namespace Dune
    \n+
    133
    \n+
    134#endif
    \n+
    The IdentityGridEntity class.
    \n+
    The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Default Implementations for EntityImp.
    Definition common/entity.hh:542
    \n-
    GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition common/entity.hh:576
    \n-
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n-
    The implementation of entities in a IdentityGrid.
    Definition identitygridentity.hh:55
    \n-
    IdentityGridEntity()
    Definition identitygridentity.hh:90
    \n-
    IdentityGridEntity & operator=(IdentityGridEntity &&original)
    Definition identitygridentity.hh:127
    \n-
    IdentityGridEntity(IdentityGridEntity &&original)
    Definition identitygridentity.hh:110
    \n-
    bool equals(const IdentityGridEntity &other) const
    Definition identitygridentity.hh:137
    \n-
    HostGridEntity hostEntity_
    Definition identitygridentity.hh:179
    \n-
    GridImp::template Codim< codim >::EntitySeed EntitySeed
    The type of the EntitySeed interface class.
    Definition identitygridentity.hh:88
    \n-
    EntitySeed seed() const
    Create EntitySeed.
    Definition identitygridentity.hh:148
    \n-
    IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity &hostEntity)
    Definition identitygridentity.hh:94
    \n-
    Geometry geometry() const
    geometry of this entity
    Definition identitygridentity.hh:173
    \n-
    PartitionType partitionType() const
    The partition type for parallel computing.
    Definition identitygridentity.hh:161
    \n-
    unsigned int subEntities(unsigned int cc) const
    Return the number of subEntities of codimension codim.
    Definition identitygridentity.hh:167
    \n-
    IdentityGridEntity(const IdentityGridEntity &original)
    Definition identitygridentity.hh:105
    \n-
    IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)
    Definition identitygridentity.hh:99
    \n-
    bool hasFather() const
    returns true if father entity exists
    Definition identitygridentity.hh:143
    \n-
    GridImp::template Codim< codim >::Geometry Geometry
    Definition identitygridentity.hh:85
    \n-
    IdentityGridEntity & operator=(const IdentityGridEntity &original)
    Definition identitygridentity.hh:116
    \n-
    int level() const
    level of this element
    Definition identitygridentity.hh:154
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    Definition identitygridintersectioniterator.hh:84
    \n+
    bool equals(const IdentityGridLevelIntersectionIterator< GridImp > &other) const
    equality
    Definition identitygridintersectioniterator.hh:108
    \n+
    void increment()
    prefix increment
    Definition identitygridintersectioniterator.hh:114
    \n+
    IdentityGridLevelIntersectionIterator(const GridImp *identityGrid, const HostLevelIntersectionIterator &hostIterator)
    Definition identitygridintersectioniterator.hh:101
    \n+
    Dune::Intersection< const GridImp, Dune::IdentityGridLevelIntersection< GridImp > > Intersection
    Definition identitygridintersectioniterator.hh:96
    \n+
    Intersection dereference() const
    dereferencing
    Definition identitygridintersectioniterator.hh:119
    \n+
    IdentityGridLevelIntersectionIterator()
    Definition identitygridintersectioniterator.hh:98
    \n
    Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
    Definition identitygridintersectioniterator.hh:29
    \n-
    Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
    Definition identitygridhierarchiciterator.hh:26
    \n-
    unsigned int subEntities(unsigned int codim) const
    Return the number of subEntities of codimension codim.
    Definition identitygridentity.hh:319
    \n-
    IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)
    Definition identitygridentity.hh:243
    \n-
    bool isLeaf() const
    returns true if Entity has NO children
    Definition identitygridentity.hh:367
    \n-
    IdentityGridHierarchicIterator< GridImp > hbegin(int maxLevel) const
    Inter-level access to son elements on higher levels<=maxlevel. This is provided for sparsely stored n...
    Definition identitygridentity.hh:398
    \n-
    GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
    Definition identitygridentity.hh:218
    \n-
    GridImp::template Codim< 0 >::EntitySeed EntitySeed
    The type of the EntitySeed interface class.
    Definition identitygridentity.hh:230
    \n-
    EntitySeed seed() const
    Create EntitySeed.
    Definition identitygridentity.hh:292
    \n-
    IdentityGridLevelIntersectionIterator< GridImp > ilevelbegin() const
    First level intersection.
    Definition identitygridentity.hh:335
    \n-
    IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity &hostEntity)
    Definition identitygridentity.hh:238
    \n-
    int level() const
    Level of this element.
    Definition identitygridentity.hh:298
    \n-
    IdentityGridLeafIntersectionIterator< GridImp > ileafbegin() const
    First leaf intersection.
    Definition identitygridentity.hh:351
    \n-
    HostGridEntity hostEntity_
    Definition identitygridentity.hh:435
    \n-
    IdentityGridEntity & operator=(const IdentityGridEntity &original)
    Definition identitygridentity.hh:260
    \n-
    Geometry geometry() const
    Geometry of this entity.
    Definition identitygridentity.hh:311
    \n-
    IdentityGridLevelIntersectionIterator< GridImp > ilevelend() const
    Reference to one past the last neighbor.
    Definition identitygridentity.hh:343
    \n-
    IdentityGridEntity(const IdentityGridEntity &original)
    Definition identitygridentity.hh:249
    \n-
    IdentityGridHierarchicIterator< GridImp > hend(int maxLevel) const
    Returns iterator to one past the last son.
    Definition identitygridentity.hh:405
    \n-
    IdentityGridLeafIntersectionIterator< GridImp > ileafend() const
    Reference to one past the last leaf intersection.
    Definition identitygridentity.hh:359
    \n-
    bool wasRefined() const
    Definition identitygridentity.hh:412
    \n-
    IdentityGridEntity & operator=(IdentityGridEntity &&original)
    Definition identitygridentity.hh:271
    \n-
    bool hasFather() const
    returns true if father entity exists
    Definition identitygridentity.hh:287
    \n-
    GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Entity HostGridEntity
    Definition identitygridentity.hh:214
    \n-
    GridImp::template Codim< 0 >::Entity father() const
    Definition identitygridentity.hh:374
    \n-
    bool mightBeCoarsened() const
    Definition identitygridentity.hh:424
    \n-
    LocalGeometry geometryInFather() const
    Location of this element relative to the reference element element of the father. This is sufficient ...
    Definition identitygridentity.hh:388
    \n-
    const GridImp * identityGrid_
    Definition identitygridentity.hh:436
    \n-
    GridImp::template Codim< cc >::Entity subEntity(int i) const
    Provide access to sub entity i of given codimension. Entities are numbered 0 ... subEntities(cc)-1.
    Definition identitygridentity.hh:329
    \n-
    IdentityGridEntity(IdentityGridEntity &&original)
    Definition identitygridentity.hh:254
    \n-
    GridImp::template Codim< 0 >::Geometry Geometry
    Definition identitygridentity.hh:216
    \n-
    bool equals(const IdentityGridEntity &other) const
    Definition identitygridentity.hh:281
    \n-
    PartitionType partitionType() const
    The partition type for parallel computing.
    Definition identitygridentity.hh:305
    \n-
    Definition identitygridindexsets.hh:26
    \n-
    Definition identitygridindexsets.hh:96
    \n-
    Definition identitygridindexsets.hh:185
    \n-
    Definition identitygridindexsets.hh:237
    \n-
    Different resources needed by all grid implementations.
    \n+
    bool equals(const IdentityGridLeafIntersectionIterator &other) const
    equality
    Definition identitygridintersectioniterator.hh:54
    \n+
    void increment()
    prefix increment
    Definition identitygridintersectioniterator.hh:60
    \n+
    IdentityGridLeafIntersectionIterator(const GridImp *identityGrid, const HostLeafIntersectionIterator &hostIterator)
    Definition identitygridintersectioniterator.hh:47
    \n+
    Intersection dereference() const
    dereferencing
    Definition identitygridintersectioniterator.hh:65
    \n+
    Dune::Intersection< const GridImp, Dune::IdentityGridLeafIntersection< GridImp > > Intersection
    Definition identitygridintersectioniterator.hh:42
    \n+
    IdentityGridLeafIntersectionIterator()
    Definition identitygridintersectioniterator.hh:44
    \n+
    An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
    Definition identitygridintersections.hh:33
    \n+
    Definition identitygridintersections.hh:192
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,620 +1,208 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridentity.hh\n+identitygridintersectioniterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRIDENTITY_HH\n-6#define DUNE_IDENTITYGRIDENTITY_HH\n+5#ifndef DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH\n+6#define DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH\n 7\n-12#include \n-13\n-14namespace Dune {\n-15\n-16\n-17 // Forward declarations\n+8#include \"identitygridintersections.hh\"\n+9#include \"identitygridentity.hh\"\n+10\n+11#include \n+12\n+17namespace Dune {\n 18\n-19 template\n-20 class IdentityGridEntity;\n-21\n-22 template\n-23 class IdentityGridLevelIterator;\n-24\n-25 template\n-26 class IdentityGridLevelIntersectionIterator;\n-27\n-28 template\n-29 class IdentityGridLeafIntersectionIterator;\n+27 template\n+28 class IdentityGridLeafIntersectionIterator\n+29 {\n 30\n-31 template\n-32 class IdentityGridHierarchicIterator;\n-33\n+31 constexpr static int dim = GridImp::dimension;\n+32\n+33 constexpr static int dimworld = GridImp::dimensionworld;\n 34\n-35 // External forward declarations\n-36 template< class Grid >\n-37 struct HostGridAccess;\n-38\n+35 // The type used to store coordinates\n+36 typedef typename GridImp::ctype ctype;\n+37\n+38 typedef typename GridImp::HostGridType::LeafGridView::IntersectionIterator\n+HostLeafIntersectionIterator;\n 39\n-40 //**********************************************************************\n-41 //\n-42 // --IdentityGridEntity\n-43 // --Entity\n-44 //\n-52 template\n-53 class IdentityGridEntity :\n-54 public EntityDefaultImplementation \n-55 {\n-56\n-57 template \n-58 friend class IdentityGridLevelIndexSet;\n-59\n-60 template \n-61 friend class IdentityGridLeafIndexSet;\n-62\n-63 template \n-64 friend class IdentityGridLocalIdSet;\n-65\n-66 template \n-67 friend class IdentityGridGlobalIdSet;\n+40 public:\n+41\n+42 typedef Dune::Intersection > Intersection;\n+43\n+44 IdentityGridLeafIntersectionIterator()\n+45 {}\n+46\n+47 IdentityGridLeafIntersectionIterator(const GridImp* identityGrid,\n+48 const HostLeafIntersectionIterator& hostIterator)\n+49 : identityGrid_(identityGrid)\n+50 , hostIterator_(hostIterator)\n+51 {}\n+52\n+54 bool equals(const IdentityGridLeafIntersectionIterator& other) const {\n+55 return hostIterator_ == other.hostIterator_;\n+56 }\n+57\n+58\n+60 void increment() {\n+61 ++hostIterator_;\n+62 }\n+63\n+65 Intersection dereference() const {\n+66 return IdentityGridLeafIntersection(identityGrid_,*hostIterator_);\n+67 }\n 68\n-69 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;\n-70\n-71\n-72 private:\n+69 private:\n+70 //**********************************************************\n+71 // private data\n+72 //**********************************************************\n 73\n-74 typedef typename GridImp::ctype ctype;\n-75\n-76 // The codimension of this entity wrt the host grid\n-77 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension -\n-GridImp::dimension + codim;\n+74 const GridImp* identityGrid_ = nullptr;\n+75 HostLeafIntersectionIterator hostIterator_ = {};\n+76 };\n+77\n 78\n-79 // equivalent entity in the host grid\n-80 typedef typename GridImp::HostGridType::Traits::template\n-Codim::Entity HostGridEntity;\n-81\n-82\n-83 public:\n-84\n-85 typedef typename GridImp::template Codim::Geometry Geometry;\n+79\n+80\n+82 template\n+83 class IdentityGridLevelIntersectionIterator\n+84 {\n+85 constexpr static int dim = GridImp::dimension;\n 86\n-88 typedef typename GridImp::template Codim::EntitySeed EntitySeed;\n-89\n-90 IdentityGridEntity()\n-91 : identityGrid_(nullptr)\n-92 {}\n+87 constexpr static int dimworld = GridImp::dimensionworld;\n+88\n+89 // The type used to store coordinates\n+90 typedef typename GridImp::ctype ctype;\n+91\n+92 typedef typename GridImp::HostGridType::LevelGridView::IntersectionIterator\n+HostLevelIntersectionIterator;\n 93\n-94 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity&\n-hostEntity)\n-95 : hostEntity_(hostEntity)\n-96 , identityGrid_(identityGrid)\n-97 {}\n-98\n-99 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&& hostEntity)\n-100 : hostEntity_(std::move(hostEntity))\n-101 , identityGrid_(identityGrid)\n-102 {}\n-103\n-105 IdentityGridEntity(const IdentityGridEntity& original)\n-106 : hostEntity_(original.hostEntity_)\n-107 , identityGrid_(original.identityGrid_)\n-108 {}\n-109\n-110 IdentityGridEntity(IdentityGridEntity&& original)\n-111 : hostEntity_(std::move(original.hostEntity_))\n-112 , identityGrid_(original.identityGrid_)\n-113 {}\n-114\n-116 IdentityGridEntity& operator=(const IdentityGridEntity& original)\n-117 {\n-118 if (this != &original)\n-119 {\n-120 identityGrid_ = original.identityGrid_;\n-121 hostEntity_ = original.hostEntity_;\n-122 }\n-123 return *this;\n-124 }\n+94 public:\n+95\n+96 typedef Dune::Intersection > Intersection;\n+97\n+98 IdentityGridLevelIntersectionIterator()\n+99 {}\n+100\n+101 IdentityGridLevelIntersectionIterator(const GridImp* identityGrid,\n+102 const HostLevelIntersectionIterator& hostIterator)\n+103 : identityGrid_(identityGrid)\n+104 , hostIterator_(hostIterator)\n+105 {}\n+106\n+108 bool equals(const IdentityGridLevelIntersectionIterator& other)\n+const {\n+109 return hostIterator_ == other.hostIterator_;\n+110 }\n+111\n+112\n+114 void increment() {\n+115 ++hostIterator_;\n+116 }\n+117\n+119 Intersection dereference() const {\n+120 return IdentityGridLevelIntersection(identityGrid_,*hostIterator_\n+);\n+121 }\n+122\n+123 private:\n+124\n 125\n-127 IdentityGridEntity& operator=(IdentityGridEntity&& original)\n-128 {\n-129 if (this != &original)\n-130 {\n-131 identityGrid_ = original.identityGrid_;\n-132 hostEntity_ = std::move(original.hostEntity_);\n-133 }\n-134 return *this;\n-135 }\n-136\n-137 bool equals(const IdentityGridEntity& other) const\n-138 {\n-139 return hostEntity_ == other.hostEntity_;\n-140 }\n-141\n-143 bool hasFather () const {\n-144 return hostEntity_.hasFather();\n-145 }\n-146\n-148 EntitySeed seed () const\n-149 {\n-150 return EntitySeed(hostEntity_);\n-151 }\n-152\n-154 int level () const {\n-155 return hostEntity_.level();\n-156 }\n-157\n-158\n-161 PartitionType partitionType () const {\n-162 return hostEntity_.partitionType();\n-163 }\n-164\n-167 unsigned int subEntities (unsigned int cc) const\n-168 {\n-169 return hostEntity_.subEntities(cc);\n-170 }\n-171\n-173 Geometry geometry () const\n-174 {\n-175 return Geometry( hostEntity_.geometry() );\n-176 }\n-177\n-178\n-179 HostGridEntity hostEntity_;\n-180\n-181 private:\n-182\n-183 const GridImp* identityGrid_;\n-184\n-185 };\n-186\n-187\n-188\n-189\n-190 //***********************\n-191 //\n-192 // --IdentityGridEntity\n-193 //\n-194 //***********************\n-202 template\n-203 class IdentityGridEntity<0,dim,GridImp> :\n-204 public EntityDefaultImplementation<0,dim,GridImp, IdentityGridEntity>\n-205 {\n-206 friend struct HostGridAccess< typename std::remove_const< GridImp >::type\n->;\n-207\n-208 public:\n-209\n-210 // The codimension of this entitypointer wrt the host grid\n-211 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension -\n-GridImp::dimension;\n-212\n-213 // equivalent entity in the host grid\n-214 typedef typename GridImp::HostGridType::Traits::template\n-Codim::Entity HostGridEntity;\n-215\n-216 typedef typename GridImp::template Codim<0>::Geometry Geometry;\n-217\n-218 typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;\n-219\n-221 typedef IdentityGridLevelIntersectionIterator\n-LevelIntersectionIterator;\n-222\n-224 typedef IdentityGridLeafIntersectionIterator\n-LeafIntersectionIterator;\n-225\n-227 typedef IdentityGridHierarchicIterator HierarchicIterator;\n-228\n-230 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;\n-231\n-232\n-233\n-234 IdentityGridEntity()\n-235 : identityGrid_(nullptr)\n-236 {}\n-237\n-238 IdentityGridEntity(const GridImp* identityGrid, const HostGridEntity&\n-hostEntity)\n-239 : hostEntity_(hostEntity)\n-240 , identityGrid_(identityGrid)\n-241 {}\n-242\n-243 IdentityGridEntity(const GridImp* identityGrid, HostGridEntity&&\n-hostEntity)\n-244 : hostEntity_(std::move(hostEntity))\n-245 , identityGrid_(identityGrid)\n-246 {}\n-247\n-249 IdentityGridEntity(const IdentityGridEntity& original)\n-250 : hostEntity_(original.hostEntity_)\n-251 , identityGrid_(original.identityGrid_)\n-252 {}\n-253\n-254 IdentityGridEntity(IdentityGridEntity&& original)\n-255 : hostEntity_(std::move(original.hostEntity_))\n-256 , identityGrid_(original.identityGrid_)\n-257 {}\n-258\n-260 IdentityGridEntity& operator=(const IdentityGridEntity& original)\n-261 {\n-262 if (this != &original)\n-263 {\n-264 identityGrid_ = original.identityGrid_;\n-265 hostEntity_ = original.hostEntity_;\n-266 }\n-267 return *this;\n-268 }\n-269\n-271 IdentityGridEntity& operator=(IdentityGridEntity&& original)\n-272 {\n-273 if (this != &original)\n-274 {\n-275 identityGrid_ = original.identityGrid_;\n-276 hostEntity_ = std::move(original.hostEntity_);\n-277 }\n-278 return *this;\n-279 }\n-280\n-281 bool equals(const IdentityGridEntity& other) const\n-282 {\n-283 return hostEntity_ == other.hostEntity_;\n-284 }\n-285\n-287 bool hasFather () const {\n-288 return hostEntity_.hasFather();\n-289 }\n-290\n-292 EntitySeed seed () const\n-293 {\n-294 return EntitySeed(hostEntity_);\n-295 }\n-296\n-298 int level () const\n-299 {\n-300 return hostEntity_.level();\n-301 }\n-302\n-303\n-305 PartitionType partitionType () const {\n-306 return hostEntity_.partitionType();\n-307 }\n-308\n-309\n-311 Geometry geometry () const\n-312 {\n-313 return Geometry( hostEntity_.geometry() );\n-314 }\n-315\n-316\n-319 unsigned int subEntities (unsigned int codim) const\n-320 {\n-321 return hostEntity_.subEntities(codim);\n-322 }\n-323\n-324\n-328 template\n-329 typename GridImp::template Codim::Entity subEntity (int i) const {\n-330 return IdentityGridEntity(identityGrid_,\n-hostEntity_.template subEntity(i));\n-331 }\n-332\n-333\n-335 IdentityGridLevelIntersectionIterator ilevelbegin () const {\n-336 return IdentityGridLevelIntersectionIterator(\n-337 identityGrid_,\n-338 identityGrid_->getHostGrid().levelGridView(level()).ibegin(hostEntity_));\n-339 }\n-340\n-341\n-343 IdentityGridLevelIntersectionIterator ilevelend () const {\n-344 return IdentityGridLevelIntersectionIterator(\n-345 identityGrid_,\n-346 identityGrid_->getHostGrid().levelGridView(level()).iend(hostEntity_));\n-347 }\n-348\n-349\n-351 IdentityGridLeafIntersectionIterator ileafbegin () const {\n-352 return IdentityGridLeafIntersectionIterator(\n-353 identityGrid_,\n-354 identityGrid_->getHostGrid().leafGridView().ibegin(hostEntity_));\n-355 }\n-356\n-357\n-359 IdentityGridLeafIntersectionIterator ileafend () const {\n-360 return IdentityGridLeafIntersectionIterator(\n-361 identityGrid_,\n-362 identityGrid_->getHostGrid().leafGridView().iend(hostEntity_));\n-363 }\n-364\n-365\n-367 bool isLeaf() const {\n-368 return hostEntity_.isLeaf();\n-369 }\n-370\n-371\n-374 typename GridImp::template Codim<0>::Entity father () const {\n-375 return IdentityGridEntity(identityGrid_, hostEntity_.father());\n-376 }\n-377\n-378\n-388 LocalGeometry geometryInFather () const\n-389 {\n-390 return LocalGeometry( hostEntity_.geometryInFather() );\n-391 }\n-392\n-393\n-398 IdentityGridHierarchicIterator hbegin (int maxLevel) const\n-399 {\n-400 return IdentityGridHierarchicIterator(identityGrid_, *this,\n-maxLevel);\n-401 }\n-402\n-403\n-405 IdentityGridHierarchicIterator hend (int maxLevel) const\n-406 {\n-407 return IdentityGridHierarchicIterator(identityGrid_, *this,\n-maxLevel, true);\n-408 }\n-409\n-410\n-412 bool wasRefined () const\n-413 {\n-414 if (identityGrid_->adaptationStep!=GridImp::adaptDone)\n-415 return false;\n-416\n-417 int level = this->level();\n-418 int index = identityGrid_->levelIndexSet(level).index(*this);\n-419 return identityGrid_->refinementMark_[level][index];\n-420 }\n-421\n-422\n-424 bool mightBeCoarsened () const\n-425 {\n-426 return true;\n-427 }\n-428\n-429\n-430 // /////////////////////////////////////////\n-431 // Internal stuff\n-432 // /////////////////////////////////////////\n-433\n-434\n-435 HostGridEntity hostEntity_;\n-436 const GridImp* identityGrid_;\n-437\n-438 private:\n-439\n-440 typedef typename GridImp::ctype ctype;\n-441\n-442 }; // end of IdentityGridEntity codim = 0\n-443\n-444\n-445} // namespace Dune\n-446\n-447\n-448#endif\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-std\n-STL namespace.\n+126 const GridImp* identityGrid_ = nullptr;\n+127 HostLevelIntersectionIterator hostIterator_ = {};\n+128\n+129 };\n+130\n+131\n+132} // namespace Dune\n+133\n+134#endif\n+identitygridentity.hh\n+The IdentityGridEntity class.\n+identitygridintersections.hh\n+The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::EntityDefaultImplementation\n-Default Implementations for EntityImp.\n-Definition common/entity.hh:542\n-Dune::EntityDefaultImplementation<_codim,_dim,_GridImp,_IdentityGridEntity_>::\n-type\n-GeometryType type() const\n-Return the name of the reference element. The type can be used to access the\n-Dune::ReferenceElement.\n-Definition common/entity.hh:576\n-Dune::HostGridAccess\n-provides access to host grid objects from GeometryGrid\n-Definition identitygrid.hh:37\n-Dune::IdentityGridEntity\n-The implementation of entities in a IdentityGrid.\n-Definition identitygridentity.hh:55\n-Dune::IdentityGridEntity::IdentityGridEntity\n-IdentityGridEntity()\n-Definition identitygridentity.hh:90\n-Dune::IdentityGridEntity::operator=\n-IdentityGridEntity & operator=(IdentityGridEntity &&original)\n-Definition identitygridentity.hh:127\n-Dune::IdentityGridEntity::IdentityGridEntity\n-IdentityGridEntity(IdentityGridEntity &&original)\n-Definition identitygridentity.hh:110\n-Dune::IdentityGridEntity::equals\n-bool equals(const IdentityGridEntity &other) const\n-Definition identitygridentity.hh:137\n-Dune::IdentityGridEntity::hostEntity_\n-HostGridEntity hostEntity_\n-Definition identitygridentity.hh:179\n-Dune::IdentityGridEntity::EntitySeed\n-GridImp::template Codim< codim >::EntitySeed EntitySeed\n-The type of the EntitySeed interface class.\n-Definition identitygridentity.hh:88\n-Dune::IdentityGridEntity::seed\n-EntitySeed seed() const\n-Create EntitySeed.\n-Definition identitygridentity.hh:148\n-Dune::IdentityGridEntity::IdentityGridEntity\n-IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity\n-&hostEntity)\n-Definition identitygridentity.hh:94\n-Dune::IdentityGridEntity::geometry\n-Geometry geometry() const\n-geometry of this entity\n-Definition identitygridentity.hh:173\n-Dune::IdentityGridEntity::partitionType\n-PartitionType partitionType() const\n-The partition type for parallel computing.\n-Definition identitygridentity.hh:161\n-Dune::IdentityGridEntity::subEntities\n-unsigned int subEntities(unsigned int cc) const\n-Return the number of subEntities of codimension codim.\n-Definition identitygridentity.hh:167\n-Dune::IdentityGridEntity::IdentityGridEntity\n-IdentityGridEntity(const IdentityGridEntity &original)\n-Definition identitygridentity.hh:105\n-Dune::IdentityGridEntity::IdentityGridEntity\n-IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)\n-Definition identitygridentity.hh:99\n-Dune::IdentityGridEntity::hasFather\n-bool hasFather() const\n-returns true if father entity exists\n-Definition identitygridentity.hh:143\n-Dune::IdentityGridEntity::Geometry\n-GridImp::template Codim< codim >::Geometry Geometry\n-Definition identitygridentity.hh:85\n-Dune::IdentityGridEntity::operator=\n-IdentityGridEntity & operator=(const IdentityGridEntity &original)\n-Definition identitygridentity.hh:116\n-Dune::IdentityGridEntity::level\n-int level() const\n-level of this element\n-Definition identitygridentity.hh:154\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n Dune::IdentityGridLevelIntersectionIterator\n Definition identitygridintersectioniterator.hh:84\n+Dune::IdentityGridLevelIntersectionIterator::equals\n+bool equals(const IdentityGridLevelIntersectionIterator< GridImp > &other)\n+const\n+equality\n+Definition identitygridintersectioniterator.hh:108\n+Dune::IdentityGridLevelIntersectionIterator::increment\n+void increment()\n+prefix increment\n+Definition identitygridintersectioniterator.hh:114\n+Dune::IdentityGridLevelIntersectionIterator::\n+IdentityGridLevelIntersectionIterator\n+IdentityGridLevelIntersectionIterator(const GridImp *identityGrid, const\n+HostLevelIntersectionIterator &hostIterator)\n+Definition identitygridintersectioniterator.hh:101\n+Dune::IdentityGridLevelIntersectionIterator::Intersection\n+Dune::Intersection< const GridImp, Dune::IdentityGridLevelIntersection< GridImp\n+> > Intersection\n+Definition identitygridintersectioniterator.hh:96\n+Dune::IdentityGridLevelIntersectionIterator::dereference\n+Intersection dereference() const\n+dereferencing\n+Definition identitygridintersectioniterator.hh:119\n+Dune::IdentityGridLevelIntersectionIterator::\n+IdentityGridLevelIntersectionIterator\n+IdentityGridLevelIntersectionIterator()\n+Definition identitygridintersectioniterator.hh:98\n Dune::IdentityGridLeafIntersectionIterator\n Iterator over all element neighborsMesh entities of codimension 0 (\"elements\")\n allow to visit all nei...\n Definition identitygridintersectioniterator.hh:29\n-Dune::IdentityGridHierarchicIterator\n-Iterator over the descendants of an entity.Mesh entities of codimension 0\n-(\"elements\") allow to visit...\n-Definition identitygridhierarchiciterator.hh:26\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::subEntities\n-unsigned int subEntities(unsigned int codim) const\n-Return the number of subEntities of codimension codim.\n-Definition identitygridentity.hh:319\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n-IdentityGridEntity(const GridImp *identityGrid, HostGridEntity &&hostEntity)\n-Definition identitygridentity.hh:243\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::isLeaf\n-bool isLeaf() const\n-returns true if Entity has NO children\n-Definition identitygridentity.hh:367\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hbegin\n-IdentityGridHierarchicIterator< GridImp > hbegin(int maxLevel) const\n-Inter-level access to son elements on higher levels<=maxlevel. This is provided\n-for sparsely stored n...\n-Definition identitygridentity.hh:398\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::LocalGeometry\n-GridImp::template Codim< 0 >::LocalGeometry LocalGeometry\n-Definition identitygridentity.hh:218\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::EntitySeed\n-GridImp::template Codim< 0 >::EntitySeed EntitySeed\n-The type of the EntitySeed interface class.\n-Definition identitygridentity.hh:230\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::seed\n-EntitySeed seed() const\n-Create EntitySeed.\n-Definition identitygridentity.hh:292\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ilevelbegin\n-IdentityGridLevelIntersectionIterator< GridImp > ilevelbegin() const\n-First level intersection.\n-Definition identitygridentity.hh:335\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n-IdentityGridEntity(const GridImp *identityGrid, const HostGridEntity\n-&hostEntity)\n-Definition identitygridentity.hh:238\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::level\n-int level() const\n-Level of this element.\n-Definition identitygridentity.hh:298\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ileafbegin\n-IdentityGridLeafIntersectionIterator< GridImp > ileafbegin() const\n-First leaf intersection.\n-Definition identitygridentity.hh:351\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hostEntity_\n-HostGridEntity hostEntity_\n-Definition identitygridentity.hh:435\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::operator=\n-IdentityGridEntity & operator=(const IdentityGridEntity &original)\n-Definition identitygridentity.hh:260\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::geometry\n-Geometry geometry() const\n-Geometry of this entity.\n-Definition identitygridentity.hh:311\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ilevelend\n-IdentityGridLevelIntersectionIterator< GridImp > ilevelend() const\n-Reference to one past the last neighbor.\n-Definition identitygridentity.hh:343\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n-IdentityGridEntity(const IdentityGridEntity &original)\n-Definition identitygridentity.hh:249\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hend\n-IdentityGridHierarchicIterator< GridImp > hend(int maxLevel) const\n-Returns iterator to one past the last son.\n-Definition identitygridentity.hh:405\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::ileafend\n-IdentityGridLeafIntersectionIterator< GridImp > ileafend() const\n-Reference to one past the last leaf intersection.\n-Definition identitygridentity.hh:359\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::wasRefined\n-bool wasRefined() const\n-Definition identitygridentity.hh:412\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::operator=\n-IdentityGridEntity & operator=(IdentityGridEntity &&original)\n-Definition identitygridentity.hh:271\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::hasFather\n-bool hasFather() const\n-returns true if father entity exists\n-Definition identitygridentity.hh:287\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::HostGridEntity\n-GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Entity\n-HostGridEntity\n-Definition identitygridentity.hh:214\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::father\n-GridImp::template Codim< 0 >::Entity father() const\n-Definition identitygridentity.hh:374\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::mightBeCoarsened\n-bool mightBeCoarsened() const\n-Definition identitygridentity.hh:424\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::geometryInFather\n-LocalGeometry geometryInFather() const\n-Location of this element relative to the reference element element of the\n-father. This is sufficient ...\n-Definition identitygridentity.hh:388\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::identityGrid_\n-const GridImp * identityGrid_\n-Definition identitygridentity.hh:436\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::subEntity\n-GridImp::template Codim< cc >::Entity subEntity(int i) const\n-Provide access to sub entity i of given codimension. Entities are numbered 0\n-... subEntities(cc)-1.\n-Definition identitygridentity.hh:329\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::IdentityGridEntity\n-IdentityGridEntity(IdentityGridEntity &&original)\n-Definition identitygridentity.hh:254\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::Geometry\n-GridImp::template Codim< 0 >::Geometry Geometry\n-Definition identitygridentity.hh:216\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::equals\n-bool equals(const IdentityGridEntity &other) const\n-Definition identitygridentity.hh:281\n-Dune::IdentityGridEntity<_0,_dim,_GridImp_>::partitionType\n-PartitionType partitionType() const\n-The partition type for parallel computing.\n-Definition identitygridentity.hh:305\n-Dune::IdentityGridLevelIndexSet\n-Definition identitygridindexsets.hh:26\n-Dune::IdentityGridLeafIndexSet\n-Definition identitygridindexsets.hh:96\n-Dune::IdentityGridGlobalIdSet\n-Definition identitygridindexsets.hh:185\n-Dune::IdentityGridLocalIdSet\n-Definition identitygridindexsets.hh:237\n-grid.hh\n-Different resources needed by all grid implementations.\n+Dune::IdentityGridLeafIntersectionIterator::equals\n+bool equals(const IdentityGridLeafIntersectionIterator &other) const\n+equality\n+Definition identitygridintersectioniterator.hh:54\n+Dune::IdentityGridLeafIntersectionIterator::increment\n+void increment()\n+prefix increment\n+Definition identitygridintersectioniterator.hh:60\n+Dune::IdentityGridLeafIntersectionIterator::\n+IdentityGridLeafIntersectionIterator\n+IdentityGridLeafIntersectionIterator(const GridImp *identityGrid, const\n+HostLeafIntersectionIterator &hostIterator)\n+Definition identitygridintersectioniterator.hh:47\n+Dune::IdentityGridLeafIntersectionIterator::dereference\n+Intersection dereference() const\n+dereferencing\n+Definition identitygridintersectioniterator.hh:65\n+Dune::IdentityGridLeafIntersectionIterator::Intersection\n+Dune::Intersection< const GridImp, Dune::IdentityGridLeafIntersection< GridImp\n+> > Intersection\n+Definition identitygridintersectioniterator.hh:42\n+Dune::IdentityGridLeafIntersectionIterator::\n+IdentityGridLeafIntersectionIterator\n+IdentityGridLeafIntersectionIterator()\n+Definition identitygridintersectioniterator.hh:44\n+Dune::IdentityGridLeafIntersection\n+An intersection with a leaf neighbor elementMesh entities of codimension 0\n+(\"elements\") allow to visi...\n+Definition identitygridintersections.hh:33\n+Dune::IdentityGridLevelIntersection\n+Definition identitygridintersections.hh:192\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00743.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00743.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridhierarchiciterator.hh File Reference\n+dune-grid: identitygridleafiterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,38 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n \n
    \n \n-
    identitygridhierarchiciterator.hh File Reference
    \n+
    identitygridleafiterator.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridHierarchicIterator class. \n+

    The IdentityGridLeafIterator class. \n More...

    \n-\n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdentityGridHierarchicIterator< GridImp >
     Iterator over the descendants of an entity.Mesh entities of codimension 0 (\"elements\") allow to visit all entities of codimension 0 obtained through nested, hierarchic refinement of the entity. Iteration over this set of entities is provided by the HierarchicIterator, starting from a given entity. More...
    class  Dune::IdentityGridLeafIterator< codim, pitype, GridImp >
     Iterator over all entities of a given codimension and level of a grid. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridHierarchicIterator class.

    \n+

    The IdentityGridLeafIterator class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,24 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridhierarchiciterator.hh File Reference\n-The IdentityGridHierarchicIterator class. More...\n+identitygridleafiterator.hh File Reference\n+The IdentityGridLeafIterator class. More...\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridHierarchicIterator<_GridImp_>\n- Iterator over the descendants of an entity.Mesh entities of codimension\n- 0 (\"elements\") allow to visit all entities of codimension 0 obtained\n-\u00a0 through nested, hierarchic refinement of the entity. Iteration over\n- this set of entities is provided by the HierarchicIterator, starting\n- from a given entity. More...\n+class \u00a0 Dune::IdentityGridLeafIterator<_codim,_pitype,_GridImp_>\n+\u00a0 Iterator over all entities of a given codimension and level of a grid.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridHierarchicIterator class.\n+The IdentityGridLeafIterator class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00743_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00743_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridhierarchiciterator.hh Source File\n+dune-grid: identitygridleafiterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,99 +74,100 @@\n \n \n
    \n
    \n-
    identitygridhierarchiciterator.hh
    \n+
    identitygridleafiterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRIDHIERITERATOR_HH
    \n-
    6#define DUNE_IDENTITYGRIDHIERITERATOR_HH
    \n+
    5#ifndef DUNE_IDENTITYGRIDLEAFITERATOR_HH
    \n+
    6#define DUNE_IDENTITYGRIDLEAFITERATOR_HH
    \n
    7
    \n-
    12namespace Dune {
    \n-
    13
    \n-
    14
    \n-
    15 //**********************************************************************
    \n-
    16 //
    \n-
    24 template<class GridImp>
    \n-
    \n-\n-
    26 {
    \n+\n+
    9
    \n+
    14namespace Dune {
    \n+
    15
    \n+
    16
    \n+
    20 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n+
    \n+\n+
    22 {
    \n+
    23 private:
    \n+
    24
    \n+
    25 // LevelIterator to the equivalent entity in the host grid
    \n+
    26 typedef typename GridImp::HostGridType::template Codim<codim>::template Partition<pitype>::LeafIterator HostGridLeafIterator;
    \n
    27
    \n-
    28 // Type of the corresponding HierarchicIterator in the host grid
    \n-
    29 typedef typename GridImp::HostGridType::template Codim<0>::Entity::HierarchicIterator HostGridHierarchicIterator;
    \n-
    30
    \n-
    31 public:
    \n-
    32
    \n-
    33 constexpr static int codimension = 0;
    \n-
    34
    \n-
    35 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    36
    \n-
    \n-
    38 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const Entity& startEntity, int maxLevel) :
    \n-
    39 identityGrid_(identityGrid),
    \n-
    40 hostHierarchicIterator_(startEntity.impl().hostEntity_.hbegin(maxLevel))
    \n-
    41 {}
    \n-
    \n-
    42
    \n-
    43
    \n-
    \n-
    45 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const Entity& startEntity, int maxLevel, [[maybe_unused]] bool endDummy) :
    \n-
    46 identityGrid_(identityGrid),
    \n-
    47 hostHierarchicIterator_(startEntity.impl().hostEntity_.hend(maxLevel))
    \n-
    48 {}
    \n+
    28 public:
    \n+
    29
    \n+
    30 constexpr static int codimension = codim;
    \n+
    31
    \n+
    32 typedef typename GridImp::template Codim<codim>::Entity Entity;
    \n+
    33
    \n+
    \n+
    35 explicit IdentityGridLeafIterator(const GridImp* identityGrid) :
    \n+
    36 identityGrid_(identityGrid),
    \n+
    37 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template begin<codim,pitype>())
    \n+
    38 {}
    \n+
    \n+
    39
    \n+
    \n+
    44 explicit IdentityGridLeafIterator(const GridImp* identityGrid, [[maybe_unused]] bool endDummy) :
    \n+
    45 identityGrid_(identityGrid),
    \n+
    46 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template end<codim,pitype>())
    \n+
    47 {}
    \n
    \n+
    48
    \n
    49
    \n-
    50
    \n-
    \n-
    52 void increment()
    \n-
    53 {
    \n-
    54 ++hostHierarchicIterator_;
    \n-
    55 }
    \n-
    \n-
    56
    \n-
    \n-\n-
    59 return Entity{{identityGrid_,*hostHierarchicIterator_}};
    \n-
    60 }
    \n-
    \n-
    61
    \n-
    \n-\n-
    64 return hostHierarchicIterator_ == i.hostHierarchicIterator_;
    \n-
    65 }
    \n-
    \n-
    66
    \n-
    67 private:
    \n-
    68 const GridImp* identityGrid_;
    \n+
    \n+
    51 void increment() {
    \n+
    52 ++hostLeafIterator_;
    \n+
    53 }
    \n+
    \n+
    54
    \n+
    \n+\n+
    57 return Entity{{identityGrid_,*hostLeafIterator_}};
    \n+
    58 }
    \n+
    \n+
    59
    \n+
    \n+
    61 bool equals(const IdentityGridLeafIterator& i) const {
    \n+
    62 return hostLeafIterator_ == i.hostLeafIterator_;
    \n+
    63 }
    \n+
    \n+
    64
    \n+
    65 private:
    \n+
    66 const GridImp* identityGrid_;
    \n+
    67
    \n+
    68 HostGridLeafIterator hostLeafIterator_;
    \n
    69
    \n-
    70 HostGridHierarchicIterator hostHierarchicIterator_;
    \n-
    71
    \n-
    72 };
    \n+
    70 };
    \n
    \n-
    73
    \n+
    71
    \n+
    72
    \n+
    73} // namespace Dune
    \n
    74
    \n-
    75} // end namespace Dune
    \n-
    76
    \n-
    77#endif
    \n+
    75#endif
    \n+\n+
    Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
    leaf grid view for the given grid
    Definition common/grid.hh:805
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
    Definition identitygridhierarchiciterator.hh:26
    \n-
    void increment()
    Definition identitygridhierarchiciterator.hh:52
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition identitygridhierarchiciterator.hh:35
    \n-
    bool equals(const IdentityGridHierarchicIterator &i) const
    equality
    Definition identitygridhierarchiciterator.hh:63
    \n-
    static constexpr int codimension
    Definition identitygridhierarchiciterator.hh:33
    \n-
    IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity &startEntity, int maxLevel, bool endDummy)
    Definition identitygridhierarchiciterator.hh:45
    \n-
    Entity dereference() const
    dereferencing
    Definition identitygridhierarchiciterator.hh:58
    \n-
    IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity &startEntity, int maxLevel)
    the default Constructor
    Definition identitygridhierarchiciterator.hh:38
    \n+
    Iterator over all entities of a given codimension and level of a grid.
    Definition identitygridleafiterator.hh:22
    \n+
    Entity dereference() const
    dereferencing
    Definition identitygridleafiterator.hh:56
    \n+
    bool equals(const IdentityGridLeafIterator &i) const
    equality
    Definition identitygridleafiterator.hh:61
    \n+
    IdentityGridLeafIterator(const GridImp *identityGrid, bool endDummy)
    Constructor which create the end iterator.
    Definition identitygridleafiterator.hh:44
    \n+
    static constexpr int codimension
    Definition identitygridleafiterator.hh:30
    \n+
    GridImp::template Codim< codim >::Entity Entity
    Definition identitygridleafiterator.hh:32
    \n+
    IdentityGridLeafIterator(const GridImp *identityGrid)
    Definition identitygridleafiterator.hh:35
    \n+
    void increment()
    prefix increment
    Definition identitygridleafiterator.hh:51
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,109 +1,113 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridhierarchiciterator.hh\n+identitygridleafiterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRIDHIERITERATOR_HH\n-6#define DUNE_IDENTITYGRIDHIERITERATOR_HH\n+5#ifndef DUNE_IDENTITYGRIDLEAFITERATOR_HH\n+6#define DUNE_IDENTITYGRIDLEAFITERATOR_HH\n 7\n-12namespace Dune {\n-13\n-14\n-15 //**********************************************************************\n-16 //\n-24 template\n-25 class IdentityGridHierarchicIterator\n-26 {\n+8#include \n+9\n+14namespace Dune {\n+15\n+16\n+20 template\n+21 class IdentityGridLeafIterator\n+22 {\n+23 private:\n+24\n+25 // LevelIterator to the equivalent entity in the host grid\n+26 typedef typename GridImp::HostGridType::template Codim::template\n+Partition::LeafIterator HostGridLeafIterator;\n 27\n-28 // Type of the corresponding HierarchicIterator in the host grid\n-29 typedef typename GridImp::HostGridType::template Codim<0>::Entity::\n-HierarchicIterator HostGridHierarchicIterator;\n-30\n-31 public:\n-32\n-33 constexpr static int codimension = 0;\n-34\n-35 typedef typename GridImp::template Codim<0>::Entity Entity;\n-36\n-38 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const\n-Entity& startEntity, int maxLevel) :\n-39 identityGrid_(identityGrid),\n-40 hostHierarchicIterator_(startEntity.impl().hostEntity_.hbegin(maxLevel))\n-41 {}\n-42\n-43\n-45 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const\n-Entity& startEntity, int maxLevel, [[maybe_unused]] bool endDummy) :\n-46 identityGrid_(identityGrid),\n-47 hostHierarchicIterator_(startEntity.impl().hostEntity_.hend(maxLevel))\n-48 {}\n+28 public:\n+29\n+30 constexpr static int codimension = codim;\n+31\n+32 typedef typename GridImp::template Codim::Entity Entity;\n+33\n+35 explicit IdentityGridLeafIterator(const GridImp* identityGrid) :\n+36 identityGrid_(identityGrid),\n+37 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template\n+begin())\n+38 {}\n+39\n+44 explicit IdentityGridLeafIterator(const GridImp* identityGrid, [[maybe_\n+unused]] bool endDummy) :\n+45 identityGrid_(identityGrid),\n+46 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template\n+end())\n+47 {}\n+48\n 49\n-50\n-52 void increment()\n-53 {\n-54 ++hostHierarchicIterator_;\n-55 }\n-56\n-58 Entity dereference() const {\n-59 return Entity{{identityGrid_,*hostHierarchicIterator_}};\n-60 }\n-61\n-63 bool equals(const IdentityGridHierarchicIterator& i) const {\n-64 return hostHierarchicIterator_ == i.hostHierarchicIterator_;\n-65 }\n-66\n-67 private:\n-68 const GridImp* identityGrid_;\n+51 void increment() {\n+52 ++hostLeafIterator_;\n+53 }\n+54\n+56 Entity dereference() const {\n+57 return Entity{{identityGrid_,*hostLeafIterator_}};\n+58 }\n+59\n+61 bool equals(const IdentityGridLeafIterator& i) const {\n+62 return hostLeafIterator_ == i.hostLeafIterator_;\n+63 }\n+64\n+65 private:\n+66 const GridImp* identityGrid_;\n+67\n+68 HostGridLeafIterator hostLeafIterator_;\n 69\n-70 HostGridHierarchicIterator hostHierarchicIterator_;\n+70 };\n 71\n-72 };\n-73\n+72\n+73} // namespace Dune\n 74\n-75} // end namespace Dune\n-76\n-77#endif\n+75#endif\n+gridenums.hh\n+Dune::leafGridView\n+Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid<\n+dim, dimworld, ct, GridFamily > &grid)\n+leaf grid view for the given grid\n+Definition common/grid.hh:805\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IdentityGridHierarchicIterator\n-Iterator over the descendants of an entity.Mesh entities of codimension 0\n-(\"elements\") allow to visit...\n-Definition identitygridhierarchiciterator.hh:26\n-Dune::IdentityGridHierarchicIterator::increment\n-void increment()\n-Definition identitygridhierarchiciterator.hh:52\n-Dune::IdentityGridHierarchicIterator::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Definition identitygridhierarchiciterator.hh:35\n-Dune::IdentityGridHierarchicIterator::equals\n-bool equals(const IdentityGridHierarchicIterator &i) const\n-equality\n-Definition identitygridhierarchiciterator.hh:63\n-Dune::IdentityGridHierarchicIterator::codimension\n-static constexpr int codimension\n-Definition identitygridhierarchiciterator.hh:33\n-Dune::IdentityGridHierarchicIterator::IdentityGridHierarchicIterator\n-IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity\n-&startEntity, int maxLevel, bool endDummy)\n-Definition identitygridhierarchiciterator.hh:45\n-Dune::IdentityGridHierarchicIterator::dereference\n+Dune::IdentityGridLeafIterator\n+Iterator over all entities of a given codimension and level of a grid.\n+Definition identitygridleafiterator.hh:22\n+Dune::IdentityGridLeafIterator::dereference\n Entity dereference() const\n dereferencing\n-Definition identitygridhierarchiciterator.hh:58\n-Dune::IdentityGridHierarchicIterator::IdentityGridHierarchicIterator\n-IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity\n-&startEntity, int maxLevel)\n-the default Constructor\n-Definition identitygridhierarchiciterator.hh:38\n+Definition identitygridleafiterator.hh:56\n+Dune::IdentityGridLeafIterator::equals\n+bool equals(const IdentityGridLeafIterator &i) const\n+equality\n+Definition identitygridleafiterator.hh:61\n+Dune::IdentityGridLeafIterator::IdentityGridLeafIterator\n+IdentityGridLeafIterator(const GridImp *identityGrid, bool endDummy)\n+Constructor which create the end iterator.\n+Definition identitygridleafiterator.hh:44\n+Dune::IdentityGridLeafIterator::codimension\n+static constexpr int codimension\n+Definition identitygridleafiterator.hh:30\n+Dune::IdentityGridLeafIterator::Entity\n+GridImp::template Codim< codim >::Entity Entity\n+Definition identitygridleafiterator.hh:32\n+Dune::IdentityGridLeafIterator::IdentityGridLeafIterator\n+IdentityGridLeafIterator(const GridImp *identityGrid)\n+Definition identitygridleafiterator.hh:35\n+Dune::IdentityGridLeafIterator::increment\n+void increment()\n+prefix increment\n+Definition identitygridleafiterator.hh:51\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00746.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00746.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridintersectioniterator.hh File Reference\n+dune-grid: identitygridindexsets.hh File Reference\n \n \n \n \n \n \n \n@@ -72,42 +72,44 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n
    \n
    \n \n-
    identitygridintersectioniterator.hh File Reference
    \n+
    identitygridindexsets.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes. \n+

    The index and id sets for the IdentityGrid class. \n More...

    \n-
    #include "identitygridintersections.hh"
    \n-#include "identitygridentity.hh"
    \n-#include <dune/grid/common/intersection.hh>
    \n+
    #include <dune/grid/common/indexidset.hh>
    \n+#include <vector>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdentityGridLeafIntersectionIterator< GridImp >
     Iterator over all element neighborsMesh entities of codimension 0 (\"elements\") allow to visit all neighbors, where a neighbor is an entity of codimension 0 which has a common entity of codimension 1 These neighbors are accessed via a IntersectionIterator. This allows the implement non-matching meshes. The number of neighbors may be different from the number of an element! More...
    class  Dune::IdentityGridLevelIndexSet< GridImp >
     
    class  Dune::IdentityGridLevelIntersectionIterator< GridImp >
    class  Dune::IdentityGridLeafIndexSet< GridImp >
     
    class  Dune::IdentityGridGlobalIdSet< GridImp >
     
    class  Dune::IdentityGridLocalIdSet< GridImp >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes.

    \n+

    The index and id sets for the IdentityGrid class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,34 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridintersectioniterator.hh File Reference\n-The IdentityGridLeafIntersectionIterator and\n-IdentityGridLevelIntersectionIterator classes. More...\n-#include \"identitygridintersections.hh\"\n-#include \"identitygridentity.hh\"\n-#include \n+identitygridindexsets.hh File Reference\n+The index and id sets for the IdentityGrid class. More...\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridLeafIntersectionIterator<_GridImp_>\n- Iterator over all element neighborsMesh entities of codimension 0\n- (\"elements\") allow to visit all neighbors, where a neighbor is an\n-\u00a0 entity of codimension 0 which has a common entity of codimension 1\n- These neighbors are accessed via a IntersectionIterator. This allows\n- the implement non-matching meshes. The number of neighbors may be\n- different from the number of an element! More...\n+class \u00a0 Dune::IdentityGridLevelIndexSet<_GridImp_>\n \u00a0\n-class \u00a0 Dune::IdentityGridLevelIntersectionIterator<_GridImp_>\n+class \u00a0 Dune::IdentityGridLeafIndexSet<_GridImp_>\n+\u00a0\n+class \u00a0 Dune::IdentityGridGlobalIdSet<_GridImp_>\n+\u00a0\n+class \u00a0 Dune::IdentityGridLocalIdSet<_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridLeafIntersectionIterator and\n-IdentityGridLevelIntersectionIterator classes.\n+The index and id sets for the IdentityGrid class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00746_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00746_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridintersectioniterator.hh Source File\n+dune-grid: identitygridindexsets.hh Source File\n \n \n \n \n \n \n \n@@ -74,177 +74,364 @@\n \n \n
    \n
    \n-
    identitygridintersectioniterator.hh
    \n+
    identitygridindexsets.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
    \n-
    6#define DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
    \n+
    5#ifndef DUNE_IDENTITYGRID_INDEXSETS_HH
    \n+
    6#define DUNE_IDENTITYGRID_INDEXSETS_HH
    \n
    7
    \n-\n-\n-
    10
    \n-\n-
    12
    \n-
    17namespace Dune {
    \n-
    18
    \n-
    27 template<class GridImp>
    \n-
    \n-\n-
    29 {
    \n-
    30
    \n-
    31 constexpr static int dim = GridImp::dimension;
    \n-
    32
    \n-
    33 constexpr static int dimworld = GridImp::dimensionworld;
    \n-
    34
    \n-
    35 // The type used to store coordinates
    \n-
    36 typedef typename GridImp::ctype ctype;
    \n-
    37
    \n-
    38 typedef typename GridImp::HostGridType::LeafGridView::IntersectionIterator HostLeafIntersectionIterator;
    \n-
    39
    \n-
    40 public:
    \n+\n+
    13
    \n+
    14#include <vector>
    \n+
    15
    \n+
    16namespace Dune {
    \n+
    17
    \n+
    19 template<class GridImp>
    \n+
    \n+\n+
    21 public IndexSet<GridImp,
    \n+
    22 IdentityGridLevelIndexSet<GridImp>,
    \n+
    23 typename std::remove_const<GridImp>::type::HostGridType::LevelGridView::IndexSet::IndexType,
    \n+
    24 typename std::remove_const<GridImp>::type::HostGridType::LevelGridView::IndexSet::Types
    \n+
    25 >
    \n+
    26 {
    \n+
    27 public:
    \n+
    28
    \n+
    29 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n+
    30 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;
    \n+
    31
    \n+
    32 constexpr static int dim = GridImp::dimension;
    \n+
    33
    \n+
    35 template<int codim>
    \n+
    \n+
    36 int index (const typename GridImp::Traits::template Codim<codim>::Entity& e) const
    \n+
    37 {
    \n+
    38 return grid_->hostgrid_->levelIndexSet(level_).template index<codim>(grid_->template getHostEntity<codim>(e));
    \n+
    39 }
    \n+
    \n+
    40
    \n
    41
    \n-\n-
    43
    \n+
    43 template<int cc>
    \n
    \n-\n-
    45 {}
    \n+
    44 int subIndex (const typename GridImp::Traits::template Codim<cc>::Entity& e, int i, int codim) const
    \n+
    45 {
    \n+
    46 return grid_->hostgrid_->levelIndexSet(level_).subIndex(grid_->template getHostEntity<cc>(e), i, codim);
    \n+
    47 }
    \n+
    \n+
    48
    \n+
    49
    \n+
    \n+
    51 std::size_t size (int codim) const {
    \n+
    52 return grid_->hostgrid_->levelIndexSet(level_).size(codim);
    \n+
    53 }
    \n+
    \n+
    54
    \n+
    55
    \n+
    \n+
    57 std::size_t size (GeometryType type) const
    \n+
    58 {
    \n+
    59 return grid_->hostgrid_->levelIndexSet(level_).size(type);
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    \n+
    63 Types types (int codim) const
    \n+
    64 {
    \n+
    65 return grid_->hostgrid_->levelIndexSet(level_).types(codim);
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    69 template<class EntityType>
    \n+
    \n+
    70 bool contains (const EntityType& e) const
    \n+
    71 {
    \n+
    72 return grid_->hostgrid_->levelIndexSet(level_).contains(grid_->template getHostEntity<EntityType::codimension>(e));
    \n+
    73 }
    \n+
    \n+
    74
    \n+
    \n+
    76 void update(const GridImp& grid, int level)
    \n+
    77 {
    \n+
    78 grid_ = &grid;
    \n+
    79 level_ = level;
    \n+
    80 }
    \n+
    \n+
    81
    \n+
    82
    \n+
    83 GridImp* grid_;
    \n+
    84
    \n+
    85 int level_;
    \n+
    86 };
    \n
    \n-
    46
    \n-
    \n-
    47 IdentityGridLeafIntersectionIterator(const GridImp* identityGrid,
    \n-
    48 const HostLeafIntersectionIterator& hostIterator)
    \n-
    49 : identityGrid_(identityGrid)
    \n-
    50 , hostIterator_(hostIterator)
    \n-
    51 {}
    \n-
    \n-
    52
    \n-
    \n-\n-
    55 return hostIterator_ == other.hostIterator_;
    \n-
    56 }
    \n-
    \n-
    57
    \n-
    58
    \n-
    \n-
    60 void increment() {
    \n-
    61 ++hostIterator_;
    \n-
    62 }
    \n-
    \n-
    63
    \n-
    \n-\n-
    66 return IdentityGridLeafIntersection<GridImp>(identityGrid_,*hostIterator_);
    \n-
    67 }
    \n-
    \n-
    68
    \n-
    69 private:
    \n-
    70 //**********************************************************
    \n-
    71 // private data
    \n-
    72 //**********************************************************
    \n-
    73
    \n-
    74 const GridImp* identityGrid_ = nullptr;
    \n-
    75 HostLeafIntersectionIterator hostIterator_ = {};
    \n-
    76 };
    \n-
    \n-
    77
    \n-
    78
    \n-
    79
    \n-
    80
    \n-
    82 template<class GridImp>
    \n-
    \n-\n-
    84 {
    \n-
    85 constexpr static int dim = GridImp::dimension;
    \n-
    86
    \n-
    87 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    87
    \n
    88
    \n-
    89 // The type used to store coordinates
    \n-
    90 typedef typename GridImp::ctype ctype;
    \n-
    91
    \n-
    92 typedef typename GridImp::HostGridType::LevelGridView::IntersectionIterator HostLevelIntersectionIterator;
    \n-
    93
    \n-
    94 public:
    \n-
    95
    \n-\n-
    97
    \n-\n+
    89 template<class GridImp>
    \n+
    \n+\n+
    91 public IndexSet<GridImp,
    \n+
    92 IdentityGridLeafIndexSet<GridImp>,
    \n+
    93 typename std::remove_const<GridImp>::type::HostGridType::LeafGridView::IndexSet::IndexType,
    \n+
    94 typename std::remove_const<GridImp>::type::HostGridType::LeafGridView::IndexSet::Types
    \n+
    95 >
    \n+
    96 {
    \n+
    97 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n+
    98
    \n+
    99 public:
    \n
    100
    \n-
    \n-
    101 IdentityGridLevelIntersectionIterator(const GridImp* identityGrid,
    \n-
    102 const HostLevelIntersectionIterator& hostIterator)
    \n-
    103 : identityGrid_(identityGrid)
    \n-
    104 , hostIterator_(hostIterator)
    \n-
    105 {}
    \n-
    \n-
    106
    \n-
    \n-\n-
    109 return hostIterator_ == other.hostIterator_;
    \n-
    110 }
    \n-
    \n-
    111
    \n-
    112
    \n-
    \n-
    114 void increment() {
    \n-
    115 ++hostIterator_;
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    \n-\n-
    120 return IdentityGridLevelIntersection<GridImp>(identityGrid_,*hostIterator_);
    \n-
    121 }
    \n-
    \n-
    122
    \n-
    123 private:
    \n-
    124
    \n-
    125
    \n-
    126 const GridImp* identityGrid_ = nullptr;
    \n-
    127 HostLevelIntersectionIterator hostIterator_ = {};
    \n-
    128
    \n-
    129 };
    \n-
    \n-
    130
    \n-
    131
    \n-
    132} // namespace Dune
    \n-
    133
    \n-
    134#endif
    \n-
    The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.
    \n-
    The IdentityGridEntity class.
    \n+
    101 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;
    \n+
    102
    \n+
    103 /*
    \n+
    104 * We use the remove_const to extract the Type from the mutable class,
    \n+
    105 * because the const class is not instantiated yet.
    \n+
    106 */
    \n+
    107 constexpr static int dim = std::remove_const<GridImp>::type::dimension;
    \n+
    108
    \n+
    109
    \n+
    \n+
    111 IdentityGridLeafIndexSet (const GridImp& grid)
    \n+
    112 : grid_(&grid)
    \n+
    113 {}
    \n+
    \n+
    114
    \n+
    115
    \n+
    117 /*
    \n+
    118 We use the RemoveConst to extract the Type from the mutable class,
    \n+
    119 because the const class is not instantiated yet.
    \n+
    120 */
    \n+
    121 template<int codim>
    \n+
    \n+
    122 int index (const typename std::remove_const<GridImp>::type::template Codim<codim>::Entity& e) const
    \n+
    123 {
    \n+
    124 return grid_->hostgrid_->leafIndexSet().template index<codim>(grid_->template getHostEntity<codim>(e));
    \n+
    125 }
    \n+
    \n+
    126
    \n+
    127
    \n+
    129 /*
    \n+
    130 We use the RemoveConst to extract the Type from the mutable class,
    \n+
    131 because the const class is not instantiated yet.
    \n+
    132 */
    \n+
    133 template<int cc>
    \n+
    \n+
    134 int subIndex (const typename std::remove_const<GridImp>::type::Traits::template Codim<cc>::Entity& e, int i, int codim) const
    \n+
    135 {
    \n+
    136 return grid_->hostgrid_->leafIndexSet().subIndex(grid_->template getHostEntity<cc>(e),i, codim);
    \n+
    137 }
    \n+
    \n+
    138
    \n+
    139
    \n+
    \n+
    141 std::size_t size (GeometryType type) const
    \n+
    142 {
    \n+
    143 return grid_->hostgrid_->leafIndexSet().size(type);
    \n+
    144 }
    \n+
    \n+
    145
    \n+
    146
    \n+
    \n+
    148 std::size_t size (int codim) const
    \n+
    149 {
    \n+
    150 return grid_->hostgrid_->leafIndexSet().size(codim);
    \n+
    151 }
    \n+
    \n+
    152
    \n+
    \n+
    154 Types types (int codim) const
    \n+
    155 {
    \n+
    156 return grid_->hostgrid_->leafIndexSet().types(codim);
    \n+
    157 }
    \n+
    \n+
    158
    \n+
    160 template<class EntityType>
    \n+
    \n+
    161 bool contains (const EntityType& e) const
    \n+
    162 {
    \n+
    163 return grid_->hostgrid_->leafIndexSet().contains(grid_->template getHostEntity<EntityType::codimension>(e));
    \n+
    164 }
    \n+
    \n+
    165
    \n+
    166
    \n+
    167
    \n+
    \n+
    169 void update(const GridImp& grid)
    \n+
    170 {
    \n+
    171 grid_ = &grid;
    \n+
    172 }
    \n+
    \n+
    173
    \n+
    174
    \n+
    175 GridImp* grid_;
    \n+
    176 };
    \n+
    \n+
    177
    \n+
    178
    \n+
    179
    \n+
    180
    \n+
    181 template <class GridImp>
    \n+
    \n+\n+
    183 public IdSet<GridImp,IdentityGridGlobalIdSet<GridImp>,
    \n+
    184 typename std::remove_const<GridImp>::type::HostGridType::Traits::GlobalIdSet::IdType>
    \n+
    185 {
    \n+
    186
    \n+
    187 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n+
    188
    \n+
    189
    \n+
    190 public:
    \n+
    192 IdentityGridGlobalIdSet (const GridImp& g) : grid_(&g) {}
    \n+
    193
    \n+
    195 typedef typename HostGrid::Traits::GlobalIdSet::IdType IdType;
    \n+
    196
    \n+
    197
    \n+
    199 /*
    \n+
    200 We use the remove_const to extract the Type from the mutable class,
    \n+
    201 because the const class is not instantiated yet.
    \n+
    202 */
    \n+
    203 template<int cd>
    \n+
    \n+
    204 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
    \n+
    205 {
    \n+
    206 // Return id of the host entity
    \n+
    207 return grid_->hostgrid_->globalIdSet().id(e.impl().hostEntity_);
    \n+
    208 }
    \n+
    \n+
    209
    \n+
    210
    \n+
    212 /*
    \n+
    213 We use the remove_const to extract the Type from the mutable class,
    \n+
    214 because the const class is not instantiated yet.
    \n+
    215 */
    \n+
    \n+
    216 IdType subId (const typename std::remove_const<GridImp>::type::Traits::template Codim<0>::Entity& e, int i, int codim) const
    \n+
    217 {
    \n+
    218 // Return sub id of the host entity
    \n+
    219 return grid_->hostgrid_->globalIdSet().subId(e.impl().hostEntity_,i, codim);
    \n+
    220 }
    \n+
    \n+
    221
    \n+
    222
    \n+
    224 void update() {}
    \n+
    225
    \n+
    226
    \n+
    227 const GridImp* grid_;
    \n+
    228 };
    \n+
    \n+
    229
    \n+
    230
    \n+
    231
    \n+
    232
    \n+
    233 template<class GridImp>
    \n+
    \n+\n+
    235 public IdSet<GridImp,IdentityGridLocalIdSet<GridImp>,
    \n+
    236 typename std::remove_const<GridImp>::type::HostGridType::Traits::LocalIdSet::IdType>
    \n+
    237 {
    \n+
    238 private:
    \n+
    239
    \n+
    240 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n+
    241
    \n+
    242
    \n+
    243 public:
    \n+
    245 typedef typename HostGrid::Traits::LocalIdSet::IdType IdType;
    \n+
    246
    \n+
    247
    \n+
    249 IdentityGridLocalIdSet (const GridImp& g) : grid_(&g) {}
    \n+
    250
    \n+
    251
    \n+
    253 /*
    \n+
    254 We use the remove_const to extract the Type from the mutable class,
    \n+
    255 because the const class is not instantiated yet.
    \n+
    256 */
    \n+
    257 template<int cd>
    \n+
    \n+
    258 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
    \n+
    259 {
    \n+
    260 // Return id of the host entity
    \n+
    261 return grid_->hostgrid_->localIdSet().id(e.impl().hostEntity_);
    \n+
    262 }
    \n+
    \n+
    263
    \n+
    264
    \n+
    266 /*
    \n+
    267 * We use the remove_const to extract the Type from the mutable class,
    \n+
    268 * because the const class is not instantiated yet.
    \n+
    269 */
    \n+
    \n+
    270 IdType subId (const typename std::remove_const<GridImp>::type::template Codim<0>::Entity& e, int i, int codim) const
    \n+
    271 {
    \n+
    272 // Return sub id of the host entity
    \n+
    273 return grid_->hostgrid_->localIdSet().subId(e.impl().hostEntity_,i,codim);
    \n+
    274 }
    \n+
    \n+
    275
    \n+
    276
    \n+
    278 void update() {}
    \n+
    279
    \n+
    280
    \n+
    281 const GridImp* grid_;
    \n+
    282 };
    \n+
    \n+
    283
    \n+
    284
    \n+
    285} // namespace Dune
    \n+
    286
    \n+
    287
    \n+
    288#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Definition identitygridintersectioniterator.hh:84
    \n-
    bool equals(const IdentityGridLevelIntersectionIterator< GridImp > &other) const
    equality
    Definition identitygridintersectioniterator.hh:108
    \n-
    void increment()
    prefix increment
    Definition identitygridintersectioniterator.hh:114
    \n-
    IdentityGridLevelIntersectionIterator(const GridImp *identityGrid, const HostLevelIntersectionIterator &hostIterator)
    Definition identitygridintersectioniterator.hh:101
    \n-
    Dune::Intersection< const GridImp, Dune::IdentityGridLevelIntersection< GridImp > > Intersection
    Definition identitygridintersectioniterator.hh:96
    \n-
    Intersection dereference() const
    dereferencing
    Definition identitygridintersectioniterator.hh:119
    \n-
    IdentityGridLevelIntersectionIterator()
    Definition identitygridintersectioniterator.hh:98
    \n-
    Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
    Definition identitygridintersectioniterator.hh:29
    \n-
    bool equals(const IdentityGridLeafIntersectionIterator &other) const
    equality
    Definition identitygridintersectioniterator.hh:54
    \n-
    void increment()
    prefix increment
    Definition identitygridintersectioniterator.hh:60
    \n-
    IdentityGridLeafIntersectionIterator(const GridImp *identityGrid, const HostLeafIntersectionIterator &hostIterator)
    Definition identitygridintersectioniterator.hh:47
    \n-
    Intersection dereference() const
    dereferencing
    Definition identitygridintersectioniterator.hh:65
    \n-
    Dune::Intersection< const GridImp, Dune::IdentityGridLeafIntersection< GridImp > > Intersection
    Definition identitygridintersectioniterator.hh:42
    \n-
    IdentityGridLeafIntersectionIterator()
    Definition identitygridintersectioniterator.hh:44
    \n-
    An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
    Definition identitygridintersections.hh:33
    \n-
    Definition identitygridintersections.hh:192
    \n-\n+
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n+
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n+
    Definition identitygridindexsets.hh:26
    \n+
    bool contains(const EntityType &e) const
    Return true if the given entity is contained in the index set.
    Definition identitygridindexsets.hh:70
    \n+
    int index(const typename GridImp::Traits::template Codim< codim >::Entity &e) const
    get index of an entity
    Definition identitygridindexsets.hh:36
    \n+
    GridImp * grid_
    Definition identitygridindexsets.hh:83
    \n+
    std::remove_const< GridImp >::type::HostGridType HostGrid
    Definition identitygridindexsets.hh:29
    \n+
    Types types(int codim) const
    Deliver all geometry types used in this grid.
    Definition identitygridindexsets.hh:63
    \n+
    std::size_t size(GeometryType type) const
    get number of entities of given codim, type and on this level
    Definition identitygridindexsets.hh:57
    \n+
    static constexpr int dim
    Definition identitygridindexsets.hh:32
    \n+
    HostGrid::LevelGridView::IndexSet::Types Types
    Definition identitygridindexsets.hh:30
    \n+
    std::size_t size(int codim) const
    get number of entities of given codim, type and on this level
    Definition identitygridindexsets.hh:51
    \n+
    int subIndex(const typename GridImp::Traits::template Codim< cc >::Entity &e, int i, int codim) const
    get index of subEntity of a codim 0 entity
    Definition identitygridindexsets.hh:44
    \n+
    int level_
    Definition identitygridindexsets.hh:85
    \n+
    void update(const GridImp &grid, int level)
    Set up the index set.
    Definition identitygridindexsets.hh:76
    \n+
    Definition identitygridindexsets.hh:96
    \n+
    IdentityGridLeafIndexSet(const GridImp &grid)
    constructor stores reference to a grid and level
    Definition identitygridindexsets.hh:111
    \n+
    static constexpr int dim
    Definition identitygridindexsets.hh:107
    \n+
    std::size_t size(int codim) const
    get number of entities of given codim
    Definition identitygridindexsets.hh:148
    \n+
    bool contains(const EntityType &e) const
    Return true if the given entity is contained in the index set.
    Definition identitygridindexsets.hh:161
    \n+
    std::size_t size(GeometryType type) const
    get number of entities of given type
    Definition identitygridindexsets.hh:141
    \n+
    HostGrid::LevelGridView::IndexSet::Types Types
    Definition identitygridindexsets.hh:101
    \n+
    int index(const typename std::remove_const< GridImp >::type::template Codim< codim >::Entity &e) const
    get index of an entity
    Definition identitygridindexsets.hh:122
    \n+
    int subIndex(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e, int i, int codim) const
    get index of subEntity of a codim 0 entity
    Definition identitygridindexsets.hh:134
    \n+
    Types types(int codim) const
    Deliver all geometry types used in this grid.
    Definition identitygridindexsets.hh:154
    \n+
    GridImp * grid_
    Definition identitygridindexsets.hh:175
    \n+
    void update(const GridImp &grid)
    Definition identitygridindexsets.hh:169
    \n+
    Definition identitygridindexsets.hh:185
    \n+
    IdentityGridGlobalIdSet(const GridImp &g)
    constructor stores reference to a grid
    Definition identitygridindexsets.hh:192
    \n+
    void update()
    Definition identitygridindexsets.hh:224
    \n+
    const GridImp * grid_
    Definition identitygridindexsets.hh:227
    \n+
    HostGrid::Traits::GlobalIdSet::IdType IdType
    define the type used for persistent indices
    Definition identitygridindexsets.hh:195
    \n+
    IdType subId(const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, int codim) const
    get id of subEntity
    Definition identitygridindexsets.hh:216
    \n+
    IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
    get id of an entity
    Definition identitygridindexsets.hh:204
    \n+
    Definition identitygridindexsets.hh:237
    \n+
    IdType subId(const typename std::remove_const< GridImp >::type::template Codim< 0 >::Entity &e, int i, int codim) const
    get id of subEntity
    Definition identitygridindexsets.hh:270
    \n+
    IdentityGridLocalIdSet(const GridImp &g)
    constructor stores reference to a grid
    Definition identitygridindexsets.hh:249
    \n+
    const GridImp * grid_
    Definition identitygridindexsets.hh:281
    \n+
    void update()
    Definition identitygridindexsets.hh:278
    \n+
    IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
    get id of an entity
    Definition identitygridindexsets.hh:258
    \n+
    HostGrid::Traits::LocalIdSet::IdType IdType
    define the type used for persistent local ids
    Definition identitygridindexsets.hh:245
    \n+
    Provides base classes for index and id sets.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,208 +1,445 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridintersectioniterator.hh\n+identitygridindexsets.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH\n-6#define DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH\n+5#ifndef DUNE_IDENTITYGRID_INDEXSETS_HH\n+6#define DUNE_IDENTITYGRID_INDEXSETS_HH\n 7\n-8#include \"identitygridintersections.hh\"\n-9#include \"identitygridentity.hh\"\n-10\n-11#include \n-12\n-17namespace Dune {\n-18\n-27 template\n-28 class IdentityGridLeafIntersectionIterator\n-29 {\n-30\n-31 constexpr static int dim = GridImp::dimension;\n-32\n-33 constexpr static int dimworld = GridImp::dimensionworld;\n-34\n-35 // The type used to store coordinates\n-36 typedef typename GridImp::ctype ctype;\n-37\n-38 typedef typename GridImp::HostGridType::LeafGridView::IntersectionIterator\n-HostLeafIntersectionIterator;\n-39\n-40 public:\n+12#include \n+13\n+14#include \n+15\n+16namespace Dune {\n+17\n+19 template\n+20 class IdentityGridLevelIndexSet :\n+21 public IndexSet,\n+23 typename std::remove_const::type::HostGridType::LevelGridView::\n+IndexSet::IndexType,\n+24 typename std::remove_const::type::HostGridType::LevelGridView::\n+IndexSet::Types\n+25 >\n+26 {\n+27 public:\n+28\n+29 typedef typename std::remove_const::type::HostGridType HostGrid;\n+30 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;\n+31\n+32 constexpr static int dim = GridImp::dimension;\n+33\n+35 template\n+36 int index (const typename GridImp::Traits::template Codim::Entity& e)\n+const\n+37 {\n+38 return grid_->hostgrid_->levelIndexSet(level_).template index(grid_-\n+>template getHostEntity(e));\n+39 }\n+40\n 41\n-42 typedef Dune::Intersection > Intersection;\n-43\n-44 IdentityGridLeafIntersectionIterator()\n-45 {}\n-46\n-47 IdentityGridLeafIntersectionIterator(const GridImp* identityGrid,\n-48 const HostLeafIntersectionIterator& hostIterator)\n-49 : identityGrid_(identityGrid)\n-50 , hostIterator_(hostIterator)\n-51 {}\n-52\n-54 bool equals(const IdentityGridLeafIntersectionIterator& other) const {\n-55 return hostIterator_ == other.hostIterator_;\n-56 }\n-57\n-58\n-60 void increment() {\n-61 ++hostIterator_;\n-62 }\n-63\n-65 Intersection dereference() const {\n-66 return IdentityGridLeafIntersection(identityGrid_,*hostIterator_);\n-67 }\n-68\n-69 private:\n-70 //**********************************************************\n-71 // private data\n-72 //**********************************************************\n-73\n-74 const GridImp* identityGrid_ = nullptr;\n-75 HostLeafIntersectionIterator hostIterator_ = {};\n-76 };\n-77\n-78\n-79\n-80\n-82 template\n-83 class IdentityGridLevelIntersectionIterator\n-84 {\n-85 constexpr static int dim = GridImp::dimension;\n-86\n-87 constexpr static int dimworld = GridImp::dimensionworld;\n+43 template\n+44 int subIndex (const typename GridImp::Traits::template Codim::Entity& e,\n+int i, int codim) const\n+45 {\n+46 return grid_->hostgrid_->levelIndexSet(level_).subIndex(grid_->template\n+getHostEntity(e), i, codim);\n+47 }\n+48\n+49\n+51 std::size_t size (int codim) const {\n+52 return grid_->hostgrid_->levelIndexSet(level_).size(codim);\n+53 }\n+54\n+55\n+57 std::size_t size (GeometryType type) const\n+58 {\n+59 return grid_->hostgrid_->levelIndexSet(level_).size(type);\n+60 }\n+61\n+63 Types types (int codim) const\n+64 {\n+65 return grid_->hostgrid_->levelIndexSet(level_).types(codim);\n+66 }\n+67\n+69 template\n+70 bool contains (const EntityType& e) const\n+71 {\n+72 return grid_->hostgrid_->levelIndexSet(level_).contains(grid_->template\n+getHostEntity(e));\n+73 }\n+74\n+76 void update(const GridImp& grid, int level)\n+77 {\n+78 grid_ = &grid;\n+79 level_ = level;\n+80 }\n+81\n+82\n+83 GridImp* grid_;\n+84\n+85 int level_;\n+86 };\n+87\n 88\n-89 // The type used to store coordinates\n-90 typedef typename GridImp::ctype ctype;\n-91\n-92 typedef typename GridImp::HostGridType::LevelGridView::IntersectionIterator\n-HostLevelIntersectionIterator;\n-93\n-94 public:\n-95\n-96 typedef Dune::Intersection > Intersection;\n-97\n-98 IdentityGridLevelIntersectionIterator()\n-99 {}\n+89 template\n+90 class IdentityGridLeafIndexSet :\n+91 public IndexSet,\n+93 typename std::remove_const::type::HostGridType::LeafGridView::\n+IndexSet::IndexType,\n+94 typename std::remove_const::type::HostGridType::LeafGridView::\n+IndexSet::Types\n+95 >\n+96 {\n+97 typedef typename std::remove_const::type::HostGridType HostGrid;\n+98\n+99 public:\n 100\n-101 IdentityGridLevelIntersectionIterator(const GridImp* identityGrid,\n-102 const HostLevelIntersectionIterator& hostIterator)\n-103 : identityGrid_(identityGrid)\n-104 , hostIterator_(hostIterator)\n-105 {}\n-106\n-108 bool equals(const IdentityGridLevelIntersectionIterator& other)\n-const {\n-109 return hostIterator_ == other.hostIterator_;\n-110 }\n-111\n-112\n-114 void increment() {\n-115 ++hostIterator_;\n-116 }\n-117\n-119 Intersection dereference() const {\n-120 return IdentityGridLevelIntersection(identityGrid_,*hostIterator_\n-);\n-121 }\n-122\n-123 private:\n-124\n-125\n-126 const GridImp* identityGrid_ = nullptr;\n-127 HostLevelIntersectionIterator hostIterator_ = {};\n-128\n-129 };\n-130\n-131\n-132} // namespace Dune\n-133\n-134#endif\n-identitygridintersections.hh\n-The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.\n-identitygridentity.hh\n-The IdentityGridEntity class.\n+101 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;\n+102\n+103 /*\n+104 * We use the remove_const to extract the Type from the mutable class,\n+105 * because the const class is not instantiated yet.\n+106 */\n+107 constexpr static int dim = std::remove_const::type::dimension;\n+108\n+109\n+111 IdentityGridLeafIndexSet (const GridImp& grid)\n+112 : grid_(&grid)\n+113 {}\n+114\n+115\n+117 /*\n+118 We use the RemoveConst to extract the Type from the mutable class,\n+119 because the const class is not instantiated yet.\n+120 */\n+121 template\n+122 int index (const typename std::remove_const::type::template\n+Codim::Entity& e) const\n+123 {\n+124 return grid_->hostgrid_->leafIndexSet().template index(grid_-\n+>template getHostEntity(e));\n+125 }\n+126\n+127\n+129 /*\n+130 We use the RemoveConst to extract the Type from the mutable class,\n+131 because the const class is not instantiated yet.\n+132 */\n+133 template\n+134 int subIndex (const typename std::remove_const::type::Traits::\n+template Codim::Entity& e, int i, int codim) const\n+135 {\n+136 return grid_->hostgrid_->leafIndexSet().subIndex(grid_->template\n+getHostEntity(e),i, codim);\n+137 }\n+138\n+139\n+141 std::size_t size (GeometryType type) const\n+142 {\n+143 return grid_->hostgrid_->leafIndexSet().size(type);\n+144 }\n+145\n+146\n+148 std::size_t size (int codim) const\n+149 {\n+150 return grid_->hostgrid_->leafIndexSet().size(codim);\n+151 }\n+152\n+154 Types types (int codim) const\n+155 {\n+156 return grid_->hostgrid_->leafIndexSet().types(codim);\n+157 }\n+158\n+160 template\n+161 bool contains (const EntityType& e) const\n+162 {\n+163 return grid_->hostgrid_->leafIndexSet().contains(grid_->template\n+getHostEntity(e));\n+164 }\n+165\n+166\n+167\n+169 void update(const GridImp& grid)\n+170 {\n+171 grid_ = &grid;\n+172 }\n+173\n+174\n+175 GridImp* grid_;\n+176 };\n+177\n+178\n+179\n+180\n+181 template \n+182 class IdentityGridGlobalIdSet :\n+183 public IdSet,\n+184 typename std::remove_const::type::HostGridType::Traits::\n+GlobalIdSet::IdType>\n+185 {\n+186\n+187 typedef typename std::remove_const::type::HostGridType HostGrid;\n+188\n+189\n+190 public:\n+192 IdentityGridGlobalIdSet (const GridImp& g) : grid_(&g) {}\n+193\n+195 typedef typename HostGrid::Traits::GlobalIdSet::IdType IdType;\n+196\n+197\n+199 /*\n+200 We use the remove_const to extract the Type from the mutable class,\n+201 because the const class is not instantiated yet.\n+202 */\n+203 template\n+204 IdType id (const typename std::remove_const::type::Traits::\n+template Codim::Entity& e) const\n+205 {\n+206 // Return id of the host entity\n+207 return grid_->hostgrid_->globalIdSet().id(e.impl().hostEntity_);\n+208 }\n+209\n+210\n+212 /*\n+213 We use the remove_const to extract the Type from the mutable class,\n+214 because the const class is not instantiated yet.\n+215 */\n+216 IdType subId (const typename std::remove_const::type::Traits::\n+template Codim<0>::Entity& e, int i, int codim) const\n+217 {\n+218 // Return sub id of the host entity\n+219 return grid_->hostgrid_->globalIdSet().subId(e.impl().hostEntity_,i,\n+codim);\n+220 }\n+221\n+222\n+224 void update() {}\n+225\n+226\n+227 const GridImp* grid_;\n+228 };\n+229\n+230\n+231\n+232\n+233 template\n+234 class IdentityGridLocalIdSet :\n+235 public IdSet,\n+236 typename std::remove_const::type::HostGridType::Traits::\n+LocalIdSet::IdType>\n+237 {\n+238 private:\n+239\n+240 typedef typename std::remove_const::type::HostGridType HostGrid;\n+241\n+242\n+243 public:\n+245 typedef typename HostGrid::Traits::LocalIdSet::IdType IdType;\n+246\n+247\n+249 IdentityGridLocalIdSet (const GridImp& g) : grid_(&g) {}\n+250\n+251\n+253 /*\n+254 We use the remove_const to extract the Type from the mutable class,\n+255 because the const class is not instantiated yet.\n+256 */\n+257 template\n+258 IdType id (const typename std::remove_const::type::Traits::\n+template Codim::Entity& e) const\n+259 {\n+260 // Return id of the host entity\n+261 return grid_->hostgrid_->localIdSet().id(e.impl().hostEntity_);\n+262 }\n+263\n+264\n+266 /*\n+267 * We use the remove_const to extract the Type from the mutable class,\n+268 * because the const class is not instantiated yet.\n+269 */\n+270 IdType subId (const typename std::remove_const::type::template\n+Codim<0>::Entity& e, int i, int codim) const\n+271 {\n+272 // Return sub id of the host entity\n+273 return grid_->hostgrid_->localIdSet().subId(e.impl().hostEntity_,i,codim);\n+274 }\n+275\n+276\n+278 void update() {}\n+279\n+280\n+281 const GridImp* grid_;\n+282 };\n+283\n+284\n+285} // namespace Dune\n+286\n+287\n+288#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::IdentityGridLevelIntersectionIterator\n-Definition identitygridintersectioniterator.hh:84\n-Dune::IdentityGridLevelIntersectionIterator::equals\n-bool equals(const IdentityGridLevelIntersectionIterator< GridImp > &other)\n+Dune::IndexSet\n+Index Set Interface base class.\n+Definition common/indexidset.hh:78\n+Dune::IdSet\n+Id Set Interface.\n+Definition common/indexidset.hh:447\n+Dune::IdentityGridLevelIndexSet\n+Definition identitygridindexsets.hh:26\n+Dune::IdentityGridLevelIndexSet::contains\n+bool contains(const EntityType &e) const\n+Return true if the given entity is contained in the index set.\n+Definition identitygridindexsets.hh:70\n+Dune::IdentityGridLevelIndexSet::index\n+int index(const typename GridImp::Traits::template Codim< codim >::Entity &e)\n const\n-equality\n-Definition identitygridintersectioniterator.hh:108\n-Dune::IdentityGridLevelIntersectionIterator::increment\n-void increment()\n-prefix increment\n-Definition identitygridintersectioniterator.hh:114\n-Dune::IdentityGridLevelIntersectionIterator::\n-IdentityGridLevelIntersectionIterator\n-IdentityGridLevelIntersectionIterator(const GridImp *identityGrid, const\n-HostLevelIntersectionIterator &hostIterator)\n-Definition identitygridintersectioniterator.hh:101\n-Dune::IdentityGridLevelIntersectionIterator::Intersection\n-Dune::Intersection< const GridImp, Dune::IdentityGridLevelIntersection< GridImp\n-> > Intersection\n-Definition identitygridintersectioniterator.hh:96\n-Dune::IdentityGridLevelIntersectionIterator::dereference\n-Intersection dereference() const\n-dereferencing\n-Definition identitygridintersectioniterator.hh:119\n-Dune::IdentityGridLevelIntersectionIterator::\n-IdentityGridLevelIntersectionIterator\n-IdentityGridLevelIntersectionIterator()\n-Definition identitygridintersectioniterator.hh:98\n-Dune::IdentityGridLeafIntersectionIterator\n-Iterator over all element neighborsMesh entities of codimension 0 (\"elements\")\n-allow to visit all nei...\n-Definition identitygridintersectioniterator.hh:29\n-Dune::IdentityGridLeafIntersectionIterator::equals\n-bool equals(const IdentityGridLeafIntersectionIterator &other) const\n-equality\n-Definition identitygridintersectioniterator.hh:54\n-Dune::IdentityGridLeafIntersectionIterator::increment\n-void increment()\n-prefix increment\n-Definition identitygridintersectioniterator.hh:60\n-Dune::IdentityGridLeafIntersectionIterator::\n-IdentityGridLeafIntersectionIterator\n-IdentityGridLeafIntersectionIterator(const GridImp *identityGrid, const\n-HostLeafIntersectionIterator &hostIterator)\n-Definition identitygridintersectioniterator.hh:47\n-Dune::IdentityGridLeafIntersectionIterator::dereference\n-Intersection dereference() const\n-dereferencing\n-Definition identitygridintersectioniterator.hh:65\n-Dune::IdentityGridLeafIntersectionIterator::Intersection\n-Dune::Intersection< const GridImp, Dune::IdentityGridLeafIntersection< GridImp\n-> > Intersection\n-Definition identitygridintersectioniterator.hh:42\n-Dune::IdentityGridLeafIntersectionIterator::\n-IdentityGridLeafIntersectionIterator\n-IdentityGridLeafIntersectionIterator()\n-Definition identitygridintersectioniterator.hh:44\n-Dune::IdentityGridLeafIntersection\n-An intersection with a leaf neighbor elementMesh entities of codimension 0\n-(\"elements\") allow to visi...\n-Definition identitygridintersections.hh:33\n-Dune::IdentityGridLevelIntersection\n-Definition identitygridintersections.hh:192\n-intersection.hh\n+get index of an entity\n+Definition identitygridindexsets.hh:36\n+Dune::IdentityGridLevelIndexSet::grid_\n+GridImp * grid_\n+Definition identitygridindexsets.hh:83\n+Dune::IdentityGridLevelIndexSet::HostGrid\n+std::remove_const< GridImp >::type::HostGridType HostGrid\n+Definition identitygridindexsets.hh:29\n+Dune::IdentityGridLevelIndexSet::types\n+Types types(int codim) const\n+Deliver all geometry types used in this grid.\n+Definition identitygridindexsets.hh:63\n+Dune::IdentityGridLevelIndexSet::size\n+std::size_t size(GeometryType type) const\n+get number of entities of given codim, type and on this level\n+Definition identitygridindexsets.hh:57\n+Dune::IdentityGridLevelIndexSet::dim\n+static constexpr int dim\n+Definition identitygridindexsets.hh:32\n+Dune::IdentityGridLevelIndexSet::Types\n+HostGrid::LevelGridView::IndexSet::Types Types\n+Definition identitygridindexsets.hh:30\n+Dune::IdentityGridLevelIndexSet::size\n+std::size_t size(int codim) const\n+get number of entities of given codim, type and on this level\n+Definition identitygridindexsets.hh:51\n+Dune::IdentityGridLevelIndexSet::subIndex\n+int subIndex(const typename GridImp::Traits::template Codim< cc >::Entity &e,\n+int i, int codim) const\n+get index of subEntity of a codim 0 entity\n+Definition identitygridindexsets.hh:44\n+Dune::IdentityGridLevelIndexSet::level_\n+int level_\n+Definition identitygridindexsets.hh:85\n+Dune::IdentityGridLevelIndexSet::update\n+void update(const GridImp &grid, int level)\n+Set up the index set.\n+Definition identitygridindexsets.hh:76\n+Dune::IdentityGridLeafIndexSet\n+Definition identitygridindexsets.hh:96\n+Dune::IdentityGridLeafIndexSet::IdentityGridLeafIndexSet\n+IdentityGridLeafIndexSet(const GridImp &grid)\n+constructor stores reference to a grid and level\n+Definition identitygridindexsets.hh:111\n+Dune::IdentityGridLeafIndexSet::dim\n+static constexpr int dim\n+Definition identitygridindexsets.hh:107\n+Dune::IdentityGridLeafIndexSet::size\n+std::size_t size(int codim) const\n+get number of entities of given codim\n+Definition identitygridindexsets.hh:148\n+Dune::IdentityGridLeafIndexSet::contains\n+bool contains(const EntityType &e) const\n+Return true if the given entity is contained in the index set.\n+Definition identitygridindexsets.hh:161\n+Dune::IdentityGridLeafIndexSet::size\n+std::size_t size(GeometryType type) const\n+get number of entities of given type\n+Definition identitygridindexsets.hh:141\n+Dune::IdentityGridLeafIndexSet::Types\n+HostGrid::LevelGridView::IndexSet::Types Types\n+Definition identitygridindexsets.hh:101\n+Dune::IdentityGridLeafIndexSet::index\n+int index(const typename std::remove_const< GridImp >::type::template Codim<\n+codim >::Entity &e) const\n+get index of an entity\n+Definition identitygridindexsets.hh:122\n+Dune::IdentityGridLeafIndexSet::subIndex\n+int subIndex(const typename std::remove_const< GridImp >::type::Traits::\n+template Codim< cc >::Entity &e, int i, int codim) const\n+get index of subEntity of a codim 0 entity\n+Definition identitygridindexsets.hh:134\n+Dune::IdentityGridLeafIndexSet::types\n+Types types(int codim) const\n+Deliver all geometry types used in this grid.\n+Definition identitygridindexsets.hh:154\n+Dune::IdentityGridLeafIndexSet::grid_\n+GridImp * grid_\n+Definition identitygridindexsets.hh:175\n+Dune::IdentityGridLeafIndexSet::update\n+void update(const GridImp &grid)\n+Definition identitygridindexsets.hh:169\n+Dune::IdentityGridGlobalIdSet\n+Definition identitygridindexsets.hh:185\n+Dune::IdentityGridGlobalIdSet::IdentityGridGlobalIdSet\n+IdentityGridGlobalIdSet(const GridImp &g)\n+constructor stores reference to a grid\n+Definition identitygridindexsets.hh:192\n+Dune::IdentityGridGlobalIdSet::update\n+void update()\n+Definition identitygridindexsets.hh:224\n+Dune::IdentityGridGlobalIdSet::grid_\n+const GridImp * grid_\n+Definition identitygridindexsets.hh:227\n+Dune::IdentityGridGlobalIdSet::IdType\n+HostGrid::Traits::GlobalIdSet::IdType IdType\n+define the type used for persistent indices\n+Definition identitygridindexsets.hh:195\n+Dune::IdentityGridGlobalIdSet::subId\n+IdType subId(const typename std::remove_const< GridImp >::type::Traits::\n+template Codim< 0 >::Entity &e, int i, int codim) const\n+get id of subEntity\n+Definition identitygridindexsets.hh:216\n+Dune::IdentityGridGlobalIdSet::id\n+IdType id(const typename std::remove_const< GridImp >::type::Traits::template\n+Codim< cd >::Entity &e) const\n+get id of an entity\n+Definition identitygridindexsets.hh:204\n+Dune::IdentityGridLocalIdSet\n+Definition identitygridindexsets.hh:237\n+Dune::IdentityGridLocalIdSet::subId\n+IdType subId(const typename std::remove_const< GridImp >::type::template Codim<\n+0 >::Entity &e, int i, int codim) const\n+get id of subEntity\n+Definition identitygridindexsets.hh:270\n+Dune::IdentityGridLocalIdSet::IdentityGridLocalIdSet\n+IdentityGridLocalIdSet(const GridImp &g)\n+constructor stores reference to a grid\n+Definition identitygridindexsets.hh:249\n+Dune::IdentityGridLocalIdSet::grid_\n+const GridImp * grid_\n+Definition identitygridindexsets.hh:281\n+Dune::IdentityGridLocalIdSet::update\n+void update()\n+Definition identitygridindexsets.hh:278\n+Dune::IdentityGridLocalIdSet::id\n+IdType id(const typename std::remove_const< GridImp >::type::Traits::template\n+Codim< cd >::Entity &e) const\n+get id of an entity\n+Definition identitygridindexsets.hh:258\n+Dune::IdentityGridLocalIdSet::IdType\n+HostGrid::Traits::LocalIdSet::IdType IdType\n+define the type used for persistent local ids\n+Definition identitygridindexsets.hh:245\n+indexidset.hh\n+Provides base classes for index and id sets.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00749.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00749.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridentityseed.hh File Reference\n+dune-grid: identitygridintersections.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,41 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n \n
    \n \n-
    identitygridentityseed.hh File Reference
    \n+
    identitygridintersections.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridEntitySeed class. \n+

    The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes. \n More...

    \n-\n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdentityGridEntitySeed< codim, GridImp >
     The EntitySeed class provides the minimal information needed to restore an Entity using the grid. More...
    class  Dune::IdentityGridLeafIntersection< GridImp >
     An intersection with a leaf neighbor elementMesh entities of codimension 0 (\"elements\") allow to visit all neighbors, where a neighbor is an entity of codimension 0 which has a common entity of codimension 1 These neighbors are accessed via a IntersectionIterator. This allows the implement non-matching meshes. The number of neighbors may be different from the number of an element! More...
     
    class  Dune::IdentityGridLevelIntersection< GridImp >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridEntitySeed class.

    \n+

    The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,23 +2,32 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridentityseed.hh File Reference\n-The IdentityGridEntitySeed class. More...\n+identitygridintersections.hh File Reference\n+The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.\n+More...\n+#include \"identitygridleafiterator.hh\"\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridEntitySeed<_codim,_GridImp_>\n-\u00a0 The EntitySeed class provides the minimal information needed to restore\n- an Entity using the grid. More...\n+class \u00a0 Dune::IdentityGridLeafIntersection<_GridImp_>\n+ An intersection with a leaf neighbor elementMesh entities of\n+ codimension 0 (\"elements\") allow to visit all neighbors, where a\n+\u00a0 neighbor is an entity of codimension 0 which has a common entity of\n+ codimension 1 These neighbors are accessed via a IntersectionIterator.\n+ This allows the implement non-matching meshes. The number of neighbors\n+ may be different from the number of an element! More...\n+\u00a0\n+class \u00a0 Dune::IdentityGridLevelIntersection<_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridEntitySeed class.\n+The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00749_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00749_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridentityseed.hh Source File\n+dune-grid: identitygridintersections.hh Source File\n \n \n \n \n \n \n \n@@ -74,85 +74,435 @@\n \n \n
    \n
    \n-
    identitygridentityseed.hh
    \n+
    identitygridintersections.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITY_GRID_ENTITY_SEED_HH
    \n-
    6#define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
    \n+
    5#ifndef DUNE_IDENTITYGRID_INTERSECTIONS_HH
    \n+
    6#define DUNE_IDENTITYGRID_INTERSECTIONS_HH
    \n
    7
    \n-
    14namespace Dune {
    \n-
    15
    \n+\n+\n+
    10
    \n+
    15namespace Dune {
    \n
    16
    \n-
    22 template<int codim, class GridImp>
    \n-
    \n-\n-
    24 {
    \n-
    25 protected:
    \n-
    26
    \n-
    27 // Entity type of the hostgrid
    \n-
    28 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::Entity HostEntity;
    \n-
    29
    \n-
    30 // EntitySeed type of the hostgrid
    \n-
    31 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::EntitySeed HostEntitySeed;
    \n-
    32
    \n-
    33 public:
    \n+
    17
    \n+
    18 // External forward declarations
    \n+
    19 template< class Grid >
    \n+
    20 struct HostGridAccess;
    \n+
    21
    \n+
    22
    \n+
    31 template<class GridImp>
    \n+
    \n+\n+
    33 {
    \n
    34
    \n-
    35 constexpr static int codimension = codim;
    \n+
    35 friend class IdentityGridLeafIntersectionIterator<GridImp>;
    \n
    36
    \n-
    \n-\n-
    41 {}
    \n-
    \n+
    37 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n+
    38
    \n+
    39 constexpr static int dim = GridImp::dimension;
    \n+
    40
    \n+
    41 constexpr static int dimworld = GridImp::dimensionworld;
    \n
    42
    \n-
    \n-\n-
    50 hostEntitySeed_(hostEntity.seed())
    \n-
    51 {}
    \n-
    \n-
    52
    \n-
    \n-\n-
    57 {
    \n-
    58 return hostEntitySeed_;
    \n-
    59 }
    \n+
    43 // The type used to store coordinates
    \n+
    44 typedef typename GridImp::ctype ctype;
    \n+
    45
    \n+
    46 typedef typename GridImp::HostGridType::LeafGridView::Intersection HostLeafIntersection;
    \n+
    47
    \n+
    48 public:
    \n+
    49
    \n+
    50 typedef typename GridImp::template Codim<1>::Geometry Geometry;
    \n+
    51 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
    \n+
    52 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n+
    53 typedef FieldVector<ctype, dimworld> NormalVector;
    \n+
    54
    \n+\n+
    57
    \n+
    \n+
    58 IdentityGridLeafIntersection(const GridImp* identityGrid,
    \n+
    59 const HostLeafIntersection& hostIntersection)
    \n+
    60 : identityGrid_(identityGrid)
    \n+
    61 , hostIntersection_(hostIntersection)
    \n+
    62 {}
    \n
    \n-
    60
    \n+
    63
    \n
    \n-
    64 bool isValid() const
    \n-
    65 {
    \n-
    66 return hostEntitySeed_.isValid();
    \n-
    67 }
    \n+
    64 IdentityGridLeafIntersection(const GridImp* identityGrid,
    \n+
    65 HostLeafIntersection&& hostIntersection)
    \n+
    66 : identityGrid_(identityGrid)
    \n+
    67 , hostIntersection_(std::move(hostIntersection))
    \n+
    68 {}
    \n
    \n-
    68 private:
    \n
    69
    \n-
    70 HostEntitySeed hostEntitySeed_;
    \n-
    71 };
    \n+
    \n+
    70 bool equals(const IdentityGridLeafIntersection& other) const
    \n+
    71 {
    \n+
    72 return hostIntersection_ == other.hostIntersection_;
    \n+
    73 }
    \n
    \n-
    72
    \n-
    73} // namespace Dune
    \n
    74
    \n-
    75#endif // #define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
    \n+
    \n+
    77 Entity inside() const {
    \n+
    78 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
    \n+
    79 }
    \n+
    \n+
    80
    \n+
    81
    \n+
    \n+
    84 Entity outside() const {
    \n+
    85 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
    \n+
    86 }
    \n+
    \n+
    87
    \n+
    88
    \n+
    \n+
    90 bool boundary () const {
    \n+
    91 return hostIntersection_.boundary();
    \n+
    92 }
    \n+
    \n+
    93
    \n+
    \n+\n+
    100 return hostIntersection_.centerUnitOuterNormal();
    \n+
    101 }
    \n+
    \n+
    102
    \n+
    \n+
    104 bool neighbor () const {
    \n+
    105 return hostIntersection_.neighbor();
    \n+
    106 }
    \n+
    \n+
    107
    \n+
    \n+
    109 size_t boundarySegmentIndex() const {
    \n+
    110 return hostIntersection_.boundarySegmentIndex();
    \n+
    111 }
    \n+
    \n+
    112
    \n+
    \n+
    114 bool conforming () const {
    \n+
    115 return hostIntersection_.conforming();
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    \n+
    119 GeometryType type () const {
    \n+
    120 return hostIntersection_.type();
    \n+
    121 }
    \n+
    \n+
    122
    \n+
    123
    \n+
    \n+\n+
    129 {
    \n+
    130 return LocalGeometry( hostIntersection_.geometryInInside() );
    \n+
    131 }
    \n+
    \n+
    132
    \n+
    \n+\n+
    136 {
    \n+
    137 return LocalGeometry( hostIntersection_.geometryInOutside() );
    \n+
    138 }
    \n+
    \n+
    139
    \n+
    \n+\n+
    143 {
    \n+
    144 return Geometry( hostIntersection_.geometry() );
    \n+
    145 }
    \n+
    \n+
    146
    \n+
    147
    \n+
    \n+
    149 int indexInInside () const {
    \n+
    150 return hostIntersection_.indexInInside();
    \n+
    151 }
    \n+
    \n+
    152
    \n+
    153
    \n+
    \n+
    155 int indexInOutside () const {
    \n+
    156 return hostIntersection_.indexInOutside();
    \n+
    157 }
    \n+
    \n+
    158
    \n+
    159
    \n+
    \n+
    161 FieldVector<ctype, GridImp::dimensionworld> outerNormal (const FieldVector<ctype, GridImp::dimension-1>& local) const {
    \n+
    162 return hostIntersection_.outerNormal(local);
    \n+
    163 }
    \n+
    \n+
    164
    \n+
    \n+
    166 FieldVector<ctype, GridImp::dimensionworld> integrationOuterNormal (const FieldVector<ctype, GridImp::dimension-1>& local) const {
    \n+
    167 return hostIntersection_.integrationOuterNormal(local);
    \n+
    168 }
    \n+
    \n+
    169
    \n+
    \n+
    171 FieldVector<ctype, GridImp::dimensionworld> unitOuterNormal (const FieldVector<ctype, GridImp::dimension-1>& local) const {
    \n+
    172 return hostIntersection_.unitOuterNormal(local);
    \n+
    173 }
    \n+
    \n+
    174
    \n+
    175
    \n+
    176 private:
    \n+
    177 //**********************************************************
    \n+
    178 // private methods
    \n+
    179 //**********************************************************
    \n+
    180
    \n+
    181 const GridImp* identityGrid_;
    \n+
    182
    \n+
    183 HostLeafIntersection hostIntersection_;
    \n+
    184 };
    \n+
    \n+
    185
    \n+
    186
    \n+
    187
    \n+
    188
    \n+
    190 template<class GridImp>
    \n+
    \n+\n+
    192 {
    \n+
    193
    \n+
    194 friend class IdentityGridLevelIntersectionIterator<GridImp>;
    \n+
    195
    \n+
    196 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
    \n+
    197
    \n+
    198 constexpr static int dim = GridImp::dimension;
    \n+
    199
    \n+
    200 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    201
    \n+
    202 // The type used to store coordinates
    \n+
    203 typedef typename GridImp::ctype ctype;
    \n+
    204
    \n+
    205 typedef typename GridImp::HostGridType::LevelGridView::Intersection HostLevelIntersection;
    \n+
    206
    \n+
    207 public:
    \n+
    208
    \n+
    209 typedef typename GridImp::template Codim<1>::Geometry Geometry;
    \n+
    210 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
    \n+
    211 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n+
    212 typedef FieldVector<ctype, dimworld> NormalVector;
    \n+
    213
    \n+\n+
    216
    \n+
    \n+
    217 IdentityGridLevelIntersection(const GridImp* identityGrid,
    \n+
    218 const HostLevelIntersection& hostIntersection)
    \n+
    219 : identityGrid_(identityGrid)
    \n+
    220 , hostIntersection_(hostIntersection)
    \n+
    221 {}
    \n+
    \n+
    222
    \n+
    \n+
    223 IdentityGridLevelIntersection(const GridImp* identityGrid,
    \n+
    224 HostLevelIntersection&& hostIntersection)
    \n+
    225 : identityGrid_(identityGrid)
    \n+
    226 , hostIntersection_(std::move(hostIntersection))
    \n+
    227 {}
    \n+
    \n+
    228
    \n+
    \n+
    229 bool equals(const IdentityGridLevelIntersection& other) const
    \n+
    230 {
    \n+
    231 return hostIntersection_ == other.hostIntersection_;
    \n+
    232 }
    \n+
    \n+
    233
    \n+
    \n+
    236 Entity inside() const {
    \n+
    237 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
    \n+
    238 }
    \n+
    \n+
    239
    \n+
    240
    \n+
    \n+
    243 Entity outside() const {
    \n+
    244 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
    \n+
    245 }
    \n+
    \n+
    246
    \n+
    247
    \n+
    \n+
    250 bool boundary () const {
    \n+
    251 return hostIntersection_.boundary();
    \n+
    252 }
    \n+
    \n+
    253
    \n+
    \n+\n+
    260 return hostIntersection_.centerUnitOuterNormal();
    \n+
    261 }
    \n+
    \n+
    262
    \n+
    \n+
    264 bool neighbor () const {
    \n+
    265 return hostIntersection_.neighbor();
    \n+
    266 }
    \n+
    \n+
    267
    \n+
    \n+
    269 size_t boundarySegmentIndex() const {
    \n+
    270 return hostIntersection_.boundarySegmentIndex();
    \n+
    271 }
    \n+
    \n+
    272
    \n+
    \n+
    274 bool conforming () const {
    \n+
    275 return hostIntersection_.conforming();
    \n+
    276 }
    \n+
    \n+
    277
    \n+
    \n+
    279 GeometryType type () const {
    \n+
    280 return hostIntersection_.type();
    \n+
    281 }
    \n+
    \n+
    282
    \n+
    283
    \n+
    \n+\n+
    289 {
    \n+
    290 return LocalGeometry( hostIntersection_.geometryInInside() );
    \n+
    291 }
    \n+
    \n+
    292
    \n+
    \n+\n+
    296 {
    \n+
    297 return LocalGeometry( hostIntersection_.geometryInOutside() );
    \n+
    298 }
    \n+
    \n+
    299
    \n+
    \n+\n+
    303 {
    \n+
    304 return Geometry( hostIntersection_.geometry() );
    \n+
    305 }
    \n+
    \n+
    306
    \n+
    307
    \n+
    \n+
    309 int indexInInside () const {
    \n+
    310 return hostIntersection_.indexInInside();
    \n+
    311 }
    \n+
    \n+
    312
    \n+
    313
    \n+
    \n+
    315 int indexInOutside () const {
    \n+
    316 return hostIntersection_.indexInOutside();
    \n+
    317 }
    \n+
    \n+
    318
    \n+
    319
    \n+
    \n+
    321 FieldVector<ctype, dimworld> outerNormal (const FieldVector<ctype, dim-1>& local) const {
    \n+
    322 return hostIntersection_.outerNormal(local);
    \n+
    323 }
    \n+
    \n+
    324
    \n+
    \n+
    326 FieldVector<ctype, dimworld> integrationOuterNormal (const FieldVector<ctype, dim-1>& local) const {
    \n+
    327 return hostIntersection_.integrationOuterNormal(local);
    \n+
    328 }
    \n+
    \n+
    329
    \n+
    \n+
    331 FieldVector<ctype, dimworld> unitOuterNormal (const FieldVector<ctype, dim-1>& local) const {
    \n+
    332 return hostIntersection_.unitOuterNormal(local);
    \n+
    333 }
    \n+
    \n+
    334
    \n+
    335 private:
    \n+
    336
    \n+
    337 const GridImp* identityGrid_;
    \n+
    338
    \n+
    339 HostLevelIntersection hostIntersection_;
    \n+
    340
    \n+
    341 };
    \n+
    \n+
    342
    \n+
    343
    \n+
    344} // namespace Dune
    \n+
    345
    \n+
    346#endif
    \n+
    The IdentityGridEntity class.
    \n+
    The IdentityGridLeafIterator class.
    \n+
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    The EntitySeed class provides the minimal information needed to restore an Entity using the grid.
    Definition identitygridentityseed.hh:24
    \n-
    static constexpr int codimension
    Definition identitygridentityseed.hh:35
    \n-
    IdentityGridEntitySeed()
    Construct an empty (i.e. isValid() == false) seed.
    Definition identitygridentityseed.hh:40
    \n-
    bool isValid() const
    Check whether it is safe to create an Entity from this Seed.
    Definition identitygridentityseed.hh:64
    \n-
    GridImp::HostGridType::Traits::template Codim< codim >::Entity HostEntity
    Definition identitygridentityseed.hh:28
    \n-
    IdentityGridEntitySeed(const HostEntity &hostEntity)
    Create EntitySeed from hostgrid Entity.
    Definition identitygridentityseed.hh:49
    \n-
    const HostEntitySeed & hostEntitySeed() const
    Get stored HostEntitySeed.
    Definition identitygridentityseed.hh:56
    \n-
    GridImp::HostGridType::Traits::template Codim< codim >::EntitySeed HostEntitySeed
    Definition identitygridentityseed.hh:31
    \n+
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n+
    The implementation of entities in a IdentityGrid.
    Definition identitygridentity.hh:55
    \n+
    Definition identitygridintersectioniterator.hh:84
    \n+
    Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
    Definition identitygridintersectioniterator.hh:29
    \n+
    An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
    Definition identitygridintersections.hh:33
    \n+
    Entity inside() const
    Definition identitygridintersections.hh:77
    \n+
    IdentityGridLeafIntersection(const GridImp *identityGrid, HostLeafIntersection &&hostIntersection)
    Definition identitygridintersections.hh:64
    \n+
    NormalVector centerUnitOuterNormal() const
    Return unit outer normal (length == 1)
    Definition identitygridintersections.hh:99
    \n+
    GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
    Definition identitygridintersections.hh:51
    \n+
    Geometry geometry() const
    Definition identitygridintersections.hh:142
    \n+
    Entity outside() const
    Definition identitygridintersections.hh:84
    \n+
    LocalGeometry geometryInOutside() const
    Definition identitygridintersections.hh:135
    \n+
    bool boundary() const
    return true if intersection is with boundary.
    Definition identitygridintersections.hh:90
    \n+
    GeometryType type() const
    Geometry type of an intersection.
    Definition identitygridintersections.hh:119
    \n+
    FieldVector< ctype, dimworld > NormalVector
    Definition identitygridintersections.hh:53
    \n+
    LocalGeometry geometryInInside() const
    Definition identitygridintersections.hh:128
    \n+
    bool conforming() const
    Return true if this is a conforming intersection.
    Definition identitygridintersections.hh:114
    \n+
    IdentityGridLeafIntersection(const GridImp *identityGrid, const HostLeafIntersection &hostIntersection)
    Definition identitygridintersections.hh:58
    \n+
    size_t boundarySegmentIndex() const
    return the boundary segment index
    Definition identitygridintersections.hh:109
    \n+
    bool equals(const IdentityGridLeafIntersection &other) const
    Definition identitygridintersections.hh:70
    \n+
    FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
    return outer normal
    Definition identitygridintersections.hh:161
    \n+
    int indexInOutside() const
    local number of codim 1 entity in neighbor where intersection is contained
    Definition identitygridintersections.hh:155
    \n+
    FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
    return outer normal multiplied by the integration element
    Definition identitygridintersections.hh:166
    \n+
    bool neighbor() const
    return true if across the edge an neighbor on this level exists
    Definition identitygridintersections.hh:104
    \n+
    FieldVector< ctype, GridImp::dimensionworld > unitOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
    return unit outer normal
    Definition identitygridintersections.hh:171
    \n+
    int indexInInside() const
    local number of codim 1 entity in self where intersection is contained in
    Definition identitygridintersections.hh:149
    \n+
    GridImp::template Codim< 1 >::Geometry Geometry
    Definition identitygridintersections.hh:50
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Definition identitygridintersections.hh:52
    \n+
    Definition identitygridintersections.hh:192
    \n+
    Geometry geometry() const
    Definition identitygridintersections.hh:302
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Definition identitygridintersections.hh:211
    \n+
    IdentityGridLevelIntersection(const GridImp *identityGrid, const HostLevelIntersection &hostIntersection)
    Definition identitygridintersections.hh:217
    \n+
    GridImp::template Codim< 1 >::Geometry Geometry
    Definition identitygridintersections.hh:209
    \n+
    bool equals(const IdentityGridLevelIntersection &other) const
    Definition identitygridintersections.hh:229
    \n+
    bool neighbor() const
    return true if across the edge an neighbor on this level exists
    Definition identitygridintersections.hh:264
    \n+
    NormalVector centerUnitOuterNormal() const
    Return unit outer normal (length == 1)
    Definition identitygridintersections.hh:259
    \n+
    bool conforming() const
    Return true if this is a conforming intersection.
    Definition identitygridintersections.hh:274
    \n+
    int indexInInside() const
    local number of codim 1 entity in self where intersection is contained in
    Definition identitygridintersections.hh:309
    \n+
    FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &local) const
    return outer normal
    Definition identitygridintersections.hh:321
    \n+
    GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
    Definition identitygridintersections.hh:210
    \n+
    FieldVector< ctype, dimworld > NormalVector
    Definition identitygridintersections.hh:212
    \n+
    bool boundary() const
    return true if intersection is with boundary.
    Definition identitygridintersections.hh:250
    \n+
    FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
    return outer normal multiplied by the integration element
    Definition identitygridintersections.hh:326
    \n+
    LocalGeometry geometryInOutside() const
    Definition identitygridintersections.hh:295
    \n+
    LocalGeometry geometryInInside() const
    Definition identitygridintersections.hh:288
    \n+
    int indexInOutside() const
    local number of codim 1 entity in neighbor where intersection is contained
    Definition identitygridintersections.hh:315
    \n+
    FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
    return unit outer normal
    Definition identitygridintersections.hh:331
    \n+
    size_t boundarySegmentIndex() const
    return the boundary segment index
    Definition identitygridintersections.hh:269
    \n+
    Entity outside() const
    Definition identitygridintersections.hh:243
    \n+
    Entity inside() const
    Definition identitygridintersections.hh:236
    \n+
    GeometryType type() const
    Geometry type of an intersection.
    Definition identitygridintersections.hh:279
    \n+
    IdentityGridLevelIntersection(const GridImp *identityGrid, HostLevelIntersection &&hostIntersection)
    Definition identitygridintersections.hh:223
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,96 +1,500 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridentityseed.hh\n+identitygridintersections.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITY_GRID_ENTITY_SEED_HH\n-6#define DUNE_IDENTITY_GRID_ENTITY_SEED_HH\n+5#ifndef DUNE_IDENTITYGRID_INTERSECTIONS_HH\n+6#define DUNE_IDENTITYGRID_INTERSECTIONS_HH\n 7\n-14namespace Dune {\n-15\n+8#include \"identitygridleafiterator.hh\"\n+9#include \n+10\n+15namespace Dune {\n 16\n-22 template\n-23 class IdentityGridEntitySeed\n-24 {\n-25 protected:\n-26\n-27 // Entity type of the hostgrid\n-28 typedef typename GridImp::HostGridType::Traits::template Codim::\n-Entity HostEntity;\n-29\n-30 // EntitySeed type of the hostgrid\n-31 typedef typename GridImp::HostGridType::Traits::template Codim::\n-EntitySeed HostEntitySeed;\n-32\n-33 public:\n+17\n+18 // External forward declarations\n+19 template< class Grid >\n+20 struct HostGridAccess;\n+21\n+22\n+31 template\n+32 class IdentityGridLeafIntersection\n+33 {\n 34\n-35 constexpr static int codimension = codim;\n+35 friend class IdentityGridLeafIntersectionIterator;\n 36\n-40 IdentityGridEntitySeed()\n-41 {}\n+37 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;\n+38\n+39 constexpr static int dim = GridImp::dimension;\n+40\n+41 constexpr static int dimworld = GridImp::dimensionworld;\n 42\n-49 IdentityGridEntitySeed(const HostEntity& hostEntity) :\n-50 hostEntitySeed_(hostEntity.seed())\n-51 {}\n-52\n-56 const HostEntitySeed& hostEntitySeed() const\n-57 {\n-58 return hostEntitySeed_;\n-59 }\n-60\n-64 bool isValid() const\n-65 {\n-66 return hostEntitySeed_.isValid();\n-67 }\n-68 private:\n+43 // The type used to store coordinates\n+44 typedef typename GridImp::ctype ctype;\n+45\n+46 typedef typename GridImp::HostGridType::LeafGridView::Intersection\n+HostLeafIntersection;\n+47\n+48 public:\n+49\n+50 typedef typename GridImp::template Codim<1>::Geometry Geometry;\n+51 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;\n+52 typedef typename GridImp::template Codim<0>::Entity Entity;\n+53 typedef FieldVector NormalVector;\n+54\n+55 IdentityGridLeafIntersection()\n+56 {}\n+57\n+58 IdentityGridLeafIntersection(const GridImp* identityGrid,\n+59 const HostLeafIntersection& hostIntersection)\n+60 : identityGrid_(identityGrid)\n+61 , hostIntersection_(hostIntersection)\n+62 {}\n+63\n+64 IdentityGridLeafIntersection(const GridImp* identityGrid,\n+65 HostLeafIntersection&& hostIntersection)\n+66 : identityGrid_(identityGrid)\n+67 , hostIntersection_(std::move(hostIntersection))\n+68 {}\n 69\n-70 HostEntitySeed hostEntitySeed_;\n-71 };\n-72\n-73} // namespace Dune\n+70 bool equals(const IdentityGridLeafIntersection& other) const\n+71 {\n+72 return hostIntersection_ == other.hostIntersection_;\n+73 }\n 74\n-75#endif // #define DUNE_IDENTITY_GRID_ENTITY_SEED_HH\n+77 Entity inside() const {\n+78 return IdentityGridEntity<0,dim,GridImp>\n+(identityGrid_,hostIntersection_.inside());\n+79 }\n+80\n+81\n+84 Entity outside() const {\n+85 return IdentityGridEntity<0,dim,GridImp>\n+(identityGrid_,hostIntersection_.outside());\n+86 }\n+87\n+88\n+90 bool boundary () const {\n+91 return hostIntersection_.boundary();\n+92 }\n+93\n+99 NormalVector centerUnitOuterNormal () const {\n+100 return hostIntersection_.centerUnitOuterNormal();\n+101 }\n+102\n+104 bool neighbor () const {\n+105 return hostIntersection_.neighbor();\n+106 }\n+107\n+109 size_t boundarySegmentIndex() const {\n+110 return hostIntersection_.boundarySegmentIndex();\n+111 }\n+112\n+114 bool conforming () const {\n+115 return hostIntersection_.conforming();\n+116 }\n+117\n+119 GeometryType type () const {\n+120 return hostIntersection_.type();\n+121 }\n+122\n+123\n+128 LocalGeometry geometryInInside () const\n+129 {\n+130 return LocalGeometry( hostIntersection_.geometryInInside() );\n+131 }\n+132\n+135 LocalGeometry geometryInOutside () const\n+136 {\n+137 return LocalGeometry( hostIntersection_.geometryInOutside() );\n+138 }\n+139\n+142 Geometry geometry () const\n+143 {\n+144 return Geometry( hostIntersection_.geometry() );\n+145 }\n+146\n+147\n+149 int indexInInside () const {\n+150 return hostIntersection_.indexInInside();\n+151 }\n+152\n+153\n+155 int indexInOutside () const {\n+156 return hostIntersection_.indexInOutside();\n+157 }\n+158\n+159\n+161 FieldVector outerNormal (const\n+FieldVector& local) const {\n+162 return hostIntersection_.outerNormal(local);\n+163 }\n+164\n+166 FieldVector integrationOuterNormal (const\n+FieldVector& local) const {\n+167 return hostIntersection_.integrationOuterNormal(local);\n+168 }\n+169\n+171 FieldVector unitOuterNormal (const\n+FieldVector& local) const {\n+172 return hostIntersection_.unitOuterNormal(local);\n+173 }\n+174\n+175\n+176 private:\n+177 //**********************************************************\n+178 // private methods\n+179 //**********************************************************\n+180\n+181 const GridImp* identityGrid_;\n+182\n+183 HostLeafIntersection hostIntersection_;\n+184 };\n+185\n+186\n+187\n+188\n+190 template\n+191 class IdentityGridLevelIntersection\n+192 {\n+193\n+194 friend class IdentityGridLevelIntersectionIterator;\n+195\n+196 friend struct HostGridAccess< typename std::remove_const< GridImp >::type\n+>;\n+197\n+198 constexpr static int dim = GridImp::dimension;\n+199\n+200 constexpr static int dimworld = GridImp::dimensionworld;\n+201\n+202 // The type used to store coordinates\n+203 typedef typename GridImp::ctype ctype;\n+204\n+205 typedef typename GridImp::HostGridType::LevelGridView::Intersection\n+HostLevelIntersection;\n+206\n+207 public:\n+208\n+209 typedef typename GridImp::template Codim<1>::Geometry Geometry;\n+210 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;\n+211 typedef typename GridImp::template Codim<0>::Entity Entity;\n+212 typedef FieldVector NormalVector;\n+213\n+214 IdentityGridLevelIntersection()\n+215 {}\n+216\n+217 IdentityGridLevelIntersection(const GridImp* identityGrid,\n+218 const HostLevelIntersection& hostIntersection)\n+219 : identityGrid_(identityGrid)\n+220 , hostIntersection_(hostIntersection)\n+221 {}\n+222\n+223 IdentityGridLevelIntersection(const GridImp* identityGrid,\n+224 HostLevelIntersection&& hostIntersection)\n+225 : identityGrid_(identityGrid)\n+226 , hostIntersection_(std::move(hostIntersection))\n+227 {}\n+228\n+229 bool equals(const IdentityGridLevelIntersection& other) const\n+230 {\n+231 return hostIntersection_ == other.hostIntersection_;\n+232 }\n+233\n+236 Entity inside() const {\n+237 return IdentityGridEntity<0,dim,GridImp>\n+(identityGrid_,hostIntersection_.inside());\n+238 }\n+239\n+240\n+243 Entity outside() const {\n+244 return IdentityGridEntity<0,dim,GridImp>\n+(identityGrid_,hostIntersection_.outside());\n+245 }\n+246\n+247\n+250 bool boundary () const {\n+251 return hostIntersection_.boundary();\n+252 }\n+253\n+259 NormalVector centerUnitOuterNormal () const {\n+260 return hostIntersection_.centerUnitOuterNormal();\n+261 }\n+262\n+264 bool neighbor () const {\n+265 return hostIntersection_.neighbor();\n+266 }\n+267\n+269 size_t boundarySegmentIndex() const {\n+270 return hostIntersection_.boundarySegmentIndex();\n+271 }\n+272\n+274 bool conforming () const {\n+275 return hostIntersection_.conforming();\n+276 }\n+277\n+279 GeometryType type () const {\n+280 return hostIntersection_.type();\n+281 }\n+282\n+283\n+288 LocalGeometry geometryInInside () const\n+289 {\n+290 return LocalGeometry( hostIntersection_.geometryInInside() );\n+291 }\n+292\n+295 LocalGeometry geometryInOutside () const\n+296 {\n+297 return LocalGeometry( hostIntersection_.geometryInOutside() );\n+298 }\n+299\n+302 Geometry geometry () const\n+303 {\n+304 return Geometry( hostIntersection_.geometry() );\n+305 }\n+306\n+307\n+309 int indexInInside () const {\n+310 return hostIntersection_.indexInInside();\n+311 }\n+312\n+313\n+315 int indexInOutside () const {\n+316 return hostIntersection_.indexInOutside();\n+317 }\n+318\n+319\n+321 FieldVector outerNormal (const FieldVector&\n+local) const {\n+322 return hostIntersection_.outerNormal(local);\n+323 }\n+324\n+326 FieldVector integrationOuterNormal (const\n+FieldVector& local) const {\n+327 return hostIntersection_.integrationOuterNormal(local);\n+328 }\n+329\n+331 FieldVector unitOuterNormal (const FieldVector& local) const {\n+332 return hostIntersection_.unitOuterNormal(local);\n+333 }\n+334\n+335 private:\n+336\n+337 const GridImp* identityGrid_;\n+338\n+339 HostLevelIntersection hostIntersection_;\n+340\n+341 };\n+342\n+343\n+344} // namespace Dune\n+345\n+346#endif\n+identitygridentity.hh\n+The IdentityGridEntity class.\n+identitygridleafiterator.hh\n+The IdentityGridLeafIterator class.\n+std\n+STL namespace.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IdentityGridEntitySeed\n-The EntitySeed class provides the minimal information needed to restore an\n-Entity using the grid.\n-Definition identitygridentityseed.hh:24\n-Dune::IdentityGridEntitySeed::codimension\n-static constexpr int codimension\n-Definition identitygridentityseed.hh:35\n-Dune::IdentityGridEntitySeed::IdentityGridEntitySeed\n-IdentityGridEntitySeed()\n-Construct an empty (i.e. isValid() == false) seed.\n-Definition identitygridentityseed.hh:40\n-Dune::IdentityGridEntitySeed::isValid\n-bool isValid() const\n-Check whether it is safe to create an Entity from this Seed.\n-Definition identitygridentityseed.hh:64\n-Dune::IdentityGridEntitySeed::HostEntity\n-GridImp::HostGridType::Traits::template Codim< codim >::Entity HostEntity\n-Definition identitygridentityseed.hh:28\n-Dune::IdentityGridEntitySeed::IdentityGridEntitySeed\n-IdentityGridEntitySeed(const HostEntity &hostEntity)\n-Create EntitySeed from hostgrid Entity.\n-Definition identitygridentityseed.hh:49\n-Dune::IdentityGridEntitySeed::hostEntitySeed\n-const HostEntitySeed & hostEntitySeed() const\n-Get stored HostEntitySeed.\n-Definition identitygridentityseed.hh:56\n-Dune::IdentityGridEntitySeed::HostEntitySeed\n-GridImp::HostGridType::Traits::template Codim< codim >::EntitySeed\n-HostEntitySeed\n-Definition identitygridentityseed.hh:31\n+Dune::HostGridAccess\n+provides access to host grid objects from GeometryGrid\n+Definition identitygrid.hh:37\n+Dune::IdentityGridEntity\n+The implementation of entities in a IdentityGrid.\n+Definition identitygridentity.hh:55\n+Dune::IdentityGridLevelIntersectionIterator\n+Definition identitygridintersectioniterator.hh:84\n+Dune::IdentityGridLeafIntersectionIterator\n+Iterator over all element neighborsMesh entities of codimension 0 (\"elements\")\n+allow to visit all nei...\n+Definition identitygridintersectioniterator.hh:29\n+Dune::IdentityGridLeafIntersection\n+An intersection with a leaf neighbor elementMesh entities of codimension 0\n+(\"elements\") allow to visi...\n+Definition identitygridintersections.hh:33\n+Dune::IdentityGridLeafIntersection::inside\n+Entity inside() const\n+Definition identitygridintersections.hh:77\n+Dune::IdentityGridLeafIntersection::IdentityGridLeafIntersection\n+IdentityGridLeafIntersection(const GridImp *identityGrid, HostLeafIntersection\n+&&hostIntersection)\n+Definition identitygridintersections.hh:64\n+Dune::IdentityGridLeafIntersection::centerUnitOuterNormal\n+NormalVector centerUnitOuterNormal() const\n+Return unit outer normal (length == 1)\n+Definition identitygridintersections.hh:99\n+Dune::IdentityGridLeafIntersection::LocalGeometry\n+GridImp::template Codim< 1 >::LocalGeometry LocalGeometry\n+Definition identitygridintersections.hh:51\n+Dune::IdentityGridLeafIntersection::geometry\n+Geometry geometry() const\n+Definition identitygridintersections.hh:142\n+Dune::IdentityGridLeafIntersection::outside\n+Entity outside() const\n+Definition identitygridintersections.hh:84\n+Dune::IdentityGridLeafIntersection::geometryInOutside\n+LocalGeometry geometryInOutside() const\n+Definition identitygridintersections.hh:135\n+Dune::IdentityGridLeafIntersection::boundary\n+bool boundary() const\n+return true if intersection is with boundary.\n+Definition identitygridintersections.hh:90\n+Dune::IdentityGridLeafIntersection::type\n+GeometryType type() const\n+Geometry type of an intersection.\n+Definition identitygridintersections.hh:119\n+Dune::IdentityGridLeafIntersection::NormalVector\n+FieldVector< ctype, dimworld > NormalVector\n+Definition identitygridintersections.hh:53\n+Dune::IdentityGridLeafIntersection::geometryInInside\n+LocalGeometry geometryInInside() const\n+Definition identitygridintersections.hh:128\n+Dune::IdentityGridLeafIntersection::conforming\n+bool conforming() const\n+Return true if this is a conforming intersection.\n+Definition identitygridintersections.hh:114\n+Dune::IdentityGridLeafIntersection::IdentityGridLeafIntersection\n+IdentityGridLeafIntersection(const GridImp *identityGrid, const\n+HostLeafIntersection &hostIntersection)\n+Definition identitygridintersections.hh:58\n+Dune::IdentityGridLeafIntersection::boundarySegmentIndex\n+size_t boundarySegmentIndex() const\n+return the boundary segment index\n+Definition identitygridintersections.hh:109\n+Dune::IdentityGridLeafIntersection::equals\n+bool equals(const IdentityGridLeafIntersection &other) const\n+Definition identitygridintersections.hh:70\n+Dune::IdentityGridLeafIntersection::outerNormal\n+FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector<\n+ctype, GridImp::dimension-1 > &local) const\n+return outer normal\n+Definition identitygridintersections.hh:161\n+Dune::IdentityGridLeafIntersection::indexInOutside\n+int indexInOutside() const\n+local number of codim 1 entity in neighbor where intersection is contained\n+Definition identitygridintersections.hh:155\n+Dune::IdentityGridLeafIntersection::integrationOuterNormal\n+FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const\n+FieldVector< ctype, GridImp::dimension-1 > &local) const\n+return outer normal multiplied by the integration element\n+Definition identitygridintersections.hh:166\n+Dune::IdentityGridLeafIntersection::neighbor\n+bool neighbor() const\n+return true if across the edge an neighbor on this level exists\n+Definition identitygridintersections.hh:104\n+Dune::IdentityGridLeafIntersection::unitOuterNormal\n+FieldVector< ctype, GridImp::dimensionworld > unitOuterNormal(const\n+FieldVector< ctype, GridImp::dimension-1 > &local) const\n+return unit outer normal\n+Definition identitygridintersections.hh:171\n+Dune::IdentityGridLeafIntersection::indexInInside\n+int indexInInside() const\n+local number of codim 1 entity in self where intersection is contained in\n+Definition identitygridintersections.hh:149\n+Dune::IdentityGridLeafIntersection::Geometry\n+GridImp::template Codim< 1 >::Geometry Geometry\n+Definition identitygridintersections.hh:50\n+Dune::IdentityGridLeafIntersection::Entity\n+GridImp::template Codim< 0 >::Entity Entity\n+Definition identitygridintersections.hh:52\n+Dune::IdentityGridLevelIntersection\n+Definition identitygridintersections.hh:192\n+Dune::IdentityGridLevelIntersection::geometry\n+Geometry geometry() const\n+Definition identitygridintersections.hh:302\n+Dune::IdentityGridLevelIntersection::Entity\n+GridImp::template Codim< 0 >::Entity Entity\n+Definition identitygridintersections.hh:211\n+Dune::IdentityGridLevelIntersection::IdentityGridLevelIntersection\n+IdentityGridLevelIntersection(const GridImp *identityGrid, const\n+HostLevelIntersection &hostIntersection)\n+Definition identitygridintersections.hh:217\n+Dune::IdentityGridLevelIntersection::Geometry\n+GridImp::template Codim< 1 >::Geometry Geometry\n+Definition identitygridintersections.hh:209\n+Dune::IdentityGridLevelIntersection::equals\n+bool equals(const IdentityGridLevelIntersection &other) const\n+Definition identitygridintersections.hh:229\n+Dune::IdentityGridLevelIntersection::neighbor\n+bool neighbor() const\n+return true if across the edge an neighbor on this level exists\n+Definition identitygridintersections.hh:264\n+Dune::IdentityGridLevelIntersection::centerUnitOuterNormal\n+NormalVector centerUnitOuterNormal() const\n+Return unit outer normal (length == 1)\n+Definition identitygridintersections.hh:259\n+Dune::IdentityGridLevelIntersection::conforming\n+bool conforming() const\n+Return true if this is a conforming intersection.\n+Definition identitygridintersections.hh:274\n+Dune::IdentityGridLevelIntersection::indexInInside\n+int indexInInside() const\n+local number of codim 1 entity in self where intersection is contained in\n+Definition identitygridintersections.hh:309\n+Dune::IdentityGridLevelIntersection::outerNormal\n+FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 >\n+&local) const\n+return outer normal\n+Definition identitygridintersections.hh:321\n+Dune::IdentityGridLevelIntersection::LocalGeometry\n+GridImp::template Codim< 1 >::LocalGeometry LocalGeometry\n+Definition identitygridintersections.hh:210\n+Dune::IdentityGridLevelIntersection::NormalVector\n+FieldVector< ctype, dimworld > NormalVector\n+Definition identitygridintersections.hh:212\n+Dune::IdentityGridLevelIntersection::boundary\n+bool boundary() const\n+return true if intersection is with boundary.\n+Definition identitygridintersections.hh:250\n+Dune::IdentityGridLevelIntersection::integrationOuterNormal\n+FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype,\n+dim-1 > &local) const\n+return outer normal multiplied by the integration element\n+Definition identitygridintersections.hh:326\n+Dune::IdentityGridLevelIntersection::geometryInOutside\n+LocalGeometry geometryInOutside() const\n+Definition identitygridintersections.hh:295\n+Dune::IdentityGridLevelIntersection::geometryInInside\n+LocalGeometry geometryInInside() const\n+Definition identitygridintersections.hh:288\n+Dune::IdentityGridLevelIntersection::indexInOutside\n+int indexInOutside() const\n+local number of codim 1 entity in neighbor where intersection is contained\n+Definition identitygridintersections.hh:315\n+Dune::IdentityGridLevelIntersection::unitOuterNormal\n+FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-\n+1 > &local) const\n+return unit outer normal\n+Definition identitygridintersections.hh:331\n+Dune::IdentityGridLevelIntersection::boundarySegmentIndex\n+size_t boundarySegmentIndex() const\n+return the boundary segment index\n+Definition identitygridintersections.hh:269\n+Dune::IdentityGridLevelIntersection::outside\n+Entity outside() const\n+Definition identitygridintersections.hh:243\n+Dune::IdentityGridLevelIntersection::inside\n+Entity inside() const\n+Definition identitygridintersections.hh:236\n+Dune::IdentityGridLevelIntersection::type\n+GeometryType type() const\n+Geometry type of an intersection.\n+Definition identitygridintersections.hh:279\n+Dune::IdentityGridLevelIntersection::IdentityGridLevelIntersection\n+IdentityGridLevelIntersection(const GridImp *identityGrid,\n+HostLevelIntersection &&hostIntersection)\n+Definition identitygridintersections.hh:223\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00752.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00752.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridleveliterator.hh File Reference\n+dune-grid: identitygridentityseed.hh File Reference\n \n \n \n \n \n \n \n@@ -72,38 +72,37 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n
    \n
    \n \n-
    identitygridleveliterator.hh File Reference
    \n+
    identitygridentityseed.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridLevelIterator class. \n+

    The IdentityGridEntitySeed class. \n More...

    \n-\n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdentityGridLevelIterator< codim, pitype, GridImp >
     Iterator over all entities of a given codimension and level of a grid. More...
    class  Dune::IdentityGridEntitySeed< codim, GridImp >
     The EntitySeed class provides the minimal information needed to restore an Entity using the grid. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridLevelIterator class.

    \n+

    The IdentityGridEntitySeed class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,24 +2,23 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridleveliterator.hh File Reference\n-The IdentityGridLevelIterator class. More...\n-#include \n+identitygridentityseed.hh File Reference\n+The IdentityGridEntitySeed class. More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridLevelIterator<_codim,_pitype,_GridImp_>\n-\u00a0 Iterator over all entities of a given codimension and level of a grid.\n- More...\n+class \u00a0 Dune::IdentityGridEntitySeed<_codim,_GridImp_>\n+\u00a0 The EntitySeed class provides the minimal information needed to restore\n+ an Entity using the grid. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridLevelIterator class.\n+The IdentityGridEntitySeed class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00752_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00752_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridleveliterator.hh Source File\n+dune-grid: identitygridentityseed.hh Source File\n \n \n \n \n \n \n \n@@ -74,97 +74,85 @@\n \n \n
    \n
    \n-
    identitygridleveliterator.hh
    \n+
    identitygridentityseed.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRIDLEVELITERATOR_HH
    \n-
    6#define DUNE_IDENTITYGRIDLEVELITERATOR_HH
    \n+
    5#ifndef DUNE_IDENTITY_GRID_ENTITY_SEED_HH
    \n+
    6#define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
    \n
    7
    \n-\n-
    9
    \n
    14namespace Dune {
    \n
    15
    \n-
    19 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n-
    \n-\n-
    21 {
    \n-
    22
    \n-
    23 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::template Partition<pitype>::LevelIterator HostGridLevelIterator;
    \n-
    24
    \n-
    25 public:
    \n+
    16
    \n+
    22 template<int codim, class GridImp>
    \n+
    \n+\n+
    24 {
    \n+
    25 protected:
    \n
    26
    \n-
    27 constexpr static int codimension = codim;
    \n-
    28
    \n-
    29 typedef typename GridImp::template Codim<codim>::Entity Entity;
    \n-
    30
    \n-
    \n-
    32 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level)
    \n-
    33 : identityGrid_(identityGrid),
    \n-
    34 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template begin<codim,pitype>())
    \n-
    35 {}
    \n-
    \n+
    27 // Entity type of the hostgrid
    \n+
    28 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::Entity HostEntity;
    \n+
    29
    \n+
    30 // EntitySeed type of the hostgrid
    \n+
    31 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::EntitySeed HostEntitySeed;
    \n+
    32
    \n+
    33 public:
    \n+
    34
    \n+
    35 constexpr static int codimension = codim;
    \n
    36
    \n-
    37
    \n-
    \n-
    43 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level, [[maybe_unused]] bool endDummy)
    \n-
    44 : identityGrid_(identityGrid),
    \n-
    45 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template end<codim,pitype>())
    \n-
    46 {}
    \n-
    \n-
    47
    \n-
    48
    \n-
    \n-
    50 void increment() {
    \n-
    51 ++hostLevelIterator_;
    \n-
    52 }
    \n-
    \n-
    53
    \n-
    \n-\n-
    56 return Entity{{identityGrid_,*hostLevelIterator_}};
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    \n-
    60 bool equals(const IdentityGridLevelIterator& i) const {
    \n-
    61 return hostLevelIterator_ == i.hostLevelIterator_;
    \n-
    62 }
    \n-
    \n-
    63
    \n-
    64 private:
    \n-
    65 const GridImp* identityGrid_;
    \n-
    66
    \n-
    67 HostGridLevelIterator hostLevelIterator_;
    \n-
    68 };
    \n+
    \n+\n+
    41 {}
    \n+
    \n+
    42
    \n+
    \n+\n+
    50 hostEntitySeed_(hostEntity.seed())
    \n+
    51 {}
    \n+
    \n+
    52
    \n+
    \n+\n+
    57 {
    \n+
    58 return hostEntitySeed_;
    \n+
    59 }
    \n+
    \n+
    60
    \n+
    \n+
    64 bool isValid() const
    \n+
    65 {
    \n+
    66 return hostEntitySeed_.isValid();
    \n+
    67 }
    \n
    \n+
    68 private:
    \n
    69
    \n-
    70
    \n-
    71} // namespace Dune
    \n+
    70 HostEntitySeed hostEntitySeed_;
    \n+
    71 };
    \n+
    \n
    72
    \n-
    73#endif
    \n-\n-
    Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
    level grid view for the given grid and level.
    Definition common/grid.hh:788
    \n+
    73} // namespace Dune
    \n+
    74
    \n+
    75#endif // #define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Iterator over all entities of a given codimension and level of a grid.
    Definition identitygridleveliterator.hh:21
    \n-
    void increment()
    prefix increment
    Definition identitygridleveliterator.hh:50
    \n-
    GridImp::template Codim< codim >::Entity Entity
    Definition identitygridleveliterator.hh:29
    \n-
    IdentityGridLevelIterator(const GridImp *identityGrid, int level)
    Constructor.
    Definition identitygridleveliterator.hh:32
    \n-
    IdentityGridLevelIterator(const GridImp *identityGrid, int level, bool endDummy)
    Constructor which create the end iterator.
    Definition identitygridleveliterator.hh:43
    \n-
    static constexpr int codimension
    Definition identitygridleveliterator.hh:27
    \n-
    bool equals(const IdentityGridLevelIterator &i) const
    equality
    Definition identitygridleveliterator.hh:60
    \n-
    Entity dereference() const
    dereferencing
    Definition identitygridleveliterator.hh:55
    \n+
    The EntitySeed class provides the minimal information needed to restore an Entity using the grid.
    Definition identitygridentityseed.hh:24
    \n+
    static constexpr int codimension
    Definition identitygridentityseed.hh:35
    \n+
    IdentityGridEntitySeed()
    Construct an empty (i.e. isValid() == false) seed.
    Definition identitygridentityseed.hh:40
    \n+
    bool isValid() const
    Check whether it is safe to create an Entity from this Seed.
    Definition identitygridentityseed.hh:64
    \n+
    GridImp::HostGridType::Traits::template Codim< codim >::Entity HostEntity
    Definition identitygridentityseed.hh:28
    \n+
    IdentityGridEntitySeed(const HostEntity &hostEntity)
    Create EntitySeed from hostgrid Entity.
    Definition identitygridentityseed.hh:49
    \n+
    const HostEntitySeed & hostEntitySeed() const
    Get stored HostEntitySeed.
    Definition identitygridentityseed.hh:56
    \n+
    GridImp::HostGridType::Traits::template Codim< codim >::EntitySeed HostEntitySeed
    Definition identitygridentityseed.hh:31
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,112 +1,96 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridleveliterator.hh\n+identitygridentityseed.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRIDLEVELITERATOR_HH\n-6#define DUNE_IDENTITYGRIDLEVELITERATOR_HH\n+5#ifndef DUNE_IDENTITY_GRID_ENTITY_SEED_HH\n+6#define DUNE_IDENTITY_GRID_ENTITY_SEED_HH\n 7\n-8#include \n-9\n 14namespace Dune {\n 15\n-19 template\n-20 class IdentityGridLevelIterator\n-21 {\n-22\n-23 typedef typename GridImp::HostGridType::Traits::template Codim::\n-template Partition::LevelIterator HostGridLevelIterator;\n-24\n-25 public:\n+16\n+22 template\n+23 class IdentityGridEntitySeed\n+24 {\n+25 protected:\n 26\n-27 constexpr static int codimension = codim;\n-28\n-29 typedef typename GridImp::template Codim::Entity Entity;\n-30\n-32 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level)\n-33 : identityGrid_(identityGrid),\n-34 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template\n-begin())\n-35 {}\n+27 // Entity type of the hostgrid\n+28 typedef typename GridImp::HostGridType::Traits::template Codim::\n+Entity HostEntity;\n+29\n+30 // EntitySeed type of the hostgrid\n+31 typedef typename GridImp::HostGridType::Traits::template Codim::\n+EntitySeed HostEntitySeed;\n+32\n+33 public:\n+34\n+35 constexpr static int codimension = codim;\n 36\n-37\n-43 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level, [\n-[maybe_unused]] bool endDummy)\n-44 : identityGrid_(identityGrid),\n-45 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template\n-end())\n-46 {}\n-47\n-48\n-50 void increment() {\n-51 ++hostLevelIterator_;\n-52 }\n-53\n-55 Entity dereference() const {\n-56 return Entity{{identityGrid_,*hostLevelIterator_}};\n-57 }\n-58\n-60 bool equals(const IdentityGridLevelIterator& i) const {\n-61 return hostLevelIterator_ == i.hostLevelIterator_;\n-62 }\n-63\n-64 private:\n-65 const GridImp* identityGrid_;\n-66\n-67 HostGridLevelIterator hostLevelIterator_;\n-68 };\n+40 IdentityGridEntitySeed()\n+41 {}\n+42\n+49 IdentityGridEntitySeed(const HostEntity& hostEntity) :\n+50 hostEntitySeed_(hostEntity.seed())\n+51 {}\n+52\n+56 const HostEntitySeed& hostEntitySeed() const\n+57 {\n+58 return hostEntitySeed_;\n+59 }\n+60\n+64 bool isValid() const\n+65 {\n+66 return hostEntitySeed_.isValid();\n+67 }\n+68 private:\n 69\n-70\n-71} // namespace Dune\n+70 HostEntitySeed hostEntitySeed_;\n+71 };\n 72\n-73#endif\n-gridenums.hh\n-Dune::levelGridView\n-Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid<\n-dim, dimworld, ct, GridFamily > &grid, int level)\n-level grid view for the given grid and level.\n-Definition common/grid.hh:788\n+73} // namespace Dune\n+74\n+75#endif // #define DUNE_IDENTITY_GRID_ENTITY_SEED_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IdentityGridLevelIterator\n-Iterator over all entities of a given codimension and level of a grid.\n-Definition identitygridleveliterator.hh:21\n-Dune::IdentityGridLevelIterator::increment\n-void increment()\n-prefix increment\n-Definition identitygridleveliterator.hh:50\n-Dune::IdentityGridLevelIterator::Entity\n-GridImp::template Codim< codim >::Entity Entity\n-Definition identitygridleveliterator.hh:29\n-Dune::IdentityGridLevelIterator::IdentityGridLevelIterator\n-IdentityGridLevelIterator(const GridImp *identityGrid, int level)\n-Constructor.\n-Definition identitygridleveliterator.hh:32\n-Dune::IdentityGridLevelIterator::IdentityGridLevelIterator\n-IdentityGridLevelIterator(const GridImp *identityGrid, int level, bool\n-endDummy)\n-Constructor which create the end iterator.\n-Definition identitygridleveliterator.hh:43\n-Dune::IdentityGridLevelIterator::codimension\n+Dune::IdentityGridEntitySeed\n+The EntitySeed class provides the minimal information needed to restore an\n+Entity using the grid.\n+Definition identitygridentityseed.hh:24\n+Dune::IdentityGridEntitySeed::codimension\n static constexpr int codimension\n-Definition identitygridleveliterator.hh:27\n-Dune::IdentityGridLevelIterator::equals\n-bool equals(const IdentityGridLevelIterator &i) const\n-equality\n-Definition identitygridleveliterator.hh:60\n-Dune::IdentityGridLevelIterator::dereference\n-Entity dereference() const\n-dereferencing\n-Definition identitygridleveliterator.hh:55\n+Definition identitygridentityseed.hh:35\n+Dune::IdentityGridEntitySeed::IdentityGridEntitySeed\n+IdentityGridEntitySeed()\n+Construct an empty (i.e. isValid() == false) seed.\n+Definition identitygridentityseed.hh:40\n+Dune::IdentityGridEntitySeed::isValid\n+bool isValid() const\n+Check whether it is safe to create an Entity from this Seed.\n+Definition identitygridentityseed.hh:64\n+Dune::IdentityGridEntitySeed::HostEntity\n+GridImp::HostGridType::Traits::template Codim< codim >::Entity HostEntity\n+Definition identitygridentityseed.hh:28\n+Dune::IdentityGridEntitySeed::IdentityGridEntitySeed\n+IdentityGridEntitySeed(const HostEntity &hostEntity)\n+Create EntitySeed from hostgrid Entity.\n+Definition identitygridentityseed.hh:49\n+Dune::IdentityGridEntitySeed::hostEntitySeed\n+const HostEntitySeed & hostEntitySeed() const\n+Get stored HostEntitySeed.\n+Definition identitygridentityseed.hh:56\n+Dune::IdentityGridEntitySeed::HostEntitySeed\n+GridImp::HostGridType::Traits::template Codim< codim >::EntitySeed\n+HostEntitySeed\n+Definition identitygridentityseed.hh:31\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00755.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00755.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridindexsets.hh File Reference\n+dune-grid: identitygridgeometry.hh File Reference\n \n \n \n \n \n \n \n@@ -72,44 +72,39 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n
    \n
    \n \n-
    identitygridindexsets.hh File Reference
    \n+
    identitygridgeometry.hh File Reference
    \n
    \n
    \n \n-

    The index and id sets for the IdentityGrid class. \n+

    The IdentityGridGeometry class and its specializations. \n More...

    \n-
    #include <dune/grid/common/indexidset.hh>
    \n-#include <vector>
    \n+
    #include <dune/common/fmatrix.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/common/geometry.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::IdentityGridLevelIndexSet< GridImp >
     
    class  Dune::IdentityGridLeafIndexSet< GridImp >
     
    class  Dune::IdentityGridGlobalIdSet< GridImp >
     
    class  Dune::IdentityGridLocalIdSet< GridImp >
    class  Dune::IdentityGridGeometry< mydim, coorddim, GridImp >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The index and id sets for the IdentityGrid class.

    \n+

    The IdentityGridGeometry class and its specializations.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,24 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridindexsets.hh File Reference\n-The index and id sets for the IdentityGrid class. More...\n-#include \n-#include \n+identitygridgeometry.hh File Reference\n+The IdentityGridGeometry class and its specializations. More...\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridLevelIndexSet<_GridImp_>\n-\u00a0\n-class \u00a0 Dune::IdentityGridLeafIndexSet<_GridImp_>\n-\u00a0\n-class \u00a0 Dune::IdentityGridGlobalIdSet<_GridImp_>\n-\u00a0\n-class \u00a0 Dune::IdentityGridLocalIdSet<_GridImp_>\n+class \u00a0 Dune::IdentityGridGeometry<_mydim,_coorddim,_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The index and id sets for the IdentityGrid class.\n+The IdentityGridGeometry class and its specializations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00755_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00755_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridindexsets.hh Source File\n+dune-grid: identitygridgeometry.hh Source File\n \n \n \n \n \n \n \n@@ -74,364 +74,162 @@\n \n \n
    \n
    \n-
    identitygridindexsets.hh
    \n+
    identitygridgeometry.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRID_INDEXSETS_HH
    \n-
    6#define DUNE_IDENTITYGRID_INDEXSETS_HH
    \n+
    5#ifndef DUNE_IDENTITYGRIDGEOMETRY_HH
    \n+
    6#define DUNE_IDENTITYGRIDGEOMETRY_HH
    \n
    7
    \n-\n-
    13
    \n-
    14#include <vector>
    \n+
    12#include <dune/common/fmatrix.hh>
    \n+
    13#include <dune/common/typetraits.hh>
    \n+\n
    15
    \n
    16namespace Dune {
    \n
    17
    \n-
    19 template<class GridImp>
    \n-
    \n-\n-
    21 public IndexSet<GridImp,
    \n-
    22 IdentityGridLevelIndexSet<GridImp>,
    \n-
    23 typename std::remove_const<GridImp>::type::HostGridType::LevelGridView::IndexSet::IndexType,
    \n-
    24 typename std::remove_const<GridImp>::type::HostGridType::LevelGridView::IndexSet::Types
    \n-
    25 >
    \n-
    26 {
    \n+
    18 template<int mydim, int coorddim, class GridImp>
    \n+
    \n+\n+
    20 public GeometryDefaultImplementation <mydim, coorddim, GridImp, IdentityGridGeometry>
    \n+
    21 {
    \n+
    22 private:
    \n+
    23
    \n+
    24 typedef typename GridImp::ctype ctype;
    \n+
    25
    \n+
    26
    \n
    27 public:
    \n
    28
    \n-
    29 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n-
    30 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;
    \n-
    31
    \n-
    32 constexpr static int dim = GridImp::dimension;
    \n-
    33
    \n-
    35 template<int codim>
    \n-
    \n-
    36 int index (const typename GridImp::Traits::template Codim<codim>::Entity& e) const
    \n-
    37 {
    \n-
    38 return grid_->hostgrid_->levelIndexSet(level_).template index<codim>(grid_->template getHostEntity<codim>(e));
    \n-
    39 }
    \n-
    \n-
    40
    \n-
    41
    \n-
    43 template<int cc>
    \n-
    \n-
    44 int subIndex (const typename GridImp::Traits::template Codim<cc>::Entity& e, int i, int codim) const
    \n-
    45 {
    \n-
    46 return grid_->hostgrid_->levelIndexSet(level_).subIndex(grid_->template getHostEntity<cc>(e), i, codim);
    \n-
    47 }
    \n+
    29 // The codimension of this entitypointer wrt the host grid
    \n+
    30 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - mydim;
    \n+
    31 constexpr static int DimensionWorld = GridImp::HostGridType::dimensionworld;
    \n+
    32
    \n+
    33 // select appropriate hostgrid geometry via typeswitch
    \n+
    34 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridGeometryType;
    \n+
    35 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridLocalGeometryType;
    \n+
    36
    \n+
    37 typedef typename std::conditional<coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType>::type HostGridGeometry;
    \n+
    38
    \n+
    40 typedef typename HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed;
    \n+
    41 typedef typename HostGridGeometryType::JacobianTransposed JacobianTransposed;
    \n+
    42
    \n+
    43
    \n+
    \n+\n+
    47 : hostGeometry_(hostGeometry)
    \n+
    48 {}
    \n
    \n-
    48
    \n
    49
    \n-
    \n-
    51 std::size_t size (int codim) const {
    \n-
    52 return grid_->hostgrid_->levelIndexSet(level_).size(codim);
    \n-
    53 }
    \n-
    \n-
    54
    \n-
    55
    \n-
    \n-
    57 std::size_t size (GeometryType type) const
    \n-
    58 {
    \n-
    59 return grid_->hostgrid_->levelIndexSet(level_).size(type);
    \n+
    50
    \n+
    \n+
    53 GeometryType type () const {
    \n+
    54 return hostGeometry_.type();
    \n+
    55 }
    \n+
    \n+
    56
    \n+
    57 // return whether we have an affine mapping
    \n+
    \n+
    58 bool affine() const {
    \n+
    59 return hostGeometry_.affine();
    \n
    60 }
    \n
    \n
    61
    \n
    \n-
    63 Types types (int codim) const
    \n-
    64 {
    \n-
    65 return grid_->hostgrid_->levelIndexSet(level_).types(codim);
    \n-
    66 }
    \n+
    63 int corners () const {
    \n+
    64 return hostGeometry_.corners();
    \n+
    65 }
    \n
    \n+
    66
    \n
    67
    \n-
    69 template<class EntityType>
    \n-
    \n-
    70 bool contains (const EntityType& e) const
    \n-
    71 {
    \n-
    72 return grid_->hostgrid_->levelIndexSet(level_).contains(grid_->template getHostEntity<EntityType::codimension>(e));
    \n-
    73 }
    \n+
    \n+
    69 const FieldVector<ctype, coorddim> corner (int i) const {
    \n+
    70 return hostGeometry_.corner(i);
    \n+
    71 }
    \n
    \n-
    74
    \n+
    72
    \n+
    73
    \n
    \n-
    76 void update(const GridImp& grid, int level)
    \n-
    77 {
    \n-
    78 grid_ = &grid;
    \n-
    79 level_ = level;
    \n-
    80 }
    \n-
    \n-
    81
    \n-
    82
    \n-
    83 GridImp* grid_;
    \n-
    84
    \n-
    85 int level_;
    \n-
    86 };
    \n-
    \n-
    87
    \n-
    88
    \n-
    89 template<class GridImp>
    \n-
    \n-\n-
    91 public IndexSet<GridImp,
    \n-
    92 IdentityGridLeafIndexSet<GridImp>,
    \n-
    93 typename std::remove_const<GridImp>::type::HostGridType::LeafGridView::IndexSet::IndexType,
    \n-
    94 typename std::remove_const<GridImp>::type::HostGridType::LeafGridView::IndexSet::Types
    \n-
    95 >
    \n-
    96 {
    \n-
    97 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n-
    98
    \n-
    99 public:
    \n-
    100
    \n-
    101 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;
    \n-
    102
    \n-
    103 /*
    \n-
    104 * We use the remove_const to extract the Type from the mutable class,
    \n-
    105 * because the const class is not instantiated yet.
    \n-
    106 */
    \n-
    107 constexpr static int dim = std::remove_const<GridImp>::type::dimension;
    \n-
    108
    \n-
    109
    \n-
    \n-
    111 IdentityGridLeafIndexSet (const GridImp& grid)
    \n-
    112 : grid_(&grid)
    \n-
    113 {}
    \n+
    76 FieldVector<ctype, coorddim> global (const FieldVector<ctype, mydim>& local) const {
    \n+
    77 return hostGeometry_.global(local);
    \n+
    78 }
    \n+
    \n+
    79
    \n+\n+
    \n+
    83 jacobianTransposed ( const FieldVector<ctype, mydim>& local ) const {
    \n+
    84 return hostGeometry_.jacobianTransposed(local);
    \n+
    85 }
    \n+
    \n+
    86
    \n+
    \n+
    89 FieldVector<ctype, mydim> local (const FieldVector<ctype, coorddim>& global) const {
    \n+
    90 return hostGeometry_.local(global);
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    93
    \n+
    \n+
    95 bool checkInside(const FieldVector<ctype, mydim> &local) const {
    \n+
    96 return hostGeometry_.checkInside(local);
    \n+
    97 }
    \n
    \n+
    98
    \n+
    99
    \n+
    \n+
    102 ctype integrationElement (const FieldVector<ctype, mydim>& local) const {
    \n+
    103 return hostGeometry_.integrationElement(local);
    \n+
    104 }
    \n+
    \n+
    105
    \n+
    106
    \n+
    \n+
    108 JacobianInverseTransposed jacobianInverseTransposed (const FieldVector<ctype, mydim>& local) const {
    \n+
    109 return hostGeometry_.jacobianInverseTransposed(local);
    \n+
    110 }
    \n+
    \n+
    111
    \n+
    112
    \n+\n
    114
    \n-
    115
    \n-
    117 /*
    \n-
    118 We use the RemoveConst to extract the Type from the mutable class,
    \n-
    119 because the const class is not instantiated yet.
    \n-
    120 */
    \n-
    121 template<int codim>
    \n-
    \n-
    122 int index (const typename std::remove_const<GridImp>::type::template Codim<codim>::Entity& e) const
    \n-
    123 {
    \n-
    124 return grid_->hostgrid_->leafIndexSet().template index<codim>(grid_->template getHostEntity<codim>(e));
    \n-
    125 }
    \n-
    \n-
    126
    \n-
    127
    \n-
    129 /*
    \n-
    130 We use the RemoveConst to extract the Type from the mutable class,
    \n-
    131 because the const class is not instantiated yet.
    \n-
    132 */
    \n-
    133 template<int cc>
    \n-
    \n-
    134 int subIndex (const typename std::remove_const<GridImp>::type::Traits::template Codim<cc>::Entity& e, int i, int codim) const
    \n-
    135 {
    \n-
    136 return grid_->hostgrid_->leafIndexSet().subIndex(grid_->template getHostEntity<cc>(e),i, codim);
    \n-
    137 }
    \n-
    \n-
    138
    \n-
    139
    \n-
    \n-
    141 std::size_t size (GeometryType type) const
    \n-
    142 {
    \n-
    143 return grid_->hostgrid_->leafIndexSet().size(type);
    \n-
    144 }
    \n-
    \n-
    145
    \n-
    146
    \n-
    \n-
    148 std::size_t size (int codim) const
    \n-
    149 {
    \n-
    150 return grid_->hostgrid_->leafIndexSet().size(codim);
    \n-
    151 }
    \n-
    \n-
    152
    \n-
    \n-
    154 Types types (int codim) const
    \n-
    155 {
    \n-
    156 return grid_->hostgrid_->leafIndexSet().types(codim);
    \n-
    157 }
    \n-
    \n-
    158
    \n-
    160 template<class EntityType>
    \n-
    \n-
    161 bool contains (const EntityType& e) const
    \n-
    162 {
    \n-
    163 return grid_->hostgrid_->leafIndexSet().contains(grid_->template getHostEntity<EntityType::codimension>(e));
    \n-
    164 }
    \n-
    \n-
    165
    \n-
    166
    \n-
    167
    \n-
    \n-
    169 void update(const GridImp& grid)
    \n-
    170 {
    \n-
    171 grid_ = &grid;
    \n-
    172 }
    \n-
    \n-
    173
    \n-
    174
    \n-
    175 GridImp* grid_;
    \n-
    176 };
    \n-
    \n-
    177
    \n-
    178
    \n-
    179
    \n-
    180
    \n-
    181 template <class GridImp>
    \n-
    \n-\n-
    183 public IdSet<GridImp,IdentityGridGlobalIdSet<GridImp>,
    \n-
    184 typename std::remove_const<GridImp>::type::HostGridType::Traits::GlobalIdSet::IdType>
    \n-
    185 {
    \n-
    186
    \n-
    187 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n-
    188
    \n-
    189
    \n-
    190 public:
    \n-
    192 IdentityGridGlobalIdSet (const GridImp& g) : grid_(&g) {}
    \n-
    193
    \n-
    195 typedef typename HostGrid::Traits::GlobalIdSet::IdType IdType;
    \n-
    196
    \n-
    197
    \n-
    199 /*
    \n-
    200 We use the remove_const to extract the Type from the mutable class,
    \n-
    201 because the const class is not instantiated yet.
    \n-
    202 */
    \n-
    203 template<int cd>
    \n-
    \n-
    204 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
    \n-
    205 {
    \n-
    206 // Return id of the host entity
    \n-
    207 return grid_->hostgrid_->globalIdSet().id(e.impl().hostEntity_);
    \n-
    208 }
    \n-
    \n-
    209
    \n-
    210
    \n-
    212 /*
    \n-
    213 We use the remove_const to extract the Type from the mutable class,
    \n-
    214 because the const class is not instantiated yet.
    \n-
    215 */
    \n-
    \n-
    216 IdType subId (const typename std::remove_const<GridImp>::type::Traits::template Codim<0>::Entity& e, int i, int codim) const
    \n-
    217 {
    \n-
    218 // Return sub id of the host entity
    \n-
    219 return grid_->hostgrid_->globalIdSet().subId(e.impl().hostEntity_,i, codim);
    \n-
    220 }
    \n-
    \n-
    221
    \n-
    222
    \n-
    224 void update() {}
    \n-
    225
    \n-
    226
    \n-
    227 const GridImp* grid_;
    \n-
    228 };
    \n-
    \n-
    229
    \n-
    230
    \n-
    231
    \n-
    232
    \n-
    233 template<class GridImp>
    \n-
    \n-\n-
    235 public IdSet<GridImp,IdentityGridLocalIdSet<GridImp>,
    \n-
    236 typename std::remove_const<GridImp>::type::HostGridType::Traits::LocalIdSet::IdType>
    \n-
    237 {
    \n-
    238 private:
    \n-
    239
    \n-
    240 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
    \n-
    241
    \n-
    242
    \n-
    243 public:
    \n-
    245 typedef typename HostGrid::Traits::LocalIdSet::IdType IdType;
    \n-
    246
    \n-
    247
    \n-
    249 IdentityGridLocalIdSet (const GridImp& g) : grid_(&g) {}
    \n-
    250
    \n-
    251
    \n-
    253 /*
    \n-
    254 We use the remove_const to extract the Type from the mutable class,
    \n-
    255 because the const class is not instantiated yet.
    \n-
    256 */
    \n-
    257 template<int cd>
    \n-
    \n-
    258 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
    \n-
    259 {
    \n-
    260 // Return id of the host entity
    \n-
    261 return grid_->hostgrid_->localIdSet().id(e.impl().hostEntity_);
    \n-
    262 }
    \n-
    \n-
    263
    \n-
    264
    \n-
    266 /*
    \n-
    267 * We use the remove_const to extract the Type from the mutable class,
    \n-
    268 * because the const class is not instantiated yet.
    \n-
    269 */
    \n-
    \n-
    270 IdType subId (const typename std::remove_const<GridImp>::type::template Codim<0>::Entity& e, int i, int codim) const
    \n-
    271 {
    \n-
    272 // Return sub id of the host entity
    \n-
    273 return grid_->hostgrid_->localIdSet().subId(e.impl().hostEntity_,i,codim);
    \n-
    274 }
    \n-
    \n-
    275
    \n-
    276
    \n-
    278 void update() {}
    \n-
    279
    \n-
    280
    \n-
    281 const GridImp* grid_;
    \n-
    282 };
    \n-
    \n-
    283
    \n-
    284
    \n-
    285} // namespace Dune
    \n-
    286
    \n-
    287
    \n-
    288#endif
    \n+
    115 };
    \n+
    \n+
    116
    \n+
    117} // namespace Dune
    \n+
    118
    \n+
    119#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n-
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n-
    Definition identitygridindexsets.hh:26
    \n-
    bool contains(const EntityType &e) const
    Return true if the given entity is contained in the index set.
    Definition identitygridindexsets.hh:70
    \n-
    int index(const typename GridImp::Traits::template Codim< codim >::Entity &e) const
    get index of an entity
    Definition identitygridindexsets.hh:36
    \n-
    GridImp * grid_
    Definition identitygridindexsets.hh:83
    \n-
    std::remove_const< GridImp >::type::HostGridType HostGrid
    Definition identitygridindexsets.hh:29
    \n-
    Types types(int codim) const
    Deliver all geometry types used in this grid.
    Definition identitygridindexsets.hh:63
    \n-
    std::size_t size(GeometryType type) const
    get number of entities of given codim, type and on this level
    Definition identitygridindexsets.hh:57
    \n-
    static constexpr int dim
    Definition identitygridindexsets.hh:32
    \n-
    HostGrid::LevelGridView::IndexSet::Types Types
    Definition identitygridindexsets.hh:30
    \n-
    std::size_t size(int codim) const
    get number of entities of given codim, type and on this level
    Definition identitygridindexsets.hh:51
    \n-
    int subIndex(const typename GridImp::Traits::template Codim< cc >::Entity &e, int i, int codim) const
    get index of subEntity of a codim 0 entity
    Definition identitygridindexsets.hh:44
    \n-
    int level_
    Definition identitygridindexsets.hh:85
    \n-
    void update(const GridImp &grid, int level)
    Set up the index set.
    Definition identitygridindexsets.hh:76
    \n-
    Definition identitygridindexsets.hh:96
    \n-
    IdentityGridLeafIndexSet(const GridImp &grid)
    constructor stores reference to a grid and level
    Definition identitygridindexsets.hh:111
    \n-
    static constexpr int dim
    Definition identitygridindexsets.hh:107
    \n-
    std::size_t size(int codim) const
    get number of entities of given codim
    Definition identitygridindexsets.hh:148
    \n-
    bool contains(const EntityType &e) const
    Return true if the given entity is contained in the index set.
    Definition identitygridindexsets.hh:161
    \n-
    std::size_t size(GeometryType type) const
    get number of entities of given type
    Definition identitygridindexsets.hh:141
    \n-
    HostGrid::LevelGridView::IndexSet::Types Types
    Definition identitygridindexsets.hh:101
    \n-
    int index(const typename std::remove_const< GridImp >::type::template Codim< codim >::Entity &e) const
    get index of an entity
    Definition identitygridindexsets.hh:122
    \n-
    int subIndex(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e, int i, int codim) const
    get index of subEntity of a codim 0 entity
    Definition identitygridindexsets.hh:134
    \n-
    Types types(int codim) const
    Deliver all geometry types used in this grid.
    Definition identitygridindexsets.hh:154
    \n-
    GridImp * grid_
    Definition identitygridindexsets.hh:175
    \n-
    void update(const GridImp &grid)
    Definition identitygridindexsets.hh:169
    \n-
    Definition identitygridindexsets.hh:185
    \n-
    IdentityGridGlobalIdSet(const GridImp &g)
    constructor stores reference to a grid
    Definition identitygridindexsets.hh:192
    \n-
    void update()
    Definition identitygridindexsets.hh:224
    \n-
    const GridImp * grid_
    Definition identitygridindexsets.hh:227
    \n-
    HostGrid::Traits::GlobalIdSet::IdType IdType
    define the type used for persistent indices
    Definition identitygridindexsets.hh:195
    \n-
    IdType subId(const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, int codim) const
    get id of subEntity
    Definition identitygridindexsets.hh:216
    \n-
    IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
    get id of an entity
    Definition identitygridindexsets.hh:204
    \n-
    Definition identitygridindexsets.hh:237
    \n-
    IdType subId(const typename std::remove_const< GridImp >::type::template Codim< 0 >::Entity &e, int i, int codim) const
    get id of subEntity
    Definition identitygridindexsets.hh:270
    \n-
    IdentityGridLocalIdSet(const GridImp &g)
    constructor stores reference to a grid
    Definition identitygridindexsets.hh:249
    \n-
    const GridImp * grid_
    Definition identitygridindexsets.hh:281
    \n-
    void update()
    Definition identitygridindexsets.hh:278
    \n-
    IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
    get id of an entity
    Definition identitygridindexsets.hh:258
    \n-
    HostGrid::Traits::LocalIdSet::IdType IdType
    define the type used for persistent local ids
    Definition identitygridindexsets.hh:245
    \n-
    Provides base classes for index and id sets.
    \n+
    Default implementation for class Geometry.
    Definition common/geometry.hh:406
    \n+
    Definition identitygridgeometry.hh:21
    \n+
    bool checkInside(const FieldVector< ctype, mydim > &local) const
    Returns true if the point is in the current element.
    Definition identitygridgeometry.hh:95
    \n+
    JacobianInverseTransposed jacobianInverseTransposed(const FieldVector< ctype, mydim > &local) const
    The Jacobian matrix of the mapping from the reference element to this element.
    Definition identitygridgeometry.hh:108
    \n+
    JacobianTransposed jacobianTransposed(const FieldVector< ctype, mydim > &local) const
    Return the transposed of the Jacobian.
    Definition identitygridgeometry.hh:83
    \n+
    std::conditional< coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType >::type HostGridGeometry
    Definition identitygridgeometry.hh:37
    \n+
    bool affine() const
    Definition identitygridgeometry.hh:58
    \n+
    static constexpr int CodimInHostGrid
    Definition identitygridgeometry.hh:30
    \n+
    FieldVector< ctype, coorddim > global(const FieldVector< ctype, mydim > &local) const
    Maps a local coordinate within reference element to global coordinate in element
    Definition identitygridgeometry.hh:76
    \n+
    IdentityGridGeometry(const HostGridGeometry &hostGeometry)
    Definition identitygridgeometry.hh:46
    \n+
    GeometryType type() const
    Return the element type identifier.
    Definition identitygridgeometry.hh:53
    \n+
    const FieldVector< ctype, coorddim > corner(int i) const
    access to coordinates of corners. Index is the number of the corner
    Definition identitygridgeometry.hh:69
    \n+
    HostGridGeometryType::JacobianTransposed JacobianTransposed
    Definition identitygridgeometry.hh:41
    \n+
    ctype integrationElement(const FieldVector< ctype, mydim > &local) const
    Definition identitygridgeometry.hh:102
    \n+
    HostGridGeometry hostGeometry_
    Definition identitygridgeometry.hh:113
    \n+
    GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry HostGridLocalGeometryType
    Definition identitygridgeometry.hh:35
    \n+
    GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry HostGridGeometryType
    Definition identitygridgeometry.hh:34
    \n+
    HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed
    type of jacobian transposed
    Definition identitygridgeometry.hh:40
    \n+
    static constexpr int DimensionWorld
    Definition identitygridgeometry.hh:31
    \n+
    FieldVector< ctype, mydim > local(const FieldVector< ctype, coorddim > &global) const
    Maps a global coordinate within the element to a local coordinate in its reference element.
    Definition identitygridgeometry.hh:89
    \n+
    int corners() const
    return the number of corners of this element. Corners are numbered 0...n-1
    Definition identitygridgeometry.hh:63
    \n+
    Wrapper and interface classes for element geometries.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,445 +1,205 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridindexsets.hh\n+identitygridgeometry.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRID_INDEXSETS_HH\n-6#define DUNE_IDENTITYGRID_INDEXSETS_HH\n+5#ifndef DUNE_IDENTITYGRIDGEOMETRY_HH\n+6#define DUNE_IDENTITYGRIDGEOMETRY_HH\n 7\n-12#include \n-13\n-14#include \n+12#include \n+13#include \n+14#include \n 15\n 16namespace Dune {\n 17\n-19 template\n-20 class IdentityGridLevelIndexSet :\n-21 public IndexSet,\n-23 typename std::remove_const::type::HostGridType::LevelGridView::\n-IndexSet::IndexType,\n-24 typename std::remove_const::type::HostGridType::LevelGridView::\n-IndexSet::Types\n-25 >\n-26 {\n+18 template\n+19 class IdentityGridGeometry :\n+20 public GeometryDefaultImplementation \n+21 {\n+22 private:\n+23\n+24 typedef typename GridImp::ctype ctype;\n+25\n+26\n 27 public:\n 28\n-29 typedef typename std::remove_const::type::HostGridType HostGrid;\n-30 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;\n-31\n-32 constexpr static int dim = GridImp::dimension;\n-33\n-35 template\n-36 int index (const typename GridImp::Traits::template Codim::Entity& e)\n-const\n-37 {\n-38 return grid_->hostgrid_->levelIndexSet(level_).template index(grid_-\n->template getHostEntity(e));\n-39 }\n-40\n-41\n-43 template\n-44 int subIndex (const typename GridImp::Traits::template Codim::Entity& e,\n-int i, int codim) const\n-45 {\n-46 return grid_->hostgrid_->levelIndexSet(level_).subIndex(grid_->template\n-getHostEntity(e), i, codim);\n-47 }\n-48\n+29 // The codimension of this entitypointer wrt the host grid\n+30 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension -\n+mydim;\n+31 constexpr static int DimensionWorld = GridImp::HostGridType::dimensionworld;\n+32\n+33 // select appropriate hostgrid geometry via typeswitch\n+34 typedef typename GridImp::HostGridType::Traits::template\n+Codim::Geometry HostGridGeometryType;\n+35 typedef typename GridImp::HostGridType::Traits::template\n+Codim::Geometry HostGridLocalGeometryType;\n+36\n+37 typedef typename std::conditional::type HostGridGeometry;\n+38\n+40 typedef typename HostGridGeometryType::JacobianInverseTransposed\n+JacobianInverseTransposed;\n+41 typedef typename HostGridGeometryType::JacobianTransposed\n+JacobianTransposed;\n+42\n+43\n+46 IdentityGridGeometry(const HostGridGeometry& hostGeometry)\n+47 : hostGeometry_(hostGeometry)\n+48 {}\n 49\n-51 std::size_t size (int codim) const {\n-52 return grid_->hostgrid_->levelIndexSet(level_).size(codim);\n-53 }\n-54\n-55\n-57 std::size_t size (GeometryType type) const\n-58 {\n-59 return grid_->hostgrid_->levelIndexSet(level_).size(type);\n+50\n+53 GeometryType type () const {\n+54 return hostGeometry_.type();\n+55 }\n+56\n+57 // return whether we have an affine mapping\n+58 bool affine() const {\n+59 return hostGeometry_.affine();\n 60 }\n 61\n-63 Types types (int codim) const\n-64 {\n-65 return grid_->hostgrid_->levelIndexSet(level_).types(codim);\n-66 }\n+63 int corners () const {\n+64 return hostGeometry_.corners();\n+65 }\n+66\n 67\n-69 template\n-70 bool contains (const EntityType& e) const\n-71 {\n-72 return grid_->hostgrid_->levelIndexSet(level_).contains(grid_->template\n-getHostEntity(e));\n-73 }\n-74\n-76 void update(const GridImp& grid, int level)\n-77 {\n-78 grid_ = &grid;\n-79 level_ = level;\n-80 }\n-81\n-82\n-83 GridImp* grid_;\n-84\n-85 int level_;\n-86 };\n-87\n-88\n-89 template\n-90 class IdentityGridLeafIndexSet :\n-91 public IndexSet,\n-93 typename std::remove_const::type::HostGridType::LeafGridView::\n-IndexSet::IndexType,\n-94 typename std::remove_const::type::HostGridType::LeafGridView::\n-IndexSet::Types\n-95 >\n-96 {\n-97 typedef typename std::remove_const::type::HostGridType HostGrid;\n+69 const FieldVector corner (int i) const {\n+70 return hostGeometry_.corner(i);\n+71 }\n+72\n+73\n+76 FieldVector global (const FieldVector& local)\n+const {\n+77 return hostGeometry_.global(local);\n+78 }\n+79\n+82 JacobianTransposed\n+83 jacobianTransposed ( const FieldVector& local ) const {\n+84 return hostGeometry_.jacobianTransposed(local);\n+85 }\n+86\n+89 FieldVector local (const FieldVector& global)\n+const {\n+90 return hostGeometry_.local(global);\n+91 }\n+92\n+93\n+95 bool checkInside(const FieldVector &local) const {\n+96 return hostGeometry_.checkInside(local);\n+97 }\n 98\n-99 public:\n-100\n-101 typedef typename HostGrid::LevelGridView::IndexSet::Types Types;\n-102\n-103 /*\n-104 * We use the remove_const to extract the Type from the mutable class,\n-105 * because the const class is not instantiated yet.\n-106 */\n-107 constexpr static int dim = std::remove_const::type::dimension;\n-108\n-109\n-111 IdentityGridLeafIndexSet (const GridImp& grid)\n-112 : grid_(&grid)\n-113 {}\n+99\n+102 ctype integrationElement (const FieldVector& local) const {\n+103 return hostGeometry_.integrationElement(local);\n+104 }\n+105\n+106\n+108 JacobianInverseTransposed jacobianInverseTransposed (const\n+FieldVector& local) const {\n+109 return hostGeometry_.jacobianInverseTransposed(local);\n+110 }\n+111\n+112\n+113 HostGridGeometry hostGeometry_;\n 114\n-115\n-117 /*\n-118 We use the RemoveConst to extract the Type from the mutable class,\n-119 because the const class is not instantiated yet.\n-120 */\n-121 template\n-122 int index (const typename std::remove_const::type::template\n-Codim::Entity& e) const\n-123 {\n-124 return grid_->hostgrid_->leafIndexSet().template index(grid_-\n->template getHostEntity(e));\n-125 }\n-126\n-127\n-129 /*\n-130 We use the RemoveConst to extract the Type from the mutable class,\n-131 because the const class is not instantiated yet.\n-132 */\n-133 template\n-134 int subIndex (const typename std::remove_const::type::Traits::\n-template Codim::Entity& e, int i, int codim) const\n-135 {\n-136 return grid_->hostgrid_->leafIndexSet().subIndex(grid_->template\n-getHostEntity(e),i, codim);\n-137 }\n-138\n-139\n-141 std::size_t size (GeometryType type) const\n-142 {\n-143 return grid_->hostgrid_->leafIndexSet().size(type);\n-144 }\n-145\n-146\n-148 std::size_t size (int codim) const\n-149 {\n-150 return grid_->hostgrid_->leafIndexSet().size(codim);\n-151 }\n-152\n-154 Types types (int codim) const\n-155 {\n-156 return grid_->hostgrid_->leafIndexSet().types(codim);\n-157 }\n-158\n-160 template\n-161 bool contains (const EntityType& e) const\n-162 {\n-163 return grid_->hostgrid_->leafIndexSet().contains(grid_->template\n-getHostEntity(e));\n-164 }\n-165\n-166\n-167\n-169 void update(const GridImp& grid)\n-170 {\n-171 grid_ = &grid;\n-172 }\n-173\n-174\n-175 GridImp* grid_;\n-176 };\n-177\n-178\n-179\n-180\n-181 template \n-182 class IdentityGridGlobalIdSet :\n-183 public IdSet,\n-184 typename std::remove_const::type::HostGridType::Traits::\n-GlobalIdSet::IdType>\n-185 {\n-186\n-187 typedef typename std::remove_const::type::HostGridType HostGrid;\n-188\n-189\n-190 public:\n-192 IdentityGridGlobalIdSet (const GridImp& g) : grid_(&g) {}\n-193\n-195 typedef typename HostGrid::Traits::GlobalIdSet::IdType IdType;\n-196\n-197\n-199 /*\n-200 We use the remove_const to extract the Type from the mutable class,\n-201 because the const class is not instantiated yet.\n-202 */\n-203 template\n-204 IdType id (const typename std::remove_const::type::Traits::\n-template Codim::Entity& e) const\n-205 {\n-206 // Return id of the host entity\n-207 return grid_->hostgrid_->globalIdSet().id(e.impl().hostEntity_);\n-208 }\n-209\n-210\n-212 /*\n-213 We use the remove_const to extract the Type from the mutable class,\n-214 because the const class is not instantiated yet.\n-215 */\n-216 IdType subId (const typename std::remove_const::type::Traits::\n-template Codim<0>::Entity& e, int i, int codim) const\n-217 {\n-218 // Return sub id of the host entity\n-219 return grid_->hostgrid_->globalIdSet().subId(e.impl().hostEntity_,i,\n-codim);\n-220 }\n-221\n-222\n-224 void update() {}\n-225\n-226\n-227 const GridImp* grid_;\n-228 };\n-229\n-230\n-231\n-232\n-233 template\n-234 class IdentityGridLocalIdSet :\n-235 public IdSet,\n-236 typename std::remove_const::type::HostGridType::Traits::\n-LocalIdSet::IdType>\n-237 {\n-238 private:\n-239\n-240 typedef typename std::remove_const::type::HostGridType HostGrid;\n-241\n-242\n-243 public:\n-245 typedef typename HostGrid::Traits::LocalIdSet::IdType IdType;\n-246\n-247\n-249 IdentityGridLocalIdSet (const GridImp& g) : grid_(&g) {}\n-250\n-251\n-253 /*\n-254 We use the remove_const to extract the Type from the mutable class,\n-255 because the const class is not instantiated yet.\n-256 */\n-257 template\n-258 IdType id (const typename std::remove_const::type::Traits::\n-template Codim::Entity& e) const\n-259 {\n-260 // Return id of the host entity\n-261 return grid_->hostgrid_->localIdSet().id(e.impl().hostEntity_);\n-262 }\n-263\n-264\n-266 /*\n-267 * We use the remove_const to extract the Type from the mutable class,\n-268 * because the const class is not instantiated yet.\n-269 */\n-270 IdType subId (const typename std::remove_const::type::template\n-Codim<0>::Entity& e, int i, int codim) const\n-271 {\n-272 // Return sub id of the host entity\n-273 return grid_->hostgrid_->localIdSet().subId(e.impl().hostEntity_,i,codim);\n-274 }\n-275\n-276\n-278 void update() {}\n-279\n-280\n-281 const GridImp* grid_;\n-282 };\n-283\n-284\n-285} // namespace Dune\n-286\n-287\n-288#endif\n+115 };\n+116\n+117} // namespace Dune\n+118\n+119#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IndexSet\n-Index Set Interface base class.\n-Definition common/indexidset.hh:78\n-Dune::IdSet\n-Id Set Interface.\n-Definition common/indexidset.hh:447\n-Dune::IdentityGridLevelIndexSet\n-Definition identitygridindexsets.hh:26\n-Dune::IdentityGridLevelIndexSet::contains\n-bool contains(const EntityType &e) const\n-Return true if the given entity is contained in the index set.\n-Definition identitygridindexsets.hh:70\n-Dune::IdentityGridLevelIndexSet::index\n-int index(const typename GridImp::Traits::template Codim< codim >::Entity &e)\n+Dune::GeometryDefaultImplementation\n+Default implementation for class Geometry.\n+Definition common/geometry.hh:406\n+Dune::IdentityGridGeometry\n+Definition identitygridgeometry.hh:21\n+Dune::IdentityGridGeometry::checkInside\n+bool checkInside(const FieldVector< ctype, mydim > &local) const\n+Returns true if the point is in the current element.\n+Definition identitygridgeometry.hh:95\n+Dune::IdentityGridGeometry::jacobianInverseTransposed\n+JacobianInverseTransposed jacobianInverseTransposed(const FieldVector< ctype,\n+mydim > &local) const\n+The Jacobian matrix of the mapping from the reference element to this element.\n+Definition identitygridgeometry.hh:108\n+Dune::IdentityGridGeometry::jacobianTransposed\n+JacobianTransposed jacobianTransposed(const FieldVector< ctype, mydim > &local)\n+const\n+Return the transposed of the Jacobian.\n+Definition identitygridgeometry.hh:83\n+Dune::IdentityGridGeometry::HostGridGeometry\n+std::conditional< coorddim==DimensionWorld, HostGridGeometryType,\n+HostGridLocalGeometryType >::type HostGridGeometry\n+Definition identitygridgeometry.hh:37\n+Dune::IdentityGridGeometry::affine\n+bool affine() const\n+Definition identitygridgeometry.hh:58\n+Dune::IdentityGridGeometry::CodimInHostGrid\n+static constexpr int CodimInHostGrid\n+Definition identitygridgeometry.hh:30\n+Dune::IdentityGridGeometry::global\n+FieldVector< ctype, coorddim > global(const FieldVector< ctype, mydim > &local)\n+const\n+Maps a local coordinate within reference element to global coordinate in\n+element\n+Definition identitygridgeometry.hh:76\n+Dune::IdentityGridGeometry::IdentityGridGeometry\n+IdentityGridGeometry(const HostGridGeometry &hostGeometry)\n+Definition identitygridgeometry.hh:46\n+Dune::IdentityGridGeometry::type\n+GeometryType type() const\n+Return the element type identifier.\n+Definition identitygridgeometry.hh:53\n+Dune::IdentityGridGeometry::corner\n+const FieldVector< ctype, coorddim > corner(int i) const\n+access to coordinates of corners. Index is the number of the corner\n+Definition identitygridgeometry.hh:69\n+Dune::IdentityGridGeometry::JacobianTransposed\n+HostGridGeometryType::JacobianTransposed JacobianTransposed\n+Definition identitygridgeometry.hh:41\n+Dune::IdentityGridGeometry::integrationElement\n+ctype integrationElement(const FieldVector< ctype, mydim > &local) const\n+Definition identitygridgeometry.hh:102\n+Dune::IdentityGridGeometry::hostGeometry_\n+HostGridGeometry hostGeometry_\n+Definition identitygridgeometry.hh:113\n+Dune::IdentityGridGeometry::HostGridLocalGeometryType\n+GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry\n+HostGridLocalGeometryType\n+Definition identitygridgeometry.hh:35\n+Dune::IdentityGridGeometry::HostGridGeometryType\n+GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry\n+HostGridGeometryType\n+Definition identitygridgeometry.hh:34\n+Dune::IdentityGridGeometry::JacobianInverseTransposed\n+HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed\n+type of jacobian transposed\n+Definition identitygridgeometry.hh:40\n+Dune::IdentityGridGeometry::DimensionWorld\n+static constexpr int DimensionWorld\n+Definition identitygridgeometry.hh:31\n+Dune::IdentityGridGeometry::local\n+FieldVector< ctype, mydim > local(const FieldVector< ctype, coorddim > &global)\n const\n-get index of an entity\n-Definition identitygridindexsets.hh:36\n-Dune::IdentityGridLevelIndexSet::grid_\n-GridImp * grid_\n-Definition identitygridindexsets.hh:83\n-Dune::IdentityGridLevelIndexSet::HostGrid\n-std::remove_const< GridImp >::type::HostGridType HostGrid\n-Definition identitygridindexsets.hh:29\n-Dune::IdentityGridLevelIndexSet::types\n-Types types(int codim) const\n-Deliver all geometry types used in this grid.\n-Definition identitygridindexsets.hh:63\n-Dune::IdentityGridLevelIndexSet::size\n-std::size_t size(GeometryType type) const\n-get number of entities of given codim, type and on this level\n-Definition identitygridindexsets.hh:57\n-Dune::IdentityGridLevelIndexSet::dim\n-static constexpr int dim\n-Definition identitygridindexsets.hh:32\n-Dune::IdentityGridLevelIndexSet::Types\n-HostGrid::LevelGridView::IndexSet::Types Types\n-Definition identitygridindexsets.hh:30\n-Dune::IdentityGridLevelIndexSet::size\n-std::size_t size(int codim) const\n-get number of entities of given codim, type and on this level\n-Definition identitygridindexsets.hh:51\n-Dune::IdentityGridLevelIndexSet::subIndex\n-int subIndex(const typename GridImp::Traits::template Codim< cc >::Entity &e,\n-int i, int codim) const\n-get index of subEntity of a codim 0 entity\n-Definition identitygridindexsets.hh:44\n-Dune::IdentityGridLevelIndexSet::level_\n-int level_\n-Definition identitygridindexsets.hh:85\n-Dune::IdentityGridLevelIndexSet::update\n-void update(const GridImp &grid, int level)\n-Set up the index set.\n-Definition identitygridindexsets.hh:76\n-Dune::IdentityGridLeafIndexSet\n-Definition identitygridindexsets.hh:96\n-Dune::IdentityGridLeafIndexSet::IdentityGridLeafIndexSet\n-IdentityGridLeafIndexSet(const GridImp &grid)\n-constructor stores reference to a grid and level\n-Definition identitygridindexsets.hh:111\n-Dune::IdentityGridLeafIndexSet::dim\n-static constexpr int dim\n-Definition identitygridindexsets.hh:107\n-Dune::IdentityGridLeafIndexSet::size\n-std::size_t size(int codim) const\n-get number of entities of given codim\n-Definition identitygridindexsets.hh:148\n-Dune::IdentityGridLeafIndexSet::contains\n-bool contains(const EntityType &e) const\n-Return true if the given entity is contained in the index set.\n-Definition identitygridindexsets.hh:161\n-Dune::IdentityGridLeafIndexSet::size\n-std::size_t size(GeometryType type) const\n-get number of entities of given type\n-Definition identitygridindexsets.hh:141\n-Dune::IdentityGridLeafIndexSet::Types\n-HostGrid::LevelGridView::IndexSet::Types Types\n-Definition identitygridindexsets.hh:101\n-Dune::IdentityGridLeafIndexSet::index\n-int index(const typename std::remove_const< GridImp >::type::template Codim<\n-codim >::Entity &e) const\n-get index of an entity\n-Definition identitygridindexsets.hh:122\n-Dune::IdentityGridLeafIndexSet::subIndex\n-int subIndex(const typename std::remove_const< GridImp >::type::Traits::\n-template Codim< cc >::Entity &e, int i, int codim) const\n-get index of subEntity of a codim 0 entity\n-Definition identitygridindexsets.hh:134\n-Dune::IdentityGridLeafIndexSet::types\n-Types types(int codim) const\n-Deliver all geometry types used in this grid.\n-Definition identitygridindexsets.hh:154\n-Dune::IdentityGridLeafIndexSet::grid_\n-GridImp * grid_\n-Definition identitygridindexsets.hh:175\n-Dune::IdentityGridLeafIndexSet::update\n-void update(const GridImp &grid)\n-Definition identitygridindexsets.hh:169\n-Dune::IdentityGridGlobalIdSet\n-Definition identitygridindexsets.hh:185\n-Dune::IdentityGridGlobalIdSet::IdentityGridGlobalIdSet\n-IdentityGridGlobalIdSet(const GridImp &g)\n-constructor stores reference to a grid\n-Definition identitygridindexsets.hh:192\n-Dune::IdentityGridGlobalIdSet::update\n-void update()\n-Definition identitygridindexsets.hh:224\n-Dune::IdentityGridGlobalIdSet::grid_\n-const GridImp * grid_\n-Definition identitygridindexsets.hh:227\n-Dune::IdentityGridGlobalIdSet::IdType\n-HostGrid::Traits::GlobalIdSet::IdType IdType\n-define the type used for persistent indices\n-Definition identitygridindexsets.hh:195\n-Dune::IdentityGridGlobalIdSet::subId\n-IdType subId(const typename std::remove_const< GridImp >::type::Traits::\n-template Codim< 0 >::Entity &e, int i, int codim) const\n-get id of subEntity\n-Definition identitygridindexsets.hh:216\n-Dune::IdentityGridGlobalIdSet::id\n-IdType id(const typename std::remove_const< GridImp >::type::Traits::template\n-Codim< cd >::Entity &e) const\n-get id of an entity\n-Definition identitygridindexsets.hh:204\n-Dune::IdentityGridLocalIdSet\n-Definition identitygridindexsets.hh:237\n-Dune::IdentityGridLocalIdSet::subId\n-IdType subId(const typename std::remove_const< GridImp >::type::template Codim<\n-0 >::Entity &e, int i, int codim) const\n-get id of subEntity\n-Definition identitygridindexsets.hh:270\n-Dune::IdentityGridLocalIdSet::IdentityGridLocalIdSet\n-IdentityGridLocalIdSet(const GridImp &g)\n-constructor stores reference to a grid\n-Definition identitygridindexsets.hh:249\n-Dune::IdentityGridLocalIdSet::grid_\n-const GridImp * grid_\n-Definition identitygridindexsets.hh:281\n-Dune::IdentityGridLocalIdSet::update\n-void update()\n-Definition identitygridindexsets.hh:278\n-Dune::IdentityGridLocalIdSet::id\n-IdType id(const typename std::remove_const< GridImp >::type::Traits::template\n-Codim< cd >::Entity &e) const\n-get id of an entity\n-Definition identitygridindexsets.hh:258\n-Dune::IdentityGridLocalIdSet::IdType\n-HostGrid::Traits::LocalIdSet::IdType IdType\n-define the type used for persistent local ids\n-Definition identitygridindexsets.hh:245\n-indexidset.hh\n-Provides base classes for index and id sets.\n+Maps a global coordinate within the element to a local coordinate in its\n+reference element.\n+Definition identitygridgeometry.hh:89\n+Dune::IdentityGridGeometry::corners\n+int corners() const\n+return the number of corners of this element. Corners are numbered 0...n-1\n+Definition identitygridgeometry.hh:63\n+geometry.hh\n+Wrapper and interface classes for element geometries.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00758.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00758.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridgeometry.hh File Reference\n+dune-grid: identitygridleveliterator.hh File Reference\n \n \n \n \n \n \n \n@@ -72,39 +72,38 @@\n
  • dune
  • grid
  • identitygrid
  • \n
    \n
    \n
    \n \n-
    identitygridgeometry.hh File Reference
    \n+
    identitygridleveliterator.hh File Reference
    \n
    \n
    \n \n-

    The IdentityGridGeometry class and its specializations. \n+

    The IdentityGridLevelIterator class. \n More...

    \n-
    #include <dune/common/fmatrix.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/grid/common/geometry.hh>
    \n+\n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdentityGridGeometry< mydim, coorddim, GridImp >
    class  Dune::IdentityGridLevelIterator< codim, pitype, GridImp >
     Iterator over all entities of a given codimension and level of a grid. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The IdentityGridGeometry class and its specializations.

    \n+

    The IdentityGridLevelIterator class.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,24 +2,24 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n Classes | Namespaces\n-identitygridgeometry.hh File Reference\n-The IdentityGridGeometry class and its specializations. More...\n-#include \n-#include \n-#include \n+identitygridleveliterator.hh File Reference\n+The IdentityGridLevelIterator class. More...\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdentityGridGeometry<_mydim,_coorddim,_GridImp_>\n+class \u00a0 Dune::IdentityGridLevelIterator<_codim,_pitype,_GridImp_>\n+\u00a0 Iterator over all entities of a given codimension and level of a grid.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The IdentityGridGeometry class and its specializations.\n+The IdentityGridLevelIterator class.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00758_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00758_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identitygridgeometry.hh Source File\n+dune-grid: identitygridleveliterator.hh Source File\n \n \n \n \n \n \n \n@@ -74,162 +74,97 @@\n \n \n
    \n
    \n-
    identitygridgeometry.hh
    \n+
    identitygridleveliterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IDENTITYGRIDGEOMETRY_HH
    \n-
    6#define DUNE_IDENTITYGRIDGEOMETRY_HH
    \n+
    5#ifndef DUNE_IDENTITYGRIDLEVELITERATOR_HH
    \n+
    6#define DUNE_IDENTITYGRIDLEVELITERATOR_HH
    \n
    7
    \n-
    12#include <dune/common/fmatrix.hh>
    \n-
    13#include <dune/common/typetraits.hh>
    \n-\n+\n+
    9
    \n+
    14namespace Dune {
    \n
    15
    \n-
    16namespace Dune {
    \n-
    17
    \n-
    18 template<int mydim, int coorddim, class GridImp>
    \n-
    \n-\n-
    20 public GeometryDefaultImplementation <mydim, coorddim, GridImp, IdentityGridGeometry>
    \n+
    19 template<int codim, PartitionIteratorType pitype, class GridImp>
    \n+
    \n+\n
    21 {
    \n-
    22 private:
    \n-
    23
    \n-
    24 typedef typename GridImp::ctype ctype;
    \n-
    25
    \n+
    22
    \n+
    23 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::template Partition<pitype>::LevelIterator HostGridLevelIterator;
    \n+
    24
    \n+
    25 public:
    \n
    26
    \n-
    27 public:
    \n+
    27 constexpr static int codimension = codim;
    \n
    28
    \n-
    29 // The codimension of this entitypointer wrt the host grid
    \n-
    30 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - mydim;
    \n-
    31 constexpr static int DimensionWorld = GridImp::HostGridType::dimensionworld;
    \n-
    32
    \n-
    33 // select appropriate hostgrid geometry via typeswitch
    \n-
    34 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridGeometryType;
    \n-
    35 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridLocalGeometryType;
    \n-
    36
    \n-
    37 typedef typename std::conditional<coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType>::type HostGridGeometry;
    \n-
    38
    \n-
    40 typedef typename HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed;
    \n-
    41 typedef typename HostGridGeometryType::JacobianTransposed JacobianTransposed;
    \n-
    42
    \n-
    43
    \n-
    \n-\n-
    47 : hostGeometry_(hostGeometry)
    \n-
    48 {}
    \n-
    \n-
    49
    \n-
    50
    \n-
    \n-
    53 GeometryType type () const {
    \n-
    54 return hostGeometry_.type();
    \n-
    55 }
    \n-
    \n-
    56
    \n-
    57 // return whether we have an affine mapping
    \n-
    \n-
    58 bool affine() const {
    \n-
    59 return hostGeometry_.affine();
    \n-
    60 }
    \n-
    \n-
    61
    \n-
    \n-
    63 int corners () const {
    \n-
    64 return hostGeometry_.corners();
    \n-
    65 }
    \n+
    29 typedef typename GridImp::template Codim<codim>::Entity Entity;
    \n+
    30
    \n+
    \n+
    32 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level)
    \n+
    33 : identityGrid_(identityGrid),
    \n+
    34 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template begin<codim,pitype>())
    \n+
    35 {}
    \n
    \n+
    36
    \n+
    37
    \n+
    \n+
    43 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level, [[maybe_unused]] bool endDummy)
    \n+
    44 : identityGrid_(identityGrid),
    \n+
    45 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template end<codim,pitype>())
    \n+
    46 {}
    \n+
    \n+
    47
    \n+
    48
    \n+
    \n+
    50 void increment() {
    \n+
    51 ++hostLevelIterator_;
    \n+
    52 }
    \n+
    \n+
    53
    \n+
    \n+\n+
    56 return Entity{{identityGrid_,*hostLevelIterator_}};
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    \n+
    60 bool equals(const IdentityGridLevelIterator& i) const {
    \n+
    61 return hostLevelIterator_ == i.hostLevelIterator_;
    \n+
    62 }
    \n+
    \n+
    63
    \n+
    64 private:
    \n+
    65 const GridImp* identityGrid_;
    \n
    66
    \n-
    67
    \n-
    \n-
    69 const FieldVector<ctype, coorddim> corner (int i) const {
    \n-
    70 return hostGeometry_.corner(i);
    \n-
    71 }
    \n+
    67 HostGridLevelIterator hostLevelIterator_;
    \n+
    68 };
    \n
    \n+
    69
    \n+
    70
    \n+
    71} // namespace Dune
    \n
    72
    \n-
    73
    \n-
    \n-
    76 FieldVector<ctype, coorddim> global (const FieldVector<ctype, mydim>& local) const {
    \n-
    77 return hostGeometry_.global(local);
    \n-
    78 }
    \n-
    \n-
    79
    \n-\n-
    \n-
    83 jacobianTransposed ( const FieldVector<ctype, mydim>& local ) const {
    \n-
    84 return hostGeometry_.jacobianTransposed(local);
    \n-
    85 }
    \n-
    \n-
    86
    \n-
    \n-
    89 FieldVector<ctype, mydim> local (const FieldVector<ctype, coorddim>& global) const {
    \n-
    90 return hostGeometry_.local(global);
    \n-
    91 }
    \n-
    \n-
    92
    \n-
    93
    \n-
    \n-
    95 bool checkInside(const FieldVector<ctype, mydim> &local) const {
    \n-
    96 return hostGeometry_.checkInside(local);
    \n-
    97 }
    \n-
    \n-
    98
    \n-
    99
    \n-
    \n-
    102 ctype integrationElement (const FieldVector<ctype, mydim>& local) const {
    \n-
    103 return hostGeometry_.integrationElement(local);
    \n-
    104 }
    \n-
    \n-
    105
    \n-
    106
    \n-
    \n-
    108 JacobianInverseTransposed jacobianInverseTransposed (const FieldVector<ctype, mydim>& local) const {
    \n-
    109 return hostGeometry_.jacobianInverseTransposed(local);
    \n-
    110 }
    \n-
    \n-
    111
    \n-
    112
    \n-\n-
    114
    \n-
    115 };
    \n-
    \n-
    116
    \n-
    117} // namespace Dune
    \n-
    118
    \n-
    119#endif
    \n+
    73#endif
    \n+\n+
    Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
    level grid view for the given grid and level.
    Definition common/grid.hh:788
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Default implementation for class Geometry.
    Definition common/geometry.hh:406
    \n-
    Definition identitygridgeometry.hh:21
    \n-
    bool checkInside(const FieldVector< ctype, mydim > &local) const
    Returns true if the point is in the current element.
    Definition identitygridgeometry.hh:95
    \n-
    JacobianInverseTransposed jacobianInverseTransposed(const FieldVector< ctype, mydim > &local) const
    The Jacobian matrix of the mapping from the reference element to this element.
    Definition identitygridgeometry.hh:108
    \n-
    JacobianTransposed jacobianTransposed(const FieldVector< ctype, mydim > &local) const
    Return the transposed of the Jacobian.
    Definition identitygridgeometry.hh:83
    \n-
    std::conditional< coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType >::type HostGridGeometry
    Definition identitygridgeometry.hh:37
    \n-
    bool affine() const
    Definition identitygridgeometry.hh:58
    \n-
    static constexpr int CodimInHostGrid
    Definition identitygridgeometry.hh:30
    \n-
    FieldVector< ctype, coorddim > global(const FieldVector< ctype, mydim > &local) const
    Maps a local coordinate within reference element to global coordinate in element
    Definition identitygridgeometry.hh:76
    \n-
    IdentityGridGeometry(const HostGridGeometry &hostGeometry)
    Definition identitygridgeometry.hh:46
    \n-
    GeometryType type() const
    Return the element type identifier.
    Definition identitygridgeometry.hh:53
    \n-
    const FieldVector< ctype, coorddim > corner(int i) const
    access to coordinates of corners. Index is the number of the corner
    Definition identitygridgeometry.hh:69
    \n-
    HostGridGeometryType::JacobianTransposed JacobianTransposed
    Definition identitygridgeometry.hh:41
    \n-
    ctype integrationElement(const FieldVector< ctype, mydim > &local) const
    Definition identitygridgeometry.hh:102
    \n-
    HostGridGeometry hostGeometry_
    Definition identitygridgeometry.hh:113
    \n-
    GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry HostGridLocalGeometryType
    Definition identitygridgeometry.hh:35
    \n-
    GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry HostGridGeometryType
    Definition identitygridgeometry.hh:34
    \n-
    HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed
    type of jacobian transposed
    Definition identitygridgeometry.hh:40
    \n-
    static constexpr int DimensionWorld
    Definition identitygridgeometry.hh:31
    \n-
    FieldVector< ctype, mydim > local(const FieldVector< ctype, coorddim > &global) const
    Maps a global coordinate within the element to a local coordinate in its reference element.
    Definition identitygridgeometry.hh:89
    \n-
    int corners() const
    return the number of corners of this element. Corners are numbered 0...n-1
    Definition identitygridgeometry.hh:63
    \n-
    Wrapper and interface classes for element geometries.
    \n+
    Iterator over all entities of a given codimension and level of a grid.
    Definition identitygridleveliterator.hh:21
    \n+
    void increment()
    prefix increment
    Definition identitygridleveliterator.hh:50
    \n+
    GridImp::template Codim< codim >::Entity Entity
    Definition identitygridleveliterator.hh:29
    \n+
    IdentityGridLevelIterator(const GridImp *identityGrid, int level)
    Constructor.
    Definition identitygridleveliterator.hh:32
    \n+
    IdentityGridLevelIterator(const GridImp *identityGrid, int level, bool endDummy)
    Constructor which create the end iterator.
    Definition identitygridleveliterator.hh:43
    \n+
    static constexpr int codimension
    Definition identitygridleveliterator.hh:27
    \n+
    bool equals(const IdentityGridLevelIterator &i) const
    equality
    Definition identitygridleveliterator.hh:60
    \n+
    Entity dereference() const
    dereferencing
    Definition identitygridleveliterator.hh:55
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,205 +1,112 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * identitygrid\n-identitygridgeometry.hh\n+identitygridleveliterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IDENTITYGRIDGEOMETRY_HH\n-6#define DUNE_IDENTITYGRIDGEOMETRY_HH\n+5#ifndef DUNE_IDENTITYGRIDLEVELITERATOR_HH\n+6#define DUNE_IDENTITYGRIDLEVELITERATOR_HH\n 7\n-12#include \n-13#include \n-14#include \n+8#include \n+9\n+14namespace Dune {\n 15\n-16namespace Dune {\n-17\n-18 template\n-19 class IdentityGridGeometry :\n-20 public GeometryDefaultImplementation \n+19 template\n+20 class IdentityGridLevelIterator\n 21 {\n-22 private:\n-23\n-24 typedef typename GridImp::ctype ctype;\n-25\n+22\n+23 typedef typename GridImp::HostGridType::Traits::template Codim::\n+template Partition::LevelIterator HostGridLevelIterator;\n+24\n+25 public:\n 26\n-27 public:\n+27 constexpr static int codimension = codim;\n 28\n-29 // The codimension of this entitypointer wrt the host grid\n-30 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension -\n-mydim;\n-31 constexpr static int DimensionWorld = GridImp::HostGridType::dimensionworld;\n-32\n-33 // select appropriate hostgrid geometry via typeswitch\n-34 typedef typename GridImp::HostGridType::Traits::template\n-Codim::Geometry HostGridGeometryType;\n-35 typedef typename GridImp::HostGridType::Traits::template\n-Codim::Geometry HostGridLocalGeometryType;\n+29 typedef typename GridImp::template Codim::Entity Entity;\n+30\n+32 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level)\n+33 : identityGrid_(identityGrid),\n+34 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template\n+begin())\n+35 {}\n 36\n-37 typedef typename std::conditional::type HostGridGeometry;\n-38\n-40 typedef typename HostGridGeometryType::JacobianInverseTransposed\n-JacobianInverseTransposed;\n-41 typedef typename HostGridGeometryType::JacobianTransposed\n-JacobianTransposed;\n-42\n-43\n-46 IdentityGridGeometry(const HostGridGeometry& hostGeometry)\n-47 : hostGeometry_(hostGeometry)\n-48 {}\n-49\n-50\n-53 GeometryType type () const {\n-54 return hostGeometry_.type();\n-55 }\n-56\n-57 // return whether we have an affine mapping\n-58 bool affine() const {\n-59 return hostGeometry_.affine();\n-60 }\n-61\n-63 int corners () const {\n-64 return hostGeometry_.corners();\n-65 }\n+37\n+43 explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level, [\n+[maybe_unused]] bool endDummy)\n+44 : identityGrid_(identityGrid),\n+45 hostLevelIterator_(identityGrid->hostgrid_->levelGridView(level).template\n+end())\n+46 {}\n+47\n+48\n+50 void increment() {\n+51 ++hostLevelIterator_;\n+52 }\n+53\n+55 Entity dereference() const {\n+56 return Entity{{identityGrid_,*hostLevelIterator_}};\n+57 }\n+58\n+60 bool equals(const IdentityGridLevelIterator& i) const {\n+61 return hostLevelIterator_ == i.hostLevelIterator_;\n+62 }\n+63\n+64 private:\n+65 const GridImp* identityGrid_;\n 66\n-67\n-69 const FieldVector corner (int i) const {\n-70 return hostGeometry_.corner(i);\n-71 }\n+67 HostGridLevelIterator hostLevelIterator_;\n+68 };\n+69\n+70\n+71} // namespace Dune\n 72\n-73\n-76 FieldVector global (const FieldVector& local)\n-const {\n-77 return hostGeometry_.global(local);\n-78 }\n-79\n-82 JacobianTransposed\n-83 jacobianTransposed ( const FieldVector& local ) const {\n-84 return hostGeometry_.jacobianTransposed(local);\n-85 }\n-86\n-89 FieldVector local (const FieldVector& global)\n-const {\n-90 return hostGeometry_.local(global);\n-91 }\n-92\n-93\n-95 bool checkInside(const FieldVector &local) const {\n-96 return hostGeometry_.checkInside(local);\n-97 }\n-98\n-99\n-102 ctype integrationElement (const FieldVector& local) const {\n-103 return hostGeometry_.integrationElement(local);\n-104 }\n-105\n-106\n-108 JacobianInverseTransposed jacobianInverseTransposed (const\n-FieldVector& local) const {\n-109 return hostGeometry_.jacobianInverseTransposed(local);\n-110 }\n-111\n-112\n-113 HostGridGeometry hostGeometry_;\n-114\n-115 };\n-116\n-117} // namespace Dune\n-118\n-119#endif\n+73#endif\n+gridenums.hh\n+Dune::levelGridView\n+Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid<\n+dim, dimworld, ct, GridFamily > &grid, int level)\n+level grid view for the given grid and level.\n+Definition common/grid.hh:788\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::GeometryDefaultImplementation\n-Default implementation for class Geometry.\n-Definition common/geometry.hh:406\n-Dune::IdentityGridGeometry\n-Definition identitygridgeometry.hh:21\n-Dune::IdentityGridGeometry::checkInside\n-bool checkInside(const FieldVector< ctype, mydim > &local) const\n-Returns true if the point is in the current element.\n-Definition identitygridgeometry.hh:95\n-Dune::IdentityGridGeometry::jacobianInverseTransposed\n-JacobianInverseTransposed jacobianInverseTransposed(const FieldVector< ctype,\n-mydim > &local) const\n-The Jacobian matrix of the mapping from the reference element to this element.\n-Definition identitygridgeometry.hh:108\n-Dune::IdentityGridGeometry::jacobianTransposed\n-JacobianTransposed jacobianTransposed(const FieldVector< ctype, mydim > &local)\n-const\n-Return the transposed of the Jacobian.\n-Definition identitygridgeometry.hh:83\n-Dune::IdentityGridGeometry::HostGridGeometry\n-std::conditional< coorddim==DimensionWorld, HostGridGeometryType,\n-HostGridLocalGeometryType >::type HostGridGeometry\n-Definition identitygridgeometry.hh:37\n-Dune::IdentityGridGeometry::affine\n-bool affine() const\n-Definition identitygridgeometry.hh:58\n-Dune::IdentityGridGeometry::CodimInHostGrid\n-static constexpr int CodimInHostGrid\n-Definition identitygridgeometry.hh:30\n-Dune::IdentityGridGeometry::global\n-FieldVector< ctype, coorddim > global(const FieldVector< ctype, mydim > &local)\n-const\n-Maps a local coordinate within reference element to global coordinate in\n-element\n-Definition identitygridgeometry.hh:76\n-Dune::IdentityGridGeometry::IdentityGridGeometry\n-IdentityGridGeometry(const HostGridGeometry &hostGeometry)\n-Definition identitygridgeometry.hh:46\n-Dune::IdentityGridGeometry::type\n-GeometryType type() const\n-Return the element type identifier.\n-Definition identitygridgeometry.hh:53\n-Dune::IdentityGridGeometry::corner\n-const FieldVector< ctype, coorddim > corner(int i) const\n-access to coordinates of corners. Index is the number of the corner\n-Definition identitygridgeometry.hh:69\n-Dune::IdentityGridGeometry::JacobianTransposed\n-HostGridGeometryType::JacobianTransposed JacobianTransposed\n-Definition identitygridgeometry.hh:41\n-Dune::IdentityGridGeometry::integrationElement\n-ctype integrationElement(const FieldVector< ctype, mydim > &local) const\n-Definition identitygridgeometry.hh:102\n-Dune::IdentityGridGeometry::hostGeometry_\n-HostGridGeometry hostGeometry_\n-Definition identitygridgeometry.hh:113\n-Dune::IdentityGridGeometry::HostGridLocalGeometryType\n-GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry\n-HostGridLocalGeometryType\n-Definition identitygridgeometry.hh:35\n-Dune::IdentityGridGeometry::HostGridGeometryType\n-GridImp::HostGridType::Traits::template Codim< CodimInHostGrid >::Geometry\n-HostGridGeometryType\n-Definition identitygridgeometry.hh:34\n-Dune::IdentityGridGeometry::JacobianInverseTransposed\n-HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed\n-type of jacobian transposed\n-Definition identitygridgeometry.hh:40\n-Dune::IdentityGridGeometry::DimensionWorld\n-static constexpr int DimensionWorld\n-Definition identitygridgeometry.hh:31\n-Dune::IdentityGridGeometry::local\n-FieldVector< ctype, mydim > local(const FieldVector< ctype, coorddim > &global)\n-const\n-Maps a global coordinate within the element to a local coordinate in its\n-reference element.\n-Definition identitygridgeometry.hh:89\n-Dune::IdentityGridGeometry::corners\n-int corners() const\n-return the number of corners of this element. Corners are numbered 0...n-1\n-Definition identitygridgeometry.hh:63\n-geometry.hh\n-Wrapper and interface classes for element geometries.\n+Dune::IdentityGridLevelIterator\n+Iterator over all entities of a given codimension and level of a grid.\n+Definition identitygridleveliterator.hh:21\n+Dune::IdentityGridLevelIterator::increment\n+void increment()\n+prefix increment\n+Definition identitygridleveliterator.hh:50\n+Dune::IdentityGridLevelIterator::Entity\n+GridImp::template Codim< codim >::Entity Entity\n+Definition identitygridleveliterator.hh:29\n+Dune::IdentityGridLevelIterator::IdentityGridLevelIterator\n+IdentityGridLevelIterator(const GridImp *identityGrid, int level)\n+Constructor.\n+Definition identitygridleveliterator.hh:32\n+Dune::IdentityGridLevelIterator::IdentityGridLevelIterator\n+IdentityGridLevelIterator(const GridImp *identityGrid, int level, bool\n+endDummy)\n+Constructor which create the end iterator.\n+Definition identitygridleveliterator.hh:43\n+Dune::IdentityGridLevelIterator::codimension\n+static constexpr int codimension\n+Definition identitygridleveliterator.hh:27\n+Dune::IdentityGridLevelIterator::equals\n+bool equals(const IdentityGridLevelIterator &i) const\n+equality\n+Definition identitygridleveliterator.hh:60\n+Dune::IdentityGridLevelIterator::dereference\n+Entity dereference() const\n+dereferencing\n+Definition identitygridleveliterator.hh:55\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00761.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00761.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: printgrid.hh File Reference\n+dune-grid: gmshreader.hh File Reference\n \n \n \n \n \n \n \n@@ -70,39 +70,78 @@\n
    \n \n
    \n
    \n
    \n \n-
    printgrid.hh File Reference
    \n+
    gmshreader.hh File Reference
    \n
    \n
    \n-
    #include <fstream>
    \n+
    #include <cstdarg>
    \n+#include <cstdio>
    \n+#include <cstring>
    \n+#include <fstream>
    \n+#include <iostream>
    \n+#include <map>
    \n+#include <memory>
    \n #include <string>
    \n+#include <tuple>
    \n+#include <vector>
    \n+#include <utility>
    \n #include <dune/common/exceptions.hh>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/grid/common/boundarysegment.hh>
    \n+#include <dune/grid/common/gridfactory.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

    struct  Dune::GmshReaderOptions
     Options for read operation. More...
     
    class  Dune::GmshReaderParser< GridType >
     dimension independent parts for GmshReaderParser More...
     
    class  Dune::GmshReader< GridType >
     Read Gmsh mesh file. More...
     
    \n \n \n \n \n+\n+\n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Gmsh
     
    \n+\n+\n+\n+\n

    \n+Enumerations

    enum class  Dune::Gmsh::ReaderOptions { Dune::Gmsh::ReaderOptions::verbose = 1\n+, Dune::Gmsh::ReaderOptions::insertBoundarySegments = 2\n+, Dune::Gmsh::ReaderOptions::readElementData = 4\n+, Dune::Gmsh::ReaderOptions::readBoundaryData = 8\n+ }
     Option for the Gmsh mesh file reader. More...
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n

    \n Functions

    template<typename GridType >
    void Dune::printGrid (const GridType &grid, const Dune::MPIHelper &helper, std::string output_file="printgrid", int size=2000, bool execute_plot=true, bool png=true, bool local_corner_indices=true, bool local_intersection_indices=true, bool outer_normals=true)
     Print a grid as a gnuplot for testing and development.
     
    constexpr ReaderOptions Dune::Gmsh::operator| (ReaderOptions a, ReaderOptions b)
     composition operator for reader options
     
    constexpr bool Dune::Gmsh::operator& (ReaderOptions a, ReaderOptions b)
     query operator for reader options (is b set in a)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,60 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-Namespaces | Functions\n-printgrid.hh File Reference\n+Classes | Namespaces | Enumerations | Functions\n+gmshreader.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 Go_to_the_source_code_of_this_file.\n+Classes\n+struct \u00a0 Dune::GmshReaderOptions\n+\u00a0 Options for read operation. More...\n+\u00a0\n+ class \u00a0 Dune::GmshReaderParser<_GridType_>\n+\u00a0 dimension independent parts for GmshReaderParser More...\n+\u00a0\n+ class \u00a0 Dune::GmshReader<_GridType_>\n+\u00a0 Read Gmsh mesh file. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::Gmsh\n+\u00a0\n+Enumerations\n+enum class \u00a0 Dune::Gmsh::ReaderOptions { Dune::Gmsh::ReaderOptions::verbose = 1\n+ , Dune::Gmsh::ReaderOptions::insertBoundarySegments = 2 , Dune::\n+ Gmsh::ReaderOptions::readElementData = 4 , Dune::Gmsh::\n+ ReaderOptions::readBoundaryData = 8 }\n+\u00a0 Option for the Gmsh mesh file reader. More...\n+\u00a0\n Functions\n-template\n-void\u00a0 Dune::printGrid (const GridType &grid, const Dune::MPIHelper &helper,\n- std::string output_file=\"printgrid\", int size=2000, bool execute_\n- plot=true, bool png=true, bool local_corner_indices=true, bool local_\n- intersection_indices=true, bool outer_normals=true)\n-\u00a0 Print a grid as a gnuplot for testing and development.\n+constexpr ReaderOptions\u00a0 Dune::Gmsh::operator| (ReaderOptions a, ReaderOptions\n+ b)\n+\u00a0 composition operator for reader options\n+\u00a0\n+ constexpr bool\u00a0 Dune::Gmsh::operator& (ReaderOptions a, ReaderOptions\n+ b)\n+\u00a0 query operator for reader options (is b set in a)\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00761_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00761_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: printgrid.hh Source File\n+dune-grid: gmshreader.hh Source File\n \n \n \n \n \n \n \n@@ -74,222 +74,1194 @@\n \n
    \n \n
    \n
    \n
    \n-
    printgrid.hh
    \n+
    gmshreader.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_PRINTGRID_HH
    \n-
    6#define DUNE_PRINTGRID_HH
    \n-
    7
    \n-
    8#include <fstream>
    \n-
    9#include <string>
    \n-
    10
    \n-
    11#include <dune/common/exceptions.hh>
    \n-
    12#include <dune/common/parallel/mpihelper.hh>
    \n-\n-
    14
    \n-
    15namespace Dune {
    \n-
    16
    \n-
    17 namespace {
    \n-
    18
    \n-
    19 template<int dim>
    \n-
    20 struct ElementDataLayout
    \n-
    21 {
    \n-
    22 bool contains (Dune::GeometryType gt)
    \n-
    23 {
    \n-
    24 return gt.dim()==dim;
    \n-
    25 }
    \n-
    26 };
    \n-
    27
    \n-
    28 template<int dim>
    \n-
    29 struct NodeDataLayout
    \n-
    30 {
    \n-
    31 bool contains (Dune::GeometryType gt)
    \n-
    32 {
    \n-
    33 return gt.dim()==0;
    \n-
    34 }
    \n-
    35 };
    \n-
    36
    \n-
    37 // Move a point closer to basegeo's center by factor scale (used for drawing relative to the element)
    \n-
    38 template <typename B, typename C>
    \n-
    39 C centrify (const B& basegeo, const C& coords, const double scale) {
    \n-
    40 C ret = coords;
    \n-
    41 ret -= basegeo.center();
    \n-
    42 ret *= scale;
    \n-
    43 ret += basegeo.center();
    \n-
    44 return ret;
    \n-
    45 }
    \n-
    46
    \n-
    47 // Add a line to the plotfile from p1 to p2
    \n-
    48 template <typename Coord>
    \n-
    49 void draw_line (std::ofstream &plotfile, const Coord &p1, const Coord &p2, std::string options) {
    \n-
    50 plotfile << "set object poly from ";
    \n-
    51 plotfile << p1[0] << "," << p1[1] << " to ";
    \n-
    52 plotfile << p2[0] << "," << p2[1] << " to ";
    \n-
    53 plotfile << p1[0] << "," << p1[1];
    \n-
    54 plotfile << " " << options << std::endl;
    \n-
    55 }
    \n-
    56
    \n-
    57 }
    \n+
    5
    \n+
    6#ifndef DUNE_GMSHREADER_HH
    \n+
    7#define DUNE_GMSHREADER_HH
    \n+
    8
    \n+
    9#include <cstdarg>
    \n+
    10#include <cstdio>
    \n+
    11#include <cstring>
    \n+
    12#include <fstream>
    \n+
    13#include <iostream>
    \n+
    14#include <map>
    \n+
    15#include <memory>
    \n+
    16#include <string>
    \n+
    17#include <tuple>
    \n+
    18#include <vector>
    \n+
    19#include <utility>
    \n+
    20
    \n+
    21#include <dune/common/exceptions.hh>
    \n+
    22#include <dune/common/fvector.hh>
    \n+
    23
    \n+
    24#include <dune/geometry/type.hh>
    \n+
    25
    \n+\n+\n+
    28
    \n+
    29namespace Dune
    \n+
    30{
    \n+
    31
    \n+
    \n+\n+
    39 {
    \n+
    \n+\n+\n+\n+
    45 };
    \n+
    \n+
    46 };
    \n+
    \n+
    47
    \n+
    48 namespace {
    \n+
    49
    \n+
    50 // arbitrary dimension, implementation is in specialization
    \n+
    51 template< int dimension, int dimWorld = dimension >
    \n+
    52 class GmshReaderQuadraticBoundarySegment
    \n+
    53 {
    \n+
    54 public:
    \n+
    55 // empty function since this class does not implement anything
    \n+
    56 static void registerFactory() {}
    \n+
    57 };
    \n
    58
    \n-
    72 template <typename GridType>
    \n-
    \n-
    73 void printGrid (const GridType& grid, const Dune::MPIHelper& helper, std::string output_file = "printgrid",
    \n-
    74 int size = 2000, bool execute_plot = true, bool png = true, bool local_corner_indices = true,
    \n-
    75 bool local_intersection_indices = true, bool outer_normals = true)
    \n-
    76 {
    \n-
    77
    \n-
    78 // Create output file
    \n-
    79 output_file = output_file + "_" + std::to_string(helper.rank());
    \n-
    80 std::string plot_file_name = output_file + ".gnuplot";
    \n-
    81 std::ofstream plotfile (plot_file_name, std::ios::out | std::ios::trunc);
    \n-
    82 if (!plotfile.is_open()) {
    \n-
    83 DUNE_THROW(Dune::IOError, "Could not create plot file " << output_file << "!");
    \n-
    84 return;
    \n-
    85 }
    \n-
    86
    \n-
    87 // Basic plot settings
    \n-
    88 plotfile << "set size ratio -1" << std::endl;
    \n-
    89 if (png) {
    \n-
    90 plotfile << "set terminal png size " << size << "," << size << std::endl;
    \n-
    91 plotfile << "set output '" << output_file << ".png'" << std::endl;
    \n-
    92 } else {
    \n-
    93 plotfile << "set terminal svg size " << size << "," << size << " enhanced background rgb 'white'" << std::endl;
    \n-
    94 plotfile << "set output '" << output_file << ".svg'" << std::endl;
    \n-
    95 }
    \n-
    96
    \n-
    97 // Get GridView
    \n-
    98 typedef typename GridType::LeafGridView GV;
    \n-
    99 const GV gv = grid.leafGridView();
    \n-
    100
    \n-
    101 // Create mappers used to retrieve indices
    \n-\n-
    103 const Mapper elementmapper(gv, mcmgElementLayout());
    \n-
    104 const Mapper nodemapper(gv, mcmgVertexLayout());
    \n-
    105
    \n-
    106 // Create iterators
    \n-
    107 typedef typename GV::template Codim<0 >::Iterator LeafIterator;
    \n-
    108 typedef typename GV::IntersectionIterator IntersectionIterator;
    \n-
    109
    \n-
    110 LeafIterator it = gv.template begin<0>();
    \n-
    111
    \n-
    112 // Will contain min/max coordinates. Needed for scaling of the plot
    \n-
    113 Dune::FieldVector<typename GridType::ctype,2> max_coord (it->geometry().center()), min_coord (max_coord);
    \n-
    114
    \n-
    115 // Iterate over elements
    \n-
    116 for (; it != gv.template end<0>(); ++it) {
    \n-
    117
    \n-
    118 const auto& entity = *it;
    \n-
    119 auto geo = entity.geometry();
    \n-
    120
    \n-
    121 // Plot element index
    \n-
    122 int element_id = elementmapper.index(entity);
    \n-
    123 plotfile << "set label at " << geo.center()[0] << "," << geo.center()[1] << " '"
    \n-
    124 << element_id << "' center" << std::endl;
    \n-
    125
    \n-
    126 for (int i = 0; i < geo.corners(); ++i) {
    \n-
    127 // Plot corner indices
    \n-
    128 const int globalNodeNumber1 = nodemapper.subIndex(entity, i, 2);
    \n-
    129 auto labelpos = centrify (geo, geo.corner(i), 0.7);
    \n-
    130 plotfile << "set label at " << labelpos[0] << "," << labelpos[1] << " '" << globalNodeNumber1;
    \n-
    131 if (local_corner_indices)
    \n-
    132 plotfile << "(" << i << ")";
    \n-
    133 plotfile << "' center" << std::endl;
    \n-
    134
    \n-
    135 // Adapt min / max coordinates
    \n-
    136 for (int dim = 0; dim < 2; ++dim) {
    \n-
    137 if (geo.corner(i)[dim] < min_coord[dim])
    \n-
    138 min_coord[dim] = geo.corner(i)[dim];
    \n-
    139 else if (geo.corner(i)[dim] > max_coord[dim])
    \n-
    140 max_coord[dim] = geo.corner(i)[dim];
    \n-
    141 }
    \n-
    142 }
    \n-
    143
    \n-
    144 // Iterate over intersections
    \n-
    145 for (IntersectionIterator is = gv.ibegin(entity); is != gv.iend(entity); ++is) {
    \n+
    59 // quadratic boundary segments in 1d
    \n+
    60 /*
    \n+
    61 Note the points
    \n+
    62
    \n+
    63 (0) (alpha) (1)
    \n+
    64
    \n+
    65 are mapped to the points in global coordinates
    \n+
    66
    \n+
    67 p0 p2 p1
    \n+
    68
    \n+
    69 alpha is determined automatically from the given points.
    \n+
    70 */
    \n+
    71 template< int dimWorld >
    \n+
    72 struct GmshReaderQuadraticBoundarySegment< 2, dimWorld >
    \n+
    73 : public Dune::BoundarySegment< 2, dimWorld >
    \n+
    74 {
    \n+
    75 typedef GmshReaderQuadraticBoundarySegment< 2, dimWorld > ThisType;
    \n+
    76 typedef typename Dune::BoundarySegment< 2, dimWorld > :: ObjectStreamType ObjectStreamType;
    \n+
    77 typedef Dune::FieldVector< double, dimWorld > GlobalVector;
    \n+
    78
    \n+
    79 GmshReaderQuadraticBoundarySegment ( const GlobalVector &p0_, const GlobalVector &p1_, const GlobalVector &p2_)
    \n+
    80 : p0(p0_), p1(p1_), p2(p2_)
    \n+
    81 {
    \n+
    82 init();
    \n+
    83 }
    \n+
    84
    \n+
    85 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )
    \n+
    86 {
    \n+
    87 // key is read before by the factory
    \n+
    88 const int bytes = sizeof(double)*dimWorld;
    \n+
    89 in.read( (char *) &p0[ 0 ], bytes );
    \n+
    90 in.read( (char *) &p1[ 0 ], bytes );
    \n+
    91 in.read( (char *) &p2[ 0 ], bytes );
    \n+
    92 init();
    \n+
    93 }
    \n+
    94
    \n+
    95 static void registerFactory()
    \n+
    96 {
    \n+
    97 if( key() < 0 )
    \n+
    98 {
    \n+
    99 key() = Dune::BoundarySegment< 2, dimWorld >::template registerFactory< ThisType >();
    \n+
    100 }
    \n+
    101 }
    \n+
    102
    \n+
    103 virtual GlobalVector operator() ( const Dune::FieldVector<double,1> &local ) const
    \n+
    104 {
    \n+
    105 GlobalVector y;
    \n+
    106 y = 0.0;
    \n+
    107 y.axpy((local[0]-alpha)*(local[0]-1.0)/alpha,p0);
    \n+
    108 y.axpy(local[0]*(local[0]-1.0)/(alpha*(alpha-1.0)),p1);
    \n+
    109 y.axpy(local[0]*(local[0]-alpha)/(1.0-alpha),p2);
    \n+
    110 return y;
    \n+
    111 }
    \n+
    112
    \n+
    113 void backup( ObjectStreamType& out ) const
    \n+
    114 {
    \n+
    115 // backup key to identify object
    \n+
    116 out.write( (const char *) &key(), sizeof( int ) );
    \n+
    117 // backup data
    \n+
    118 const int bytes = sizeof(double)*dimWorld;
    \n+
    119 out.write( (const char*) &p0[ 0 ], bytes );
    \n+
    120 out.write( (const char*) &p1[ 0 ], bytes );
    \n+
    121 out.write( (const char*) &p2[ 0 ], bytes );
    \n+
    122 }
    \n+
    123
    \n+
    124 protected:
    \n+
    125 void init()
    \n+
    126 {
    \n+
    127 GlobalVector d1 = p1;
    \n+
    128 d1 -= p0;
    \n+
    129 GlobalVector d2 = p2;
    \n+
    130 d2 -= p1;
    \n+
    131
    \n+
    132 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());
    \n+
    133 if (alpha<1E-6 || alpha>1-1E-6)
    \n+
    134 DUNE_THROW(Dune::IOError, "ration in quadratic boundary segment bad");
    \n+
    135 }
    \n+
    136
    \n+
    137 static int& key() {
    \n+
    138 static int k = -1;
    \n+
    139 return k;
    \n+
    140 }
    \n+
    141
    \n+
    142 private:
    \n+
    143 GlobalVector p0,p1,p2;
    \n+
    144 double alpha;
    \n+
    145 };
    \n
    146
    \n-
    147 const auto& intersection = *is;
    \n-
    148 auto igeo = intersection.geometry();
    \n-
    149
    \n-
    150 // Draw intersection line
    \n-
    151 draw_line (plotfile, igeo.corner(0), igeo.corner(1), "fs empty border 1");
    \n-
    152
    \n-
    153 // Plot local intersection index
    \n-
    154 if (local_intersection_indices) {
    \n-
    155 auto label_pos = centrify (geo, igeo.center(), 0.8);
    \n-
    156 plotfile << "set label at " << label_pos[0] << "," << label_pos[1]
    \n-
    157 << " '" << intersection.indexInInside() << "' center" << std::endl;
    \n-
    158 }
    \n-
    159
    \n-
    160 // Plot outer normal
    \n-
    161 if (outer_normals) {
    \n-
    162 auto intersection_pos = igeo.center();
    \n-
    163 auto normal = intersection.centerUnitOuterNormal();
    \n-
    164 normal *= 0.15 * igeo.volume();
    \n-
    165 auto normal_end = intersection_pos + normal;
    \n-
    166 plotfile << "set arrow from " << intersection_pos[0] << "," << intersection_pos[1]
    \n-
    167 << " to " << normal_end[0] << "," << normal_end[1] << " lt rgb \\"gray\\"" << std::endl;
    \n-
    168 }
    \n-
    169
    \n-
    170 // Get corners for inner intersection representation
    \n-
    171 auto inner_corner1 = centrify (geo, igeo.corner(0), 0.5);
    \n-
    172 auto inner_corner2 = centrify (geo, igeo.corner(1), 0.5);
    \n-
    173
    \n-
    174 // Thick line in case of boundary()
    \n-
    175 if (intersection.boundary())
    \n-
    176 draw_line (plotfile, inner_corner1, inner_corner2, "fs empty border 3 lw 4");
    \n-
    177
    \n-
    178 // Thin line with color according to neighbor()
    \n-
    179 if (intersection.neighbor())
    \n-
    180 draw_line (plotfile, inner_corner1, inner_corner2, "fs empty border 2");
    \n-
    181 else
    \n-
    182 draw_line (plotfile, inner_corner1, inner_corner2, "fs empty border 1");
    \n-
    183 }
    \n-
    184
    \n-
    185 }
    \n-
    186
    \n-
    187 // Finish plot, pass extend of the grid
    \n-
    188 Dune::FieldVector<typename GridType::ctype,2> extend (max_coord - min_coord);
    \n-
    189
    \n-
    190 extend *= 0.2;
    \n-
    191 min_coord -= extend;
    \n-
    192 max_coord += extend;
    \n-
    193 plotfile << "plot [" << min_coord[0] << ":" << max_coord[0] << "] [" << min_coord[1]
    \n-
    194 << ":" << max_coord[1] << "] NaN notitle" << std::endl;
    \n-
    195 plotfile.close();
    \n-
    196
    \n-
    197 if (execute_plot) {
    \n-
    198 std::string cmd = "gnuplot -p '" + plot_file_name + "'";
    \n-
    199 if (std::system (cmd.c_str()) != 0)
    \n-
    200 DUNE_THROW(Dune::Exception,"Error running GNUPlot: " << cmd);
    \n-
    201 }
    \n-
    202 }
    \n-
    \n-
    203
    \n-
    204}
    \n+
    147
    \n+
    148 // quadratic boundary segments in 2d
    \n+
    149 /* numbering of points corresponding to gmsh:
    \n+
    150
    \n+
    151 2
    \n+
    152
    \n+
    153 5 4
    \n+
    154
    \n+
    155 0 3 1
    \n+
    156
    \n+
    157 Note: The vertices 3, 4, 5 are not necessarily at the edge midpoints but can
    \n+
    158 be placed with parameters alpha, beta , gamma at the following positions
    \n+
    159 in local coordinates:
    \n+
    160
    \n+
    161
    \n+
    162 2 = (0,1)
    \n+
    163
    \n+
    164 5 = (0,beta) 4 = (1-gamma/sqrt(2),gamma/sqrt(2))
    \n+
    165
    \n+
    166 0 = (0,0) 3 = (alpha,0) 1 = (1,0)
    \n+
    167
    \n+
    168 The parameters alpha, beta, gamma are determined from the given vertices in
    \n+
    169 global coordinates.
    \n+
    170 */
    \n+
    171 template<>
    \n+
    172 class GmshReaderQuadraticBoundarySegment< 3, 3 >
    \n+
    173 : public Dune::BoundarySegment< 3 >
    \n+
    174 {
    \n+
    175 typedef GmshReaderQuadraticBoundarySegment< 3, 3 > ThisType;
    \n+
    176 typedef typename Dune::BoundarySegment< 3 > :: ObjectStreamType ObjectStreamType;
    \n+
    177 public:
    \n+
    178 GmshReaderQuadraticBoundarySegment (Dune::FieldVector<double,3> p0_, Dune::FieldVector<double,3> p1_,
    \n+
    179 Dune::FieldVector<double,3> p2_, Dune::FieldVector<double,3> p3_,
    \n+
    180 Dune::FieldVector<double,3> p4_, Dune::FieldVector<double,3> p5_)
    \n+
    181 : p0(p0_), p1(p1_), p2(p2_), p3(p3_), p4(p4_), p5(p5_)
    \n+
    182 {
    \n+
    183 init();
    \n+
    184 }
    \n+
    185
    \n+
    186 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )
    \n+
    187 {
    \n+
    188 const int bytes = sizeof(double)*3;
    \n+
    189 in.read( (char *) &p0[ 0 ], bytes );
    \n+
    190 in.read( (char *) &p1[ 0 ], bytes );
    \n+
    191 in.read( (char *) &p2[ 0 ], bytes );
    \n+
    192 in.read( (char *) &p3[ 0 ], bytes );
    \n+
    193 in.read( (char *) &p4[ 0 ], bytes );
    \n+
    194 in.read( (char *) &p5[ 0 ], bytes );
    \n+
    195 init();
    \n+
    196 }
    \n+
    197
    \n+
    198 static void registerFactory()
    \n+
    199 {
    \n+
    200 if( key() < 0 )
    \n+
    201 {
    \n+
    202 key() = Dune::BoundarySegment< 3 >::template registerFactory< ThisType >();
    \n+
    203 }
    \n+
    204 }
    \n
    205
    \n-
    206#endif // #ifndef DUNE_PRINTGRID_HH
    \n-
    Mapper for multiple codim and multiple geometry types.
    \n-
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n-
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n+
    206 virtual Dune::FieldVector<double,3> operator() (const Dune::FieldVector<double,2>& local) const
    \n+
    207 {
    \n+
    208 Dune::FieldVector<double,3> y;
    \n+
    209 y = 0.0;
    \n+
    210 y.axpy(phi0(local),p0);
    \n+
    211 y.axpy(phi1(local),p1);
    \n+
    212 y.axpy(phi2(local),p2);
    \n+
    213 y.axpy(phi3(local),p3);
    \n+
    214 y.axpy(phi4(local),p4);
    \n+
    215 y.axpy(phi5(local),p5);
    \n+
    216 return y;
    \n+
    217 }
    \n+
    218
    \n+
    219 void backup( ObjectStreamType& out ) const
    \n+
    220 {
    \n+
    221 // backup key to identify object in factory
    \n+
    222 out.write( (const char*) &key(), sizeof( int ) );
    \n+
    223 // backup data
    \n+
    224 const int bytes = sizeof(double)*3;
    \n+
    225 out.write( (const char*) &p0[ 0 ], bytes );
    \n+
    226 out.write( (const char*) &p1[ 0 ], bytes );
    \n+
    227 out.write( (const char*) &p2[ 0 ], bytes );
    \n+
    228 out.write( (const char*) &p3[ 0 ], bytes );
    \n+
    229 out.write( (const char*) &p4[ 0 ], bytes );
    \n+
    230 out.write( (const char*) &p5[ 0 ], bytes );
    \n+
    231 }
    \n+
    232
    \n+
    233 protected:
    \n+
    234 void init()
    \n+
    235 {
    \n+
    236 using std::sqrt;
    \n+
    237 sqrt2 = sqrt(2.0);
    \n+
    238 Dune::FieldVector<double,3> d1,d2;
    \n+
    239
    \n+
    240 d1 = p3; d1 -= p0;
    \n+
    241 d2 = p1; d2 -= p3;
    \n+
    242 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());
    \n+
    243 if (alpha<1E-6 || alpha>1-1E-6)
    \n+
    244 DUNE_THROW(Dune::IOError, "alpha in quadratic boundary segment bad");
    \n+
    245
    \n+
    246 d1 = p5; d1 -= p0;
    \n+
    247 d2 = p2; d2 -= p5;
    \n+
    248 beta=d1.two_norm()/(d1.two_norm()+d2.two_norm());
    \n+
    249 if (beta<1E-6 || beta>1-1E-6)
    \n+
    250 DUNE_THROW(Dune::IOError, "beta in quadratic boundary segment bad");
    \n+
    251
    \n+
    252 d1 = p4; d1 -= p1;
    \n+
    253 d2 = p2; d2 -= p4;
    \n+
    254 gamma=sqrt2*(d1.two_norm()/(d1.two_norm()+d2.two_norm()));
    \n+
    255 if (gamma<1E-6 || gamma>1-1E-6)
    \n+
    256 DUNE_THROW(Dune::IOError, "gamma in quadratic boundary segment bad");
    \n+
    257 }
    \n+
    258
    \n+
    259 static int& key() {
    \n+
    260 static int k = -1;
    \n+
    261 return k;
    \n+
    262 }
    \n+
    263
    \n+
    264 private:
    \n+
    265 // The six Lagrange basis function on the reference element
    \n+
    266 // for the points given above
    \n+
    267
    \n+
    268 double phi0 (const Dune::FieldVector<double,2>& local) const
    \n+
    269 {
    \n+
    270 return (alpha*beta-beta*local[0]-alpha*local[1])*(1-local[0]-local[1])/(alpha*beta);
    \n+
    271 }
    \n+
    272 double phi3 (const Dune::FieldVector<double,2>& local) const
    \n+
    273 {
    \n+
    274 return local[0]*(1-local[0]-local[1])/(alpha*(1-alpha));
    \n+
    275 }
    \n+
    276 double phi1 (const Dune::FieldVector<double,2>& local) const
    \n+
    277 {
    \n+
    278 return local[0]*(gamma*local[0]-(sqrt2-gamma-sqrt2*alpha)*local[1]-alpha*gamma)/(gamma*(1-alpha));
    \n+
    279 }
    \n+
    280 double phi5 (const Dune::FieldVector<double,2>& local) const
    \n+
    281 {
    \n+
    282 return local[1]*(1-local[0]-local[1])/(beta*(1-beta));
    \n+
    283 }
    \n+
    284 double phi4 (const Dune::FieldVector<double,2>& local) const
    \n+
    285 {
    \n+
    286 return local[0]*local[1]/((1-gamma/sqrt2)*gamma/sqrt2);
    \n+
    287 }
    \n+
    288 double phi2 (const Dune::FieldVector<double,2>& local) const
    \n+
    289 {
    \n+
    290 return local[1]*(beta*(1-gamma/sqrt2)-local[0]*(beta-gamma/sqrt2)-local[1]*(1-gamma/sqrt2))/((1-gamma/sqrt2)*(beta-1));
    \n+
    291 }
    \n+
    292
    \n+
    293 Dune::FieldVector<double,3> p0,p1,p2,p3,p4,p5;
    \n+
    294 double alpha,beta,gamma,sqrt2;
    \n+
    295 };
    \n+
    296
    \n+
    297 } // end empty namespace
    \n+
    298
    \n+
    300 template<typename GridType>
    \n+
    \n+\n+
    302 {
    \n+
    303 protected:
    \n+
    304 // private data
    \n+\n+\n+\n+\n+\n+\n+
    311 // read buffer
    \n+
    312 char buf[512];
    \n+
    313 std::string fileName;
    \n+
    314 // exported data
    \n+\n+\n+
    317 std::vector<std::string> physical_entity_names;
    \n+
    318
    \n+
    319 // static data
    \n+
    320 static const int dim = GridType::dimension;
    \n+
    321 static const int dimWorld = GridType::dimensionworld;
    \n+
    322 static_assert( (dimWorld <= 3), "GmshReader requires dimWorld <= 3." );
    \n+
    323
    \n+
    324 // typedefs
    \n+
    325 typedef FieldVector< double, dimWorld > GlobalVector;
    \n+
    326
    \n+
    327 // don't use something like
    \n+
    328 // readfile(file, 1, "%s\\n", buf);
    \n+
    329 // to skip the rest of of the line -- that will only skip the next
    \n+
    330 // whitespace-separated word! Use skipline() instead.
    \n+
    \n+
    331 void readfile(FILE * file, int cnt, const char * format, ...)
    \n+
    332#ifdef __GNUC__
    \n+
    333 __attribute__((format(scanf, 4, 5)))
    \n+
    334#endif
    \n+
    335 {
    \n+
    336 std::va_list ap;
    \n+
    337 va_start(ap, format);
    \n+
    338 off_t pos = ftello(file);
    \n+
    339 int c = std::vfscanf(file, format, ap);
    \n+
    340 va_end(ap);
    \n+
    341 if (c != cnt)
    \n+
    342 DUNE_THROW(Dune::IOError, "Error parsing " << fileName << " "
    \n+
    343 "file pos " << pos
    \n+
    344 << ": Expected '" << format << "', only read " << c << " entries instead of " << cnt << ".");
    \n+
    345 }
    \n+
    \n+
    346
    \n+
    347 // skip over the rest of the line, including the terminating newline
    \n+
    \n+
    348 void skipline(FILE * file)
    \n+
    349 {
    \n+
    350 int c;
    \n+
    351 do {
    \n+
    352 c = std::fgetc(file);
    \n+
    353 } while(c != '\\n' && c != EOF);
    \n+
    354 }
    \n+
    \n+
    355
    \n+
    356 public:
    \n+
    357
    \n+
    \n+\n+
    359 factory(_factory), verbose(v), insert_boundary_segments(i) {}
    \n+
    \n+
    360
    \n+
    \n+
    361 std::vector<int> & boundaryIdMap()
    \n+
    362 {
    \n+\n+
    364 }
    \n+
    \n+
    365
    \n+
    \n+
    367 std::vector<int> & elementIndexMap()
    \n+
    368 {
    \n+\n+
    370 }
    \n+
    \n+
    371
    \n+
    \n+
    373 std::vector<std::string> & physicalEntityNames()
    \n+
    374 {
    \n+\n+
    376 }
    \n+
    \n+
    377
    \n+
    \n+
    378 void read (const std::string& f)
    \n+
    379 {
    \n+
    380 if (verbose) std::cout << "Reading " << dim << "d Gmsh grid..." << std::endl;
    \n+
    381
    \n+
    382 // open file name, we use C I/O
    \n+
    383 fileName = f;
    \n+
    384 FILE* file = fopen(fileName.c_str(),"rb");
    \n+
    385 if (file==0)
    \n+
    386 DUNE_THROW(Dune::IOError, "Could not open " << fileName);
    \n+
    387
    \n+
    388 //=========================================
    \n+
    389 // Header: Read vertices into vector
    \n+
    390 // Check vertices that are needed
    \n+
    391 //=========================================
    \n+
    392
    \n+\n+\n+
    395 element_count = 0;
    \n+
    396
    \n+
    397 // process header
    \n+
    398 double version_number;
    \n+
    399 int file_type, data_size;
    \n+
    400
    \n+
    401 readfile(file,1,"%s\\n",buf);
    \n+
    402 if (strcmp(buf,"$MeshFormat")!=0)
    \n+
    403 DUNE_THROW(Dune::IOError, "expected $MeshFormat in first line");
    \n+
    404 readfile(file,3,"%lg %d %d\\n",&version_number,&file_type,&data_size);
    \n+
    405 // 2.2 is not representable as float and leads to problems on i386
    \n+
    406 // Hence we use >= 2.00001.
    \n+
    407 if( (version_number < 2.0) || (version_number >= 2.20001) ) // 2.2 is not representable as float and leads to problems on i386
    \n+
    408 DUNE_THROW(Dune::IOError, "can only read Gmsh version 2 files");
    \n+
    409 if (verbose) std::cout << "version " << version_number << " Gmsh file detected" << std::endl;
    \n+
    410 readfile(file,1,"%s\\n",buf);
    \n+
    411 if (strcmp(buf,"$EndMeshFormat")!=0)
    \n+
    412 DUNE_THROW(Dune::IOError, "expected $EndMeshFormat");
    \n+
    413
    \n+
    414 // physical name section
    \n+
    415 physical_entity_names.clear();
    \n+
    416 readfile(file,1,"%s\\n",buf);
    \n+
    417 if (strcmp(buf,"$PhysicalNames")==0) {
    \n+
    418 int number_of_names;
    \n+
    419 readfile(file,1,"%d\\n",&number_of_names);
    \n+
    420 if (verbose) std::cout << "file contains " << number_of_names << " physical entities" << std::endl;
    \n+
    421 physical_entity_names.resize(number_of_names);
    \n+
    422 std::string buf_name;
    \n+
    423 for( int i = 0; i < number_of_names; ++i ) {
    \n+
    424 int dim, id;
    \n+
    425 readfile(file,3, "%d %d %s\\n", &dim, &id, buf);
    \n+
    426 buf_name.assign(buf);
    \n+
    427 auto begin = buf_name.find_first_of('\\"') + 1;
    \n+
    428 auto end = buf_name.find_last_of('\\"') - begin;
    \n+
    429 physical_entity_names[id-1].assign(buf_name.substr(begin, end));
    \n+
    430 }
    \n+
    431 readfile(file,1,"%s\\n",buf);
    \n+
    432 if (strcmp(buf,"$EndPhysicalNames")!=0)
    \n+
    433 DUNE_THROW(Dune::IOError, "expected $EndPhysicalNames");
    \n+
    434 readfile(file,1,"%s\\n",buf);
    \n+
    435 }
    \n+
    436
    \n+
    437 // node section
    \n+
    438 int number_of_nodes;
    \n+
    439
    \n+
    440 if (strcmp(buf,"$Nodes")!=0)
    \n+
    441 DUNE_THROW(Dune::IOError, "expected $Nodes");
    \n+
    442 readfile(file,1,"%d\\n",&number_of_nodes);
    \n+
    443 if (verbose) std::cout << "file contains " << number_of_nodes << " nodes" << std::endl;
    \n+
    444
    \n+
    445 // read nodes
    \n+
    446 // The '+1' is due to the fact that gmsh numbers node starting from 1 rather than from 0
    \n+
    447 std::vector< GlobalVector > nodes( number_of_nodes+1 );
    \n+
    448 {
    \n+
    449 int id;
    \n+
    450 double x[ 3 ];
    \n+
    451 for( int i = 1; i <= number_of_nodes; ++i )
    \n+
    452 {
    \n+
    453 readfile(file,4, "%d %lg %lg %lg\\n", &id, &x[ 0 ], &x[ 1 ], &x[ 2 ] );
    \n+
    454
    \n+
    455 if (id > number_of_nodes) {
    \n+
    456 DUNE_THROW(Dune::IOError,
    \n+
    457 "Only dense sequences of node indices are currently supported (node index "
    \n+
    458 << id << " is invalid).");
    \n+
    459 }
    \n+
    460
    \n+
    461 // just store node position
    \n+
    462 for( int j = 0; j < dimWorld; ++j )
    \n+
    463 nodes[ id ][ j ] = x[ j ];
    \n+
    464 }
    \n+
    465 readfile(file,1,"%s\\n",buf);
    \n+
    466 if (strcmp(buf,"$EndNodes")!=0)
    \n+
    467 DUNE_THROW(Dune::IOError, "expected $EndNodes");
    \n+
    468 }
    \n+
    469
    \n+
    470 // element section
    \n+
    471 readfile(file,1,"%s\\n",buf);
    \n+
    472 if (strcmp(buf,"$Elements")!=0)
    \n+
    473 DUNE_THROW(Dune::IOError, "expected $Elements");
    \n+
    474 int number_of_elements;
    \n+
    475 readfile(file,1,"%d\\n",&number_of_elements);
    \n+
    476 if (verbose) std::cout << "file contains " << number_of_elements << " elements" << std::endl;
    \n+
    477
    \n+
    478 //=========================================
    \n+
    479 // Pass 1: Select and insert those vertices in the file that
    \n+
    480 // actually occur as corners of an element.
    \n+
    481 //=========================================
    \n+
    482
    \n+
    483 off_t section_element_offset = ftello(file);
    \n+
    484 std::map<int,unsigned int> renumber;
    \n+
    485 for (int i=1; i<=number_of_elements; i++)
    \n+
    486 {
    \n+
    487 int id, elm_type, number_of_tags;
    \n+
    488 readfile(file,3,"%d %d %d ",&id,&elm_type,&number_of_tags);
    \n+
    489 for (int k=1; k<=number_of_tags; k++)
    \n+
    490 {
    \n+
    491 int blub;
    \n+
    492 readfile(file,1,"%d ",&blub);
    \n+
    493 // k == 1: physical entity
    \n+
    494 // k == 2: elementary entity (not used here)
    \n+
    495 // if version_number < 2.2:
    \n+
    496 // k == 3: mesh partition 0
    \n+
    497 // else
    \n+
    498 // k == 3: number of mesh partitions
    \n+
    499 // k => 4: mesh partition k-4
    \n+
    500 }
    \n+
    501 pass1HandleElement(file, elm_type, renumber, nodes);
    \n+
    502 }
    \n+
    503 if (verbose) std::cout << "number of real vertices = " << number_of_real_vertices << std::endl;
    \n+
    504 if (verbose) std::cout << "number of boundary elements = " << boundary_element_count << std::endl;
    \n+
    505 if (verbose) std::cout << "number of elements = " << element_count << std::endl;
    \n+
    506 readfile(file,1,"%s\\n",buf);
    \n+
    507 if (strcmp(buf,"$EndElements")!=0)
    \n+
    508 DUNE_THROW(Dune::IOError, "expected $EndElements");
    \n+\n+\n+
    511
    \n+
    512 //==============================================
    \n+
    513 // Pass 2: Insert boundary segments and elements
    \n+
    514 //==============================================
    \n+
    515
    \n+
    516 fseeko(file, section_element_offset, SEEK_SET);
    \n+\n+
    518 element_count = 0;
    \n+
    519 for (int i=1; i<=number_of_elements; i++)
    \n+
    520 {
    \n+
    521 int id, elm_type, number_of_tags;
    \n+
    522 readfile(file,3,"%d %d %d ",&id,&elm_type,&number_of_tags);
    \n+
    523 int physical_entity = -1;
    \n+
    524
    \n+
    525 for (int k=1; k<=number_of_tags; k++)
    \n+
    526 {
    \n+
    527 int blub;
    \n+
    528 readfile(file,1,"%d ",&blub);
    \n+
    529 if (k==1) physical_entity = blub;
    \n+
    530 }
    \n+
    531 pass2HandleElement(file, elm_type, renumber, nodes, physical_entity);
    \n+
    532 }
    \n+
    533 readfile(file,1,"%s\\n",buf);
    \n+
    534 if (strcmp(buf,"$EndElements")!=0)
    \n+
    535 DUNE_THROW(Dune::IOError, "expected $EndElements");
    \n+
    536
    \n+
    537 fclose(file);
    \n+
    538 }
    \n+
    \n+
    539
    \n+
    \n+
    545 void pass1HandleElement(FILE* file, const int elm_type,
    \n+
    546 std::map<int,unsigned int> & renumber,
    \n+
    547 const std::vector< GlobalVector > & nodes)
    \n+
    548 {
    \n+
    549 // some data about gmsh elements
    \n+
    550 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1, 1};
    \n+
    551 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -1, 1};
    \n+
    552 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -1, 0};
    \n+
    553
    \n+
    554 // test whether we support the element type
    \n+
    555 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?
    \n+
    556 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) // real element or boundary element?
    \n+
    557 {
    \n+
    558 skipline(file); // skip rest of line if element is unknown
    \n+
    559 return;
    \n+
    560 }
    \n+
    561
    \n+
    562 // The format string for parsing is n times '%d' in a row
    \n+
    563 std::string formatString = "%d";
    \n+
    564 for (int i=1; i<nDofs[elm_type]; i++)
    \n+
    565 formatString += " %d";
    \n+
    566 formatString += "\\n";
    \n+
    567
    \n+
    568 // '10' is the largest number of dofs we may encounter in a .msh file
    \n+
    569 std::vector<int> elementDofs(10);
    \n+
    570
    \n+
    571 readfile(file,nDofs[elm_type], formatString.c_str(),
    \n+
    572 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),
    \n+
    573 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),
    \n+
    574 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),
    \n+
    575 &(elementDofs[9]));
    \n+
    576
    \n+
    577 // insert each vertex if it hasn't been inserted already
    \n+
    578 for (int i=0; i<nVertices[elm_type]; i++)
    \n+
    579 if (renumber.find(elementDofs[i])==renumber.end())
    \n+
    580 {
    \n+
    581 renumber[elementDofs[i]] = number_of_real_vertices++;
    \n+
    582 factory.insertVertex(nodes[elementDofs[i]]);
    \n+
    583 }
    \n+
    584
    \n+
    585 // count elements and boundary elements
    \n+
    586 if (elementDim[elm_type] == dim)
    \n+\n+
    588 else
    \n+\n+
    590
    \n+
    591 }
    \n+
    \n+
    592
    \n+
    593
    \n+
    594
    \n+
    595 // generic-case: This is not supposed to be used at runtime.
    \n+
    596 template <class E, class V, class V2>
    \n+
    \n+\n+
    598 const V&,
    \n+
    599 const E&,
    \n+
    600 const V2&
    \n+
    601 )
    \n+
    602 {
    \n+
    603 DUNE_THROW(Dune::IOError, "tried to create a 3D boundary segment in a non-3D Grid");
    \n+
    604 }
    \n+
    \n+
    605
    \n+
    606 // 3d-case:
    \n+
    607 template <class E, class V>
    \n+
    \n+\n+
    609 const std::vector<FieldVector<double, 3> >& nodes,
    \n+
    610 const E& elementDofs,
    \n+
    611 const V& vertices
    \n+
    612 )
    \n+
    613 {
    \n+
    614 std::array<FieldVector<double,dimWorld>, 6> v;
    \n+
    615 for (int i=0; i<6; i++)
    \n+
    616 for (int j=0; j<dimWorld; j++)
    \n+
    617 v[i][j] = nodes[elementDofs[i]][j];
    \n+
    618
    \n+
    619 BoundarySegment<dim,dimWorld>* newBoundarySegment
    \n+
    620 = (BoundarySegment<dim,dimWorld>*) new GmshReaderQuadraticBoundarySegment< 3, 3 >( v[0], v[1], v[2],
    \n+
    621 v[3], v[4], v[5] );
    \n+
    622
    \n+
    623 factory.insertBoundarySegment( vertices,
    \n+
    624 std::shared_ptr<BoundarySegment<dim,dimWorld> >(newBoundarySegment) );
    \n+
    625 }
    \n+
    \n+
    626
    \n+
    627
    \n+
    628
    \n+
    \n+
    633 virtual void pass2HandleElement(FILE* file, const int elm_type,
    \n+
    634 std::map<int,unsigned int> & renumber,
    \n+
    635 const std::vector< GlobalVector > & nodes,
    \n+
    636 const int physical_entity)
    \n+
    637 {
    \n+
    638 // some data about gmsh elements
    \n+
    639 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1, 1};
    \n+
    640 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -1, 1};
    \n+
    641 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -1, 0};
    \n+
    642
    \n+
    643 // test whether we support the element type
    \n+
    644 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?
    \n+
    645 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) // real element or boundary element?
    \n+
    646 {
    \n+
    647 skipline(file); // skip rest of line if element is unknown
    \n+
    648 return;
    \n+
    649 }
    \n+
    650
    \n+
    651 // The format string for parsing is n times '%d' in a row
    \n+
    652 std::string formatString = "%d";
    \n+
    653 for (int i=1; i<nDofs[elm_type]; i++)
    \n+
    654 formatString += " %d";
    \n+
    655 formatString += "\\n";
    \n+
    656
    \n+
    657 // '10' is the largest number of dofs we may encounter in a .msh file
    \n+
    658 std::vector<int> elementDofs(10);
    \n+
    659
    \n+
    660 readfile(file,nDofs[elm_type], formatString.c_str(),
    \n+
    661 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),
    \n+
    662 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),
    \n+
    663 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),
    \n+
    664 &(elementDofs[9]));
    \n+
    665
    \n+
    666 // correct differences between gmsh and Dune in the local vertex numbering
    \n+
    667 switch (elm_type)
    \n+
    668 {
    \n+
    669 case 3 : // 4-node quadrilateral
    \n+
    670 std::swap(elementDofs[2],elementDofs[3]);
    \n+
    671 break;
    \n+
    672 case 5 : // 8-node hexahedron
    \n+
    673 std::swap(elementDofs[2],elementDofs[3]);
    \n+
    674 std::swap(elementDofs[6],elementDofs[7]);
    \n+
    675 break;
    \n+
    676 case 7 : // 5-node pyramid
    \n+
    677 std::swap(elementDofs[2],elementDofs[3]);
    \n+
    678 break;
    \n+
    679 }
    \n+
    680
    \n+
    681 // renumber corners to account for the explicitly given vertex
    \n+
    682 // numbering in the file
    \n+
    683 std::vector<unsigned int> vertices(nVertices[elm_type]);
    \n+
    684
    \n+
    685 for (int i=0; i<nVertices[elm_type]; i++)
    \n+
    686 vertices[i] = renumber[elementDofs[i]];
    \n+
    687
    \n+
    688 // If it is an element, insert it as such
    \n+
    689 if (elementDim[elm_type] == dim) {
    \n+
    690
    \n+
    691 switch (elm_type)
    \n+
    692 {
    \n+
    693 case 1 : // 2-node line
    \n+
    694 factory.insertElement(Dune::GeometryTypes::line,vertices);
    \n+
    695 break;
    \n+
    696 case 2 : // 3-node triangle
    \n+
    697 factory.insertElement(Dune::GeometryTypes::triangle,vertices);
    \n+
    698 break;
    \n+
    699 case 3 : // 4-node quadrilateral
    \n+
    700 factory.insertElement(Dune::GeometryTypes::quadrilateral,vertices);
    \n+
    701 break;
    \n+
    702 case 4 : // 4-node tetrahedron
    \n+
    703 factory.insertElement(Dune::GeometryTypes::tetrahedron,vertices);
    \n+
    704 break;
    \n+
    705 case 5 : // 8-node hexahedron
    \n+
    706 factory.insertElement(Dune::GeometryTypes::hexahedron,vertices);
    \n+
    707 break;
    \n+
    708 case 6 : // 6-node prism
    \n+
    709 factory.insertElement(Dune::GeometryTypes::prism,vertices);
    \n+
    710 break;
    \n+
    711 case 7 : // 5-node pyramid
    \n+
    712 factory.insertElement(Dune::GeometryTypes::pyramid,vertices);
    \n+
    713 break;
    \n+
    714 case 9 : // 6-node triangle
    \n+
    715 factory.insertElement(Dune::GeometryTypes::triangle,vertices);
    \n+
    716 break;
    \n+
    717 case 11 : // 10-node tetrahedron
    \n+
    718 factory.insertElement(Dune::GeometryTypes::tetrahedron,vertices);
    \n+
    719 break;
    \n+
    720 }
    \n+
    721
    \n+
    722 } else {
    \n+
    723 // it must be a boundary segment then
    \n+\n+
    725
    \n+
    726 switch (elm_type)
    \n+
    727 {
    \n+
    728 case 1 : // 2-node line
    \n+
    729 factory.insertBoundarySegment(vertices);
    \n+
    730 break;
    \n+
    731
    \n+
    732 case 2 : // 3-node triangle
    \n+
    733 factory.insertBoundarySegment(vertices);
    \n+
    734 break;
    \n+
    735
    \n+
    736 case 3 : // 4-node quadrilateral
    \n+
    737 factory.insertBoundarySegment(vertices);
    \n+
    738 break;
    \n+
    739
    \n+
    740 case 15 : // 1-node point
    \n+
    741 factory.insertBoundarySegment(vertices);
    \n+
    742 break;
    \n+
    743
    \n+
    744 case 8 : { // 3-node line
    \n+
    745 std::array<FieldVector<double,dimWorld>, 3> v;
    \n+
    746 for (int i=0; i<dimWorld; i++) {
    \n+
    747 v[0][i] = nodes[elementDofs[0]][i];
    \n+
    748 v[1][i] = nodes[elementDofs[2]][i]; // yes, the renumbering is intended!
    \n+
    749 v[2][i] = nodes[elementDofs[1]][i];
    \n+
    750 }
    \n+
    751 BoundarySegment<dim,dimWorld>* newBoundarySegment
    \n+
    752 = (BoundarySegment<dim,dimWorld>*) new GmshReaderQuadraticBoundarySegment< 2, dimWorld >(v[0], v[1], v[2]);
    \n+
    753 factory.insertBoundarySegment(vertices,
    \n+
    754 std::shared_ptr<BoundarySegment<dim,dimWorld> >(newBoundarySegment));
    \n+
    755 break;
    \n+
    756 }
    \n+
    757 case 9 : { // 6-node triangle
    \n+
    758 boundarysegment_insert(nodes, elementDofs, vertices);
    \n+
    759 break;
    \n+
    760 }
    \n+
    761 default: {
    \n+
    762 DUNE_THROW(Dune::IOError, "GmshReader does not support using element-type " << elm_type << " for boundary segments");
    \n+
    763 break;
    \n+
    764 }
    \n+
    765
    \n+
    766 }
    \n+
    767
    \n+
    768 }
    \n+
    769 }
    \n+
    770
    \n+
    771 // count elements and boundary elements
    \n+
    772 if (elementDim[elm_type] == dim) {
    \n+\n+\n+
    775 } else {
    \n+\n+\n+
    778 }
    \n+
    779
    \n+
    780 }
    \n+
    \n+
    781
    \n+
    782 };
    \n+
    \n+
    783
    \n+
    \n+
    784 namespace Gmsh {
    \n+
    \n+
    790 enum class ReaderOptions
    \n+
    791 {
    \n+
    792 verbose = 1,
    \n+\n+
    794 readElementData = 4,
    \n+\n+
    796 };
    \n+
    \n+
    797
    \n+
    \n+\n+
    800 {
    \n+
    801 return static_cast<ReaderOptions>(
    \n+
    802 static_cast<int>(a) | static_cast<int>(b)
    \n+
    803 );
    \n+
    804 }
    \n+
    \n+
    805
    \n+
    \n+\n+
    808 {
    \n+
    809 return static_cast<int>(a) & static_cast<int>(b);
    \n+
    810 }
    \n+
    \n+
    811
    \n+
    812 } // end namespace Gmsh
    \n+
    \n+
    813
    \n+
    838 template<typename GridType>
    \n+
    \n+\n+
    840 {
    \n+
    842
    \n+
    861 static void doRead(Dune::GridFactory<GridType> &factory,
    \n+
    862 const std::string &fileName,
    \n+
    863 std::vector<int>& boundarySegmentToPhysicalEntity,
    \n+
    864 std::vector<int>& elementToPhysicalEntity,
    \n+
    865 bool verbose, bool insertBoundarySegments)
    \n+
    866 {
    \n+
    867 // register boundary segment to boundary segment factory for possible load balancing
    \n+
    868 // this needs to be done on all cores since the type might not be known otherwise
    \n+
    869 GmshReaderQuadraticBoundarySegment< Grid::dimension, Grid::dimensionworld >::registerFactory();
    \n+
    870
    \n+
    871#ifndef NDEBUG
    \n+
    872 // check that this method is called on all cores
    \n+
    873 factory.comm().barrier();
    \n+
    874#endif
    \n+
    875
    \n+
    876 // create parse object and read grid on process 0
    \n+
    877 if (factory.comm().rank() == 0)
    \n+
    878 {
    \n+
    879 GmshReaderParser<Grid> parser(factory,verbose,insertBoundarySegments);
    \n+
    880 parser.read(fileName);
    \n+
    881
    \n+
    882 boundarySegmentToPhysicalEntity = std::move(parser.boundaryIdMap());
    \n+
    883 elementToPhysicalEntity = std::move(parser.elementIndexMap());
    \n+
    884 }
    \n+
    885 else
    \n+
    886 {
    \n+
    887 boundarySegmentToPhysicalEntity = {};
    \n+
    888 elementToPhysicalEntity = {};
    \n+
    889 }
    \n+
    890 }
    \n+
    891
    \n+
    893
    \n+
    912 template<class T>
    \n+
    913 static T &discarded(T &&value) { return static_cast<T&>(value); }
    \n+
    914
    \n+
    915 struct DataArg {
    \n+
    916 std::vector<int> *data_ = nullptr;
    \n+
    917 DataArg(std::vector<int> &data) : data_(&data) {}
    \n+
    918 DataArg(const decltype(std::ignore)&) {}
    \n+
    919 DataArg() = default;
    \n+
    920 };
    \n+
    921
    \n+
    922 struct DataFlagArg : DataArg {
    \n+
    923 bool flag_ = false;
    \n+
    924 using DataArg::DataArg;
    \n+
    925 DataFlagArg(bool flag) : flag_(flag) {}
    \n+
    926 };
    \n+
    927
    \n+
    928 public:
    \n+
    929 typedef GridType Grid;
    \n+
    930
    \n+
    \n+
    937 static std::unique_ptr<Grid> read (const std::string& fileName, bool verbose = true, bool insertBoundarySegments=true)
    \n+
    938 {
    \n+
    939 // make a grid factory
    \n+\n+
    941
    \n+
    942 read(factory, fileName, verbose, insertBoundarySegments);
    \n+
    943
    \n+
    944 return factory.createGrid();
    \n+
    945 }
    \n+
    \n+
    946
    \n+
    \n+
    966 static std::unique_ptr<Grid> read (const std::string& fileName,
    \n+
    967 std::vector<int>& boundarySegmentToPhysicalEntity,
    \n+
    968 std::vector<int>& elementToPhysicalEntity,
    \n+
    969 bool verbose = true, bool insertBoundarySegments=true)
    \n+
    970 {
    \n+
    971 // make a grid factory
    \n+\n+
    973
    \n+
    974 doRead(
    \n+
    975 factory, fileName, boundarySegmentToPhysicalEntity,
    \n+
    976 elementToPhysicalEntity, verbose, insertBoundarySegments
    \n+
    977 );
    \n+
    978
    \n+
    979 return factory.createGrid();
    \n+
    980 }
    \n+
    \n+
    981
    \n+
    \n+
    983 static void read (Dune::GridFactory<Grid>& factory, const std::string& fileName,
    \n+
    984 bool verbose = true, bool insertBoundarySegments=true)
    \n+
    985 {
    \n+
    986 doRead(
    \n+
    987 factory, fileName, discarded(std::vector<int>{}),
    \n+
    988 discarded(std::vector<int>{}), verbose, insertBoundarySegments
    \n+
    989 );
    \n+
    990 }
    \n+
    \n+
    991
    \n+
    993
    \n+
    \n+
    1016 static void read (Dune::GridFactory<Grid> &factory,
    \n+
    1017 const std::string &fileName,
    \n+
    1018 DataFlagArg boundarySegmentData,
    \n+
    1019 DataArg elementData,
    \n+
    1020 bool verbose=true)
    \n+
    1021 {
    \n+
    1022 doRead(
    \n+
    1023 factory, fileName,
    \n+
    1024 boundarySegmentData.data_
    \n+
    1025 ? *boundarySegmentData.data_ : discarded(std::vector<int>{}),
    \n+
    1026 elementData.data_
    \n+
    1027 ? *elementData.data_ : discarded(std::vector<int>{}),
    \n+
    1028 verbose,
    \n+
    1029 boundarySegmentData.flag_ || boundarySegmentData.data_
    \n+
    1030 );
    \n+
    1031 }
    \n+
    \n+
    1032
    \n+
    \n+
    1053 static void read (Dune::GridFactory<Grid>& factory,
    \n+
    1054 const std::string& fileName,
    \n+
    1055 std::vector<int>& boundarySegmentToPhysicalEntity,
    \n+
    1056 std::vector<int>& elementToPhysicalEntity,
    \n+
    1057 bool verbose, bool insertBoundarySegments)
    \n+
    1058 {
    \n+
    1059 doRead(
    \n+
    1060 factory, fileName, boundarySegmentToPhysicalEntity,
    \n+
    1061 elementToPhysicalEntity, verbose, insertBoundarySegments
    \n+
    1062 );
    \n+
    1063 }
    \n+
    \n+
    1064
    \n+
    1066 //\\{
    \n+
    1067
    \n+\n+
    1069
    \n+
    1070 static constexpr Opts defaultOpts =
    \n+
    1071 Opts::verbose | Opts::insertBoundarySegments | Opts::readElementData | Opts::readBoundaryData;
    \n+
    1072
    \n+
    1074
    \n+
    \n+
    1097 GmshReader(const std::string& fileName,
    \n+\n+
    1099 {
    \n+
    1100 gridFactory_ = std::make_unique<Dune::GridFactory<Grid>>();
    \n+
    1101 readGridFile(fileName, *gridFactory_, options);
    \n+
    1102 }
    \n+
    \n+
    1103
    \n+
    \n+
    1111 GmshReader(const std::string& fileName, GridFactory<Grid>& factory,
    \n+\n+
    1113 {
    \n+
    1114 readGridFile(fileName, factory, options);
    \n+
    1115 }
    \n+
    \n+
    1116
    \n+
    \n+
    1118 const std::vector<int>& elementData () const
    \n+
    1119 {
    \n+
    1120 checkElementData();
    \n+
    1121 return elementIndexToGmshPhysicalEntity_;
    \n+
    1122 }
    \n+
    \n+
    1123
    \n+
    \n+
    1125 const std::vector<int>& boundaryData () const
    \n+
    1126 {
    \n+
    1127 checkBoundaryData();
    \n+
    1128 return boundarySegmentIndexToGmshPhysicalEntity_;
    \n+
    1129 }
    \n+
    \n+
    1130
    \n+
    \n+
    1135 bool hasElementData () const
    \n+
    1136 { return hasElementData_ && !extractedElementData_; }
    \n+
    \n+
    1137
    \n+
    \n+
    1142 bool hasBoundaryData () const
    \n+
    1143 { return hasBoundaryData_ && !extractedBoundaryData_; }
    \n+
    \n+
    1144
    \n+
    \n+
    1146 std::vector<int> extractElementData ()
    \n+
    1147 {
    \n+
    1148 checkElementData();
    \n+
    1149 extractedElementData_ = true;
    \n+
    1150 return std::move(elementIndexToGmshPhysicalEntity_);
    \n+
    1151 }
    \n+
    \n+
    1152
    \n+
    \n+
    1154 std::vector<int> extractBoundaryData ()
    \n+
    1155 {
    \n+
    1156 checkBoundaryData();
    \n+
    1157 extractedBoundaryData_ = true;
    \n+
    1158 return std::move(boundarySegmentIndexToGmshPhysicalEntity_);
    \n+
    1159 }
    \n+
    \n+
    1160
    \n+
    \n+
    1162 std::unique_ptr<Grid> createGrid ()
    \n+
    1163 {
    \n+
    1164 if (!gridFactory_)
    \n+
    1165 DUNE_THROW(Dune::InvalidStateException,
    \n+
    1166 "This GmshReader has been constructed with a Dune::GridFactory. "
    \n+
    1167 << "This grid factory has been filled with all information to create a grid. "
    \n+
    1168 << "Please use this factory to create the grid by calling factory.createGrid(). "
    \n+
    1169 << "Alternatively use the constructor without passing the factory in combination with this member function."
    \n+
    1170 );
    \n+
    1171
    \n+
    1172 return gridFactory_->createGrid();
    \n+
    1173 }
    \n+
    \n+
    1174
    \n+
    1175 //\\}
    \n+
    1176
    \n+
    1177 private:
    \n+
    1178 void checkElementData () const
    \n+
    1179 {
    \n+
    1180 if (!hasElementData_)
    \n+
    1181 DUNE_THROW(Dune::InvalidStateException,
    \n+
    1182 "This GmshReader has been constructed without the option 'readElementData'. "
    \n+
    1183 << "Please enable reading element data by passing the option 'Gmsh::ReaderOpts::readElementData' "
    \n+
    1184 << "to the constructor of this class."
    \n+
    1185 );
    \n+
    1186
    \n+
    1187 if (extractedElementData_)
    \n+
    1188 DUNE_THROW(Dune::InvalidStateException,
    \n+
    1189 "The element data has already been extracted from this GmshReader "
    \n+
    1190 << "via a function call to reader.extractElementData(). Use the extracted data or "
    \n+
    1191 << "read the grid data from file again by constructing a new reader."
    \n+
    1192 );
    \n+
    1193 }
    \n+
    1194
    \n+
    1195 void checkBoundaryData () const
    \n+
    1196 {
    \n+
    1197 if (!hasBoundaryData_)
    \n+
    1198 DUNE_THROW(Dune::InvalidStateException,
    \n+
    1199 "This GmshReader has been constructed without the option 'readBoundaryData'. "
    \n+
    1200 << "Please enable reading boundary data by passing the option 'Gmsh::ReaderOpts::readBoundaryData' "
    \n+
    1201 << "to the constructor of this class."
    \n+
    1202 );
    \n+
    1203
    \n+
    1204 if (extractedBoundaryData_)
    \n+
    1205 DUNE_THROW(Dune::InvalidStateException,
    \n+
    1206 "The boundary data has already been extracted from this GmshReader "
    \n+
    1207 << "via a function call to reader.extractBoundaryData(). Use the extracted data or "
    \n+
    1208 << "read the grid data from file again by constructing a new reader."
    \n+
    1209 );
    \n+
    1210 }
    \n+
    1211
    \n+
    1212 void readGridFile (const std::string& fileName, GridFactory<Grid>& factory, Gmsh::ReaderOptions options)
    \n+
    1213 {
    \n+
    1214 const bool verbose = options & Opts::verbose;
    \n+
    1215 const bool insertBoundarySegments = options & Opts::insertBoundarySegments;
    \n+
    1216 const bool readBoundaryData = options & Opts::readBoundaryData;
    \n+
    1217 const bool readElementData = options & Opts::readElementData;
    \n+
    1218
    \n+
    1219 doRead(
    \n+
    1220 factory, fileName, boundarySegmentIndexToGmshPhysicalEntity_,
    \n+
    1221 elementIndexToGmshPhysicalEntity_, verbose,
    \n+
    1222 readBoundaryData || insertBoundarySegments
    \n+
    1223 );
    \n+
    1224
    \n+
    1225 // clear unwanted data
    \n+
    1226 if (!readBoundaryData)
    \n+
    1227 boundarySegmentIndexToGmshPhysicalEntity_ = std::vector<int>{};
    \n+
    1228 if (!readElementData)
    \n+
    1229 elementIndexToGmshPhysicalEntity_ = std::vector<int>{};
    \n+
    1230
    \n+
    1231 hasElementData_ = readElementData;
    \n+
    1232 hasBoundaryData_ = readBoundaryData;
    \n+
    1233 }
    \n+
    1234
    \n+
    1235 std::unique_ptr<Dune::GridFactory<Grid>> gridFactory_;
    \n+
    1236
    \n+
    1237 std::vector<int> elementIndexToGmshPhysicalEntity_;
    \n+
    1238 std::vector<int> boundarySegmentIndexToGmshPhysicalEntity_;
    \n+
    1239
    \n+
    1240 bool hasElementData_;
    \n+
    1241 bool hasBoundaryData_;
    \n+
    1242
    \n+
    1243 // for better error messages, we keep track of these separately
    \n+
    1244 bool extractedElementData_ = false;
    \n+
    1245 bool extractedBoundaryData_ = false;
    \n+
    1246 };
    \n+
    \n+
    1247
    \n+
    1250} // namespace Dune
    \n+
    1251
    \n+
    1252#endif
    \n+
    Base class for grid boundary segments of arbitrary geometry.
    \n+
    ReaderOptions
    Option for the Gmsh mesh file reader.
    Definition gmshreader.hh:791
    \n+\n+\n+\n+\n+
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    void printGrid(const GridType &grid, const Dune::MPIHelper &helper, std::string output_file="printgrid", int size=2000, bool execute_plot=true, bool png=true, bool local_corner_indices=true, bool local_intersection_indices=true, bool outer_normals=true)
    Print a grid as a gnuplot for testing and development.
    Definition printgrid.hh:73
    \n-
    Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
    Definition common/intersectioniterator.hh:83
    \n-
    Mapper interface.
    Definition mapper.hh:110
    \n-
    Index index(const EntityType &e) const
    Map entity to array index.
    Definition mapper.hh:122
    \n-
    Index subIndex(const typename G::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity i of codim cc of a codim 0 entity to array index.
    Definition mapper.hh:136
    \n-
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n+
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n+
    constexpr bool operator&(ReaderOptions a, ReaderOptions b)
    query operator for reader options (is b set in a)
    Definition gmshreader.hh:807
    \n+
    constexpr ReaderOptions operator|(ReaderOptions a, ReaderOptions b)
    composition operator for reader options
    Definition gmshreader.hh:799
    \n+
    Base class for classes implementing geometries of boundary segments.
    Definition boundarysegment.hh:94
    \n+
    Communication comm() const
    Return the Communication used by the grid factory.
    Definition common/gridfactory.hh:258
    \n+
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n+
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n+
    Options for read operation.
    Definition gmshreader.hh:39
    \n+
    GeometryOrder
    Definition gmshreader.hh:40
    \n+
    @ firstOrder
    edges are straight lines.
    Definition gmshreader.hh:42
    \n+
    @ secondOrder
    quadratic boundary approximation.
    Definition gmshreader.hh:44
    \n+
    dimension independent parts for GmshReaderParser
    Definition gmshreader.hh:302
    \n+
    std::vector< std::string > & physicalEntityNames()
    Returns the names of the gmsh physical entities (0-based index)
    Definition gmshreader.hh:373
    \n+
    void pass1HandleElement(FILE *file, const int elm_type, std::map< int, unsigned int > &renumber, const std::vector< GlobalVector > &nodes)
    Process one element during the first pass through the list of all elements.
    Definition gmshreader.hh:545
    \n+
    static const int dimWorld
    Definition gmshreader.hh:321
    \n+
    Dune::GridFactory< GridType > & factory
    Definition gmshreader.hh:305
    \n+
    std::vector< int > & boundaryIdMap()
    Definition gmshreader.hh:361
    \n+
    void readfile(FILE *file, int cnt, const char *format,...)
    Definition gmshreader.hh:331
    \n+
    std::vector< int > & elementIndexMap()
    Returns a map for the gmsh physical entity id (1-based index) for each entity of codim 0.
    Definition gmshreader.hh:367
    \n+
    unsigned int number_of_real_vertices
    Definition gmshreader.hh:308
    \n+
    void boundarysegment_insert(const std::vector< FieldVector< double, 3 > > &nodes, const E &elementDofs, const V &vertices)
    Definition gmshreader.hh:608
    \n+
    GmshReaderParser(Dune::GridFactory< GridType > &_factory, bool v, bool i)
    Definition gmshreader.hh:358
    \n+
    int element_count
    Definition gmshreader.hh:310
    \n+
    void read(const std::string &f)
    Definition gmshreader.hh:378
    \n+
    void skipline(FILE *file)
    Definition gmshreader.hh:348
    \n+
    std::vector< int > element_index_to_physical_entity
    Definition gmshreader.hh:316
    \n+
    virtual void pass2HandleElement(FILE *file, const int elm_type, std::map< int, unsigned int > &renumber, const std::vector< GlobalVector > &nodes, const int physical_entity)
    Process one element during the second pass through the list of all elements.
    Definition gmshreader.hh:633
    \n+
    static const int dim
    Definition gmshreader.hh:320
    \n+
    FieldVector< double, dimWorld > GlobalVector
    Definition gmshreader.hh:325
    \n+
    std::string fileName
    Definition gmshreader.hh:313
    \n+
    std::vector< std::string > physical_entity_names
    Definition gmshreader.hh:317
    \n+
    int boundary_element_count
    Definition gmshreader.hh:309
    \n+
    void boundarysegment_insert(const V &, const E &, const V2 &)
    Definition gmshreader.hh:597
    \n+
    bool verbose
    Definition gmshreader.hh:306
    \n+
    std::vector< int > boundary_id_to_physical_entity
    Definition gmshreader.hh:315
    \n+
    char buf[512]
    Definition gmshreader.hh:312
    \n+
    bool insert_boundary_segments
    Definition gmshreader.hh:307
    \n+
    Read Gmsh mesh file.
    Definition gmshreader.hh:840
    \n+
    static std::unique_ptr< Grid > read(const std::string &fileName, std::vector< int > &boundarySegmentToPhysicalEntity, std::vector< int > &elementToPhysicalEntity, bool verbose=true, bool insertBoundarySegments=true)
    Read Gmsh file, possibly with data.
    Definition gmshreader.hh:966
    \n+
    const std::vector< int > & elementData() const
    Access element data (maps element index to Gmsh physical entity)
    Definition gmshreader.hh:1118
    \n+
    static void read(Dune::GridFactory< Grid > &factory, const std::string &fileName, DataFlagArg boundarySegmentData, DataArg elementData, bool verbose=true)
    read Gmsh file, possibly with data
    Definition gmshreader.hh:1016
    \n+
    static std::unique_ptr< Grid > read(const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
    Definition gmshreader.hh:937
    \n+
    static void read(Dune::GridFactory< Grid > &factory, const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
    Definition gmshreader.hh:983
    \n+
    GridType Grid
    Definition gmshreader.hh:929
    \n+
    std::unique_ptr< Grid > createGrid()
    Create the grid.
    Definition gmshreader.hh:1162
    \n+
    std::vector< int > extractBoundaryData()
    Erase boundary data from reader and return the data.
    Definition gmshreader.hh:1154
    \n+
    static void read(Dune::GridFactory< Grid > &factory, const std::string &fileName, std::vector< int > &boundarySegmentToPhysicalEntity, std::vector< int > &elementToPhysicalEntity, bool verbose, bool insertBoundarySegments)
    Read Gmsh file, possibly with data.
    Definition gmshreader.hh:1053
    \n+
    bool hasElementData() const
    If element data is available.
    Definition gmshreader.hh:1135
    \n+
    bool hasBoundaryData() const
    If boundary data is available.
    Definition gmshreader.hh:1142
    \n+
    static constexpr Opts defaultOpts
    Definition gmshreader.hh:1070
    \n+
    GmshReader(const std::string &fileName, GridFactory< Grid > &factory, Gmsh::ReaderOptions options=defaultOpts)
    Construct a Gmsh reader object from a file name and a grid factory.
    Definition gmshreader.hh:1111
    \n+
    GmshReader(const std::string &fileName, Gmsh::ReaderOptions options=defaultOpts)
    Construct a Gmsh reader object (alternatively use one of the static member functions)
    Definition gmshreader.hh:1097
    \n+
    std::vector< int > extractElementData()
    Erase element data from reader and return the data.
    Definition gmshreader.hh:1146
    \n+
    const std::vector< int > & boundaryData() const
    Access boundary data (maps boundary segment index to Gmsh physical entity)
    Definition gmshreader.hh:1125
    \n+
    Provide a generic factory class for unstructured grids.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,259 +2,1334 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-printgrid.hh\n+gmshreader.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_PRINTGRID_HH\n-6#define DUNE_PRINTGRID_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13#include \n-14\n-15namespace Dune {\n-16\n-17 namespace {\n-18\n-19 template\n-20 struct ElementDataLayout\n-21 {\n-22 bool contains (Dune::GeometryType gt)\n-23 {\n-24 return gt.dim()==dim;\n-25 }\n-26 };\n-27\n-28 template\n-29 struct NodeDataLayout\n-30 {\n-31 bool contains (Dune::GeometryType gt)\n-32 {\n-33 return gt.dim()==0;\n-34 }\n-35 };\n-36\n-37 // Move a point closer to basegeo's center by factor scale (used for drawing\n-relative to the element)\n-38 template \n-39 C centrify (const B& basegeo, const C& coords, const double scale) {\n-40 C ret = coords;\n-41 ret -= basegeo.center();\n-42 ret *= scale;\n-43 ret += basegeo.center();\n-44 return ret;\n-45 }\n-46\n-47 // Add a line to the plotfile from p1 to p2\n-48 template \n-49 void draw_line (std::ofstream &plotfile, const Coord &p1, const Coord &p2,\n-std::string options) {\n-50 plotfile << \"set object poly from \";\n-51 plotfile << p1[0] << \",\" << p1[1] << \" to \";\n-52 plotfile << p2[0] << \",\" << p2[1] << \" to \";\n-53 plotfile << p1[0] << \",\" << p1[1];\n-54 plotfile << \" \" << options << std::endl;\n-55 }\n-56\n-57 }\n+5\n+6#ifndef DUNE_GMSHREADER_HH\n+7#define DUNE_GMSHREADER_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15#include \n+16#include \n+17#include \n+18#include \n+19#include \n+20\n+21#include \n+22#include \n+23\n+24#include \n+25\n+26#include \n+27#include \n+28\n+29namespace Dune\n+30{\n+31\n+38 struct GmshReaderOptions\n+39 {\n+40 enum GeometryOrder {\n+42 firstOrder,\n+44 secondOrder\n+45 };\n+46 };\n+47\n+48 namespace {\n+49\n+50 // arbitrary dimension, implementation is in specialization\n+51 template< int dimension, int dimWorld = dimension >\n+52 class GmshReaderQuadraticBoundarySegment\n+53 {\n+54 public:\n+55 // empty function since this class does not implement anything\n+56 static void registerFactory() {}\n+57 };\n 58\n-72 template \n-73 void printGrid (const GridType& grid, const Dune::MPIHelper& helper, std::\n-string output_file = \"printgrid\",\n-74 int size = 2000, bool execute_plot = true, bool png = true, bool local_\n-corner_indices = true,\n-75 bool local_intersection_indices = true, bool outer_normals = true)\n-76 {\n-77\n-78 // Create output file\n-79 output_file = output_file + \"_\" + std::to_string(helper.rank());\n-80 std::string plot_file_name = output_file + \".gnuplot\";\n-81 std::ofstream plotfile (plot_file_name, std::ios::out | std::ios::trunc);\n-82 if (!plotfile.is_open()) {\n-83 DUNE_THROW(Dune::IOError, \"Could not create plot file \" << output_file <<\n-\"!\");\n-84 return;\n-85 }\n-86\n-87 // Basic plot settings\n-88 plotfile << \"set size ratio -1\" << std::endl;\n-89 if (png) {\n-90 plotfile << \"set terminal png size \" << size << \",\" << size << std::endl;\n-91 plotfile << \"set output '\" << output_file << \".png'\" << std::endl;\n-92 } else {\n-93 plotfile << \"set terminal svg size \" << size << \",\" << size << \" enhanced\n-background rgb 'white'\" << std::endl;\n-94 plotfile << \"set output '\" << output_file << \".svg'\" << std::endl;\n-95 }\n-96\n-97 // Get GridView\n-98 typedef typename GridType::LeafGridView GV;\n-99 const GV gv = grid.leafGridView();\n-100\n-101 // Create mappers used to retrieve indices\n-102 typedef typename Dune::MultipleCodimMultipleGeomTypeMapper Mapper;\n-103 const Mapper elementmapper(gv, mcmgElementLayout());\n-104 const Mapper nodemapper(gv, mcmgVertexLayout());\n-105\n-106 // Create iterators\n-107 typedef typename GV::template Codim<0 >::Iterator LeafIterator;\n-108 typedef typename GV::IntersectionIterator IntersectionIterator;\n-109\n-110 LeafIterator it = gv.template begin<0>();\n-111\n-112 // Will contain min/max coordinates. Needed for scaling of the plot\n-113 Dune::FieldVector max_coord (it->geometry\n-().center()), min_coord (max_coord);\n-114\n-115 // Iterate over elements\n-116 for (; it != gv.template end<0>(); ++it) {\n-117\n-118 const auto& entity = *it;\n-119 auto geo = entity.geometry();\n-120\n-121 // Plot element index\n-122 int element_id = elementmapper.index(entity);\n-123 plotfile << \"set label at \" << geo.center()[0] << \",\" << geo.center()[1] <<\n-\" '\"\n-124 << element_id << \"' center\" << std::endl;\n-125\n-126 for (int i = 0; i < geo.corners(); ++i) {\n-127 // Plot corner indices\n-128 const int globalNodeNumber1 = nodemapper.subIndex(entity, i, 2);\n-129 auto labelpos = centrify (geo, geo.corner(i), 0.7);\n-130 plotfile << \"set label at \" << labelpos[0] << \",\" << labelpos[1] << \" '\" <<\n-globalNodeNumber1;\n-131 if (local_corner_indices)\n-132 plotfile << \"(\" << i << \")\";\n-133 plotfile << \"' center\" << std::endl;\n-134\n-135 // Adapt min / max coordinates\n-136 for (int dim = 0; dim < 2; ++dim) {\n-137 if (geo.corner(i)[dim] < min_coord[dim])\n-138 min_coord[dim] = geo.corner(i)[dim];\n-139 else if (geo.corner(i)[dim] > max_coord[dim])\n-140 max_coord[dim] = geo.corner(i)[dim];\n-141 }\n-142 }\n-143\n-144 // Iterate over intersections\n-145 for (IntersectionIterator is = gv.ibegin(entity); is != gv.iend(entity);\n-++is) {\n+59 // quadratic boundary segments in 1d\n+60 /*\n+61 Note the points\n+62\n+63 (0) (alpha) (1)\n+64\n+65 are mapped to the points in global coordinates\n+66\n+67 p0 p2 p1\n+68\n+69 alpha is determined automatically from the given points.\n+70 */\n+71 template< int dimWorld >\n+72 struct GmshReaderQuadraticBoundarySegment< 2, dimWorld >\n+73 : public Dune::BoundarySegment< 2, dimWorld >\n+74 {\n+75 typedef GmshReaderQuadraticBoundarySegment< 2, dimWorld > ThisType;\n+76 typedef typename Dune::BoundarySegment<_2,_dimWorld_> :: ObjectStreamType\n+ObjectStreamType;\n+77 typedef Dune::FieldVector< double, dimWorld > GlobalVector;\n+78\n+79 GmshReaderQuadraticBoundarySegment ( const GlobalVector &p0_, const\n+GlobalVector &p1_, const GlobalVector &p2_)\n+80 : p0(p0_), p1(p1_), p2(p2_)\n+81 {\n+82 init();\n+83 }\n+84\n+85 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )\n+86 {\n+87 // key is read before by the factory\n+88 const int bytes = sizeof(double)*dimWorld;\n+89 in.read( (char *) &p0[ 0 ], bytes );\n+90 in.read( (char *) &p1[ 0 ], bytes );\n+91 in.read( (char *) &p2[ 0 ], bytes );\n+92 init();\n+93 }\n+94\n+95 static void registerFactory()\n+96 {\n+97 if( key() < 0 )\n+98 {\n+99 key() = Dune::BoundarySegment<_2,_dimWorld_>::template registerFactory<\n+ThisType >();\n+100 }\n+101 }\n+102\n+103 virtual GlobalVector operator() ( const Dune::FieldVector &local\n+) const\n+104 {\n+105 GlobalVector y;\n+106 y = 0.0;\n+107 y.axpy((local[0]-alpha)*(local[0]-1.0)/alpha,p0);\n+108 y.axpy(local[0]*(local[0]-1.0)/(alpha*(alpha-1.0)),p1);\n+109 y.axpy(local[0]*(local[0]-alpha)/(1.0-alpha),p2);\n+110 return y;\n+111 }\n+112\n+113 void backup( ObjectStreamType& out ) const\n+114 {\n+115 // backup key to identify object\n+116 out.write( (const char *) &key(), sizeof( int ) );\n+117 // backup data\n+118 const int bytes = sizeof(double)*dimWorld;\n+119 out.write( (const char*) &p0[ 0 ], bytes );\n+120 out.write( (const char*) &p1[ 0 ], bytes );\n+121 out.write( (const char*) &p2[ 0 ], bytes );\n+122 }\n+123\n+124 protected:\n+125 void init()\n+126 {\n+127 GlobalVector d1 = p1;\n+128 d1 -= p0;\n+129 GlobalVector d2 = p2;\n+130 d2 -= p1;\n+131\n+132 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());\n+133 if (alpha<1E-6 || alpha>1-1E-6)\n+134 DUNE_THROW(Dune::IOError, \"ration in quadratic boundary segment bad\");\n+135 }\n+136\n+137 static int& key() {\n+138 static int k = -1;\n+139 return k;\n+140 }\n+141\n+142 private:\n+143 GlobalVector p0,p1,p2;\n+144 double alpha;\n+145 };\n 146\n-147 const auto& intersection = *is;\n-148 auto igeo = intersection.geometry();\n-149\n-150 // Draw intersection line\n-151 draw_line (plotfile, igeo.corner(0), igeo.corner(1), \"fs empty border 1\");\n+147\n+148 // quadratic boundary segments in 2d\n+149 /* numbering of points corresponding to gmsh:\n+150\n+151 2\n 152\n-153 // Plot local intersection index\n-154 if (local_intersection_indices) {\n-155 auto label_pos = centrify (geo, igeo.center(), 0.8);\n-156 plotfile << \"set label at \" << label_pos[0] << \",\" << label_pos[1]\n-157 << \" '\" << intersection.indexInInside() << \"' center\" << std::endl;\n-158 }\n-159\n-160 // Plot outer normal\n-161 if (outer_normals) {\n-162 auto intersection_pos = igeo.center();\n-163 auto normal = intersection.centerUnitOuterNormal();\n-164 normal *= 0.15 * igeo.volume();\n-165 auto normal_end = intersection_pos + normal;\n-166 plotfile << \"set arrow from \" << intersection_pos[0] << \",\" <<\n-intersection_pos[1]\n-167 << \" to \" << normal_end[0] << \",\" << normal_end[1] << \" lt rgb \\\"gray\\\"\" <<\n-std::endl;\n-168 }\n-169\n-170 // Get corners for inner intersection representation\n-171 auto inner_corner1 = centrify (geo, igeo.corner(0), 0.5);\n-172 auto inner_corner2 = centrify (geo, igeo.corner(1), 0.5);\n-173\n-174 // Thick line in case of boundary()\n-175 if (intersection.boundary())\n-176 draw_line (plotfile, inner_corner1, inner_corner2, \"fs empty border 3 lw\n-4\");\n-177\n-178 // Thin line with color according to neighbor()\n-179 if (intersection.neighbor())\n-180 draw_line (plotfile, inner_corner1, inner_corner2, \"fs empty border 2\");\n-181 else\n-182 draw_line (plotfile, inner_corner1, inner_corner2, \"fs empty border 1\");\n-183 }\n-184\n-185 }\n-186\n-187 // Finish plot, pass extend of the grid\n-188 Dune::FieldVector extend (max_coord - min_\n-coord);\n-189\n-190 extend *= 0.2;\n-191 min_coord -= extend;\n-192 max_coord += extend;\n-193 plotfile << \"plot [\" << min_coord[0] << \":\" << max_coord[0] << \"] [\" <<\n-min_coord[1]\n-194 << \":\" << max_coord[1] << \"] NaN notitle\" << std::endl;\n-195 plotfile.close();\n-196\n-197 if (execute_plot) {\n-198 std::string cmd = \"gnuplot -p '\" + plot_file_name + \"'\";\n-199 if (std::system (cmd.c_str()) != 0)\n-200 DUNE_THROW(Dune::Exception,\"Error running GNUPlot: \" << cmd);\n-201 }\n-202 }\n-203\n-204}\n+153 5 4\n+154\n+155 0 3 1\n+156\n+157 Note: The vertices 3, 4, 5 are not necessarily at the edge midpoints but\n+can\n+158 be placed with parameters alpha, beta , gamma at the following positions\n+159 in local coordinates:\n+160\n+161\n+162 2 = (0,1)\n+163\n+164 5 = (0,beta) 4 = (1-gamma/sqrt(2),gamma/sqrt(2))\n+165\n+166 0 = (0,0) 3 = (alpha,0) 1 = (1,0)\n+167\n+168 The parameters alpha, beta, gamma are determined from the given vertices in\n+169 global coordinates.\n+170 */\n+171 template<>\n+172 class GmshReaderQuadraticBoundarySegment< 3, 3 >\n+173 : public Dune::BoundarySegment< 3 >\n+174 {\n+175 typedef GmshReaderQuadraticBoundarySegment< 3, 3 > ThisType;\n+176 typedef typename Dune::BoundarySegment<_3_> :: ObjectStreamType\n+ObjectStreamType;\n+177 public:\n+178 GmshReaderQuadraticBoundarySegment (Dune::FieldVector p0_, Dune::\n+FieldVector p1_,\n+179 Dune::FieldVector p2_, Dune::FieldVector p3_,\n+180 Dune::FieldVector p4_, Dune::FieldVector p5_)\n+181 : p0(p0_), p1(p1_), p2(p2_), p3(p3_), p4(p4_), p5(p5_)\n+182 {\n+183 init();\n+184 }\n+185\n+186 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )\n+187 {\n+188 const int bytes = sizeof(double)*3;\n+189 in.read( (char *) &p0[ 0 ], bytes );\n+190 in.read( (char *) &p1[ 0 ], bytes );\n+191 in.read( (char *) &p2[ 0 ], bytes );\n+192 in.read( (char *) &p3[ 0 ], bytes );\n+193 in.read( (char *) &p4[ 0 ], bytes );\n+194 in.read( (char *) &p5[ 0 ], bytes );\n+195 init();\n+196 }\n+197\n+198 static void registerFactory()\n+199 {\n+200 if( key() < 0 )\n+201 {\n+202 key() = Dune::BoundarySegment<_3_>::template registerFactory< ThisType >();\n+203 }\n+204 }\n 205\n-206#endif // #ifndef DUNE_PRINTGRID_HH\n-mcmgmapper.hh\n-Mapper for multiple codim and multiple geometry types.\n-Dune::mcmgElementLayout\n-MCMGLayout mcmgElementLayout()\n-layout for elements (codim-0 entities)\n-Definition mcmgmapper.hh:97\n-Dune::mcmgVertexLayout\n-MCMGLayout mcmgVertexLayout()\n-layout for vertices (dim-0 entities)\n-Definition mcmgmapper.hh:107\n+206 virtual Dune::FieldVector operator() (const Dune::\n+FieldVector& local) const\n+207 {\n+208 Dune::FieldVector y;\n+209 y = 0.0;\n+210 y.axpy(phi0(local),p0);\n+211 y.axpy(phi1(local),p1);\n+212 y.axpy(phi2(local),p2);\n+213 y.axpy(phi3(local),p3);\n+214 y.axpy(phi4(local),p4);\n+215 y.axpy(phi5(local),p5);\n+216 return y;\n+217 }\n+218\n+219 void backup( ObjectStreamType& out ) const\n+220 {\n+221 // backup key to identify object in factory\n+222 out.write( (const char*) &key(), sizeof( int ) );\n+223 // backup data\n+224 const int bytes = sizeof(double)*3;\n+225 out.write( (const char*) &p0[ 0 ], bytes );\n+226 out.write( (const char*) &p1[ 0 ], bytes );\n+227 out.write( (const char*) &p2[ 0 ], bytes );\n+228 out.write( (const char*) &p3[ 0 ], bytes );\n+229 out.write( (const char*) &p4[ 0 ], bytes );\n+230 out.write( (const char*) &p5[ 0 ], bytes );\n+231 }\n+232\n+233 protected:\n+234 void init()\n+235 {\n+236 using std::sqrt;\n+237 sqrt2 = sqrt(2.0);\n+238 Dune::FieldVector d1,d2;\n+239\n+240 d1 = p3; d1 -= p0;\n+241 d2 = p1; d2 -= p3;\n+242 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());\n+243 if (alpha<1E-6 || alpha>1-1E-6)\n+244 DUNE_THROW(Dune::IOError, \"alpha in quadratic boundary segment bad\");\n+245\n+246 d1 = p5; d1 -= p0;\n+247 d2 = p2; d2 -= p5;\n+248 beta=d1.two_norm()/(d1.two_norm()+d2.two_norm());\n+249 if (beta<1E-6 || beta>1-1E-6)\n+250 DUNE_THROW(Dune::IOError, \"beta in quadratic boundary segment bad\");\n+251\n+252 d1 = p4; d1 -= p1;\n+253 d2 = p2; d2 -= p4;\n+254 gamma=sqrt2*(d1.two_norm()/(d1.two_norm()+d2.two_norm()));\n+255 if (gamma<1E-6 || gamma>1-1E-6)\n+256 DUNE_THROW(Dune::IOError, \"gamma in quadratic boundary segment bad\");\n+257 }\n+258\n+259 static int& key() {\n+260 static int k = -1;\n+261 return k;\n+262 }\n+263\n+264 private:\n+265 // The six Lagrange basis function on the reference element\n+266 // for the points given above\n+267\n+268 double phi0 (const Dune::FieldVector& local) const\n+269 {\n+270 return (alpha*beta-beta*local[0]-alpha*local[1])*(1-local[0]-local[1])/\n+(alpha*beta);\n+271 }\n+272 double phi3 (const Dune::FieldVector& local) const\n+273 {\n+274 return local[0]*(1-local[0]-local[1])/(alpha*(1-alpha));\n+275 }\n+276 double phi1 (const Dune::FieldVector& local) const\n+277 {\n+278 return local[0]*(gamma*local[0]-(sqrt2-gamma-sqrt2*alpha)*local[1]-\n+alpha*gamma)/(gamma*(1-alpha));\n+279 }\n+280 double phi5 (const Dune::FieldVector& local) const\n+281 {\n+282 return local[1]*(1-local[0]-local[1])/(beta*(1-beta));\n+283 }\n+284 double phi4 (const Dune::FieldVector& local) const\n+285 {\n+286 return local[0]*local[1]/((1-gamma/sqrt2)*gamma/sqrt2);\n+287 }\n+288 double phi2 (const Dune::FieldVector& local) const\n+289 {\n+290 return local[1]*(beta*(1-gamma/sqrt2)-local[0]*(beta-gamma/sqrt2)-local[1]*\n+(1-gamma/sqrt2))/((1-gamma/sqrt2)*(beta-1));\n+291 }\n+292\n+293 Dune::FieldVector p0,p1,p2,p3,p4,p5;\n+294 double alpha,beta,gamma,sqrt2;\n+295 };\n+296\n+297 } // end empty namespace\n+298\n+300 template\n+301 class GmshReaderParser\n+302 {\n+303 protected:\n+304 // private data\n+305 Dune::GridFactory& factory;\n+306 bool verbose;\n+307 bool insert_boundary_segments;\n+308 unsigned int number_of_real_vertices;\n+309 int boundary_element_count;\n+310 int element_count;\n+311 // read buffer\n+312 char buf[512];\n+313 std::string fileName;\n+314 // exported data\n+315 std::vector boundary_id_to_physical_entity;\n+316 std::vector element_index_to_physical_entity;\n+317 std::vector physical_entity_names;\n+318\n+319 // static data\n+320 static const int dim = GridType::dimension;\n+321 static const int dimWorld = GridType::dimensionworld;\n+322 static_assert( (dimWorld <= 3), \"GmshReader requires dimWorld <= 3.\" );\n+323\n+324 // typedefs\n+325 typedef FieldVector< double, dimWorld > GlobalVector;\n+326\n+327 // don't use something like\n+328 // readfile(file, 1, \"%s\\n\", buf);\n+329 // to skip the rest of of the line -- that will only skip the next\n+330 // whitespace-separated word! Use skipline() instead.\n+331 void readfile(FILE * file, int cnt, const char * format, ...)\n+332#ifdef __GNUC__\n+333 __attribute__((format(scanf, 4, 5)))\n+334#endif\n+335 {\n+336 std::va_list ap;\n+337 va_start(ap, format);\n+338 off_t pos = ftello(file);\n+339 int c = std::vfscanf(file, format, ap);\n+340 va_end(ap);\n+341 if (c != cnt)\n+342 DUNE_THROW(Dune::IOError, \"Error parsing \" << fileName << \" \"\n+343 \"file pos \" << pos\n+344 << \": Expected '\" << format << \"', only read \" << c << \" entries instead of\n+\" << cnt << \".\");\n+345 }\n+346\n+347 // skip over the rest of the line, including the terminating newline\n+348 void skipline(FILE * file)\n+349 {\n+350 int c;\n+351 do {\n+352 c = std::fgetc(file);\n+353 } while(c != '\\n' && c != EOF);\n+354 }\n+355\n+356 public:\n+357\n+358 GmshReaderParser(Dune::GridFactory& _factory, bool v, bool i) :\n+359 factory(_factory), verbose(v), insert_boundary_segments(i) {}\n+360\n+361 std::vector & boundaryIdMap()\n+362 {\n+363 return boundary_id_to_physical_entity;\n+364 }\n+365\n+367 std::vector & elementIndexMap()\n+368 {\n+369 return element_index_to_physical_entity;\n+370 }\n+371\n+373 std::vector & physicalEntityNames()\n+374 {\n+375 return physical_entity_names;\n+376 }\n+377\n+378 void read (const std::string& f)\n+379 {\n+380 if (verbose) std::cout << \"Reading \" << dim << \"d Gmsh grid...\" << std::\n+endl;\n+381\n+382 // open file name, we use C I/O\n+383 fileName = f;\n+384 FILE* file = fopen(fileName.c_str(),\"rb\");\n+385 if (file==0)\n+386 DUNE_THROW(Dune::IOError, \"Could not open \" << fileName);\n+387\n+388 //=========================================\n+389 // Header: Read vertices into vector\n+390 // Check vertices that are needed\n+391 //=========================================\n+392\n+393 number_of_real_vertices = 0;\n+394 boundary_element_count = 0;\n+395 element_count = 0;\n+396\n+397 // process header\n+398 double version_number;\n+399 int file_type, data_size;\n+400\n+401 readfile(file,1,\"%s\\n\",buf);\n+402 if (strcmp(buf,\"$MeshFormat\")!=0)\n+403 DUNE_THROW(Dune::IOError, \"expected $MeshFormat in first line\");\n+404 readfile(file,3,\"%lg %d %d\\n\",&version_number,&file_type,&data_size);\n+405 // 2.2 is not representable as float and leads to problems on i386\n+406 // Hence we use >= 2.00001.\n+407 if( (version_number < 2.0) || (version_number >= 2.20001) ) // 2.2 is not\n+representable as float and leads to problems on i386\n+408 DUNE_THROW(Dune::IOError, \"can only read Gmsh version 2 files\");\n+409 if (verbose) std::cout << \"version \" << version_number << \" Gmsh file\n+detected\" << std::endl;\n+410 readfile(file,1,\"%s\\n\",buf);\n+411 if (strcmp(buf,\"$EndMeshFormat\")!=0)\n+412 DUNE_THROW(Dune::IOError, \"expected $EndMeshFormat\");\n+413\n+414 // physical name section\n+415 physical_entity_names.clear();\n+416 readfile(file,1,\"%s\\n\",buf);\n+417 if (strcmp(buf,\"$PhysicalNames\")==0) {\n+418 int number_of_names;\n+419 readfile(file,1,\"%d\\n\",&number_of_names);\n+420 if (verbose) std::cout << \"file contains \" << number_of_names << \" physical\n+entities\" << std::endl;\n+421 physical_entity_names.resize(number_of_names);\n+422 std::string buf_name;\n+423 for( int i = 0; i < number_of_names; ++i ) {\n+424 int dim, id;\n+425 readfile(file,3, \"%d %d %s\\n\", &dim, &id, buf);\n+426 buf_name.assign(buf);\n+427 auto begin = buf_name.find_first_of('\\\"') + 1;\n+428 auto end = buf_name.find_last_of('\\\"') - begin;\n+429 physical_entity_names[id-1].assign(buf_name.substr(begin, end));\n+430 }\n+431 readfile(file,1,\"%s\\n\",buf);\n+432 if (strcmp(buf,\"$EndPhysicalNames\")!=0)\n+433 DUNE_THROW(Dune::IOError, \"expected $EndPhysicalNames\");\n+434 readfile(file,1,\"%s\\n\",buf);\n+435 }\n+436\n+437 // node section\n+438 int number_of_nodes;\n+439\n+440 if (strcmp(buf,\"$Nodes\")!=0)\n+441 DUNE_THROW(Dune::IOError, \"expected $Nodes\");\n+442 readfile(file,1,\"%d\\n\",&number_of_nodes);\n+443 if (verbose) std::cout << \"file contains \" << number_of_nodes << \" nodes\"\n+<< std::endl;\n+444\n+445 // read nodes\n+446 // The '+1' is due to the fact that gmsh numbers node starting from 1\n+rather than from 0\n+447 std::vector< GlobalVector > nodes( number_of_nodes+1 );\n+448 {\n+449 int id;\n+450 double x[ 3 ];\n+451 for( int i = 1; i <= number_of_nodes; ++i )\n+452 {\n+453 readfile(file,4, \"%d %lg %lg %lg\\n\", &id, &x[ 0 ], &x[ 1 ], &x[ 2 ] );\n+454\n+455 if (id > number_of_nodes) {\n+456 DUNE_THROW(Dune::IOError,\n+457 \"Only dense sequences of node indices are currently supported (node index \"\n+458 << id << \" is invalid).\");\n+459 }\n+460\n+461 // just store node position\n+462 for( int j = 0; j < dimWorld; ++j )\n+463 nodes[ id ][ j ] = x[ j ];\n+464 }\n+465 readfile(file,1,\"%s\\n\",buf);\n+466 if (strcmp(buf,\"$EndNodes\")!=0)\n+467 DUNE_THROW(Dune::IOError, \"expected $EndNodes\");\n+468 }\n+469\n+470 // element section\n+471 readfile(file,1,\"%s\\n\",buf);\n+472 if (strcmp(buf,\"$Elements\")!=0)\n+473 DUNE_THROW(Dune::IOError, \"expected $Elements\");\n+474 int number_of_elements;\n+475 readfile(file,1,\"%d\\n\",&number_of_elements);\n+476 if (verbose) std::cout << \"file contains \" << number_of_elements << \"\n+elements\" << std::endl;\n+477\n+478 //=========================================\n+479 // Pass 1: Select and insert those vertices in the file that\n+480 // actually occur as corners of an element.\n+481 //=========================================\n+482\n+483 off_t section_element_offset = ftello(file);\n+484 std::map renumber;\n+485 for (int i=1; i<=number_of_elements; i++)\n+486 {\n+487 int id, elm_type, number_of_tags;\n+488 readfile(file,3,\"%d %d %d \",&id,&elm_type,&number_of_tags);\n+489 for (int k=1; k<=number_of_tags; k++)\n+490 {\n+491 int blub;\n+492 readfile(file,1,\"%d \",&blub);\n+493 // k == 1: physical entity\n+494 // k == 2: elementary entity (not used here)\n+495 // if version_number < 2.2:\n+496 // k == 3: mesh partition 0\n+497 // else\n+498 // k == 3: number of mesh partitions\n+499 // k => 4: mesh partition k-4\n+500 }\n+501 pass1HandleElement(file, elm_type, renumber, nodes);\n+502 }\n+503 if (verbose) std::cout << \"number of real vertices = \" << number_of_real_\n+vertices << std::endl;\n+504 if (verbose) std::cout << \"number of boundary elements = \" << boundary_\n+element_count << std::endl;\n+505 if (verbose) std::cout << \"number of elements = \" << element_count << std::\n+endl;\n+506 readfile(file,1,\"%s\\n\",buf);\n+507 if (strcmp(buf,\"$EndElements\")!=0)\n+508 DUNE_THROW(Dune::IOError, \"expected $EndElements\");\n+509 boundary_id_to_physical_entity.resize(boundary_element_count);\n+510 element_index_to_physical_entity.resize(element_count);\n+511\n+512 //==============================================\n+513 // Pass 2: Insert boundary segments and elements\n+514 //==============================================\n+515\n+516 fseeko(file, section_element_offset, SEEK_SET);\n+517 boundary_element_count = 0;\n+518 element_count = 0;\n+519 for (int i=1; i<=number_of_elements; i++)\n+520 {\n+521 int id, elm_type, number_of_tags;\n+522 readfile(file,3,\"%d %d %d \",&id,&elm_type,&number_of_tags);\n+523 int physical_entity = -1;\n+524\n+525 for (int k=1; k<=number_of_tags; k++)\n+526 {\n+527 int blub;\n+528 readfile(file,1,\"%d \",&blub);\n+529 if (k==1) physical_entity = blub;\n+530 }\n+531 pass2HandleElement(file, elm_type, renumber, nodes, physical_entity);\n+532 }\n+533 readfile(file,1,\"%s\\n\",buf);\n+534 if (strcmp(buf,\"$EndElements\")!=0)\n+535 DUNE_THROW(Dune::IOError, \"expected $EndElements\");\n+536\n+537 fclose(file);\n+538 }\n+539\n+545 void pass1HandleElement(FILE* file, const int elm_type,\n+546 std::map & renumber,\n+547 const std::vector< GlobalVector > & nodes)\n+548 {\n+549 // some data about gmsh elements\n+550 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1,\n+1};\n+551 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -\n+1, 1};\n+552 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -\n+1, 0};\n+553\n+554 // test whether we support the element type\n+555 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?\n+556 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) /\n+/ real element or boundary element?\n+557 {\n+558 skipline(file); // skip rest of line if element is unknown\n+559 return;\n+560 }\n+561\n+562 // The format string for parsing is n times '%d' in a row\n+563 std::string formatString = \"%d\";\n+564 for (int i=1; i elementDofs(10);\n+570\n+571 readfile(file,nDofs[elm_type], formatString.c_str(),\n+572 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),\n+573 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),\n+574 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),\n+575 &(elementDofs[9]));\n+576\n+577 // insert each vertex if it hasn't been inserted already\n+578 for (int i=0; i\n+597 void boundarysegment_insert(\n+598 const V&,\n+599 const E&,\n+600 const V2&\n+601 )\n+602 {\n+603 DUNE_THROW(Dune::IOError, \"tried to create a 3D boundary segment in a non-\n+3D Grid\");\n+604 }\n+605\n+606 // 3d-case:\n+607 template \n+608 void boundarysegment_insert(\n+609 const std::vector >& nodes,\n+610 const E& elementDofs,\n+611 const V& vertices\n+612 )\n+613 {\n+614 std::array, 6> v;\n+615 for (int i=0; i<6; i++)\n+616 for (int j=0; j* newBoundarySegment\n+620 = (BoundarySegment*) new GmshReaderQuadraticBoundarySegment<\n+3, 3 >( v[0], v[1], v[2],\n+621 v[3], v[4], v[5] );\n+622\n+623 factory.insertBoundarySegment( vertices,\n+624 std::shared_ptr >(newBoundarySegment) );\n+625 }\n+626\n+627\n+628\n+633 virtual void pass2HandleElement(FILE* file, const int elm_type,\n+634 std::map & renumber,\n+635 const std::vector< GlobalVector > & nodes,\n+636 const int physical_entity)\n+637 {\n+638 // some data about gmsh elements\n+639 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1,\n+1};\n+640 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -\n+1, 1};\n+641 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -\n+1, 0};\n+642\n+643 // test whether we support the element type\n+644 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?\n+645 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) /\n+/ real element or boundary element?\n+646 {\n+647 skipline(file); // skip rest of line if element is unknown\n+648 return;\n+649 }\n+650\n+651 // The format string for parsing is n times '%d' in a row\n+652 std::string formatString = \"%d\";\n+653 for (int i=1; i elementDofs(10);\n+659\n+660 readfile(file,nDofs[elm_type], formatString.c_str(),\n+661 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),\n+662 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),\n+663 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),\n+664 &(elementDofs[9]));\n+665\n+666 // correct differences between gmsh and Dune in the local vertex numbering\n+667 switch (elm_type)\n+668 {\n+669 case 3 : // 4-node quadrilateral\n+670 std::swap(elementDofs[2],elementDofs[3]);\n+671 break;\n+672 case 5 : // 8-node hexahedron\n+673 std::swap(elementDofs[2],elementDofs[3]);\n+674 std::swap(elementDofs[6],elementDofs[7]);\n+675 break;\n+676 case 7 : // 5-node pyramid\n+677 std::swap(elementDofs[2],elementDofs[3]);\n+678 break;\n+679 }\n+680\n+681 // renumber corners to account for the explicitly given vertex\n+682 // numbering in the file\n+683 std::vector vertices(nVertices[elm_type]);\n+684\n+685 for (int i=0; i, 3> v;\n+746 for (int i=0; i* newBoundarySegment\n+752 = (BoundarySegment*) new GmshReaderQuadraticBoundarySegment<\n+2, dimWorld >(v[0], v[1], v[2]);\n+753 factory.insertBoundarySegment(vertices,\n+754 std::shared_ptr >(newBoundarySegment));\n+755 break;\n+756 }\n+757 case 9 : { // 6-node triangle\n+758 boundarysegment_insert(nodes, elementDofs, vertices);\n+759 break;\n+760 }\n+761 default: {\n+762 DUNE_THROW(Dune::IOError, \"GmshReader does not support using element-type \"\n+<< elm_type << \" for boundary segments\");\n+763 break;\n+764 }\n+765\n+766 }\n+767\n+768 }\n+769 }\n+770\n+771 // count elements and boundary elements\n+772 if (elementDim[elm_type] == dim) {\n+773 element_index_to_physical_entity[element_count] = physical_entity;\n+774 element_count++;\n+775 } else {\n+776 boundary_id_to_physical_entity[boundary_element_count] = physical_entity;\n+777 boundary_element_count++;\n+778 }\n+779\n+780 }\n+781\n+782 };\n+783\n+784 namespace Gmsh {\n+790 enum class ReaderOptions\n+791 {\n+792 verbose = 1,\n+793 insertBoundarySegments = 2,\n+794 readElementData = 4,\n+795 readBoundaryData = 8\n+796 };\n+797\n+799 constexpr ReaderOptions operator_|_(ReaderOptions a, ReaderOptions b)\n+800 {\n+801 return static_cast(\n+802 static_cast(a) | static_cast(b)\n+803 );\n+804 }\n+805\n+807 constexpr bool operator_&_(ReaderOptions a, ReaderOptions b)\n+808 {\n+809 return static_cast(a) & static_cast(b);\n+810 }\n+811\n+812 } // end namespace Gmsh\n+813\n+838 template\n+839 class GmshReader\n+840 {\n+842\n+861 static void doRead(Dune::GridFactory &factory,\n+862 const std::string &fileName,\n+863 std::vector& boundarySegmentToPhysicalEntity,\n+864 std::vector& elementToPhysicalEntity,\n+865 bool verbose, bool insertBoundarySegments)\n+866 {\n+867 // register boundary segment to boundary segment factory for possible load\n+balancing\n+868 // this needs to be done on all cores since the type might not be known\n+otherwise\n+869 GmshReaderQuadraticBoundarySegment< Grid::dimension, Grid::dimensionworld\n+>::registerFactory();\n+870\n+871#ifndef NDEBUG\n+872 // check that this method is called on all cores\n+873 factory.comm().barrier();\n+874#endif\n+875\n+876 // create parse object and read grid on process 0\n+877 if (factory.comm().rank() == 0)\n+878 {\n+879 GmshReaderParser parser(factory,verbose,insertBoundarySegments);\n+880 parser.read(fileName);\n+881\n+882 boundarySegmentToPhysicalEntity = std::move(parser.boundaryIdMap());\n+883 elementToPhysicalEntity = std::move(parser.elementIndexMap());\n+884 }\n+885 else\n+886 {\n+887 boundarySegmentToPhysicalEntity = {};\n+888 elementToPhysicalEntity = {};\n+889 }\n+890 }\n+891\n+893\n+912 template\n+913 static T &discarded(T &&value) { return static_cast(value); }\n+914\n+915 struct DataArg {\n+916 std::vector *data_ = nullptr;\n+917 DataArg(std::vector &data) : data_(&data) {}\n+918 DataArg(const decltype(std::ignore)&) {}\n+919 DataArg() = default;\n+920 };\n+921\n+922 struct DataFlagArg : DataArg {\n+923 bool flag_ = false;\n+924 using DataArg::DataArg;\n+925 DataFlagArg(bool flag) : flag_(flag) {}\n+926 };\n+927\n+928 public:\n+929 typedef GridType Grid;\n+930\n+937 static std::unique_ptr read (const std::string& fileName, bool\n+verbose = true, bool insertBoundarySegments=true)\n+938 {\n+939 // make a grid factory\n+940 Dune::GridFactory factory;\n+941\n+942 read(factory, fileName, verbose, insertBoundarySegments);\n+943\n+944 return factory.createGrid();\n+945 }\n+946\n+966 static std::unique_ptr read (const std::string& fileName,\n+967 std::vector& boundarySegmentToPhysicalEntity,\n+968 std::vector& elementToPhysicalEntity,\n+969 bool verbose = true, bool insertBoundarySegments=true)\n+970 {\n+971 // make a grid factory\n+972 Dune::GridFactory factory;\n+973\n+974 doRead(\n+975 factory, fileName, boundarySegmentToPhysicalEntity,\n+976 elementToPhysicalEntity, verbose, insertBoundarySegments\n+977 );\n+978\n+979 return factory.createGrid();\n+980 }\n+981\n+983 static void read (Dune::GridFactory& factory, const std::string&\n+fileName,\n+984 bool verbose = true, bool insertBoundarySegments=true)\n+985 {\n+986 doRead(\n+987 factory, fileName, discarded(std::vector{}),\n+988 discarded(std::vector{}), verbose, insertBoundarySegments\n+989 );\n+990 }\n+991\n+993\n+1016 static void read (Dune::GridFactory &factory,\n+1017 const std::string &fileName,\n+1018 DataFlagArg boundarySegmentData,\n+1019 DataArg elementData,\n+1020 bool verbose=true)\n+1021 {\n+1022 doRead(\n+1023 factory, fileName,\n+1024 boundarySegmentData.data_\n+1025 ? *boundarySegmentData.data_ : discarded(std::vector{}),\n+1026 elementData.data_\n+1027 ? *elementData.data_ : discarded(std::vector{}),\n+1028 verbose,\n+1029 boundarySegmentData.flag_ || boundarySegmentData.data_\n+1030 );\n+1031 }\n+1032\n+1053 static void read (Dune::GridFactory& factory,\n+1054 const std::string& fileName,\n+1055 std::vector& boundarySegmentToPhysicalEntity,\n+1056 std::vector& elementToPhysicalEntity,\n+1057 bool verbose, bool insertBoundarySegments)\n+1058 {\n+1059 doRead(\n+1060 factory, fileName, boundarySegmentToPhysicalEntity,\n+1061 elementToPhysicalEntity, verbose, insertBoundarySegments\n+1062 );\n+1063 }\n+1064\n+1066 //\\{\n+1067\n+1068 using Opts = Gmsh::ReaderOptions;\n+1069\n+1070 static constexpr Opts defaultOpts =\n+1071 Opts::verbose | Opts::insertBoundarySegments | Opts::readElementData |\n+Opts::readBoundaryData;\n+1072\n+1074\n+1097 GmshReader(const std::string& fileName,\n+1098 Gmsh::ReaderOptions options = defaultOpts)\n+1099 {\n+1100 gridFactory_ = std::make_unique>();\n+1101 readGridFile(fileName, *gridFactory_, options);\n+1102 }\n+1103\n+1111 GmshReader(const std::string& fileName, GridFactory& factory,\n+1112 Gmsh::ReaderOptions options = defaultOpts)\n+1113 {\n+1114 readGridFile(fileName, factory, options);\n+1115 }\n+1116\n+1118 const std::vector& elementData () const\n+1119 {\n+1120 checkElementData();\n+1121 return elementIndexToGmshPhysicalEntity_;\n+1122 }\n+1123\n+1125 const std::vector& boundaryData () const\n+1126 {\n+1127 checkBoundaryData();\n+1128 return boundarySegmentIndexToGmshPhysicalEntity_;\n+1129 }\n+1130\n+1135 bool hasElementData () const\n+1136 { return hasElementData_ && !extractedElementData_; }\n+1137\n+1142 bool hasBoundaryData () const\n+1143 { return hasBoundaryData_ && !extractedBoundaryData_; }\n+1144\n+1146 std::vector extractElementData ()\n+1147 {\n+1148 checkElementData();\n+1149 extractedElementData_ = true;\n+1150 return std::move(elementIndexToGmshPhysicalEntity_);\n+1151 }\n+1152\n+1154 std::vector extractBoundaryData ()\n+1155 {\n+1156 checkBoundaryData();\n+1157 extractedBoundaryData_ = true;\n+1158 return std::move(boundarySegmentIndexToGmshPhysicalEntity_);\n+1159 }\n+1160\n+1162 std::unique_ptr createGrid ()\n+1163 {\n+1164 if (!gridFactory_)\n+1165 DUNE_THROW(Dune::InvalidStateException,\n+1166 \"This GmshReader has been constructed with a Dune::GridFactory. \"\n+1167 << \"This grid factory has been filled with all information to create a\n+grid. \"\n+1168 << \"Please use this factory to create the grid by calling\n+factory.createGrid(). \"\n+1169 << \"Alternatively use the constructor without passing the factory in\n+combination with this member function.\"\n+1170 );\n+1171\n+1172 return gridFactory_->createGrid();\n+1173 }\n+1174\n+1175 //\\}\n+1176\n+1177 private:\n+1178 void checkElementData () const\n+1179 {\n+1180 if (!hasElementData_)\n+1181 DUNE_THROW(Dune::InvalidStateException,\n+1182 \"This GmshReader has been constructed without the option\n+'readElementData'. \"\n+1183 << \"Please enable reading element data by passing the option 'Gmsh::\n+ReaderOpts::readElementData' \"\n+1184 << \"to the constructor of this class.\"\n+1185 );\n+1186\n+1187 if (extractedElementData_)\n+1188 DUNE_THROW(Dune::InvalidStateException,\n+1189 \"The element data has already been extracted from this GmshReader \"\n+1190 << \"via a function call to reader.extractElementData(). Use the extracted\n+data or \"\n+1191 << \"read the grid data from file again by constructing a new reader.\"\n+1192 );\n+1193 }\n+1194\n+1195 void checkBoundaryData () const\n+1196 {\n+1197 if (!hasBoundaryData_)\n+1198 DUNE_THROW(Dune::InvalidStateException,\n+1199 \"This GmshReader has been constructed without the option\n+'readBoundaryData'. \"\n+1200 << \"Please enable reading boundary data by passing the option 'Gmsh::\n+ReaderOpts::readBoundaryData' \"\n+1201 << \"to the constructor of this class.\"\n+1202 );\n+1203\n+1204 if (extractedBoundaryData_)\n+1205 DUNE_THROW(Dune::InvalidStateException,\n+1206 \"The boundary data has already been extracted from this GmshReader \"\n+1207 << \"via a function call to reader.extractBoundaryData(). Use the extracted\n+data or \"\n+1208 << \"read the grid data from file again by constructing a new reader.\"\n+1209 );\n+1210 }\n+1211\n+1212 void readGridFile (const std::string& fileName, GridFactory&\n+factory, Gmsh::ReaderOptions options)\n+1213 {\n+1214 const bool verbose = options & Opts::verbose;\n+1215 const bool insertBoundarySegments = options & Opts::\n+insertBoundarySegments;\n+1216 const bool readBoundaryData = options & Opts::readBoundaryData;\n+1217 const bool readElementData = options & Opts::readElementData;\n+1218\n+1219 doRead(\n+1220 factory, fileName, boundarySegmentIndexToGmshPhysicalEntity_,\n+1221 elementIndexToGmshPhysicalEntity_, verbose,\n+1222 readBoundaryData || insertBoundarySegments\n+1223 );\n+1224\n+1225 // clear unwanted data\n+1226 if (!readBoundaryData)\n+1227 boundarySegmentIndexToGmshPhysicalEntity_ = std::vector{};\n+1228 if (!readElementData)\n+1229 elementIndexToGmshPhysicalEntity_ = std::vector{};\n+1230\n+1231 hasElementData_ = readElementData;\n+1232 hasBoundaryData_ = readBoundaryData;\n+1233 }\n+1234\n+1235 std::unique_ptr> gridFactory_;\n+1236\n+1237 std::vector elementIndexToGmshPhysicalEntity_;\n+1238 std::vector boundarySegmentIndexToGmshPhysicalEntity_;\n+1239\n+1240 bool hasElementData_;\n+1241 bool hasBoundaryData_;\n+1242\n+1243 // for better error messages, we keep track of these separately\n+1244 bool extractedElementData_ = false;\n+1245 bool extractedBoundaryData_ = false;\n+1246 };\n+1247\n+1250} // namespace Dune\n+1251\n+1252#endif\n+boundarysegment.hh\n+Base class for grid boundary segments of arbitrary geometry.\n+Dune::Gmsh::ReaderOptions\n+ReaderOptions\n+Option for the Gmsh mesh file reader.\n+Definition gmshreader.hh:791\n+Dune::Gmsh::ReaderOptions::verbose\n+@ verbose\n+Dune::Gmsh::ReaderOptions::readBoundaryData\n+@ readBoundaryData\n+Dune::Gmsh::ReaderOptions::readElementData\n+@ readElementData\n+Dune::Gmsh::ReaderOptions::insertBoundarySegments\n+@ insertBoundarySegments\n+std::swap\n+void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n+> &b)\n+Definition utility/persistentcontainer.hh:83\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::printGrid\n-void printGrid(const GridType &grid, const Dune::MPIHelper &helper, std::string\n-output_file=\"printgrid\", int size=2000, bool execute_plot=true, bool png=true,\n-bool local_corner_indices=true, bool local_intersection_indices=true, bool\n-outer_normals=true)\n-Print a grid as a gnuplot for testing and development.\n-Definition printgrid.hh:73\n-Dune::IntersectionIterator\n-Mesh entities of codimension 0 (\"elements\") allow to visit all intersections\n-with \"neighboring\" eleme...\n-Definition common/intersectioniterator.hh:83\n-Dune::Mapper\n-Mapper interface.\n-Definition mapper.hh:110\n-Dune::Mapper::index\n-Index index(const EntityType &e) const\n-Map entity to array index.\n-Definition mapper.hh:122\n-Dune::Mapper::subIndex\n-Index subIndex(const typename G::Traits::template Codim< 0 >::Entity &e, int i,\n-unsigned int codim) const\n-Map subentity i of codim cc of a codim 0 entity to array index.\n-Definition mapper.hh:136\n-Dune::MultipleCodimMultipleGeomTypeMapper\n-Implementation class for a multiple codim and multiple geometry type mapper.\n-Definition mcmgmapper.hh:129\n+Dune::Alberta::GlobalVector\n+ALBERTA REAL_D GlobalVector\n+Definition misc.hh:50\n+Dune::Gmsh::operator&\n+constexpr bool operator&(ReaderOptions a, ReaderOptions b)\n+query operator for reader options (is b set in a)\n+Definition gmshreader.hh:807\n+Dune::Gmsh::operator|\n+constexpr ReaderOptions operator|(ReaderOptions a, ReaderOptions b)\n+composition operator for reader options\n+Definition gmshreader.hh:799\n+Dune::BoundarySegment\n+Base class for classes implementing geometries of boundary segments.\n+Definition boundarysegment.hh:94\n+Dune::GridFactoryInterface::comm\n+Communication comm() const\n+Return the Communication used by the grid factory.\n+Definition common/gridfactory.hh:258\n+Dune::GridFactory\n+Provide a generic factory class for unstructured grids.\n+Definition common/gridfactory.hh:275\n+Dune::GridFactory::createGrid\n+virtual std::unique_ptr< GridType > createGrid()\n+Finalize grid creation and hand over the grid.\n+Definition common/gridfactory.hh:333\n+Dune::GmshReaderOptions\n+Options for read operation.\n+Definition gmshreader.hh:39\n+Dune::GmshReaderOptions::GeometryOrder\n+GeometryOrder\n+Definition gmshreader.hh:40\n+Dune::GmshReaderOptions::firstOrder\n+@ firstOrder\n+edges are straight lines.\n+Definition gmshreader.hh:42\n+Dune::GmshReaderOptions::secondOrder\n+@ secondOrder\n+quadratic boundary approximation.\n+Definition gmshreader.hh:44\n+Dune::GmshReaderParser\n+dimension independent parts for GmshReaderParser\n+Definition gmshreader.hh:302\n+Dune::GmshReaderParser::physicalEntityNames\n+std::vector< std::string > & physicalEntityNames()\n+Returns the names of the gmsh physical entities (0-based index)\n+Definition gmshreader.hh:373\n+Dune::GmshReaderParser::pass1HandleElement\n+void pass1HandleElement(FILE *file, const int elm_type, std::map< int, unsigned\n+int > &renumber, const std::vector< GlobalVector > &nodes)\n+Process one element during the first pass through the list of all elements.\n+Definition gmshreader.hh:545\n+Dune::GmshReaderParser::dimWorld\n+static const int dimWorld\n+Definition gmshreader.hh:321\n+Dune::GmshReaderParser::factory\n+Dune::GridFactory< GridType > & factory\n+Definition gmshreader.hh:305\n+Dune::GmshReaderParser::boundaryIdMap\n+std::vector< int > & boundaryIdMap()\n+Definition gmshreader.hh:361\n+Dune::GmshReaderParser::readfile\n+void readfile(FILE *file, int cnt, const char *format,...)\n+Definition gmshreader.hh:331\n+Dune::GmshReaderParser::elementIndexMap\n+std::vector< int > & elementIndexMap()\n+Returns a map for the gmsh physical entity id (1-based index) for each entity\n+of codim 0.\n+Definition gmshreader.hh:367\n+Dune::GmshReaderParser::number_of_real_vertices\n+unsigned int number_of_real_vertices\n+Definition gmshreader.hh:308\n+Dune::GmshReaderParser::boundarysegment_insert\n+void boundarysegment_insert(const std::vector< FieldVector< double, 3 > >\n+&nodes, const E &elementDofs, const V &vertices)\n+Definition gmshreader.hh:608\n+Dune::GmshReaderParser::GmshReaderParser\n+GmshReaderParser(Dune::GridFactory< GridType > &_factory, bool v, bool i)\n+Definition gmshreader.hh:358\n+Dune::GmshReaderParser::element_count\n+int element_count\n+Definition gmshreader.hh:310\n+Dune::GmshReaderParser::read\n+void read(const std::string &f)\n+Definition gmshreader.hh:378\n+Dune::GmshReaderParser::skipline\n+void skipline(FILE *file)\n+Definition gmshreader.hh:348\n+Dune::GmshReaderParser::element_index_to_physical_entity\n+std::vector< int > element_index_to_physical_entity\n+Definition gmshreader.hh:316\n+Dune::GmshReaderParser::pass2HandleElement\n+virtual void pass2HandleElement(FILE *file, const int elm_type, std::map< int,\n+unsigned int > &renumber, const std::vector< GlobalVector > &nodes, const int\n+physical_entity)\n+Process one element during the second pass through the list of all elements.\n+Definition gmshreader.hh:633\n+Dune::GmshReaderParser::dim\n+static const int dim\n+Definition gmshreader.hh:320\n+Dune::GmshReaderParser::GlobalVector\n+FieldVector< double, dimWorld > GlobalVector\n+Definition gmshreader.hh:325\n+Dune::GmshReaderParser::fileName\n+std::string fileName\n+Definition gmshreader.hh:313\n+Dune::GmshReaderParser::physical_entity_names\n+std::vector< std::string > physical_entity_names\n+Definition gmshreader.hh:317\n+Dune::GmshReaderParser::boundary_element_count\n+int boundary_element_count\n+Definition gmshreader.hh:309\n+Dune::GmshReaderParser::boundarysegment_insert\n+void boundarysegment_insert(const V &, const E &, const V2 &)\n+Definition gmshreader.hh:597\n+Dune::GmshReaderParser::verbose\n+bool verbose\n+Definition gmshreader.hh:306\n+Dune::GmshReaderParser::boundary_id_to_physical_entity\n+std::vector< int > boundary_id_to_physical_entity\n+Definition gmshreader.hh:315\n+Dune::GmshReaderParser::buf\n+char buf[512]\n+Definition gmshreader.hh:312\n+Dune::GmshReaderParser::insert_boundary_segments\n+bool insert_boundary_segments\n+Definition gmshreader.hh:307\n+Dune::GmshReader\n+Read Gmsh mesh file.\n+Definition gmshreader.hh:840\n+Dune::GmshReader::read\n+static std::unique_ptr< Grid > read(const std::string &fileName, std::vector<\n+int > &boundarySegmentToPhysicalEntity, std::vector< int >\n+&elementToPhysicalEntity, bool verbose=true, bool insertBoundarySegments=true)\n+Read Gmsh file, possibly with data.\n+Definition gmshreader.hh:966\n+Dune::GmshReader::elementData\n+const std::vector< int > & elementData() const\n+Access element data (maps element index to Gmsh physical entity)\n+Definition gmshreader.hh:1118\n+Dune::GmshReader::read\n+static void read(Dune::GridFactory< Grid > &factory, const std::string\n+&fileName, DataFlagArg boundarySegmentData, DataArg elementData, bool\n+verbose=true)\n+read Gmsh file, possibly with data\n+Definition gmshreader.hh:1016\n+Dune::GmshReader::read\n+static std::unique_ptr< Grid > read(const std::string &fileName, bool\n+verbose=true, bool insertBoundarySegments=true)\n+Definition gmshreader.hh:937\n+Dune::GmshReader::read\n+static void read(Dune::GridFactory< Grid > &factory, const std::string\n+&fileName, bool verbose=true, bool insertBoundarySegments=true)\n+Definition gmshreader.hh:983\n+Dune::GmshReader::Grid\n+GridType Grid\n+Definition gmshreader.hh:929\n+Dune::GmshReader::createGrid\n+std::unique_ptr< Grid > createGrid()\n+Create the grid.\n+Definition gmshreader.hh:1162\n+Dune::GmshReader::extractBoundaryData\n+std::vector< int > extractBoundaryData()\n+Erase boundary data from reader and return the data.\n+Definition gmshreader.hh:1154\n+Dune::GmshReader::read\n+static void read(Dune::GridFactory< Grid > &factory, const std::string\n+&fileName, std::vector< int > &boundarySegmentToPhysicalEntity, std::vector<\n+int > &elementToPhysicalEntity, bool verbose, bool insertBoundarySegments)\n+Read Gmsh file, possibly with data.\n+Definition gmshreader.hh:1053\n+Dune::GmshReader::hasElementData\n+bool hasElementData() const\n+If element data is available.\n+Definition gmshreader.hh:1135\n+Dune::GmshReader::hasBoundaryData\n+bool hasBoundaryData() const\n+If boundary data is available.\n+Definition gmshreader.hh:1142\n+Dune::GmshReader::defaultOpts\n+static constexpr Opts defaultOpts\n+Definition gmshreader.hh:1070\n+Dune::GmshReader::GmshReader\n+GmshReader(const std::string &fileName, GridFactory< Grid > &factory, Gmsh::\n+ReaderOptions options=defaultOpts)\n+Construct a Gmsh reader object from a file name and a grid factory.\n+Definition gmshreader.hh:1111\n+Dune::GmshReader::GmshReader\n+GmshReader(const std::string &fileName, Gmsh::ReaderOptions\n+options=defaultOpts)\n+Construct a Gmsh reader object (alternatively use one of the static member\n+functions)\n+Definition gmshreader.hh:1097\n+Dune::GmshReader::extractElementData\n+std::vector< int > extractElementData()\n+Erase element data from reader and return the data.\n+Definition gmshreader.hh:1146\n+Dune::GmshReader::boundaryData\n+const std::vector< int > & boundaryData() const\n+Access boundary data (maps boundary segment index to Gmsh physical entity)\n+Definition gmshreader.hh:1125\n+gridfactory.hh\n+Provide a generic factory class for unstructured grids.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00764.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00764.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gmshreader.hh File Reference\n+dune-grid: gnuplot.cc File Reference\n \n \n \n \n \n \n \n@@ -65,84 +65,39 @@\n
    \n
    \n
    \n
    \n \n \n \n
    \n \n-
    gmshreader.hh File Reference
    \n+Namespaces
    \n+
    gnuplot.cc File Reference
    \n \n
    \n-
    #include <cstdarg>
    \n-#include <cstdio>
    \n-#include <cstring>
    \n-#include <fstream>
    \n-#include <iostream>
    \n-#include <map>
    \n-#include <memory>
    \n-#include <string>
    \n-#include <tuple>
    \n-#include <vector>
    \n-#include <utility>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/boundarysegment.hh>
    \n-#include <dune/grid/common/gridfactory.hh>
    \n+\n+

    Implementation of gnuplot output for 1D and 2D grids. \n+More...

    \n+
    #include "../gnuplot.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

    struct  Dune::GmshReaderOptions
     Options for read operation. More...
     
    class  Dune::GmshReaderParser< GridType >
     dimension independent parts for GmshReaderParser More...
     
    class  Dune::GmshReader< GridType >
     Read Gmsh mesh file. More...
     
    \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Gmsh
     
    \n-\n-\n-\n-\n-

    \n-Enumerations

    enum class  Dune::Gmsh::ReaderOptions { Dune::Gmsh::ReaderOptions::verbose = 1\n-, Dune::Gmsh::ReaderOptions::insertBoundarySegments = 2\n-, Dune::Gmsh::ReaderOptions::readElementData = 4\n-, Dune::Gmsh::ReaderOptions::readBoundaryData = 8\n- }
     Option for the Gmsh mesh file reader. More...
     
    \n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

    constexpr ReaderOptions Dune::Gmsh::operator| (ReaderOptions a, ReaderOptions b)
     composition operator for reader options
     
    constexpr bool Dune::Gmsh::operator& (ReaderOptions a, ReaderOptions b)
     query operator for reader options (is b set in a)
     
    \n-
    \n+

    Detailed Description

    \n+

    Implementation of gnuplot output for 1D and 2D grids.

    \n+
    Author
    Christian Engwer
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,60 +2,23 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-Classes | Namespaces | Enumerations | Functions\n-gmshreader.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+ * gnuplot\n+Namespaces\n+gnuplot.cc File Reference\n+Implementation of gnuplot output for 1D and 2D grids. More...\n+#include \"../gnuplot.hh\"\n Go_to_the_source_code_of_this_file.\n-Classes\n-struct \u00a0 Dune::GmshReaderOptions\n-\u00a0 Options for read operation. More...\n-\u00a0\n- class \u00a0 Dune::GmshReaderParser<_GridType_>\n-\u00a0 dimension independent parts for GmshReaderParser More...\n-\u00a0\n- class \u00a0 Dune::GmshReader<_GridType_>\n-\u00a0 Read Gmsh mesh file. More...\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::Gmsh\n-\u00a0\n-Enumerations\n-enum class \u00a0 Dune::Gmsh::ReaderOptions { Dune::Gmsh::ReaderOptions::verbose = 1\n- , Dune::Gmsh::ReaderOptions::insertBoundarySegments = 2 , Dune::\n- Gmsh::ReaderOptions::readElementData = 4 , Dune::Gmsh::\n- ReaderOptions::readBoundaryData = 8 }\n-\u00a0 Option for the Gmsh mesh file reader. More...\n-\u00a0\n-Functions\n-constexpr ReaderOptions\u00a0 Dune::Gmsh::operator| (ReaderOptions a, ReaderOptions\n- b)\n-\u00a0 composition operator for reader options\n-\u00a0\n- constexpr bool\u00a0 Dune::Gmsh::operator& (ReaderOptions a, ReaderOptions\n- b)\n-\u00a0 query operator for reader options (is b set in a)\n-\u00a0\n+***** Detailed Description *****\n+Implementation of gnuplot output for 1D and 2D grids.\n+ Author\n+ Christian Engwer\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00764_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00764_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gmshreader.hh Source File\n+dune-grid: gnuplot.cc Source File\n \n \n \n \n \n \n \n@@ -70,1198 +70,136 @@\n \n \n \n \n \n \n \n
    \n-
    gmshreader.hh
    \n+
    gnuplot.cc
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GMSHREADER_HH
    \n-
    7#define DUNE_GMSHREADER_HH
    \n-
    8
    \n-
    9#include <cstdarg>
    \n-
    10#include <cstdio>
    \n-
    11#include <cstring>
    \n-
    12#include <fstream>
    \n-
    13#include <iostream>
    \n-
    14#include <map>
    \n-
    15#include <memory>
    \n-
    16#include <string>
    \n-
    17#include <tuple>
    \n-
    18#include <vector>
    \n-
    19#include <utility>
    \n-
    20
    \n-
    21#include <dune/common/exceptions.hh>
    \n-
    22#include <dune/common/fvector.hh>
    \n-
    23
    \n-
    24#include <dune/geometry/type.hh>
    \n-
    25
    \n-\n-\n+
    10#include "../gnuplot.hh"
    \n+
    11
    \n+
    12namespace Dune {
    \n+
    13
    \n+
    17 template<class GridView>
    \n+
    18 void
    \n+
    \n+
    19 GnuplotWriter<GridView>::write(const std::string& filename) const
    \n+
    20 {
    \n+
    21 // open file
    \n+
    22 std::ofstream file(filename.c_str());
    \n+
    23 // write all column names
    \n+
    24 file << "# coord\\t";
    \n+
    25 for (size_t i=0; i<_names.size(); i++)
    \n+
    26 file << _names[i] << "\\t";
    \n+
    27 file << "\\n";
    \n
    28
    \n-
    29namespace Dune
    \n-
    30{
    \n-
    31
    \n-
    \n-\n-
    39 {
    \n-
    \n-\n-\n-\n-
    45 };
    \n+
    29 if (dimworld==1) {
    \n+
    30#if !NDEBUG
    \n+
    31 int counter = 0;
    \n+
    32#endif
    \n+
    33 typedef typename GridView::template Codim<0>::Iterator CellIterator;
    \n+
    34 CellIterator it = _gv.template begin<0>();
    \n+
    35 CellIterator end = _gv.template end<0>();
    \n+
    36 for (; it != end; ++it)
    \n+
    37 {
    \n+
    38 int i = _is.index(*it);
    \n+
    39 // check that the elements are numbered consecutively
    \n+
    40 assert (i == counter++);
    \n+
    41 // calc positions
    \n+
    42 assert(it->geometry().corners() == 2);
    \n+
    43 const FieldVector<ctype,dimworld>& left = it->geometry().corner(0);
    \n+
    44 const FieldVector<ctype,dimworld>& right = it->geometry().corner(1);
    \n+
    45 assert(left[0] < right[0]);
    \n+
    46 // write gnuplot rows for left & right vertex
    \n+
    47 writeRow(file, left, _data[2*i]);
    \n+
    48 writeRow(file, right, _data[2*i+1]);
    \n+
    49 }
    \n+
    50
    \n+
    51 } else {
    \n+
    52
    \n+
    53 typedef typename GridView::template Codim<dimworld>::Iterator VertexIterator;
    \n+
    54 VertexIterator it = _gv.template begin<dimworld>();
    \n+
    55 VertexIterator end = _gv.template end<dimworld>();
    \n+
    56 for (; it != end; ++it) {
    \n+
    57
    \n+
    58 // write gnuplot rows for vertex
    \n+
    59 writeRow(file, it->geometry().corner(0), _data[_is.index(*it)]);
    \n+
    60
    \n+
    61 }
    \n+
    62
    \n+
    63 }
    \n+
    64
    \n+
    65 }
    \n+
    \n+
    66
    \n+
    67 template<class GridView>
    \n+
    68 void
    \n+
    \n+\n+
    70 const FieldVector<ctype,dimworld>& position,
    \n+
    71 const std::vector<float> & data) const
    \n+
    72 {
    \n+
    73 assert (data.size() == _names.size());
    \n+
    74 // write position
    \n+
    75 file << position << "\\t";
    \n+
    76 // write all data columns
    \n+
    77 for (size_t j=0; j<data.size(); j++)
    \n+
    78 file << data[j] << "\\t";
    \n+
    79 file << "\\n";
    \n+
    80 }
    \n+
    81
    \n+
    87 template<class GridView>
    \n+
    88 template<class DataContainer>
    \n+
    89 void
    \n+
    90 GnuplotWriter<GridView>::addData(DataType t, const DataContainer& data, const std::string & name)
    \n+
    91 {
    \n+
    92 assert((t == cellData && _is.size(0) == data.size())
    \n+
    93 || (t == vertexData && _is.size(GridView::dimension) == data.size()) );
    \n+
    94 _names.push_back(name);
    \n+
    95
    \n+
    96 // copy data to new container
    \n+
    97
    \n+
    98 if (dimworld==1) {
    \n+
    99
    \n+
    100 // data is transformed to nonconforming vertex data
    \n+
    101 int c = 0;
    \n+
    102 int shift = (t==vertexData ? 1 : 0);
    \n+
    103 for (size_t i=0; i<_is.size(0); i++)
    \n+
    104 {
    \n+
    105 _data[c++].push_back(data[i]);
    \n+
    106 _data[c++].push_back(data[i+shift]);
    \n+
    107 };
    \n+
    108
    \n+
    109 } else {
    \n+
    110
    \n+
    111 // 2d: only vertex data is allowed
    \n+
    112 for (size_t i=0; i<_is.size(dimworld); i++)
    \n+
    113 _data[i].push_back(data[i]);
    \n+
    114
    \n+
    115 }
    \n+
    116
    \n+
    117 }
    \n+
    118
    \n+
    119}
    \n
    \n-
    46 };
    \n-
    \n-
    47
    \n-
    48 namespace {
    \n-
    49
    \n-
    50 // arbitrary dimension, implementation is in specialization
    \n-
    51 template< int dimension, int dimWorld = dimension >
    \n-
    52 class GmshReaderQuadraticBoundarySegment
    \n-
    53 {
    \n-
    54 public:
    \n-
    55 // empty function since this class does not implement anything
    \n-
    56 static void registerFactory() {}
    \n-
    57 };
    \n-
    58
    \n-
    59 // quadratic boundary segments in 1d
    \n-
    60 /*
    \n-
    61 Note the points
    \n-
    62
    \n-
    63 (0) (alpha) (1)
    \n-
    64
    \n-
    65 are mapped to the points in global coordinates
    \n-
    66
    \n-
    67 p0 p2 p1
    \n-
    68
    \n-
    69 alpha is determined automatically from the given points.
    \n-
    70 */
    \n-
    71 template< int dimWorld >
    \n-
    72 struct GmshReaderQuadraticBoundarySegment< 2, dimWorld >
    \n-
    73 : public Dune::BoundarySegment< 2, dimWorld >
    \n-
    74 {
    \n-
    75 typedef GmshReaderQuadraticBoundarySegment< 2, dimWorld > ThisType;
    \n-
    76 typedef typename Dune::BoundarySegment< 2, dimWorld > :: ObjectStreamType ObjectStreamType;
    \n-
    77 typedef Dune::FieldVector< double, dimWorld > GlobalVector;
    \n-
    78
    \n-
    79 GmshReaderQuadraticBoundarySegment ( const GlobalVector &p0_, const GlobalVector &p1_, const GlobalVector &p2_)
    \n-
    80 : p0(p0_), p1(p1_), p2(p2_)
    \n-
    81 {
    \n-
    82 init();
    \n-
    83 }
    \n-
    84
    \n-
    85 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )
    \n-
    86 {
    \n-
    87 // key is read before by the factory
    \n-
    88 const int bytes = sizeof(double)*dimWorld;
    \n-
    89 in.read( (char *) &p0[ 0 ], bytes );
    \n-
    90 in.read( (char *) &p1[ 0 ], bytes );
    \n-
    91 in.read( (char *) &p2[ 0 ], bytes );
    \n-
    92 init();
    \n-
    93 }
    \n-
    94
    \n-
    95 static void registerFactory()
    \n-
    96 {
    \n-
    97 if( key() < 0 )
    \n-
    98 {
    \n-
    99 key() = Dune::BoundarySegment< 2, dimWorld >::template registerFactory< ThisType >();
    \n-
    100 }
    \n-
    101 }
    \n-
    102
    \n-
    103 virtual GlobalVector operator() ( const Dune::FieldVector<double,1> &local ) const
    \n-
    104 {
    \n-
    105 GlobalVector y;
    \n-
    106 y = 0.0;
    \n-
    107 y.axpy((local[0]-alpha)*(local[0]-1.0)/alpha,p0);
    \n-
    108 y.axpy(local[0]*(local[0]-1.0)/(alpha*(alpha-1.0)),p1);
    \n-
    109 y.axpy(local[0]*(local[0]-alpha)/(1.0-alpha),p2);
    \n-
    110 return y;
    \n-
    111 }
    \n-
    112
    \n-
    113 void backup( ObjectStreamType& out ) const
    \n-
    114 {
    \n-
    115 // backup key to identify object
    \n-
    116 out.write( (const char *) &key(), sizeof( int ) );
    \n-
    117 // backup data
    \n-
    118 const int bytes = sizeof(double)*dimWorld;
    \n-
    119 out.write( (const char*) &p0[ 0 ], bytes );
    \n-
    120 out.write( (const char*) &p1[ 0 ], bytes );
    \n-
    121 out.write( (const char*) &p2[ 0 ], bytes );
    \n-
    122 }
    \n-
    123
    \n-
    124 protected:
    \n-
    125 void init()
    \n-
    126 {
    \n-
    127 GlobalVector d1 = p1;
    \n-
    128 d1 -= p0;
    \n-
    129 GlobalVector d2 = p2;
    \n-
    130 d2 -= p1;
    \n-
    131
    \n-
    132 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());
    \n-
    133 if (alpha<1E-6 || alpha>1-1E-6)
    \n-
    134 DUNE_THROW(Dune::IOError, "ration in quadratic boundary segment bad");
    \n-
    135 }
    \n-
    136
    \n-
    137 static int& key() {
    \n-
    138 static int k = -1;
    \n-
    139 return k;
    \n-
    140 }
    \n-
    141
    \n-
    142 private:
    \n-
    143 GlobalVector p0,p1,p2;
    \n-
    144 double alpha;
    \n-
    145 };
    \n-
    146
    \n-
    147
    \n-
    148 // quadratic boundary segments in 2d
    \n-
    149 /* numbering of points corresponding to gmsh:
    \n-
    150
    \n-
    151 2
    \n-
    152
    \n-
    153 5 4
    \n-
    154
    \n-
    155 0 3 1
    \n-
    156
    \n-
    157 Note: The vertices 3, 4, 5 are not necessarily at the edge midpoints but can
    \n-
    158 be placed with parameters alpha, beta , gamma at the following positions
    \n-
    159 in local coordinates:
    \n-
    160
    \n-
    161
    \n-
    162 2 = (0,1)
    \n-
    163
    \n-
    164 5 = (0,beta) 4 = (1-gamma/sqrt(2),gamma/sqrt(2))
    \n-
    165
    \n-
    166 0 = (0,0) 3 = (alpha,0) 1 = (1,0)
    \n-
    167
    \n-
    168 The parameters alpha, beta, gamma are determined from the given vertices in
    \n-
    169 global coordinates.
    \n-
    170 */
    \n-
    171 template<>
    \n-
    172 class GmshReaderQuadraticBoundarySegment< 3, 3 >
    \n-
    173 : public Dune::BoundarySegment< 3 >
    \n-
    174 {
    \n-
    175 typedef GmshReaderQuadraticBoundarySegment< 3, 3 > ThisType;
    \n-
    176 typedef typename Dune::BoundarySegment< 3 > :: ObjectStreamType ObjectStreamType;
    \n-
    177 public:
    \n-
    178 GmshReaderQuadraticBoundarySegment (Dune::FieldVector<double,3> p0_, Dune::FieldVector<double,3> p1_,
    \n-
    179 Dune::FieldVector<double,3> p2_, Dune::FieldVector<double,3> p3_,
    \n-
    180 Dune::FieldVector<double,3> p4_, Dune::FieldVector<double,3> p5_)
    \n-
    181 : p0(p0_), p1(p1_), p2(p2_), p3(p3_), p4(p4_), p5(p5_)
    \n-
    182 {
    \n-
    183 init();
    \n-
    184 }
    \n-
    185
    \n-
    186 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )
    \n-
    187 {
    \n-
    188 const int bytes = sizeof(double)*3;
    \n-
    189 in.read( (char *) &p0[ 0 ], bytes );
    \n-
    190 in.read( (char *) &p1[ 0 ], bytes );
    \n-
    191 in.read( (char *) &p2[ 0 ], bytes );
    \n-
    192 in.read( (char *) &p3[ 0 ], bytes );
    \n-
    193 in.read( (char *) &p4[ 0 ], bytes );
    \n-
    194 in.read( (char *) &p5[ 0 ], bytes );
    \n-
    195 init();
    \n-
    196 }
    \n-
    197
    \n-
    198 static void registerFactory()
    \n-
    199 {
    \n-
    200 if( key() < 0 )
    \n-
    201 {
    \n-
    202 key() = Dune::BoundarySegment< 3 >::template registerFactory< ThisType >();
    \n-
    203 }
    \n-
    204 }
    \n-
    205
    \n-
    206 virtual Dune::FieldVector<double,3> operator() (const Dune::FieldVector<double,2>& local) const
    \n-
    207 {
    \n-
    208 Dune::FieldVector<double,3> y;
    \n-
    209 y = 0.0;
    \n-
    210 y.axpy(phi0(local),p0);
    \n-
    211 y.axpy(phi1(local),p1);
    \n-
    212 y.axpy(phi2(local),p2);
    \n-
    213 y.axpy(phi3(local),p3);
    \n-
    214 y.axpy(phi4(local),p4);
    \n-
    215 y.axpy(phi5(local),p5);
    \n-
    216 return y;
    \n-
    217 }
    \n-
    218
    \n-
    219 void backup( ObjectStreamType& out ) const
    \n-
    220 {
    \n-
    221 // backup key to identify object in factory
    \n-
    222 out.write( (const char*) &key(), sizeof( int ) );
    \n-
    223 // backup data
    \n-
    224 const int bytes = sizeof(double)*3;
    \n-
    225 out.write( (const char*) &p0[ 0 ], bytes );
    \n-
    226 out.write( (const char*) &p1[ 0 ], bytes );
    \n-
    227 out.write( (const char*) &p2[ 0 ], bytes );
    \n-
    228 out.write( (const char*) &p3[ 0 ], bytes );
    \n-
    229 out.write( (const char*) &p4[ 0 ], bytes );
    \n-
    230 out.write( (const char*) &p5[ 0 ], bytes );
    \n-
    231 }
    \n-
    232
    \n-
    233 protected:
    \n-
    234 void init()
    \n-
    235 {
    \n-
    236 using std::sqrt;
    \n-
    237 sqrt2 = sqrt(2.0);
    \n-
    238 Dune::FieldVector<double,3> d1,d2;
    \n-
    239
    \n-
    240 d1 = p3; d1 -= p0;
    \n-
    241 d2 = p1; d2 -= p3;
    \n-
    242 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());
    \n-
    243 if (alpha<1E-6 || alpha>1-1E-6)
    \n-
    244 DUNE_THROW(Dune::IOError, "alpha in quadratic boundary segment bad");
    \n-
    245
    \n-
    246 d1 = p5; d1 -= p0;
    \n-
    247 d2 = p2; d2 -= p5;
    \n-
    248 beta=d1.two_norm()/(d1.two_norm()+d2.two_norm());
    \n-
    249 if (beta<1E-6 || beta>1-1E-6)
    \n-
    250 DUNE_THROW(Dune::IOError, "beta in quadratic boundary segment bad");
    \n-
    251
    \n-
    252 d1 = p4; d1 -= p1;
    \n-
    253 d2 = p2; d2 -= p4;
    \n-
    254 gamma=sqrt2*(d1.two_norm()/(d1.two_norm()+d2.two_norm()));
    \n-
    255 if (gamma<1E-6 || gamma>1-1E-6)
    \n-
    256 DUNE_THROW(Dune::IOError, "gamma in quadratic boundary segment bad");
    \n-
    257 }
    \n-
    258
    \n-
    259 static int& key() {
    \n-
    260 static int k = -1;
    \n-
    261 return k;
    \n-
    262 }
    \n-
    263
    \n-
    264 private:
    \n-
    265 // The six Lagrange basis function on the reference element
    \n-
    266 // for the points given above
    \n-
    267
    \n-
    268 double phi0 (const Dune::FieldVector<double,2>& local) const
    \n-
    269 {
    \n-
    270 return (alpha*beta-beta*local[0]-alpha*local[1])*(1-local[0]-local[1])/(alpha*beta);
    \n-
    271 }
    \n-
    272 double phi3 (const Dune::FieldVector<double,2>& local) const
    \n-
    273 {
    \n-
    274 return local[0]*(1-local[0]-local[1])/(alpha*(1-alpha));
    \n-
    275 }
    \n-
    276 double phi1 (const Dune::FieldVector<double,2>& local) const
    \n-
    277 {
    \n-
    278 return local[0]*(gamma*local[0]-(sqrt2-gamma-sqrt2*alpha)*local[1]-alpha*gamma)/(gamma*(1-alpha));
    \n-
    279 }
    \n-
    280 double phi5 (const Dune::FieldVector<double,2>& local) const
    \n-
    281 {
    \n-
    282 return local[1]*(1-local[0]-local[1])/(beta*(1-beta));
    \n-
    283 }
    \n-
    284 double phi4 (const Dune::FieldVector<double,2>& local) const
    \n-
    285 {
    \n-
    286 return local[0]*local[1]/((1-gamma/sqrt2)*gamma/sqrt2);
    \n-
    287 }
    \n-
    288 double phi2 (const Dune::FieldVector<double,2>& local) const
    \n-
    289 {
    \n-
    290 return local[1]*(beta*(1-gamma/sqrt2)-local[0]*(beta-gamma/sqrt2)-local[1]*(1-gamma/sqrt2))/((1-gamma/sqrt2)*(beta-1));
    \n-
    291 }
    \n-
    292
    \n-
    293 Dune::FieldVector<double,3> p0,p1,p2,p3,p4,p5;
    \n-
    294 double alpha,beta,gamma,sqrt2;
    \n-
    295 };
    \n-
    296
    \n-
    297 } // end empty namespace
    \n-
    298
    \n-
    300 template<typename GridType>
    \n-
    \n-\n-
    302 {
    \n-
    303 protected:
    \n-
    304 // private data
    \n-\n-\n-\n-\n-\n-\n-
    311 // read buffer
    \n-
    312 char buf[512];
    \n-
    313 std::string fileName;
    \n-
    314 // exported data
    \n-\n-\n-
    317 std::vector<std::string> physical_entity_names;
    \n-
    318
    \n-
    319 // static data
    \n-
    320 static const int dim = GridType::dimension;
    \n-
    321 static const int dimWorld = GridType::dimensionworld;
    \n-
    322 static_assert( (dimWorld <= 3), "GmshReader requires dimWorld <= 3." );
    \n-
    323
    \n-
    324 // typedefs
    \n-
    325 typedef FieldVector< double, dimWorld > GlobalVector;
    \n-
    326
    \n-
    327 // don't use something like
    \n-
    328 // readfile(file, 1, "%s\\n", buf);
    \n-
    329 // to skip the rest of of the line -- that will only skip the next
    \n-
    330 // whitespace-separated word! Use skipline() instead.
    \n-
    \n-
    331 void readfile(FILE * file, int cnt, const char * format, ...)
    \n-
    332#ifdef __GNUC__
    \n-
    333 __attribute__((format(scanf, 4, 5)))
    \n-
    334#endif
    \n-
    335 {
    \n-
    336 std::va_list ap;
    \n-
    337 va_start(ap, format);
    \n-
    338 off_t pos = ftello(file);
    \n-
    339 int c = std::vfscanf(file, format, ap);
    \n-
    340 va_end(ap);
    \n-
    341 if (c != cnt)
    \n-
    342 DUNE_THROW(Dune::IOError, "Error parsing " << fileName << " "
    \n-
    343 "file pos " << pos
    \n-
    344 << ": Expected '" << format << "', only read " << c << " entries instead of " << cnt << ".");
    \n-
    345 }
    \n-
    \n-
    346
    \n-
    347 // skip over the rest of the line, including the terminating newline
    \n-
    \n-
    348 void skipline(FILE * file)
    \n-
    349 {
    \n-
    350 int c;
    \n-
    351 do {
    \n-
    352 c = std::fgetc(file);
    \n-
    353 } while(c != '\\n' && c != EOF);
    \n-
    354 }
    \n-
    \n-
    355
    \n-
    356 public:
    \n-
    357
    \n-
    \n-\n-
    359 factory(_factory), verbose(v), insert_boundary_segments(i) {}
    \n-
    \n-
    360
    \n-
    \n-
    361 std::vector<int> & boundaryIdMap()
    \n-
    362 {
    \n-\n-
    364 }
    \n-
    \n-
    365
    \n-
    \n-
    367 std::vector<int> & elementIndexMap()
    \n-
    368 {
    \n-\n-
    370 }
    \n-
    \n-
    371
    \n-
    \n-
    373 std::vector<std::string> & physicalEntityNames()
    \n-
    374 {
    \n-\n-
    376 }
    \n-
    \n-
    377
    \n-
    \n-
    378 void read (const std::string& f)
    \n-
    379 {
    \n-
    380 if (verbose) std::cout << "Reading " << dim << "d Gmsh grid..." << std::endl;
    \n-
    381
    \n-
    382 // open file name, we use C I/O
    \n-
    383 fileName = f;
    \n-
    384 FILE* file = fopen(fileName.c_str(),"rb");
    \n-
    385 if (file==0)
    \n-
    386 DUNE_THROW(Dune::IOError, "Could not open " << fileName);
    \n-
    387
    \n-
    388 //=========================================
    \n-
    389 // Header: Read vertices into vector
    \n-
    390 // Check vertices that are needed
    \n-
    391 //=========================================
    \n-
    392
    \n-\n-\n-
    395 element_count = 0;
    \n-
    396
    \n-
    397 // process header
    \n-
    398 double version_number;
    \n-
    399 int file_type, data_size;
    \n-
    400
    \n-
    401 readfile(file,1,"%s\\n",buf);
    \n-
    402 if (strcmp(buf,"$MeshFormat")!=0)
    \n-
    403 DUNE_THROW(Dune::IOError, "expected $MeshFormat in first line");
    \n-
    404 readfile(file,3,"%lg %d %d\\n",&version_number,&file_type,&data_size);
    \n-
    405 // 2.2 is not representable as float and leads to problems on i386
    \n-
    406 // Hence we use >= 2.00001.
    \n-
    407 if( (version_number < 2.0) || (version_number >= 2.20001) ) // 2.2 is not representable as float and leads to problems on i386
    \n-
    408 DUNE_THROW(Dune::IOError, "can only read Gmsh version 2 files");
    \n-
    409 if (verbose) std::cout << "version " << version_number << " Gmsh file detected" << std::endl;
    \n-
    410 readfile(file,1,"%s\\n",buf);
    \n-
    411 if (strcmp(buf,"$EndMeshFormat")!=0)
    \n-
    412 DUNE_THROW(Dune::IOError, "expected $EndMeshFormat");
    \n-
    413
    \n-
    414 // physical name section
    \n-
    415 physical_entity_names.clear();
    \n-
    416 readfile(file,1,"%s\\n",buf);
    \n-
    417 if (strcmp(buf,"$PhysicalNames")==0) {
    \n-
    418 int number_of_names;
    \n-
    419 readfile(file,1,"%d\\n",&number_of_names);
    \n-
    420 if (verbose) std::cout << "file contains " << number_of_names << " physical entities" << std::endl;
    \n-
    421 physical_entity_names.resize(number_of_names);
    \n-
    422 std::string buf_name;
    \n-
    423 for( int i = 0; i < number_of_names; ++i ) {
    \n-
    424 int dim, id;
    \n-
    425 readfile(file,3, "%d %d %s\\n", &dim, &id, buf);
    \n-
    426 buf_name.assign(buf);
    \n-
    427 auto begin = buf_name.find_first_of('\\"') + 1;
    \n-
    428 auto end = buf_name.find_last_of('\\"') - begin;
    \n-
    429 physical_entity_names[id-1].assign(buf_name.substr(begin, end));
    \n-
    430 }
    \n-
    431 readfile(file,1,"%s\\n",buf);
    \n-
    432 if (strcmp(buf,"$EndPhysicalNames")!=0)
    \n-
    433 DUNE_THROW(Dune::IOError, "expected $EndPhysicalNames");
    \n-
    434 readfile(file,1,"%s\\n",buf);
    \n-
    435 }
    \n-
    436
    \n-
    437 // node section
    \n-
    438 int number_of_nodes;
    \n-
    439
    \n-
    440 if (strcmp(buf,"$Nodes")!=0)
    \n-
    441 DUNE_THROW(Dune::IOError, "expected $Nodes");
    \n-
    442 readfile(file,1,"%d\\n",&number_of_nodes);
    \n-
    443 if (verbose) std::cout << "file contains " << number_of_nodes << " nodes" << std::endl;
    \n-
    444
    \n-
    445 // read nodes
    \n-
    446 // The '+1' is due to the fact that gmsh numbers node starting from 1 rather than from 0
    \n-
    447 std::vector< GlobalVector > nodes( number_of_nodes+1 );
    \n-
    448 {
    \n-
    449 int id;
    \n-
    450 double x[ 3 ];
    \n-
    451 for( int i = 1; i <= number_of_nodes; ++i )
    \n-
    452 {
    \n-
    453 readfile(file,4, "%d %lg %lg %lg\\n", &id, &x[ 0 ], &x[ 1 ], &x[ 2 ] );
    \n-
    454
    \n-
    455 if (id > number_of_nodes) {
    \n-
    456 DUNE_THROW(Dune::IOError,
    \n-
    457 "Only dense sequences of node indices are currently supported (node index "
    \n-
    458 << id << " is invalid).");
    \n-
    459 }
    \n-
    460
    \n-
    461 // just store node position
    \n-
    462 for( int j = 0; j < dimWorld; ++j )
    \n-
    463 nodes[ id ][ j ] = x[ j ];
    \n-
    464 }
    \n-
    465 readfile(file,1,"%s\\n",buf);
    \n-
    466 if (strcmp(buf,"$EndNodes")!=0)
    \n-
    467 DUNE_THROW(Dune::IOError, "expected $EndNodes");
    \n-
    468 }
    \n-
    469
    \n-
    470 // element section
    \n-
    471 readfile(file,1,"%s\\n",buf);
    \n-
    472 if (strcmp(buf,"$Elements")!=0)
    \n-
    473 DUNE_THROW(Dune::IOError, "expected $Elements");
    \n-
    474 int number_of_elements;
    \n-
    475 readfile(file,1,"%d\\n",&number_of_elements);
    \n-
    476 if (verbose) std::cout << "file contains " << number_of_elements << " elements" << std::endl;
    \n-
    477
    \n-
    478 //=========================================
    \n-
    479 // Pass 1: Select and insert those vertices in the file that
    \n-
    480 // actually occur as corners of an element.
    \n-
    481 //=========================================
    \n-
    482
    \n-
    483 off_t section_element_offset = ftello(file);
    \n-
    484 std::map<int,unsigned int> renumber;
    \n-
    485 for (int i=1; i<=number_of_elements; i++)
    \n-
    486 {
    \n-
    487 int id, elm_type, number_of_tags;
    \n-
    488 readfile(file,3,"%d %d %d ",&id,&elm_type,&number_of_tags);
    \n-
    489 for (int k=1; k<=number_of_tags; k++)
    \n-
    490 {
    \n-
    491 int blub;
    \n-
    492 readfile(file,1,"%d ",&blub);
    \n-
    493 // k == 1: physical entity
    \n-
    494 // k == 2: elementary entity (not used here)
    \n-
    495 // if version_number < 2.2:
    \n-
    496 // k == 3: mesh partition 0
    \n-
    497 // else
    \n-
    498 // k == 3: number of mesh partitions
    \n-
    499 // k => 4: mesh partition k-4
    \n-
    500 }
    \n-
    501 pass1HandleElement(file, elm_type, renumber, nodes);
    \n-
    502 }
    \n-
    503 if (verbose) std::cout << "number of real vertices = " << number_of_real_vertices << std::endl;
    \n-
    504 if (verbose) std::cout << "number of boundary elements = " << boundary_element_count << std::endl;
    \n-
    505 if (verbose) std::cout << "number of elements = " << element_count << std::endl;
    \n-
    506 readfile(file,1,"%s\\n",buf);
    \n-
    507 if (strcmp(buf,"$EndElements")!=0)
    \n-
    508 DUNE_THROW(Dune::IOError, "expected $EndElements");
    \n-\n-\n-
    511
    \n-
    512 //==============================================
    \n-
    513 // Pass 2: Insert boundary segments and elements
    \n-
    514 //==============================================
    \n-
    515
    \n-
    516 fseeko(file, section_element_offset, SEEK_SET);
    \n-\n-
    518 element_count = 0;
    \n-
    519 for (int i=1; i<=number_of_elements; i++)
    \n-
    520 {
    \n-
    521 int id, elm_type, number_of_tags;
    \n-
    522 readfile(file,3,"%d %d %d ",&id,&elm_type,&number_of_tags);
    \n-
    523 int physical_entity = -1;
    \n-
    524
    \n-
    525 for (int k=1; k<=number_of_tags; k++)
    \n-
    526 {
    \n-
    527 int blub;
    \n-
    528 readfile(file,1,"%d ",&blub);
    \n-
    529 if (k==1) physical_entity = blub;
    \n-
    530 }
    \n-
    531 pass2HandleElement(file, elm_type, renumber, nodes, physical_entity);
    \n-
    532 }
    \n-
    533 readfile(file,1,"%s\\n",buf);
    \n-
    534 if (strcmp(buf,"$EndElements")!=0)
    \n-
    535 DUNE_THROW(Dune::IOError, "expected $EndElements");
    \n-
    536
    \n-
    537 fclose(file);
    \n-
    538 }
    \n-
    \n-
    539
    \n-
    \n-
    545 void pass1HandleElement(FILE* file, const int elm_type,
    \n-
    546 std::map<int,unsigned int> & renumber,
    \n-
    547 const std::vector< GlobalVector > & nodes)
    \n-
    548 {
    \n-
    549 // some data about gmsh elements
    \n-
    550 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1, 1};
    \n-
    551 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -1, 1};
    \n-
    552 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -1, 0};
    \n-
    553
    \n-
    554 // test whether we support the element type
    \n-
    555 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?
    \n-
    556 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) // real element or boundary element?
    \n-
    557 {
    \n-
    558 skipline(file); // skip rest of line if element is unknown
    \n-
    559 return;
    \n-
    560 }
    \n-
    561
    \n-
    562 // The format string for parsing is n times '%d' in a row
    \n-
    563 std::string formatString = "%d";
    \n-
    564 for (int i=1; i<nDofs[elm_type]; i++)
    \n-
    565 formatString += " %d";
    \n-
    566 formatString += "\\n";
    \n-
    567
    \n-
    568 // '10' is the largest number of dofs we may encounter in a .msh file
    \n-
    569 std::vector<int> elementDofs(10);
    \n-
    570
    \n-
    571 readfile(file,nDofs[elm_type], formatString.c_str(),
    \n-
    572 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),
    \n-
    573 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),
    \n-
    574 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),
    \n-
    575 &(elementDofs[9]));
    \n-
    576
    \n-
    577 // insert each vertex if it hasn't been inserted already
    \n-
    578 for (int i=0; i<nVertices[elm_type]; i++)
    \n-
    579 if (renumber.find(elementDofs[i])==renumber.end())
    \n-
    580 {
    \n-
    581 renumber[elementDofs[i]] = number_of_real_vertices++;
    \n-
    582 factory.insertVertex(nodes[elementDofs[i]]);
    \n-
    583 }
    \n-
    584
    \n-
    585 // count elements and boundary elements
    \n-
    586 if (elementDim[elm_type] == dim)
    \n-\n-
    588 else
    \n-\n-
    590
    \n-
    591 }
    \n-
    \n-
    592
    \n-
    593
    \n-
    594
    \n-
    595 // generic-case: This is not supposed to be used at runtime.
    \n-
    596 template <class E, class V, class V2>
    \n-
    \n-\n-
    598 const V&,
    \n-
    599 const E&,
    \n-
    600 const V2&
    \n-
    601 )
    \n-
    602 {
    \n-
    603 DUNE_THROW(Dune::IOError, "tried to create a 3D boundary segment in a non-3D Grid");
    \n-
    604 }
    \n-
    \n-
    605
    \n-
    606 // 3d-case:
    \n-
    607 template <class E, class V>
    \n-
    \n-\n-
    609 const std::vector<FieldVector<double, 3> >& nodes,
    \n-
    610 const E& elementDofs,
    \n-
    611 const V& vertices
    \n-
    612 )
    \n-
    613 {
    \n-
    614 std::array<FieldVector<double,dimWorld>, 6> v;
    \n-
    615 for (int i=0; i<6; i++)
    \n-
    616 for (int j=0; j<dimWorld; j++)
    \n-
    617 v[i][j] = nodes[elementDofs[i]][j];
    \n-
    618
    \n-
    619 BoundarySegment<dim,dimWorld>* newBoundarySegment
    \n-
    620 = (BoundarySegment<dim,dimWorld>*) new GmshReaderQuadraticBoundarySegment< 3, 3 >( v[0], v[1], v[2],
    \n-
    621 v[3], v[4], v[5] );
    \n-
    622
    \n-
    623 factory.insertBoundarySegment( vertices,
    \n-
    624 std::shared_ptr<BoundarySegment<dim,dimWorld> >(newBoundarySegment) );
    \n-
    625 }
    \n-
    \n-
    626
    \n-
    627
    \n-
    628
    \n-
    \n-
    633 virtual void pass2HandleElement(FILE* file, const int elm_type,
    \n-
    634 std::map<int,unsigned int> & renumber,
    \n-
    635 const std::vector< GlobalVector > & nodes,
    \n-
    636 const int physical_entity)
    \n-
    637 {
    \n-
    638 // some data about gmsh elements
    \n-
    639 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1, 1};
    \n-
    640 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -1, 1};
    \n-
    641 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -1, 0};
    \n-
    642
    \n-
    643 // test whether we support the element type
    \n-
    644 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?
    \n-
    645 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) // real element or boundary element?
    \n-
    646 {
    \n-
    647 skipline(file); // skip rest of line if element is unknown
    \n-
    648 return;
    \n-
    649 }
    \n-
    650
    \n-
    651 // The format string for parsing is n times '%d' in a row
    \n-
    652 std::string formatString = "%d";
    \n-
    653 for (int i=1; i<nDofs[elm_type]; i++)
    \n-
    654 formatString += " %d";
    \n-
    655 formatString += "\\n";
    \n-
    656
    \n-
    657 // '10' is the largest number of dofs we may encounter in a .msh file
    \n-
    658 std::vector<int> elementDofs(10);
    \n-
    659
    \n-
    660 readfile(file,nDofs[elm_type], formatString.c_str(),
    \n-
    661 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),
    \n-
    662 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),
    \n-
    663 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),
    \n-
    664 &(elementDofs[9]));
    \n-
    665
    \n-
    666 // correct differences between gmsh and Dune in the local vertex numbering
    \n-
    667 switch (elm_type)
    \n-
    668 {
    \n-
    669 case 3 : // 4-node quadrilateral
    \n-
    670 std::swap(elementDofs[2],elementDofs[3]);
    \n-
    671 break;
    \n-
    672 case 5 : // 8-node hexahedron
    \n-
    673 std::swap(elementDofs[2],elementDofs[3]);
    \n-
    674 std::swap(elementDofs[6],elementDofs[7]);
    \n-
    675 break;
    \n-
    676 case 7 : // 5-node pyramid
    \n-
    677 std::swap(elementDofs[2],elementDofs[3]);
    \n-
    678 break;
    \n-
    679 }
    \n-
    680
    \n-
    681 // renumber corners to account for the explicitly given vertex
    \n-
    682 // numbering in the file
    \n-
    683 std::vector<unsigned int> vertices(nVertices[elm_type]);
    \n-
    684
    \n-
    685 for (int i=0; i<nVertices[elm_type]; i++)
    \n-
    686 vertices[i] = renumber[elementDofs[i]];
    \n-
    687
    \n-
    688 // If it is an element, insert it as such
    \n-
    689 if (elementDim[elm_type] == dim) {
    \n-
    690
    \n-
    691 switch (elm_type)
    \n-
    692 {
    \n-
    693 case 1 : // 2-node line
    \n-
    694 factory.insertElement(Dune::GeometryTypes::line,vertices);
    \n-
    695 break;
    \n-
    696 case 2 : // 3-node triangle
    \n-
    697 factory.insertElement(Dune::GeometryTypes::triangle,vertices);
    \n-
    698 break;
    \n-
    699 case 3 : // 4-node quadrilateral
    \n-
    700 factory.insertElement(Dune::GeometryTypes::quadrilateral,vertices);
    \n-
    701 break;
    \n-
    702 case 4 : // 4-node tetrahedron
    \n-
    703 factory.insertElement(Dune::GeometryTypes::tetrahedron,vertices);
    \n-
    704 break;
    \n-
    705 case 5 : // 8-node hexahedron
    \n-
    706 factory.insertElement(Dune::GeometryTypes::hexahedron,vertices);
    \n-
    707 break;
    \n-
    708 case 6 : // 6-node prism
    \n-
    709 factory.insertElement(Dune::GeometryTypes::prism,vertices);
    \n-
    710 break;
    \n-
    711 case 7 : // 5-node pyramid
    \n-
    712 factory.insertElement(Dune::GeometryTypes::pyramid,vertices);
    \n-
    713 break;
    \n-
    714 case 9 : // 6-node triangle
    \n-
    715 factory.insertElement(Dune::GeometryTypes::triangle,vertices);
    \n-
    716 break;
    \n-
    717 case 11 : // 10-node tetrahedron
    \n-
    718 factory.insertElement(Dune::GeometryTypes::tetrahedron,vertices);
    \n-
    719 break;
    \n-
    720 }
    \n-
    721
    \n-
    722 } else {
    \n-
    723 // it must be a boundary segment then
    \n-\n-
    725
    \n-
    726 switch (elm_type)
    \n-
    727 {
    \n-
    728 case 1 : // 2-node line
    \n-
    729 factory.insertBoundarySegment(vertices);
    \n-
    730 break;
    \n-
    731
    \n-
    732 case 2 : // 3-node triangle
    \n-
    733 factory.insertBoundarySegment(vertices);
    \n-
    734 break;
    \n-
    735
    \n-
    736 case 3 : // 4-node quadrilateral
    \n-
    737 factory.insertBoundarySegment(vertices);
    \n-
    738 break;
    \n-
    739
    \n-
    740 case 15 : // 1-node point
    \n-
    741 factory.insertBoundarySegment(vertices);
    \n-
    742 break;
    \n-
    743
    \n-
    744 case 8 : { // 3-node line
    \n-
    745 std::array<FieldVector<double,dimWorld>, 3> v;
    \n-
    746 for (int i=0; i<dimWorld; i++) {
    \n-
    747 v[0][i] = nodes[elementDofs[0]][i];
    \n-
    748 v[1][i] = nodes[elementDofs[2]][i]; // yes, the renumbering is intended!
    \n-
    749 v[2][i] = nodes[elementDofs[1]][i];
    \n-
    750 }
    \n-
    751 BoundarySegment<dim,dimWorld>* newBoundarySegment
    \n-
    752 = (BoundarySegment<dim,dimWorld>*) new GmshReaderQuadraticBoundarySegment< 2, dimWorld >(v[0], v[1], v[2]);
    \n-
    753 factory.insertBoundarySegment(vertices,
    \n-
    754 std::shared_ptr<BoundarySegment<dim,dimWorld> >(newBoundarySegment));
    \n-
    755 break;
    \n-
    756 }
    \n-
    757 case 9 : { // 6-node triangle
    \n-
    758 boundarysegment_insert(nodes, elementDofs, vertices);
    \n-
    759 break;
    \n-
    760 }
    \n-
    761 default: {
    \n-
    762 DUNE_THROW(Dune::IOError, "GmshReader does not support using element-type " << elm_type << " for boundary segments");
    \n-
    763 break;
    \n-
    764 }
    \n-
    765
    \n-
    766 }
    \n-
    767
    \n-
    768 }
    \n-
    769 }
    \n-
    770
    \n-
    771 // count elements and boundary elements
    \n-
    772 if (elementDim[elm_type] == dim) {
    \n-\n-\n-
    775 } else {
    \n-\n-\n-
    778 }
    \n-
    779
    \n-
    780 }
    \n-
    \n-
    781
    \n-
    782 };
    \n-
    \n-
    783
    \n-
    \n-
    784 namespace Gmsh {
    \n-
    \n-
    790 enum class ReaderOptions
    \n-
    791 {
    \n-
    792 verbose = 1,
    \n-\n-
    794 readElementData = 4,
    \n-\n-
    796 };
    \n-
    \n-
    797
    \n-
    \n-\n-
    800 {
    \n-
    801 return static_cast<ReaderOptions>(
    \n-
    802 static_cast<int>(a) | static_cast<int>(b)
    \n-
    803 );
    \n-
    804 }
    \n-
    \n-
    805
    \n-
    \n-\n-
    808 {
    \n-
    809 return static_cast<int>(a) & static_cast<int>(b);
    \n-
    810 }
    \n-
    \n-
    811
    \n-
    812 } // end namespace Gmsh
    \n-
    \n-
    813
    \n-
    838 template<typename GridType>
    \n-
    \n-\n-
    840 {
    \n-
    842
    \n-
    861 static void doRead(Dune::GridFactory<GridType> &factory,
    \n-
    862 const std::string &fileName,
    \n-
    863 std::vector<int>& boundarySegmentToPhysicalEntity,
    \n-
    864 std::vector<int>& elementToPhysicalEntity,
    \n-
    865 bool verbose, bool insertBoundarySegments)
    \n-
    866 {
    \n-
    867 // register boundary segment to boundary segment factory for possible load balancing
    \n-
    868 // this needs to be done on all cores since the type might not be known otherwise
    \n-
    869 GmshReaderQuadraticBoundarySegment< Grid::dimension, Grid::dimensionworld >::registerFactory();
    \n-
    870
    \n-
    871#ifndef NDEBUG
    \n-
    872 // check that this method is called on all cores
    \n-
    873 factory.comm().barrier();
    \n-
    874#endif
    \n-
    875
    \n-
    876 // create parse object and read grid on process 0
    \n-
    877 if (factory.comm().rank() == 0)
    \n-
    878 {
    \n-
    879 GmshReaderParser<Grid> parser(factory,verbose,insertBoundarySegments);
    \n-
    880 parser.read(fileName);
    \n-
    881
    \n-
    882 boundarySegmentToPhysicalEntity = std::move(parser.boundaryIdMap());
    \n-
    883 elementToPhysicalEntity = std::move(parser.elementIndexMap());
    \n-
    884 }
    \n-
    885 else
    \n-
    886 {
    \n-
    887 boundarySegmentToPhysicalEntity = {};
    \n-
    888 elementToPhysicalEntity = {};
    \n-
    889 }
    \n-
    890 }
    \n-
    891
    \n-
    893
    \n-
    912 template<class T>
    \n-
    913 static T &discarded(T &&value) { return static_cast<T&>(value); }
    \n-
    914
    \n-
    915 struct DataArg {
    \n-
    916 std::vector<int> *data_ = nullptr;
    \n-
    917 DataArg(std::vector<int> &data) : data_(&data) {}
    \n-
    918 DataArg(const decltype(std::ignore)&) {}
    \n-
    919 DataArg() = default;
    \n-
    920 };
    \n-
    921
    \n-
    922 struct DataFlagArg : DataArg {
    \n-
    923 bool flag_ = false;
    \n-
    924 using DataArg::DataArg;
    \n-
    925 DataFlagArg(bool flag) : flag_(flag) {}
    \n-
    926 };
    \n-
    927
    \n-
    928 public:
    \n-
    929 typedef GridType Grid;
    \n-
    930
    \n-
    \n-
    937 static std::unique_ptr<Grid> read (const std::string& fileName, bool verbose = true, bool insertBoundarySegments=true)
    \n-
    938 {
    \n-
    939 // make a grid factory
    \n-\n-
    941
    \n-
    942 read(factory, fileName, verbose, insertBoundarySegments);
    \n-
    943
    \n-
    944 return factory.createGrid();
    \n-
    945 }
    \n-
    \n-
    946
    \n-
    \n-
    966 static std::unique_ptr<Grid> read (const std::string& fileName,
    \n-
    967 std::vector<int>& boundarySegmentToPhysicalEntity,
    \n-
    968 std::vector<int>& elementToPhysicalEntity,
    \n-
    969 bool verbose = true, bool insertBoundarySegments=true)
    \n-
    970 {
    \n-
    971 // make a grid factory
    \n-\n-
    973
    \n-
    974 doRead(
    \n-
    975 factory, fileName, boundarySegmentToPhysicalEntity,
    \n-
    976 elementToPhysicalEntity, verbose, insertBoundarySegments
    \n-
    977 );
    \n-
    978
    \n-
    979 return factory.createGrid();
    \n-
    980 }
    \n-
    \n-
    981
    \n-
    \n-
    983 static void read (Dune::GridFactory<Grid>& factory, const std::string& fileName,
    \n-
    984 bool verbose = true, bool insertBoundarySegments=true)
    \n-
    985 {
    \n-
    986 doRead(
    \n-
    987 factory, fileName, discarded(std::vector<int>{}),
    \n-
    988 discarded(std::vector<int>{}), verbose, insertBoundarySegments
    \n-
    989 );
    \n-
    990 }
    \n-
    \n-
    991
    \n-
    993
    \n-
    \n-
    1016 static void read (Dune::GridFactory<Grid> &factory,
    \n-
    1017 const std::string &fileName,
    \n-
    1018 DataFlagArg boundarySegmentData,
    \n-
    1019 DataArg elementData,
    \n-
    1020 bool verbose=true)
    \n-
    1021 {
    \n-
    1022 doRead(
    \n-
    1023 factory, fileName,
    \n-
    1024 boundarySegmentData.data_
    \n-
    1025 ? *boundarySegmentData.data_ : discarded(std::vector<int>{}),
    \n-
    1026 elementData.data_
    \n-
    1027 ? *elementData.data_ : discarded(std::vector<int>{}),
    \n-
    1028 verbose,
    \n-
    1029 boundarySegmentData.flag_ || boundarySegmentData.data_
    \n-
    1030 );
    \n-
    1031 }
    \n-
    \n-
    1032
    \n-
    \n-
    1053 static void read (Dune::GridFactory<Grid>& factory,
    \n-
    1054 const std::string& fileName,
    \n-
    1055 std::vector<int>& boundarySegmentToPhysicalEntity,
    \n-
    1056 std::vector<int>& elementToPhysicalEntity,
    \n-
    1057 bool verbose, bool insertBoundarySegments)
    \n-
    1058 {
    \n-
    1059 doRead(
    \n-
    1060 factory, fileName, boundarySegmentToPhysicalEntity,
    \n-
    1061 elementToPhysicalEntity, verbose, insertBoundarySegments
    \n-
    1062 );
    \n-
    1063 }
    \n-
    \n-
    1064
    \n-
    1066 //\\{
    \n-
    1067
    \n-\n-
    1069
    \n-
    1070 static constexpr Opts defaultOpts =
    \n-
    1071 Opts::verbose | Opts::insertBoundarySegments | Opts::readElementData | Opts::readBoundaryData;
    \n-
    1072
    \n-
    1074
    \n-
    \n-
    1097 GmshReader(const std::string& fileName,
    \n-\n-
    1099 {
    \n-
    1100 gridFactory_ = std::make_unique<Dune::GridFactory<Grid>>();
    \n-
    1101 readGridFile(fileName, *gridFactory_, options);
    \n-
    1102 }
    \n-
    \n-
    1103
    \n-
    \n-
    1111 GmshReader(const std::string& fileName, GridFactory<Grid>& factory,
    \n-\n-
    1113 {
    \n-
    1114 readGridFile(fileName, factory, options);
    \n-
    1115 }
    \n-
    \n-
    1116
    \n-
    \n-
    1118 const std::vector<int>& elementData () const
    \n-
    1119 {
    \n-
    1120 checkElementData();
    \n-
    1121 return elementIndexToGmshPhysicalEntity_;
    \n-
    1122 }
    \n-
    \n-
    1123
    \n-
    \n-
    1125 const std::vector<int>& boundaryData () const
    \n-
    1126 {
    \n-
    1127 checkBoundaryData();
    \n-
    1128 return boundarySegmentIndexToGmshPhysicalEntity_;
    \n-
    1129 }
    \n-
    \n-
    1130
    \n-
    \n-
    1135 bool hasElementData () const
    \n-
    1136 { return hasElementData_ && !extractedElementData_; }
    \n-
    \n-
    1137
    \n-
    \n-
    1142 bool hasBoundaryData () const
    \n-
    1143 { return hasBoundaryData_ && !extractedBoundaryData_; }
    \n-
    \n-
    1144
    \n-
    \n-
    1146 std::vector<int> extractElementData ()
    \n-
    1147 {
    \n-
    1148 checkElementData();
    \n-
    1149 extractedElementData_ = true;
    \n-
    1150 return std::move(elementIndexToGmshPhysicalEntity_);
    \n-
    1151 }
    \n-
    \n-
    1152
    \n-
    \n-
    1154 std::vector<int> extractBoundaryData ()
    \n-
    1155 {
    \n-
    1156 checkBoundaryData();
    \n-
    1157 extractedBoundaryData_ = true;
    \n-
    1158 return std::move(boundarySegmentIndexToGmshPhysicalEntity_);
    \n-
    1159 }
    \n-
    \n-
    1160
    \n-
    \n-
    1162 std::unique_ptr<Grid> createGrid ()
    \n-
    1163 {
    \n-
    1164 if (!gridFactory_)
    \n-
    1165 DUNE_THROW(Dune::InvalidStateException,
    \n-
    1166 "This GmshReader has been constructed with a Dune::GridFactory. "
    \n-
    1167 << "This grid factory has been filled with all information to create a grid. "
    \n-
    1168 << "Please use this factory to create the grid by calling factory.createGrid(). "
    \n-
    1169 << "Alternatively use the constructor without passing the factory in combination with this member function."
    \n-
    1170 );
    \n-
    1171
    \n-
    1172 return gridFactory_->createGrid();
    \n-
    1173 }
    \n-
    \n-
    1174
    \n-
    1175 //\\}
    \n-
    1176
    \n-
    1177 private:
    \n-
    1178 void checkElementData () const
    \n-
    1179 {
    \n-
    1180 if (!hasElementData_)
    \n-
    1181 DUNE_THROW(Dune::InvalidStateException,
    \n-
    1182 "This GmshReader has been constructed without the option 'readElementData'. "
    \n-
    1183 << "Please enable reading element data by passing the option 'Gmsh::ReaderOpts::readElementData' "
    \n-
    1184 << "to the constructor of this class."
    \n-
    1185 );
    \n-
    1186
    \n-
    1187 if (extractedElementData_)
    \n-
    1188 DUNE_THROW(Dune::InvalidStateException,
    \n-
    1189 "The element data has already been extracted from this GmshReader "
    \n-
    1190 << "via a function call to reader.extractElementData(). Use the extracted data or "
    \n-
    1191 << "read the grid data from file again by constructing a new reader."
    \n-
    1192 );
    \n-
    1193 }
    \n-
    1194
    \n-
    1195 void checkBoundaryData () const
    \n-
    1196 {
    \n-
    1197 if (!hasBoundaryData_)
    \n-
    1198 DUNE_THROW(Dune::InvalidStateException,
    \n-
    1199 "This GmshReader has been constructed without the option 'readBoundaryData'. "
    \n-
    1200 << "Please enable reading boundary data by passing the option 'Gmsh::ReaderOpts::readBoundaryData' "
    \n-
    1201 << "to the constructor of this class."
    \n-
    1202 );
    \n-
    1203
    \n-
    1204 if (extractedBoundaryData_)
    \n-
    1205 DUNE_THROW(Dune::InvalidStateException,
    \n-
    1206 "The boundary data has already been extracted from this GmshReader "
    \n-
    1207 << "via a function call to reader.extractBoundaryData(). Use the extracted data or "
    \n-
    1208 << "read the grid data from file again by constructing a new reader."
    \n-
    1209 );
    \n-
    1210 }
    \n-
    1211
    \n-
    1212 void readGridFile (const std::string& fileName, GridFactory<Grid>& factory, Gmsh::ReaderOptions options)
    \n-
    1213 {
    \n-
    1214 const bool verbose = options & Opts::verbose;
    \n-
    1215 const bool insertBoundarySegments = options & Opts::insertBoundarySegments;
    \n-
    1216 const bool readBoundaryData = options & Opts::readBoundaryData;
    \n-
    1217 const bool readElementData = options & Opts::readElementData;
    \n-
    1218
    \n-
    1219 doRead(
    \n-
    1220 factory, fileName, boundarySegmentIndexToGmshPhysicalEntity_,
    \n-
    1221 elementIndexToGmshPhysicalEntity_, verbose,
    \n-
    1222 readBoundaryData || insertBoundarySegments
    \n-
    1223 );
    \n-
    1224
    \n-
    1225 // clear unwanted data
    \n-
    1226 if (!readBoundaryData)
    \n-
    1227 boundarySegmentIndexToGmshPhysicalEntity_ = std::vector<int>{};
    \n-
    1228 if (!readElementData)
    \n-
    1229 elementIndexToGmshPhysicalEntity_ = std::vector<int>{};
    \n-
    1230
    \n-
    1231 hasElementData_ = readElementData;
    \n-
    1232 hasBoundaryData_ = readBoundaryData;
    \n-
    1233 }
    \n-
    1234
    \n-
    1235 std::unique_ptr<Dune::GridFactory<Grid>> gridFactory_;
    \n-
    1236
    \n-
    1237 std::vector<int> elementIndexToGmshPhysicalEntity_;
    \n-
    1238 std::vector<int> boundarySegmentIndexToGmshPhysicalEntity_;
    \n-
    1239
    \n-
    1240 bool hasElementData_;
    \n-
    1241 bool hasBoundaryData_;
    \n-
    1242
    \n-
    1243 // for better error messages, we keep track of these separately
    \n-
    1244 bool extractedElementData_ = false;
    \n-
    1245 bool extractedBoundaryData_ = false;
    \n-
    1246 };
    \n-
    \n-
    1247
    \n-
    1250} // namespace Dune
    \n-
    1251
    \n-
    1252#endif
    \n-
    Base class for grid boundary segments of arbitrary geometry.
    \n-
    ReaderOptions
    Option for the Gmsh mesh file reader.
    Definition gmshreader.hh:791
    \n-\n-\n-\n-\n-
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-
    constexpr bool operator&(ReaderOptions a, ReaderOptions b)
    query operator for reader options (is b set in a)
    Definition gmshreader.hh:807
    \n-
    constexpr ReaderOptions operator|(ReaderOptions a, ReaderOptions b)
    composition operator for reader options
    Definition gmshreader.hh:799
    \n-
    Base class for classes implementing geometries of boundary segments.
    Definition boundarysegment.hh:94
    \n-
    Communication comm() const
    Return the Communication used by the grid factory.
    Definition common/gridfactory.hh:258
    \n-
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n-
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n-
    Options for read operation.
    Definition gmshreader.hh:39
    \n-
    GeometryOrder
    Definition gmshreader.hh:40
    \n-
    @ firstOrder
    edges are straight lines.
    Definition gmshreader.hh:42
    \n-
    @ secondOrder
    quadratic boundary approximation.
    Definition gmshreader.hh:44
    \n-
    dimension independent parts for GmshReaderParser
    Definition gmshreader.hh:302
    \n-
    std::vector< std::string > & physicalEntityNames()
    Returns the names of the gmsh physical entities (0-based index)
    Definition gmshreader.hh:373
    \n-
    void pass1HandleElement(FILE *file, const int elm_type, std::map< int, unsigned int > &renumber, const std::vector< GlobalVector > &nodes)
    Process one element during the first pass through the list of all elements.
    Definition gmshreader.hh:545
    \n-
    static const int dimWorld
    Definition gmshreader.hh:321
    \n-
    Dune::GridFactory< GridType > & factory
    Definition gmshreader.hh:305
    \n-
    std::vector< int > & boundaryIdMap()
    Definition gmshreader.hh:361
    \n-
    void readfile(FILE *file, int cnt, const char *format,...)
    Definition gmshreader.hh:331
    \n-
    std::vector< int > & elementIndexMap()
    Returns a map for the gmsh physical entity id (1-based index) for each entity of codim 0.
    Definition gmshreader.hh:367
    \n-
    unsigned int number_of_real_vertices
    Definition gmshreader.hh:308
    \n-
    void boundarysegment_insert(const std::vector< FieldVector< double, 3 > > &nodes, const E &elementDofs, const V &vertices)
    Definition gmshreader.hh:608
    \n-
    GmshReaderParser(Dune::GridFactory< GridType > &_factory, bool v, bool i)
    Definition gmshreader.hh:358
    \n-
    int element_count
    Definition gmshreader.hh:310
    \n-
    void read(const std::string &f)
    Definition gmshreader.hh:378
    \n-
    void skipline(FILE *file)
    Definition gmshreader.hh:348
    \n-
    std::vector< int > element_index_to_physical_entity
    Definition gmshreader.hh:316
    \n-
    virtual void pass2HandleElement(FILE *file, const int elm_type, std::map< int, unsigned int > &renumber, const std::vector< GlobalVector > &nodes, const int physical_entity)
    Process one element during the second pass through the list of all elements.
    Definition gmshreader.hh:633
    \n-
    static const int dim
    Definition gmshreader.hh:320
    \n-
    FieldVector< double, dimWorld > GlobalVector
    Definition gmshreader.hh:325
    \n-
    std::string fileName
    Definition gmshreader.hh:313
    \n-
    std::vector< std::string > physical_entity_names
    Definition gmshreader.hh:317
    \n-
    int boundary_element_count
    Definition gmshreader.hh:309
    \n-
    void boundarysegment_insert(const V &, const E &, const V2 &)
    Definition gmshreader.hh:597
    \n-
    bool verbose
    Definition gmshreader.hh:306
    \n-
    std::vector< int > boundary_id_to_physical_entity
    Definition gmshreader.hh:315
    \n-
    char buf[512]
    Definition gmshreader.hh:312
    \n-
    bool insert_boundary_segments
    Definition gmshreader.hh:307
    \n-
    Read Gmsh mesh file.
    Definition gmshreader.hh:840
    \n-
    static std::unique_ptr< Grid > read(const std::string &fileName, std::vector< int > &boundarySegmentToPhysicalEntity, std::vector< int > &elementToPhysicalEntity, bool verbose=true, bool insertBoundarySegments=true)
    Read Gmsh file, possibly with data.
    Definition gmshreader.hh:966
    \n-
    const std::vector< int > & elementData() const
    Access element data (maps element index to Gmsh physical entity)
    Definition gmshreader.hh:1118
    \n-
    static void read(Dune::GridFactory< Grid > &factory, const std::string &fileName, DataFlagArg boundarySegmentData, DataArg elementData, bool verbose=true)
    read Gmsh file, possibly with data
    Definition gmshreader.hh:1016
    \n-
    static std::unique_ptr< Grid > read(const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
    Definition gmshreader.hh:937
    \n-
    static void read(Dune::GridFactory< Grid > &factory, const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
    Definition gmshreader.hh:983
    \n-
    GridType Grid
    Definition gmshreader.hh:929
    \n-
    std::unique_ptr< Grid > createGrid()
    Create the grid.
    Definition gmshreader.hh:1162
    \n-
    std::vector< int > extractBoundaryData()
    Erase boundary data from reader and return the data.
    Definition gmshreader.hh:1154
    \n-
    static void read(Dune::GridFactory< Grid > &factory, const std::string &fileName, std::vector< int > &boundarySegmentToPhysicalEntity, std::vector< int > &elementToPhysicalEntity, bool verbose, bool insertBoundarySegments)
    Read Gmsh file, possibly with data.
    Definition gmshreader.hh:1053
    \n-
    bool hasElementData() const
    If element data is available.
    Definition gmshreader.hh:1135
    \n-
    bool hasBoundaryData() const
    If boundary data is available.
    Definition gmshreader.hh:1142
    \n-
    static constexpr Opts defaultOpts
    Definition gmshreader.hh:1070
    \n-
    GmshReader(const std::string &fileName, GridFactory< Grid > &factory, Gmsh::ReaderOptions options=defaultOpts)
    Construct a Gmsh reader object from a file name and a grid factory.
    Definition gmshreader.hh:1111
    \n-
    GmshReader(const std::string &fileName, Gmsh::ReaderOptions options=defaultOpts)
    Construct a Gmsh reader object (alternatively use one of the static member functions)
    Definition gmshreader.hh:1097
    \n-
    std::vector< int > extractElementData()
    Erase element data from reader and return the data.
    Definition gmshreader.hh:1146
    \n-
    const std::vector< int > & boundaryData() const
    Access boundary data (maps boundary segment index to Gmsh physical entity)
    Definition gmshreader.hh:1125
    \n-
    Provide a generic factory class for unstructured grids.
    \n+
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n+
    Writer for 1D grids in gnuplot format.
    Definition gnuplot.hh:30
    \n+
    void write(const std::string &filename) const
    Write Gnuplot file to disk.
    Definition gnuplot.cc:19
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,1334 +2,139 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-gmshreader.hh\n+ * gnuplot\n+gnuplot.cc\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GMSHREADER_HH\n-7#define DUNE_GMSHREADER_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n-15#include \n-16#include \n-17#include \n-18#include \n-19#include \n-20\n-21#include \n-22#include \n-23\n-24#include \n-25\n-26#include \n-27#include \n+10#include \"../gnuplot.hh\"\n+11\n+12namespace Dune {\n+13\n+17 template\n+18 void\n+19 GnuplotWriter::write(const std::string& filename) const\n+20 {\n+21 // open file\n+22 std::ofstream file(filename.c_str());\n+23 // write all column names\n+24 file << \"# coord\\t\";\n+25 for (size_t i=0; i<_names.size(); i++)\n+26 file << _names[i] << \"\\t\";\n+27 file << \"\\n\";\n 28\n-29namespace Dune\n-30{\n-31\n-38 struct GmshReaderOptions\n-39 {\n-40 enum GeometryOrder {\n-42 firstOrder,\n-44 secondOrder\n-45 };\n-46 };\n-47\n-48 namespace {\n-49\n-50 // arbitrary dimension, implementation is in specialization\n-51 template< int dimension, int dimWorld = dimension >\n-52 class GmshReaderQuadraticBoundarySegment\n-53 {\n-54 public:\n-55 // empty function since this class does not implement anything\n-56 static void registerFactory() {}\n-57 };\n-58\n-59 // quadratic boundary segments in 1d\n-60 /*\n-61 Note the points\n+29 if (dimworld==1) {\n+30#if !NDEBUG\n+31 int counter = 0;\n+32#endif\n+33 typedef typename GridView::template Codim<0>::Iterator CellIterator;\n+34 CellIterator it = _gv.template begin<0>();\n+35 CellIterator end = _gv.template end<0>();\n+36 for (; it != end; ++it)\n+37 {\n+38 int i = _is.index(*it);\n+39 // check that the elements are numbered consecutively\n+40 assert (i == counter++);\n+41 // calc positions\n+42 assert(it->geometry().corners() == 2);\n+43 const FieldVector& left = it->geometry().corner(0);\n+44 const FieldVector& right = it->geometry().corner(1);\n+45 assert(left[0] < right[0]);\n+46 // write gnuplot rows for left & right vertex\n+47 writeRow(file, left, _data[2*i]);\n+48 writeRow(file, right, _data[2*i+1]);\n+49 }\n+50\n+51 } else {\n+52\n+53 typedef typename GridView::template Codim::Iterator\n+VertexIterator;\n+54 VertexIterator it = _gv.template begin();\n+55 VertexIterator end = _gv.template end();\n+56 for (; it != end; ++it) {\n+57\n+58 // write gnuplot rows for vertex\n+59 writeRow(file, it->geometry().corner(0), _data[_is.index(*it)]);\n+60\n+61 }\n 62\n-63 (0) (alpha) (1)\n+63 }\n 64\n-65 are mapped to the points in global coordinates\n+65 }\n 66\n-67 p0 p2 p1\n-68\n-69 alpha is determined automatically from the given points.\n-70 */\n-71 template< int dimWorld >\n-72 struct GmshReaderQuadraticBoundarySegment< 2, dimWorld >\n-73 : public Dune::BoundarySegment< 2, dimWorld >\n-74 {\n-75 typedef GmshReaderQuadraticBoundarySegment< 2, dimWorld > ThisType;\n-76 typedef typename Dune::BoundarySegment<_2,_dimWorld_> :: ObjectStreamType\n-ObjectStreamType;\n-77 typedef Dune::FieldVector< double, dimWorld > GlobalVector;\n-78\n-79 GmshReaderQuadraticBoundarySegment ( const GlobalVector &p0_, const\n-GlobalVector &p1_, const GlobalVector &p2_)\n-80 : p0(p0_), p1(p1_), p2(p2_)\n-81 {\n-82 init();\n-83 }\n-84\n-85 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )\n-86 {\n-87 // key is read before by the factory\n-88 const int bytes = sizeof(double)*dimWorld;\n-89 in.read( (char *) &p0[ 0 ], bytes );\n-90 in.read( (char *) &p1[ 0 ], bytes );\n-91 in.read( (char *) &p2[ 0 ], bytes );\n-92 init();\n-93 }\n-94\n-95 static void registerFactory()\n-96 {\n-97 if( key() < 0 )\n-98 {\n-99 key() = Dune::BoundarySegment<_2,_dimWorld_>::template registerFactory<\n-ThisType >();\n-100 }\n-101 }\n-102\n-103 virtual GlobalVector operator() ( const Dune::FieldVector &local\n-) const\n+67 template\n+68 void\n+69 GnuplotWriter::writeRow(std::ostream & file,\n+70 const FieldVector& position,\n+71 const std::vector & data) const\n+72 {\n+73 assert (data.size() == _names.size());\n+74 // write position\n+75 file << position << \"\\t\";\n+76 // write all data columns\n+77 for (size_t j=0; j\n+88 template\n+89 void\n+90 GnuplotWriter::addData(DataType t, const DataContainer& data,\n+const std::string & name)\n+91 {\n+92 assert((t == cellData && _is.size(0) == data.size())\n+93 || (t == vertexData && _is.size(GridView::dimension) == data.size()) );\n+94 _names.push_back(name);\n+95\n+96 // copy data to new container\n+97\n+98 if (dimworld==1) {\n+99\n+100 // data is transformed to nonconforming vertex data\n+101 int c = 0;\n+102 int shift = (t==vertexData ? 1 : 0);\n+103 for (size_t i=0; i<_is.size(0); i++)\n 104 {\n-105 GlobalVector y;\n-106 y = 0.0;\n-107 y.axpy((local[0]-alpha)*(local[0]-1.0)/alpha,p0);\n-108 y.axpy(local[0]*(local[0]-1.0)/(alpha*(alpha-1.0)),p1);\n-109 y.axpy(local[0]*(local[0]-alpha)/(1.0-alpha),p2);\n-110 return y;\n-111 }\n-112\n-113 void backup( ObjectStreamType& out ) const\n-114 {\n-115 // backup key to identify object\n-116 out.write( (const char *) &key(), sizeof( int ) );\n-117 // backup data\n-118 const int bytes = sizeof(double)*dimWorld;\n-119 out.write( (const char*) &p0[ 0 ], bytes );\n-120 out.write( (const char*) &p1[ 0 ], bytes );\n-121 out.write( (const char*) &p2[ 0 ], bytes );\n-122 }\n-123\n-124 protected:\n-125 void init()\n-126 {\n-127 GlobalVector d1 = p1;\n-128 d1 -= p0;\n-129 GlobalVector d2 = p2;\n-130 d2 -= p1;\n-131\n-132 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());\n-133 if (alpha<1E-6 || alpha>1-1E-6)\n-134 DUNE_THROW(Dune::IOError, \"ration in quadratic boundary segment bad\");\n-135 }\n-136\n-137 static int& key() {\n-138 static int k = -1;\n-139 return k;\n-140 }\n-141\n-142 private:\n-143 GlobalVector p0,p1,p2;\n-144 double alpha;\n-145 };\n-146\n-147\n-148 // quadratic boundary segments in 2d\n-149 /* numbering of points corresponding to gmsh:\n-150\n-151 2\n-152\n-153 5 4\n-154\n-155 0 3 1\n-156\n-157 Note: The vertices 3, 4, 5 are not necessarily at the edge midpoints but\n-can\n-158 be placed with parameters alpha, beta , gamma at the following positions\n-159 in local coordinates:\n-160\n-161\n-162 2 = (0,1)\n-163\n-164 5 = (0,beta) 4 = (1-gamma/sqrt(2),gamma/sqrt(2))\n-165\n-166 0 = (0,0) 3 = (alpha,0) 1 = (1,0)\n-167\n-168 The parameters alpha, beta, gamma are determined from the given vertices in\n-169 global coordinates.\n-170 */\n-171 template<>\n-172 class GmshReaderQuadraticBoundarySegment< 3, 3 >\n-173 : public Dune::BoundarySegment< 3 >\n-174 {\n-175 typedef GmshReaderQuadraticBoundarySegment< 3, 3 > ThisType;\n-176 typedef typename Dune::BoundarySegment<_3_> :: ObjectStreamType\n-ObjectStreamType;\n-177 public:\n-178 GmshReaderQuadraticBoundarySegment (Dune::FieldVector p0_, Dune::\n-FieldVector p1_,\n-179 Dune::FieldVector p2_, Dune::FieldVector p3_,\n-180 Dune::FieldVector p4_, Dune::FieldVector p5_)\n-181 : p0(p0_), p1(p1_), p2(p2_), p3(p3_), p4(p4_), p5(p5_)\n-182 {\n-183 init();\n-184 }\n-185\n-186 GmshReaderQuadraticBoundarySegment( ObjectStreamType& in )\n-187 {\n-188 const int bytes = sizeof(double)*3;\n-189 in.read( (char *) &p0[ 0 ], bytes );\n-190 in.read( (char *) &p1[ 0 ], bytes );\n-191 in.read( (char *) &p2[ 0 ], bytes );\n-192 in.read( (char *) &p3[ 0 ], bytes );\n-193 in.read( (char *) &p4[ 0 ], bytes );\n-194 in.read( (char *) &p5[ 0 ], bytes );\n-195 init();\n-196 }\n-197\n-198 static void registerFactory()\n-199 {\n-200 if( key() < 0 )\n-201 {\n-202 key() = Dune::BoundarySegment<_3_>::template registerFactory< ThisType >();\n-203 }\n-204 }\n-205\n-206 virtual Dune::FieldVector operator() (const Dune::\n-FieldVector& local) const\n-207 {\n-208 Dune::FieldVector y;\n-209 y = 0.0;\n-210 y.axpy(phi0(local),p0);\n-211 y.axpy(phi1(local),p1);\n-212 y.axpy(phi2(local),p2);\n-213 y.axpy(phi3(local),p3);\n-214 y.axpy(phi4(local),p4);\n-215 y.axpy(phi5(local),p5);\n-216 return y;\n-217 }\n-218\n-219 void backup( ObjectStreamType& out ) const\n-220 {\n-221 // backup key to identify object in factory\n-222 out.write( (const char*) &key(), sizeof( int ) );\n-223 // backup data\n-224 const int bytes = sizeof(double)*3;\n-225 out.write( (const char*) &p0[ 0 ], bytes );\n-226 out.write( (const char*) &p1[ 0 ], bytes );\n-227 out.write( (const char*) &p2[ 0 ], bytes );\n-228 out.write( (const char*) &p3[ 0 ], bytes );\n-229 out.write( (const char*) &p4[ 0 ], bytes );\n-230 out.write( (const char*) &p5[ 0 ], bytes );\n-231 }\n-232\n-233 protected:\n-234 void init()\n-235 {\n-236 using std::sqrt;\n-237 sqrt2 = sqrt(2.0);\n-238 Dune::FieldVector d1,d2;\n-239\n-240 d1 = p3; d1 -= p0;\n-241 d2 = p1; d2 -= p3;\n-242 alpha=d1.two_norm()/(d1.two_norm()+d2.two_norm());\n-243 if (alpha<1E-6 || alpha>1-1E-6)\n-244 DUNE_THROW(Dune::IOError, \"alpha in quadratic boundary segment bad\");\n-245\n-246 d1 = p5; d1 -= p0;\n-247 d2 = p2; d2 -= p5;\n-248 beta=d1.two_norm()/(d1.two_norm()+d2.two_norm());\n-249 if (beta<1E-6 || beta>1-1E-6)\n-250 DUNE_THROW(Dune::IOError, \"beta in quadratic boundary segment bad\");\n-251\n-252 d1 = p4; d1 -= p1;\n-253 d2 = p2; d2 -= p4;\n-254 gamma=sqrt2*(d1.two_norm()/(d1.two_norm()+d2.two_norm()));\n-255 if (gamma<1E-6 || gamma>1-1E-6)\n-256 DUNE_THROW(Dune::IOError, \"gamma in quadratic boundary segment bad\");\n-257 }\n-258\n-259 static int& key() {\n-260 static int k = -1;\n-261 return k;\n-262 }\n-263\n-264 private:\n-265 // The six Lagrange basis function on the reference element\n-266 // for the points given above\n-267\n-268 double phi0 (const Dune::FieldVector& local) const\n-269 {\n-270 return (alpha*beta-beta*local[0]-alpha*local[1])*(1-local[0]-local[1])/\n-(alpha*beta);\n-271 }\n-272 double phi3 (const Dune::FieldVector& local) const\n-273 {\n-274 return local[0]*(1-local[0]-local[1])/(alpha*(1-alpha));\n-275 }\n-276 double phi1 (const Dune::FieldVector& local) const\n-277 {\n-278 return local[0]*(gamma*local[0]-(sqrt2-gamma-sqrt2*alpha)*local[1]-\n-alpha*gamma)/(gamma*(1-alpha));\n-279 }\n-280 double phi5 (const Dune::FieldVector& local) const\n-281 {\n-282 return local[1]*(1-local[0]-local[1])/(beta*(1-beta));\n-283 }\n-284 double phi4 (const Dune::FieldVector& local) const\n-285 {\n-286 return local[0]*local[1]/((1-gamma/sqrt2)*gamma/sqrt2);\n-287 }\n-288 double phi2 (const Dune::FieldVector& local) const\n-289 {\n-290 return local[1]*(beta*(1-gamma/sqrt2)-local[0]*(beta-gamma/sqrt2)-local[1]*\n-(1-gamma/sqrt2))/((1-gamma/sqrt2)*(beta-1));\n-291 }\n-292\n-293 Dune::FieldVector p0,p1,p2,p3,p4,p5;\n-294 double alpha,beta,gamma,sqrt2;\n-295 };\n-296\n-297 } // end empty namespace\n-298\n-300 template\n-301 class GmshReaderParser\n-302 {\n-303 protected:\n-304 // private data\n-305 Dune::GridFactory& factory;\n-306 bool verbose;\n-307 bool insert_boundary_segments;\n-308 unsigned int number_of_real_vertices;\n-309 int boundary_element_count;\n-310 int element_count;\n-311 // read buffer\n-312 char buf[512];\n-313 std::string fileName;\n-314 // exported data\n-315 std::vector boundary_id_to_physical_entity;\n-316 std::vector element_index_to_physical_entity;\n-317 std::vector physical_entity_names;\n-318\n-319 // static data\n-320 static const int dim = GridType::dimension;\n-321 static const int dimWorld = GridType::dimensionworld;\n-322 static_assert( (dimWorld <= 3), \"GmshReader requires dimWorld <= 3.\" );\n-323\n-324 // typedefs\n-325 typedef FieldVector< double, dimWorld > GlobalVector;\n-326\n-327 // don't use something like\n-328 // readfile(file, 1, \"%s\\n\", buf);\n-329 // to skip the rest of of the line -- that will only skip the next\n-330 // whitespace-separated word! Use skipline() instead.\n-331 void readfile(FILE * file, int cnt, const char * format, ...)\n-332#ifdef __GNUC__\n-333 __attribute__((format(scanf, 4, 5)))\n-334#endif\n-335 {\n-336 std::va_list ap;\n-337 va_start(ap, format);\n-338 off_t pos = ftello(file);\n-339 int c = std::vfscanf(file, format, ap);\n-340 va_end(ap);\n-341 if (c != cnt)\n-342 DUNE_THROW(Dune::IOError, \"Error parsing \" << fileName << \" \"\n-343 \"file pos \" << pos\n-344 << \": Expected '\" << format << \"', only read \" << c << \" entries instead of\n-\" << cnt << \".\");\n-345 }\n-346\n-347 // skip over the rest of the line, including the terminating newline\n-348 void skipline(FILE * file)\n-349 {\n-350 int c;\n-351 do {\n-352 c = std::fgetc(file);\n-353 } while(c != '\\n' && c != EOF);\n-354 }\n-355\n-356 public:\n-357\n-358 GmshReaderParser(Dune::GridFactory& _factory, bool v, bool i) :\n-359 factory(_factory), verbose(v), insert_boundary_segments(i) {}\n-360\n-361 std::vector & boundaryIdMap()\n-362 {\n-363 return boundary_id_to_physical_entity;\n-364 }\n-365\n-367 std::vector & elementIndexMap()\n-368 {\n-369 return element_index_to_physical_entity;\n-370 }\n-371\n-373 std::vector & physicalEntityNames()\n-374 {\n-375 return physical_entity_names;\n-376 }\n-377\n-378 void read (const std::string& f)\n-379 {\n-380 if (verbose) std::cout << \"Reading \" << dim << \"d Gmsh grid...\" << std::\n-endl;\n-381\n-382 // open file name, we use C I/O\n-383 fileName = f;\n-384 FILE* file = fopen(fileName.c_str(),\"rb\");\n-385 if (file==0)\n-386 DUNE_THROW(Dune::IOError, \"Could not open \" << fileName);\n-387\n-388 //=========================================\n-389 // Header: Read vertices into vector\n-390 // Check vertices that are needed\n-391 //=========================================\n-392\n-393 number_of_real_vertices = 0;\n-394 boundary_element_count = 0;\n-395 element_count = 0;\n-396\n-397 // process header\n-398 double version_number;\n-399 int file_type, data_size;\n-400\n-401 readfile(file,1,\"%s\\n\",buf);\n-402 if (strcmp(buf,\"$MeshFormat\")!=0)\n-403 DUNE_THROW(Dune::IOError, \"expected $MeshFormat in first line\");\n-404 readfile(file,3,\"%lg %d %d\\n\",&version_number,&file_type,&data_size);\n-405 // 2.2 is not representable as float and leads to problems on i386\n-406 // Hence we use >= 2.00001.\n-407 if( (version_number < 2.0) || (version_number >= 2.20001) ) // 2.2 is not\n-representable as float and leads to problems on i386\n-408 DUNE_THROW(Dune::IOError, \"can only read Gmsh version 2 files\");\n-409 if (verbose) std::cout << \"version \" << version_number << \" Gmsh file\n-detected\" << std::endl;\n-410 readfile(file,1,\"%s\\n\",buf);\n-411 if (strcmp(buf,\"$EndMeshFormat\")!=0)\n-412 DUNE_THROW(Dune::IOError, \"expected $EndMeshFormat\");\n-413\n-414 // physical name section\n-415 physical_entity_names.clear();\n-416 readfile(file,1,\"%s\\n\",buf);\n-417 if (strcmp(buf,\"$PhysicalNames\")==0) {\n-418 int number_of_names;\n-419 readfile(file,1,\"%d\\n\",&number_of_names);\n-420 if (verbose) std::cout << \"file contains \" << number_of_names << \" physical\n-entities\" << std::endl;\n-421 physical_entity_names.resize(number_of_names);\n-422 std::string buf_name;\n-423 for( int i = 0; i < number_of_names; ++i ) {\n-424 int dim, id;\n-425 readfile(file,3, \"%d %d %s\\n\", &dim, &id, buf);\n-426 buf_name.assign(buf);\n-427 auto begin = buf_name.find_first_of('\\\"') + 1;\n-428 auto end = buf_name.find_last_of('\\\"') - begin;\n-429 physical_entity_names[id-1].assign(buf_name.substr(begin, end));\n-430 }\n-431 readfile(file,1,\"%s\\n\",buf);\n-432 if (strcmp(buf,\"$EndPhysicalNames\")!=0)\n-433 DUNE_THROW(Dune::IOError, \"expected $EndPhysicalNames\");\n-434 readfile(file,1,\"%s\\n\",buf);\n-435 }\n-436\n-437 // node section\n-438 int number_of_nodes;\n-439\n-440 if (strcmp(buf,\"$Nodes\")!=0)\n-441 DUNE_THROW(Dune::IOError, \"expected $Nodes\");\n-442 readfile(file,1,\"%d\\n\",&number_of_nodes);\n-443 if (verbose) std::cout << \"file contains \" << number_of_nodes << \" nodes\"\n-<< std::endl;\n-444\n-445 // read nodes\n-446 // The '+1' is due to the fact that gmsh numbers node starting from 1\n-rather than from 0\n-447 std::vector< GlobalVector > nodes( number_of_nodes+1 );\n-448 {\n-449 int id;\n-450 double x[ 3 ];\n-451 for( int i = 1; i <= number_of_nodes; ++i )\n-452 {\n-453 readfile(file,4, \"%d %lg %lg %lg\\n\", &id, &x[ 0 ], &x[ 1 ], &x[ 2 ] );\n-454\n-455 if (id > number_of_nodes) {\n-456 DUNE_THROW(Dune::IOError,\n-457 \"Only dense sequences of node indices are currently supported (node index \"\n-458 << id << \" is invalid).\");\n-459 }\n-460\n-461 // just store node position\n-462 for( int j = 0; j < dimWorld; ++j )\n-463 nodes[ id ][ j ] = x[ j ];\n-464 }\n-465 readfile(file,1,\"%s\\n\",buf);\n-466 if (strcmp(buf,\"$EndNodes\")!=0)\n-467 DUNE_THROW(Dune::IOError, \"expected $EndNodes\");\n-468 }\n-469\n-470 // element section\n-471 readfile(file,1,\"%s\\n\",buf);\n-472 if (strcmp(buf,\"$Elements\")!=0)\n-473 DUNE_THROW(Dune::IOError, \"expected $Elements\");\n-474 int number_of_elements;\n-475 readfile(file,1,\"%d\\n\",&number_of_elements);\n-476 if (verbose) std::cout << \"file contains \" << number_of_elements << \"\n-elements\" << std::endl;\n-477\n-478 //=========================================\n-479 // Pass 1: Select and insert those vertices in the file that\n-480 // actually occur as corners of an element.\n-481 //=========================================\n-482\n-483 off_t section_element_offset = ftello(file);\n-484 std::map renumber;\n-485 for (int i=1; i<=number_of_elements; i++)\n-486 {\n-487 int id, elm_type, number_of_tags;\n-488 readfile(file,3,\"%d %d %d \",&id,&elm_type,&number_of_tags);\n-489 for (int k=1; k<=number_of_tags; k++)\n-490 {\n-491 int blub;\n-492 readfile(file,1,\"%d \",&blub);\n-493 // k == 1: physical entity\n-494 // k == 2: elementary entity (not used here)\n-495 // if version_number < 2.2:\n-496 // k == 3: mesh partition 0\n-497 // else\n-498 // k == 3: number of mesh partitions\n-499 // k => 4: mesh partition k-4\n-500 }\n-501 pass1HandleElement(file, elm_type, renumber, nodes);\n-502 }\n-503 if (verbose) std::cout << \"number of real vertices = \" << number_of_real_\n-vertices << std::endl;\n-504 if (verbose) std::cout << \"number of boundary elements = \" << boundary_\n-element_count << std::endl;\n-505 if (verbose) std::cout << \"number of elements = \" << element_count << std::\n-endl;\n-506 readfile(file,1,\"%s\\n\",buf);\n-507 if (strcmp(buf,\"$EndElements\")!=0)\n-508 DUNE_THROW(Dune::IOError, \"expected $EndElements\");\n-509 boundary_id_to_physical_entity.resize(boundary_element_count);\n-510 element_index_to_physical_entity.resize(element_count);\n-511\n-512 //==============================================\n-513 // Pass 2: Insert boundary segments and elements\n-514 //==============================================\n-515\n-516 fseeko(file, section_element_offset, SEEK_SET);\n-517 boundary_element_count = 0;\n-518 element_count = 0;\n-519 for (int i=1; i<=number_of_elements; i++)\n-520 {\n-521 int id, elm_type, number_of_tags;\n-522 readfile(file,3,\"%d %d %d \",&id,&elm_type,&number_of_tags);\n-523 int physical_entity = -1;\n-524\n-525 for (int k=1; k<=number_of_tags; k++)\n-526 {\n-527 int blub;\n-528 readfile(file,1,\"%d \",&blub);\n-529 if (k==1) physical_entity = blub;\n-530 }\n-531 pass2HandleElement(file, elm_type, renumber, nodes, physical_entity);\n-532 }\n-533 readfile(file,1,\"%s\\n\",buf);\n-534 if (strcmp(buf,\"$EndElements\")!=0)\n-535 DUNE_THROW(Dune::IOError, \"expected $EndElements\");\n-536\n-537 fclose(file);\n-538 }\n-539\n-545 void pass1HandleElement(FILE* file, const int elm_type,\n-546 std::map & renumber,\n-547 const std::vector< GlobalVector > & nodes)\n-548 {\n-549 // some data about gmsh elements\n-550 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1,\n-1};\n-551 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -\n-1, 1};\n-552 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -\n-1, 0};\n-553\n-554 // test whether we support the element type\n-555 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?\n-556 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) /\n-/ real element or boundary element?\n-557 {\n-558 skipline(file); // skip rest of line if element is unknown\n-559 return;\n-560 }\n-561\n-562 // The format string for parsing is n times '%d' in a row\n-563 std::string formatString = \"%d\";\n-564 for (int i=1; i elementDofs(10);\n-570\n-571 readfile(file,nDofs[elm_type], formatString.c_str(),\n-572 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),\n-573 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),\n-574 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),\n-575 &(elementDofs[9]));\n-576\n-577 // insert each vertex if it hasn't been inserted already\n-578 for (int i=0; i\n-597 void boundarysegment_insert(\n-598 const V&,\n-599 const E&,\n-600 const V2&\n-601 )\n-602 {\n-603 DUNE_THROW(Dune::IOError, \"tried to create a 3D boundary segment in a non-\n-3D Grid\");\n-604 }\n-605\n-606 // 3d-case:\n-607 template \n-608 void boundarysegment_insert(\n-609 const std::vector >& nodes,\n-610 const E& elementDofs,\n-611 const V& vertices\n-612 )\n-613 {\n-614 std::array, 6> v;\n-615 for (int i=0; i<6; i++)\n-616 for (int j=0; j* newBoundarySegment\n-620 = (BoundarySegment*) new GmshReaderQuadraticBoundarySegment<\n-3, 3 >( v[0], v[1], v[2],\n-621 v[3], v[4], v[5] );\n-622\n-623 factory.insertBoundarySegment( vertices,\n-624 std::shared_ptr >(newBoundarySegment) );\n-625 }\n-626\n-627\n-628\n-633 virtual void pass2HandleElement(FILE* file, const int elm_type,\n-634 std::map & renumber,\n-635 const std::vector< GlobalVector > & nodes,\n-636 const int physical_entity)\n-637 {\n-638 // some data about gmsh elements\n-639 const int nDofs[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 3, 6, -1, 10, -1, -1, -1,\n-1};\n-640 const int nVertices[16] = {-1, 2, 3, 4, 4, 8, 6, 5, 2, 3, -1, 4, -1, -1, -\n-1, 1};\n-641 const int elementDim[16] = {-1, 1, 2, 2, 3, 3, 3, 3, 1, 2, -1, 3, -1, -1, -\n-1, 0};\n-642\n-643 // test whether we support the element type\n-644 if ( not (elm_type > 0 && elm_type <= 15 // index in suitable range?\n-645 && (elementDim[elm_type] == dim || elementDim[elm_type] == (dim-1) ) ) ) /\n-/ real element or boundary element?\n-646 {\n-647 skipline(file); // skip rest of line if element is unknown\n-648 return;\n-649 }\n-650\n-651 // The format string for parsing is n times '%d' in a row\n-652 std::string formatString = \"%d\";\n-653 for (int i=1; i elementDofs(10);\n-659\n-660 readfile(file,nDofs[elm_type], formatString.c_str(),\n-661 &(elementDofs[0]),&(elementDofs[1]),&(elementDofs[2]),\n-662 &(elementDofs[3]),&(elementDofs[4]),&(elementDofs[5]),\n-663 &(elementDofs[6]),&(elementDofs[7]),&(elementDofs[8]),\n-664 &(elementDofs[9]));\n-665\n-666 // correct differences between gmsh and Dune in the local vertex numbering\n-667 switch (elm_type)\n-668 {\n-669 case 3 : // 4-node quadrilateral\n-670 std::swap(elementDofs[2],elementDofs[3]);\n-671 break;\n-672 case 5 : // 8-node hexahedron\n-673 std::swap(elementDofs[2],elementDofs[3]);\n-674 std::swap(elementDofs[6],elementDofs[7]);\n-675 break;\n-676 case 7 : // 5-node pyramid\n-677 std::swap(elementDofs[2],elementDofs[3]);\n-678 break;\n-679 }\n-680\n-681 // renumber corners to account for the explicitly given vertex\n-682 // numbering in the file\n-683 std::vector vertices(nVertices[elm_type]);\n-684\n-685 for (int i=0; i, 3> v;\n-746 for (int i=0; i* newBoundarySegment\n-752 = (BoundarySegment*) new GmshReaderQuadraticBoundarySegment<\n-2, dimWorld >(v[0], v[1], v[2]);\n-753 factory.insertBoundarySegment(vertices,\n-754 std::shared_ptr >(newBoundarySegment));\n-755 break;\n-756 }\n-757 case 9 : { // 6-node triangle\n-758 boundarysegment_insert(nodes, elementDofs, vertices);\n-759 break;\n-760 }\n-761 default: {\n-762 DUNE_THROW(Dune::IOError, \"GmshReader does not support using element-type \"\n-<< elm_type << \" for boundary segments\");\n-763 break;\n-764 }\n-765\n-766 }\n-767\n-768 }\n-769 }\n-770\n-771 // count elements and boundary elements\n-772 if (elementDim[elm_type] == dim) {\n-773 element_index_to_physical_entity[element_count] = physical_entity;\n-774 element_count++;\n-775 } else {\n-776 boundary_id_to_physical_entity[boundary_element_count] = physical_entity;\n-777 boundary_element_count++;\n-778 }\n-779\n-780 }\n-781\n-782 };\n-783\n-784 namespace Gmsh {\n-790 enum class ReaderOptions\n-791 {\n-792 verbose = 1,\n-793 insertBoundarySegments = 2,\n-794 readElementData = 4,\n-795 readBoundaryData = 8\n-796 };\n-797\n-799 constexpr ReaderOptions operator_|_(ReaderOptions a, ReaderOptions b)\n-800 {\n-801 return static_cast(\n-802 static_cast(a) | static_cast(b)\n-803 );\n-804 }\n-805\n-807 constexpr bool operator_&_(ReaderOptions a, ReaderOptions b)\n-808 {\n-809 return static_cast(a) & static_cast(b);\n-810 }\n-811\n-812 } // end namespace Gmsh\n-813\n-838 template\n-839 class GmshReader\n-840 {\n-842\n-861 static void doRead(Dune::GridFactory &factory,\n-862 const std::string &fileName,\n-863 std::vector& boundarySegmentToPhysicalEntity,\n-864 std::vector& elementToPhysicalEntity,\n-865 bool verbose, bool insertBoundarySegments)\n-866 {\n-867 // register boundary segment to boundary segment factory for possible load\n-balancing\n-868 // this needs to be done on all cores since the type might not be known\n-otherwise\n-869 GmshReaderQuadraticBoundarySegment< Grid::dimension, Grid::dimensionworld\n->::registerFactory();\n-870\n-871#ifndef NDEBUG\n-872 // check that this method is called on all cores\n-873 factory.comm().barrier();\n-874#endif\n-875\n-876 // create parse object and read grid on process 0\n-877 if (factory.comm().rank() == 0)\n-878 {\n-879 GmshReaderParser parser(factory,verbose,insertBoundarySegments);\n-880 parser.read(fileName);\n-881\n-882 boundarySegmentToPhysicalEntity = std::move(parser.boundaryIdMap());\n-883 elementToPhysicalEntity = std::move(parser.elementIndexMap());\n-884 }\n-885 else\n-886 {\n-887 boundarySegmentToPhysicalEntity = {};\n-888 elementToPhysicalEntity = {};\n-889 }\n-890 }\n-891\n-893\n-912 template\n-913 static T &discarded(T &&value) { return static_cast(value); }\n-914\n-915 struct DataArg {\n-916 std::vector *data_ = nullptr;\n-917 DataArg(std::vector &data) : data_(&data) {}\n-918 DataArg(const decltype(std::ignore)&) {}\n-919 DataArg() = default;\n-920 };\n-921\n-922 struct DataFlagArg : DataArg {\n-923 bool flag_ = false;\n-924 using DataArg::DataArg;\n-925 DataFlagArg(bool flag) : flag_(flag) {}\n-926 };\n-927\n-928 public:\n-929 typedef GridType Grid;\n-930\n-937 static std::unique_ptr read (const std::string& fileName, bool\n-verbose = true, bool insertBoundarySegments=true)\n-938 {\n-939 // make a grid factory\n-940 Dune::GridFactory factory;\n-941\n-942 read(factory, fileName, verbose, insertBoundarySegments);\n-943\n-944 return factory.createGrid();\n-945 }\n-946\n-966 static std::unique_ptr read (const std::string& fileName,\n-967 std::vector& boundarySegmentToPhysicalEntity,\n-968 std::vector& elementToPhysicalEntity,\n-969 bool verbose = true, bool insertBoundarySegments=true)\n-970 {\n-971 // make a grid factory\n-972 Dune::GridFactory factory;\n-973\n-974 doRead(\n-975 factory, fileName, boundarySegmentToPhysicalEntity,\n-976 elementToPhysicalEntity, verbose, insertBoundarySegments\n-977 );\n-978\n-979 return factory.createGrid();\n-980 }\n-981\n-983 static void read (Dune::GridFactory& factory, const std::string&\n-fileName,\n-984 bool verbose = true, bool insertBoundarySegments=true)\n-985 {\n-986 doRead(\n-987 factory, fileName, discarded(std::vector{}),\n-988 discarded(std::vector{}), verbose, insertBoundarySegments\n-989 );\n-990 }\n-991\n-993\n-1016 static void read (Dune::GridFactory &factory,\n-1017 const std::string &fileName,\n-1018 DataFlagArg boundarySegmentData,\n-1019 DataArg elementData,\n-1020 bool verbose=true)\n-1021 {\n-1022 doRead(\n-1023 factory, fileName,\n-1024 boundarySegmentData.data_\n-1025 ? *boundarySegmentData.data_ : discarded(std::vector{}),\n-1026 elementData.data_\n-1027 ? *elementData.data_ : discarded(std::vector{}),\n-1028 verbose,\n-1029 boundarySegmentData.flag_ || boundarySegmentData.data_\n-1030 );\n-1031 }\n-1032\n-1053 static void read (Dune::GridFactory& factory,\n-1054 const std::string& fileName,\n-1055 std::vector& boundarySegmentToPhysicalEntity,\n-1056 std::vector& elementToPhysicalEntity,\n-1057 bool verbose, bool insertBoundarySegments)\n-1058 {\n-1059 doRead(\n-1060 factory, fileName, boundarySegmentToPhysicalEntity,\n-1061 elementToPhysicalEntity, verbose, insertBoundarySegments\n-1062 );\n-1063 }\n-1064\n-1066 //\\{\n-1067\n-1068 using Opts = Gmsh::ReaderOptions;\n-1069\n-1070 static constexpr Opts defaultOpts =\n-1071 Opts::verbose | Opts::insertBoundarySegments | Opts::readElementData |\n-Opts::readBoundaryData;\n-1072\n-1074\n-1097 GmshReader(const std::string& fileName,\n-1098 Gmsh::ReaderOptions options = defaultOpts)\n-1099 {\n-1100 gridFactory_ = std::make_unique>();\n-1101 readGridFile(fileName, *gridFactory_, options);\n-1102 }\n-1103\n-1111 GmshReader(const std::string& fileName, GridFactory& factory,\n-1112 Gmsh::ReaderOptions options = defaultOpts)\n-1113 {\n-1114 readGridFile(fileName, factory, options);\n-1115 }\n-1116\n-1118 const std::vector& elementData () const\n-1119 {\n-1120 checkElementData();\n-1121 return elementIndexToGmshPhysicalEntity_;\n-1122 }\n-1123\n-1125 const std::vector& boundaryData () const\n-1126 {\n-1127 checkBoundaryData();\n-1128 return boundarySegmentIndexToGmshPhysicalEntity_;\n-1129 }\n-1130\n-1135 bool hasElementData () const\n-1136 { return hasElementData_ && !extractedElementData_; }\n-1137\n-1142 bool hasBoundaryData () const\n-1143 { return hasBoundaryData_ && !extractedBoundaryData_; }\n-1144\n-1146 std::vector extractElementData ()\n-1147 {\n-1148 checkElementData();\n-1149 extractedElementData_ = true;\n-1150 return std::move(elementIndexToGmshPhysicalEntity_);\n-1151 }\n-1152\n-1154 std::vector extractBoundaryData ()\n-1155 {\n-1156 checkBoundaryData();\n-1157 extractedBoundaryData_ = true;\n-1158 return std::move(boundarySegmentIndexToGmshPhysicalEntity_);\n-1159 }\n-1160\n-1162 std::unique_ptr createGrid ()\n-1163 {\n-1164 if (!gridFactory_)\n-1165 DUNE_THROW(Dune::InvalidStateException,\n-1166 \"This GmshReader has been constructed with a Dune::GridFactory. \"\n-1167 << \"This grid factory has been filled with all information to create a\n-grid. \"\n-1168 << \"Please use this factory to create the grid by calling\n-factory.createGrid(). \"\n-1169 << \"Alternatively use the constructor without passing the factory in\n-combination with this member function.\"\n-1170 );\n-1171\n-1172 return gridFactory_->createGrid();\n-1173 }\n-1174\n-1175 //\\}\n-1176\n-1177 private:\n-1178 void checkElementData () const\n-1179 {\n-1180 if (!hasElementData_)\n-1181 DUNE_THROW(Dune::InvalidStateException,\n-1182 \"This GmshReader has been constructed without the option\n-'readElementData'. \"\n-1183 << \"Please enable reading element data by passing the option 'Gmsh::\n-ReaderOpts::readElementData' \"\n-1184 << \"to the constructor of this class.\"\n-1185 );\n-1186\n-1187 if (extractedElementData_)\n-1188 DUNE_THROW(Dune::InvalidStateException,\n-1189 \"The element data has already been extracted from this GmshReader \"\n-1190 << \"via a function call to reader.extractElementData(). Use the extracted\n-data or \"\n-1191 << \"read the grid data from file again by constructing a new reader.\"\n-1192 );\n-1193 }\n-1194\n-1195 void checkBoundaryData () const\n-1196 {\n-1197 if (!hasBoundaryData_)\n-1198 DUNE_THROW(Dune::InvalidStateException,\n-1199 \"This GmshReader has been constructed without the option\n-'readBoundaryData'. \"\n-1200 << \"Please enable reading boundary data by passing the option 'Gmsh::\n-ReaderOpts::readBoundaryData' \"\n-1201 << \"to the constructor of this class.\"\n-1202 );\n-1203\n-1204 if (extractedBoundaryData_)\n-1205 DUNE_THROW(Dune::InvalidStateException,\n-1206 \"The boundary data has already been extracted from this GmshReader \"\n-1207 << \"via a function call to reader.extractBoundaryData(). Use the extracted\n-data or \"\n-1208 << \"read the grid data from file again by constructing a new reader.\"\n-1209 );\n-1210 }\n-1211\n-1212 void readGridFile (const std::string& fileName, GridFactory&\n-factory, Gmsh::ReaderOptions options)\n-1213 {\n-1214 const bool verbose = options & Opts::verbose;\n-1215 const bool insertBoundarySegments = options & Opts::\n-insertBoundarySegments;\n-1216 const bool readBoundaryData = options & Opts::readBoundaryData;\n-1217 const bool readElementData = options & Opts::readElementData;\n-1218\n-1219 doRead(\n-1220 factory, fileName, boundarySegmentIndexToGmshPhysicalEntity_,\n-1221 elementIndexToGmshPhysicalEntity_, verbose,\n-1222 readBoundaryData || insertBoundarySegments\n-1223 );\n-1224\n-1225 // clear unwanted data\n-1226 if (!readBoundaryData)\n-1227 boundarySegmentIndexToGmshPhysicalEntity_ = std::vector{};\n-1228 if (!readElementData)\n-1229 elementIndexToGmshPhysicalEntity_ = std::vector{};\n-1230\n-1231 hasElementData_ = readElementData;\n-1232 hasBoundaryData_ = readBoundaryData;\n-1233 }\n-1234\n-1235 std::unique_ptr> gridFactory_;\n-1236\n-1237 std::vector elementIndexToGmshPhysicalEntity_;\n-1238 std::vector boundarySegmentIndexToGmshPhysicalEntity_;\n-1239\n-1240 bool hasElementData_;\n-1241 bool hasBoundaryData_;\n-1242\n-1243 // for better error messages, we keep track of these separately\n-1244 bool extractedElementData_ = false;\n-1245 bool extractedBoundaryData_ = false;\n-1246 };\n-1247\n-1250} // namespace Dune\n-1251\n-1252#endif\n-boundarysegment.hh\n-Base class for grid boundary segments of arbitrary geometry.\n-Dune::Gmsh::ReaderOptions\n-ReaderOptions\n-Option for the Gmsh mesh file reader.\n-Definition gmshreader.hh:791\n-Dune::Gmsh::ReaderOptions::verbose\n-@ verbose\n-Dune::Gmsh::ReaderOptions::readBoundaryData\n-@ readBoundaryData\n-Dune::Gmsh::ReaderOptions::readElementData\n-@ readElementData\n-Dune::Gmsh::ReaderOptions::insertBoundarySegments\n-@ insertBoundarySegments\n-std::swap\n-void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n-> &b)\n-Definition utility/persistentcontainer.hh:83\n+105 _data[c++].push_back(data[i]);\n+106 _data[c++].push_back(data[i+shift]);\n+107 };\n+108\n+109 } else {\n+110\n+111 // 2d: only vertex data is allowed\n+112 for (size_t i=0; i<_is.size(dimworld); i++)\n+113 _data[i].push_back(data[i]);\n+114\n+115 }\n+116\n+117 }\n+118\n+119}\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::GlobalVector\n-ALBERTA REAL_D GlobalVector\n-Definition misc.hh:50\n-Dune::Gmsh::operator&\n-constexpr bool operator&(ReaderOptions a, ReaderOptions b)\n-query operator for reader options (is b set in a)\n-Definition gmshreader.hh:807\n-Dune::Gmsh::operator|\n-constexpr ReaderOptions operator|(ReaderOptions a, ReaderOptions b)\n-composition operator for reader options\n-Definition gmshreader.hh:799\n-Dune::BoundarySegment\n-Base class for classes implementing geometries of boundary segments.\n-Definition boundarysegment.hh:94\n-Dune::GridFactoryInterface::comm\n-Communication comm() const\n-Return the Communication used by the grid factory.\n-Definition common/gridfactory.hh:258\n-Dune::GridFactory\n-Provide a generic factory class for unstructured grids.\n-Definition common/gridfactory.hh:275\n-Dune::GridFactory::createGrid\n-virtual std::unique_ptr< GridType > createGrid()\n-Finalize grid creation and hand over the grid.\n-Definition common/gridfactory.hh:333\n-Dune::GmshReaderOptions\n-Options for read operation.\n-Definition gmshreader.hh:39\n-Dune::GmshReaderOptions::GeometryOrder\n-GeometryOrder\n-Definition gmshreader.hh:40\n-Dune::GmshReaderOptions::firstOrder\n-@ firstOrder\n-edges are straight lines.\n-Definition gmshreader.hh:42\n-Dune::GmshReaderOptions::secondOrder\n-@ secondOrder\n-quadratic boundary approximation.\n-Definition gmshreader.hh:44\n-Dune::GmshReaderParser\n-dimension independent parts for GmshReaderParser\n-Definition gmshreader.hh:302\n-Dune::GmshReaderParser::physicalEntityNames\n-std::vector< std::string > & physicalEntityNames()\n-Returns the names of the gmsh physical entities (0-based index)\n-Definition gmshreader.hh:373\n-Dune::GmshReaderParser::pass1HandleElement\n-void pass1HandleElement(FILE *file, const int elm_type, std::map< int, unsigned\n-int > &renumber, const std::vector< GlobalVector > &nodes)\n-Process one element during the first pass through the list of all elements.\n-Definition gmshreader.hh:545\n-Dune::GmshReaderParser::dimWorld\n-static const int dimWorld\n-Definition gmshreader.hh:321\n-Dune::GmshReaderParser::factory\n-Dune::GridFactory< GridType > & factory\n-Definition gmshreader.hh:305\n-Dune::GmshReaderParser::boundaryIdMap\n-std::vector< int > & boundaryIdMap()\n-Definition gmshreader.hh:361\n-Dune::GmshReaderParser::readfile\n-void readfile(FILE *file, int cnt, const char *format,...)\n-Definition gmshreader.hh:331\n-Dune::GmshReaderParser::elementIndexMap\n-std::vector< int > & elementIndexMap()\n-Returns a map for the gmsh physical entity id (1-based index) for each entity\n-of codim 0.\n-Definition gmshreader.hh:367\n-Dune::GmshReaderParser::number_of_real_vertices\n-unsigned int number_of_real_vertices\n-Definition gmshreader.hh:308\n-Dune::GmshReaderParser::boundarysegment_insert\n-void boundarysegment_insert(const std::vector< FieldVector< double, 3 > >\n-&nodes, const E &elementDofs, const V &vertices)\n-Definition gmshreader.hh:608\n-Dune::GmshReaderParser::GmshReaderParser\n-GmshReaderParser(Dune::GridFactory< GridType > &_factory, bool v, bool i)\n-Definition gmshreader.hh:358\n-Dune::GmshReaderParser::element_count\n-int element_count\n-Definition gmshreader.hh:310\n-Dune::GmshReaderParser::read\n-void read(const std::string &f)\n-Definition gmshreader.hh:378\n-Dune::GmshReaderParser::skipline\n-void skipline(FILE *file)\n-Definition gmshreader.hh:348\n-Dune::GmshReaderParser::element_index_to_physical_entity\n-std::vector< int > element_index_to_physical_entity\n-Definition gmshreader.hh:316\n-Dune::GmshReaderParser::pass2HandleElement\n-virtual void pass2HandleElement(FILE *file, const int elm_type, std::map< int,\n-unsigned int > &renumber, const std::vector< GlobalVector > &nodes, const int\n-physical_entity)\n-Process one element during the second pass through the list of all elements.\n-Definition gmshreader.hh:633\n-Dune::GmshReaderParser::dim\n-static const int dim\n-Definition gmshreader.hh:320\n-Dune::GmshReaderParser::GlobalVector\n-FieldVector< double, dimWorld > GlobalVector\n-Definition gmshreader.hh:325\n-Dune::GmshReaderParser::fileName\n-std::string fileName\n-Definition gmshreader.hh:313\n-Dune::GmshReaderParser::physical_entity_names\n-std::vector< std::string > physical_entity_names\n-Definition gmshreader.hh:317\n-Dune::GmshReaderParser::boundary_element_count\n-int boundary_element_count\n-Definition gmshreader.hh:309\n-Dune::GmshReaderParser::boundarysegment_insert\n-void boundarysegment_insert(const V &, const E &, const V2 &)\n-Definition gmshreader.hh:597\n-Dune::GmshReaderParser::verbose\n-bool verbose\n-Definition gmshreader.hh:306\n-Dune::GmshReaderParser::boundary_id_to_physical_entity\n-std::vector< int > boundary_id_to_physical_entity\n-Definition gmshreader.hh:315\n-Dune::GmshReaderParser::buf\n-char buf[512]\n-Definition gmshreader.hh:312\n-Dune::GmshReaderParser::insert_boundary_segments\n-bool insert_boundary_segments\n-Definition gmshreader.hh:307\n-Dune::GmshReader\n-Read Gmsh mesh file.\n-Definition gmshreader.hh:840\n-Dune::GmshReader::read\n-static std::unique_ptr< Grid > read(const std::string &fileName, std::vector<\n-int > &boundarySegmentToPhysicalEntity, std::vector< int >\n-&elementToPhysicalEntity, bool verbose=true, bool insertBoundarySegments=true)\n-Read Gmsh file, possibly with data.\n-Definition gmshreader.hh:966\n-Dune::GmshReader::elementData\n-const std::vector< int > & elementData() const\n-Access element data (maps element index to Gmsh physical entity)\n-Definition gmshreader.hh:1118\n-Dune::GmshReader::read\n-static void read(Dune::GridFactory< Grid > &factory, const std::string\n-&fileName, DataFlagArg boundarySegmentData, DataArg elementData, bool\n-verbose=true)\n-read Gmsh file, possibly with data\n-Definition gmshreader.hh:1016\n-Dune::GmshReader::read\n-static std::unique_ptr< Grid > read(const std::string &fileName, bool\n-verbose=true, bool insertBoundarySegments=true)\n-Definition gmshreader.hh:937\n-Dune::GmshReader::read\n-static void read(Dune::GridFactory< Grid > &factory, const std::string\n-&fileName, bool verbose=true, bool insertBoundarySegments=true)\n-Definition gmshreader.hh:983\n-Dune::GmshReader::Grid\n-GridType Grid\n-Definition gmshreader.hh:929\n-Dune::GmshReader::createGrid\n-std::unique_ptr< Grid > createGrid()\n-Create the grid.\n-Definition gmshreader.hh:1162\n-Dune::GmshReader::extractBoundaryData\n-std::vector< int > extractBoundaryData()\n-Erase boundary data from reader and return the data.\n-Definition gmshreader.hh:1154\n-Dune::GmshReader::read\n-static void read(Dune::GridFactory< Grid > &factory, const std::string\n-&fileName, std::vector< int > &boundarySegmentToPhysicalEntity, std::vector<\n-int > &elementToPhysicalEntity, bool verbose, bool insertBoundarySegments)\n-Read Gmsh file, possibly with data.\n-Definition gmshreader.hh:1053\n-Dune::GmshReader::hasElementData\n-bool hasElementData() const\n-If element data is available.\n-Definition gmshreader.hh:1135\n-Dune::GmshReader::hasBoundaryData\n-bool hasBoundaryData() const\n-If boundary data is available.\n-Definition gmshreader.hh:1142\n-Dune::GmshReader::defaultOpts\n-static constexpr Opts defaultOpts\n-Definition gmshreader.hh:1070\n-Dune::GmshReader::GmshReader\n-GmshReader(const std::string &fileName, GridFactory< Grid > &factory, Gmsh::\n-ReaderOptions options=defaultOpts)\n-Construct a Gmsh reader object from a file name and a grid factory.\n-Definition gmshreader.hh:1111\n-Dune::GmshReader::GmshReader\n-GmshReader(const std::string &fileName, Gmsh::ReaderOptions\n-options=defaultOpts)\n-Construct a Gmsh reader object (alternatively use one of the static member\n-functions)\n-Definition gmshreader.hh:1097\n-Dune::GmshReader::extractElementData\n-std::vector< int > extractElementData()\n-Erase element data from reader and return the data.\n-Definition gmshreader.hh:1146\n-Dune::GmshReader::boundaryData\n-const std::vector< int > & boundaryData() const\n-Access boundary data (maps boundary segment index to Gmsh physical entity)\n-Definition gmshreader.hh:1125\n-gridfactory.hh\n-Provide a generic factory class for unstructured grids.\n+Dune::GridView::Codim\n+A struct that collects all associated types of one implementation from the\n+Traits class.\n+Definition common/gridview.hh:104\n+Dune::GnuplotWriter\n+Writer for 1D grids in gnuplot format.\n+Definition gnuplot.hh:30\n+Dune::GnuplotWriter::write\n+void write(const std::string &filename) const\n+Write Gnuplot file to disk.\n+Definition gnuplot.cc:19\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00767.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00767.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gnuplot.hh File Reference\n+dune-grid: vtk.hh File Reference\n \n \n \n \n \n \n \n@@ -69,54 +69,29 @@\n \n
    \n \n
    \n
    \n
    \n- \n-
    gnuplot.hh File Reference
    \n+
    vtk.hh File Reference
    \n
    \n
    \n \n-

    Provides gnuplot output for 1D Grids. \n+

    Convenience header which includes all available VTK writers. \n More...

    \n-
    #include <vector>
    \n-#include <string>
    \n-#include <iostream>
    \n-#include <fstream>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/grid/common/grid.hh>
    \n-#include "gnuplot/gnuplot.cc"
    \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::GnuplotWriter< GridView >
     Writer for 1D grids in gnuplot format. More...
     
    class  Dune::LeafGnuplotWriter< G >
     GnuplotWriter on the leaf grid. More...
     
    class  Dune::LevelGnuplotWriter< G >
     GnuplotWriter on a given level grid. More...
     
    \n-\n-\n-\n-\n-

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    Provides gnuplot output for 1D Grids.

    \n-
    Author
    Christian Engwer
    \n+

    Convenience header which includes all available VTK writers.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,38 +2,19 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-Classes | Namespaces\n-gnuplot.hh File Reference\n-Provides gnuplot output for 1D Grids. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \"gnuplot/gnuplot.cc\"\n+vtk.hh File Reference\n+Convenience header which includes all available VTK writers. More...\n+#include \"vtk/boundarywriter.hh\"\n+#include \"vtk/subsamplingvtkwriter.hh\"\n+#include \"vtk/vtksequencewriter.hh\"\n+#include \"vtk/vtkwriter.hh\"\n+#include \"vtk/volumewriter.hh\"\n Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::GnuplotWriter<_GridView_>\n-\u00a0 Writer for 1D grids in gnuplot format. More...\n-\u00a0\n-class \u00a0 Dune::LeafGnuplotWriter<_G_>\n-\u00a0 GnuplotWriter on the leaf grid. More...\n-\u00a0\n-class \u00a0 Dune::LevelGnuplotWriter<_G_>\n-\u00a0 GnuplotWriter on a given level grid. More...\n-\u00a0\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n ***** Detailed Description *****\n-Provides gnuplot output for 1D Grids.\n- Author\n- Christian Engwer\n+Convenience header which includes all available VTK writers.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00767_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00767_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gnuplot.hh Source File\n+dune-grid: vtk.hh Source File\n \n \n \n \n \n \n \n@@ -74,137 +74,37 @@\n \n
    \n \n
    \n
    \n
    \n-
    gnuplot.hh
    \n+
    vtk.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_IO_GNUPLOT_HH
    \n-
    6#define DUNE_IO_GNUPLOT_HH
    \n-
    7
    \n-
    13#include <vector>
    \n-
    14#include <string>
    \n-
    15#include <iostream>
    \n-
    16#include <fstream>
    \n-
    17
    \n-
    18#include <dune/common/fvector.hh>
    \n-
    19
    \n-\n-
    21
    \n-
    22namespace Dune {
    \n-
    23
    \n-
    29 template<class GridView>
    \n-
    \n-\n-
    31
    \n-
    32 typedef typename GridView::Grid::ctype ctype;
    \n-
    33
    \n-
    34 constexpr static int dimworld = GridView::dimensionworld;
    \n-
    35
    \n-
    36 public:
    \n-
    \n-
    37 GnuplotWriter (const GridView & gv) : _is(gv.indexSet()), _gv(gv)
    \n-
    38 {
    \n-
    39 static_assert(dimworld==1 || dimworld==2, "GnuPlot export only works for worlddim==1 and worlddim==2");
    \n-
    40 // allocate _data buffer
    \n-
    41 _data.resize(_is.size(0)*2);
    \n-
    42 }
    \n-
    \n-
    43
    \n-
    48 template <class DataContainer>
    \n-
    \n-
    49 void addCellData(const DataContainer& data, const std::string & name)
    \n-
    50 {
    \n-
    51 if (dimworld!=1)
    \n-
    52 DUNE_THROW(IOError, "Gnuplot cell data writing is only supported for grids in a 1d world!");
    \n-
    53 addData(cellData, data, name);
    \n-
    54 }
    \n-
    \n-
    55
    \n-
    60 template <class DataContainer>
    \n-
    \n-
    61 void addVertexData(const DataContainer& data, const std::string & name)
    \n-
    62 {
    \n-
    63 addData(vertexData, data, name);
    \n-
    64 }
    \n-
    \n-
    65
    \n-
    69 void write(const std::string& filename) const;
    \n-
    70
    \n-
    71 private:
    \n-
    72 enum DataType { vertexData, cellData };
    \n-
    73 const typename GridView::IndexSet & _is;
    \n-
    74 const GridView _gv;
    \n-
    75 std::vector< std::vector< float > > _data;
    \n-
    76 std::vector< std::string > _names;
    \n-
    77
    \n-
    78 template <class DataContainer>
    \n-
    79 void addData(DataType t, const DataContainer& data, const std::string & name);
    \n-
    80
    \n-
    81 void writeRow(std::ostream & file,
    \n-
    82 const FieldVector<ctype, dimworld>& position,
    \n-
    83 const std::vector<float> & data) const;
    \n-
    84 };
    \n-
    \n-
    85
    \n-
    89 template<class G>
    \n-
    \n-
    90 class LeafGnuplotWriter : public GnuplotWriter<typename G::LeafGridView>
    \n-
    91 {
    \n-
    92 public:
    \n-
    \n-
    94 LeafGnuplotWriter (const G& grid)
    \n-
    95 : GnuplotWriter<typename G::LeafGridView>(grid.leafGridView())
    \n-
    96 {}
    \n-
    \n-
    97 };
    \n-
    \n-
    98
    \n-
    102 template<class G>
    \n-
    \n-
    103 class LevelGnuplotWriter : public GnuplotWriter<typename G::LevelGridView>
    \n-
    104 {
    \n-
    105 public:
    \n-
    \n-
    107 LevelGnuplotWriter (const G& grid, int level)
    \n-
    108 : GnuplotWriter<typename G::LevelGridView>(grid.levelGridView(level))
    \n-
    109 {}
    \n-
    \n-
    110 };
    \n-
    \n-
    111
    \n-
    112}
    \n-
    113
    \n-
    114#include "gnuplot/gnuplot.cc"
    \n-
    115
    \n-
    116#endif // DUNE_IO_GNUPLOT_HH
    \n-
    Implementation of gnuplot output for 1D and 2D grids.
    \n-
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n-
    Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
    leaf grid view for the given grid
    Definition common/grid.hh:805
    \n-
    Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
    level grid view for the given grid and level.
    Definition common/grid.hh:788
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n-
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    Writer for 1D grids in gnuplot format.
    Definition gnuplot.hh:30
    \n-
    void addVertexData(const DataContainer &data, const std::string &name)
    Add vertex data.
    Definition gnuplot.hh:61
    \n-
    void addCellData(const DataContainer &data, const std::string &name)
    Add cell data.
    Definition gnuplot.hh:49
    \n-
    void write(const std::string &filename) const
    Write Gnuplot file to disk.
    Definition gnuplot.cc:19
    \n-
    GnuplotWriter(const GridView &gv)
    Definition gnuplot.hh:37
    \n-
    GnuplotWriter on the leaf grid.
    Definition gnuplot.hh:91
    \n-
    LeafGnuplotWriter(const G &grid)
    Construct a Gnuplot writer for the leaf level of a given grid.
    Definition gnuplot.hh:94
    \n-
    GnuplotWriter on a given level grid.
    Definition gnuplot.hh:104
    \n-
    LevelGnuplotWriter(const G &grid, int level)
    Construct a Gnuplot writer for a certain level of a given grid.
    Definition gnuplot.hh:107
    \n-
    Different resources needed by all grid implementations.
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_HH
    \n+
    8
    \n+
    13#include "vtk/boundarywriter.hh"
    \n+\n+\n+
    16#include "vtk/vtkwriter.hh"
    \n+
    17#include "vtk/volumewriter.hh"
    \n+
    18
    \n+
    19#endif // DUNE_GRID_IO_FILE_VTK_HH
    \n+
    Provides file i/o for the visualization toolkit.
    \n+\n+\n+\n+
    Provides subsampled file i/o for the visualization toolkit.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,162 +2,34 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-gnuplot.hh\n+vtk.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_IO_GNUPLOT_HH\n-6#define DUNE_IO_GNUPLOT_HH\n-7\n-13#include \n-14#include \n-15#include \n-16#include \n-17\n-18#include \n-19\n-20#include \n-21\n-22namespace Dune {\n-23\n-29 template\n-30 class GnuplotWriter {\n-31\n-32 typedef typename GridView::Grid::ctype ctype;\n-33\n-34 constexpr static int dimworld = GridView::dimensionworld;\n-35\n-36 public:\n-37 GnuplotWriter (const GridView & gv) : _is(gv.indexSet()), _gv(gv)\n-38 {\n-39 static_assert(dimworld==1 || dimworld==2, \"GnuPlot export only works for\n-worlddim==1 and worlddim==2\");\n-40 // allocate _data buffer\n-41 _data.resize(_is.size(0)*2);\n-42 }\n-43\n-48 template \n-49 void addCellData(const DataContainer& data, const std::string & name)\n-50 {\n-51 if (dimworld!=1)\n-52 DUNE_THROW(IOError, \"Gnuplot cell data writing is only supported for grids\n-in a 1d world!\");\n-53 addData(cellData, data, name);\n-54 }\n-55\n-60 template \n-61 void addVertexData(const DataContainer& data, const std::string & name)\n-62 {\n-63 addData(vertexData, data, name);\n-64 }\n-65\n-69 void write(const std::string& filename) const;\n-70\n-71 private:\n-72 enum DataType { vertexData, cellData };\n-73 const typename GridView::IndexSet & _is;\n-74 const GridView _gv;\n-75 std::vector< std::vector< float > > _data;\n-76 std::vector< std::string > _names;\n-77\n-78 template \n-79 void addData(DataType t, const DataContainer& data, const std::string &\n-name);\n-80\n-81 void writeRow(std::ostream & file,\n-82 const FieldVector& position,\n-83 const std::vector & data) const;\n-84 };\n-85\n-89 template\n-90 class LeafGnuplotWriter : public GnuplotWriter\n-91 {\n-92 public:\n-94 LeafGnuplotWriter (const G& grid)\n-95 : GnuplotWriter(grid.leafGridView())\n-96 {}\n-97 };\n-98\n-102 template\n-103 class LevelGnuplotWriter : public GnuplotWriter\n-104 {\n-105 public:\n-107 LevelGnuplotWriter (const G& grid, int level)\n-108 : GnuplotWriter(grid.levelGridView(level))\n-109 {}\n-110 };\n-111\n-112}\n-113\n-114#include \"gnuplot/gnuplot.cc\"\n-115\n-116#endif // DUNE_IO_GNUPLOT_HH\n-gnuplot.cc\n-Implementation of gnuplot output for 1D and 2D grids.\n-Dune::GridView::IndexSet\n-Traits::IndexSet IndexSet\n-type of the index set\n-Definition common/gridview.hh:86\n-Dune::leafGridView\n-Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid<\n-dim, dimworld, ct, GridFamily > &grid)\n-leaf grid view for the given grid\n-Definition common/grid.hh:805\n-Dune::levelGridView\n-Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid<\n-dim, dimworld, ct, GridFamily > &grid, int level)\n-level grid view for the given grid and level.\n-Definition common/grid.hh:788\n-Dune::GridView::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/gridview.hh:137\n-Dune\n-Include standard header files.\n-Definition agrid.hh:60\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::GnuplotWriter\n-Writer for 1D grids in gnuplot format.\n-Definition gnuplot.hh:30\n-Dune::GnuplotWriter::addVertexData\n-void addVertexData(const DataContainer &data, const std::string &name)\n-Add vertex data.\n-Definition gnuplot.hh:61\n-Dune::GnuplotWriter::addCellData\n-void addCellData(const DataContainer &data, const std::string &name)\n-Add cell data.\n-Definition gnuplot.hh:49\n-Dune::GnuplotWriter::write\n-void write(const std::string &filename) const\n-Write Gnuplot file to disk.\n-Definition gnuplot.cc:19\n-Dune::GnuplotWriter::GnuplotWriter\n-GnuplotWriter(const GridView &gv)\n-Definition gnuplot.hh:37\n-Dune::LeafGnuplotWriter\n-GnuplotWriter on the leaf grid.\n-Definition gnuplot.hh:91\n-Dune::LeafGnuplotWriter::LeafGnuplotWriter\n-LeafGnuplotWriter(const G &grid)\n-Construct a Gnuplot writer for the leaf level of a given grid.\n-Definition gnuplot.hh:94\n-Dune::LevelGnuplotWriter\n-GnuplotWriter on a given level grid.\n-Definition gnuplot.hh:104\n-Dune::LevelGnuplotWriter::LevelGnuplotWriter\n-LevelGnuplotWriter(const G &grid, int level)\n-Construct a Gnuplot writer for a certain level of a given grid.\n-Definition gnuplot.hh:107\n-grid.hh\n-Different resources needed by all grid implementations.\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_HH\n+7#define DUNE_GRID_IO_FILE_VTK_HH\n+8\n+13#include \"vtk/boundarywriter.hh\"\n+14#include \"vtk/subsamplingvtkwriter.hh\"\n+15#include \"vtk/vtksequencewriter.hh\"\n+16#include \"vtk/vtkwriter.hh\"\n+17#include \"vtk/volumewriter.hh\"\n+18\n+19#endif // DUNE_GRID_IO_FILE_VTK_HH\n+vtkwriter.hh\n+Provides file i/o for the visualization toolkit.\n+vtksequencewriter.hh\n+boundarywriter.hh\n+volumewriter.hh\n+subsamplingvtkwriter.hh\n+Provides subsampled file i/o for the visualization toolkit.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00770.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00770.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtk.hh File Reference\n+dune-grid: starcdreader.hh File Reference\n \n \n \n \n \n \n \n@@ -69,29 +69,41 @@\n \n
    \n \n
    \n
    \n
    \n-
    vtk.hh File Reference
    \n+ \n+
    starcdreader.hh File Reference
    \n
    \n
    \n-\n-

    Convenience header which includes all available VTK writers. \n-More...

    \n-
    #include "vtk/boundarywriter.hh"
    \n-#include "vtk/subsamplingvtkwriter.hh"
    \n-#include "vtk/vtksequencewriter.hh"
    \n-#include "vtk/vtkwriter.hh"
    \n-#include "vtk/volumewriter.hh"
    \n+
    #include <dune/common/exceptions.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/grid/common/gridfactory.hh>
    \n+#include <iostream>
    \n+#include <fstream>
    \n+#include <memory>
    \n
    \n

    Go to the source code of this file.

    \n-

    Detailed Description

    \n-

    Convenience header which includes all available VTK writers.

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

    \n+Classes

    class  Dune::StarCDReader< GridType >
     File reader for the Star-CD format. More...
     
    \n+\n+\n+\n+\n+

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,19 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-vtk.hh File Reference\n-Convenience header which includes all available VTK writers. More...\n-#include \"vtk/boundarywriter.hh\"\n-#include \"vtk/subsamplingvtkwriter.hh\"\n-#include \"vtk/vtksequencewriter.hh\"\n-#include \"vtk/vtkwriter.hh\"\n-#include \"vtk/volumewriter.hh\"\n+Classes | Namespaces\n+starcdreader.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-***** Detailed Description *****\n-Convenience header which includes all available VTK writers.\n+Classes\n+class \u00a0 Dune::StarCDReader<_GridType_>\n+\u00a0 File reader for the Star-CD format. More...\n+\u00a0\n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00770_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00770_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtk.hh Source File\n+dune-grid: starcdreader.hh Source File\n \n \n \n \n \n \n \n@@ -74,37 +74,176 @@\n \n
    \n \n
    \n \n
    \n-
    vtk.hh
    \n+
    starcdreader.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_HH
    \n-
    8
    \n-
    13#include "vtk/boundarywriter.hh"
    \n-\n-\n-
    16#include "vtk/vtkwriter.hh"
    \n-
    17#include "vtk/volumewriter.hh"
    \n-
    18
    \n-
    19#endif // DUNE_GRID_IO_FILE_VTK_HH
    \n-\n-
    Provides subsampled file i/o for the visualization toolkit.
    \n-
    Provides file i/o for the visualization toolkit.
    \n-\n-\n+
    5#ifndef DUNE_STARCD_READER_HH
    \n+
    6#define DUNE_STARCD_READER_HH
    \n+
    7
    \n+
    8#include <dune/common/exceptions.hh>
    \n+
    9
    \n+
    10#include <dune/geometry/type.hh>
    \n+\n+
    12#include <iostream>
    \n+
    13#include <fstream>
    \n+
    14#include <memory>
    \n+
    15
    \n+
    16namespace Dune {
    \n+
    17
    \n+
    51 template <class GridType>
    \n+
    \n+\n+
    53
    \n+
    54 public:
    \n+
    55
    \n+
    \n+
    65 static std::unique_ptr<GridType> read(const std::string& fileName, bool verbose = true)
    \n+
    66 {
    \n+
    67 // extract the grid dimension
    \n+
    68 const int dim = GridType::dimension;
    \n+
    69
    \n+
    70 // currently only dim = 3 is implemented
    \n+
    71 if (dim != 3)
    \n+
    72 DUNE_THROW(Dune::NotImplemented,
    \n+
    73 "Reading Star-CD format is not implemented for dimension " << dim);
    \n+
    74
    \n+
    75 // set up the grid factory
    \n+\n+
    77
    \n+
    78 // set the name of the vertex file
    \n+
    79 std::string vertexFileName = fileName + ".vrt";
    \n+
    80
    \n+
    81 // set the vertex input stream
    \n+
    82 std::ifstream vertexFile(vertexFileName.c_str());
    \n+
    83 if (!vertexFile)
    \n+
    84 DUNE_THROW(Dune::IOError, "Could not open " << vertexFileName);
    \n+
    85
    \n+
    86 // read the vertices
    \n+
    87 int dummyIdx;
    \n+
    88 int numberOfVertices = 0;
    \n+
    89 while (vertexFile >> dummyIdx) {
    \n+
    90 numberOfVertices++;
    \n+
    91
    \n+
    92 Dune::FieldVector<double,dim> position;
    \n+
    93
    \n+
    94 for (int k = 0; k < dim; k++)
    \n+
    95 vertexFile >> position[k];
    \n+
    96
    \n+
    97 factory.insertVertex(position);
    \n+
    98 }
    \n+
    99 if (verbose)
    \n+
    100 std::cout << numberOfVertices << " vertices read." << std::endl;
    \n+
    101
    \n+
    102 // set the name of the element file
    \n+
    103 std::string elementFileName = fileName + ".cel";
    \n+
    104
    \n+
    105 // set the element input stream
    \n+
    106 std::ifstream elementFile(elementFileName.c_str());
    \n+
    107 if (!elementFile)
    \n+
    108 DUNE_THROW(Dune::IOError, "Could not open " << elementFileName);
    \n+
    109
    \n+
    110 // read the elements
    \n+
    111 int numberOfElements = 0;
    \n+
    112 int numberOfSimplices = 0;
    \n+
    113 int numberOfPyramids = 0;
    \n+
    114 int numberOfPrisms = 0;
    \n+
    115 int numberOfCubes = 0;;
    \n+
    116 int maxNumberOfVertices = (int)pow(2, dim);
    \n+
    117 int isVolume = 1;
    \n+
    118 while (elementFile >> dummyIdx) {
    \n+
    119 std::vector<unsigned int> vertices(maxNumberOfVertices);
    \n+
    120 for (int k = 0; k < maxNumberOfVertices; k++)
    \n+
    121 elementFile >> vertices[k];
    \n+
    122
    \n+
    123 int boundaryId;
    \n+
    124 elementFile >> boundaryId;
    \n+
    125
    \n+
    126 int volumeOrSurface[2];
    \n+
    127 elementFile >> volumeOrSurface[0] >> volumeOrSurface[1];
    \n+
    128
    \n+
    129 if (volumeOrSurface[0] == isVolume) {
    \n+
    130 numberOfElements++;
    \n+
    131
    \n+
    132 if (vertices[2] == vertices[3]) { // simplex or prism
    \n+
    133 if (vertices[4] == vertices[5]) { // simplex
    \n+
    134 numberOfSimplices++;
    \n+
    135 std::vector<unsigned int> simplexVertices(4);
    \n+
    136 for (int k = 0; k < 3; k++)
    \n+
    137 simplexVertices[k] = vertices[k] - 1;
    \n+
    138 simplexVertices[3] = vertices[4] - 1;
    \n+
    139 factory.insertElement(Dune::GeometryTypes::tetrahedron, simplexVertices);
    \n+
    140 }
    \n+
    141 else { // prism
    \n+
    142 numberOfPrisms++;
    \n+
    143 std::vector<unsigned int> prismVertices(6);
    \n+
    144 for (int k = 0; k < 3; k++)
    \n+
    145 prismVertices[k] = vertices[k] - 1;
    \n+
    146 for (int k = 3; k < 6; k++)
    \n+
    147 prismVertices[k] = vertices[k+1] - 1;
    \n+
    148 factory.insertElement(Dune::GeometryTypes::prism, prismVertices);
    \n+
    149 }
    \n+
    150 }
    \n+
    151 else { // cube or pyramid
    \n+
    152 if (vertices[4] == vertices[5]) { // pyramid
    \n+
    153 numberOfPyramids++;
    \n+
    154 std::vector<unsigned int> pyramidVertices(5);
    \n+
    155 for (int k = 0; k < 5; k++)
    \n+
    156 pyramidVertices[k] = vertices[k] - 1;
    \n+
    157 factory.insertElement(Dune::GeometryTypes::pyramid, pyramidVertices);
    \n+
    158 }
    \n+
    159 else { // cube
    \n+
    160 numberOfCubes++;
    \n+
    161 std::vector<unsigned int> cubeVertices(8);
    \n+
    162 for (int k = 0; k < 8; k++)
    \n+
    163 cubeVertices[k] = vertices[k] - 1;
    \n+
    164 std::swap(cubeVertices[2], cubeVertices[3]);
    \n+
    165 std::swap(cubeVertices[6], cubeVertices[7]);
    \n+
    166 factory.insertElement(Dune::GeometryTypes::hexahedron, cubeVertices);
    \n+
    167 }
    \n+
    168 }
    \n+
    169 }
    \n+
    170 }
    \n+
    171 if (verbose)
    \n+
    172 std::cout << numberOfElements << " elements read: "
    \n+
    173 << numberOfSimplices << " simplices, " << numberOfPyramids << " pyramids, "
    \n+
    174 << numberOfPrisms << " prisms, " << numberOfCubes << " cubes." << std::endl;
    \n+
    175
    \n+
    176 // finish off the construction of the grid object
    \n+
    177 if (verbose)
    \n+
    178 std::cout << "Starting createGrid() ... " << std::flush;
    \n+
    179
    \n+
    180 return factory.createGrid();
    \n+
    181
    \n+
    182 }
    \n+
    \n+
    183
    \n+
    184 };
    \n+
    \n+
    185
    \n+
    186}
    \n+
    187
    \n+
    188#endif
    \n+
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n+
    Include standard header files.
    Definition agrid.hh:60
    \n+
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n+
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
    Insert an element into the coarse grid.
    Definition common/gridfactory.hh:307
    \n+
    virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
    Insert a vertex into the coarse grid.
    Definition common/gridfactory.hh:296
    \n+
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n+
    File reader for the Star-CD format.
    Definition starcdreader.hh:52
    \n+
    static std::unique_ptr< GridType > read(const std::string &fileName, bool verbose=true)
    Read grid from a Star-CD file.
    Definition starcdreader.hh:65
    \n+
    Provide a generic factory class for unstructured grids.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,34 +2,193 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-vtk.hh\n+starcdreader.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_HH\n-7#define DUNE_GRID_IO_FILE_VTK_HH\n-8\n-13#include \"vtk/boundarywriter.hh\"\n-14#include \"vtk/subsamplingvtkwriter.hh\"\n-15#include \"vtk/vtksequencewriter.hh\"\n-16#include \"vtk/vtkwriter.hh\"\n-17#include \"vtk/volumewriter.hh\"\n-18\n-19#endif // DUNE_GRID_IO_FILE_VTK_HH\n-volumewriter.hh\n-subsamplingvtkwriter.hh\n-Provides subsampled file i/o for the visualization toolkit.\n-vtkwriter.hh\n-Provides file i/o for the visualization toolkit.\n-vtksequencewriter.hh\n-boundarywriter.hh\n+5#ifndef DUNE_STARCD_READER_HH\n+6#define DUNE_STARCD_READER_HH\n+7\n+8#include \n+9\n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15\n+16namespace Dune {\n+17\n+51 template \n+52 class StarCDReader {\n+53\n+54 public:\n+55\n+65 static std::unique_ptr read(const std::string& fileName, bool\n+verbose = true)\n+66 {\n+67 // extract the grid dimension\n+68 const int dim = GridType::dimension;\n+69\n+70 // currently only dim = 3 is implemented\n+71 if (dim != 3)\n+72 DUNE_THROW(Dune::NotImplemented,\n+73 \"Reading Star-CD format is not implemented for dimension \" << dim);\n+74\n+75 // set up the grid factory\n+76 GridFactory factory;\n+77\n+78 // set the name of the vertex file\n+79 std::string vertexFileName = fileName + \".vrt\";\n+80\n+81 // set the vertex input stream\n+82 std::ifstream vertexFile(vertexFileName.c_str());\n+83 if (!vertexFile)\n+84 DUNE_THROW(Dune::IOError, \"Could not open \" << vertexFileName);\n+85\n+86 // read the vertices\n+87 int dummyIdx;\n+88 int numberOfVertices = 0;\n+89 while (vertexFile >> dummyIdx) {\n+90 numberOfVertices++;\n+91\n+92 Dune::FieldVector position;\n+93\n+94 for (int k = 0; k < dim; k++)\n+95 vertexFile >> position[k];\n+96\n+97 factory.insertVertex(position);\n+98 }\n+99 if (verbose)\n+100 std::cout << numberOfVertices << \" vertices read.\" << std::endl;\n+101\n+102 // set the name of the element file\n+103 std::string elementFileName = fileName + \".cel\";\n+104\n+105 // set the element input stream\n+106 std::ifstream elementFile(elementFileName.c_str());\n+107 if (!elementFile)\n+108 DUNE_THROW(Dune::IOError, \"Could not open \" << elementFileName);\n+109\n+110 // read the elements\n+111 int numberOfElements = 0;\n+112 int numberOfSimplices = 0;\n+113 int numberOfPyramids = 0;\n+114 int numberOfPrisms = 0;\n+115 int numberOfCubes = 0;;\n+116 int maxNumberOfVertices = (int)pow(2, dim);\n+117 int isVolume = 1;\n+118 while (elementFile >> dummyIdx) {\n+119 std::vector vertices(maxNumberOfVertices);\n+120 for (int k = 0; k < maxNumberOfVertices; k++)\n+121 elementFile >> vertices[k];\n+122\n+123 int boundaryId;\n+124 elementFile >> boundaryId;\n+125\n+126 int volumeOrSurface[2];\n+127 elementFile >> volumeOrSurface[0] >> volumeOrSurface[1];\n+128\n+129 if (volumeOrSurface[0] == isVolume) {\n+130 numberOfElements++;\n+131\n+132 if (vertices[2] == vertices[3]) { // simplex or prism\n+133 if (vertices[4] == vertices[5]) { // simplex\n+134 numberOfSimplices++;\n+135 std::vector simplexVertices(4);\n+136 for (int k = 0; k < 3; k++)\n+137 simplexVertices[k] = vertices[k] - 1;\n+138 simplexVertices[3] = vertices[4] - 1;\n+139 factory.insertElement(Dune::GeometryTypes::tetrahedron, simplexVertices);\n+140 }\n+141 else { // prism\n+142 numberOfPrisms++;\n+143 std::vector prismVertices(6);\n+144 for (int k = 0; k < 3; k++)\n+145 prismVertices[k] = vertices[k] - 1;\n+146 for (int k = 3; k < 6; k++)\n+147 prismVertices[k] = vertices[k+1] - 1;\n+148 factory.insertElement(Dune::GeometryTypes::prism, prismVertices);\n+149 }\n+150 }\n+151 else { // cube or pyramid\n+152 if (vertices[4] == vertices[5]) { // pyramid\n+153 numberOfPyramids++;\n+154 std::vector pyramidVertices(5);\n+155 for (int k = 0; k < 5; k++)\n+156 pyramidVertices[k] = vertices[k] - 1;\n+157 factory.insertElement(Dune::GeometryTypes::pyramid, pyramidVertices);\n+158 }\n+159 else { // cube\n+160 numberOfCubes++;\n+161 std::vector cubeVertices(8);\n+162 for (int k = 0; k < 8; k++)\n+163 cubeVertices[k] = vertices[k] - 1;\n+164 std::swap(cubeVertices[2], cubeVertices[3]);\n+165 std::swap(cubeVertices[6], cubeVertices[7]);\n+166 factory.insertElement(Dune::GeometryTypes::hexahedron, cubeVertices);\n+167 }\n+168 }\n+169 }\n+170 }\n+171 if (verbose)\n+172 std::cout << numberOfElements << \" elements read: \"\n+173 << numberOfSimplices << \" simplices, \" << numberOfPyramids << \" pyramids, \"\n+174 << numberOfPrisms << \" prisms, \" << numberOfCubes << \" cubes.\" << std::\n+endl;\n+175\n+176 // finish off the construction of the grid object\n+177 if (verbose)\n+178 std::cout << \"Starting createGrid() ... \" << std::flush;\n+179\n+180 return factory.createGrid();\n+181\n+182 }\n+183\n+184 };\n+185\n+186}\n+187\n+188#endif\n+std::swap\n+void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n+> &b)\n+Definition utility/persistentcontainer.hh:83\n+Dune\n+Include standard header files.\n+Definition agrid.hh:60\n+Dune::GridFactory\n+Provide a generic factory class for unstructured grids.\n+Definition common/gridfactory.hh:275\n+Dune::GridFactory::insertElement\n+virtual void insertElement(const GeometryType &type, const std::vector<\n+unsigned int > &vertices)\n+Insert an element into the coarse grid.\n+Definition common/gridfactory.hh:307\n+Dune::GridFactory::insertVertex\n+virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)\n+Insert a vertex into the coarse grid.\n+Definition common/gridfactory.hh:296\n+Dune::GridFactory::createGrid\n+virtual std::unique_ptr< GridType > createGrid()\n+Finalize grid creation and hand over the grid.\n+Definition common/gridfactory.hh:333\n+Dune::StarCDReader\n+File reader for the Star-CD format.\n+Definition starcdreader.hh:52\n+Dune::StarCDReader::read\n+static std::unique_ptr< GridType > read(const std::string &fileName, bool\n+verbose=true)\n+Read grid from a Star-CD file.\n+Definition starcdreader.hh:65\n+gridfactory.hh\n+Provide a generic factory class for unstructured grids.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00773.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00773.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gnuplot.cc File Reference\n+dune-grid: corneriterator.hh File Reference\n \n \n \n \n \n \n \n@@ -65,39 +65,46 @@\n \n \n \n \n \n \n \n
    \n \n-
    gnuplot.cc File Reference
    \n+
    corneriterator.hh File Reference
    \n
    \n
    \n-\n-

    Implementation of gnuplot output for 1D and 2D grids. \n-More...

    \n-
    #include "../gnuplot.hh"
    \n+
    #include <iterator>
    \n+#include <dune/common/iteratorfacades.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/io/file/vtk/corner.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::CornerIterator< CellIterator >
     iterate over the corners of some cell range More...
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n-

    Detailed Description

    \n-

    Implementation of gnuplot output for 1D and 2D grids.

    \n-
    Author
    Christian Engwer
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,23 +2,28 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * gnuplot\n-Namespaces\n-gnuplot.cc File Reference\n-Implementation of gnuplot output for 1D and 2D grids. More...\n-#include \"../gnuplot.hh\"\n+ * vtk\n+Classes | Namespaces\n+corneriterator.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 \u00a0 Dune::VTK::CornerIterator<_CellIterator_>\n+\u00a0 iterate over the corners of some cell range More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Implementation of gnuplot output for 1D and 2D grids.\n- Author\n- Christian Engwer\n+namespace \u00a0 Dune::VTK\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00773_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00773_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gnuplot.cc Source File\n+dune-grid: corneriterator.hh Source File\n \n \n \n \n \n \n \n@@ -70,136 +70,170 @@\n \n \n \n \n \n \n \n
    \n-
    gnuplot.cc
    \n+
    corneriterator.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    10#include "../gnuplot.hh"
    \n-
    11
    \n-
    12namespace Dune {
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
    \n+
    8
    \n+
    9#include <iterator>
    \n+
    10
    \n+
    11#include <dune/common/iteratorfacades.hh>
    \n+
    12#include <dune/common/typetraits.hh>
    \n
    13
    \n-
    17 template<class GridView>
    \n-
    18 void
    \n-
    \n-
    19 GnuplotWriter<GridView>::write(const std::string& filename) const
    \n-
    20 {
    \n-
    21 // open file
    \n-
    22 std::ofstream file(filename.c_str());
    \n-
    23 // write all column names
    \n-
    24 file << "# coord\\t";
    \n-
    25 for (size_t i=0; i<_names.size(); i++)
    \n-
    26 file << _names[i] << "\\t";
    \n-
    27 file << "\\n";
    \n-
    28
    \n-
    29 if (dimworld==1) {
    \n-
    30#if !NDEBUG
    \n-
    31 int counter = 0;
    \n-
    32#endif
    \n-
    33 typedef typename GridView::template Codim<0>::Iterator CellIterator;
    \n-
    34 CellIterator it = _gv.template begin<0>();
    \n-
    35 CellIterator end = _gv.template end<0>();
    \n-
    36 for (; it != end; ++it)
    \n-
    37 {
    \n-
    38 int i = _is.index(*it);
    \n-
    39 // check that the elements are numbered consecutively
    \n-
    40 assert (i == counter++);
    \n-
    41 // calc positions
    \n-
    42 assert(it->geometry().corners() == 2);
    \n-
    43 const FieldVector<ctype,dimworld>& left = it->geometry().corner(0);
    \n-
    44 const FieldVector<ctype,dimworld>& right = it->geometry().corner(1);
    \n-
    45 assert(left[0] < right[0]);
    \n-
    46 // write gnuplot rows for left & right vertex
    \n-
    47 writeRow(file, left, _data[2*i]);
    \n-
    48 writeRow(file, right, _data[2*i+1]);
    \n-
    49 }
    \n-
    50
    \n-
    51 } else {
    \n-
    52
    \n-
    53 typedef typename GridView::template Codim<dimworld>::Iterator VertexIterator;
    \n-
    54 VertexIterator it = _gv.template begin<dimworld>();
    \n-
    55 VertexIterator end = _gv.template end<dimworld>();
    \n-
    56 for (; it != end; ++it) {
    \n-
    57
    \n-
    58 // write gnuplot rows for vertex
    \n-
    59 writeRow(file, it->geometry().corner(0), _data[_is.index(*it)]);
    \n-
    60
    \n-
    61 }
    \n-
    62
    \n-
    63 }
    \n-
    64
    \n-
    65 }
    \n-
    \n-
    66
    \n-
    67 template<class GridView>
    \n-
    68 void
    \n-
    \n-\n-
    70 const FieldVector<ctype,dimworld>& position,
    \n-
    71 const std::vector<float> & data) const
    \n-
    72 {
    \n-
    73 assert (data.size() == _names.size());
    \n-
    74 // write position
    \n-
    75 file << position << "\\t";
    \n-
    76 // write all data columns
    \n-
    77 for (size_t j=0; j<data.size(); j++)
    \n-
    78 file << data[j] << "\\t";
    \n-
    79 file << "\\n";
    \n-
    80 }
    \n-
    81
    \n-
    87 template<class GridView>
    \n-
    88 template<class DataContainer>
    \n-
    89 void
    \n-
    90 GnuplotWriter<GridView>::addData(DataType t, const DataContainer& data, const std::string & name)
    \n-
    91 {
    \n-
    92 assert((t == cellData && _is.size(0) == data.size())
    \n-
    93 || (t == vertexData && _is.size(GridView::dimension) == data.size()) );
    \n-
    94 _names.push_back(name);
    \n-
    95
    \n-
    96 // copy data to new container
    \n-
    97
    \n-
    98 if (dimworld==1) {
    \n-
    99
    \n-
    100 // data is transformed to nonconforming vertex data
    \n-
    101 int c = 0;
    \n-
    102 int shift = (t==vertexData ? 1 : 0);
    \n-
    103 for (size_t i=0; i<_is.size(0); i++)
    \n-
    104 {
    \n-
    105 _data[c++].push_back(data[i]);
    \n-
    106 _data[c++].push_back(data[i+shift]);
    \n-
    107 };
    \n-
    108
    \n-
    109 } else {
    \n-
    110
    \n-
    111 // 2d: only vertex data is allowed
    \n-
    112 for (size_t i=0; i<_is.size(dimworld); i++)
    \n-
    113 _data[i].push_back(data[i]);
    \n-
    114
    \n-
    115 }
    \n-
    116
    \n-
    117 }
    \n-
    118
    \n-
    119}
    \n+
    14#include <dune/geometry/referenceelements.hh>
    \n+
    15
    \n+\n+
    17
    \n+
    18namespace Dune
    \n+
    19{
    \n+
    22
    \n+
    23 namespace VTK {
    \n+
    24
    \n+
    26
    \n+
    30 template<typename CellIterator>
    \n+
    \n+\n+
    32 : public ForwardIteratorFacade
    \n+
    33 < CornerIterator<CellIterator>,
    \n+
    34 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n+
    35 CellIterator>::value_type>::type>,
    \n+
    36 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n+
    37 CellIterator>::value_type>::type>&,
    \n+
    38 typename std::iterator_traits<CellIterator>::difference_type>
    \n+
    39 {
    \n+
    40 public:
    \n+
    41 // reiterate the facades typedefs here
    \n+\n+
    43 typedef VTK::Corner<typename std::remove_const<typename std::iterator_traits<
    \n+
    44 CellIterator>::value_type>::type> Corner;
    \n+
    45 typedef const Corner Value;
    \n+
    46 typedef Value& Reference;
    \n+
    47 typedef typename std::iterator_traits<CellIterator>::difference_type
    \n+\n+
    49
    \n+
    50 typedef typename std::iterator_traits<CellIterator>::value_type::Geometry::ctype
    \n+\n+
    52 static const unsigned dim = std::iterator_traits<CellIterator>::
    \n+
    53 value_type::mydimension;
    \n+
    54 typedef ReferenceElements<ctype, dim> Refelems;
    \n+
    55
    \n+
    56 private:
    \n+
    57 typedef ForwardIteratorFacade<DerivedType, Value, Reference,
    \n+
    58 DifferenceType> Facade;
    \n+
    59
    \n+
    60 CellIterator cellit;
    \n+
    61 CellIterator cellend;
    \n+
    62 Corner corner;
    \n+
    63
    \n+
    64 public:
    \n+
    \n+\n+
    66 return corner;
    \n+
    67 }
    \n
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    68
    \n+
    \n+
    69 bool isDereferencable() const {
    \n+
    70 return cellit != cellend;
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    \n+
    73 bool equals(const DerivedType& other) const {
    \n+
    74 bool mePassedTheEnd = !isDereferencable();
    \n+
    75 bool otherPassedTheEnd = !other.isDereferencable();
    \n+
    76 // both are passed the end => return true
    \n+
    77 if(mePassedTheEnd && otherPassedTheEnd) return true;
    \n+
    78 // one is passed the end => return false
    \n+
    79 if(mePassedTheEnd || otherPassedTheEnd) return false;
    \n+
    80 // none is passed the end, do their iterators and indices match?
    \n+
    81 return cellit == other.cellit &&
    \n+
    82 corner.duneIndex() == other.corner.duneIndex();
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    \n+
    85 void increment() {
    \n+
    86 int index = corner.vtkIndex();
    \n+
    87 ++index;
    \n+
    88 if(index == Refelems::general(cellit->type()).size(dim)) {
    \n+
    89 ++cellit;
    \n+
    90 if(cellit != cellend) {
    \n+
    91 corner.cell(*cellit);
    \n+
    92 corner.vtkIndex(0);
    \n+
    93 }
    \n+
    94 }
    \n+
    95 else
    \n+
    96 corner.vtkIndex(index);
    \n+
    97 }
    \n+
    \n+
    98
    \n+
    100
    \n+
    \n+
    105 CornerIterator(const CellIterator& cellit_, const CellIterator& cellend_,
    \n+
    106 unsigned vtkIndex = 0)
    \n+
    107 : cellit(cellit_), cellend(cellend_)
    \n+
    108 {
    \n+
    109 if(cellit != cellend) {
    \n+
    110 corner.cell(*cellit);
    \n+
    111 corner.vtkIndex(vtkIndex);
    \n+
    112 }
    \n+
    113 }
    \n+
    \n+
    115
    \n+
    \n+
    118 CornerIterator(const CellIterator& cellend_)
    \n+
    119 : cellit(cellend_), cellend(cellend_)
    \n+
    120 { }
    \n+
    \n+
    121 };
    \n+
    \n+
    122
    \n+
    123 } // namespace VTK
    \n+
    124
    \n+
    126
    \n+
    127} // namespace Dune
    \n+
    128
    \n+
    129#endif // DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n-
    Writer for 1D grids in gnuplot format.
    Definition gnuplot.hh:30
    \n-
    void write(const std::string &filename) const
    Write Gnuplot file to disk.
    Definition gnuplot.cc:19
    \n+
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n+
    unsigned vtkIndex() const
    get the index of the corner within the cell in VTK-numbering
    Definition corner.hh:63
    \n+
    unsigned duneIndex() const
    get the index of the corner within the cell in Dune-numbering
    Definition corner.hh:55
    \n+
    const Cell & cell() const
    get reference to the cell
    Definition corner.hh:46
    \n+
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n+
    Value & Reference
    Definition corneriterator.hh:46
    \n+
    VTK::Corner< typename std::remove_const< typename std::iterator_traits< CellIterator >::value_type >::type > Corner
    Definition corneriterator.hh:44
    \n+
    void increment()
    Definition corneriterator.hh:85
    \n+
    Reference dereference() const
    Definition corneriterator.hh:65
    \n+
    std::iterator_traits< CellIterator >::difference_type DifferenceType
    Definition corneriterator.hh:48
    \n+
    static const unsigned dim
    Definition corneriterator.hh:52
    \n+
    ReferenceElements< ctype, dim > Refelems
    Definition corneriterator.hh:54
    \n+
    const Corner Value
    Definition corneriterator.hh:45
    \n+
    CornerIterator(const CellIterator &cellit_, const CellIterator &cellend_, unsigned vtkIndex=0)
    construct a CornerIterator
    Definition corneriterator.hh:105
    \n+
    CornerIterator(const CellIterator &cellend_)
    construct a CornerIterator
    Definition corneriterator.hh:118
    \n+
    bool equals(const DerivedType &other) const
    Definition corneriterator.hh:73
    \n+
    CornerIterator< CellIterator > DerivedType
    Definition corneriterator.hh:42
    \n+
    std::iterator_traits< CellIterator >::value_type::Geometry::ctype ctype
    Definition corneriterator.hh:51
    \n+
    bool isDereferencable() const
    Definition corneriterator.hh:69
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,139 +2,197 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * gnuplot\n-gnuplot.cc\n+ * vtk\n+corneriterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-10#include \"../gnuplot.hh\"\n-11\n-12namespace Dune {\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH\n+7#define DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH\n+8\n+9#include \n+10\n+11#include \n+12#include \n 13\n-17 template\n-18 void\n-19 GnuplotWriter::write(const std::string& filename) const\n-20 {\n-21 // open file\n-22 std::ofstream file(filename.c_str());\n-23 // write all column names\n-24 file << \"# coord\\t\";\n-25 for (size_t i=0; i<_names.size(); i++)\n-26 file << _names[i] << \"\\t\";\n-27 file << \"\\n\";\n-28\n-29 if (dimworld==1) {\n-30#if !NDEBUG\n-31 int counter = 0;\n-32#endif\n-33 typedef typename GridView::template Codim<0>::Iterator CellIterator;\n-34 CellIterator it = _gv.template begin<0>();\n-35 CellIterator end = _gv.template end<0>();\n-36 for (; it != end; ++it)\n-37 {\n-38 int i = _is.index(*it);\n-39 // check that the elements are numbered consecutively\n-40 assert (i == counter++);\n-41 // calc positions\n-42 assert(it->geometry().corners() == 2);\n-43 const FieldVector& left = it->geometry().corner(0);\n-44 const FieldVector& right = it->geometry().corner(1);\n-45 assert(left[0] < right[0]);\n-46 // write gnuplot rows for left & right vertex\n-47 writeRow(file, left, _data[2*i]);\n-48 writeRow(file, right, _data[2*i+1]);\n-49 }\n-50\n-51 } else {\n-52\n-53 typedef typename GridView::template Codim::Iterator\n-VertexIterator;\n-54 VertexIterator it = _gv.template begin();\n-55 VertexIterator end = _gv.template end();\n-56 for (; it != end; ++it) {\n-57\n-58 // write gnuplot rows for vertex\n-59 writeRow(file, it->geometry().corner(0), _data[_is.index(*it)]);\n-60\n-61 }\n-62\n-63 }\n-64\n-65 }\n-66\n-67 template\n-68 void\n-69 GnuplotWriter::writeRow(std::ostream & file,\n-70 const FieldVector& position,\n-71 const std::vector & data) const\n-72 {\n-73 assert (data.size() == _names.size());\n-74 // write position\n-75 file << position << \"\\t\";\n-76 // write all data columns\n-77 for (size_t j=0; j\n-88 template\n-89 void\n-90 GnuplotWriter::addData(DataType t, const DataContainer& data,\n-const std::string & name)\n-91 {\n-92 assert((t == cellData && _is.size(0) == data.size())\n-93 || (t == vertexData && _is.size(GridView::dimension) == data.size()) );\n-94 _names.push_back(name);\n-95\n-96 // copy data to new container\n-97\n-98 if (dimworld==1) {\n-99\n-100 // data is transformed to nonconforming vertex data\n-101 int c = 0;\n-102 int shift = (t==vertexData ? 1 : 0);\n-103 for (size_t i=0; i<_is.size(0); i++)\n-104 {\n-105 _data[c++].push_back(data[i]);\n-106 _data[c++].push_back(data[i+shift]);\n-107 };\n-108\n-109 } else {\n-110\n-111 // 2d: only vertex data is allowed\n-112 for (size_t i=0; i<_is.size(dimworld); i++)\n-113 _data[i].push_back(data[i]);\n-114\n-115 }\n-116\n-117 }\n-118\n-119}\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n+14#include \n+15\n+16#include \n+17\n+18namespace Dune\n+19{\n+22\n+23 namespace VTK {\n+24\n+26\n+30 template\n+31 class CornerIterator\n+32 : public ForwardIteratorFacade\n+33 < CornerIterator,\n+34 const Corner::value_type>::type>,\n+36 const Corner::value_type>::type>&,\n+38 typename std::iterator_traits::difference_type>\n+39 {\n+40 public:\n+41 // reiterate the facades typedefs here\n+42 typedef CornerIterator DerivedType;\n+43 typedef VTK::Corner::value_type>::type> Corner;\n+45 typedef const Corner Value;\n+46 typedef Value& Reference;\n+47 typedef typename std::iterator_traits::difference_type\n+48 DifferenceType;\n+49\n+50 typedef typename std::iterator_traits::value_type::Geometry::\n+ctype\n+51 ctype;\n+52 static const unsigned dim = std::iterator_traits::\n+53 value_type::mydimension;\n+54 typedef ReferenceElements Refelems;\n+55\n+56 private:\n+57 typedef ForwardIteratorFacade Facade;\n+59\n+60 CellIterator cellit;\n+61 CellIterator cellend;\n+62 Corner corner;\n+63\n+64 public:\n+65 Reference dereference() const {\n+66 return corner;\n+67 }\n+68\n+69 bool isDereferencable() const {\n+70 return cellit != cellend;\n+71 }\n+72\n+73 bool equals(const DerivedType& other) const {\n+74 bool mePassedTheEnd = !isDereferencable();\n+75 bool otherPassedTheEnd = !other.isDereferencable();\n+76 // both are passed the end => return true\n+77 if(mePassedTheEnd && otherPassedTheEnd) return true;\n+78 // one is passed the end => return false\n+79 if(mePassedTheEnd || otherPassedTheEnd) return false;\n+80 // none is passed the end, do their iterators and indices match?\n+81 return cellit == other.cellit &&\n+82 corner.duneIndex() == other.corner.duneIndex();\n+83 }\n+84\n+85 void increment() {\n+86 int index = corner.vtkIndex();\n+87 ++index;\n+88 if(index == Refelems::general(cellit->type()).size(dim)) {\n+89 ++cellit;\n+90 if(cellit != cellend) {\n+91 corner.cell(*cellit);\n+92 corner.vtkIndex(0);\n+93 }\n+94 }\n+95 else\n+96 corner.vtkIndex(index);\n+97 }\n+98\n+100\n+105 CornerIterator(const CellIterator& cellit_, const CellIterator& cellend_,\n+106 unsigned vtkIndex = 0)\n+107 : cellit(cellit_), cellend(cellend_)\n+108 {\n+109 if(cellit != cellend) {\n+110 corner.cell(*cellit);\n+111 corner.vtkIndex(vtkIndex);\n+112 }\n+113 }\n+115\n+118 CornerIterator(const CellIterator& cellend_)\n+119 : cellit(cellend_), cellend(cellend_)\n+120 { }\n+121 };\n+122\n+123 } // namespace VTK\n+124\n+126\n+127} // namespace Dune\n+128\n+129#endif // DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH\n+corner.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::GridView::Codim\n-A struct that collects all associated types of one implementation from the\n-Traits class.\n-Definition common/gridview.hh:104\n-Dune::GnuplotWriter\n-Writer for 1D grids in gnuplot format.\n-Definition gnuplot.hh:30\n-Dune::GnuplotWriter::write\n-void write(const std::string &filename) const\n-Write Gnuplot file to disk.\n-Definition gnuplot.cc:19\n+Dune::VTK::Corner\n+simple class representing a corner of a cell\n+Definition corner.hh:25\n+Dune::VTK::Corner::vtkIndex\n+unsigned vtkIndex() const\n+get the index of the corner within the cell in VTK-numbering\n+Definition corner.hh:63\n+Dune::VTK::Corner::duneIndex\n+unsigned duneIndex() const\n+get the index of the corner within the cell in Dune-numbering\n+Definition corner.hh:55\n+Dune::VTK::Corner::cell\n+const Cell & cell() const\n+get reference to the cell\n+Definition corner.hh:46\n+Dune::VTK::CornerIterator\n+iterate over the corners of some cell range\n+Definition corneriterator.hh:39\n+Dune::VTK::CornerIterator::Reference\n+Value & Reference\n+Definition corneriterator.hh:46\n+Dune::VTK::CornerIterator::Corner\n+VTK::Corner< typename std::remove_const< typename std::iterator_traits<\n+CellIterator >::value_type >::type > Corner\n+Definition corneriterator.hh:44\n+Dune::VTK::CornerIterator::increment\n+void increment()\n+Definition corneriterator.hh:85\n+Dune::VTK::CornerIterator::dereference\n+Reference dereference() const\n+Definition corneriterator.hh:65\n+Dune::VTK::CornerIterator::DifferenceType\n+std::iterator_traits< CellIterator >::difference_type DifferenceType\n+Definition corneriterator.hh:48\n+Dune::VTK::CornerIterator::dim\n+static const unsigned dim\n+Definition corneriterator.hh:52\n+Dune::VTK::CornerIterator::Refelems\n+ReferenceElements< ctype, dim > Refelems\n+Definition corneriterator.hh:54\n+Dune::VTK::CornerIterator::Value\n+const Corner Value\n+Definition corneriterator.hh:45\n+Dune::VTK::CornerIterator::CornerIterator\n+CornerIterator(const CellIterator &cellit_, const CellIterator &cellend_,\n+unsigned vtkIndex=0)\n+construct a CornerIterator\n+Definition corneriterator.hh:105\n+Dune::VTK::CornerIterator::CornerIterator\n+CornerIterator(const CellIterator &cellend_)\n+construct a CornerIterator\n+Definition corneriterator.hh:118\n+Dune::VTK::CornerIterator::equals\n+bool equals(const DerivedType &other) const\n+Definition corneriterator.hh:73\n+Dune::VTK::CornerIterator::DerivedType\n+CornerIterator< CellIterator > DerivedType\n+Definition corneriterator.hh:42\n+Dune::VTK::CornerIterator::ctype\n+std::iterator_traits< CellIterator >::value_type::Geometry::ctype ctype\n+Definition corneriterator.hh:51\n+Dune::VTK::CornerIterator::isDereferencable\n+bool isDereferencable() const\n+Definition corneriterator.hh:69\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00776.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00776.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gmshwriter.hh File Reference\n+dune-grid: skeletonfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -65,49 +65,59 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    gmshwriter.hh File Reference
    \n+
    skeletonfunction.hh File Reference
    \n
    \n
    \n-
    #include <fstream>
    \n-#include <iostream>
    \n-#include <iomanip>
    \n+\n+

    Functions for VTK output on the skeleton. \n+More...

    \n+
    #include <memory>
    \n #include <string>
    \n #include <vector>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/common/grid.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/grid/io/file/vtk/functionwriter.hh>
    \n+#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n+#include <dune/grid/io/file/vtk/vtuwriter.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::GmshWriter< GridView >
     Write Gmsh mesh file. More...
    struct  Dune::VTK::SkeletonFunctionTraits< GV, RF >
     
    class  Dune::VTK::SkeletonFunctionInterface< GV, RF >
     A prototype for VTKFunctions on the skeleton. More...
     
    class  Dune::VTK::SkeletonFunctionWriter< Func >
     function writer for skeleton functions More...
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n-
    \n+

    Detailed Description

    \n+

    Functions for VTK output on the skeleton.

    \n+
    Author
    J\u00f6 Fahlke
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,30 +2,41 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n+ * vtk\n Classes | Namespaces\n-gmshwriter.hh File Reference\n-#include \n-#include \n-#include \n+skeletonfunction.hh File Reference\n+dune-grid \u00bb I/O \u00bb Visualization_ToolKit_(VTK)\n+Functions for VTK output on the skeleton. 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-class \u00a0 Dune::GmshWriter<_GridView_>\n-\u00a0 Write Gmsh mesh file. More...\n+struct \u00a0 Dune::VTK::SkeletonFunctionTraits<_GV,_RF_>\n+\u00a0\n+ class \u00a0 Dune::VTK::SkeletonFunctionInterface<_GV,_RF_>\n+\u00a0 A prototype for VTKFunctions on the skeleton. More...\n+\u00a0\n+ class \u00a0 Dune::VTK::SkeletonFunctionWriter<_Func_>\n+\u00a0 function writer for skeleton functions More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::VTK\n+\u00a0\n+***** Detailed Description *****\n+Functions for VTK output on the skeleton.\n+ Author\n+ J\u00c3\u00b6 Fahlke\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00776_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00776_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gmshwriter.hh Source File\n+dune-grid: skeletonfunction.hh Source File\n \n \n \n \n \n \n \n@@ -70,240 +70,189 @@\n \n \n \n \n \n \n \n
    \n-
    gmshwriter.hh
    \n+
    skeletonfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_IO_FILE_GMSHWRITER_HH
    \n-
    6#define DUNE_GRID_IO_FILE_GMSHWRITER_HH
    \n-
    7
    \n-
    8#include <fstream>
    \n-
    9#include <iostream>
    \n-
    10#include <iomanip>
    \n-
    11#include <string>
    \n-
    12#include <vector>
    \n-
    13
    \n-
    14#include <dune/common/exceptions.hh>
    \n-
    15#include <dune/geometry/type.hh>
    \n-
    16#include <dune/geometry/referenceelements.hh>
    \n-\n-\n-
    19
    \n-
    20namespace Dune {
    \n-
    21
    \n-
    35 template <class GridView>
    \n-
    \n-\n-
    37 {
    \n-
    38 private:
    \n-
    39 const GridView gv;
    \n-
    40 int precision;
    \n-
    41
    \n-
    42 static const unsigned int dim = GridView::dimension;
    \n-
    43 static const unsigned int dimWorld = GridView::dimensionworld;
    \n-
    44 static_assert( (dimWorld <= 3), "GmshWriter requires dimWorld <= 3." );
    \n-
    45
    \n-
    47 template<typename Entity>
    \n-
    48 std::size_t nodeIndexFromEntity(const Entity& entity, int i) const {
    \n-
    49 return gv.indexSet().subIndex(entity, i, dim)+1;
    \n-
    50 }
    \n-
    51
    \n-
    55 static std::size_t translateDuneToGmshType(const GeometryType& type) {
    \n-
    56 std::size_t element_type;
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH
    \n+
    8
    \n+
    9#include <memory>
    \n+
    10#include <string>
    \n+
    11#include <vector>
    \n+
    12
    \n+
    13#include <dune/common/fvector.hh>
    \n+
    14
    \n+\n+\n+\n+
    18
    \n+
    19namespace Dune {
    \n+
    20
    \n+
    23
    \n+
    29 namespace VTK {
    \n+
    30
    \n+
    32 //
    \n+
    33 // Prototype for VTKFunktions on the skeleton
    \n+
    34 //
    \n+
    35
    \n+
    36 template<typename GV, typename RF>
    \n+
    \n+\n+
    38 typedef GV GridView;
    \n+
    39 typedef typename GV::Intersection Cell;
    \n+
    40
    \n+
    41 typedef typename GV::ctype DomainField;
    \n+
    42 static const unsigned dimDomain = GV::dimension-1;
    \n+
    43 typedef FieldVector<DomainField, dimDomain> Domain;
    \n+
    44
    \n+
    45 typedef RF RangeField;
    \n+
    46 typedef std::vector<RangeField> Range;
    \n+
    47 };
    \n+
    \n+
    48
    \n+
    50 template <typename GV, typename RF>
    \n+
    \n+\n+
    52 public:
    \n+\n+
    54
    \n+
    56 unsigned dimRange() const;
    \n
    57
    \n-
    58 if (type.isLine())
    \n-
    59 element_type = 1;
    \n-
    60 else if (type.isTriangle())
    \n-
    61 element_type = 2;
    \n-
    62 else if (type.isQuadrilateral())
    \n-
    63 element_type = 3;
    \n-
    64 else if (type.isTetrahedron())
    \n-
    65 element_type = 4;
    \n-
    66 else if (type.isHexahedron())
    \n-
    67 element_type = 5;
    \n-
    68 else if (type.isPrism())
    \n-
    69 element_type = 6;
    \n-
    70 else if (type.isPyramid())
    \n-
    71 element_type = 7;
    \n-
    72 else if (type.isVertex())
    \n-
    73 element_type = 15;
    \n-
    74 else
    \n-
    75 DUNE_THROW(Dune::IOError, "GeometryType " << type << " is not supported by gmsh.");
    \n+
    59
    \n+
    65 void evaluate(const typename Traits::Cell& c,
    \n+
    66 const typename Traits::Domain& xl,
    \n+
    67 typename Traits::Range& result) const;
    \n+
    68 };
    \n+
    \n+
    69
    \n+
    71 //
    \n+
    72 // Class for writing SkeletonFunctions
    \n+
    73 //
    \n+
    74
    \n
    76
    \n-
    77 return element_type;
    \n-
    78 }
    \n-
    79
    \n-
    94 void outputElements(std::ofstream& file, const std::vector<int>& physicalEntities, const std::vector<int>& physicalBoundaries) const {
    \n-\n-
    96 std::size_t counter(1);
    \n-
    97 for (const auto& entity : elements(gv)) {
    \n-
    98 // Check whether the type is compatible. If not, close file and rethrow exception.
    \n-
    99 try {
    \n-
    100 std::size_t element_type = translateDuneToGmshType(entity.type());
    \n-
    101
    \n-
    102 file << counter << " " << element_type;
    \n-
    103 // If present, set the first tag to the physical entity
    \n-
    104 if (!physicalEntities.empty())
    \n-
    105 file << " " << 1 << " " << physicalEntities[elementMapper.index(entity)];
    \n-
    106 else
    \n-
    107 file << " " << 0; // "0" for "I do not use any tags."
    \n-
    108
    \n-
    109 // Output list of nodes.
    \n-
    110 // 3, 5 and 7 got different vertex numbering compared to Dune
    \n-
    111 if (3 == element_type)
    \n-
    112 file << " "
    \n-
    113 << nodeIndexFromEntity(entity, 0) << " " << nodeIndexFromEntity(entity, 1) << " "
    \n-
    114 << nodeIndexFromEntity(entity, 3) << " " << nodeIndexFromEntity(entity, 2);
    \n-
    115 else if (5 == element_type)
    \n-
    116 file << " "
    \n-
    117 << nodeIndexFromEntity(entity, 0) << " " << nodeIndexFromEntity(entity, 1) << " "
    \n-
    118 << nodeIndexFromEntity(entity, 3) << " " << nodeIndexFromEntity(entity, 2) << " "
    \n-
    119 << nodeIndexFromEntity(entity, 4) << " " << nodeIndexFromEntity(entity, 5) << " "
    \n-
    120 << nodeIndexFromEntity(entity, 7) << " " << nodeIndexFromEntity(entity, 6);
    \n-
    121 else if (7 == element_type)
    \n-
    122 file << " "
    \n-
    123 << nodeIndexFromEntity(entity, 0) << " " << nodeIndexFromEntity(entity, 1) << " "
    \n-
    124 << nodeIndexFromEntity(entity, 3) << " " << nodeIndexFromEntity(entity, 2) << " "
    \n-
    125 << nodeIndexFromEntity(entity, 4);
    \n-
    126 else {
    \n-
    127 for (int k = 0; k < entity.geometry().corners(); ++k)
    \n-
    128 file << " " << nodeIndexFromEntity(entity, k);
    \n-
    129 }
    \n-
    130 ++counter;
    \n-
    131
    \n-
    132 file << std::endl;
    \n+
    80 template<typename Func>
    \n+
    \n+\n+
    82 : public FunctionWriterBase<typename Func::Traits::Cell>
    \n+
    83 {
    \n+
    84 typedef typename Func::Traits::RangeField RF;
    \n+
    85
    \n+
    86 std::shared_ptr<const Func> func;
    \n+
    87 std::string name_;
    \n+
    88 unsigned dimR;
    \n+
    89 VTK::Precision precision_;
    \n+
    90 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    91
    \n+
    92 public:
    \n+
    \n+
    93 SkeletonFunctionWriter(const std::shared_ptr<const Func>& func_,
    \n+
    94 const std::string& name, unsigned dimR_,
    \n+\n+
    96 : func(func_), name_(name), dimR(dimR_), precision_(prec)
    \n+
    97 { }
    \n+
    \n+
    98
    \n+
    \n+
    99 SkeletonFunctionWriter(const std::shared_ptr<const Func>& func_,
    \n+
    100 const std::string& name,
    \n+\n+
    102 : func(func_), name_(name), dimR(func->dimRange()), precision_(prec)
    \n+
    103 { }
    \n+
    \n+
    104
    \n+
    106 virtual std::string name() const { return name_; }
    \n+
    107
    \n+
    109 virtual unsigned ncomps() const { return dimR; }
    \n+
    110
    \n+
    \n+
    112 virtual void addArray(PVTUWriter& writer) {
    \n+
    113 writer.addArray(name(), ncomps(), precision_);
    \n+
    114 }
    \n+
    \n+
    115
    \n+
    \n+
    117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n+
    119 nitems, precision_));
    \n+
    120 return !arraywriter->writeIsNoop();
    \n+
    121 }
    \n+
    \n+
    122
    \n+
    \n+
    124 virtual void write(const typename Func::Traits::Cell& cell,
    \n+
    125 const typename Func::Traits::Domain& xl) {
    \n+
    126 typename Func::Traits::Range result;
    \n+
    127 func->evaluate(cell, xl, result);
    \n+
    128 for(unsigned d = 0; d < result.size() && d < dimR; ++d)
    \n+
    129 arraywriter->write(result[d]);
    \n+
    130 for(unsigned d = result.size(); d < dimR; ++d)
    \n+
    131 arraywriter->write(0);
    \n+
    132 }
    \n+
    \n
    133
    \n-
    134 // Write boundaries
    \n-
    135 if (!physicalBoundaries.empty()) {
    \n-
    136 auto refElement = referenceElement<typename GridView::ctype,dim>(entity.type());
    \n-
    137 for(const auto& intersection : intersections(gv, entity)) {
    \n-
    138 if(intersection.boundary()) {
    \n-
    139 const auto faceLocalIndex(intersection.indexInInside());
    \n-
    140 file << counter << " " << translateDuneToGmshType(intersection.type())
    \n-
    141 << " " << 1 << " " << physicalBoundaries[intersection.boundarySegmentIndex()];
    \n-
    142 for (int k = 0; k < intersection.geometry().corners(); ++k)
    \n-
    143 {
    \n-
    144 const auto vtxLocalIndex(refElement.subEntity(faceLocalIndex, 1, k, dim));
    \n-
    145 file << " " << nodeIndexFromEntity(entity, vtxLocalIndex);
    \n-
    146 }
    \n-
    147 ++counter;
    \n-
    148 file << std::endl;
    \n-
    149 }
    \n-
    150 }
    \n-
    151 }
    \n-
    152
    \n-
    153 } catch(Exception& e) {
    \n-
    154 file.close();
    \n-
    155 throw;
    \n-
    156 }
    \n-
    157 }
    \n-
    158 }
    \n-
    159
    \n-
    160
    \n-
    167 void outputNodes(std::ofstream& file) const {
    \n-
    168 for (const auto& vertex : vertices(gv)) {
    \n-
    169 const auto globalCoord = vertex.geometry().center();
    \n-
    170 const auto nodeIndex = gv.indexSet().index(vertex)+1; // Start counting indices by "1".
    \n-
    171
    \n-
    172 if (1 == dimWorld)
    \n-
    173 file << nodeIndex << " " << globalCoord[0] << " " << 0 << " " << 0 << std::endl;
    \n-
    174 else if (2 == dimWorld)
    \n-
    175 file << nodeIndex << " " << globalCoord[0] << " " << globalCoord[1] << " " << 0 << std::endl;
    \n-
    176 else // (3 == dimWorld)
    \n-
    177 file << nodeIndex << " " << globalCoord[0] << " " << globalCoord[1] << " " << globalCoord[2] << std::endl;
    \n-
    178 }
    \n-
    179 }
    \n-
    180
    \n-
    181 public:
    \n-
    187 GmshWriter(const GridView& gridView, int numDigits=6) : gv(gridView), precision(numDigits) {}
    \n-
    188
    \n-
    \n-
    193 void setPrecision(int numDigits) {
    \n-
    194 precision = numDigits;
    \n-
    195 }
    \n-
    \n-
    196
    \n-
    \n-
    218 void write(const std::string& fileName,
    \n-
    219 const std::vector<int>& physicalEntities=std::vector<int>(),
    \n-
    220 const std::vector<int>& physicalBoundaries=std::vector<int>()) const {
    \n-
    221 // Open file
    \n-
    222 std::ofstream file(fileName.c_str());
    \n-
    223 if (!file.is_open())
    \n-
    224 DUNE_THROW(Dune::IOError, "Could not open " << fileName << " with write access.");
    \n-
    225
    \n-
    226 // Set precision
    \n-
    227 file << std::setprecision( precision );
    \n-
    228
    \n-
    229 // Output Header
    \n-
    230 file << "$MeshFormat" << std::endl
    \n-
    231 << "2.0 0 " << sizeof(double) << std::endl // "2.0" for "version 2.0", "0" for ASCII
    \n-
    232 << "$EndMeshFormat" << std::endl;
    \n-
    233
    \n-
    234 // Output Nodes
    \n-
    235 file << "$Nodes" << std::endl
    \n-
    236 << gv.size(dim) << std::endl;
    \n-
    237
    \n-
    238 outputNodes(file);
    \n-
    239
    \n-
    240 file << "$EndNodes" << std::endl;
    \n-
    241
    \n-
    242 // Output Elements;
    \n-
    243 int boundariesSize(0);
    \n-
    244 if(!physicalBoundaries.empty())
    \n-
    245 for(const auto& entity : elements(gv))
    \n-
    246 for(const auto& intersection : intersections(gv, entity))
    \n-
    247 if(intersection.boundary())
    \n-
    248 ++boundariesSize;
    \n-
    249
    \n-
    250 file << "$Elements" << std::endl
    \n-
    251 << gv.size(0) + boundariesSize<< std::endl;
    \n-
    252
    \n-
    253 outputElements(file, physicalEntities, physicalBoundaries);
    \n-
    254
    \n-
    255 file << "$EndElements" << std::endl;
    \n-
    256 }
    \n-
    \n-
    257
    \n-
    258 };
    \n-
    \n-
    259
    \n-
    260} // namespace Dune
    \n-
    261
    \n-
    262#endif // DUNE_GRID_IO_FILE_GMSHWRITER_HH
    \n-
    Mapper for multiple codim and multiple geometry types.
    \n-
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n-
    int size(int codim) const
    obtain number of entities in a given codimension
    Definition common/gridview.hh:183
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n-
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n+
    \n+
    135 virtual void endWrite() {
    \n+
    136 arraywriter.reset();
    \n+
    137 }
    \n+
    \n+
    138 };
    \n+
    \n+
    139
    \n+
    140 } // namespace VTK
    \n+
    141
    \n+
    143
    \n+
    144} // namespace Dune
    \n+
    145
    \n+
    146#endif // DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH
    \n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Geometry geometry() const
    obtain geometric realization of the entity
    Definition common/entity.hh:141
    \n-
    GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition common/entity.hh:146
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n-
    Index index(const EntityType &e) const
    Map entity to starting index in array for dof block.
    Definition mcmgmapper.hh:171
    \n-
    Write Gmsh mesh file.
    Definition gmshwriter.hh:37
    \n-
    GmshWriter(const GridView &gridView, int numDigits=6)
    Constructor expecting GridView of Grid to be written.
    Definition gmshwriter.hh:187
    \n-
    void setPrecision(int numDigits)
    Set the number of digits to be used when writing the vertices. By default is 6.
    Definition gmshwriter.hh:193
    \n-
    void write(const std::string &fileName, const std::vector< int > &physicalEntities=std::vector< int >(), const std::vector< int > &physicalBoundaries=std::vector< int >()) const
    Write given grid in Gmsh 2.0 compatible ASCII file.
    Definition gmshwriter.hh:218
    \n-
    Different resources needed by all grid implementations.
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+
    Base class for function writers.
    Definition functionwriter.hh:34
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n+
    void addArray(const std::string &name, unsigned ncomps, Precision prec)
    Add an array to the output file.
    Definition pvtuwriter.hh:207
    \n+
    Definition skeletonfunction.hh:37
    \n+
    RF RangeField
    Definition skeletonfunction.hh:45
    \n+
    FieldVector< DomainField, dimDomain > Domain
    Definition skeletonfunction.hh:43
    \n+
    GV GridView
    Definition skeletonfunction.hh:38
    \n+
    std::vector< RangeField > Range
    Definition skeletonfunction.hh:46
    \n+
    GV::Intersection Cell
    Definition skeletonfunction.hh:39
    \n+
    GV::ctype DomainField
    Definition skeletonfunction.hh:41
    \n+
    static const unsigned dimDomain
    Definition skeletonfunction.hh:42
    \n+
    A prototype for VTKFunctions on the skeleton.
    Definition skeletonfunction.hh:51
    \n+
    unsigned dimRange() const
    get dimension of the Range
    \n+
    SkeletonFunctionTraits< GV, RF > Traits
    Definition skeletonfunction.hh:53
    \n+
    void evaluate(const typename Traits::Cell &c, const typename Traits::Domain &xl, typename Traits::Range &result) const
    evaluate at local point xl in Cell c, store in result
    \n+
    function writer for skeleton functions
    Definition skeletonfunction.hh:83
    \n+
    virtual std::string name() const
    return name
    Definition skeletonfunction.hh:106
    \n+
    SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::string &name, VTK::Precision prec=VTK::Precision::float32)
    Definition skeletonfunction.hh:99
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition skeletonfunction.hh:112
    \n+
    virtual void write(const typename Func::Traits::Cell &cell, const typename Func::Traits::Domain &xl)
    write at the given position
    Definition skeletonfunction.hh:124
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition skeletonfunction.hh:117
    \n+
    SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::string &name, unsigned dimR_, VTK::Precision prec=VTK::Precision::float32)
    Definition skeletonfunction.hh:93
    \n+
    virtual void endWrite()
    signal end of writing
    Definition skeletonfunction.hh:135
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition skeletonfunction.hh:109
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n+
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,292 +2,233 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-gmshwriter.hh\n+ * vtk\n+skeletonfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_IO_FILE_GMSHWRITER_HH\n-6#define DUNE_GRID_IO_FILE_GMSHWRITER_HH\n-7\n-8#include \n-9#include \n-10#include \n-11#include \n-12#include \n-13\n-14#include \n-15#include \n-16#include \n-17#include \n-18#include \n-19\n-20namespace Dune {\n-21\n-35 template \n-36 class GmshWriter\n-37 {\n-38 private:\n-39 const GridView gv;\n-40 int precision;\n-41\n-42 static const unsigned int dim = GridView::dimension;\n-43 static const unsigned int dimWorld = GridView::dimensionworld;\n-44 static_assert( (dimWorld <= 3), \"GmshWriter requires dimWorld <= 3.\" );\n-45\n-47 template\n-48 std::size_t nodeIndexFromEntity(const Entity& entity, int i) const {\n-49 return gv.indexSet().subIndex(entity, i, dim)+1;\n-50 }\n-51\n-55 static std::size_t translateDuneToGmshType(const GeometryType& type) {\n-56 std::size_t element_type;\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH\n+7#define DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH\n+8\n+9#include \n+10#include \n+11#include \n+12\n+13#include \n+14\n+15#include \n+16#include \n+17#include \n+18\n+19namespace Dune {\n+20\n+23\n+29 namespace VTK {\n+30\n+32 //\n+33 // Prototype for VTKFunktions on the skeleton\n+34 //\n+35\n+36 template\n+37 struct SkeletonFunctionTraits {\n+38 typedef GV GridView;\n+39 typedef typename GV::Intersection Cell;\n+40\n+41 typedef typename GV::ctype DomainField;\n+42 static const unsigned dimDomain = GV::dimension-1;\n+43 typedef FieldVector Domain;\n+44\n+45 typedef RF RangeField;\n+46 typedef std::vector Range;\n+47 };\n+48\n+50 template \n+51 class SkeletonFunctionInterface {\n+52 public:\n+53 typedef SkeletonFunctionTraits Traits;\n+54\n+56 unsigned dimRange() const;\n 57\n-58 if (type.isLine())\n-59 element_type = 1;\n-60 else if (type.isTriangle())\n-61 element_type = 2;\n-62 else if (type.isQuadrilateral())\n-63 element_type = 3;\n-64 else if (type.isTetrahedron())\n-65 element_type = 4;\n-66 else if (type.isHexahedron())\n-67 element_type = 5;\n-68 else if (type.isPrism())\n-69 element_type = 6;\n-70 else if (type.isPyramid())\n-71 element_type = 7;\n-72 else if (type.isVertex())\n-73 element_type = 15;\n-74 else\n-75 DUNE_THROW(Dune::IOError, \"GeometryType \" << type << \" is not supported by\n-gmsh.\");\n+59\n+65 void evaluate(const typename Traits::Cell& c,\n+66 const typename Traits::Domain& xl,\n+67 typename Traits::Range& result) const;\n+68 };\n+69\n+71 //\n+72 // Class for writing SkeletonFunctions\n+73 //\n+74\n 76\n-77 return element_type;\n-78 }\n-79\n-94 void outputElements(std::ofstream& file, const std::vector&\n-physicalEntities, const std::vector& physicalBoundaries) const {\n-95 MultipleCodimMultipleGeomTypeMapper elementMapper(gv,\n-mcmgElementLayout());\n-96 std::size_t counter(1);\n-97 for (const auto& entity : elements(gv)) {\n-98 // Check whether the type is compatible. If not, close file and rethrow\n-exception.\n-99 try {\n-100 std::size_t element_type = translateDuneToGmshType(entity.type());\n-101\n-102 file << counter << \" \" << element_type;\n-103 // If present, set the first tag to the physical entity\n-104 if (!physicalEntities.empty())\n-105 file << \" \" << 1 << \" \" << physicalEntities[elementMapper.index(entity)];\n-106 else\n-107 file << \" \" << 0; // \"0\" for \"I do not use any tags.\"\n-108\n-109 // Output list of nodes.\n-110 // 3, 5 and 7 got different vertex numbering compared to Dune\n-111 if (3 == element_type)\n-112 file << \" \"\n-113 << nodeIndexFromEntity(entity, 0) << \" \" << nodeIndexFromEntity(entity, 1)\n-<< \" \"\n-114 << nodeIndexFromEntity(entity, 3) << \" \" << nodeIndexFromEntity(entity, 2);\n-115 else if (5 == element_type)\n-116 file << \" \"\n-117 << nodeIndexFromEntity(entity, 0) << \" \" << nodeIndexFromEntity(entity, 1)\n-<< \" \"\n-118 << nodeIndexFromEntity(entity, 3) << \" \" << nodeIndexFromEntity(entity, 2)\n-<< \" \"\n-119 << nodeIndexFromEntity(entity, 4) << \" \" << nodeIndexFromEntity(entity, 5)\n-<< \" \"\n-120 << nodeIndexFromEntity(entity, 7) << \" \" << nodeIndexFromEntity(entity, 6);\n-121 else if (7 == element_type)\n-122 file << \" \"\n-123 << nodeIndexFromEntity(entity, 0) << \" \" << nodeIndexFromEntity(entity, 1)\n-<< \" \"\n-124 << nodeIndexFromEntity(entity, 3) << \" \" << nodeIndexFromEntity(entity, 2)\n-<< \" \"\n-125 << nodeIndexFromEntity(entity, 4);\n-126 else {\n-127 for (int k = 0; k < entity.geometry().corners(); ++k)\n-128 file << \" \" << nodeIndexFromEntity(entity, k);\n-129 }\n-130 ++counter;\n-131\n-132 file << std::endl;\n+80 template\n+81 class SkeletonFunctionWriter\n+82 : public FunctionWriterBase\n+83 {\n+84 typedef typename Func::Traits::RangeField RF;\n+85\n+86 std::shared_ptr func;\n+87 std::string name_;\n+88 unsigned dimR;\n+89 VTK::Precision precision_;\n+90 std::shared_ptr arraywriter;\n+91\n+92 public:\n+93 SkeletonFunctionWriter(const std::shared_ptr& func_,\n+94 const std::string& name, unsigned dimR_,\n+95 VTK::Precision prec = VTK::Precision::float32)\n+96 : func(func_), name_(name), dimR(dimR_), precision_(prec)\n+97 { }\n+98\n+99 SkeletonFunctionWriter(const std::shared_ptr& func_,\n+100 const std::string& name,\n+101 VTK::Precision prec = VTK::Precision::float32)\n+102 : func(func_), name_(name), dimR(func->dimRange()), precision_(prec)\n+103 { }\n+104\n+106 virtual std::string name() const { return name_; }\n+107\n+109 virtual unsigned ncomps() const { return dimR; }\n+110\n+112 virtual void addArray(PVTUWriter& writer) {\n+113 writer.addArray(name(), ncomps(), precision_);\n+114 }\n+115\n+117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n+119 nitems, precision_));\n+120 return !arraywriter->writeIsNoop();\n+121 }\n+122\n+124 virtual void write(const typename Func::Traits::Cell& cell,\n+125 const typename Func::Traits::Domain& xl) {\n+126 typename Func::Traits::Range result;\n+127 func->evaluate(cell, xl, result);\n+128 for(unsigned d = 0; d < result.size() && d < dimR; ++d)\n+129 arraywriter->write(result[d]);\n+130 for(unsigned d = result.size(); d < dimR; ++d)\n+131 arraywriter->write(0);\n+132 }\n 133\n-134 // Write boundaries\n-135 if (!physicalBoundaries.empty()) {\n-136 auto refElement = referenceElement\n-(entity.type());\n-137 for(const auto& intersection : intersections(gv, entity)) {\n-138 if(intersection.boundary()) {\n-139 const auto faceLocalIndex(intersection.indexInInside());\n-140 file << counter << \" \" << translateDuneToGmshType(intersection.type())\n-141 << \" \" << 1 << \" \" << physicalBoundaries[intersection.boundarySegmentIndex\n-()];\n-142 for (int k = 0; k < intersection.geometry().corners(); ++k)\n-143 {\n-144 const auto vtxLocalIndex(refElement.subEntity(faceLocalIndex, 1, k, dim));\n-145 file << \" \" << nodeIndexFromEntity(entity, vtxLocalIndex);\n-146 }\n-147 ++counter;\n-148 file << std::endl;\n-149 }\n-150 }\n-151 }\n-152\n-153 } catch(Exception& e) {\n-154 file.close();\n-155 throw;\n-156 }\n-157 }\n-158 }\n-159\n-160\n-167 void outputNodes(std::ofstream& file) const {\n-168 for (const auto& vertex : vertices(gv)) {\n-169 const auto globalCoord = vertex.geometry().center();\n-170 const auto nodeIndex = gv.indexSet().index(vertex)+1; // Start counting\n-indices by \"1\".\n-171\n-172 if (1 == dimWorld)\n-173 file << nodeIndex << \" \" << globalCoord[0] << \" \" << 0 << \" \" << 0 << std::\n-endl;\n-174 else if (2 == dimWorld)\n-175 file << nodeIndex << \" \" << globalCoord[0] << \" \" << globalCoord[1] << \" \"\n-<< 0 << std::endl;\n-176 else // (3 == dimWorld)\n-177 file << nodeIndex << \" \" << globalCoord[0] << \" \" << globalCoord[1] << \" \"\n-<< globalCoord[2] << std::endl;\n-178 }\n-179 }\n-180\n-181 public:\n-187 GmshWriter(const GridView& gridView, int numDigits=6) : gv(gridView),\n-precision(numDigits) {}\n-188\n-193 void setPrecision(int numDigits) {\n-194 precision = numDigits;\n-195 }\n-196\n-218 void write(const std::string& fileName,\n-219 const std::vector& physicalEntities=std::vector(),\n-220 const std::vector& physicalBoundaries=std::vector()) const {\n-221 // Open file\n-222 std::ofstream file(fileName.c_str());\n-223 if (!file.is_open())\n-224 DUNE_THROW(Dune::IOError, \"Could not open \" << fileName << \" with write\n-access.\");\n-225\n-226 // Set precision\n-227 file << std::setprecision( precision );\n-228\n-229 // Output Header\n-230 file << \"$MeshFormat\" << std::endl\n-231 << \"2.0 0 \" << sizeof(double) << std::endl // \"2.0\" for \"version 2.0\", \"0\"\n-for ASCII\n-232 << \"$EndMeshFormat\" << std::endl;\n-233\n-234 // Output Nodes\n-235 file << \"$Nodes\" << std::endl\n-236 << gv.size(dim) << std::endl;\n-237\n-238 outputNodes(file);\n-239\n-240 file << \"$EndNodes\" << std::endl;\n-241\n-242 // Output Elements;\n-243 int boundariesSize(0);\n-244 if(!physicalBoundaries.empty())\n-245 for(const auto& entity : elements(gv))\n-246 for(const auto& intersection : intersections(gv, entity))\n-247 if(intersection.boundary())\n-248 ++boundariesSize;\n-249\n-250 file << \"$Elements\" << std::endl\n-251 << gv.size(0) + boundariesSize<< std::endl;\n-252\n-253 outputElements(file, physicalEntities, physicalBoundaries);\n-254\n-255 file << \"$EndElements\" << std::endl;\n-256 }\n-257\n-258 };\n-259\n-260} // namespace Dune\n-261\n-262#endif // DUNE_GRID_IO_FILE_GMSHWRITER_HH\n-mcmgmapper.hh\n-Mapper for multiple codim and multiple geometry types.\n-Dune::GridView::indexSet\n-const IndexSet & indexSet() const\n-obtain the index set\n-Definition common/gridview.hh:177\n-Dune::GridView::size\n-int size(int codim) const\n-obtain number of entities in a given codimension\n-Definition common/gridview.hh:183\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n-Dune::GridView::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/gridview.hh:137\n-Dune::mcmgElementLayout\n-MCMGLayout mcmgElementLayout()\n-layout for elements (codim-0 entities)\n-Definition mcmgmapper.hh:97\n+135 virtual void endWrite() {\n+136 arraywriter.reset();\n+137 }\n+138 };\n+139\n+140 } // namespace VTK\n+141\n+143\n+144} // namespace Dune\n+145\n+146#endif // DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH\n+vtuwriter.hh\n+pvtuwriter.hh\n+functionwriter.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Entity::geometry\n-Geometry geometry() const\n-obtain geometric realization of the entity\n-Definition common/entity.hh:141\n-Dune::Entity::type\n-GeometryType type() const\n-Return the name of the reference element. The type can be used to access the\n-Dune::ReferenceElement.\n-Definition common/entity.hh:146\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::MultipleCodimMultipleGeomTypeMapper\n-Implementation class for a multiple codim and multiple geometry type mapper.\n-Definition mcmgmapper.hh:129\n-Dune::MultipleCodimMultipleGeomTypeMapper::index\n-Index index(const EntityType &e) const\n-Map entity to starting index in array for dof block.\n-Definition mcmgmapper.hh:171\n-Dune::GmshWriter\n-Write Gmsh mesh file.\n-Definition gmshwriter.hh:37\n-Dune::GmshWriter::GmshWriter\n-GmshWriter(const GridView &gridView, int numDigits=6)\n-Constructor expecting GridView of Grid to be written.\n-Definition gmshwriter.hh:187\n-Dune::GmshWriter::setPrecision\n-void setPrecision(int numDigits)\n-Set the number of digits to be used when writing the vertices. By default is 6.\n-Definition gmshwriter.hh:193\n-Dune::GmshWriter::write\n-void write(const std::string &fileName, const std::vector< int >\n-&physicalEntities=std::vector< int >(), const std::vector< int >\n-&physicalBoundaries=std::vector< int >()) const\n-Write given grid in Gmsh 2.0 compatible ASCII file.\n-Definition gmshwriter.hh:218\n-grid.hh\n-Different resources needed by all grid implementations.\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::VTK::FunctionWriterBase\n+Base class for function writers.\n+Definition functionwriter.hh:34\n+Dune::VTK::PVTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition pvtuwriter.hh:62\n+Dune::VTK::PVTUWriter::addArray\n+void addArray(const std::string &name, unsigned ncomps, Precision prec)\n+Add an array to the output file.\n+Definition pvtuwriter.hh:207\n+Dune::VTK::SkeletonFunctionTraits\n+Definition skeletonfunction.hh:37\n+Dune::VTK::SkeletonFunctionTraits::RangeField\n+RF RangeField\n+Definition skeletonfunction.hh:45\n+Dune::VTK::SkeletonFunctionTraits::Domain\n+FieldVector< DomainField, dimDomain > Domain\n+Definition skeletonfunction.hh:43\n+Dune::VTK::SkeletonFunctionTraits::GridView\n+GV GridView\n+Definition skeletonfunction.hh:38\n+Dune::VTK::SkeletonFunctionTraits::Range\n+std::vector< RangeField > Range\n+Definition skeletonfunction.hh:46\n+Dune::VTK::SkeletonFunctionTraits::Cell\n+GV::Intersection Cell\n+Definition skeletonfunction.hh:39\n+Dune::VTK::SkeletonFunctionTraits::DomainField\n+GV::ctype DomainField\n+Definition skeletonfunction.hh:41\n+Dune::VTK::SkeletonFunctionTraits::dimDomain\n+static const unsigned dimDomain\n+Definition skeletonfunction.hh:42\n+Dune::VTK::SkeletonFunctionInterface\n+A prototype for VTKFunctions on the skeleton.\n+Definition skeletonfunction.hh:51\n+Dune::VTK::SkeletonFunctionInterface::dimRange\n+unsigned dimRange() const\n+get dimension of the Range\n+Dune::VTK::SkeletonFunctionInterface::Traits\n+SkeletonFunctionTraits< GV, RF > Traits\n+Definition skeletonfunction.hh:53\n+Dune::VTK::SkeletonFunctionInterface::evaluate\n+void evaluate(const typename Traits::Cell &c, const typename Traits::Domain\n+&xl, typename Traits::Range &result) const\n+evaluate at local point xl in Cell c, store in result\n+Dune::VTK::SkeletonFunctionWriter\n+function writer for skeleton functions\n+Definition skeletonfunction.hh:83\n+Dune::VTK::SkeletonFunctionWriter::name\n+virtual std::string name() const\n+return name\n+Definition skeletonfunction.hh:106\n+Dune::VTK::SkeletonFunctionWriter::SkeletonFunctionWriter\n+SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::\n+string &name, VTK::Precision prec=VTK::Precision::float32)\n+Definition skeletonfunction.hh:99\n+Dune::VTK::SkeletonFunctionWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition skeletonfunction.hh:112\n+Dune::VTK::SkeletonFunctionWriter::write\n+virtual void write(const typename Func::Traits::Cell &cell, const typename\n+Func::Traits::Domain &xl)\n+write at the given position\n+Definition skeletonfunction.hh:124\n+Dune::VTK::SkeletonFunctionWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition skeletonfunction.hh:117\n+Dune::VTK::SkeletonFunctionWriter::SkeletonFunctionWriter\n+SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::\n+string &name, unsigned dimR_, VTK::Precision prec=VTK::Precision::float32)\n+Definition skeletonfunction.hh:93\n+Dune::VTK::SkeletonFunctionWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition skeletonfunction.hh:135\n+Dune::VTK::SkeletonFunctionWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition skeletonfunction.hh:109\n+Dune::VTK::VTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition vtuwriter.hh:98\n+Dune::VTK::VTUWriter::makeArrayWriter\n+DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n+unsigned nitems, Precision prec)\n+acquire a DataArrayWriter\n+Definition vtuwriter.hh:380\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00779.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00779.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridptr.hh File Reference\n+dune-grid: b64enc.hh File Reference\n \n \n \n \n \n \n \n@@ -65,63 +65,54 @@\n \n \n \n \n \n \n \n
    \n \n-
    gridptr.hh File Reference
    \n+
    b64enc.hh File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <cctype>
    \n-#include <array>
    \n-#include <iostream>
    \n-#include <map>
    \n-#include <memory>
    \n-#include <string>
    \n-#include <type_traits>
    \n-#include <vector>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/common/shared_ptr.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/common/datahandleif.hh>
    \n-#include <dune/grid/common/intersection.hh>
    \n-#include <dune/grid/common/partitionset.hh>
    \n-#include <dune/grid/common/rangegenerators.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n-#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n-#include <dune/grid/io/file/dgfparser/parser.hh>
    \n-#include <dune/grid/io/file/gmshreader.hh>
    \n+\n+

    Simple base64 encode. \n+More...

    \n+
    #include <assert.h>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::GridPtr< GridType >
     Class for constructing grids from DGF files. More...
     
    class  Dune::GridPtr< GridType >::mygrid_ptr
     
    struct  Dune::GridPtr< GridType >::DataHandle
    struct  Dune::b64chunk
     struct representing the three byte text as well as the four 6 bit chunks More...
     
    \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n+\n+\n

    \n+Variables

    const char Dune::base64table []
     endoing table
     
    \n-
    \n+

    Detailed Description

    \n+

    Simple base64 encode.

    \n+
    Author
    Christian Engwer
    \n+

    We implement the base64 encoding (c.f. RFC 4648 https://tools.ietf.org/html/rfc4648).

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,45 +2,34 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n+ * vtk\n Classes | Namespaces\n-gridptr.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+b64enc.hh File Reference\n+Simple base64 encode. More...\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::GridPtr<_GridType_>\n-\u00a0 Class for constructing grids from DGF files. More...\n-\u00a0\n- class \u00a0 Dune::GridPtr<_GridType_>::mygrid_ptr\n-\u00a0\n-struct \u00a0 Dune::GridPtr<_GridType_>::DataHandle\n+struct \u00a0 Dune::b64chunk\n+\u00a0 struct representing the three byte text as well as the four 6 bit\n+ chunks More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+Variables\n+const char\u00a0 Dune::base64table []\n+\u00a0 endoing table\n+\u00a0\n+***** Detailed Description *****\n+Simple base64 encode.\n+ Author\n+ Christian Engwer\n+We implement the base64 encoding (c.f. RFC 4648 https://tools.ietf.org/html/\n+rfc4648).\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00779_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00779_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridptr.hh Source File\n+dune-grid: b64enc.hh Source File\n \n \n \n \n \n \n \n@@ -70,964 +70,108 @@\n \n \n \n \n \n \n \n
    \n-
    gridptr.hh
    \n+
    b64enc.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_GRIDPTR_HH
    \n-
    6#define DUNE_DGF_GRIDPTR_HH
    \n-
    7
    \n-
    8#include <cassert>
    \n-
    9#include <cctype>
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_B64ENC_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_B64ENC_HH
    \n+
    8
    \n+
    9#include <assert.h>
    \n
    10
    \n-
    11#include <array>
    \n-
    12#include <iostream>
    \n-
    13#include <map>
    \n-
    14#include <memory>
    \n-
    15#include <string>
    \n-
    16#include <type_traits>
    \n-
    17#include <vector>
    \n-
    18
    \n-
    19//- Dune includes
    \n-
    20#include <dune/common/parallel/mpihelper.hh>
    \n-
    21#include <dune/common/shared_ptr.hh>
    \n-
    22
    \n-\n-\n-\n-\n-\n-
    28
    \n-\n-\n-\n-
    32
    \n-\n-
    34
    \n-
    35namespace Dune
    \n-
    36{
    \n-
    37
    \n-
    38 // External Forward Declarations
    \n-
    39 // -----------------------------
    \n-
    40
    \n-
    41 template < class G >
    \n-
    42 struct DGFGridFactory;
    \n-
    43
    \n-
    44 template< class GridImp, class IntersectionImp >
    \n-
    45 class Intersection;
    \n-
    46
    \n-
    47
    \n-
    48
    \n-
    49 // GridPtr
    \n-
    50 // -------
    \n-
    51
    \n-
    64 template< class GridType >
    \n-
    \n-
    65 struct GridPtr
    \n-
    66 {
    \n-
    \n-
    67 class mygrid_ptr : public std::shared_ptr< GridType >
    \n-
    68 {
    \n-
    69 typedef std::shared_ptr< GridType > base_t ;
    \n-
    70 // empty deleter to avoid deletion on release
    \n-
    71 typedef null_deleter< GridType > emptydeleter_t ;
    \n-
    72
    \n-
    73 void removeObj()
    \n-
    74 {
    \n-
    75 // if use count is only 1 delete object
    \n-
    76 if( use_count() == 1 )
    \n-
    77 {
    \n-
    78 // delete point here, since we use the empty deleter
    \n-
    79 GridType* grd = release();
    \n-
    80 if( grd ) delete grd ;
    \n-
    81 }
    \n-
    82 }
    \n-
    83
    \n-
    84 void assignObj( const mygrid_ptr& other )
    \n-
    85 {
    \n-
    86 removeObj();
    \n-
    87 base_t :: operator = ( other );
    \n-
    88 }
    \n-
    89 public:
    \n-
    90 using base_t :: get ;
    \n-
    91 using base_t :: swap ;
    \n-
    92 using base_t :: use_count ;
    \n-
    93
    \n-
    94 // default constructor
    \n-
    95 mygrid_ptr() : base_t( ( GridType * ) 0, emptydeleter_t() ) {}
    \n-
    96 // copy constructor
    \n-
    97 mygrid_ptr( const mygrid_ptr& other ) : base_t(nullptr) { assignObj( other ); }
    \n-
    98 // constructor taking pointer
    \n-
    99 explicit mygrid_ptr( GridType* grd ) : base_t( grd, emptydeleter_t() ) {}
    \n-
    100
    \n-
    101 // destructor
    \n-
    102 ~mygrid_ptr() { removeObj(); }
    \n-
    103
    \n-
    104 // assignment operator
    \n-
    \n-\n-
    106 {
    \n-
    107 assignObj( other );
    \n-
    108 return *this;
    \n-
    109 }
    \n-
    \n-
    110
    \n-
    111 // release pointer
    \n-
    \n-
    112 GridType* release()
    \n-
    113 {
    \n-
    114 GridType* grd = this->get();
    \n-
    115 base_t ptr(( GridType * ) 0, emptydeleter_t() );
    \n-
    116 this->swap( ptr );
    \n-
    117 return grd ;
    \n-
    118 }
    \n-
    \n-
    119 };
    \n-
    \n-
    120
    \n-
    121 protected:
    \n-
    \n-
    122 std::string getFileExtension( const std::string& filename ) const
    \n-
    123 {
    \n-
    124 // extract file extension
    \n-
    125 auto extpos = filename.find_last_of(".");
    \n-
    126 std::string ext;
    \n-
    127 if( extpos != std::string::npos)
    \n-
    128 ext = filename.substr( extpos + 1 );
    \n-
    129
    \n-
    130 // convert all letters to lower case
    \n-
    131 for( auto& item : ext )
    \n-
    132 item = std::tolower( item );
    \n-
    133 return ext;
    \n-
    134 }
    \n-
    \n-
    135
    \n-
    136 // read gmsh file if dimension world <= 3
    \n-
    \n-
    137 void readGmsh( const std::string& filename, std::integral_constant< bool, true > )
    \n-
    138 {
    \n-
    139 GridFactory<GridType> gridFactory;
    \n-
    140 std::vector<int> boundaryIDs;
    \n-
    141 std::vector<int> elementsIDs;
    \n-
    142 GmshReader<GridType>::read(gridFactory,filename,boundaryIDs,elementsIDs);
    \n-
    143 initialize( gridFactory, boundaryIDs,elementsIDs);
    \n-
    144 }
    \n-
    \n-
    145
    \n-
    146 // if dimension world > 3 throw GridError
    \n-
    \n-
    147 void readGmsh( const std::string& filename, std::integral_constant< bool, false > )
    \n-
    148 {
    \n-
    149 DUNE_THROW(GridError, "GmshReader requires dimWorld <= 3." );
    \n-
    150 }
    \n-
    \n-
    151
    \n-
    152 public:
    \n-
    153
    \n-
    154 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    155 static const int dimension = GridType::dimension;
    \n-
    156
    \n-
    \n-
    158 explicit GridPtr ( const std::string &filename,
    \n-
    159 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    160 : gridPtr_(),
    \n-
    161 elParam_(),
    \n-
    162 vtxParam_(),
    \n-
    163 bndParam_(),
    \n-
    164 bndId_(),
    \n-
    165 emptyParam_(),
    \n-
    166 nofElParam_( 0 ),
    \n-
    167 nofVtxParam_( 0 ),
    \n-
    168 haveBndParam_( false )
    \n-
    169 {
    \n-
    170 std::string fileExt = getFileExtension( filename );
    \n-
    171
    \n-
    172 if( fileExt == "dgf" )
    \n-
    173 {
    \n-
    174 DGFGridFactory< GridType > dgfFactory( filename, comm );
    \n-
    175 initialize( dgfFactory );
    \n-
    176 }
    \n-
    177 else if( fileExt == "msh" )
    \n-
    178 {
    \n-
    179 // Gmsh reader only compiles for dimworld <= 3
    \n-
    180 readGmsh( filename, std::integral_constant< bool, GridType::dimensionworld <= 3 > () );
    \n-
    181 }
    \n-
    182 else if( fileExt == "amc" || fileExt == "2d" || fileExt == "3d" )
    \n-
    183 {
    \n-
    184 // TODO: AlbertaReader
    \n-
    185 DUNE_THROW( NotImplemented, "GridPtr: file format '" << fileExt << "' not supported yet!" );
    \n-
    186 }
    \n-
    187 else if( fileExt == "vtu" )
    \n-
    188 {
    \n-
    189 // TODO: vtu/vtk reader
    \n-
    190 DUNE_THROW( NotImplemented, "GridPtr: file format '" << fileExt << "' not supported yet!" );
    \n-
    191 }
    \n-
    192 else
    \n-
    193 {
    \n-
    194 DUNE_THROW( NotImplemented, "GridPtr: file format '" << fileExt << "' not supported yet!" );
    \n-
    195 }
    \n-
    196 }
    \n-
    \n-
    197
    \n-
    \n-
    199 explicit GridPtr ( std::istream &input,
    \n-
    200 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    201 : gridPtr_(),
    \n-
    202 elParam_(),
    \n-
    203 vtxParam_(),
    \n-
    204 bndParam_(),
    \n-
    205 bndId_(),
    \n-
    206 emptyParam_(),
    \n-
    207 nofElParam_( 0 ),
    \n-
    208 nofVtxParam_( 0 ),
    \n-
    209 haveBndParam_( false )
    \n-
    210 {
    \n-
    211 // input stream only works for DGF format right now
    \n-
    212 DGFGridFactory< GridType > dgfFactory( input, comm );
    \n-
    213 initialize( dgfFactory );
    \n-
    214 }
    \n-
    \n-
    215
    \n-
    \n-\n-
    218 : gridPtr_(),
    \n-
    219 elParam_(),
    \n-
    220 vtxParam_(),
    \n-
    221 bndParam_(),
    \n-
    222 bndId_(),
    \n-
    223 emptyParam_(),
    \n-
    224 nofElParam_(0),
    \n-
    225 nofVtxParam_(0),
    \n-
    226 haveBndParam_( false )
    \n-
    227 {}
    \n-
    \n-
    228
    \n-
    \n-
    230 explicit GridPtr( GridType *grd )
    \n-
    231 : gridPtr_(grd),
    \n-
    232 elParam_(),
    \n-
    233 vtxParam_(),
    \n-
    234 bndParam_(),
    \n-
    235 bndId_(),
    \n-
    236 emptyParam_(),
    \n-
    237 nofElParam_(0),
    \n-
    238 nofVtxParam_(0),
    \n-
    239 haveBndParam_( false )
    \n-
    240 {}
    \n-
    \n-
    241
    \n-
    243 GridPtr( const GridPtr &org ) = default;
    \n-
    244
    \n-
    \n-\n-
    247 {
    \n-
    248 gridPtr_ = org.gridPtr_;
    \n-
    249 elParam_ = org.elParam_;
    \n-
    250 vtxParam_ = org.vtxParam_;
    \n-
    251 bndParam_ = org.bndParam_;
    \n-
    252 bndId_ = org.bndId_;
    \n-\n-
    254
    \n-\n-\n-\n-
    258 return *this;
    \n-
    259 }
    \n-
    \n-
    260
    \n-
    \n-
    262 GridPtr& operator = (GridType * grd)
    \n-
    263 {
    \n-
    264 gridPtr_ = mygrid_ptr( grd );
    \n-
    265 elParam_.resize(0);
    \n-
    266 vtxParam_.resize(0);
    \n-
    267 bndParam_.resize(0);
    \n-
    268 bndId_.resize(0);
    \n-
    269 emptyParam_.resize(0);
    \n-
    270
    \n-
    271 nofVtxParam_ = 0;
    \n-
    272 nofElParam_ = 0;
    \n-
    273 haveBndParam_ = false;
    \n-
    274 return *this;
    \n-
    275 }
    \n-
    \n-
    276
    \n-
    \n-
    278 GridType& operator*() {
    \n-
    279 return *gridPtr_;
    \n-
    280 }
    \n-
    \n-
    281
    \n-
    \n-
    283 GridType* operator->() {
    \n-
    284 return gridPtr_.operator -> ();
    \n-
    285 }
    \n-
    \n-
    286
    \n-
    \n-
    288 const GridType& operator*() const {
    \n-
    289 return *gridPtr_;
    \n-
    290 }
    \n-
    \n-
    291
    \n-
    \n-
    293 const GridType* operator->() const {
    \n-
    294 return gridPtr_.operator -> ();
    \n-
    295 }
    \n-
    \n-
    296
    \n-
    298 GridType* release () { return gridPtr_.release(); }
    \n-
    299
    \n-
    \n-
    301 int nofParameters(int cdim) const {
    \n-
    302 switch (cdim) {
    \n-
    303 case 0 : return nofElParam_; break;
    \n-
    304 case GridType::dimension : return nofVtxParam_; break;
    \n-
    305 }
    \n-
    306 return 0;
    \n-
    307 }
    \n-
    \n-
    308
    \n-
    310 template <class Entity>
    \n-
    \n-
    311 int nofParameters ( const Entity & ) const
    \n-
    312 {
    \n-
    313 return nofParameters( (int) Entity::codimension );
    \n-
    314 }
    \n-
    \n-
    315
    \n-
    317 template< class GridImp, class IntersectionImp >
    \n-
    \n-\n-
    319 {
    \n-
    320 return parameters( intersection ).size();
    \n-
    321 }
    \n-
    \n-
    322
    \n-
    324 template <class Entity>
    \n-
    \n-
    325 const std::vector< double > &parameters ( const Entity &entity ) const
    \n-
    326 {
    \n-
    327 typedef typename GridType::LevelGridView GridView;
    \n-
    328 GridView gridView = gridPtr_->levelGridView( 0 );
    \n-
    329 switch( (int)Entity::codimension )
    \n-
    330 {
    \n-
    331 case 0 :
    \n-
    332 if( nofElParam_ > 0 )
    \n-
    333 {
    \n-
    334 assert( (unsigned int)gridView.indexSet().index( entity ) < elParam_.size() );
    \n-
    335 return elParam_[ gridView.indexSet().index( entity ) ];
    \n-
    336 }
    \n-
    337 break;
    \n-
    338 case GridType::dimension :
    \n-
    339 if( nofVtxParam_ > 0 )
    \n-
    340 {
    \n-
    341 assert( (unsigned int)gridView.indexSet().index( entity ) < vtxParam_.size() );
    \n-
    342 return vtxParam_[ gridView.indexSet().index( entity ) ];
    \n-
    343 }
    \n-
    344 break;
    \n-
    345 }
    \n-
    346 return emptyParam_;
    \n-
    347 }
    \n-
    \n-
    348
    \n-
    350 template< class GridImp, class IntersectionImp >
    \n-
    \n-\n-
    352 {
    \n-
    353 // if no parameters given return empty vector
    \n-
    354 if ( !haveBndParam_ )
    \n-\n-
    356
    \n-
    357 return bndParam_[ intersection.boundarySegmentIndex() ];
    \n-
    358 }
    \n-
    \n-
    359
    \n-
    \n-\n-
    361 {
    \n-
    362 if( gridPtr_->comm().size() > 1 )
    \n-
    363 {
    \n-
    364 DataHandle dh(*this);
    \n-
    365 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_All_Interface,ForwardCommunication );
    \n-
    366 }
    \n-
    367 }
    \n-
    \n-
    368
    \n-
    \n-\n-
    370 {
    \n-
    371 if( gridPtr_->comm().size() > 1 )
    \n-
    372 {
    \n-
    373 DataHandle dh(*this);
    \n-
    374 gridPtr_->loadBalance( dh.interface() );
    \n-
    375 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_All_Interface,ForwardCommunication );
    \n-
    376 }
    \n-
    377 }
    \n-
    \n-
    378
    \n-
    379 protected:
    \n-
    380 template< class Range >
    \n-
    \n-
    381 static bool isEmpty ( Range &&range )
    \n-
    382 {
    \n-
    383 return range.begin() == range.end();
    \n-
    384 }
    \n-
    \n-
    385
    \n-
    \n-\n-
    387 {
    \n-
    388 gridPtr_ = mygrid_ptr( dgfFactory.grid() );
    \n-
    389
    \n-
    390 const auto gridView = gridPtr_->levelGridView( 0 );
    \n-
    391 const auto &indexSet = gridView.indexSet();
    \n-
    392
    \n-
    393 nofElParam_ = dgfFactory.template numParameters< 0 >();
    \n-
    394 nofVtxParam_ = dgfFactory.template numParameters< dimension >();
    \n-\n-
    396
    \n-
    397 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast< int >( haveBndParam_ ) }};
    \n-
    398 gridView.comm().max( nofParams.data(), nofParams.size() );
    \n-
    399
    \n-
    400 // empty grids have no parameters associated
    \n-
    401 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )
    \n-
    402 {
    \n-
    403 nofElParam_ = nofParams[ 0 ];
    \n-
    404 nofVtxParam_ = nofParams[ 1 ];
    \n-
    405 }
    \n-
    406
    \n-
    407 // boundary parameters may be empty
    \n-
    408 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );
    \n-
    409
    \n-
    410 if( (nofElParam_ != nofParams[ 0 ]) || (nofVtxParam_ != nofParams[ 1 ]) )
    \n-
    411 DUNE_THROW( DGFException, "Number of parameters differs between processes" );
    \n-
    412
    \n-
    413 elParam_.resize( nofElParam_ > 0 ? indexSet.size( 0 ) : 0 );
    \n-
    414 vtxParam_.resize( nofVtxParam_ > 0 ? indexSet.size( dimension ) : 0 );
    \n-
    415
    \n-
    416 bndId_.resize( indexSet.size( 1 ) );
    \n-
    417 if( haveBndParam_ )
    \n-
    418 bndParam_.resize( gridPtr_->numBoundarySegments() );
    \n-
    419
    \n-
    420 for( const auto &element : elements( gridView, Partitions::interiorBorder ) )
    \n-
    421 {
    \n-
    422 if( nofElParam_ > 0 )
    \n-
    423 {
    \n-
    424 std::swap( elParam_[ indexSet.index( element ) ], dgfFactory.parameter( element ) );
    \n-
    425 assert( elParam_[ indexSet.index( element ) ].size() == static_cast< std::size_t >( nofElParam_ ) );
    \n-
    426 }
    \n-
    427
    \n-
    428 if( nofVtxParam_ > 0 )
    \n-
    429 {
    \n-
    430 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )
    \n-
    431 {
    \n-
    432 const auto index = indexSet.subIndex( element, v, dimension );
    \n-
    433 if( vtxParam_[ index ].empty() )
    \n-
    434 std::swap( vtxParam_[ index ], dgfFactory.parameter( element.template subEntity< dimension >( v ) ) );
    \n-
    435 assert( vtxParam_[ index ].size() == static_cast< std::size_t >( nofVtxParam_ ) );
    \n-
    436 }
    \n-
    437 }
    \n-
    438
    \n-
    439 if( element.hasBoundaryIntersections() )
    \n-
    440 {
    \n-
    441 for( const auto &intersection : intersections( gridView, element ) )
    \n-
    442 {
    \n-
    443 // dirty hack: check for "none" to make corner point grid work
    \n-
    444 if( !intersection.boundary() || intersection.type().isNone() )
    \n-
    445 continue;
    \n-
    446
    \n-
    447 const auto k = indexSet.subIndex( element, intersection.indexInInside(), 1 );
    \n-
    448 bndId_[ k ] = dgfFactory.boundaryId( intersection );
    \n-
    449 if( haveBndParam_ )
    \n-
    450 bndParam_[ intersection.boundarySegmentIndex() ] = dgfFactory.boundaryParameter( intersection );
    \n-
    451 }
    \n-
    452 }
    \n-
    453 }
    \n-
    454 }
    \n-
    \n-
    455
    \n-
    \n-\n-
    457 std::vector<int>& boundaryIds,
    \n-
    458 std::vector<int>& elementIds )
    \n-
    459 {
    \n-
    460 gridPtr_ = mygrid_ptr( factory.createGrid().release() );
    \n-
    461
    \n-
    462 const auto& gridView = gridPtr_->leafGridView();
    \n-
    463 const auto& indexSet = gridView.indexSet();
    \n-
    464
    \n-
    465 nofElParam_ = elementIds.empty() ? 0 : 1 ;
    \n-
    466 nofVtxParam_ = 0;
    \n-
    467 haveBndParam_ = boundaryIds.empty() ? 0 : 1 ;
    \n-
    468
    \n-
    469 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast< int >( haveBndParam_ ) }};
    \n-
    470 gridView.comm().max( nofParams.data(), nofParams.size() );
    \n-
    471
    \n-
    472 // empty grids have no parameters associated
    \n-
    473 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )
    \n-
    474 {
    \n-
    475 nofElParam_ = nofParams[ 0 ];
    \n-
    476 }
    \n-
    477
    \n-
    478 // boundary parameters may be empty
    \n-
    479 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );
    \n-
    480
    \n-
    481 // Reorder boundary IDs according to the insertion index
    \n-
    482 if(!boundaryIds.empty() || !elementIds.empty() )
    \n-
    483 {
    \n-
    484 bndParam_.resize( boundaryIds.size() );
    \n-
    485 elParam_.resize( elementIds.size(), std::vector<double>(1) );
    \n-
    486 for(const auto& entity : elements( gridView ))
    \n-
    487 {
    \n-
    488 elParam_[ indexSet.index( entity ) ][ 0 ] = elementIds[ factory.insertionIndex( entity ) ];
    \n-
    489 if( haveBndParam_ )
    \n-
    490 {
    \n-
    491 for(const auto& intersection : intersections( gridView,entity) )
    \n-
    492 {
    \n-
    493 if(intersection.boundary())
    \n-
    494 {
    \n-
    495 // DGFBoundaryParameter::type is of type string.
    \n-
    496 bndParam_[intersection.boundarySegmentIndex()] = std::to_string(boundaryIds[factory.insertionIndex(intersection)]);
    \n-
    497 }
    \n-
    498 }
    \n-
    499 }
    \n-
    500 }
    \n-
    501 }
    \n-
    502 }
    \n-
    \n-
    503
    \n-
    504 template <class Entity>
    \n-
    \n-
    505 std::vector< double > &params ( const Entity &entity )
    \n-
    506 {
    \n-
    507 const auto gridView = gridPtr_->levelGridView( 0 );
    \n-
    508 switch( (int)Entity::codimension )
    \n-
    509 {
    \n-
    510 case 0 :
    \n-
    511 if( nofElParam_ > 0 ) {
    \n-
    512 if ( gridView.indexSet().index( entity ) >= elParam_.size() )
    \n-
    513 elParam_.resize( gridView.indexSet().index( entity ) );
    \n-
    514 return elParam_[ gridView.indexSet().index( entity ) ];
    \n-
    515 }
    \n-
    516 break;
    \n-
    517 case GridType::dimension :
    \n-
    518 if( nofVtxParam_ > 0 ) {
    \n-
    519 if ( gridView.indexSet().index( entity ) >= vtxParam_.size() )
    \n-
    520 vtxParam_.resize( gridView.indexSet().index( entity ) );
    \n-
    521 return vtxParam_[ gridView.indexSet().index( entity ) ];
    \n-
    522 }
    \n-
    523 break;
    \n-
    524 }
    \n-
    525 return emptyParam_;
    \n-
    526 }
    \n-
    \n-
    527
    \n-
    \n-
    528 void setNofParams( int cdim, int nofP )
    \n-
    529 {
    \n-
    530 switch (cdim) {
    \n-
    531 case 0 : nofElParam_ = nofP; break;
    \n-
    532 case GridType::dimension : nofVtxParam_ = nofP; break;
    \n-
    533 }
    \n-
    534 }
    \n-
    \n-
    535
    \n-
    \n-\n-
    537 : public CommDataHandleIF< DataHandle, char >
    \n-
    538 {
    \n-
    \n-
    539 explicit DataHandle ( GridPtr &gridPtr )
    \n-
    540 : gridPtr_( gridPtr ), idSet_( gridPtr->localIdSet() )
    \n-
    541 {
    \n-
    542 const auto gridView = gridPtr_->levelGridView( 0 );
    \n-
    543 const auto &indexSet = gridView.indexSet();
    \n-
    544
    \n-
    545 for( const auto &element : elements( gridView, Partitions::interiorBorder ) )
    \n-
    546 {
    \n-
    547 if( gridPtr_.nofElParam_ > 0 )
    \n-
    548 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_[ idSet_.id( element ) ] );
    \n-
    549
    \n-
    550 if( gridPtr_.nofVtxParam_ > 0 )
    \n-
    551 {
    \n-
    552 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )
    \n-
    553 {
    \n-
    554 const auto index = indexSet.subIndex( element, v, dimension );
    \n-
    555 if ( !gridPtr_.vtxParam_[ index ].empty() )
    \n-
    556 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v, dimension ) ] );
    \n-
    557 }
    \n-
    558 }
    \n-
    559
    \n-
    560 if( element.hasBoundaryIntersections() )
    \n-
    561 {
    \n-
    562 for( const auto &intersection : intersections( gridView, element ) )
    \n-
    563 {
    \n-
    564 // dirty hack: check for "none" to make corner point grid work
    \n-
    565 if( !intersection.boundary() || intersection.type().isNone() )
    \n-
    566 continue;
    \n-
    567
    \n-
    568 const int i = intersection.indexInInside();
    \n-
    569 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];
    \n-
    570 bndData.first = gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ];
    \n-
    571 if( gridPtr_.haveBndParam_ )
    \n-
    572 std::swap( bndData.second, gridPtr_.bndParam_[ intersection.boundarySegmentIndex() ] );
    \n-
    573 }
    \n-
    574 }
    \n-
    575 }
    \n-
    576 }
    \n-
    \n-
    577
    \n-
    578 DataHandle ( const DataHandle & ) = delete;
    \n-
    579 DataHandle ( DataHandle && ) = delete;
    \n-
    580
    \n-
    \n-\n-
    582 {
    \n-
    583 const auto gridView = gridPtr_->levelGridView( 0 );
    \n-
    584 const auto &indexSet = gridView.indexSet();
    \n-
    585
    \n-
    586 if( gridPtr_.nofElParam_ > 0 )
    \n-
    587 gridPtr_.elParam_.resize( indexSet.size( 0 ) );
    \n-
    588 if( gridPtr_.nofVtxParam_ > 0 )
    \n-
    589 gridPtr_.vtxParam_.resize( indexSet.size( dimension ) );
    \n-
    590 gridPtr_.bndId_.resize( indexSet.size( 1 ) );
    \n-
    591 if( gridPtr_.haveBndParam_ )
    \n-
    592 gridPtr_.bndParam_.resize( gridPtr_->numBoundarySegments() );
    \n-
    593
    \n-
    594 for( const auto &element : elements( gridView, Partitions::all ) )
    \n-
    595 {
    \n-
    596 if( gridPtr_.nofElParam_ > 0 )
    \n-
    597 {
    \n-
    598 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_[ idSet_.id( element ) ] );
    \n-
    599 assert( gridPtr_.elParam_[ indexSet.index( element ) ].size() == static_cast< std::size_t >( gridPtr_.nofElParam_ ) );
    \n-
    600 }
    \n-
    601
    \n-
    602 if( gridPtr_.nofVtxParam_ > 0 )
    \n-
    603 {
    \n-
    604 for( unsigned int v = 0; v < element.subEntities( dimension ); ++v )
    \n-
    605 {
    \n-
    606 const auto index = indexSet.subIndex( element, v, dimension );
    \n-
    607 if( gridPtr_.vtxParam_[ index ].empty() )
    \n-
    608 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v, dimension ) ] );
    \n-
    609 assert( gridPtr_.vtxParam_[ index ].size() == static_cast< std::size_t >( gridPtr_.nofVtxParam_ ) );
    \n-
    610 }
    \n-
    611 }
    \n-
    612
    \n-
    613 if( element.hasBoundaryIntersections() )
    \n-
    614 {
    \n-
    615 for( const auto &intersection : intersections( gridView, element ) )
    \n-
    616 {
    \n-
    617 // dirty hack: check for "none" to make corner point grid work
    \n-
    618 if( !intersection.boundary() || intersection.type().isNone() )
    \n-
    619 continue;
    \n-
    620
    \n-
    621 const int i = intersection.indexInInside();
    \n-
    622 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];
    \n-
    623 gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ] = bndData.first;
    \n-
    624 if( gridPtr_.haveBndParam_ )
    \n-
    625 std::swap( bndData.second, gridPtr_.bndParam_[ intersection.boundarySegmentIndex() ] );
    \n-
    626 }
    \n-
    627 }
    \n-
    628 }
    \n-
    629 }
    \n-
    630
    \n-\n-
    \n-
    632
    \n-
    \n-
    633 bool contains ( int dim, int codim ) const
    \n-
    634 {
    \n-
    635 assert( dim == dimension );
    \n-
    636 // do not use a switch statement, because dimension == 1 is possible
    \n-
    637 return (codim == 1) || ((codim == dimension) && (gridPtr_.nofVtxParam_ > 0)) || ((codim == 0) && (gridPtr_.nofElParam_ > 0));
    \n-
    638 }
    \n-
    \n-
    639
    \n-
    640 bool fixedSize (int /* dim */, int /* codim */) const { return false; }
    \n-
    641
    \n-
    642 template< class Entity >
    \n-
    \n-
    643 std::size_t size ( const Entity &entity ) const
    \n-
    644 {
    \n-
    645 std::size_t totalSize = 0;
    \n-
    646
    \n-
    647 // do not use a switch statement, because dimension == 1 is possible
    \n-
    648 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )
    \n-
    649 {
    \n-
    650 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofElParam_ ) );
    \n-
    651 for( double &v : elData_[ idSet_.id( entity ) ] )
    \n-
    652 totalSize += dataSize( v );
    \n-
    653 }
    \n-
    654
    \n-
    655 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )
    \n-
    656 {
    \n-
    657 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofVtxParam_ ) );
    \n-
    658 for( double &v : vtxData_[ idSet_.id( entity ) ] )
    \n-
    659 totalSize += dataSize( v );
    \n-
    660 }
    \n-
    661
    \n-
    662 if( Entity::codimension == 1 )
    \n-
    663 {
    \n-
    664 const auto bndData = bndData_.find( idSet_.id( entity ) );
    \n-
    665 if( bndData != bndData_.end() )
    \n-
    666 totalSize += dataSize( bndData->second.first ) + dataSize( bndData->second.second );
    \n-
    667 }
    \n-
    668
    \n-
    669 return totalSize;
    \n-
    670 }
    \n-
    \n-
    671
    \n-
    672 template< class Buffer, class Entity >
    \n-
    \n-
    673 void gather ( Buffer &buffer, const Entity &entity ) const
    \n-
    674 {
    \n-
    675 // do not use a switch statement, because dimension == 1 is possible
    \n-
    676 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )
    \n-
    677 {
    \n-
    678 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofElParam_ ) );
    \n-
    679 for( double &v : elData_[ idSet_.id( entity ) ] )
    \n-
    680 write( buffer, v );
    \n-
    681 }
    \n-
    682
    \n-
    683 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )
    \n-
    684 {
    \n-
    685 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofVtxParam_ ) );
    \n-
    686 for( double &v : vtxData_[ idSet_.id( entity ) ] )
    \n-
    687 write( buffer, v );
    \n-
    688 }
    \n-
    689
    \n-
    690 if( Entity::codimension == 1 )
    \n-
    691 {
    \n-
    692 const auto bndData = bndData_.find( idSet_.id( entity ) );
    \n-
    693 if( bndData != bndData_.end() )
    \n-
    694 {
    \n-
    695 write( buffer, bndData->second.first );
    \n-
    696 write( buffer, bndData->second.second );
    \n-
    697 }
    \n-
    698 }
    \n-
    699 }
    \n-
    \n-
    700
    \n-
    701 template< class Buffer, class Entity >
    \n-
    \n-
    702 void scatter ( Buffer &buffer, const Entity &entity, std::size_t n )
    \n-
    703 {
    \n-
    704 // do not use a switch statement, because dimension == 1 is possible
    \n-
    705 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )
    \n-
    706 {
    \n-
    707 auto &p = elData_[ idSet_.id( entity ) ];
    \n-
    708 p.resize( gridPtr_.nofElParam_ );
    \n-
    709 for( double &v : p )
    \n-
    710 read( buffer, v, n );
    \n-
    711 }
    \n-
    712
    \n-
    713 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )
    \n-
    714 {
    \n-
    715 auto &p = vtxData_[ idSet_.id( entity ) ];
    \n-
    716 p.resize( gridPtr_.nofVtxParam_ );
    \n-
    717 for( double &v : p )
    \n-
    718 read( buffer, v, n );
    \n-
    719 }
    \n-
    720
    \n-
    721 if( (Entity::codimension == 1) && (n > 0) )
    \n-
    722 {
    \n-
    723 auto &bndData = bndData_[ idSet_.id( entity ) ];
    \n-
    724 read( buffer, bndData.first, n );
    \n-
    725 read( buffer, bndData.second, n );
    \n-
    726 }
    \n-
    727
    \n-
    728 assert( n == 0 );
    \n-
    729 }
    \n-
    \n-
    730
    \n-
    731 private:
    \n-
    732 template< class T >
    \n-
    733 static std::enable_if_t< std::is_trivially_copyable< T >::value, std::size_t > dataSize ( const T & /* value */ )
    \n-
    734 {
    \n-
    735 return sizeof( T );
    \n-
    736 }
    \n-
    737
    \n-
    738 static std::size_t dataSize ( const std::string &s )
    \n-
    739 {
    \n-
    740 return dataSize( s.size() ) + s.size();
    \n-
    741 }
    \n-
    742
    \n-
    743 template< class Buffer, class T >
    \n-
    744 static std::enable_if_t< std::is_trivially_copyable< T >::value > write ( Buffer &buffer, const T &value )
    \n-
    745 {
    \n-
    746 std::array< char, sizeof( T ) > bytes;
    \n-
    747 std::memcpy( bytes.data(), &value, sizeof( T ) );
    \n-
    748 for( char &b : bytes )
    \n-
    749 buffer.write( b );
    \n-
    750 }
    \n-
    751
    \n-
    752 template< class Buffer >
    \n-
    753 static void write ( Buffer &buffer, const std::string &s )
    \n-
    754 {
    \n-
    755 write( buffer, s.size() );
    \n-
    756 for( const char &c : s )
    \n-
    757 buffer.write( c );
    \n-
    758 }
    \n-
    759
    \n-
    760 template< class Buffer, class T >
    \n-
    761 static std::enable_if_t< std::is_trivially_copyable< T >::value > read ( Buffer &buffer, T &value, std::size_t &n )
    \n-
    762 {
    \n-
    763 assert( n >= sizeof( T ) );
    \n-
    764 n -= sizeof( T );
    \n-
    765
    \n-
    766 std::array< char, sizeof( T ) > bytes;
    \n-
    767 for( char &b : bytes )
    \n-
    768 buffer.read( b );
    \n-
    769 std::memcpy( &value, bytes.data(), sizeof( T ) );
    \n-
    770 }
    \n-
    771
    \n-
    772 template< class Buffer >
    \n-
    773 static void read ( Buffer &buffer, std::string &s, std::size_t &n )
    \n-
    774 {
    \n-
    775 std::size_t size;
    \n-
    776 read( buffer, size, n );
    \n-
    777 s.resize( size );
    \n-
    778
    \n-
    779 assert( n >= size );
    \n-
    780 n -= size;
    \n-
    781
    \n-
    782 for( char &c : s )
    \n-
    783 buffer.read( c );
    \n-
    784 }
    \n-
    785
    \n-
    786 GridPtr &gridPtr_;
    \n-
    787 const typename GridType::LocalIdSet &idSet_;
    \n-
    788 mutable std::map< typename GridType::LocalIdSet::IdType, std::vector< double > > elData_, vtxData_;
    \n-
    789 mutable std::map< typename GridType::LocalIdSet::IdType, std::pair< int, DGFBoundaryParameter::type > > bndData_;
    \n-
    790 };
    \n-
    \n-
    791
    \n-
    792 // grid auto pointer
    \n-\n-
    794 // element and vertex parameters
    \n-
    795 std::vector< std::vector< double > > elParam_;
    \n-
    796 std::vector< std::vector< double > > vtxParam_;
    \n-
    797 std::vector< DGFBoundaryParameter::type > bndParam_;
    \n-
    798 std::vector< int > bndId_;
    \n-
    799 std::vector< double > emptyParam_;
    \n-
    800
    \n-\n-\n-\n-
    804 }; // end of class GridPtr
    \n-
    \n-
    805
    \n-
    806} // end namespace Dune
    \n-
    807
    \n-
    808#endif
    \n-\n-
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n-\n-\n-\n-\n-\n-\n-
    @ ForwardCommunication
    communicate as given in InterfaceType
    Definition gridenums.hh:171
    \n-
    @ InteriorBorder_All_Interface
    send interior and border, receive all entities
    Definition gridenums.hh:88
    \n-
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n-
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n+
    11namespace Dune {
    \n+
    12
    \n+
    \n+
    23 const char base64table[] =
    \n+
    24 {
    \n+
    25 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
    \n+
    26 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
    \n+
    27 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
    \n+
    28 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
    \n+
    29 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
    \n+
    30 };
    \n+
    \n+
    31
    \n+
    \n+
    33 struct b64chunk
    \n+
    34 {
    \n+
    35 using size_type = unsigned char;
    \n+\n+
    37 char txt[3];
    \n+
    38
    \n+
    \n+
    39 void reset()
    \n+
    40 {
    \n+
    41 size = 0;
    \n+
    42 txt[0] = txt[1] = txt[2] = 0;
    \n+
    43 }
    \n+
    \n+
    44
    \n+
    \n+
    45 int read(const char* t, size_type s)
    \n+
    46 {
    \n+
    47 size = s>=3 ? 3 : s;
    \n+
    48 txt[0] = s>0 ? t[0] : 0;
    \n+
    49 txt[1] = s>1 ? t[1] : 0;
    \n+
    50 txt[2] = s>2 ? t[2] : 0;
    \n+
    51 return size;
    \n+
    52 }
    \n+
    \n+
    53
    \n+
    \n+
    54 void put(const char c)
    \n+
    55 {
    \n+
    56 assert (size < 3);
    \n+
    57 txt[size++] = c;
    \n+
    58 }
    \n+
    \n+
    59
    \n+
    \n+
    60 void write(char* t)
    \n+
    61 {
    \n+
    62 const unsigned A = (txt[0] & 0b1111'1100) >> 2;
    \n+
    63 const unsigned B = (txt[0] & 0b0000'0011) << 4 | (txt[1] & 0b1111'0000) >> 4;
    \n+
    64 const unsigned C = (txt[1] & 0b0000'1111) << 2 | (txt[2] & 0b1100'0000) >> 6;
    \n+
    65 const unsigned D = txt[2] & 0b0011'1111;
    \n+
    66 t[0] = size>0 ? base64table[A] : '=';
    \n+
    67 t[1] = size>0 ? base64table[B] : '=';
    \n+
    68 t[2] = size>1 ? base64table[C] : '=';
    \n+
    69 t[3] = size>2 ? base64table[D] : '=';
    \n+
    70 size = 0;
    \n+
    71 }
    \n+
    \n+
    72 };
    \n+
    \n+
    73
    \n+
    76} // namespace Dune
    \n+
    77
    \n+
    78#endif // DUNE_GRID_IO_FILE_VTK_B64ENC_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    constexpr All all
    PartitionSet for all partitions.
    Definition partitionset.hh:295
    \n-
    constexpr InteriorBorder interiorBorder
    PartitionSet for the interior and border partitions.
    Definition partitionset.hh:286
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    int boundaryId(const Intersection &intersection) const
    Definition dgfgridfactory.hh:102
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfgridfactory.hh:158
    \n-
    Grid * grid()
    Definition dgfgridfactory.hh:90
    \n-
    std::vector< double > & parameter(const Element &element)
    Definition dgfgridfactory.hh:124
    \n-
    bool haveBoundaryParameters() const
    Definition dgfgridfactory.hh:151
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    size_t boundarySegmentIndex() const
    index of the boundary segment within the macro grid
    Definition common/intersection.hh:236
    \n-
    CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
    Definition datahandleif.hh:78
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n-
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n-
    virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
    obtain an element's insertion index
    Definition common/gridfactory.hh:181
    \n-
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n-
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n-
    Class for constructing grids from DGF files.
    Definition gridptr.hh:66
    \n-
    GridPtr(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor given a std::istream
    Definition gridptr.hh:199
    \n-
    const std::vector< double > & parameters(const Entity &entity) const
    get parameters defined for each codim 0 und dim entity on the grid through the grid file
    Definition gridptr.hh:325
    \n-
    GridPtr()
    Default constructor, creating empty GridPtr.
    Definition gridptr.hh:217
    \n-
    const GridType & operator*() const
    return const reference to GridType instance
    Definition gridptr.hh:288
    \n-
    bool haveBndParam_
    Definition gridptr.hh:803
    \n-
    static const int dimension
    Definition gridptr.hh:155
    \n-
    std::vector< int > bndId_
    Definition gridptr.hh:798
    \n-
    void setNofParams(int cdim, int nofP)
    Definition gridptr.hh:528
    \n-
    void loadBalance()
    Definition gridptr.hh:369
    \n-
    std::vector< DGFBoundaryParameter::type > bndParam_
    Definition gridptr.hh:797
    \n-
    void initialize(GridFactory< GridType > &factory, std::vector< int > &boundaryIds, std::vector< int > &elementIds)
    Definition gridptr.hh:456
    \n-
    GridPtr(GridType *grd)
    Constructor storing given pointer to internal auto pointer.
    Definition gridptr.hh:230
    \n-
    int nofElParam_
    Definition gridptr.hh:801
    \n-
    const DGFBoundaryParameter::type & parameters(const Intersection< GridImp, IntersectionImp > &intersection) const
    get parameters for intersection
    Definition gridptr.hh:351
    \n-
    GridType & operator*()
    return reference to GridType instance
    Definition gridptr.hh:278
    \n-
    static bool isEmpty(Range &&range)
    Definition gridptr.hh:381
    \n-
    int nofParameters(const Entity &) const
    get parameters defined for given entity
    Definition gridptr.hh:311
    \n-
    GridPtr(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor given the name of a DGF file
    Definition gridptr.hh:158
    \n-
    std::vector< std::vector< double > > elParam_
    Definition gridptr.hh:795
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition gridptr.hh:154
    \n-
    GridPtr & operator=(const GridPtr &org)
    assignment of grid pointer
    Definition gridptr.hh:246
    \n-
    int nofParameters(int cdim) const
    get number of parameters defined for a given codimension
    Definition gridptr.hh:301
    \n-
    int nofParameters(const Intersection< GridImp, IntersectionImp > &intersection) const
    get number of parameters defined for a given intersection
    Definition gridptr.hh:318
    \n-
    std::vector< double > emptyParam_
    Definition gridptr.hh:799
    \n-
    mygrid_ptr gridPtr_
    Definition gridptr.hh:793
    \n-
    void readGmsh(const std::string &filename, std::integral_constant< bool, false >)
    Definition gridptr.hh:147
    \n-
    void readGmsh(const std::string &filename, std::integral_constant< bool, true >)
    Definition gridptr.hh:137
    \n-
    std::vector< double > & params(const Entity &entity)
    Definition gridptr.hh:505
    \n-
    void initialize(DGFGridFactory< GridType > &dgfFactory)
    Definition gridptr.hh:386
    \n-
    GridPtr(const GridPtr &org)=default
    Copy constructor, copies internal auto pointer.
    \n-
    std::string getFileExtension(const std::string &filename) const
    Definition gridptr.hh:122
    \n-
    const GridType * operator->() const
    return const pointer to GridType instance
    Definition gridptr.hh:293
    \n-
    GridType * release()
    release pointer from internal ownership
    Definition gridptr.hh:298
    \n-
    void communicate()
    Definition gridptr.hh:360
    \n-
    std::vector< std::vector< double > > vtxParam_
    Definition gridptr.hh:796
    \n-
    GridType * operator->()
    return pointer to GridType instance
    Definition gridptr.hh:283
    \n-
    int nofVtxParam_
    Definition gridptr.hh:802
    \n-
    Definition gridptr.hh:68
    \n-
    mygrid_ptr(GridType *grd)
    Definition gridptr.hh:99
    \n-
    ~mygrid_ptr()
    Definition gridptr.hh:102
    \n-
    GridType * release()
    Definition gridptr.hh:112
    \n-
    mygrid_ptr(const mygrid_ptr &other)
    Definition gridptr.hh:97
    \n-
    mygrid_ptr & operator=(const mygrid_ptr &other)
    Definition gridptr.hh:105
    \n-
    mygrid_ptr()
    Definition gridptr.hh:95
    \n-
    Definition gridptr.hh:538
    \n-
    CommDataHandleIF< DataHandle, char > & interface()
    Definition gridptr.hh:631
    \n-
    DataHandle(const DataHandle &)=delete
    \n-
    ~DataHandle()
    Definition gridptr.hh:581
    \n-
    DataHandle(GridPtr &gridPtr)
    Definition gridptr.hh:539
    \n-
    void gather(Buffer &buffer, const Entity &entity) const
    Definition gridptr.hh:673
    \n-
    bool fixedSize(int, int) const
    Definition gridptr.hh:640
    \n-
    std::size_t size(const Entity &entity) const
    Definition gridptr.hh:643
    \n-
    DataHandle(DataHandle &&)=delete
    \n-
    void scatter(Buffer &buffer, const Entity &entity, std::size_t n)
    Definition gridptr.hh:702
    \n-
    bool contains(int dim, int codim) const
    Definition gridptr.hh:633
    \n-
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-
    static std::unique_ptr< Grid > read(const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
    Definition gmshreader.hh:937
    \n-\n+
    const char base64table[]
    endoing table
    Definition b64enc.hh:23
    \n+
    struct representing the three byte text as well as the four 6 bit chunks
    Definition b64enc.hh:34
    \n+
    char txt[3]
    Definition b64enc.hh:37
    \n+
    unsigned char size_type
    Definition b64enc.hh:35
    \n+
    void write(char *t)
    Definition b64enc.hh:60
    \n+
    size_type size
    Definition b64enc.hh:36
    \n+
    int read(const char *t, size_type s)
    Definition b64enc.hh:45
    \n+
    void put(const char c)
    Definition b64enc.hh:54
    \n+
    void reset()
    Definition b64enc.hh:39
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,1132 +2,111 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n-gridptr.hh\n+ * vtk\n+b64enc.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_GRIDPTR_HH\n-6#define DUNE_DGF_GRIDPTR_HH\n-7\n-8#include \n-9#include \n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_B64ENC_HH\n+7#define DUNE_GRID_IO_FILE_VTK_B64ENC_HH\n+8\n+9#include \n 10\n-11#include \n-12#include \n-13#include \n-14#include \n-15#include \n-16#include \n-17#include \n-18\n-19//- Dune includes\n-20#include \n-21#include \n-22\n-23#include \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-36{\n-37\n-38 // External Forward Declarations\n-39 // -----------------------------\n-40\n-41 template < class G >\n-42 struct DGFGridFactory;\n-43\n-44 template< class GridImp, class IntersectionImp >\n-45 class Intersection;\n-46\n-47\n-48\n-49 // GridPtr\n-50 // -------\n-51\n-64 template< class GridType >\n-65 struct GridPtr\n-66 {\n-67 class mygrid_ptr : public std::shared_ptr< GridType >\n-68 {\n-69 typedef std::shared_ptr< GridType > base_t ;\n-70 // empty deleter to avoid deletion on release\n-71 typedef null_deleter< GridType > emptydeleter_t ;\n-72\n-73 void removeObj()\n-74 {\n-75 // if use count is only 1 delete object\n-76 if( use_count() == 1 )\n-77 {\n-78 // delete point here, since we use the empty deleter\n-79 GridType* grd = release();\n-80 if( grd ) delete grd ;\n-81 }\n-82 }\n-83\n-84 void assignObj( const mygrid_ptr& other )\n-85 {\n-86 removeObj();\n-87 base_t :: operator = ( other );\n-88 }\n-89 public:\n-90 using base_t :: get ;\n-91 using base_t :: swap ;\n-92 using base_t :: use_count ;\n-93\n-94 // default constructor\n-95 mygrid_ptr() : base_t( ( GridType * ) 0, emptydeleter_t() ) {}\n-96 // copy constructor\n-97 mygrid_ptr( const mygrid_ptr& other ) : base_t(nullptr) { assignObj( other\n-); }\n-98 // constructor taking pointer\n-99 explicit mygrid_ptr( GridType* grd ) : base_t( grd, emptydeleter_t() ) {}\n-100\n-101 // destructor\n-102 ~mygrid_ptr() { removeObj(); }\n-103\n-104 // assignment operator\n-105 mygrid_ptr& operator_=_( const mygrid_ptr& other )\n-106 {\n-107 assignObj( other );\n-108 return *this;\n-109 }\n-110\n-111 // release pointer\n-112 GridType* release()\n-113 {\n-114 GridType* grd = this->get();\n-115 base_t ptr(( GridType * ) 0, emptydeleter_t() );\n-116 this->swap( ptr );\n-117 return grd ;\n-118 }\n-119 };\n-120\n-121 protected:\n-122 std::string getFileExtension( const std::string& filename ) const\n-123 {\n-124 // extract file extension\n-125 auto extpos = filename.find_last_of(\".\");\n-126 std::string ext;\n-127 if( extpos != std::string::npos)\n-128 ext = filename.substr( extpos + 1 );\n-129\n-130 // convert all letters to lower case\n-131 for( auto& item : ext )\n-132 item = std::tolower( item );\n-133 return ext;\n-134 }\n-135\n-136 // read gmsh file if dimension world <= 3\n-137 void readGmsh( const std::string& filename, std::integral_constant< bool,\n-true > )\n-138 {\n-139 GridFactory gridFactory;\n-140 std::vector boundaryIDs;\n-141 std::vector elementsIDs;\n-142 GmshReader::read(gridFactory,filename,boundaryIDs,elementsIDs);\n-143 initialize( gridFactory, boundaryIDs,elementsIDs);\n-144 }\n-145\n-146 // if dimension world > 3 throw GridError\n-147 void readGmsh( const std::string& filename, std::integral_constant< bool,\n-false > )\n-148 {\n-149 DUNE_THROW(GridError, \"GmshReader requires dimWorld <= 3.\" );\n-150 }\n-151\n-152 public:\n-153\n-154 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-155 static const int dimension = GridType::dimension;\n-156\n-158 explicit GridPtr ( const std::string &filename,\n-159 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-160 : gridPtr_(),\n-161 elParam_(),\n-162 vtxParam_(),\n-163 bndParam_(),\n-164 bndId_(),\n-165 emptyParam_(),\n-166 nofElParam_( 0 ),\n-167 nofVtxParam_( 0 ),\n-168 haveBndParam_( false )\n-169 {\n-170 std::string fileExt = getFileExtension( filename );\n-171\n-172 if( fileExt == \"dgf\" )\n-173 {\n-174 DGFGridFactory<_GridType_> dgfFactory( filename, comm );\n-175 initialize( dgfFactory );\n-176 }\n-177 else if( fileExt == \"msh\" )\n-178 {\n-179 // Gmsh reader only compiles for dimworld <= 3\n-180 readGmsh( filename, std::integral_constant< bool, GridType::dimensionworld\n-<= 3 > () );\n-181 }\n-182 else if( fileExt == \"amc\" || fileExt == \"2d\" || fileExt == \"3d\" )\n-183 {\n-184 // TODO: AlbertaReader\n-185 DUNE_THROW( NotImplemented, \"GridPtr: file format '\" << fileExt << \"' not\n-supported yet!\" );\n-186 }\n-187 else if( fileExt == \"vtu\" )\n-188 {\n-189 // TODO: vtu/vtk reader\n-190 DUNE_THROW( NotImplemented, \"GridPtr: file format '\" << fileExt << \"' not\n-supported yet!\" );\n-191 }\n-192 else\n-193 {\n-194 DUNE_THROW( NotImplemented, \"GridPtr: file format '\" << fileExt << \"' not\n-supported yet!\" );\n-195 }\n-196 }\n-197\n-199 explicit GridPtr ( std::istream &input,\n-200 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-201 : gridPtr_(),\n-202 elParam_(),\n-203 vtxParam_(),\n-204 bndParam_(),\n-205 bndId_(),\n-206 emptyParam_(),\n-207 nofElParam_( 0 ),\n-208 nofVtxParam_( 0 ),\n-209 haveBndParam_( false )\n-210 {\n-211 // input stream only works for DGF format right now\n-212 DGFGridFactory<_GridType_> dgfFactory( input, comm );\n-213 initialize( dgfFactory );\n-214 }\n-215\n-217 GridPtr()\n-218 : gridPtr_(),\n-219 elParam_(),\n-220 vtxParam_(),\n-221 bndParam_(),\n-222 bndId_(),\n-223 emptyParam_(),\n-224 nofElParam_(0),\n-225 nofVtxParam_(0),\n-226 haveBndParam_( false )\n-227 {}\n-228\n-230 explicit GridPtr( GridType *grd )\n-231 : gridPtr_(grd),\n-232 elParam_(),\n-233 vtxParam_(),\n-234 bndParam_(),\n-235 bndId_(),\n-236 emptyParam_(),\n-237 nofElParam_(0),\n-238 nofVtxParam_(0),\n-239 haveBndParam_( false )\n-240 {}\n-241\n-243 GridPtr( const GridPtr &org ) = default;\n-244\n-246 GridPtr& operator=_( const GridPtr &org )\n-247 {\n-248 gridPtr_ = org.gridPtr_;\n-249 elParam_ = org.elParam_;\n-250 vtxParam_ = org.vtxParam_;\n-251 bndParam_ = org.bndParam_;\n-252 bndId_ = org.bndId_;\n-253 emptyParam_ = org.emptyParam_;\n-254\n-255 nofElParam_ = org.nofElParam_;\n-256 nofVtxParam_ = org.nofVtxParam_;\n-257 haveBndParam_ = org.haveBndParam_;\n-258 return *this;\n-259 }\n-260\n-262 GridPtr& operator_=_(GridType * grd)\n-263 {\n-264 gridPtr_ = mygrid_ptr( grd );\n-265 elParam_.resize(0);\n-266 vtxParam_.resize(0);\n-267 bndParam_.resize(0);\n-268 bndId_.resize(0);\n-269 emptyParam_.resize(0);\n-270\n-271 nofVtxParam_ = 0;\n-272 nofElParam_ = 0;\n-273 haveBndParam_ = false;\n-274 return *this;\n-275 }\n-276\n-278 GridType& operator*() {\n-279 return *gridPtr_;\n-280 }\n-281\n-283 GridType* operator->() {\n-284 return gridPtr_.operator -> ();\n-285 }\n-286\n-288 const GridType& operator*() const {\n-289 return *gridPtr_;\n-290 }\n-291\n-293 const GridType* operator->() const {\n-294 return gridPtr_.operator -> ();\n-295 }\n-296\n-298 GridType* release () { return gridPtr_.release(); }\n-299\n-301 int nofParameters(int cdim) const {\n-302 switch (cdim) {\n-303 case 0 : return nofElParam_; break;\n-304 case GridType::dimension : return nofVtxParam_; break;\n-305 }\n-306 return 0;\n-307 }\n-308\n-310 template \n-311 int nofParameters ( const Entity & ) const\n-312 {\n-313 return nofParameters( (int) Entity::codimension );\n-314 }\n-315\n-317 template< class GridImp, class IntersectionImp >\n-318 int nofParameters ( const Intersection<_GridImp,_IntersectionImp_> &\n-intersection ) const\n-319 {\n-320 return parameters( intersection ).size();\n-321 }\n-322\n-324 template \n-325 const std::vector< double > ¶meters ( const Entity &entity ) const\n-326 {\n-327 typedef typename GridType::LevelGridView GridView;\n-328 GridView gridView = gridPtr_->levelGridView( 0 );\n-329 switch( (int)Entity::codimension )\n-330 {\n-331 case 0 :\n-332 if( nofElParam_ > 0 )\n-333 {\n-334 assert( (unsigned int)gridView.indexSet().index( entity ) < elParam_.size()\n-);\n-335 return elParam_[ gridView.indexSet().index( entity ) ];\n-336 }\n-337 break;\n-338 case GridType::dimension :\n-339 if( nofVtxParam_ > 0 )\n-340 {\n-341 assert( (unsigned int)gridView.indexSet().index( entity ) < vtxParam_.size\n-() );\n-342 return vtxParam_[ gridView.indexSet().index( entity ) ];\n-343 }\n-344 break;\n-345 }\n-346 return emptyParam_;\n-347 }\n-348\n-350 template< class GridImp, class IntersectionImp >\n-351 const DGFBoundaryParameter::type & parameters ( const Intersection<\n-GridImp,_IntersectionImp_> & intersection ) const\n-352 {\n-353 // if no parameters given return empty vector\n-354 if ( !haveBndParam_ )\n-355 return DGFBoundaryParameter::defaultValue();\n-356\n-357 return bndParam_[ intersection.boundarySegmentIndex() ];\n-358 }\n-359\n-360 void communicate ()\n-361 {\n-362 if( gridPtr_->comm().size() > 1 )\n-363 {\n-364 DataHandle dh(*this);\n-365 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_\n-All_Interface,ForwardCommunication );\n-366 }\n-367 }\n-368\n-369 void loadBalance ()\n-370 {\n-371 if( gridPtr_->comm().size() > 1 )\n-372 {\n-373 DataHandle dh(*this);\n-374 gridPtr_->loadBalance( dh.interface() );\n-375 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_\n-All_Interface,ForwardCommunication );\n-376 }\n-377 }\n-378\n-379 protected:\n-380 template< class Range >\n-381 static bool isEmpty ( Range &&range )\n-382 {\n-383 return range.begin() == range.end();\n-384 }\n-385\n-386 void initialize ( DGFGridFactory<_GridType_> &dgfFactory )\n-387 {\n-388 gridPtr_ = mygrid_ptr( dgfFactory.grid() );\n-389\n-390 const auto gridView = gridPtr_->levelGridView( 0 );\n-391 const auto &indexSet = gridView.indexSet();\n-392\n-393 nofElParam_ = dgfFactory.template numParameters< 0 >();\n-394 nofVtxParam_ = dgfFactory.template numParameters< dimension >();\n-395 haveBndParam_ = dgfFactory.haveBoundaryParameters();\n-396\n-397 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast<\n-int >( haveBndParam_ ) }};\n-398 gridView.comm().max( nofParams.data(), nofParams.size() );\n-399\n-400 // empty grids have no parameters associated\n-401 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )\n-402 {\n-403 nofElParam_ = nofParams[ 0 ];\n-404 nofVtxParam_ = nofParams[ 1 ];\n-405 }\n-406\n-407 // boundary parameters may be empty\n-408 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );\n-409\n-410 if( (nofElParam_ != nofParams[ 0 ]) || (nofVtxParam_ != nofParams[ 1 ]) )\n-411 DUNE_THROW( DGFException, \"Number of parameters differs between processes\"\n-);\n-412\n-413 elParam_.resize( nofElParam_ > 0 ? indexSet.size( 0 ) : 0 );\n-414 vtxParam_.resize( nofVtxParam_ > 0 ? indexSet.size( dimension ) : 0 );\n-415\n-416 bndId_.resize( indexSet.size( 1 ) );\n-417 if( haveBndParam_ )\n-418 bndParam_.resize( gridPtr_->numBoundarySegments() );\n-419\n-420 for( const auto &element : elements( gridView, Partitions::interiorBorder )\n-)\n-421 {\n-422 if( nofElParam_ > 0 )\n-423 {\n-424 std::swap( elParam_[ indexSet.index( element ) ], dgfFactory.parameter\n-( element ) );\n-425 assert( elParam_[ indexSet.index( element ) ].size() == static_cast< std::\n-size_t >( nofElParam_ ) );\n-426 }\n-427\n-428 if( nofVtxParam_ > 0 )\n-429 {\n-430 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )\n-431 {\n-432 const auto index = indexSet.subIndex( element, v, dimension );\n-433 if( vtxParam_[ index ].empty() )\n-434 std::swap( vtxParam_[ index ], dgfFactory.parameter( element.template\n-subEntity< dimension >( v ) ) );\n-435 assert( vtxParam_[ index ].size() == static_cast< std::size_t >\n-( nofVtxParam_ ) );\n-436 }\n-437 }\n-438\n-439 if( element.hasBoundaryIntersections() )\n-440 {\n-441 for( const auto &intersection : intersections( gridView, element ) )\n-442 {\n-443 // dirty hack: check for \"none\" to make corner point grid work\n-444 if( !intersection.boundary() || intersection.type().isNone() )\n-445 continue;\n-446\n-447 const auto k = indexSet.subIndex( element, intersection.indexInInside(), 1\n-);\n-448 bndId_[ k ] = dgfFactory.boundaryId( intersection );\n-449 if( haveBndParam_ )\n-450 bndParam_[ intersection.boundarySegmentIndex() ] =\n-dgfFactory.boundaryParameter( intersection );\n-451 }\n-452 }\n-453 }\n-454 }\n-455\n-456 void initialize ( GridFactory<_GridType_> &factory,\n-457 std::vector& boundaryIds,\n-458 std::vector& elementIds )\n-459 {\n-460 gridPtr_ = mygrid_ptr( factory.createGrid().release() );\n-461\n-462 const auto& gridView = gridPtr_->leafGridView();\n-463 const auto& indexSet = gridView.indexSet();\n-464\n-465 nofElParam_ = elementIds.empty() ? 0 : 1 ;\n-466 nofVtxParam_ = 0;\n-467 haveBndParam_ = boundaryIds.empty() ? 0 : 1 ;\n-468\n-469 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast<\n-int >( haveBndParam_ ) }};\n-470 gridView.comm().max( nofParams.data(), nofParams.size() );\n-471\n-472 // empty grids have no parameters associated\n-473 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )\n-474 {\n-475 nofElParam_ = nofParams[ 0 ];\n-476 }\n-477\n-478 // boundary parameters may be empty\n-479 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );\n-480\n-481 // Reorder boundary IDs according to the insertion index\n-482 if(!boundaryIds.empty() || !elementIds.empty() )\n-483 {\n-484 bndParam_.resize( boundaryIds.size() );\n-485 elParam_.resize( elementIds.size(), std::vector(1) );\n-486 for(const auto& entity : elements( gridView ))\n-487 {\n-488 elParam_[ indexSet.index( entity ) ][ 0 ] = elementIds\n-[ factory.insertionIndex( entity ) ];\n-489 if( haveBndParam_ )\n-490 {\n-491 for(const auto& intersection : intersections( gridView,entity) )\n-492 {\n-493 if(intersection.boundary())\n-494 {\n-495 // DGFBoundaryParameter::type is of type string.\n-496 bndParam_[intersection.boundarySegmentIndex()] = std::to_string(boundaryIds\n-[factory.insertionIndex(intersection)]);\n-497 }\n-498 }\n-499 }\n-500 }\n-501 }\n-502 }\n-503\n-504 template \n-505 std::vector< double > ¶ms ( const Entity &entity )\n-506 {\n-507 const auto gridView = gridPtr_->levelGridView( 0 );\n-508 switch( (int)Entity::codimension )\n-509 {\n-510 case 0 :\n-511 if( nofElParam_ > 0 ) {\n-512 if ( gridView.indexSet().index( entity ) >= elParam_.size() )\n-513 elParam_.resize( gridView.indexSet().index( entity ) );\n-514 return elParam_[ gridView.indexSet().index( entity ) ];\n-515 }\n-516 break;\n-517 case GridType::dimension :\n-518 if( nofVtxParam_ > 0 ) {\n-519 if ( gridView.indexSet().index( entity ) >= vtxParam_.size() )\n-520 vtxParam_.resize( gridView.indexSet().index( entity ) );\n-521 return vtxParam_[ gridView.indexSet().index( entity ) ];\n-522 }\n-523 break;\n-524 }\n-525 return emptyParam_;\n-526 }\n-527\n-528 void setNofParams( int cdim, int nofP )\n-529 {\n-530 switch (cdim) {\n-531 case 0 : nofElParam_ = nofP; break;\n-532 case GridType::dimension : nofVtxParam_ = nofP; break;\n-533 }\n-534 }\n-535\n-536 struct DataHandle\n-537 : public CommDataHandleIF< DataHandle, char >\n-538 {\n-539 explicit DataHandle ( GridPtr &gridPtr )\n-540 : gridPtr_( gridPtr ), idSet_( gridPtr->localIdSet() )\n-541 {\n-542 const auto gridView = gridPtr_->levelGridView( 0 );\n-543 const auto &indexSet = gridView.indexSet();\n-544\n-545 for( const auto &element : elements( gridView, Partitions::interiorBorder )\n-)\n-546 {\n-547 if( gridPtr_.nofElParam_ > 0 )\n-548 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_\n-[ idSet_.id( element ) ] );\n-549\n-550 if( gridPtr_.nofVtxParam_ > 0 )\n-551 {\n-552 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )\n-553 {\n-554 const auto index = indexSet.subIndex( element, v, dimension );\n-555 if ( !gridPtr_.vtxParam_[ index ].empty() )\n-556 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v,\n-dimension ) ] );\n-557 }\n-558 }\n-559\n-560 if( element.hasBoundaryIntersections() )\n-561 {\n-562 for( const auto &intersection : intersections( gridView, element ) )\n-563 {\n-564 // dirty hack: check for \"none\" to make corner point grid work\n-565 if( !intersection.boundary() || intersection.type().isNone() )\n-566 continue;\n-567\n-568 const int i = intersection.indexInInside();\n-569 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];\n-570 bndData.first = gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ];\n-571 if( gridPtr_.haveBndParam_ )\n-572 std::swap( bndData.second, gridPtr_.bndParam_\n-[ intersection.boundarySegmentIndex() ] );\n-573 }\n-574 }\n-575 }\n-576 }\n-577\n-578 DataHandle ( const DataHandle & ) = delete;\n-579 DataHandle ( DataHandle && ) = delete;\n-580\n-581 ~DataHandle ()\n-582 {\n-583 const auto gridView = gridPtr_->levelGridView( 0 );\n-584 const auto &indexSet = gridView.indexSet();\n-585\n-586 if( gridPtr_.nofElParam_ > 0 )\n-587 gridPtr_.elParam_.resize( indexSet.size( 0 ) );\n-588 if( gridPtr_.nofVtxParam_ > 0 )\n-589 gridPtr_.vtxParam_.resize( indexSet.size( dimension ) );\n-590 gridPtr_.bndId_.resize( indexSet.size( 1 ) );\n-591 if( gridPtr_.haveBndParam_ )\n-592 gridPtr_.bndParam_.resize( gridPtr_->numBoundarySegments() );\n-593\n-594 for( const auto &element : elements( gridView, Partitions::all ) )\n-595 {\n-596 if( gridPtr_.nofElParam_ > 0 )\n-597 {\n-598 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_\n-[ idSet_.id( element ) ] );\n-599 assert( gridPtr_.elParam_[ indexSet.index( element ) ].size() == static_\n-cast< std::size_t >( gridPtr_.nofElParam_ ) );\n-600 }\n-601\n-602 if( gridPtr_.nofVtxParam_ > 0 )\n-603 {\n-604 for( unsigned int v = 0; v < element.subEntities( dimension ); ++v )\n-605 {\n-606 const auto index = indexSet.subIndex( element, v, dimension );\n-607 if( gridPtr_.vtxParam_[ index ].empty() )\n-608 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v,\n-dimension ) ] );\n-609 assert( gridPtr_.vtxParam_[ index ].size() == static_cast< std::size_t >\n-( gridPtr_.nofVtxParam_ ) );\n-610 }\n-611 }\n-612\n-613 if( element.hasBoundaryIntersections() )\n-614 {\n-615 for( const auto &intersection : intersections( gridView, element ) )\n-616 {\n-617 // dirty hack: check for \"none\" to make corner point grid work\n-618 if( !intersection.boundary() || intersection.type().isNone() )\n-619 continue;\n-620\n-621 const int i = intersection.indexInInside();\n-622 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];\n-623 gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ] = bndData.first;\n-624 if( gridPtr_.haveBndParam_ )\n-625 std::swap( bndData.second, gridPtr_.bndParam_\n-[ intersection.boundarySegmentIndex() ] );\n-626 }\n-627 }\n-628 }\n-629 }\n-630\n-631 CommDataHandleIF<_DataHandle,_char_> &interface () { return *this; }\n-632\n-633 bool contains ( int dim, int codim ) const\n-634 {\n-635 assert( dim == dimension );\n-636 // do not use a switch statement, because dimension == 1 is possible\n-637 return (codim == 1) || ((codim == dimension) && (gridPtr_.nofVtxParam_ >\n-0)) || ((codim == 0) && (gridPtr_.nofElParam_ > 0));\n-638 }\n-639\n-640 bool fixedSize (int /* dim */, int /* codim */) const { return false; }\n-641\n-642 template< class Entity >\n-643 std::size_t size ( const Entity &entity ) const\n-644 {\n-645 std::size_t totalSize = 0;\n-646\n-647 // do not use a switch statement, because dimension == 1 is possible\n-648 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )\n-649 {\n-650 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >\n-( gridPtr_.nofElParam_ ) );\n-651 for( double &v : elData_[ idSet_.id( entity ) ] )\n-652 totalSize += dataSize( v );\n-653 }\n-654\n-655 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )\n-656 {\n-657 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_\n-t >( gridPtr_.nofVtxParam_ ) );\n-658 for( double &v : vtxData_[ idSet_.id( entity ) ] )\n-659 totalSize += dataSize( v );\n-660 }\n-661\n-662 if( Entity::codimension == 1 )\n-663 {\n-664 const auto bndData = bndData_.find( idSet_.id( entity ) );\n-665 if( bndData != bndData_.end() )\n-666 totalSize += dataSize( bndData->second.first ) + dataSize( bndData-\n->second.second );\n-667 }\n-668\n-669 return totalSize;\n-670 }\n-671\n-672 template< class Buffer, class Entity >\n-673 void gather ( Buffer &buffer, const Entity &entity ) const\n-674 {\n-675 // do not use a switch statement, because dimension == 1 is possible\n-676 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )\n-677 {\n-678 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >\n-( gridPtr_.nofElParam_ ) );\n-679 for( double &v : elData_[ idSet_.id( entity ) ] )\n-680 write( buffer, v );\n-681 }\n-682\n-683 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )\n-684 {\n-685 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_\n-t >( gridPtr_.nofVtxParam_ ) );\n-686 for( double &v : vtxData_[ idSet_.id( entity ) ] )\n-687 write( buffer, v );\n-688 }\n-689\n-690 if( Entity::codimension == 1 )\n-691 {\n-692 const auto bndData = bndData_.find( idSet_.id( entity ) );\n-693 if( bndData != bndData_.end() )\n-694 {\n-695 write( buffer, bndData->second.first );\n-696 write( buffer, bndData->second.second );\n-697 }\n-698 }\n-699 }\n-700\n-701 template< class Buffer, class Entity >\n-702 void scatter ( Buffer &buffer, const Entity &entity, std::size_t n )\n-703 {\n-704 // do not use a switch statement, because dimension == 1 is possible\n-705 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )\n-706 {\n-707 auto &p = elData_[ idSet_.id( entity ) ];\n-708 p.resize( gridPtr_.nofElParam_ );\n-709 for( double &v : p )\n-710 read( buffer, v, n );\n-711 }\n-712\n-713 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )\n-714 {\n-715 auto &p = vtxData_[ idSet_.id( entity ) ];\n-716 p.resize( gridPtr_.nofVtxParam_ );\n-717 for( double &v : p )\n-718 read( buffer, v, n );\n-719 }\n-720\n-721 if( (Entity::codimension == 1) && (n > 0) )\n-722 {\n-723 auto &bndData = bndData_[ idSet_.id( entity ) ];\n-724 read( buffer, bndData.first, n );\n-725 read( buffer, bndData.second, n );\n-726 }\n-727\n-728 assert( n == 0 );\n-729 }\n-730\n-731 private:\n-732 template< class T >\n-733 static std::enable_if_t< std::is_trivially_copyable< T >::value, std::size_\n-t > dataSize ( const T & /* value */ )\n-734 {\n-735 return sizeof( T );\n-736 }\n-737\n-738 static std::size_t dataSize ( const std::string &s )\n-739 {\n-740 return dataSize( s.size() ) + s.size();\n-741 }\n-742\n-743 template< class Buffer, class T >\n-744 static std::enable_if_t< std::is_trivially_copyable< T >::value > write\n-( Buffer &buffer, const T &value )\n-745 {\n-746 std::array< char, sizeof( T ) > bytes;\n-747 std::memcpy( bytes.data(), &value, sizeof( T ) );\n-748 for( char &b : bytes )\n-749 buffer.write( b );\n-750 }\n-751\n-752 template< class Buffer >\n-753 static void write ( Buffer &buffer, const std::string &s )\n-754 {\n-755 write( buffer, s.size() );\n-756 for( const char &c : s )\n-757 buffer.write( c );\n-758 }\n-759\n-760 template< class Buffer, class T >\n-761 static std::enable_if_t< std::is_trivially_copyable< T >::value > read\n-( Buffer &buffer, T &value, std::size_t &n )\n-762 {\n-763 assert( n >= sizeof( T ) );\n-764 n -= sizeof( T );\n-765\n-766 std::array< char, sizeof( T ) > bytes;\n-767 for( char &b : bytes )\n-768 buffer.read( b );\n-769 std::memcpy( &value, bytes.data(), sizeof( T ) );\n-770 }\n-771\n-772 template< class Buffer >\n-773 static void read ( Buffer &buffer, std::string &s, std::size_t &n )\n-774 {\n-775 std::size_t size;\n-776 read( buffer, size, n );\n-777 s.resize( size );\n-778\n-779 assert( n >= size );\n-780 n -= size;\n-781\n-782 for( char &c : s )\n-783 buffer.read( c );\n-784 }\n-785\n-786 GridPtr &gridPtr_;\n-787 const typename GridType::LocalIdSet &idSet_;\n-788 mutable std::map< typename GridType::LocalIdSet::IdType, std::vector<\n-double > > elData_, vtxData_;\n-789 mutable std::map< typename GridType::LocalIdSet::IdType, std::pair< int,\n-DGFBoundaryParameter::type > > bndData_;\n-790 };\n-791\n-792 // grid auto pointer\n-793 mutable mygrid_ptr gridPtr_;\n-794 // element and vertex parameters\n-795 std::vector< std::vector< double > > elParam_;\n-796 std::vector< std::vector< double > > vtxParam_;\n-797 std::vector< DGFBoundaryParameter::type > bndParam_;\n-798 std::vector< int > bndId_;\n-799 std::vector< double > emptyParam_;\n-800\n-801 int nofElParam_;\n-802 int nofVtxParam_;\n-803 bool haveBndParam_;\n-804 }; // end of class GridPtr\n-805\n-806} // end namespace Dune\n-807\n-808#endif\n-gridenums.hh\n-datahandleif.hh\n-Describes the parallel communication interface class for MessageBuffers and\n-DataHandles.\n-rangegenerators.hh\n-partitionset.hh\n-gmshreader.hh\n-entitykey.hh\n-parser.hh\n-dgfexception.hh\n-Dune::ForwardCommunication\n-@ ForwardCommunication\n-communicate as given in InterfaceType\n-Definition gridenums.hh:171\n-Dune::InteriorBorder_All_Interface\n-@ InteriorBorder_All_Interface\n-send interior and border, receive all entities\n-Definition gridenums.hh:88\n-Dune::GridView::indexSet\n-const IndexSet & indexSet() const\n-obtain the index set\n-Definition common/gridview.hh:177\n-std::swap\n-void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n-> &b)\n-Definition utility/persistentcontainer.hh:83\n+11namespace Dune {\n+12\n+23 const char base64table[] =\n+24 {\n+25 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n+26 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n+27 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\n+28 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',\n+29 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'\n+30 };\n+31\n+33 struct b64chunk\n+34 {\n+35 using size_type = unsigned char;\n+36 size_type size;\n+37 char txt[3];\n+38\n+39 void reset()\n+40 {\n+41 size = 0;\n+42 txt[0] = txt[1] = txt[2] = 0;\n+43 }\n+44\n+45 int read(const char* t, size_type s)\n+46 {\n+47 size = s>=3 ? 3 : s;\n+48 txt[0] = s>0 ? t[0] : 0;\n+49 txt[1] = s>1 ? t[1] : 0;\n+50 txt[2] = s>2 ? t[2] : 0;\n+51 return size;\n+52 }\n+53\n+54 void put(const char c)\n+55 {\n+56 assert (size < 3);\n+57 txt[size++] = c;\n+58 }\n+59\n+60 void write(char* t)\n+61 {\n+62 const unsigned A = (txt[0] & 0b1111'1100) >> 2;\n+63 const unsigned B = (txt[0] & 0b0000'0011) << 4 | (txt[1] & 0b1111'0000) >>\n+4;\n+64 const unsigned C = (txt[1] & 0b0000'1111) << 2 | (txt[2] & 0b1100'0000) >>\n+6;\n+65 const unsigned D = txt[2] & 0b0011'1111;\n+66 t[0] = size>0 ? base64table[A] : '=';\n+67 t[1] = size>0 ? base64table[B] : '=';\n+68 t[2] = size>1 ? base64table[C] : '=';\n+69 t[3] = size>2 ? base64table[D] : '=';\n+70 size = 0;\n+71 }\n+72 };\n+73\n+76} // namespace Dune\n+77\n+78#endif // DUNE_GRID_IO_FILE_VTK_B64ENC_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Partitions::all\n-constexpr All all\n-PartitionSet for all partitions.\n-Definition partitionset.hh:295\n-Dune::Partitions::interiorBorder\n-constexpr InteriorBorder interiorBorder\n-PartitionSet for the interior and border partitions.\n-Definition partitionset.hh:286\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::boundaryId\n-int boundaryId(const Intersection &intersection) const\n-Definition dgfgridfactory.hh:102\n-Dune::DGFGridFactory::boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n-> &intersection) const\n-Definition dgfgridfactory.hh:158\n-Dune::DGFGridFactory::grid\n-Grid * grid()\n-Definition dgfgridfactory.hh:90\n-Dune::DGFGridFactory::parameter\n-std::vector< double > & parameter(const Element &element)\n-Definition dgfgridfactory.hh:124\n-Dune::DGFGridFactory::haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-Definition dgfgridfactory.hh:151\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::boundarySegmentIndex\n-size_t boundarySegmentIndex() const\n-index of the boundary segment within the macro grid\n-Definition common/intersection.hh:236\n-Dune::CommDataHandleIF\n-CommDataHandleIF describes the features of a data handle for communication in\n-parallel runs using the...\n-Definition datahandleif.hh:78\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Entity::codimension\n-static constexpr int codimension\n-Know your own codimension.\n-Definition common/entity.hh:106\n-Dune::GridError\n-Base class for exceptions in Dune grid modules.\n-Definition exceptions.hh:20\n-Dune::GridFactoryInterface::insertionIndex\n-virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity)\n-const\n-obtain an element's insertion index\n-Definition common/gridfactory.hh:181\n-Dune::GridFactory\n-Provide a generic factory class for unstructured grids.\n-Definition common/gridfactory.hh:275\n-Dune::GridFactory::createGrid\n-virtual std::unique_ptr< GridType > createGrid()\n-Finalize grid creation and hand over the grid.\n-Definition common/gridfactory.hh:333\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n-Dune::GridPtr\n-Class for constructing grids from DGF files.\n-Definition gridptr.hh:66\n-Dune::GridPtr::GridPtr\n-GridPtr(std::istream &input, MPICommunicatorType comm=MPIHelper::\n-getCommunicator())\n-constructor given a std::istream\n-Definition gridptr.hh:199\n-Dune::GridPtr::parameters\n-const std::vector< double > & parameters(const Entity &entity) const\n-get parameters defined for each codim 0 und dim entity on the grid through the\n-grid file\n-Definition gridptr.hh:325\n-Dune::GridPtr::GridPtr\n-GridPtr()\n-Default constructor, creating empty GridPtr.\n-Definition gridptr.hh:217\n-Dune::GridPtr::operator*\n-const GridType & operator*() const\n-return const reference to GridType instance\n-Definition gridptr.hh:288\n-Dune::GridPtr::haveBndParam_\n-bool haveBndParam_\n-Definition gridptr.hh:803\n-Dune::GridPtr::dimension\n-static const int dimension\n-Definition gridptr.hh:155\n-Dune::GridPtr::bndId_\n-std::vector< int > bndId_\n-Definition gridptr.hh:798\n-Dune::GridPtr::setNofParams\n-void setNofParams(int cdim, int nofP)\n-Definition gridptr.hh:528\n-Dune::GridPtr::loadBalance\n-void loadBalance()\n-Definition gridptr.hh:369\n-Dune::GridPtr::bndParam_\n-std::vector< DGFBoundaryParameter::type > bndParam_\n-Definition gridptr.hh:797\n-Dune::GridPtr::initialize\n-void initialize(GridFactory< GridType > &factory, std::vector< int >\n-&boundaryIds, std::vector< int > &elementIds)\n-Definition gridptr.hh:456\n-Dune::GridPtr::GridPtr\n-GridPtr(GridType *grd)\n-Constructor storing given pointer to internal auto pointer.\n-Definition gridptr.hh:230\n-Dune::GridPtr::nofElParam_\n-int nofElParam_\n-Definition gridptr.hh:801\n-Dune::GridPtr::parameters\n-const DGFBoundaryParameter::type & parameters(const Intersection< GridImp,\n-IntersectionImp > &intersection) const\n-get parameters for intersection\n-Definition gridptr.hh:351\n-Dune::GridPtr::operator*\n-GridType & operator*()\n-return reference to GridType instance\n-Definition gridptr.hh:278\n-Dune::GridPtr::isEmpty\n-static bool isEmpty(Range &&range)\n-Definition gridptr.hh:381\n-Dune::GridPtr::nofParameters\n-int nofParameters(const Entity &) const\n-get parameters defined for given entity\n-Definition gridptr.hh:311\n-Dune::GridPtr::GridPtr\n-GridPtr(const std::string &filename, MPICommunicatorType comm=MPIHelper::\n-getCommunicator())\n-constructor given the name of a DGF file\n-Definition gridptr.hh:158\n-Dune::GridPtr::elParam_\n-std::vector< std::vector< double > > elParam_\n-Definition gridptr.hh:795\n-Dune::GridPtr::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition gridptr.hh:154\n-Dune::GridPtr::operator=\n-GridPtr & operator=(const GridPtr &org)\n-assignment of grid pointer\n-Definition gridptr.hh:246\n-Dune::GridPtr::nofParameters\n-int nofParameters(int cdim) const\n-get number of parameters defined for a given codimension\n-Definition gridptr.hh:301\n-Dune::GridPtr::nofParameters\n-int nofParameters(const Intersection< GridImp, IntersectionImp > &intersection)\n-const\n-get number of parameters defined for a given intersection\n-Definition gridptr.hh:318\n-Dune::GridPtr::emptyParam_\n-std::vector< double > emptyParam_\n-Definition gridptr.hh:799\n-Dune::GridPtr::gridPtr_\n-mygrid_ptr gridPtr_\n-Definition gridptr.hh:793\n-Dune::GridPtr::readGmsh\n-void readGmsh(const std::string &filename, std::integral_constant< bool, false\n->)\n-Definition gridptr.hh:147\n-Dune::GridPtr::readGmsh\n-void readGmsh(const std::string &filename, std::integral_constant< bool, true\n->)\n-Definition gridptr.hh:137\n-Dune::GridPtr::params\n-std::vector< double > & params(const Entity &entity)\n-Definition gridptr.hh:505\n-Dune::GridPtr::initialize\n-void initialize(DGFGridFactory< GridType > &dgfFactory)\n-Definition gridptr.hh:386\n-Dune::GridPtr::GridPtr\n-GridPtr(const GridPtr &org)=default\n-Copy constructor, copies internal auto pointer.\n-Dune::GridPtr::getFileExtension\n-std::string getFileExtension(const std::string &filename) const\n-Definition gridptr.hh:122\n-Dune::GridPtr::operator->\n-const GridType * operator->() const\n-return const pointer to GridType instance\n-Definition gridptr.hh:293\n-Dune::GridPtr::release\n-GridType * release()\n-release pointer from internal ownership\n-Definition gridptr.hh:298\n-Dune::GridPtr::communicate\n-void communicate()\n-Definition gridptr.hh:360\n-Dune::GridPtr::vtxParam_\n-std::vector< std::vector< double > > vtxParam_\n-Definition gridptr.hh:796\n-Dune::GridPtr::operator->\n-GridType * operator->()\n-return pointer to GridType instance\n-Definition gridptr.hh:283\n-Dune::GridPtr::nofVtxParam_\n-int nofVtxParam_\n-Definition gridptr.hh:802\n-Dune::GridPtr::mygrid_ptr\n-Definition gridptr.hh:68\n-Dune::GridPtr::mygrid_ptr::mygrid_ptr\n-mygrid_ptr(GridType *grd)\n-Definition gridptr.hh:99\n-Dune::GridPtr::mygrid_ptr::~mygrid_ptr\n-~mygrid_ptr()\n-Definition gridptr.hh:102\n-Dune::GridPtr::mygrid_ptr::release\n-GridType * release()\n-Definition gridptr.hh:112\n-Dune::GridPtr::mygrid_ptr::mygrid_ptr\n-mygrid_ptr(const mygrid_ptr &other)\n-Definition gridptr.hh:97\n-Dune::GridPtr::mygrid_ptr::operator=\n-mygrid_ptr & operator=(const mygrid_ptr &other)\n-Definition gridptr.hh:105\n-Dune::GridPtr::mygrid_ptr::mygrid_ptr\n-mygrid_ptr()\n-Definition gridptr.hh:95\n-Dune::GridPtr::DataHandle\n-Definition gridptr.hh:538\n-Dune::GridPtr::DataHandle::interface\n-CommDataHandleIF< DataHandle, char > & interface()\n-Definition gridptr.hh:631\n-Dune::GridPtr::DataHandle::DataHandle\n-DataHandle(const DataHandle &)=delete\n-Dune::GridPtr::DataHandle::~DataHandle\n-~DataHandle()\n-Definition gridptr.hh:581\n-Dune::GridPtr::DataHandle::DataHandle\n-DataHandle(GridPtr &gridPtr)\n-Definition gridptr.hh:539\n-Dune::GridPtr::DataHandle::gather\n-void gather(Buffer &buffer, const Entity &entity) const\n-Definition gridptr.hh:673\n-Dune::GridPtr::DataHandle::fixedSize\n-bool fixedSize(int, int) const\n-Definition gridptr.hh:640\n-Dune::GridPtr::DataHandle::size\n-std::size_t size(const Entity &entity) const\n-Definition gridptr.hh:643\n-Dune::GridPtr::DataHandle::DataHandle\n-DataHandle(DataHandle &&)=delete\n-Dune::GridPtr::DataHandle::scatter\n-void scatter(Buffer &buffer, const Entity &entity, std::size_t n)\n-Definition gridptr.hh:702\n-Dune::GridPtr::DataHandle::contains\n-bool contains(int dim, int codim) const\n-Definition gridptr.hh:633\n-Dune::DGFBoundaryParameter::defaultValue\n-static const type & defaultValue()\n-default constructor\n-Definition parser.hh:28\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n-Dune::GmshReader::read\n-static std::unique_ptr< Grid > read(const std::string &fileName, bool\n-verbose=true, bool insertBoundarySegments=true)\n-Definition gmshreader.hh:937\n-intersection.hh\n+Dune::base64table\n+const char base64table[]\n+endoing table\n+Definition b64enc.hh:23\n+Dune::b64chunk\n+struct representing the three byte text as well as the four 6 bit chunks\n+Definition b64enc.hh:34\n+Dune::b64chunk::txt\n+char txt[3]\n+Definition b64enc.hh:37\n+Dune::b64chunk::size_type\n+unsigned char size_type\n+Definition b64enc.hh:35\n+Dune::b64chunk::write\n+void write(char *t)\n+Definition b64enc.hh:60\n+Dune::b64chunk::size\n+size_type size\n+Definition b64enc.hh:36\n+Dune::b64chunk::read\n+int read(const char *t, size_type s)\n+Definition b64enc.hh:45\n+Dune::b64chunk::put\n+void put(const char c)\n+Definition b64enc.hh:54\n+Dune::b64chunk::reset\n+void reset()\n+Definition b64enc.hh:39\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00782.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00782.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entitykey.hh File Reference\n+dune-grid: function.hh File Reference\n \n \n \n \n \n \n \n@@ -65,44 +65,59 @@\n \n \n \n \n \n \n \n
    \n \n-
    entitykey.hh File Reference
    \n+
    function.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n-#include <vector>
    \n-#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n-#include "entitykey_inline.hh"
    \n+\n+

    Functions for VTK output. \n+More...

    \n+
    #include <string>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/multilineargeometry.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::DGFEntityKey< A >
    class  Dune::VTKFunction< GridView >
     A base class for grid functions with any return type and dimension. More...
     
    class  Dune::P0VTKFunction< GV, V >
     Take a vector and interpret it as cell data for the VTKWriter. More...
     
    struct  Dune::ElementFaceUtil
    class  Dune::P1VTKFunction< GV, V >
     Take a vector and interpret it as point data for the VTKWriter. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    Functions for VTK output.

    \n+
    Author
    Peter Bastian, Christian Engwer
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,41 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n+ * vtk\n Classes | Namespaces\n-entitykey.hh File Reference\n-#include \n-#include \n-#include \n-#include \"entitykey_inline.hh\"\n+function.hh File Reference\n+Functions for VTK output. 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-struct \u00a0 Dune::DGFEntityKey<_A_>\n+class \u00a0 Dune::VTKFunction<_GridView_>\n+\u00a0 A base class for grid functions with any return type and dimension.\n+ More...\n \u00a0\n-struct \u00a0 Dune::ElementFaceUtil\n+class \u00a0 Dune::P0VTKFunction<_GV,_V_>\n+\u00a0 Take a vector and interpret it as cell data for the VTKWriter. More...\n+\u00a0\n+class \u00a0 Dune::P1VTKFunction<_GV,_V_>\n+\u00a0 Take a vector and interpret it as point data for the VTKWriter. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+***** Detailed Description *****\n+Functions for VTK output.\n+ Author\n+ Peter Bastian, Christian Engwer\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00782_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00782_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entitykey.hh Source File\n+dune-grid: function.hh Source File\n \n \n \n \n \n \n \n@@ -70,221 +70,277 @@\n \n \n \n \n \n \n \n
    \n-
    entitykey.hh
    \n+
    function.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGFEnTITYKEY_HH
    \n-
    6#define DUNE_DGFEnTITYKEY_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
    \n+
    8
    \n+
    9#include <string>
    \n
    10
    \n-\n-
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n-
    15
    \n-
    16 // DGFEntityKey
    \n-
    17 // ------------
    \n-
    18
    \n-
    19 template< class A >
    \n-
    \n-\n-
    21 {
    \n-
    22 DGFEntityKey ( const std :: vector< A > &key, bool setOrigKey = true );
    \n-
    23 DGFEntityKey ( const std::vector< A > &key,
    \n-
    24 int N, int offset, bool setOrigKey = true );
    \n-\n-
    26
    \n-\n-
    28
    \n-
    \n-
    29 inline const A &operator[] ( int i ) const;
    \n-
    \n-
    30 inline bool operator < ( const DGFEntityKey< A > &k ) const;
    \n-
    31
    \n-
    32 void orientation ( int base, std :: vector< std :: vector< double > > &vtx );
    \n-
    33 void print( std :: ostream &out = std :: cerr ) const;
    \n-
    34
    \n-
    \n-
    35 inline bool origKeySet () const;
    \n-
    \n-
    36 inline const A &origKey ( int i ) const;
    \n-
    \n-
    37 inline int size () const;
    \n-
    38
    \n-
    39 private:
    \n-
    40 std :: vector< A > key_, origKey_;
    \n-
    41 bool origKeySet_;
    \n-
    42 };
    \n-
    43
    \n-
    44
    \n-
    45 template< class A >
    \n-
    \n-
    46 inline const A &DGFEntityKey< A > :: operator[] ( int i ) const
    \n-
    47 {
    \n-
    48 return key_[ i ];
    \n-
    49 }
    \n-
    \n-
    50
    \n+
    11#include <dune/common/exceptions.hh>
    \n+
    12#include <dune/common/fvector.hh>
    \n+
    13
    \n+
    14#include <dune/geometry/type.hh>
    \n+
    15#include <dune/geometry/referenceelements.hh>
    \n+
    16#include <dune/geometry/multilineargeometry.hh>
    \n+
    17
    \n+\n+\n+
    20
    \n+
    26namespace Dune
    \n+
    27{
    \n+
    30
    \n+
    32 //
    \n+
    33 // Base VTKFunction
    \n+
    34 //
    \n+
    35
    \n+
    40 template< class GridView >
    \n+
    \n+\n+
    42 {
    \n+
    43 public:
    \n+
    44 typedef typename GridView::ctype ctype;
    \n+
    45 constexpr static int dim = GridView::dimension;
    \n+
    46 typedef typename GridView::template Codim< 0 >::Entity Entity;
    \n+
    47
    \n+
    50 virtual int ncomps () const = 0;
    \n
    51
    \n-
    52 template< class A >
    \n-
    \n-\n-
    54 {
    \n-
    55 // assert(k.key_.size()==key_.size());
    \n-
    56 return key_ < k.key_;
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    59
    \n-
    60 template< class A >
    \n-
    \n-\n-
    62 {
    \n-
    63 return origKeySet_;
    \n-
    64 }
    \n-
    \n+
    53
    \n+
    60 virtual double evaluate (int comp, const Entity& e,
    \n+
    61 const Dune::FieldVector<ctype,dim>& xi) const = 0;
    \n+
    62
    \n+
    64 virtual std::string name () const = 0;
    \n
    65
    \n-
    66
    \n-
    67 template< class A >
    \n-
    \n-
    68 inline const A &DGFEntityKey< A > :: origKey ( int i ) const
    \n-
    69 {
    \n-
    70 return origKey_[ i ];
    \n-
    71 }
    \n+
    \n+
    67 virtual VTK::Precision precision() const
    \n+
    68 { return VTK::Precision::float32; }
    \n+
    \n+
    69
    \n+
    71 virtual ~VTKFunction () {}
    \n+
    72 };
    \n
    \n-
    72
    \n
    73
    \n-
    74 template< class A >
    \n-
    \n-
    75 inline int DGFEntityKey< A > :: size () const
    \n-
    76 {
    \n-
    77 return key_.size();
    \n-
    78 }
    \n-
    \n-
    \n-
    79
    \n+
    75 //
    \n+
    76 // P0VTKFunction
    \n+
    77 //
    \n+
    78
    \n
    80
    \n-
    81
    \n-
    82 // ElementFaceUtil
    \n-
    83 // ---------------
    \n-
    84
    \n-
    \n-\n-
    86 {
    \n-
    87 inline static int nofFaces ( int dim, const std::vector< unsigned int > &element );
    \n-
    88 inline static int faceSize ( int dim, bool simpl );
    \n-
    89
    \n-\n-
    91 generateFace ( int dim, const std::vector< unsigned int > &element, int f );
    \n-
    92
    \n-
    93 private:
    \n-
    94 template< int dim >
    \n-\n-
    96 generateCubeFace( const std::vector< unsigned int > &element, int f );
    \n-
    97
    \n-
    98 template< int dim >
    \n-\n-
    100 generateSimplexFace ( const std::vector< unsigned int > &element, int f );
    \n-
    101 };
    \n-
    \n+
    94 template<typename GV, typename V>
    \n+
    \n+\n+
    96 : public VTKFunction< GV >
    \n+
    97 {
    \n+
    99 typedef VTKFunction< GV > Base;
    \n+\n
    102
    \n-
    103
    \n-
    \n-
    104 inline int ElementFaceUtil::nofFaces ( int dim, const std::vector< unsigned int > &element )
    \n-
    105 {
    \n-
    106 switch( dim )
    \n-
    107 {
    \n-
    108 case 1 :
    \n-
    109 return 2;
    \n-
    110 case 2 :
    \n-
    111 switch( element.size() )
    \n-
    112 {
    \n-
    113 case 3 :
    \n-
    114 return 3;
    \n-
    115 case 4 :
    \n-
    116 return 4;
    \n-
    117 default :
    \n-
    118 return -1;
    \n-
    119 }
    \n-
    120 case 3 :
    \n-
    121 switch( element.size() )
    \n-
    122 {
    \n-
    123 case 4 :
    \n-
    124 return 4;
    \n-
    125 case 8 :
    \n-
    126 return 6;
    \n-
    127 default :
    \n-
    128 return -1;
    \n-
    129 }
    \n-
    130 default :
    \n-
    131 return -1;
    \n-
    132 }
    \n-
    133 }
    \n+
    104 const V& v;
    \n+
    106 std::string s;
    \n+
    108 int ncomps_;
    \n+
    111 int mycomp_;
    \n+
    113 VTK::Precision prec_;
    \n+
    115 Mapper mapper;
    \n+
    116
    \n+
    117 public:
    \n+
    118 typedef typename Base::Entity Entity;
    \n+
    119 typedef typename Base::ctype ctype;
    \n+
    120 using Base::dim;
    \n+
    121
    \n+
    \n+
    123 int ncomps () const override
    \n+
    124 {
    \n+
    125 return 1;
    \n+
    126 }
    \n+
    \n+
    127
    \n+
    \n+
    129 double evaluate (int, const Entity& e,
    \n+
    130 const Dune::FieldVector<ctype,dim>&) const override
    \n+
    131 {
    \n+
    132 return v[mapper.index(e)*ncomps_+mycomp_];
    \n+
    133 }
    \n
    \n
    134
    \n-
    135
    \n
    \n-
    136 inline int ElementFaceUtil::faceSize( int dim, bool simpl )
    \n-
    137 {
    \n-
    138 switch( dim )
    \n-
    139 {
    \n-
    140 case 1 :
    \n-
    141 return 1;
    \n-
    142 case 2 :
    \n-
    143 return 2;
    \n-
    144 case 3 :
    \n-
    145 return (simpl ? 3 : 4);
    \n-
    146 default :
    \n-
    147 return -1;
    \n-
    148 }
    \n-
    149 }
    \n-
    \n-
    150
    \n-
    151} //end namespace Dune
    \n-
    152
    \n-
    153// include inline implementation
    \n-
    154#include "entitykey_inline.hh"
    \n-
    155#endif
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-\n-\n+
    136 std::string name () const override
    \n+
    137 {
    \n+
    138 return s;
    \n+
    139 }
    \n+
    \n+
    140
    \n+
    \n+
    142 VTK::Precision precision() const override
    \n+
    143 {
    \n+
    144 return prec_;
    \n+
    145 }
    \n+
    \n+
    146
    \n+
    148
    \n+
    \n+
    165 P0VTKFunction(const GV &gv, const V &v_, const std::string &s_,
    \n+
    166 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)
    \n+
    167 : v( v_ ),
    \n+
    168 s( s_ ),
    \n+
    169 ncomps_(ncomps),
    \n+
    170 mycomp_(mycomp),
    \n+
    171 prec_(prec),
    \n+
    172 mapper( gv, mcmgElementLayout() )
    \n+
    173 {
    \n+
    174 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))
    \n+
    175 DUNE_THROW(IOError, "P0VTKFunction: size mismatch");
    \n+
    176 }
    \n+
    \n+
    177
    \n+
    179 virtual ~P0VTKFunction() {}
    \n+
    180 };
    \n+
    \n+
    181
    \n+
    183 //
    \n+
    184 // P1VTKFunction
    \n+
    185 //
    \n+
    186
    \n+
    188
    \n+
    202 template<typename GV, typename V>
    \n+
    \n+\n+
    204 : public VTKFunction< GV >
    \n+
    205 {
    \n+
    207 typedef VTKFunction< GV > Base;
    \n+\n+
    210
    \n+
    212 const V& v;
    \n+
    214 std::string s;
    \n+
    216 int ncomps_;
    \n+
    219 int mycomp_;
    \n+
    221 VTK::Precision prec_;
    \n+
    223 Mapper mapper;
    \n+
    224
    \n+
    225 public:
    \n+
    226 typedef typename Base::Entity Entity;
    \n+
    227 typedef typename Base::ctype ctype;
    \n+
    228 using Base::dim;
    \n+
    229
    \n+
    \n+
    231 int ncomps () const override
    \n+
    232 {
    \n+
    233 return 1;
    \n+
    234 }
    \n+
    \n+
    235
    \n+
    \n+
    237 double evaluate ([[maybe_unused]] int comp, const Entity& e,
    \n+
    238 const Dune::FieldVector<ctype,dim>& xi) const override
    \n+
    239 {
    \n+
    240 const unsigned int myDim = Entity::mydimension;
    \n+
    241 const unsigned int nVertices = e.subEntities(dim);
    \n+
    242
    \n+
    243 std::vector<FieldVector<ctype,1> > cornerValues(nVertices);
    \n+
    244 for (unsigned i=0; i<nVertices; ++i)
    \n+
    245 cornerValues[i] = v[mapper.subIndex(e,i,myDim)*ncomps_+mycomp_];
    \n+
    246
    \n+
    247 // (Ab)use the MultiLinearGeometry class to do multi-linear interpolation between scalars
    \n+
    248 const MultiLinearGeometry<ctype,dim,1> interpolation(e.type(), cornerValues);
    \n+
    249 return interpolation.global(xi);
    \n+
    250 }
    \n+
    \n+
    251
    \n+
    \n+
    253 std::string name () const override
    \n+
    254 {
    \n+
    255 return s;
    \n+
    256 }
    \n+
    \n+
    257
    \n+
    \n+
    259 VTK::Precision precision() const override
    \n+
    260 {
    \n+
    261 return prec_;
    \n+
    262 }
    \n+
    \n+
    263
    \n+
    265
    \n+
    \n+
    282 P1VTKFunction(const GV& gv, const V &v_, const std::string &s_,
    \n+
    283 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)
    \n+
    284 : v( v_ ),
    \n+
    285 s( s_ ),
    \n+
    286 ncomps_(ncomps),
    \n+
    287 mycomp_(mycomp),
    \n+
    288 prec_(prec),
    \n+
    289 mapper( gv, mcmgVertexLayout() )
    \n+
    290 {
    \n+
    291 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))
    \n+
    292 DUNE_THROW(IOError,"P1VTKFunction: size mismatch");
    \n+
    293 }
    \n+
    \n+
    294
    \n+
    296 virtual ~P1VTKFunction() {}
    \n+
    297 };
    \n+
    \n+
    298
    \n+
    300
    \n+
    301} // namespace Dune
    \n+
    302
    \n+
    303#endif // DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
    \n+
    Mapper for multiple codim and multiple geometry types.
    \n+
    Common stuff for the VTKWriter.
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    Grid::ctype ctype
    type used for coordinates in grid
    Definition common/gridview.hh:131
    \n+
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n+
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition entitykey.hh:21
    \n-
    bool operator<(const DGFEntityKey< A > &k) const
    Definition entitykey.hh:53
    \n-
    DGFEntityKey< A > & operator=(const DGFEntityKey< A > &k)
    Definition entitykey_inline.hh:64
    \n-
    bool origKeySet() const
    Definition entitykey.hh:61
    \n-
    int size() const
    Definition entitykey.hh:75
    \n-
    void orientation(int base, std ::vector< std ::vector< double > > &vtx)
    Definition entitykey_inline.hh:78
    \n-
    const A & origKey(int i) const
    Definition entitykey.hh:68
    \n-
    DGFEntityKey(const std::vector< A > &key, int N, int offset, bool setOrigKey=true)
    \n-
    void print(std ::ostream &out=std ::cerr) const
    Definition entitykey_inline.hh:105
    \n-
    const A & operator[](int i) const
    Definition entitykey.hh:46
    \n-
    Definition entitykey.hh:86
    \n-
    static DGFEntityKey< unsigned int > generateFace(int dim, const std::vector< unsigned int > &element, int f)
    Definition entitykey_inline.hh:145
    \n-
    static int faceSize(int dim, bool simpl)
    Definition entitykey.hh:136
    \n-
    static int nofFaces(int dim, const std::vector< unsigned int > &element)
    Definition entitykey.hh:104
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+
    static constexpr int mydimension
    Dimensionality of the reference element of the entity.
    Definition common/entity.hh:112
    \n+
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n+
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n+
    size_type size() const
    Return total number of entities in the entity set managed by the mapper.
    Definition mcmgmapper.hh:204
    \n+
    Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity of codim 0 entity to starting index in array for dof block.
    Definition mcmgmapper.hh:185
    \n+
    Index index(const EntityType &e) const
    Map entity to starting index in array for dof block.
    Definition mcmgmapper.hh:171
    \n+
    A base class for grid functions with any return type and dimension.
    Definition function.hh:42
    \n+
    virtual double evaluate(int comp, const Entity &e, const Dune::FieldVector< ctype, dim > &xi) const =0
    evaluate single component comp in the entity e at local coordinates xi
    \n+
    GridView::ctype ctype
    Definition function.hh:44
    \n+
    GridView::template Codim< 0 >::Entity Entity
    Definition function.hh:46
    \n+
    static constexpr int dim
    Definition function.hh:45
    \n+
    virtual std::string name() const =0
    get name
    \n+
    virtual VTK::Precision precision() const
    get output precision for the field
    Definition function.hh:67
    \n+
    virtual int ncomps() const =0
    \n+
    virtual ~VTKFunction()
    virtual destructor
    Definition function.hh:71
    \n+
    Take a vector and interpret it as cell data for the VTKWriter.
    Definition function.hh:97
    \n+
    std::string name() const override
    get name
    Definition function.hh:136
    \n+
    Base::ctype ctype
    Definition function.hh:119
    \n+
    double evaluate(int, const Entity &e, const Dune::FieldVector< ctype, dim > &) const override
    evaluate
    Definition function.hh:129
    \n+
    P0VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1, int mycomp=0, VTK::Precision prec=VTK::Precision::float32)
    construct from a vector and a name
    Definition function.hh:165
    \n+
    VTK::Precision precision() const override
    get output precision for the field
    Definition function.hh:142
    \n+
    Base::Entity Entity
    Definition function.hh:118
    \n+
    virtual ~P0VTKFunction()
    destructor
    Definition function.hh:179
    \n+
    int ncomps() const override
    return number of components
    Definition function.hh:123
    \n+
    Take a vector and interpret it as point data for the VTKWriter.
    Definition function.hh:205
    \n+
    std::string name() const override
    get name
    Definition function.hh:253
    \n+
    virtual ~P1VTKFunction()
    destructor
    Definition function.hh:296
    \n+
    Base::Entity Entity
    Definition function.hh:226
    \n+
    Base::ctype ctype
    Definition function.hh:227
    \n+
    VTK::Precision precision() const override
    get output precision for the field
    Definition function.hh:259
    \n+
    double evaluate(int comp, const Entity &e, const Dune::FieldVector< ctype, dim > &xi) const override
    evaluate
    Definition function.hh:237
    \n+
    P1VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1, int mycomp=0, VTK::Precision prec=VTK::Precision::float32)
    construct from a vector and a name
    Definition function.hh:282
    \n+
    int ncomps() const override
    return number of components
    Definition function.hh:231
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,218 +2,353 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n-entitykey.hh\n+ * vtk\n+function.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGFEnTITYKEY_HH\n-6#define DUNE_DGFEnTITYKEY_HH\n-7\n-8#include \n-9#include \n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTION_HH\n+7#define DUNE_GRID_IO_FILE_VTK_FUNCTION_HH\n+8\n+9#include \n 10\n-11#include \n-12\n-13namespace Dune\n-14{\n-15\n-16 // DGFEntityKey\n-17 // ------------\n-18\n-19 template< class A >\n-20 struct DGFEntityKey\n-21 {\n-22 DGFEntityKey ( const std :: vector< A > &key, bool setOrigKey = true );\n-23 DGFEntityKey ( const std::vector< A > &key,\n-24 int N, int offset, bool setOrigKey = true );\n-25 DGFEntityKey ( const DGFEntityKey<_A_> &k );\n-26\n-27 DGFEntityKey<_A_> &operator=_( const DGFEntityKey<_A_> &k );\n-28\n-29 inline const A &operator[]_( int i ) const;\n-30 inline bool operator_<_( const DGFEntityKey<_A_> &k ) const;\n-31\n-32 void orientation ( int base, std :: vector< std :: vector< double > > &vtx\n-);\n-33 void print( std :: ostream &out = std :: cerr ) const;\n-34\n-35 inline bool origKeySet () const;\n-36 inline const A &origKey ( int i ) const;\n-37 inline int size () const;\n-38\n-39 private:\n-40 std :: vector< A > key_, origKey_;\n-41 bool origKeySet_;\n-42 };\n-43\n-44\n-45 template< class A >\n-46 inline const A &DGFEntityKey<_A_>_::_operator[]_( int i ) const\n-47 {\n-48 return key_[ i ];\n-49 }\n-50\n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16#include \n+17\n+18#include \n+19#include \n+20\n+26namespace Dune\n+27{\n+30\n+32 //\n+33 // Base VTKFunction\n+34 //\n+35\n+40 template< class GridView >\n+41 class VTKFunction\n+42 {\n+43 public:\n+44 typedef typename GridView::ctype ctype;\n+45 constexpr static int dim = GridView::dimension;\n+46 typedef typename GridView::template Codim< 0 >::Entity Entity;\n+47\n+50 virtual int ncomps () const = 0;\n 51\n-52 template< class A >\n-53 inline bool DGFEntityKey<_A_>_::_operator<_( const DGFEntityKey<_A_> &k )\n-const\n-54 {\n-55 // assert(k.key_.size()==key_.size());\n-56 return key_ < k.key_;\n-57 }\n-58\n-59\n-60 template< class A >\n-61 inline bool DGFEntityKey<_A_>_::_origKeySet () const\n-62 {\n-63 return origKeySet_;\n-64 }\n+53\n+60 virtual double evaluate (int comp, const Entity& e,\n+61 const Dune::FieldVector& xi) const = 0;\n+62\n+64 virtual std::string name () const = 0;\n 65\n-66\n-67 template< class A >\n-68 inline const A &DGFEntityKey<_A_>_::_origKey ( int i ) const\n-69 {\n-70 return origKey_[ i ];\n-71 }\n-72\n+67 virtual VTK::Precision precision() const\n+68 { return VTK::Precision::float32; }\n+69\n+71 virtual ~VTKFunction () {}\n+72 };\n 73\n-74 template< class A >\n-75 inline int DGFEntityKey<_A_>_::_size () const\n-76 {\n-77 return key_.size();\n-78 }\n-79\n+75 //\n+76 // P0VTKFunction\n+77 //\n+78\n 80\n-81\n-82 // ElementFaceUtil\n-83 // ---------------\n-84\n-85 struct ElementFaceUtil\n-86 {\n-87 inline static int nofFaces ( int dim, const std::vector< unsigned int >\n-&element );\n-88 inline static int faceSize ( int dim, bool simpl );\n-89\n-90 static DGFEntityKey<_unsigned_int_>\n-91 generateFace ( int dim, const std::vector< unsigned int > &element, int f );\n-92\n-93 private:\n-94 template< int dim >\n-95 static DGFEntityKey<_unsigned_int_>\n-96 generateCubeFace( const std::vector< unsigned int > &element, int f );\n-97\n-98 template< int dim >\n-99 static DGFEntityKey<_unsigned_int_>\n-100 generateSimplexFace ( const std::vector< unsigned int > &element, int f );\n-101 };\n+94 template\n+95 class P0VTKFunction\n+96 : public VTKFunction< GV >\n+97 {\n+99 typedef VTKFunction<_GV_> Base;\n+101 typedef MultipleCodimMultipleGeomTypeMapper Mapper;\n 102\n-103\n-104 inline int ElementFaceUtil::nofFaces ( int dim, const std::vector< unsigned\n-int > &element )\n-105 {\n-106 switch( dim )\n-107 {\n-108 case 1 :\n-109 return 2;\n-110 case 2 :\n-111 switch( element.size() )\n-112 {\n-113 case 3 :\n-114 return 3;\n-115 case 4 :\n-116 return 4;\n-117 default :\n-118 return -1;\n-119 }\n-120 case 3 :\n-121 switch( element.size() )\n-122 {\n-123 case 4 :\n-124 return 4;\n-125 case 8 :\n-126 return 6;\n-127 default :\n-128 return -1;\n-129 }\n-130 default :\n-131 return -1;\n-132 }\n+104 const V& v;\n+106 std::string s;\n+108 int ncomps_;\n+111 int mycomp_;\n+113 VTK::Precision prec_;\n+115 Mapper mapper;\n+116\n+117 public:\n+118 typedef typename Base::Entity Entity;\n+119 typedef typename Base::ctype ctype;\n+120 using Base::dim;\n+121\n+123 int ncomps () const override\n+124 {\n+125 return 1;\n+126 }\n+127\n+129 double evaluate (int, const Entity& e,\n+130 const Dune::FieldVector&) const override\n+131 {\n+132 return v[mapper.index(e)*ncomps_+mycomp_];\n 133 }\n 134\n-135\n-136 inline int ElementFaceUtil::faceSize( int dim, bool simpl )\n+136 std::string name () const override\n 137 {\n-138 switch( dim )\n-139 {\n-140 case 1 :\n-141 return 1;\n-142 case 2 :\n-143 return 2;\n-144 case 3 :\n-145 return (simpl ? 3 : 4);\n-146 default :\n-147 return -1;\n-148 }\n-149 }\n-150\n-151} //end namespace Dune\n-152\n-153// include inline implementation\n-154#include \"entitykey_inline.hh\"\n-155#endif\n-entitykey_inline.hh\n-dgfexception.hh\n+138 return s;\n+139 }\n+140\n+142 VTK::Precision precision() const override\n+143 {\n+144 return prec_;\n+145 }\n+146\n+148\n+165 P0VTKFunction(const GV &gv, const V &v_, const std::string &s_,\n+166 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)\n+167 : v( v_ ),\n+168 s( s_ ),\n+169 ncomps_(ncomps),\n+170 mycomp_(mycomp),\n+171 prec_(prec),\n+172 mapper( gv, mcmgElementLayout() )\n+173 {\n+174 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))\n+175 DUNE_THROW(IOError, \"P0VTKFunction: size mismatch\");\n+176 }\n+177\n+179 virtual ~P0VTKFunction() {}\n+180 };\n+181\n+183 //\n+184 // P1VTKFunction\n+185 //\n+186\n+188\n+202 template\n+203 class P1VTKFunction\n+204 : public VTKFunction< GV >\n+205 {\n+207 typedef VTKFunction<_GV_> Base;\n+209 typedef MultipleCodimMultipleGeomTypeMapper Mapper;\n+210\n+212 const V& v;\n+214 std::string s;\n+216 int ncomps_;\n+219 int mycomp_;\n+221 VTK::Precision prec_;\n+223 Mapper mapper;\n+224\n+225 public:\n+226 typedef typename Base::Entity Entity;\n+227 typedef typename Base::ctype ctype;\n+228 using Base::dim;\n+229\n+231 int ncomps () const override\n+232 {\n+233 return 1;\n+234 }\n+235\n+237 double evaluate ([[maybe_unused]] int comp, const Entity& e,\n+238 const Dune::FieldVector& xi) const override\n+239 {\n+240 const unsigned int myDim = Entity::mydimension;\n+241 const unsigned int nVertices = e.subEntities(dim);\n+242\n+243 std::vector > cornerValues(nVertices);\n+244 for (unsigned i=0; i interpolation(e.type(),\n+cornerValues);\n+249 return interpolation.global(xi);\n+250 }\n+251\n+253 std::string name () const override\n+254 {\n+255 return s;\n+256 }\n+257\n+259 VTK::Precision precision() const override\n+260 {\n+261 return prec_;\n+262 }\n+263\n+265\n+282 P1VTKFunction(const GV& gv, const V &v_, const std::string &s_,\n+283 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)\n+284 : v( v_ ),\n+285 s( s_ ),\n+286 ncomps_(ncomps),\n+287 mycomp_(mycomp),\n+288 prec_(prec),\n+289 mapper( gv, mcmgVertexLayout() )\n+290 {\n+291 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))\n+292 DUNE_THROW(IOError,\"P1VTKFunction: size mismatch\");\n+293 }\n+294\n+296 virtual ~P1VTKFunction() {}\n+297 };\n+298\n+300\n+301} // namespace Dune\n+302\n+303#endif // DUNE_GRID_IO_FILE_VTK_FUNCTION_HH\n+mcmgmapper.hh\n+Mapper for multiple codim and multiple geometry types.\n+common.hh\n+Common stuff for the VTKWriter.\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n+Dune::GridView::ctype\n+Grid::ctype ctype\n+type used for coordinates in grid\n+Definition common/gridview.hh:131\n+Dune::mcmgElementLayout\n+MCMGLayout mcmgElementLayout()\n+layout for elements (codim-0 entities)\n+Definition mcmgmapper.hh:97\n+Dune::mcmgVertexLayout\n+MCMGLayout mcmgVertexLayout()\n+layout for vertices (dim-0 entities)\n+Definition mcmgmapper.hh:107\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFEntityKey\n-Definition entitykey.hh:21\n-Dune::DGFEntityKey::operator<\n-bool operator<(const DGFEntityKey< A > &k) const\n-Definition entitykey.hh:53\n-Dune::DGFEntityKey::operator=\n-DGFEntityKey< A > & operator=(const DGFEntityKey< A > &k)\n-Definition entitykey_inline.hh:64\n-Dune::DGFEntityKey::origKeySet\n-bool origKeySet() const\n-Definition entitykey.hh:61\n-Dune::DGFEntityKey::size\n-int size() const\n-Definition entitykey.hh:75\n-Dune::DGFEntityKey::orientation\n-void orientation(int base, std ::vector< std ::vector< double > > &vtx)\n-Definition entitykey_inline.hh:78\n-Dune::DGFEntityKey::origKey\n-const A & origKey(int i) const\n-Definition entitykey.hh:68\n-Dune::DGFEntityKey::DGFEntityKey\n-DGFEntityKey(const std::vector< A > &key, int N, int offset, bool\n-setOrigKey=true)\n-Dune::DGFEntityKey::print\n-void print(std ::ostream &out=std ::cerr) const\n-Definition entitykey_inline.hh:105\n-Dune::DGFEntityKey::operator[]\n-const A & operator[](int i) const\n-Definition entitykey.hh:46\n-Dune::ElementFaceUtil\n-Definition entitykey.hh:86\n-Dune::ElementFaceUtil::generateFace\n-static DGFEntityKey< unsigned int > generateFace(int dim, const std::vector<\n-unsigned int > &element, int f)\n-Definition entitykey_inline.hh:145\n-Dune::ElementFaceUtil::faceSize\n-static int faceSize(int dim, bool simpl)\n-Definition entitykey.hh:136\n-Dune::ElementFaceUtil::nofFaces\n-static int nofFaces(int dim, const std::vector< unsigned int > &element)\n-Definition entitykey.hh:104\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::Entity::mydimension\n+static constexpr int mydimension\n+Dimensionality of the reference element of the entity.\n+Definition common/entity.hh:112\n+Dune::GridView::Codim\n+A struct that collects all associated types of one implementation from the\n+Traits class.\n+Definition common/gridview.hh:104\n+Dune::MultipleCodimMultipleGeomTypeMapper\n+Implementation class for a multiple codim and multiple geometry type mapper.\n+Definition mcmgmapper.hh:129\n+Dune::MultipleCodimMultipleGeomTypeMapper::size\n+size_type size() const\n+Return total number of entities in the entity set managed by the mapper.\n+Definition mcmgmapper.hh:204\n+Dune::MultipleCodimMultipleGeomTypeMapper::subIndex\n+Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i,\n+unsigned int codim) const\n+Map subentity of codim 0 entity to starting index in array for dof block.\n+Definition mcmgmapper.hh:185\n+Dune::MultipleCodimMultipleGeomTypeMapper::index\n+Index index(const EntityType &e) const\n+Map entity to starting index in array for dof block.\n+Definition mcmgmapper.hh:171\n+Dune::VTKFunction\n+A base class for grid functions with any return type and dimension.\n+Definition function.hh:42\n+Dune::VTKFunction::evaluate\n+virtual double evaluate(int comp, const Entity &e, const Dune::FieldVector<\n+ctype, dim > &xi) const =0\n+evaluate single component comp in the entity e at local coordinates xi\n+Dune::VTKFunction::ctype\n+GridView::ctype ctype\n+Definition function.hh:44\n+Dune::VTKFunction::Entity\n+GridView::template Codim< 0 >::Entity Entity\n+Definition function.hh:46\n+Dune::VTKFunction::dim\n+static constexpr int dim\n+Definition function.hh:45\n+Dune::VTKFunction::name\n+virtual std::string name() const =0\n+get name\n+Dune::VTKFunction::precision\n+virtual VTK::Precision precision() const\n+get output precision for the field\n+Definition function.hh:67\n+Dune::VTKFunction::ncomps\n+virtual int ncomps() const =0\n+Dune::VTKFunction::~VTKFunction\n+virtual ~VTKFunction()\n+virtual destructor\n+Definition function.hh:71\n+Dune::P0VTKFunction\n+Take a vector and interpret it as cell data for the VTKWriter.\n+Definition function.hh:97\n+Dune::P0VTKFunction::name\n+std::string name() const override\n+get name\n+Definition function.hh:136\n+Dune::P0VTKFunction::ctype\n+Base::ctype ctype\n+Definition function.hh:119\n+Dune::P0VTKFunction::evaluate\n+double evaluate(int, const Entity &e, const Dune::FieldVector< ctype, dim > &)\n+const override\n+evaluate\n+Definition function.hh:129\n+Dune::P0VTKFunction::P0VTKFunction\n+P0VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1,\n+int mycomp=0, VTK::Precision prec=VTK::Precision::float32)\n+construct from a vector and a name\n+Definition function.hh:165\n+Dune::P0VTKFunction::precision\n+VTK::Precision precision() const override\n+get output precision for the field\n+Definition function.hh:142\n+Dune::P0VTKFunction::Entity\n+Base::Entity Entity\n+Definition function.hh:118\n+Dune::P0VTKFunction::~P0VTKFunction\n+virtual ~P0VTKFunction()\n+destructor\n+Definition function.hh:179\n+Dune::P0VTKFunction::ncomps\n+int ncomps() const override\n+return number of components\n+Definition function.hh:123\n+Dune::P1VTKFunction\n+Take a vector and interpret it as point data for the VTKWriter.\n+Definition function.hh:205\n+Dune::P1VTKFunction::name\n+std::string name() const override\n+get name\n+Definition function.hh:253\n+Dune::P1VTKFunction::~P1VTKFunction\n+virtual ~P1VTKFunction()\n+destructor\n+Definition function.hh:296\n+Dune::P1VTKFunction::Entity\n+Base::Entity Entity\n+Definition function.hh:226\n+Dune::P1VTKFunction::ctype\n+Base::ctype ctype\n+Definition function.hh:227\n+Dune::P1VTKFunction::precision\n+VTK::Precision precision() const override\n+get output precision for the field\n+Definition function.hh:259\n+Dune::P1VTKFunction::evaluate\n+double evaluate(int comp, const Entity &e, const Dune::FieldVector< ctype, dim\n+> &xi) const override\n+evaluate\n+Definition function.hh:237\n+Dune::P1VTKFunction::P1VTKFunction\n+P1VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1,\n+int mycomp=0, VTK::Precision prec=VTK::Precision::float32)\n+construct from a vector and a name\n+Definition function.hh:282\n+Dune::P1VTKFunction::ncomps\n+int ncomps() const override\n+return number of components\n+Definition function.hh:231\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00785.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00785.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: parser.hh File Reference\n+dune-grid: basicwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,46 +65,53 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    parser.hh File Reference
    \n+
    basicwriter.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n+
    #include <fstream>
    \n+#include <iomanip>
    \n+#include <iterator>
    \n+#include <list>
    \n+#include <memory>
    \n+#include <sstream>
    \n #include <string>
    \n-#include <vector>
    \n-#include <map>
    \n-#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n+#include <dune/common/parallel/mpiguard.hh>
    \n+#include <dune/common/path.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <dune/grid/io/file/vtk/functionwriter.hh>
    \n+#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n+#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::DGFBoundaryParameter
     Contains types for additional features. More...
     
    class  Dune::DuneGridFormatParser
     The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class. More...
    class  Dune::VTK::BasicWriter< IteratorFactory >
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,30 +2,36 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n+ * vtk\n Classes | Namespaces\n-parser.hh File Reference\n-#include \n+basicwriter.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-struct \u00a0 Dune::DGFBoundaryParameter\n-\u00a0 Contains types for additional features. More...\n-\u00a0\n- class \u00a0 Dune::DuneGridFormatParser\n-\u00a0 The DuneGridFormatParser class: reads a DGF file and stores build\n- information in vector structures used by the MacroGrid class. More...\n+class \u00a0 Dune::VTK::BasicWriter<_IteratorFactory_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::VTK\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00785_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00785_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: parser.hh Source File\n+dune-grid: basicwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,230 +70,494 @@\n
    \n \n \n \n \n \n \n
    \n-
    parser.hh
    \n+
    basicwriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_DUNEGRIDFORMATPARSER_HH
    \n-
    6#define DUNE_DGF_DUNEGRIDFORMATPARSER_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <string>
    \n-
    10#include <vector>
    \n-
    11#include <map>
    \n-
    12
    \n-\n-
    14
    \n-
    15namespace Dune
    \n-
    16{
    \n-
    17
    \n-
    18 class DGFPrintInfo;
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH
    \n+
    8
    \n+
    9#include <fstream>
    \n+
    10#include <iomanip>
    \n+
    11#include <iterator>
    \n+
    12#include <list>
    \n+
    13#include <memory>
    \n+
    14#include <sstream>
    \n+
    15#include <string>
    \n+
    16
    \n+
    17#include <dune/common/parallel/mpiguard.hh>
    \n+
    18#include <dune/common/path.hh>
    \n
    19
    \n-
    \n-\n-
    23 {
    \n-
    25 typedef std::string type;
    \n+
    20#include <dune/geometry/referenceelements.hh>
    \n+
    21
    \n+\n+\n+\n+\n
    26
    \n-
    \n-
    28 static const type &defaultValue ()
    \n-
    29 {
    \n-
    30 static type value;
    \n-
    31 return value;
    \n-
    32 }
    \n-
    \n+
    27namespace Dune
    \n+
    28{
    \n+
    31
    \n+
    \n+
    32 namespace VTK {
    \n
    33
    \n-
    \n-
    35 static type convert ( const std::string & parameter )
    \n-
    36 {
    \n-
    37 return parameter;
    \n-
    38 }
    \n-
    \n+
    34 template<typename IteratorFactory>
    \n+
    \n+\n+
    36 typedef typename IteratorFactory::CellIterator CellIterator;
    \n+
    37 typedef typename IteratorFactory::CornerIterator CornerIterator;
    \n+
    38 typedef typename IteratorFactory::PointIterator PointIterator;
    \n
    39
    \n-
    41 static const char delimiter = ':';
    \n-
    42 };
    \n-
    \n-
    43
    \n-
    \n-\n-
    47 {
    \n-
    48 public:
    \n-
    49 typedef enum {Simplex,Cube,General} element_t;
    \n-
    50
    \n-\n+
    40 typedef typename IteratorFactory::Cell Cell;
    \n+
    41
    \n+
    42 public:
    \n+\n+
    44
    \n+
    45 private:
    \n+
    46 typedef std::list<std::shared_ptr<FunctionWriter> > WriterList;
    \n+
    47 typedef typename WriterList::const_iterator WIterator;
    \n+
    48
    \n+
    49 typedef typename Cell::Geometry::ctype ctype;
    \n+
    50 static const unsigned celldim = Cell::mydimension;
    \n+
    51 typedef ReferenceElements<ctype, celldim> Refelems;
    \n
    52
    \n-
    54 DuneGridFormatParser ( int rank, int size );
    \n+
    53 static const FileType fileType = celldim == 1
    \n+\n
    55
    \n-
    66 static bool isDuneGridFormat ( std::istream &input );
    \n-
    67
    \n-
    77 static bool isDuneGridFormat ( const std::string &filename );
    \n-
    78
    \n-
    91 bool readDuneGrid( std::istream &input, int dimG, int dimW );
    \n-
    92
    \n-
    94 void writeTetgenPoly ( const std::string &, std::string &, std::string & );
    \n-
    95
    \n-
    96 void writeTetgenPoly ( std::ostream & out, const bool writeSegments = true );
    \n-
    97
    \n-
    98 protected:
    \n-
    99 void generateBoundaries ( std::istream &, bool );
    \n-
    100
    \n-
    101 // call to tetgen/triangle
    \n-
    102 void generateSimplexGrid ( std::istream & );
    \n-
    103 void readTetgenTriangle ( const std::string & );
    \n-
    104
    \n-
    105 // helper methods
    \n-
    106 void removeCopies ();
    \n-
    107
    \n-
    108 void setOrientation ( int use1, int use2,
    \n-
    109 orientation_t orientation=counterclockwise );
    \n-
    110
    \n-
    111 void setRefinement ( int use1, int use2, int is1=-1, int is2=-1 );
    \n-
    112
    \n-
    113 double testTriang ( int snr );
    \n-
    114
    \n-
    115 std::vector< double > & getElParam ( int i, std::vector< double > & coord );
    \n-
    116
    \n-
    117 std::vector< double > & getVtxParam ( int i, std::vector< double > & coord );
    \n-
    118
    \n-
    119 static std::string temporaryFileName ();
    \n+
    56 const IteratorFactory& factory;
    \n+
    57
    \n+
    58 WriterList cellData;
    \n+
    59 WriterList pointData;
    \n+
    60
    \n+\n+
    62 typename IteratorFactory::ConnectivityWriter connectivity;
    \n+
    63 OffsetsWriter<Cell> offsets;
    \n+\n+
    65
    \n+
    66 public:
    \n+
    \n+
    67 BasicWriter(const IteratorFactory& factory_)
    \n+
    68 : factory(factory_), connectivity(factory.makeConnectivity())
    \n+
    69 { }
    \n+
    \n+
    70
    \n+
    72 //
    \n+
    73 // Methods for adding data
    \n+
    74 //
    \n+
    75
    \n+
    \n+
    76 void addCellData(const std::shared_ptr<FunctionWriter>& writer) {
    \n+
    77 cellData.push_back(writer);
    \n+
    78 }
    \n+
    \n+
    79
    \n+
    \n+
    80 void addPointData(const std::shared_ptr<FunctionWriter>& writer) {
    \n+
    81 pointData.push_back(writer);
    \n+
    82 }
    \n+
    \n+
    83
    \n+
    \n+
    84 void clear() {
    \n+
    85 cellData.clear();
    \n+
    86 pointData.clear();
    \n+
    87 }
    \n+
    \n+
    88
    \n+
    89 protected:
    \n+
    91 //
    \n+
    92 // Methods for writing single functions
    \n+
    93 //
    \n+
    94
    \n+
    \n+\n+
    96 FunctionWriter& functionWriter,
    \n+
    97 unsigned ncells) const
    \n+
    98 {
    \n+
    99 if(functionWriter.beginWrite(vtuWriter, ncells)) {
    \n+
    100 const CellIterator& cellend = factory.endCells();
    \n+
    101 for(CellIterator cellit = factory.beginCells(); cellit != cellend;
    \n+
    102 ++cellit)
    \n+
    103 functionWriter.write(*cellit, Refelems::general(cellit->type()).
    \n+
    104 position(0,0));
    \n+
    105 }
    \n+
    106 functionWriter.endWrite();
    \n+
    107 }
    \n+
    \n+
    108
    \n+
    \n+\n+
    110 FunctionWriter& functionWriter,
    \n+
    111 unsigned npoints) const
    \n+
    112 {
    \n+
    113 if(functionWriter.beginWrite(vtuWriter, npoints)) {
    \n+
    114 const PointIterator& pend = factory.endPoints();
    \n+
    115 for(PointIterator pit = factory.beginPoints(); pit != pend; ++pit)
    \n+
    116 functionWriter.write(pit->cell(), pit->duneIndex());
    \n+
    117 }
    \n+
    118 functionWriter.endWrite();
    \n+
    119 }
    \n+
    \n
    120
    \n-
    121 // dimension of world and problem: set through the readDuneGrid() method
    \n-\n-
    123
    \n-
    124 // vector of vertex coordinates
    \n-
    125 std::vector < std::vector < double > > vtx;
    \n-
    126
    \n-\n-
    128
    \n-\n-
    130
    \n-
    131 double minVertexDistance; // min. L^1 distance of distinct points
    \n+
    \n+\n+
    122 FunctionWriter& functionWriter,
    \n+
    123 unsigned ncorners) const
    \n+
    124 {
    \n+
    125 if(functionWriter.beginWrite(vtuWriter, ncorners)) {
    \n+
    126 const CornerIterator& cend = factory.endCorners();
    \n+
    127 for(CornerIterator cit = factory.beginCorners(); cit != cend; ++cit)
    \n+
    128 functionWriter.write(cit->cell(), cit->duneIndex());
    \n+
    129 }
    \n+
    130 functionWriter.endWrite();
    \n+
    131 }
    \n+
    \n
    132
    \n-
    133 // vector of elements
    \n-
    134 std :: vector< std :: vector< unsigned int > > elements;
    \n-
    135
    \n-\n+
    134 //
    \n+
    135 // Methods for writing whole sections
    \n+
    136 //
    \n
    137
    \n-
    138 // vector of boundary segments + identifier
    \n-
    139 std::vector < std::vector < int > > bound;
    \n-
    140
    \n-\n-
    142
    \n-
    143 // map to generate and find boundary segments
    \n-\n-
    145 typedef std::pair < int, BoundaryParameter > BndParam;
    \n-
    146 typedef std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t;
    \n-\n-
    148
    \n-
    149 // true if parameters on a boundary found
    \n-\n+
    \n+
    138 static std::string getFirstScalar(const WriterList& data) {
    \n+
    139 for(auto&& d : data)
    \n+
    140 if (d->ncomps() == 1)
    \n+
    141 return d->name();
    \n+
    142 return "";
    \n+
    143 }
    \n+
    \n+
    144
    \n+
    \n+
    145 static std::string getFirstVector(const WriterList& data) {
    \n+
    146 for(auto&& d : data)
    \n+
    147 if (d->ncomps() == 3)
    \n+
    148 return d->name();
    \n+
    149 return "";
    \n+
    150 }
    \n+
    \n
    151
    \n-
    152 // set by generator depending on element type wanted
    \n-\n+
    \n+
    152 void writeCellData(VTUWriter& vtuWriter, unsigned ncells) const {
    \n+
    153 if(cellData.empty()) return;
    \n
    154
    \n-
    155 // set by the readDuneGrid method depending
    \n-
    156 // on what type the elements were generated
    \n-\n-
    158
    \n-
    159 // true if grid is generated using the interval Block
    \n-\n-
    161
    \n-
    162 // parameters on elements
    \n-\n-
    164
    \n-
    165 std::vector< std::vector< double > > vtxParams,elParams;
    \n-
    166
    \n-
    167 // write information about generation process
    \n-\n-
    169
    \n-
    170 std::vector < double > emptyParam_;
    \n-
    171
    \n-
    172
    \n-
    173 private:
    \n-
    174 int rank_;
    \n-
    175 int size_;
    \n-
    176
    \n-
    177 template< class GridType >
    \n-
    178 friend struct DGFGridFactory;
    \n+
    155 vtuWriter.beginCellData(getFirstScalar(cellData),
    \n+
    156 getFirstVector(cellData));
    \n+
    157
    \n+
    158 for (auto&& cD : cellData)
    \n+
    159 writeCellFunction(vtuWriter, *cD, ncells);
    \n+
    160 vtuWriter.endCellData();
    \n+
    161 }
    \n+
    \n+
    162
    \n+
    \n+
    163 void writePointData(VTUWriter& vtuWriter, unsigned npoints) const {
    \n+
    164 if(pointData.empty()) return;
    \n+
    165
    \n+
    166 vtuWriter.beginPointData(getFirstScalar(pointData),
    \n+
    167 getFirstVector(pointData));
    \n+
    168
    \n+
    169 for (auto&& pD : pointData)
    \n+
    170 writePointFunction(vtuWriter, *pD, npoints);
    \n+
    171 vtuWriter.endPointData();
    \n+
    172 }
    \n+
    \n+
    173
    \n+
    \n+
    174 void writeGrid(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,
    \n+
    175 unsigned ncorners) {
    \n+
    176 vtuWriter.beginPoints();
    \n+
    177 writePointFunction(vtuWriter, coords, npoints);
    \n+
    178 vtuWriter.endPoints();
    \n
    179
    \n-
    180 template< class GridType >
    \n-
    181 friend struct DGFBaseFactory;
    \n-
    182
    \n-
    183 };
    \n-
    \n-
    184
    \n-
    185} // end namespace Dune
    \n-
    186
    \n-
    187#endif
    \n-\n+
    180 vtuWriter.beginCells();
    \n+
    181 writeCornerFunction(vtuWriter, connectivity, ncorners);
    \n+
    182 writeCellFunction(vtuWriter, offsets, ncells);
    \n+
    183 if(fileType != polyData)
    \n+
    184 writeCellFunction(vtuWriter, types, ncells);
    \n+
    185 vtuWriter.endCells();
    \n+
    186 }
    \n+
    \n+
    187
    \n+
    \n+
    188 void writeAll(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,
    \n+
    189 unsigned ncorners) {
    \n+
    190 writeCellData(vtuWriter, ncells);
    \n+
    191 writePointData(vtuWriter, npoints);
    \n+
    192 writeGrid(vtuWriter, ncells, npoints, ncorners);
    \n+
    193 }
    \n+
    \n+
    194
    \n+
    195 public:
    \n+
    \n+
    196 void writePiece(const std::string& filename, OutputType outputType) {
    \n+
    197 std::ofstream stream;
    \n+
    198 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n+
    199 std::ios_base::eofbit);
    \n+
    200 stream.open(filename.c_str(), std::ios::binary);
    \n+
    201
    \n+
    202 VTUWriter vtuWriter(stream, outputType, fileType);
    \n+
    203
    \n+
    204 unsigned ncells = std::distance(factory.beginCells(),
    \n+
    205 factory.endCells());
    \n+
    206 unsigned npoints = std::distance(factory.beginPoints(),
    \n+
    207 factory.endPoints());
    \n+
    208 unsigned ncorners = std::distance(factory.beginCorners(),
    \n+
    209 factory.endCorners());
    \n+
    210
    \n+
    211 vtuWriter.beginMain(ncells, npoints);
    \n+
    212 writeAll(vtuWriter, ncells, npoints, ncorners);
    \n+
    213 vtuWriter.endMain();
    \n+
    214
    \n+
    215 if(vtuWriter.beginAppended())
    \n+
    216 writeAll(vtuWriter, ncells, npoints, ncorners);
    \n+
    217 vtuWriter.endAppended();
    \n+
    218
    \n+
    219 }
    \n+
    \n+
    220
    \n+
    222
    \n+
    \n+
    238 void writeCollection(const std::string name,
    \n+
    239 const std::string& piecename,
    \n+
    240 const std::string& piecepath)
    \n+
    241 {
    \n+
    242 std::ofstream stream;
    \n+
    243 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n+
    244 std::ios_base::eofbit);
    \n+
    245 stream.open(name.c_str(), std::ios::binary);
    \n+
    246
    \n+
    247 PVTUWriter writer(stream, fileType);
    \n+
    248
    \n+
    249 writer.beginMain();
    \n+
    250
    \n+
    251 // PPointData
    \n+
    252 writer.beginPointData(getFirstScalar(pointData),
    \n+
    253 getFirstVector(pointData));
    \n+
    254 for(WIterator it=pointData.begin(); it!=pointData.end(); ++it)
    \n+
    255 (*it)->addArray(writer);
    \n+
    256 writer.endPointData();
    \n+
    257
    \n+
    258 // PCellData
    \n+
    259 writer.beginCellData(getFirstScalar(cellData),
    \n+
    260 getFirstVector(cellData));
    \n+
    261 for(WIterator it=cellData.begin(); it!=cellData.end(); ++it)
    \n+
    262 (*it)->addArray(writer);
    \n+
    263 writer.endCellData();
    \n+
    264
    \n+
    265 // PPoints
    \n+
    266 writer.beginPoints();
    \n+
    267 coords.addArray(writer);
    \n+
    268 writer.endPoints();
    \n+
    269
    \n+
    270 // Pieces
    \n+
    271 for( int i = 0; i < factory.comm().size(); ++i )
    \n+
    272 writer.addPiece(getParallelPieceName(piecename, piecepath, i));
    \n+
    273
    \n+
    274 writer.endMain();
    \n+
    275 }
    \n+
    \n+
    276
    \n+
    278 //
    \n+
    279 // Filename generators
    \n+
    280 //
    \n+
    281
    \n+
    283
    \n+
    \n+
    293 std::string getParallelPieceName(const std::string& name,
    \n+
    294 const std::string& path, int rank) const
    \n+
    295 {
    \n+
    296 std::ostringstream s;
    \n+
    297 if(path.size() > 0) {
    \n+
    298 s << path;
    \n+
    299 if(path[path.size()-1] != '/')
    \n+
    300 s << '/';
    \n+
    301 }
    \n+
    302 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()
    \n+
    303 << ':';
    \n+
    304 s << 'p' << std::setw(4) << std::setfill('0') << rank << ':';
    \n+
    305 s << name;
    \n+
    306 switch(fileType) {
    \n+
    307 case polyData : s << ".vtp"; break;
    \n+
    308 case unstructuredGrid : s << ".vtu"; break;
    \n+
    309 }
    \n+
    310 return s.str();
    \n+
    311 }
    \n+
    \n+
    312
    \n+
    314
    \n+
    \n+
    323 std::string getParallelHeaderName(const std::string& name,
    \n+
    324 const std::string& path) const
    \n+
    325 {
    \n+
    326 std::ostringstream s;
    \n+
    327 if(path.size() > 0) {
    \n+
    328 s << path;
    \n+
    329 if(path[path.size()-1] != '/')
    \n+
    330 s << '/';
    \n+
    331 }
    \n+
    332 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()
    \n+
    333 << ':';
    \n+
    334 s << name;
    \n+
    335 switch(fileType) {
    \n+
    336 case polyData : s << ".pvtp"; break;
    \n+
    337 case unstructuredGrid : s << ".pvtu"; break;
    \n+
    338 }
    \n+
    339 return s.str();
    \n+
    340 }
    \n+
    \n+
    341
    \n+
    343
    \n+
    \n+
    355 std::string getSerialPieceName(const std::string& name,
    \n+
    356 const std::string& path) const
    \n+
    357 {
    \n+
    358 switch(fileType) {
    \n+
    359 case polyData : return concatPaths(path, name+".vtp");
    \n+
    360 case unstructuredGrid : return concatPaths(path, name+".vtu");
    \n+
    361 }
    \n+
    362 return concatPaths(path, name); // unknown fileType
    \n+
    363 }
    \n+
    \n+
    364
    \n+
    366 //
    \n+
    367 // User interface functions for writing
    \n+
    368 //
    \n+
    369
    \n+
    371
    \n+
    \n+
    393 std::string pwrite(const std::string& name, const std::string& path,
    \n+
    394 const std::string& extendpath, OutputType outputType)
    \n+
    395 {
    \n+
    396 MPIGuard guard(factory.comm());
    \n+
    397
    \n+
    398 // do some magic because paraview can only cope with relative paths to
    \n+
    399 // piece files
    \n+
    400 std::ofstream file;
    \n+
    401 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n+
    402 std::ios_base::eofbit);
    \n+
    403 std::string piecepath = concatPaths(path, extendpath);
    \n+
    404 std::string relpiecepath = relativePath(path, piecepath);
    \n+
    405
    \n+
    406 // write this processes .vtu/.vtp piece file
    \n+
    407 std::string fullname = getParallelPieceName(name, piecepath,
    \n+
    408 factory.comm().rank());
    \n+
    409 writePiece(fullname, outputType);
    \n+
    410
    \n+
    411 // if we are rank 0, write .pvtu/.pvtp parallel header
    \n+
    412 fullname = getParallelHeaderName(name, path);
    \n+
    413 if(factory.comm().rank() == 0)
    \n+
    414 writeCollection(fullname, name, relpiecepath);
    \n+
    415
    \n+
    416 guard.finalize();
    \n+
    417
    \n+
    418 return fullname;
    \n+
    419 }
    \n+
    \n+
    420
    \n+
    \n+
    434 std::string write(const std::string &name, OutputType outputType)
    \n+
    435 {
    \n+
    436 // in the parallel case, just use pwrite, it has all the necessary
    \n+
    437 // stuff, so we don't need to reimplement it here.
    \n+
    438 if(factory.comm().size() > 1)
    \n+
    439 return pwrite(name, "", "", outputType);
    \n+
    440
    \n+
    441 // generate filename for process data
    \n+
    442 std::string pieceName = getSerialPieceName(name, "");
    \n+
    443
    \n+
    444 writePiece(pieceName, outputType);
    \n+
    445
    \n+
    446 return pieceName;
    \n+
    447 }
    \n+
    \n+
    448
    \n+
    449 };
    \n+
    \n+
    450
    \n+
    451 } // namespace VTK
    \n+
    \n+
    452
    \n+
    454
    \n+
    455} // namespace Dune
    \n+
    456
    \n+
    457#endif // DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH
    \n+\n+\n+\n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    Definition io/file/dgfparser/dgfparser.cc:26
    \n-
    Contains types for additional features.
    Definition parser.hh:23
    \n-
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n-
    static const char delimiter
    delimiter
    Definition parser.hh:41
    \n-
    static type convert(const std::string &parameter)
    copy from string
    Definition parser.hh:35
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-
    The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures us...
    Definition parser.hh:47
    \n-
    int nofvtxparams
    Definition parser.hh:163
    \n-
    int nofbound
    Definition parser.hh:141
    \n-
    std::pair< int, BoundaryParameter > BndParam
    Definition parser.hh:145
    \n-
    void readTetgenTriangle(const std::string &)
    Definition io/file/dgfparser/dgfparser.cc:795
    \n-
    static bool isDuneGridFormat(std::istream &input)
    check whether a stream is in DUNE grid format
    Definition io/file/dgfparser/dgfparser.cc:271
    \n-
    void setOrientation(int use1, int use2, orientation_t orientation=counterclockwise)
    Definition io/file/dgfparser/dgfparser.cc:910
    \n-
    std::vector< std::vector< double > > vtxParams
    Definition parser.hh:165
    \n-
    void setRefinement(int use1, int use2, int is1=-1, int is2=-1)
    Definition io/file/dgfparser/dgfparser.cc:989
    \n-
    friend struct DGFBaseFactory
    Definition parser.hh:181
    \n-
    static std::string temporaryFileName()
    Definition io/file/dgfparser/dgfparser.cc:1096
    \n-
    void removeCopies()
    Definition io/file/dgfparser/dgfparser.cc:464
    \n-
    int dimw
    Definition parser.hh:122
    \n-
    int dimgrid
    Definition parser.hh:122
    \n-
    element_t element
    Definition parser.hh:153
    \n-
    DGFBoundaryParameter::type BoundaryParameter
    Definition parser.hh:144
    \n-
    int nofelements
    Definition parser.hh:136
    \n-
    orientation_t
    Definition parser.hh:51
    \n-
    @ clockwise
    Definition parser.hh:51
    \n-
    @ counterclockwise
    Definition parser.hh:51
    \n-
    double testTriang(int snr)
    Definition io/file/dgfparser/dgfparser.cc:1050
    \n-
    double minVertexDistance
    Definition parser.hh:131
    \n-
    bool simplexgrid
    Definition parser.hh:157
    \n-
    std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t
    Definition parser.hh:146
    \n-
    std::vector< std::vector< int > > bound
    Definition parser.hh:139
    \n-
    void generateSimplexGrid(std::istream &)
    Definition io/file/dgfparser/dgfparser.cc:624
    \n-
    std::vector< double > emptyParam_
    Definition parser.hh:170
    \n-
    int nofelparams
    Definition parser.hh:163
    \n-
    std::vector< std::vector< double > > elParams
    Definition parser.hh:165
    \n-
    facemap_t facemap
    Definition parser.hh:147
    \n-
    element_t
    Definition parser.hh:49
    \n-
    @ General
    Definition parser.hh:49
    \n-
    @ Cube
    Definition parser.hh:49
    \n-
    @ Simplex
    Definition parser.hh:49
    \n-
    bool cube2simplex
    Definition parser.hh:160
    \n-
    int nofvtx
    Definition parser.hh:127
    \n-
    void writeTetgenPoly(const std::string &, std::string &, std::string &)
    method to write in Tetgen/Triangle Poly Format
    Definition io/file/dgfparser/dgfparser.cc:123
    \n-
    std::vector< std::vector< double > > vtx
    Definition parser.hh:125
    \n-
    int vtxoffset
    Definition parser.hh:129
    \n-
    bool readDuneGrid(std::istream &input, int dimG, int dimW)
    parse dune grid format from stream
    Definition io/file/dgfparser/dgfparser.cc:298
    \n-
    std ::vector< std ::vector< unsigned int > > elements
    Definition parser.hh:134
    \n-
    bool haveBndParameters
    Definition parser.hh:150
    \n-
    DGFPrintInfo * info
    Definition parser.hh:168
    \n-
    void generateBoundaries(std::istream &, bool)
    Definition io/file/dgfparser/dgfparser.cc:502
    \n-
    std::vector< double > & getVtxParam(int i, std::vector< double > &coord)
    Definition io/file/dgfparser/dgfparser.cc:1086
    \n-
    std::vector< double > & getElParam(int i, std::vector< double > &coord)
    Definition io/file/dgfparser/dgfparser.cc:1070
    \n+
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n+
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n+
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n+
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n+
    Definition basicwriter.hh:35
    \n+
    void writeCellData(VTUWriter &vtuWriter, unsigned ncells) const
    Definition basicwriter.hh:152
    \n+
    BasicWriter(const IteratorFactory &factory_)
    Definition basicwriter.hh:67
    \n+
    std::string getSerialPieceName(const std::string &name, const std::string &path) const
    return name of a serial piece file
    Definition basicwriter.hh:355
    \n+
    void writeCollection(const std::string name, const std::string &piecename, const std::string &piecepath)
    write header file in parallel case to stream
    Definition basicwriter.hh:238
    \n+
    void writeGrid(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned ncorners)
    Definition basicwriter.hh:174
    \n+
    void writeAll(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned ncorners)
    Definition basicwriter.hh:188
    \n+
    std::string pwrite(const std::string &name, const std::string &path, const std::string &extendpath, OutputType outputType)
    write output; interface might change later
    Definition basicwriter.hh:393
    \n+
    void clear()
    Definition basicwriter.hh:84
    \n+
    void writeCellFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned ncells) const
    Definition basicwriter.hh:95
    \n+
    void writeCornerFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned ncorners) const
    Definition basicwriter.hh:121
    \n+
    std::string getParallelHeaderName(const std::string &name, const std::string &path) const
    return name of a parallel header file
    Definition basicwriter.hh:323
    \n+
    void writePointData(VTUWriter &vtuWriter, unsigned npoints) const
    Definition basicwriter.hh:163
    \n+
    static std::string getFirstVector(const WriterList &data)
    Definition basicwriter.hh:145
    \n+
    FunctionWriterBase< Cell > FunctionWriter
    Definition basicwriter.hh:43
    \n+
    void writePointFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned npoints) const
    Definition basicwriter.hh:109
    \n+
    void writePiece(const std::string &filename, OutputType outputType)
    Definition basicwriter.hh:196
    \n+
    void addCellData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:76
    \n+
    static std::string getFirstScalar(const WriterList &data)
    Definition basicwriter.hh:138
    \n+
    std::string getParallelPieceName(const std::string &name, const std::string &path, int rank) const
    return name of a parallel piece file
    Definition basicwriter.hh:293
    \n+
    std::string write(const std::string &name, OutputType outputType)
    write output (interface might change later)
    Definition basicwriter.hh:434
    \n+
    void addPointData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:80
    \n+
    Base class for function writers.
    Definition functionwriter.hh:34
    \n+
    virtual void write(const Cell &, const Domain &)
    write at the given position
    Definition functionwriter.hh:59
    \n+
    virtual void endWrite()=0
    signal end of writing
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0
    start writing with the given writer
    \n+
    writer for the Coordinates array
    Definition functionwriter.hh:147
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:165
    \n+
    writer for the offsets array
    Definition functionwriter.hh:300
    \n+
    writer for the types array
    Definition functionwriter.hh:340
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n+
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition pvtuwriter.hh:195
    \n+
    void endCellData()
    finish CellData section
    Definition pvtuwriter.hh:155
    \n+
    void beginMain(unsigned ghostLevel=0)
    start the main PPolyData/PUnstructuredGrid section
    Definition pvtuwriter.hh:189
    \n+
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition pvtuwriter.hh:146
    \n+
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition pvtuwriter.hh:120
    \n+
    void addPiece(const std::string &filename)
    Add a serial piece to the output file.
    Definition pvtuwriter.hh:215
    \n+
    void endPointData()
    finish PointData section
    Definition pvtuwriter.hh:129
    \n+
    void endPoints()
    finish section for the point coordinates
    Definition pvtuwriter.hh:171
    \n+
    void beginPoints()
    start section for the point coordinates
    Definition pvtuwriter.hh:166
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n+
    bool beginAppended()
    start the appended data section
    Definition vtuwriter.hh:345
    \n+
    void endAppended()
    finish the appended data section
    Definition vtuwriter.hh:359
    \n+
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n+
    void beginMain(unsigned ncells, unsigned npoints)
    start the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:310
    \n+
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n+
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n+
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n+
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n+
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n+
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n+
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n+
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:320
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,332 +2,605 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n-parser.hh\n+ * vtk\n+basicwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_DUNEGRIDFORMATPARSER_HH\n-6#define DUNE_DGF_DUNEGRIDFORMATPARSER_HH\n-7\n-8#include \n-9#include \n-10#include \n-11#include \n-12\n-13#include \n-14\n-15namespace Dune\n-16{\n-17\n-18 class DGFPrintInfo;\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15#include \n+16\n+17#include \n+18#include \n 19\n-22 struct DGFBoundaryParameter\n-23 {\n-25 typedef std::string type;\n+20#include \n+21\n+22#include \n+23#include \n+24#include \n+25#include \n 26\n-28 static const type &defaultValue ()\n-29 {\n-30 static type value;\n-31 return value;\n-32 }\n+27namespace Dune\n+28{\n+31\n+32 namespace VTK {\n 33\n-35 static type convert ( const std::string & parameter )\n-36 {\n-37 return parameter;\n-38 }\n+34 template\n+35 class BasicWriter {\n+36 typedef typename IteratorFactory::CellIterator CellIterator;\n+37 typedef typename IteratorFactory::CornerIterator CornerIterator;\n+38 typedef typename IteratorFactory::PointIterator PointIterator;\n 39\n-41 static const char delimiter = ':';\n-42 };\n-43\n-46 class DuneGridFormatParser\n-47 {\n-48 public:\n-49 typedef enum {Simplex,Cube,General} element_t;\n-50\n-51 typedef enum {counterclockwise=1,clockwise=-1} orientation_t;\n+40 typedef typename IteratorFactory::Cell Cell;\n+41\n+42 public:\n+43 typedef FunctionWriterBase FunctionWriter;\n+44\n+45 private:\n+46 typedef std::list > WriterList;\n+47 typedef typename WriterList::const_iterator WIterator;\n+48\n+49 typedef typename Cell::Geometry::ctype ctype;\n+50 static const unsigned celldim = Cell::mydimension;\n+51 typedef ReferenceElements Refelems;\n 52\n-54 DuneGridFormatParser ( int rank, int size );\n+53 static const FileType fileType = celldim == 1\n+54 ? polyData : unstructuredGrid;\n 55\n-66 static bool isDuneGridFormat ( std::istream &input );\n-67\n-77 static bool isDuneGridFormat ( const std::string &filename );\n-78\n-91 bool readDuneGrid( std::istream &input, int dimG, int dimW );\n-92\n-94 void writeTetgenPoly ( const std::string &, std::string &, std::string & );\n-95\n-96 void writeTetgenPoly ( std::ostream & out, const bool writeSegments = true\n-);\n-97\n-98 protected:\n-99 void generateBoundaries ( std::istream &, bool );\n-100\n-101 // call to tetgen/triangle\n-102 void generateSimplexGrid ( std::istream & );\n-103 void readTetgenTriangle ( const std::string & );\n-104\n-105 // helper methods\n-106 void removeCopies ();\n-107\n-108 void setOrientation ( int use1, int use2,\n-109 orientation_t orientation=counterclockwise );\n-110\n-111 void setRefinement ( int use1, int use2, int is1=-1, int is2=-1 );\n-112\n-113 double testTriang ( int snr );\n-114\n-115 std::vector< double > & getElParam ( int i, std::vector< double > & coord\n-);\n-116\n-117 std::vector< double > & getVtxParam ( int i, std::vector< double > & coord\n-);\n-118\n-119 static std::string temporaryFileName ();\n+56 const IteratorFactory& factory;\n+57\n+58 WriterList cellData;\n+59 WriterList pointData;\n+60\n+61 CoordinatesWriter coords;\n+62 typename IteratorFactory::ConnectivityWriter connectivity;\n+63 OffsetsWriter offsets;\n+64 TypesWriter types;\n+65\n+66 public:\n+67 BasicWriter(const IteratorFactory& factory_)\n+68 : factory(factory_), connectivity(factory.makeConnectivity())\n+69 { }\n+70\n+72 //\n+73 // Methods for adding data\n+74 //\n+75\n+76 void addCellData(const std::shared_ptr& writer) {\n+77 cellData.push_back(writer);\n+78 }\n+79\n+80 void addPointData(const std::shared_ptr& writer) {\n+81 pointData.push_back(writer);\n+82 }\n+83\n+84 void clear() {\n+85 cellData.clear();\n+86 pointData.clear();\n+87 }\n+88\n+89 protected:\n+91 //\n+92 // Methods for writing single functions\n+93 //\n+94\n+95 void writeCellFunction(VTUWriter& vtuWriter,\n+96 FunctionWriter& functionWriter,\n+97 unsigned ncells) const\n+98 {\n+99 if(functionWriter.beginWrite(vtuWriter, ncells)) {\n+100 const CellIterator& cellend = factory.endCells();\n+101 for(CellIterator cellit = factory.beginCells(); cellit != cellend;\n+102 ++cellit)\n+103 functionWriter.write(*cellit, Refelems::general(cellit->type()).\n+104 position(0,0));\n+105 }\n+106 functionWriter.endWrite();\n+107 }\n+108\n+109 void writePointFunction(VTUWriter& vtuWriter,\n+110 FunctionWriter& functionWriter,\n+111 unsigned npoints) const\n+112 {\n+113 if(functionWriter.beginWrite(vtuWriter, npoints)) {\n+114 const PointIterator& pend = factory.endPoints();\n+115 for(PointIterator pit = factory.beginPoints(); pit != pend; ++pit)\n+116 functionWriter.write(pit->cell(), pit->duneIndex());\n+117 }\n+118 functionWriter.endWrite();\n+119 }\n 120\n-121 // dimension of world and problem: set through the readDuneGrid() method\n-122 int dimw, dimgrid;\n-123\n-124 // vector of vertex coordinates\n-125 std::vector < std::vector < double > > vtx;\n-126\n-127 int nofvtx;\n-128\n-129 int vtxoffset;\n-130\n-131 double minVertexDistance; // min. L^1 distance of distinct points\n+121 void writeCornerFunction(VTUWriter& vtuWriter,\n+122 FunctionWriter& functionWriter,\n+123 unsigned ncorners) const\n+124 {\n+125 if(functionWriter.beginWrite(vtuWriter, ncorners)) {\n+126 const CornerIterator& cend = factory.endCorners();\n+127 for(CornerIterator cit = factory.beginCorners(); cit != cend; ++cit)\n+128 functionWriter.write(cit->cell(), cit->duneIndex());\n+129 }\n+130 functionWriter.endWrite();\n+131 }\n 132\n-133 // vector of elements\n-134 std :: vector< std :: vector< unsigned int > > elements;\n-135\n-136 int nofelements;\n+134 //\n+135 // Methods for writing whole sections\n+136 //\n 137\n-138 // vector of boundary segments + identifier\n-139 std::vector < std::vector < int > > bound;\n-140\n-141 int nofbound;\n-142\n-143 // map to generate and find boundary segments\n-144 typedef DGFBoundaryParameter::type BoundaryParameter;\n-145 typedef std::pair < int, BoundaryParameter > BndParam;\n-146 typedef std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t;\n-147 facemap_t facemap;\n-148\n-149 // true if parameters on a boundary found\n-150 bool haveBndParameters;\n+138 static std::string getFirstScalar(const WriterList& data) {\n+139 for(auto&& d : data)\n+140 if (d->ncomps() == 1)\n+141 return d->name();\n+142 return \"\";\n+143 }\n+144\n+145 static std::string getFirstVector(const WriterList& data) {\n+146 for(auto&& d : data)\n+147 if (d->ncomps() == 3)\n+148 return d->name();\n+149 return \"\";\n+150 }\n 151\n-152 // set by generator depending on element type wanted\n-153 element_t element;\n+152 void writeCellData(VTUWriter& vtuWriter, unsigned ncells) const {\n+153 if(cellData.empty()) return;\n 154\n-155 // set by the readDuneGrid method depending\n-156 // on what type the elements were generated\n-157 bool simplexgrid;\n-158\n-159 // true if grid is generated using the interval Block\n-160 bool cube2simplex;\n-161\n-162 // parameters on elements\n-163 int nofvtxparams,nofelparams;\n-164\n-165 std::vector< std::vector< double > > vtxParams,elParams;\n-166\n-167 // write information about generation process\n-168 DGFPrintInfo * info;\n-169\n-170 std::vector < double > emptyParam_;\n-171\n-172\n-173 private:\n-174 int rank_;\n-175 int size_;\n-176\n-177 template< class GridType >\n-178 friend struct DGFGridFactory;\n+155 vtuWriter.beginCellData(getFirstScalar(cellData),\n+156 getFirstVector(cellData));\n+157\n+158 for (auto&& cD : cellData)\n+159 writeCellFunction(vtuWriter, *cD, ncells);\n+160 vtuWriter.endCellData();\n+161 }\n+162\n+163 void writePointData(VTUWriter& vtuWriter, unsigned npoints) const {\n+164 if(pointData.empty()) return;\n+165\n+166 vtuWriter.beginPointData(getFirstScalar(pointData),\n+167 getFirstVector(pointData));\n+168\n+169 for (auto&& pD : pointData)\n+170 writePointFunction(vtuWriter, *pD, npoints);\n+171 vtuWriter.endPointData();\n+172 }\n+173\n+174 void writeGrid(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,\n+175 unsigned ncorners) {\n+176 vtuWriter.beginPoints();\n+177 writePointFunction(vtuWriter, coords, npoints);\n+178 vtuWriter.endPoints();\n 179\n-180 template< class GridType >\n-181 friend struct DGFBaseFactory;\n-182\n-183 };\n-184\n-185} // end namespace Dune\n-186\n-187#endif\n-entitykey.hh\n+180 vtuWriter.beginCells();\n+181 writeCornerFunction(vtuWriter, connectivity, ncorners);\n+182 writeCellFunction(vtuWriter, offsets, ncells);\n+183 if(fileType != polyData)\n+184 writeCellFunction(vtuWriter, types, ncells);\n+185 vtuWriter.endCells();\n+186 }\n+187\n+188 void writeAll(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,\n+189 unsigned ncorners) {\n+190 writeCellData(vtuWriter, ncells);\n+191 writePointData(vtuWriter, npoints);\n+192 writeGrid(vtuWriter, ncells, npoints, ncorners);\n+193 }\n+194\n+195 public:\n+196 void writePiece(const std::string& filename, OutputType outputType) {\n+197 std::ofstream stream;\n+198 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n+199 std::ios_base::eofbit);\n+200 stream.open(filename.c_str(), std::ios::binary);\n+201\n+202 VTUWriter vtuWriter(stream, outputType, fileType);\n+203\n+204 unsigned ncells = std::distance(factory.beginCells(),\n+205 factory.endCells());\n+206 unsigned npoints = std::distance(factory.beginPoints(),\n+207 factory.endPoints());\n+208 unsigned ncorners = std::distance(factory.beginCorners(),\n+209 factory.endCorners());\n+210\n+211 vtuWriter.beginMain(ncells, npoints);\n+212 writeAll(vtuWriter, ncells, npoints, ncorners);\n+213 vtuWriter.endMain();\n+214\n+215 if(vtuWriter.beginAppended())\n+216 writeAll(vtuWriter, ncells, npoints, ncorners);\n+217 vtuWriter.endAppended();\n+218\n+219 }\n+220\n+222\n+238 void writeCollection(const std::string name,\n+239 const std::string& piecename,\n+240 const std::string& piecepath)\n+241 {\n+242 std::ofstream stream;\n+243 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n+244 std::ios_base::eofbit);\n+245 stream.open(name.c_str(), std::ios::binary);\n+246\n+247 PVTUWriter writer(stream, fileType);\n+248\n+249 writer.beginMain();\n+250\n+251 // PPointData\n+252 writer.beginPointData(getFirstScalar(pointData),\n+253 getFirstVector(pointData));\n+254 for(WIterator it=pointData.begin(); it!=pointData.end(); ++it)\n+255 (*it)->addArray(writer);\n+256 writer.endPointData();\n+257\n+258 // PCellData\n+259 writer.beginCellData(getFirstScalar(cellData),\n+260 getFirstVector(cellData));\n+261 for(WIterator it=cellData.begin(); it!=cellData.end(); ++it)\n+262 (*it)->addArray(writer);\n+263 writer.endCellData();\n+264\n+265 // PPoints\n+266 writer.beginPoints();\n+267 coords.addArray(writer);\n+268 writer.endPoints();\n+269\n+270 // Pieces\n+271 for( int i = 0; i < factory.comm().size(); ++i )\n+272 writer.addPiece(getParallelPieceName(piecename, piecepath, i));\n+273\n+274 writer.endMain();\n+275 }\n+276\n+278 //\n+279 // Filename generators\n+280 //\n+281\n+283\n+293 std::string getParallelPieceName(const std::string& name,\n+294 const std::string& path, int rank) const\n+295 {\n+296 std::ostringstream s;\n+297 if(path.size() > 0) {\n+298 s << path;\n+299 if(path[path.size()-1] != '/')\n+300 s << '/';\n+301 }\n+302 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()\n+303 << ':';\n+304 s << 'p' << std::setw(4) << std::setfill('0') << rank << ':';\n+305 s << name;\n+306 switch(fileType) {\n+307 case polyData : s << \".vtp\"; break;\n+308 case unstructuredGrid : s << \".vtu\"; break;\n+309 }\n+310 return s.str();\n+311 }\n+312\n+314\n+323 std::string getParallelHeaderName(const std::string& name,\n+324 const std::string& path) const\n+325 {\n+326 std::ostringstream s;\n+327 if(path.size() > 0) {\n+328 s << path;\n+329 if(path[path.size()-1] != '/')\n+330 s << '/';\n+331 }\n+332 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()\n+333 << ':';\n+334 s << name;\n+335 switch(fileType) {\n+336 case polyData : s << \".pvtp\"; break;\n+337 case unstructuredGrid : s << \".pvtu\"; break;\n+338 }\n+339 return s.str();\n+340 }\n+341\n+343\n+355 std::string getSerialPieceName(const std::string& name,\n+356 const std::string& path) const\n+357 {\n+358 switch(fileType) {\n+359 case polyData : return concatPaths(path, name+\".vtp\");\n+360 case unstructuredGrid : return concatPaths(path, name+\".vtu\");\n+361 }\n+362 return concatPaths(path, name); // unknown fileType\n+363 }\n+364\n+366 //\n+367 // User interface functions for writing\n+368 //\n+369\n+371\n+393 std::string pwrite(const std::string& name, const std::string& path,\n+394 const std::string& extendpath, OutputType outputType)\n+395 {\n+396 MPIGuard guard(factory.comm());\n+397\n+398 // do some magic because paraview can only cope with relative paths to\n+399 // piece files\n+400 std::ofstream file;\n+401 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n+402 std::ios_base::eofbit);\n+403 std::string piecepath = concatPaths(path, extendpath);\n+404 std::string relpiecepath = relativePath(path, piecepath);\n+405\n+406 // write this processes .vtu/.vtp piece file\n+407 std::string fullname = getParallelPieceName(name, piecepath,\n+408 factory.comm().rank());\n+409 writePiece(fullname, outputType);\n+410\n+411 // if we are rank 0, write .pvtu/.pvtp parallel header\n+412 fullname = getParallelHeaderName(name, path);\n+413 if(factory.comm().rank() == 0)\n+414 writeCollection(fullname, name, relpiecepath);\n+415\n+416 guard.finalize();\n+417\n+418 return fullname;\n+419 }\n+420\n+434 std::string write(const std::string &name, OutputType outputType)\n+435 {\n+436 // in the parallel case, just use pwrite, it has all the necessary\n+437 // stuff, so we don't need to reimplement it here.\n+438 if(factory.comm().size() > 1)\n+439 return pwrite(name, \"\", \"\", outputType);\n+440\n+441 // generate filename for process data\n+442 std::string pieceName = getSerialPieceName(name, \"\");\n+443\n+444 writePiece(pieceName, outputType);\n+445\n+446 return pieceName;\n+447 }\n+448\n+449 };\n+450\n+451 } // namespace VTK\n+452\n+454\n+455} // namespace Dune\n+456\n+457#endif // DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH\n+vtuwriter.hh\n+pvtuwriter.hh\n+functionwriter.hh\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFPrintInfo\n-Definition io/file/dgfparser/dgfparser.cc:26\n-Dune::DGFBoundaryParameter\n-Contains types for additional features.\n-Definition parser.hh:23\n-Dune::DGFBoundaryParameter::defaultValue\n-static const type & defaultValue()\n-default constructor\n-Definition parser.hh:28\n-Dune::DGFBoundaryParameter::delimiter\n-static const char delimiter\n-delimiter\n-Definition parser.hh:41\n-Dune::DGFBoundaryParameter::convert\n-static type convert(const std::string ¶meter)\n-copy from string\n-Definition parser.hh:35\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n-Dune::DuneGridFormatParser\n-The DuneGridFormatParser class: reads a DGF file and stores build information\n-in vector structures us...\n-Definition parser.hh:47\n-Dune::DuneGridFormatParser::nofvtxparams\n-int nofvtxparams\n-Definition parser.hh:163\n-Dune::DuneGridFormatParser::nofbound\n-int nofbound\n-Definition parser.hh:141\n-Dune::DuneGridFormatParser::BndParam\n-std::pair< int, BoundaryParameter > BndParam\n-Definition parser.hh:145\n-Dune::DuneGridFormatParser::readTetgenTriangle\n-void readTetgenTriangle(const std::string &)\n-Definition io/file/dgfparser/dgfparser.cc:795\n-Dune::DuneGridFormatParser::isDuneGridFormat\n-static bool isDuneGridFormat(std::istream &input)\n-check whether a stream is in DUNE grid format\n-Definition io/file/dgfparser/dgfparser.cc:271\n-Dune::DuneGridFormatParser::setOrientation\n-void setOrientation(int use1, int use2, orientation_\n-t orientation=counterclockwise)\n-Definition io/file/dgfparser/dgfparser.cc:910\n-Dune::DuneGridFormatParser::vtxParams\n-std::vector< std::vector< double > > vtxParams\n-Definition parser.hh:165\n-Dune::DuneGridFormatParser::setRefinement\n-void setRefinement(int use1, int use2, int is1=-1, int is2=-1)\n-Definition io/file/dgfparser/dgfparser.cc:989\n-Dune::DuneGridFormatParser::DGFBaseFactory\n-friend struct DGFBaseFactory\n-Definition parser.hh:181\n-Dune::DuneGridFormatParser::temporaryFileName\n-static std::string temporaryFileName()\n-Definition io/file/dgfparser/dgfparser.cc:1096\n-Dune::DuneGridFormatParser::removeCopies\n-void removeCopies()\n-Definition io/file/dgfparser/dgfparser.cc:464\n-Dune::DuneGridFormatParser::dimw\n-int dimw\n-Definition parser.hh:122\n-Dune::DuneGridFormatParser::dimgrid\n-int dimgrid\n-Definition parser.hh:122\n-Dune::DuneGridFormatParser::element\n-element_t element\n-Definition parser.hh:153\n-Dune::DuneGridFormatParser::BoundaryParameter\n-DGFBoundaryParameter::type BoundaryParameter\n-Definition parser.hh:144\n-Dune::DuneGridFormatParser::nofelements\n-int nofelements\n-Definition parser.hh:136\n-Dune::DuneGridFormatParser::orientation_t\n-orientation_t\n-Definition parser.hh:51\n-Dune::DuneGridFormatParser::clockwise\n-@ clockwise\n-Definition parser.hh:51\n-Dune::DuneGridFormatParser::counterclockwise\n-@ counterclockwise\n-Definition parser.hh:51\n-Dune::DuneGridFormatParser::testTriang\n-double testTriang(int snr)\n-Definition io/file/dgfparser/dgfparser.cc:1050\n-Dune::DuneGridFormatParser::minVertexDistance\n-double minVertexDistance\n-Definition parser.hh:131\n-Dune::DuneGridFormatParser::simplexgrid\n-bool simplexgrid\n-Definition parser.hh:157\n-Dune::DuneGridFormatParser::facemap_t\n-std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t\n-Definition parser.hh:146\n-Dune::DuneGridFormatParser::bound\n-std::vector< std::vector< int > > bound\n-Definition parser.hh:139\n-Dune::DuneGridFormatParser::generateSimplexGrid\n-void generateSimplexGrid(std::istream &)\n-Definition io/file/dgfparser/dgfparser.cc:624\n-Dune::DuneGridFormatParser::emptyParam_\n-std::vector< double > emptyParam_\n-Definition parser.hh:170\n-Dune::DuneGridFormatParser::nofelparams\n-int nofelparams\n-Definition parser.hh:163\n-Dune::DuneGridFormatParser::elParams\n-std::vector< std::vector< double > > elParams\n-Definition parser.hh:165\n-Dune::DuneGridFormatParser::facemap\n-facemap_t facemap\n-Definition parser.hh:147\n-Dune::DuneGridFormatParser::element_t\n-element_t\n-Definition parser.hh:49\n-Dune::DuneGridFormatParser::General\n-@ General\n-Definition parser.hh:49\n-Dune::DuneGridFormatParser::Cube\n-@ Cube\n-Definition parser.hh:49\n-Dune::DuneGridFormatParser::Simplex\n-@ Simplex\n-Definition parser.hh:49\n-Dune::DuneGridFormatParser::cube2simplex\n-bool cube2simplex\n-Definition parser.hh:160\n-Dune::DuneGridFormatParser::nofvtx\n-int nofvtx\n-Definition parser.hh:127\n-Dune::DuneGridFormatParser::writeTetgenPoly\n-void writeTetgenPoly(const std::string &, std::string &, std::string &)\n-method to write in Tetgen/Triangle Poly Format\n-Definition io/file/dgfparser/dgfparser.cc:123\n-Dune::DuneGridFormatParser::vtx\n-std::vector< std::vector< double > > vtx\n-Definition parser.hh:125\n-Dune::DuneGridFormatParser::vtxoffset\n-int vtxoffset\n-Definition parser.hh:129\n-Dune::DuneGridFormatParser::readDuneGrid\n-bool readDuneGrid(std::istream &input, int dimG, int dimW)\n-parse dune grid format from stream\n-Definition io/file/dgfparser/dgfparser.cc:298\n-Dune::DuneGridFormatParser::elements\n-std ::vector< std ::vector< unsigned int > > elements\n-Definition parser.hh:134\n-Dune::DuneGridFormatParser::haveBndParameters\n-bool haveBndParameters\n-Definition parser.hh:150\n-Dune::DuneGridFormatParser::info\n-DGFPrintInfo * info\n-Definition parser.hh:168\n-Dune::DuneGridFormatParser::generateBoundaries\n-void generateBoundaries(std::istream &, bool)\n-Definition io/file/dgfparser/dgfparser.cc:502\n-Dune::DuneGridFormatParser::getVtxParam\n-std::vector< double > & getVtxParam(int i, std::vector< double > &coord)\n-Definition io/file/dgfparser/dgfparser.cc:1086\n-Dune::DuneGridFormatParser::getElParam\n-std::vector< double > & getElParam(int i, std::vector< double > &coord)\n-Definition io/file/dgfparser/dgfparser.cc:1070\n+Dune::VTK::OutputType\n+OutputType\n+How the bulk data should be stored in the file.\n+Definition common.hh:43\n+Dune::VTK::FileType\n+FileType\n+which type of VTK file to write\n+Definition common.hh:252\n+Dune::VTK::polyData\n+@ polyData\n+for .vtp files (PolyData)\n+Definition common.hh:254\n+Dune::VTK::unstructuredGrid\n+@ unstructuredGrid\n+for .vtu files (UnstructuredGrid)\n+Definition common.hh:256\n+Dune::VTK::BasicWriter\n+Definition basicwriter.hh:35\n+Dune::VTK::BasicWriter::writeCellData\n+void writeCellData(VTUWriter &vtuWriter, unsigned ncells) const\n+Definition basicwriter.hh:152\n+Dune::VTK::BasicWriter::BasicWriter\n+BasicWriter(const IteratorFactory &factory_)\n+Definition basicwriter.hh:67\n+Dune::VTK::BasicWriter::getSerialPieceName\n+std::string getSerialPieceName(const std::string &name, const std::string\n+&path) const\n+return name of a serial piece file\n+Definition basicwriter.hh:355\n+Dune::VTK::BasicWriter::writeCollection\n+void writeCollection(const std::string name, const std::string &piecename,\n+const std::string &piecepath)\n+write header file in parallel case to stream\n+Definition basicwriter.hh:238\n+Dune::VTK::BasicWriter::writeGrid\n+void writeGrid(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints,\n+unsigned ncorners)\n+Definition basicwriter.hh:174\n+Dune::VTK::BasicWriter::writeAll\n+void writeAll(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned\n+ncorners)\n+Definition basicwriter.hh:188\n+Dune::VTK::BasicWriter::pwrite\n+std::string pwrite(const std::string &name, const std::string &path, const\n+std::string &extendpath, OutputType outputType)\n+write output; interface might change later\n+Definition basicwriter.hh:393\n+Dune::VTK::BasicWriter::clear\n+void clear()\n+Definition basicwriter.hh:84\n+Dune::VTK::BasicWriter::writeCellFunction\n+void writeCellFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter,\n+unsigned ncells) const\n+Definition basicwriter.hh:95\n+Dune::VTK::BasicWriter::writeCornerFunction\n+void writeCornerFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter,\n+unsigned ncorners) const\n+Definition basicwriter.hh:121\n+Dune::VTK::BasicWriter::getParallelHeaderName\n+std::string getParallelHeaderName(const std::string &name, const std::string\n+&path) const\n+return name of a parallel header file\n+Definition basicwriter.hh:323\n+Dune::VTK::BasicWriter::writePointData\n+void writePointData(VTUWriter &vtuWriter, unsigned npoints) const\n+Definition basicwriter.hh:163\n+Dune::VTK::BasicWriter::getFirstVector\n+static std::string getFirstVector(const WriterList &data)\n+Definition basicwriter.hh:145\n+Dune::VTK::BasicWriter::FunctionWriter\n+FunctionWriterBase< Cell > FunctionWriter\n+Definition basicwriter.hh:43\n+Dune::VTK::BasicWriter::writePointFunction\n+void writePointFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter,\n+unsigned npoints) const\n+Definition basicwriter.hh:109\n+Dune::VTK::BasicWriter::writePiece\n+void writePiece(const std::string &filename, OutputType outputType)\n+Definition basicwriter.hh:196\n+Dune::VTK::BasicWriter::addCellData\n+void addCellData(const std::shared_ptr< FunctionWriter > &writer)\n+Definition basicwriter.hh:76\n+Dune::VTK::BasicWriter::getFirstScalar\n+static std::string getFirstScalar(const WriterList &data)\n+Definition basicwriter.hh:138\n+Dune::VTK::BasicWriter::getParallelPieceName\n+std::string getParallelPieceName(const std::string &name, const std::string\n+&path, int rank) const\n+return name of a parallel piece file\n+Definition basicwriter.hh:293\n+Dune::VTK::BasicWriter::write\n+std::string write(const std::string &name, OutputType outputType)\n+write output (interface might change later)\n+Definition basicwriter.hh:434\n+Dune::VTK::BasicWriter::addPointData\n+void addPointData(const std::shared_ptr< FunctionWriter > &writer)\n+Definition basicwriter.hh:80\n+Dune::VTK::FunctionWriterBase\n+Base class for function writers.\n+Definition functionwriter.hh:34\n+Dune::VTK::FunctionWriterBase::write\n+virtual void write(const Cell &, const Domain &)\n+write at the given position\n+Definition functionwriter.hh:59\n+Dune::VTK::FunctionWriterBase::endWrite\n+virtual void endWrite()=0\n+signal end of writing\n+Dune::VTK::FunctionWriterBase::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0\n+start writing with the given writer\n+Dune::VTK::CoordinatesWriter\n+writer for the Coordinates array\n+Definition functionwriter.hh:147\n+Dune::VTK::CoordinatesWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:165\n+Dune::VTK::OffsetsWriter\n+writer for the offsets array\n+Definition functionwriter.hh:300\n+Dune::VTK::TypesWriter\n+writer for the types array\n+Definition functionwriter.hh:340\n+Dune::VTK::PVTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition pvtuwriter.hh:62\n+Dune::VTK::PVTUWriter::endMain\n+void endMain()\n+finish the main PolyData/UnstructuredGrid section\n+Definition pvtuwriter.hh:195\n+Dune::VTK::PVTUWriter::endCellData\n+void endCellData()\n+finish CellData section\n+Definition pvtuwriter.hh:155\n+Dune::VTK::PVTUWriter::beginMain\n+void beginMain(unsigned ghostLevel=0)\n+start the main PPolyData/PUnstructuredGrid section\n+Definition pvtuwriter.hh:189\n+Dune::VTK::PVTUWriter::beginCellData\n+void beginCellData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start CellData section\n+Definition pvtuwriter.hh:146\n+Dune::VTK::PVTUWriter::beginPointData\n+void beginPointData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start PointData section\n+Definition pvtuwriter.hh:120\n+Dune::VTK::PVTUWriter::addPiece\n+void addPiece(const std::string &filename)\n+Add a serial piece to the output file.\n+Definition pvtuwriter.hh:215\n+Dune::VTK::PVTUWriter::endPointData\n+void endPointData()\n+finish PointData section\n+Definition pvtuwriter.hh:129\n+Dune::VTK::PVTUWriter::endPoints\n+void endPoints()\n+finish section for the point coordinates\n+Definition pvtuwriter.hh:171\n+Dune::VTK::PVTUWriter::beginPoints\n+void beginPoints()\n+start section for the point coordinates\n+Definition pvtuwriter.hh:166\n+Dune::VTK::VTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition vtuwriter.hh:98\n+Dune::VTK::VTUWriter::beginAppended\n+bool beginAppended()\n+start the appended data section\n+Definition vtuwriter.hh:345\n+Dune::VTK::VTUWriter::endAppended\n+void endAppended()\n+finish the appended data section\n+Definition vtuwriter.hh:359\n+Dune::VTK::VTUWriter::endCellData\n+void endCellData()\n+finish CellData section\n+Definition vtuwriter.hh:220\n+Dune::VTK::VTUWriter::beginMain\n+void beginMain(unsigned ncells, unsigned npoints)\n+start the main PolyData/UnstructuredGrid section\n+Definition vtuwriter.hh:310\n+Dune::VTK::VTUWriter::beginCells\n+void beginCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:274\n+Dune::VTK::VTUWriter::endPointData\n+void endPointData()\n+finish PointData section\n+Definition vtuwriter.hh:182\n+Dune::VTK::VTUWriter::beginCellData\n+void beginCellData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start CellData section\n+Definition vtuwriter.hh:205\n+Dune::VTK::VTUWriter::beginPointData\n+void beginPointData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start PointData section\n+Definition vtuwriter.hh:167\n+Dune::VTK::VTUWriter::endPoints\n+void endPoints()\n+finish section for the point coordinates\n+Definition vtuwriter.hh:249\n+Dune::VTK::VTUWriter::endCells\n+void endCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:285\n+Dune::VTK::VTUWriter::beginPoints\n+void beginPoints()\n+start section for the point coordinates\n+Definition vtuwriter.hh:238\n+Dune::VTK::VTUWriter::endMain\n+void endMain()\n+finish the main PolyData/UnstructuredGrid section\n+Definition vtuwriter.hh:320\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00788.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00788.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: polygon.hh File Reference\n+dune-grid: vtkwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,44 +65,95 @@\n \n \n \n \n \n \n \n
    \n \n-
    polygon.hh File Reference
    \n+
    vtkwriter.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n+\n+

    Provides file i/o for the visualization toolkit. \n+More...

    \n+
    #include <cstring>
    \n+#include <iostream>
    \n+#include <string>
    \n+#include <fstream>
    \n+#include <sstream>
    \n+#include <iomanip>
    \n+#include <memory>
    \n+#include <type_traits>
    \n #include <vector>
    \n+#include <list>
    \n+#include <map>
    \n+#include <dune/common/visibility.hh>
    \n #include <dune/common/typetraits.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/indent.hh>
    \n+#include <dune/common/iteratorfacades.hh>
    \n+#include <dune/common/path.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <dune/grid/io/file/vtk/dataarraywriter.hh>
    \n+#include <dune/grid/io/file/vtk/function.hh>
    \n+#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n+#include <dune/grid/io/file/vtk/streams.hh>
    \n+#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::dgf::PolygonBlock
    class  Dune::VTKWriter< GridView >
     Writer for the output of grid functions in the vtk format. More...
     
    class  Dune::VTKWriter< GridView >::VTKLocalFunction
     Type erasure wrapper for VTK data sets. More...
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase
     Base class for polymorphic container of underlying data set. More...
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapper< F >
     Type erasure implementation for functions conforming to the dune-functions LocalFunction interface. More...
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::GlobalFunctionWrapper< F >
     Type erasure implementation for C++ functions, i.e., functions that can be evaluated in global coordinates. More...
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::VTKFunctionWrapper
     Type erasure implementation for legacy VTKFunctions. More...
     
    class  Dune::VTKWriter< GridView >::CellIterator
     Iterator over the grids elements. More...
     
    class  Dune::VTKWriter< GridView >::VertexIterator
     Iterate over the grid's vertices. More...
     
    class  Dune::VTKWriter< GridView >::CornerIterator
     Iterate over the elements' corners. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-
    \n+

    Detailed Description

    \n+

    Provides file i/o for the visualization toolkit.

    \n+
    Author
    Peter Bastian, Christian Engwer
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,27 +2,79 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n+ * vtk\n Classes | Namespaces\n-polygon.hh File Reference\n+vtkwriter.hh File Reference\n+Provides file i/o for the visualization toolkit. 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+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::dgf::PolygonBlock\n+ class \u00a0 Dune::VTKWriter<_GridView_>\n+\u00a0 Writer for the output of grid functions in the vtk format. More...\n+\u00a0\n+ class \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction\n+\u00a0 Type erasure wrapper for VTK data sets. More...\n+\u00a0\n+struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::FunctionWrapperBase\n+\u00a0 Base class for polymorphic container of underlying data set. More...\n+\u00a0\n+struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::FunctionWrapper<_F_>\n+\u00a0 Type erasure implementation for functions conforming to the dune-\n+ functions LocalFunction interface. More...\n+\u00a0\n+struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::GlobalFunctionWrapper<\n+ F_>\n+\u00a0 Type erasure implementation for C++ functions, i.e., functions that\n+ can be evaluated in global coordinates. More...\n+\u00a0\n+struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::VTKFunctionWrapper\n+\u00a0 Type erasure implementation for legacy VTKFunctions. More...\n+\u00a0\n+ class \u00a0 Dune::VTKWriter<_GridView_>::CellIterator\n+\u00a0 Iterator over the grids elements. More...\n+\u00a0\n+ class \u00a0 Dune::VTKWriter<_GridView_>::VertexIterator\n+\u00a0 Iterate over the grid's vertices. More...\n+\u00a0\n+ class \u00a0 Dune::VTKWriter<_GridView_>::CornerIterator\n+\u00a0 Iterate over the elements' corners. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n+***** Detailed Description *****\n+Provides file i/o for the visualization toolkit.\n+ Author\n+ Peter Bastian, Christian Engwer\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00788_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00788_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: polygon.hh Source File\n+dune-grid: vtkwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,95 +70,1661 @@\n \n \n \n \n \n \n \n
    \n-
    polygon.hh
    \n+
    vtkwriter.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=2 sw=2 sts=2:
    \n-
    5#ifndef DUNE_POLYGON_HH
    \n-
    6#define DUNE_POLYGON_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n-
    10
    \n-
    11#include <dune/common/typetraits.hh>
    \n-\n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 namespace dgf
    \n-
    18 {
    \n-
    19
    \n-
    20 // PolygonBlock
    \n-
    21 // ------------
    \n-
    22
    \n-
    \n-\n-
    24 : public BasicBlock
    \n-
    25 {
    \n-
    \n-
    26 PolygonBlock ( std::istream &in, int numVtx, int vtxOfs )
    \n-
    27 : BasicBlock( in, "Polygon" ), vtxBegin_( vtxOfs ), vtxEnd_( vtxOfs + numVtx )
    \n-
    28 {}
    \n-
    \n-
    29
    \n-
    \n-
    30 int get ( std::vector< std::vector< int > > &polygons )
    \n-
    31 {
    \n-
    32 reset();
    \n-
    33 std::vector< int > polygon;
    \n-
    34 while( getnextline() )
    \n-
    35 {
    \n-
    36 polygon.clear();
    \n-
    37 for( int vtxIdx; getnextentry( vtxIdx ); )
    \n-
    38 {
    \n-
    39 if( (vtxBegin_ > vtxIdx) || (vtxIdx >= vtxEnd_) )
    \n-
    40 DUNE_THROW( DGFException, "Error in " << *this << ": Invalid vertex index (" << vtxIdx << " not int [" << vtxBegin_ << ", " << vtxEnd_ << "[)" );
    \n-
    41 polygon.push_back( vtxIdx - vtxBegin_ );
    \n-
    42 }
    \n-
    43
    \n-
    44 polygons.push_back( polygon );
    \n-
    45 }
    \n-
    46 return polygons.size();
    \n-
    47 }
    \n-
    \n-
    48
    \n-
    49 protected:
    \n-\n-
    51 };
    \n-
    \n+
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=4 sw=2 sts=2:
    \n+
    5
    \n+
    6#ifndef DUNE_VTKWRITER_HH
    \n+
    7#define DUNE_VTKWRITER_HH
    \n+
    8
    \n+
    9#include <cstring>
    \n+
    10#include <iostream>
    \n+
    11#include <string>
    \n+
    12#include <fstream>
    \n+
    13#include <sstream>
    \n+
    14#include <iomanip>
    \n+
    15#include <memory>
    \n+
    16#include <type_traits>
    \n+
    17#include <vector>
    \n+
    18#include <list>
    \n+
    19#include <map>
    \n+
    20
    \n+
    21#include <dune/common/visibility.hh>
    \n+
    22#include <dune/common/typetraits.hh>
    \n+
    23#include <dune/common/exceptions.hh>
    \n+
    24#include <dune/common/indent.hh>
    \n+
    25#include <dune/common/iteratorfacades.hh>
    \n+
    26#include <dune/common/path.hh>
    \n+
    27#include <dune/geometry/referenceelements.hh>
    \n+\n+\n+\n+\n+\n+\n+\n+\n+
    36
    \n+
    50namespace Dune
    \n+
    51{
    \n
    52
    \n-
    53 } // namespace dgf
    \n-
    54} // end namespace Dune
    \n-
    55
    \n-
    56#endif // #ifndef DUNE_POLYGON_HH
    \n-\n+
    53 namespace Impl
    \n+
    54 {
    \n+
    55 // Check whether type F has a method 'bind' (see the dune-functions interface)
    \n+
    56 template< class F, class E, class = void >
    \n+
    57 struct IsBindable
    \n+
    58 : std::false_type
    \n+
    59 {};
    \n+
    60
    \n+
    61 template< class F, class E >
    \n+
    62 struct IsBindable< F, E, std::void_t< decltype( std::declval< F & >().bind( std::declval< const E & >() ) ),
    \n+
    63 decltype( std::declval< F & >().unbind() ) > >
    \n+
    64 : std::true_type
    \n+
    65 {};
    \n+
    66
    \n+
    67 // Check whether localFunction(F) can be called (see the dune-functions interface)
    \n+
    68 template< class F, class = void >
    \n+
    69 struct HasLocalFunction
    \n+
    70 : std::false_type
    \n+
    71 {};
    \n+
    72
    \n+
    73 template< class F >
    \n+
    74 struct HasLocalFunction< F, std::void_t< decltype( localFunction( std::declval< F& >() ) ) > >
    \n+
    75 : std::true_type
    \n+
    76 {};
    \n+
    77
    \n+
    78 } // namespace Impl
    \n+
    79
    \n+
    80 // Forward-declaration here, so the class can be friend of VTKWriter
    \n+
    81 template <class GridView>
    \n+\n+
    83 template <class GridView>
    \n+\n+
    85
    \n+
    94 template< class GridView >
    \n+
    \n+
    95 class VTKWriter {
    \n+
    96
    \n+
    97 // VTKSequenceWriterBase needs getSerialPieceName
    \n+
    98 // and getParallelHeaderName
    \n+
    99 friend class VTKSequenceWriterBase<GridView>;
    \n+
    100 // VTKSequenceWriter needs the grid view, to get the MPI size and rank
    \n+
    101 friend class VTKSequenceWriter<GridView>;
    \n+
    102
    \n+
    103 // extract types
    \n+
    104 typedef typename GridView::Grid Grid;
    \n+
    105 typedef typename GridView::ctype DT;
    \n+
    106 constexpr static int n = GridView::dimension;
    \n+
    107 constexpr static int w = GridView::dimensionworld;
    \n+
    108
    \n+
    109 typedef typename GridView::template Codim< 0 >::Entity Cell;
    \n+
    110 typedef typename GridView::template Codim< n >::Entity Vertex;
    \n+
    111 typedef Cell Entity;
    \n+
    112
    \n+
    113 typedef typename GridView::IndexSet IndexSet;
    \n+
    114
    \n+
    115 static const PartitionIteratorType VTK_Partition = InteriorBorder_Partition;
    \n+
    116 //static const PartitionIteratorType VTK_Partition = All_Partition;
    \n+
    117
    \n+
    118 typedef typename GridView::template Codim< 0 >
    \n+
    119 ::template Partition< VTK_Partition >::Iterator
    \n+
    120 GridCellIterator;
    \n+
    121 typedef typename GridView::template Codim< n >
    \n+
    122 ::template Partition< VTK_Partition >::Iterator
    \n+
    123 GridVertexIterator;
    \n+
    124
    \n+
    125 typedef typename GridCellIterator::Reference EntityReference;
    \n+
    126
    \n+
    127 typedef typename GridView::template Codim< 0 >
    \n+
    128 ::Entity::Geometry::LocalCoordinate Coordinate;
    \n+
    129
    \n+\n+
    131
    \n+
    132 // return true if entity should be skipped in Vertex and Corner iterator
    \n+
    133 static bool skipEntity( const PartitionType entityType )
    \n+
    134 {
    \n+
    135 switch( VTK_Partition )
    \n+
    136 {
    \n+
    137 // for All_Partition no entity has to be skipped
    \n+
    138 case All_Partition: return false;
    \n+
    139 case InteriorBorder_Partition: return ( entityType != InteriorEntity );
    \n+
    140 default: DUNE_THROW(NotImplemented,"Add check for this partition type");
    \n+
    141 }
    \n+
    142 return false ;
    \n+
    143 }
    \n+
    144
    \n+
    145 public:
    \n+
    146
    \n+\n+
    148
    \n+
    149 protected:
    \n+
    150
    \n+
    152
    \n+
    \n+\n+
    156 {
    \n+
    157
    \n+
    158 public:
    \n+
    159
    \n+\n+
    161
    \n+
    \n+\n+
    164 {
    \n+
    165
    \n+
    167 virtual void bind(const Entity& e) = 0;
    \n+
    168
    \n+
    170 virtual void unbind() = 0;
    \n+
    171
    \n+
    173
    \n+
    176 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const = 0;
    \n+
    177
    \n+
    \n+\n+
    179 {}
    \n+
    \n+
    180
    \n+
    181 };
    \n+
    \n+
    182
    \n+
    184 // DUNE_PRIVATE since _f has less visibility
    \n+
    185 template<typename F>
    \n+
    \n+
    186 struct DUNE_PRIVATE FunctionWrapper
    \n+
    187 : public FunctionWrapperBase
    \n+
    188 {
    \n+
    189 using Function = typename std::decay<F>::type;
    \n+
    190
    \n+
    191 template<typename F_>
    \n+
    \n+\n+
    193 : _f(std::forward<F_>(f))
    \n+
    194 {}
    \n+
    \n+
    195
    \n+
    \n+
    196 virtual void bind(const Entity& e)
    \n+
    197 {
    \n+
    198 _f.bind(e);
    \n+
    199 }
    \n+
    \n+
    200
    \n+
    \n+
    201 virtual void unbind()
    \n+
    202 {
    \n+
    203 _f.unbind();
    \n+
    204 }
    \n+
    \n+
    205
    \n+
    \n+
    206 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const
    \n+
    207 {
    \n+
    208 auto r = _f(pos);
    \n+
    209 // we need to do different things here depending on whether r supports indexing into it or not.
    \n+
    210 do_write(w,r,count,IsIndexable<decltype(r)>());
    \n+
    211 }
    \n+
    \n+
    212
    \n+
    213 private:
    \n+
    214
    \n+
    215 template<typename R>
    \n+
    216 void do_write(Writer& w, const R& r, std::size_t count, std::true_type) const
    \n+
    217 {
    \n+
    218 for (std::size_t i = 0; i < count; ++i)
    \n+
    219 w.write(r[i]);
    \n+
    220 }
    \n+
    221
    \n+
    222 template<typename R>
    \n+
    223 void do_write(Writer& w, const R& r, std::size_t count, std::false_type) const
    \n+
    224 {
    \n+
    225 assert(count == 1);
    \n+
    226 w.write(r);
    \n+
    227 }
    \n+
    228
    \n+
    229 Function _f;
    \n+
    230 };
    \n+
    \n+
    231
    \n+
    233 template<typename F>
    \n+
    \n+\n+
    235 : public FunctionWrapperBase
    \n+
    236 {
    \n+
    237 using Function = typename std::decay<F>::type;
    \n+
    238
    \n+
    239 template<typename F_>
    \n+
    \n+\n+
    241 : _f(std::forward<F_>(f))
    \n+
    242 , element_(nullptr)
    \n+
    243 {}
    \n+
    \n+
    244
    \n+
    \n+
    245 virtual void bind(const Entity& e)
    \n+
    246 {
    \n+
    247 element_ = &e;
    \n+
    248 }
    \n+
    \n+
    249
    \n+
    \n+
    250 virtual void unbind()
    \n+
    251 {
    \n+
    252 element_ = nullptr;
    \n+
    253 }
    \n+
    \n+
    254
    \n+
    \n+
    255 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const
    \n+
    256 {
    \n+
    257 auto globalPos = element_->geometry().global(pos);
    \n+
    258 auto r = _f(globalPos);
    \n+
    259 if constexpr (IsIndexable<decltype(r)>()) {
    \n+
    260 for (std::size_t i = 0; i < count; ++i)
    \n+
    261 w.write(r[i]);
    \n+
    262 }
    \n+
    263 else {
    \n+
    264 assert(count == 1);
    \n+
    265 w.write(r);
    \n+
    266 }
    \n+
    267 }
    \n+
    \n+
    268 private:
    \n+
    269 Function _f;
    \n+
    270 const Entity* element_;
    \n+
    271 };
    \n+
    \n+
    272
    \n+
    \n+\n+
    275 : public FunctionWrapperBase
    \n+
    276 {
    \n+
    \n+
    277 VTKFunctionWrapper(const std::shared_ptr< const VTKFunction >& f)
    \n+
    278 : _f(f)
    \n+
    279 , _entity(nullptr)
    \n+
    280 {}
    \n+
    \n+
    281
    \n+
    \n+
    282 virtual void bind(const Entity& e)
    \n+
    283 {
    \n+
    284 _entity = &e;
    \n+
    285 }
    \n+
    \n+
    286
    \n+
    \n+
    287 virtual void unbind()
    \n+
    288 {
    \n+
    289 _entity = nullptr;
    \n+
    290 }
    \n+
    \n+
    291
    \n+
    \n+
    292 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const
    \n+
    293 {
    \n+
    294 for (std::size_t i = 0; i < count; ++i)
    \n+
    295 w.write(_f->evaluate(i,*_entity,pos));
    \n+
    296 }
    \n+
    \n+
    297
    \n+
    298 private:
    \n+
    299
    \n+
    300 std::shared_ptr< const VTKFunction > _f;
    \n+
    301 const Entity* _entity;
    \n+
    302
    \n+
    303 };
    \n+
    \n+
    304
    \n+
    306 template<typename F, std::enable_if_t<Impl::IsBindable<F, Entity>::value, int> = 0>
    \n+
    \n+\n+
    308 : _f(std::make_unique<FunctionWrapper<F> >(std::forward<F>(f)))
    \n+\n+
    310 {}
    \n+
    \n+
    311
    \n+
    313 // That is, a function that you can create a LocalFunction for, and evaluate that in element coordinates
    \n+
    314 template<typename F, std::enable_if_t<not Impl::IsBindable<F, Entity>::value && Impl::HasLocalFunction<F>::value, int> = 0>
    \n+
    \n+\n+
    316 : _f(std::make_unique< FunctionWrapper<
    \n+
    317 typename std::decay<decltype(localFunction(std::forward<F>(f)))>::type
    \n+
    318 > >(localFunction(std::forward<F>(f))))
    \n+\n+
    320 {}
    \n+
    \n+
    321
    \n+
    323 // That is, a function that can be evaluated in global coordinates of the domain
    \n+
    324 template<typename F, std::enable_if_t<not Impl::IsBindable<F, Entity>::value && not Impl::HasLocalFunction<F>::value, int> = 0>
    \n+
    \n+\n+
    326 : _f(std::make_unique< GlobalFunctionWrapper<F> >(std::forward<F>(f)))
    \n+\n+
    328 {}
    \n+
    \n+
    329
    \n+
    \n+
    331 explicit VTKLocalFunction (const std::shared_ptr< const VTKFunction >& vtkFunctionPtr)
    \n+
    332 : _f(std::make_unique<VTKFunctionWrapper>(vtkFunctionPtr))
    \n+
    333 , _fieldInfo(
    \n+
    334 vtkFunctionPtr->name(),
    \n+
    335 (vtkFunctionPtr->ncomps() == 2 || vtkFunctionPtr->ncomps() == 3) ? VTK::FieldInfo::Type::vector : VTK::FieldInfo::Type::scalar,
    \n+
    336 vtkFunctionPtr->ncomps(),
    \n+
    337 vtkFunctionPtr->precision()
    \n+
    338 )
    \n+
    339 {}
    \n+
    \n+
    340
    \n+
    \n+
    342 std::string name() const
    \n+
    343 {
    \n+
    344 return fieldInfo().name();
    \n+
    345 }
    \n+
    \n+
    346
    \n+
    \n+\n+
    349 {
    \n+
    350 return _fieldInfo;
    \n+
    351 }
    \n+
    \n+
    352
    \n+
    \n+
    354 void bind(const Entity& e) const
    \n+
    355 {
    \n+
    356 _f->bind(e);
    \n+
    357 }
    \n+
    \n+
    358
    \n+
    \n+
    360 void unbind() const
    \n+
    361 {
    \n+
    362 _f->unbind();
    \n+
    363 }
    \n+
    \n+
    364
    \n+
    \n+
    366 void write(const Coordinate& pos, Writer& w) const
    \n+
    367 {
    \n+
    368 _f->write(pos,w,fieldInfo().size());
    \n+
    369 }
    \n+
    \n+
    370
    \n+
    371 std::shared_ptr<FunctionWrapperBase> _f;
    \n+\n+
    373
    \n+
    374 };
    \n+
    \n+
    375
    \n+
    376 typedef typename std::list<VTKLocalFunction>::const_iterator FunctionIterator;
    \n+
    377
    \n+
    379
    \n+
    \n+
    384 class CellIterator : public GridCellIterator
    \n+
    385 {
    \n+
    386 public:
    \n+
    388 CellIterator(const GridCellIterator & x) : GridCellIterator(x) {}
    \n+
    \n+
    391 const FieldVector<DT,n> position() const
    \n+
    392 {
    \n+
    393 return ReferenceElements<DT,n>::general((*this)->type()).position(0,0);
    \n+
    394 }
    \n+
    \n+
    395 };
    \n+
    \n+
    396
    \n+
    \n+\n+
    398 {
    \n+
    399 return gridView_.template begin< 0, VTK_Partition >();
    \n+
    400 }
    \n+
    \n+
    401
    \n+
    \n+\n+
    403 {
    \n+
    404 return gridView_.template end< 0, VTK_Partition >();
    \n+
    405 }
    \n+
    \n+
    406
    \n+
    408
    \n+
    \n+\n+
    423 public ForwardIteratorFacade<VertexIterator, const Entity, EntityReference, int>
    \n+
    424 {
    \n+
    425 GridCellIterator git;
    \n+
    426 GridCellIterator gend;
    \n+
    427 VTK::DataMode datamode;
    \n+
    428 // Index of the currently visited corner within the current element.
    \n+
    429 // NOTE: this is in Dune-numbering, in contrast to CornerIterator.
    \n+
    430 int cornerIndexDune;
    \n+
    431 const VertexMapper & vertexmapper;
    \n+
    432 std::vector<bool> visited;
    \n+
    433 // in conforming mode, for each vertex id (as obtained by vertexmapper)
    \n+
    434 // hold its number in the iteration order (VertexIterator)
    \n+
    435 int offset;
    \n+
    436
    \n+
    437 // hide operator ->
    \n+
    438 void operator->();
    \n+
    439 protected:
    \n+
    \n+\n+
    441 {
    \n+
    442 if( git == gend )
    \n+
    443 return;
    \n+
    444 ++cornerIndexDune;
    \n+
    445 const int numCorners = git->subEntities(n);
    \n+
    446 if( cornerIndexDune == numCorners )
    \n+
    447 {
    \n+
    448 offset += numCorners;
    \n+
    449 cornerIndexDune = 0;
    \n+
    450
    \n+
    451 ++git;
    \n+
    452 while( (git != gend) && skipEntity( git->partitionType() ) )
    \n+
    453 ++git;
    \n+
    454 }
    \n+
    455 }
    \n+
    \n+
    456 public:
    \n+
    \n+
    457 VertexIterator(const GridCellIterator & x,
    \n+
    458 const GridCellIterator & end,
    \n+
    459 const VTK::DataMode & dm,
    \n+
    460 const VertexMapper & vm) :
    \n+
    461 git(x), gend(end), datamode(dm), cornerIndexDune(0),
    \n+
    462 vertexmapper(vm), visited(vm.size(), false),
    \n+
    463 offset(0)
    \n+
    464 {
    \n+
    465 if (datamode == VTK::conforming && git != gend)
    \n+
    466 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;
    \n+
    467 }
    \n+
    \n+
    \n+
    468 void increment ()
    \n+
    469 {
    \n+
    470 switch (datamode)
    \n+
    471 {
    \n+
    472 case VTK::conforming :
    \n+
    473 while(visited[vertexmapper.subIndex(*git,cornerIndexDune,n)])
    \n+
    474 {
    \n+\n+
    476 if (git == gend) return;
    \n+
    477 }
    \n+
    478 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;
    \n+
    479 break;
    \n+
    480 case VTK::nonconforming :
    \n+\n+
    482 break;
    \n+
    483 }
    \n+
    484 }
    \n+
    \n+
    \n+
    485 bool equals (const VertexIterator & cit) const
    \n+
    486 {
    \n+
    487 return git == cit.git
    \n+
    488 && cornerIndexDune == cit.cornerIndexDune
    \n+
    489 && datamode == cit.datamode;
    \n+
    490 }
    \n+
    \n+
    \n+
    491 EntityReference dereference() const
    \n+
    492 {
    \n+
    493 return *git;
    \n+
    494 }
    \n+
    \n+
    \n+
    496 int localindex () const
    \n+
    497 {
    \n+
    498 return cornerIndexDune;
    \n+
    499 }
    \n+
    \n+
    \n+
    501 FieldVector<DT,n> position () const
    \n+
    502 {
    \n+
    503 return referenceElement<DT,n>(git->type())
    \n+
    504 .position(cornerIndexDune,n);
    \n+
    505 }
    \n+
    \n+
    506 };
    \n+
    \n+
    507
    \n+
    \n+\n+
    509 {
    \n+
    510 return VertexIterator( gridView_.template begin< 0, VTK_Partition >(),
    \n+
    511 gridView_.template end< 0, VTK_Partition >(),
    \n+
    512 datamode, *vertexmapper );
    \n+
    513 }
    \n+
    \n+
    514
    \n+
    \n+\n+
    516 {
    \n+
    517 return VertexIterator( gridView_.template end< 0, VTK_Partition >(),
    \n+
    518 gridView_.template end< 0, VTK_Partition >(),
    \n+
    519 datamode, *vertexmapper );
    \n+
    520 }
    \n+
    \n+
    521
    \n+
    523
    \n+
    \n+\n+
    538 public ForwardIteratorFacade<CornerIterator, const Entity, EntityReference, int>
    \n+
    539 {
    \n+
    540 GridCellIterator git;
    \n+
    541 GridCellIterator gend;
    \n+
    542 VTK::DataMode datamode;
    \n+
    543 // Index of the currently visited corner within the current element.
    \n+
    544 // NOTE: this is in VTK-numbering, in contrast to VertexIterator.
    \n+
    545 int cornerIndexVTK;
    \n+
    546 const VertexMapper & vertexmapper;
    \n+
    547 // in conforming mode, for each vertex id (as obtained by vertexmapper)
    \n+
    548 // hold its number in the iteration order of VertexIterator (*not*
    \n+
    549 // CornerIterator)
    \n+
    550 const std::vector<int> & number;
    \n+
    551 // holds the number of corners of all the elements we have seen so far,
    \n+
    552 // excluding the current element
    \n+
    553 int offset;
    \n+
    554
    \n+
    555 // hide operator ->
    \n+
    556 void operator->();
    \n+
    557 public:
    \n+
    \n+
    558 CornerIterator(const GridCellIterator & x,
    \n+
    559 const GridCellIterator & end,
    \n+
    560 const VTK::DataMode & dm,
    \n+
    561 const VertexMapper & vm,
    \n+
    562 const std::vector<int> & num) :
    \n+
    563 git(x), gend(end), datamode(dm), cornerIndexVTK(0),
    \n+
    564 vertexmapper(vm),
    \n+
    565 number(num), offset(0) {}
    \n+
    \n+
    \n+
    566 void increment ()
    \n+
    567 {
    \n+
    568 if( git == gend )
    \n+
    569 return;
    \n+
    570 ++cornerIndexVTK;
    \n+
    571 const int numCorners = git->subEntities(n);
    \n+
    572 if( cornerIndexVTK == numCorners )
    \n+
    573 {
    \n+
    574 offset += numCorners;
    \n+
    575 cornerIndexVTK = 0;
    \n+
    576
    \n+
    577 ++git;
    \n+
    578 while( (git != gend) && skipEntity( git->partitionType() ) )
    \n+
    579 ++git;
    \n+
    580 }
    \n+
    581 }
    \n+
    \n+
    \n+
    582 bool equals (const CornerIterator & cit) const
    \n+
    583 {
    \n+
    584 return git == cit.git
    \n+
    585 && cornerIndexVTK == cit.cornerIndexVTK
    \n+
    586 && datamode == cit.datamode;
    \n+
    587 }
    \n+
    \n+
    \n+
    588 EntityReference dereference() const
    \n+
    589 {
    \n+
    590 return *git;
    \n+
    591 }
    \n+
    \n+
    593
    \n+
    \n+
    597 int id () const
    \n+
    598 {
    \n+
    599 switch (datamode)
    \n+
    600 {
    \n+
    601 case VTK::conforming :
    \n+
    602 return
    \n+
    603 number[vertexmapper.subIndex(*git,VTK::renumber(*git,cornerIndexVTK),
    \n+
    604 n)];
    \n+
    605 case VTK::nonconforming :
    \n+
    606 return offset + VTK::renumber(*git,cornerIndexVTK);
    \n+
    607 default :
    \n+
    608 DUNE_THROW(IOError,"VTKWriter: unsupported DataMode" << datamode);
    \n+
    609 }
    \n+
    610 }
    \n+
    \n+
    611 };
    \n+
    \n+
    612
    \n+
    \n+\n+
    614 {
    \n+
    615 return CornerIterator( gridView_.template begin< 0, VTK_Partition >(),
    \n+
    616 gridView_.template end< 0, VTK_Partition >(),
    \n+
    617 datamode, *vertexmapper, number );
    \n+
    618 }
    \n+
    \n+
    619
    \n+
    \n+\n+
    621 {
    \n+
    622 return CornerIterator( gridView_.template end< 0, VTK_Partition >(),
    \n+
    623 gridView_.template end< 0, VTK_Partition >(),
    \n+
    624 datamode, *vertexmapper, number );
    \n+
    625 }
    \n+
    \n+
    626
    \n+
    627 public:
    \n+
    \n+
    636 explicit VTKWriter ( const GridView &gridView,
    \n+\n+\n+
    639 : gridView_( gridView ),
    \n+
    640 datamode( dm ),
    \n+
    641 coordPrec (coordPrecision),
    \n+
    642 polyhedralCellsPresent_( checkForPolyhedralCells() )
    \n+
    643 { }
    \n+
    \n+
    644
    \n+
    \n+
    649 void addCellData (const std::shared_ptr< const VTKFunction > & p)
    \n+
    650 {
    \n+
    651 celldata.push_back(VTKLocalFunction(p));
    \n+
    652 }
    \n+
    \n+
    653
    \n+
    673 template<typename F>
    \n+
    \n+
    674 void addCellData(F&& f, VTK::FieldInfo vtkFieldInfo)
    \n+
    675 {
    \n+
    676 celldata.push_back(VTKLocalFunction(std::forward<F>(f),vtkFieldInfo));
    \n+
    677 }
    \n+
    \n+
    678
    \n+
    694 template<class Container>
    \n+
    \n+
    695 void addCellData (const Container& v, const std::string &name, int ncomps = 1,
    \n+\n+
    697 {
    \n+
    698 typedef P0VTKFunction<GridView, Container> Function;
    \n+
    699 for (int c=0; c<ncomps; ++c) {
    \n+
    700 std::stringstream compName;
    \n+
    701 compName << name;
    \n+
    702 if (ncomps>1)
    \n+
    703 compName << "[" << c << "]";
    \n+
    704 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c, prec);
    \n+
    705 addCellData(std::shared_ptr< const VTKFunction >(p));
    \n+
    706 }
    \n+
    707 }
    \n+
    \n+
    708
    \n+
    \n+
    713 void addVertexData (const std::shared_ptr< const VTKFunction > & p)
    \n+
    714 {
    \n+
    715 vertexdata.push_back(VTKLocalFunction(p));
    \n+
    716 }
    \n+
    \n+
    717
    \n+
    737 template<typename F>
    \n+
    \n+
    738 void addVertexData(F&& f, VTK::FieldInfo vtkFieldInfo)
    \n+
    739 {
    \n+
    740 vertexdata.push_back(VTKLocalFunction(std::forward<F>(f),vtkFieldInfo));
    \n+
    741 }
    \n+
    \n+
    742
    \n+
    743
    \n+
    759 template<class Container>
    \n+
    \n+
    760 void addVertexData (const Container& v, const std::string &name, int ncomps=1,
    \n+\n+
    762 {
    \n+
    763 typedef P1VTKFunction<GridView, Container> Function;
    \n+
    764 for (int c=0; c<ncomps; ++c) {
    \n+
    765 std::stringstream compName;
    \n+
    766 compName << name;
    \n+
    767 if (ncomps>1)
    \n+
    768 compName << "[" << c << "]";
    \n+
    769 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c, prec);
    \n+
    770 addVertexData(std::shared_ptr< const VTKFunction >(p));
    \n+
    771 }
    \n+
    772 }
    \n+
    \n+
    773
    \n+
    \n+
    775 void clear ()
    \n+
    776 {
    \n+
    777 celldata.clear();
    \n+
    778 vertexdata.clear();
    \n+
    779 }
    \n+
    \n+
    780
    \n+
    \n+\n+
    783 { return coordPrec; }
    \n+
    \n+
    784
    \n+
    \n+
    786 virtual ~VTKWriter ()
    \n+
    787 {
    \n+
    788 this->clear();
    \n+
    789 }
    \n+
    \n+
    790
    \n+
    \n+
    803 std::string write ( const std::string &name,
    \n+\n+
    805 {
    \n+
    806 return write( name, type, gridView_.comm().rank(), gridView_.comm().size() );
    \n+
    807 }
    \n+
    \n+
    808
    \n+
    \n+
    835 std::string pwrite ( const std::string & name, const std::string & path, const std::string & extendpath,
    \n+\n+
    837 {
    \n+
    838 return pwrite( name, path, extendpath, type, gridView_.comm().rank(), gridView_.comm().size() );
    \n+
    839 }
    \n+
    \n+
    840
    \n+
    841 protected:
    \n+
    843
    \n+
    \n+
    855 std::string getParallelPieceName(const std::string& name,
    \n+
    856 const std::string& path,
    \n+
    857 int commRank, int commSize) const
    \n+
    858 {
    \n+
    859 std::ostringstream s;
    \n+
    860 // write path first
    \n+
    861 if(path.size() > 0)
    \n+
    862 {
    \n+
    863 s << path;
    \n+
    864 if(path[path.size()-1] != '/')
    \n+
    865 s << '/';
    \n+
    866 }
    \n+
    867
    \n+
    868 std::string fileprefix;
    \n+
    869 // check if a path was already added to name
    \n+
    870 // and if yes find filename without path
    \n+
    871 auto pos = name.rfind('/');
    \n+
    872 if( pos != std::string::npos )
    \n+
    873 {
    \n+
    874 // extract filename without path
    \n+
    875 fileprefix = name.substr( pos+1 );
    \n+
    876 // extract the path and added it before
    \n+
    877 // the magic below is added
    \n+
    878 std::string newpath = name.substr(0, pos);
    \n+
    879 s << newpath;
    \n+
    880 if(newpath[name.size()-1] != '/')
    \n+
    881 s << '/';
    \n+
    882 }
    \n+
    883 else
    \n+
    884 {
    \n+
    885 // if no path was found just copy the name
    \n+
    886 fileprefix = name;
    \n+
    887 }
    \n+
    888
    \n+
    889 s << 's' << std::setw(4) << std::setfill('0') << commSize << '-';
    \n+
    890 const bool writeHeader = commRank < 0;
    \n+
    891 if( ! writeHeader )
    \n+
    892 {
    \n+
    893 s << 'p' << std::setw(4) << std::setfill('0') << commRank << '-';
    \n+
    894 }
    \n+
    895
    \n+
    896 s << fileprefix << ".";
    \n+
    897 // write p for header files
    \n+
    898 if( writeHeader )
    \n+
    899 s << "p";
    \n+
    900 s << "vt";
    \n+
    901
    \n+
    902 if(GridView::dimension > 1)
    \n+
    903 s << "u";
    \n+
    904 else
    \n+
    905 s << "p";
    \n+
    906 return s.str();
    \n+
    907 }
    \n+
    \n+
    908
    \n+
    910
    \n+
    \n+
    920 std::string getParallelHeaderName(const std::string& name,
    \n+
    921 const std::string& path,
    \n+
    922 int commSize) const
    \n+
    923 {
    \n+
    924 return getParallelPieceName( name, path, -1, commSize );
    \n+
    925 }
    \n+
    \n+
    926
    \n+
    928
    \n+
    \n+
    940 std::string getSerialPieceName(const std::string& name,
    \n+
    941 const std::string& path) const
    \n+
    942 {
    \n+
    943 static const std::string extension =
    \n+
    944 GridView::dimension == 1 ? ".vtp" : ".vtu";
    \n+
    945
    \n+
    946 return concatPaths(path, name+extension);
    \n+
    947 }
    \n+
    \n+
    948
    \n+
    \n+
    965 std::string write ( const std::string &name,
    \n+
    966 VTK::OutputType type,
    \n+
    967 const int commRank,
    \n+
    968 const int commSize )
    \n+
    969 {
    \n+
    970 // in the parallel case, just use pwrite, it has all the necessary
    \n+
    971 // stuff, so we don't need to reimplement it here.
    \n+
    972 if(commSize > 1)
    \n+
    973 {
    \n+
    974 std::string filename = name;
    \n+
    975 std::string path = std::string("");
    \n+
    976
    \n+
    977 // check if a path was already added to name
    \n+
    978 // and if yes find filename without path
    \n+
    979 auto pos = name.rfind('/');
    \n+
    980 if( pos != std::string::npos )
    \n+
    981 {
    \n+
    982 // extract filename without path
    \n+
    983 filename = name.substr( pos+1 );
    \n+
    984
    \n+
    985 // extract the path and added it before
    \n+
    986 // the magic below is added
    \n+
    987 path = name.substr(0, pos);
    \n+
    988 }
    \n+
    989
    \n+
    990 return pwrite(filename, path, "", type, commRank, commSize);
    \n+
    991 }
    \n+
    992
    \n+
    993 // make data mode visible to private functions
    \n+
    994 outputtype = type;
    \n+
    995
    \n+
    996 // generate filename for process data
    \n+
    997 std::string pieceName = getSerialPieceName(name, "");
    \n+
    998
    \n+
    999 // write process data
    \n+
    1000 std::ofstream file;
    \n+
    1001 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n+
    1002 std::ios_base::eofbit);
    \n+
    1003 // check if file can be opened
    \n+
    1004 try {
    \n+
    1005 file.open( pieceName.c_str(), std::ios::binary );
    \n+
    1006 }
    \n+
    1007 catch(...) {
    \n+
    1008 std::cerr << "Filename: " << pieceName << " could not be opened" << std::endl;
    \n+
    1009 throw;
    \n+
    1010 }
    \n+
    1011 if (! file.is_open())
    \n+
    1012 DUNE_THROW(IOError, "Could not write to piece file " << pieceName);
    \n+
    1013 writeDataFile( file );
    \n+
    1014 file.close();
    \n+
    1015
    \n+
    1016 return pieceName;
    \n+
    1017 }
    \n+
    \n+
    1018
    \n+
    1020
    \n+
    \n+
    1043 std::string pwrite(const std::string& name, const std::string& path,
    \n+
    1044 const std::string& extendpath,
    \n+
    1045 VTK::OutputType ot, const int commRank,
    \n+
    1046 const int commSize )
    \n+
    1047 {
    \n+
    1048 // make data mode visible to private functions
    \n+
    1049 outputtype=ot;
    \n+
    1050
    \n+
    1051 // do some magic because paraview can only cope with relative paths to piece files
    \n+
    1052 std::ofstream file;
    \n+
    1053 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n+
    1054 std::ios_base::eofbit);
    \n+
    1055 std::string piecepath = concatPaths(path, extendpath);
    \n+
    1056 std::string relpiecepath = relativePath(path, piecepath);
    \n+
    1057
    \n+
    1058 // write this processes .vtu/.vtp piece file
    \n+
    1059 std::string fullname = getParallelPieceName(name, piecepath, commRank,
    \n+
    1060 commSize);
    \n+
    1061 // check if file can be opened
    \n+
    1062 try {
    \n+
    1063 file.open(fullname.c_str(),std::ios::binary);
    \n+
    1064 }
    \n+
    1065 catch(...) {
    \n+
    1066 std::cerr << "Filename: " << fullname << " could not be opened" << std::endl;
    \n+
    1067 throw;
    \n+
    1068 }
    \n+
    1069 if (! file.is_open())
    \n+
    1070 DUNE_THROW(IOError, "Could not write to piecefile file " << fullname);
    \n+
    1071 writeDataFile(file);
    \n+
    1072 file.close();
    \n+
    1073 gridView_.comm().barrier();
    \n+
    1074
    \n+
    1075 // if we are rank 0, write .pvtu/.pvtp parallel header
    \n+
    1076 fullname = getParallelHeaderName(name, path, commSize);
    \n+
    1077 if( commRank ==0 )
    \n+
    1078 {
    \n+
    1079 file.open(fullname.c_str());
    \n+
    1080 if (! file.is_open())
    \n+
    1081 DUNE_THROW(IOError, "Could not write to parallel file " << fullname);
    \n+
    1082 writeParallelHeader(file,name,relpiecepath, commSize );
    \n+
    1083 file.close();
    \n+
    1084 }
    \n+
    1085 gridView_.comm().barrier();
    \n+
    1086 return fullname;
    \n+
    1087 }
    \n+
    \n+
    1088
    \n+
    1089 private:
    \n+
    1091
    \n+
    1108 void writeParallelHeader(std::ostream& s, const std::string& piecename,
    \n+
    1109 const std::string& piecepath, const int commSize)
    \n+
    1110 {
    \n+
    1111 VTK::FileType fileType =
    \n+
    1112 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;
    \n+
    1113
    \n+
    1114 VTK::PVTUWriter writer(s, fileType);
    \n+
    1115
    \n+
    1116 writer.beginMain();
    \n+
    1117
    \n+
    1118 // PPointData
    \n+
    1119 {
    \n+
    1120 std::string scalars, vectors;
    \n+
    1121 std::tie(scalars,vectors) = getDataNames(vertexdata);
    \n+
    1122 writer.beginPointData(scalars, vectors);
    \n+
    1123 }
    \n+
    1124 for (auto it = vertexdata.begin(),
    \n+
    1125 end = vertexdata.end();
    \n+
    1126 it != end;
    \n+
    1127 ++it)
    \n+
    1128 {
    \n+
    1129 unsigned writecomps = it->fieldInfo().size();
    \n+
    1130 // for 2d vector fields should be written as 3d vector fields
    \n+
    1131 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps == 2)
    \n+
    1132 writecomps = 3;
    \n+
    1133 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());
    \n+
    1134 }
    \n+
    1135 writer.endPointData();
    \n+
    1136
    \n+
    1137 // PCellData
    \n+
    1138 {
    \n+
    1139 std::string scalars, vectors;
    \n+
    1140 std::tie(scalars,vectors) = getDataNames(celldata);
    \n+
    1141 writer.beginCellData(scalars, vectors);
    \n+
    1142 }
    \n+
    1143 for (auto it = celldata.begin(),
    \n+
    1144 end = celldata.end();
    \n+
    1145 it != end;
    \n+
    1146 ++it)
    \n+
    1147 {
    \n+
    1148 unsigned writecomps = it->fieldInfo().size();
    \n+
    1149 // for 2d vector fields should be written as 3d vector fields
    \n+
    1150 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps == 2)
    \n+
    1151 writecomps = 3;
    \n+
    1152 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());
    \n+
    1153 }
    \n+
    1154 writer.endCellData();
    \n+
    1155
    \n+
    1156 // PPoints
    \n+
    1157 writer.beginPoints();
    \n+
    1158 writer.addArray("Coordinates", 3, coordPrec);
    \n+
    1159 writer.endPoints();
    \n+
    1160
    \n+
    1161 // Pieces
    \n+
    1162 for( int i = 0; i < commSize; ++i )
    \n+
    1163 {
    \n+
    1164 const std::string& fullname = getParallelPieceName(piecename,
    \n+
    1165 piecepath, i,
    \n+
    1166 commSize);
    \n+
    1167 writer.addPiece(fullname);
    \n+
    1168 }
    \n+
    1169
    \n+
    1170 writer.endMain();
    \n+
    1171 }
    \n+
    1172
    \n+
    1174 void writeDataFile (std::ostream& s)
    \n+
    1175 {
    \n+
    1176 VTK::FileType fileType =
    \n+
    1177 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;
    \n+
    1178
    \n+
    1179 VTK::VTUWriter writer(s, outputtype, fileType);
    \n+
    1180
    \n+
    1181 // Grid characteristics
    \n+
    1182 vertexmapper = new VertexMapper( gridView_, mcmgVertexLayout() );
    \n+
    1183 if (datamode == VTK::conforming)
    \n+
    1184 {
    \n+
    1185 number.resize(vertexmapper->size());
    \n+
    1186 for (std::vector<int>::size_type i=0; i<number.size(); i++) number[i] = -1;
    \n+
    1187 }
    \n+\n+
    1189
    \n+
    1190 writer.beginMain(ncells, nvertices);
    \n+
    1191 writeAllData(writer);
    \n+
    1192 writer.endMain();
    \n+
    1193
    \n+
    1194 // write appended binary data section
    \n+
    1195 if(writer.beginAppended())
    \n+
    1196 writeAllData(writer);
    \n+
    1197 writer.endAppended();
    \n+
    1198
    \n+
    1199 delete vertexmapper; number.clear();
    \n+
    1200 }
    \n+
    1201
    \n+
    1202 void writeAllData(VTK::VTUWriter& writer) {
    \n+
    1203 // PointData
    \n+
    1204 writeVertexData(writer);
    \n+
    1205
    \n+
    1206 // CellData
    \n+
    1207 writeCellData(writer);
    \n+
    1208
    \n+
    1209 // Points
    \n+
    1210 writeGridPoints(writer);
    \n+
    1211
    \n+
    1212 // Cells
    \n+
    1213 writeGridCells(writer);
    \n+
    1214 }
    \n+
    1215
    \n+
    1216 protected:
    \n+
    \n+
    1217 std::string getFormatString() const
    \n+
    1218 {
    \n+\n+
    1220 return "ascii";
    \n+\n+
    1222 return "binary";
    \n+\n+
    1224 return "appended";
    \n+\n+
    1226 return "appended";
    \n+
    1227 DUNE_THROW(IOError, "VTKWriter: unsupported OutputType" << outputtype);
    \n+
    1228 }
    \n+
    \n+
    1229
    \n+
    \n+
    1230 std::string getTypeString() const
    \n+
    1231 {
    \n+
    1232 if (n==1)
    \n+
    1233 return "PolyData";
    \n+
    1234 else
    \n+
    1235 return "UnstructuredGrid";
    \n+
    1236 }
    \n+
    \n+
    1237
    \n+
    \n+
    1239 virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    \n+
    1240 {
    \n+
    1241 nvertices_ = 0;
    \n+
    1242 ncells_ = 0;
    \n+
    1243 ncorners_ = 0;
    \n+
    1244 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n+
    1245 {
    \n+
    1246 ncells_++;
    \n+
    1247 // because of the use of vertexmapper->map(), this iteration must be
    \n+
    1248 // in the order of Dune's numbering.
    \n+
    1249 const int subEntities = it->subEntities(n);
    \n+
    1250 for (int i=0; i<subEntities; ++i)
    \n+
    1251 {
    \n+
    1252 ncorners_++;
    \n+
    1253 if (datamode == VTK::conforming)
    \n+
    1254 {
    \n+
    1255 int alpha = vertexmapper->subIndex(*it,i,n);
    \n+
    1256 if (number[alpha]<0)
    \n+
    1257 number[alpha] = nvertices_++;
    \n+
    1258 }
    \n+
    1259 else
    \n+
    1260 {
    \n+
    1261 nvertices_++;
    \n+
    1262 }
    \n+
    1263 }
    \n+
    1264 }
    \n+
    1265 }
    \n+
    \n+
    1266
    \n+
    1267 template<typename T>
    \n+
    \n+
    1268 std::tuple<std::string,std::string> getDataNames(const T& data) const
    \n+
    1269 {
    \n+
    1270 std::string scalars = "";
    \n+
    1271 for (auto it = data.begin(),
    \n+
    1272 end = data.end();
    \n+
    1273 it != end;
    \n+
    1274 ++it)
    \n+
    1275 if (it->fieldInfo().type() == VTK::FieldInfo::Type::scalar)
    \n+
    1276 {
    \n+
    1277 scalars = it->name();
    \n+
    1278 break;
    \n+
    1279 }
    \n+
    1280
    \n+
    1281 std::string vectors = "";
    \n+
    1282 for (auto it = data.begin(),
    \n+
    1283 end = data.end();
    \n+
    1284 it != end;
    \n+
    1285 ++it)
    \n+
    1286 if (it->fieldInfo().type() == VTK::FieldInfo::Type::vector)
    \n+
    1287 {
    \n+
    1288 vectors = it->name();
    \n+
    1289 break;
    \n+
    1290 }
    \n+
    1291 return std::make_tuple(scalars,vectors);
    \n+
    1292 }
    \n+
    \n+
    1293
    \n+
    1294 template<typename Data, typename Iterator>
    \n+
    \n+
    1295 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator begin, const Iterator end, int nentries)
    \n+
    1296 {
    \n+
    1297 for (auto it = data.begin(),
    \n+
    1298 iend = data.end();
    \n+
    1299 it != iend;
    \n+
    1300 ++it)
    \n+
    1301 {
    \n+
    1302 const auto& f = *it;
    \n+
    1303 VTK::FieldInfo fieldInfo = f.fieldInfo();
    \n+
    1304 std::size_t writecomps = fieldInfo.size();
    \n+
    1305 switch (fieldInfo.type())
    \n+
    1306 {
    \n+\n+
    1308 break;
    \n+\n+
    1310 // vtk file format: a vector data always should have 3 comps (with
    \n+
    1311 // 3rd comp = 0 in 2D case)
    \n+
    1312 if (writecomps > 3)
    \n+
    1313 DUNE_THROW(IOError,"Cannot write VTK vectors with more than 3 components (components was " << writecomps << ")");
    \n+
    1314 writecomps = 3;
    \n+
    1315 break;
    \n+\n+
    1317 DUNE_THROW(NotImplemented,"VTK output for tensors not implemented yet");
    \n+
    1318 }
    \n+
    1319 std::shared_ptr<VTK::DataArrayWriter> p
    \n+
    1320 (writer.makeArrayWriter(f.name(), writecomps, nentries, fieldInfo.precision()));
    \n+
    1321 if(!p->writeIsNoop())
    \n+
    1322 for (Iterator eit = begin; eit!=end; ++eit)
    \n+
    1323 {
    \n+
    1324 const Entity & e = *eit;
    \n+
    1325 f.bind(e);
    \n+
    1326 f.write(eit.position(),*p);
    \n+
    1327 f.unbind();
    \n+
    1328 // vtk file format: a vector data always should have 3 comps
    \n+
    1329 // (with 3rd comp = 0 in 2D case)
    \n+
    1330 for (std::size_t j=fieldInfo.size(); j < writecomps; ++j)
    \n+
    1331 p->write(0.0);
    \n+
    1332 }
    \n+
    1333 }
    \n+
    1334 }
    \n+
    \n+
    1335
    \n+
    \n+
    1337 virtual void writeCellData(VTK::VTUWriter& writer)
    \n+
    1338 {
    \n+
    1339 if(celldata.size() == 0)
    \n+
    1340 return;
    \n+
    1341
    \n+
    1342 std::string scalars, vectors;
    \n+
    1343 std::tie(scalars,vectors) = getDataNames(celldata);
    \n+
    1344
    \n+
    1345 writer.beginCellData(scalars, vectors);
    \n+\n+
    1347 writer.endCellData();
    \n+
    1348 }
    \n+
    \n+
    1349
    \n+
    \n+
    1351 virtual void writeVertexData(VTK::VTUWriter& writer)
    \n+
    1352 {
    \n+
    1353 if(vertexdata.size() == 0)
    \n+
    1354 return;
    \n+
    1355
    \n+
    1356 std::string scalars, vectors;
    \n+
    1357 std::tie(scalars,vectors) = getDataNames(vertexdata);
    \n+
    1358
    \n+
    1359 writer.beginPointData(scalars, vectors);
    \n+\n+
    1361 writer.endPointData();
    \n+
    1362 }
    \n+
    \n+
    1363
    \n+
    \n+
    1365 virtual void writeGridPoints(VTK::VTUWriter& writer)
    \n+
    1366 {
    \n+
    1367 writer.beginPoints();
    \n+
    1368
    \n+
    1369 std::shared_ptr<VTK::DataArrayWriter> p
    \n+
    1370 (writer.makeArrayWriter("Coordinates", 3, nvertices, coordPrec));
    \n+
    1371 if(!p->writeIsNoop()) {
    \n+
    1372 VertexIterator vEnd = vertexEnd();
    \n+
    1373 for (VertexIterator vit=vertexBegin(); vit!=vEnd; ++vit)
    \n+
    1374 {
    \n+
    1375 int dimw=w;
    \n+
    1376 for (int j=0; j<std::min(dimw,3); j++)
    \n+
    1377 p->write((*vit).geometry().corner(vit.localindex())[j]);
    \n+
    1378 for (int j=std::min(dimw,3); j<3; j++)
    \n+
    1379 p->write(0.0);
    \n+
    1380 }
    \n+
    1381 }
    \n+
    1382 // free the VTK::DataArrayWriter before touching the stream
    \n+
    1383 p.reset();
    \n+
    1384
    \n+
    1385 writer.endPoints();
    \n+
    1386 }
    \n+
    \n+
    1387
    \n+
    \n+
    1389 virtual void writeGridCells(VTK::VTUWriter& writer)
    \n+
    1390 {
    \n+
    1391 writer.beginCells();
    \n+
    1392
    \n+
    1393 // connectivity
    \n+
    1394 {
    \n+
    1395 std::shared_ptr<VTK::DataArrayWriter> p1
    \n+
    1396 (writer.makeArrayWriter("connectivity", 1, ncorners, VTK::Precision::int32));
    \n+
    1397 if(!p1->writeIsNoop())
    \n+
    1398 for (CornerIterator it=cornerBegin(); it!=cornerEnd(); ++it)
    \n+
    1399 p1->write(it.id());
    \n+
    1400 }
    \n+
    1401
    \n+
    1402 // offsets
    \n+
    1403 {
    \n+
    1404 std::shared_ptr<VTK::DataArrayWriter> p2
    \n+
    1405 (writer.makeArrayWriter("offsets", 1, ncells, VTK::Precision::int32));
    \n+
    1406 if(!p2->writeIsNoop()) {
    \n+
    1407 int offset = 0;
    \n+
    1408 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n+
    1409 {
    \n+
    1410 offset += it->subEntities(n);
    \n+
    1411 p2->write(offset);
    \n+
    1412 }
    \n+
    1413 }
    \n+
    1414 }
    \n+
    1415
    \n+
    1416 // types
    \n+
    1417 if (n>1)
    \n+
    1418 {
    \n+
    1419 {
    \n+
    1420 std::shared_ptr<VTK::DataArrayWriter> p3
    \n+
    1421 (writer.makeArrayWriter("types", 1, ncells, VTK::Precision::uint8));
    \n+
    1422
    \n+
    1423 if(!p3->writeIsNoop())
    \n+
    1424 {
    \n+
    1425 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n+
    1426 {
    \n+
    1427 int vtktype = VTK::geometryType(it->type());
    \n+
    1428 p3->write(vtktype);
    \n+
    1429 }
    \n+
    1430 }
    \n+
    1431 }
    \n+
    1432
    \n+
    1433
    \n+
    1434 // if polyhedron cells found also cell faces need to be written
    \n+
    1435 if( polyhedralCellsPresent_ )
    \n+
    1436 {
    \n+
    1437 writeCellFaces( writer );
    \n+
    1438 }
    \n+
    1439 }
    \n+
    1440
    \n+
    1441 writer.endCells();
    \n+
    1442 }
    \n+
    \n+
    1443
    \n+
    1444 protected:
    \n+
    \n+\n+
    1446 {
    \n+
    1447 // check if polyhedron cells are present
    \n+
    1448 for( const auto& geomType : gridView_.indexSet().types( 0 ) )
    \n+
    1449 {
    \n+
    1450 if( VTK::geometryType( geomType ) == VTK::polyhedron )
    \n+
    1451 {
    \n+
    1452 return true;
    \n+
    1453 }
    \n+
    1454 }
    \n+
    1455 return false;
    \n+
    1456 }
    \n+
    \n+
    1457
    \n+
    \n+
    1459 virtual void writeCellFaces(VTK::VTUWriter& writer)
    \n+
    1460 {
    \n+
    1461 if( ! faceVertices_ )
    \n+
    1462 {
    \n+
    1463 faceVertices_.reset( new std::pair< std::vector<int>, std::vector<int> > () );
    \n+
    1464 // fill face vertex structure
    \n+\n+
    1466 faceVertices_->first, faceVertices_->second );
    \n+
    1467 }
    \n+
    1468
    \n+
    1469 std::vector< int >& faces = faceVertices_->first;
    \n+
    1470 std::vector< int >& faceOffsets = faceVertices_->second;
    \n+
    1471 assert( int(faceOffsets.size()) == ncells );
    \n+
    1472
    \n+
    1473 {
    \n+
    1474 std::shared_ptr<VTK::DataArrayWriter> p4
    \n+
    1475 (writer.makeArrayWriter("faces", 1, faces.size(), VTK::Precision::int32));
    \n+
    1476 if(!p4->writeIsNoop())
    \n+
    1477 {
    \n+
    1478 for( const auto& face : faces )
    \n+
    1479 p4->write( face );
    \n+
    1480 }
    \n+
    1481 }
    \n+
    1482
    \n+
    1483 {
    \n+
    1484 std::shared_ptr<VTK::DataArrayWriter> p5
    \n+
    1485 (writer.makeArrayWriter("faceoffsets", 1, ncells, VTK::Precision::int32));
    \n+
    1486 if(!p5->writeIsNoop())
    \n+
    1487 {
    \n+
    1488 for( const auto& offset : faceOffsets )
    \n+
    1489 p5->write( offset );
    \n+
    1490
    \n+
    1491 // clear face vertex structure
    \n+
    1492 faceVertices_.reset();
    \n+
    1493 }
    \n+
    1494 }
    \n+
    1495 }
    \n+
    \n+
    1496
    \n+
    1497 template <class CornerIterator, class IndexSet, class T>
    \n+
    \n+\n+
    1499 const CornerIterator end,
    \n+
    1500 const IndexSet& indexSet,
    \n+
    1501 std::vector<T>& faces,
    \n+
    1502 std::vector<T>& faceOffsets )
    \n+
    1503 {
    \n+
    1504 if( n == 3 && it != end )
    \n+
    1505 {
    \n+
    1506 // clear output arrays
    \n+
    1507 faces.clear();
    \n+
    1508 faces.reserve( 15 * ncells );
    \n+
    1509 faceOffsets.clear();
    \n+
    1510 faceOffsets.reserve( ncells );
    \n+
    1511
    \n+
    1512 int offset = 0;
    \n+
    1513
    \n+
    1514 Cell element = *it;
    \n+
    1515 int elIndex = indexSet.index( element );
    \n+
    1516 std::vector< T > vertices;
    \n+
    1517 vertices.reserve( 30 );
    \n+
    1518 for( ; it != end; ++it )
    \n+
    1519 {
    \n+
    1520 const Cell& cell = *it ;
    \n+
    1521 const int cellIndex = indexSet.index( cell ) ;
    \n+
    1522 if( elIndex != cellIndex )
    \n+
    1523 {
    \n+
    1524 fillFacesForElement( element, indexSet, vertices, offset, faces, faceOffsets );
    \n+
    1525
    \n+
    1526 vertices.clear();
    \n+
    1527 element = cell ;
    \n+
    1528 elIndex = cellIndex ;
    \n+
    1529 }
    \n+
    1530 vertices.push_back( it.id() );
    \n+
    1531 }
    \n+
    1532
    \n+
    1533 // fill faces for last element
    \n+
    1534 fillFacesForElement( element, indexSet, vertices, offset, faces, faceOffsets );
    \n+
    1535 }
    \n+
    1536 }
    \n+
    \n+
    1537
    \n+
    1538 template <class Entity, class IndexSet, class T>
    \n+
    \n+
    1539 static void fillFacesForElement( const Entity& element,
    \n+
    1540 const IndexSet& indexSet,
    \n+
    1541 const std::vector<T>& vertices,
    \n+
    1542 T& offset,
    \n+
    1543 std::vector<T>& faces,
    \n+
    1544 std::vector<T>& faceOffsets )
    \n+
    1545 {
    \n+
    1546 const int dim = n;
    \n+
    1547
    \n+
    1548 std::map< T, T > vxMap;
    \n+
    1549
    \n+
    1550 // get number of local faces
    \n+
    1551 const int nVertices = element.subEntities( dim );
    \n+
    1552 for( int vx = 0; vx < nVertices; ++ vx )
    \n+
    1553 {
    \n+
    1554 const int vxIdx = indexSet.subIndex( element, vx, dim );
    \n+
    1555 vxMap[ vxIdx ] = vertices[ vx ];
    \n+
    1556 }
    \n+
    1557
    \n+
    1558 // get number of local faces
    \n+
    1559 const int nFaces = element.subEntities( 1 );
    \n+
    1560 // store number of faces for current element
    \n+
    1561 faces.push_back( nFaces );
    \n+
    1562 ++offset;
    \n+
    1563 // extract each face as a set of vertex indices
    \n+
    1564 for( int fce = 0; fce < nFaces; ++ fce )
    \n+
    1565 {
    \n+
    1566 // obtain face
    \n+
    1567 const auto face = element.template subEntity< 1 > ( fce );
    \n+
    1568
    \n+
    1569 // get all vertex indices from current face
    \n+
    1570 const int nVxFace = face.subEntities( dim );
    \n+
    1571 faces.push_back( nVxFace );
    \n+
    1572 ++offset ;
    \n+
    1573 for( int i=0; i<nVxFace; ++i )
    \n+
    1574 {
    \n+
    1575 const T vxIndex = indexSet.subIndex( face, i, dim );
    \n+
    1576 assert( vxMap.find( vxIndex ) != vxMap.end() );
    \n+
    1577 faces.push_back( vxMap[ vxIndex ] );
    \n+
    1578 ++offset ;
    \n+
    1579 }
    \n+
    1580 }
    \n+
    1581
    \n+
    1582 // store face offset for each element
    \n+
    1583 faceOffsets.push_back( offset );
    \n+
    1584 }
    \n+
    \n+
    1585
    \n+
    1586 protected:
    \n+
    1587 // the list of registered functions
    \n+
    1588 std::list<VTKLocalFunction> celldata;
    \n+
    1589 std::list<VTKLocalFunction> vertexdata;
    \n+
    1590
    \n+
    1591 // the grid
    \n+\n+
    1593
    \n+
    1594 // temporary grid information
    \n+\n+\n+\n+
    1598 private:
    \n+
    1599 VertexMapper* vertexmapper;
    \n+
    1600 // in conforming mode, for each vertex id (as obtained by vertexmapper)
    \n+
    1601 // hold its number in the iteration order (VertexIterator)
    \n+
    1602 std::vector<int> number;
    \n+
    1603 VTK::DataMode datamode;
    \n+
    1604 VTK::Precision coordPrec;
    \n+
    1605
    \n+
    1606 // true if polyhedral cells are present in the grid
    \n+
    1607 const bool polyhedralCellsPresent_;
    \n+
    1608
    \n+
    1609 // pointer holding face vertex connectivity if needed
    \n+
    1610 std::shared_ptr< std::pair< std::vector<int>, std::vector<int> > > faceVertices_;
    \n+
    1611
    \n+
    1612 protected:
    \n+\n+
    1614 };
    \n+
    \n+
    1615
    \n+
    1616}
    \n+
    1617
    \n+
    1618#endif
    \n+\n+
    Mapper for multiple codim and multiple geometry types.
    \n+
    Functions for VTK output.
    \n+
    Data array writers for the VTKWriter.
    \n+\n+\n+\n+
    Common stuff for the VTKWriter.
    \n+
    PartitionIteratorType
    Parameter to be used for the parallel level- and leaf iterators.
    Definition gridenums.hh:136
    \n+
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n+
    @ All_Partition
    all entities
    Definition gridenums.hh:141
    \n+
    @ InteriorBorder_Partition
    interior and border entities
    Definition gridenums.hh:138
    \n+
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n+
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n+
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n+
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n+
    const Communication & comm() const
    obtain communication object
    Definition common/gridview.hh:273
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    Grid::ctype ctype
    type used for coordinates in grid
    Definition common/gridview.hh:131
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n+
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n+
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    void reset()
    Definition basic.hh:51
    \n-
    bool getnextline()
    Definition basic.cc:93
    \n-
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n-
    Definition polygon.hh:25
    \n-
    PolygonBlock(std::istream &in, int numVtx, int vtxOfs)
    Definition polygon.hh:26
    \n-
    int get(std::vector< std::vector< int > > &polygons)
    Definition polygon.hh:30
    \n-
    int vtxEnd_
    Definition polygon.hh:50
    \n-
    int vtxBegin_
    Definition polygon.hh:50
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+\n+\n+
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n+
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n+
    @ appendedraw
    Output is to the file is appended raw binary.
    Definition common.hh:49
    \n+
    @ appendedbase64
    Output is to the file is appended base64 binary.
    Definition common.hh:51
    \n+
    @ base64
    Output to the file is inline base64 binary.
    Definition common.hh:47
    \n+
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n+
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n+
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n+
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n+
    DataMode
    Whether to produce conforming or non-conforming output.
    Definition common.hh:67
    \n+
    @ conforming
    Output conforming data.
    Definition common.hh:73
    \n+
    @ nonconforming
    Output non-conforming data.
    Definition common.hh:81
    \n+
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n+
    @ polyhedron
    Definition common.hh:142
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n+
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n+
    size_type size() const
    Return total number of entities in the entity set managed by the mapper.
    Definition mcmgmapper.hh:204
    \n+
    Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity of codim 0 entity to starting index in array for dof block.
    Definition mcmgmapper.hh:185
    \n+
    Descriptor struct for VTK fields.
    Definition common.hh:328
    \n+
    std::size_t size() const
    The number of components in the data field.
    Definition common.hh:364
    \n+
    Precision precision() const
    The precision used for the output of the data field.
    Definition common.hh:370
    \n+
    @ tensor
    tensor field (always 3x3)
    \n+
    @ vector
    vector-valued field (always 3D, will be padded if necessary)
    \n+\n+
    Type type() const
    The type of the data field.
    Definition common.hh:358
    \n+
    std::string name() const
    The name of the data field.
    Definition common.hh:352
    \n+
    base class for data array writers
    Definition dataarraywriter.hh:56
    \n+
    void write(T data)
    write one element of data
    Definition dataarraywriter.hh:69
    \n+
    A base class for grid functions with any return type and dimension.
    Definition function.hh:42
    \n+
    Take a vector and interpret it as cell data for the VTKWriter.
    Definition function.hh:97
    \n+
    Take a vector and interpret it as point data for the VTKWriter.
    Definition function.hh:205
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n+
    Writer for the output of grid functions in the vtk format.
    Definition vtksequencewriter.hh:29
    \n+
    Base class to write pvd-files which contains a list of all collected vtk-files.
    Definition vtksequencewriterbase.hh:34
    \n+
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n+
    void addCellData(const Container &v, const std::string &name, int ncomps=1, VTK::Precision prec=VTK::Precision::float32)
    Add a grid function (represented by container) that lives on the cells of the grid to the visualizati...
    Definition vtkwriter.hh:695
    \n+
    CornerIterator cornerEnd() const
    Definition vtkwriter.hh:620
    \n+
    void clear()
    clear list of registered functions
    Definition vtkwriter.hh:775
    \n+
    std::string write(const std::string &name, VTK::OutputType type=VTK::ascii)
    write output (interface might change later)
    Definition vtkwriter.hh:803
    \n+
    VertexIterator vertexBegin() const
    Definition vtkwriter.hh:508
    \n+
    std::string getTypeString() const
    Definition vtkwriter.hh:1230
    \n+
    std::string getParallelHeaderName(const std::string &name, const std::string &path, int commSize) const
    return name of a parallel header file
    Definition vtkwriter.hh:920
    \n+
    void addVertexData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the vertices of the grid to the visualization.
    Definition vtkwriter.hh:713
    \n+
    Dune::VTKFunction< GridView > VTKFunction
    Definition vtkwriter.hh:147
    \n+
    CellIterator cellEnd() const
    Definition vtkwriter.hh:402
    \n+
    std::list< VTKLocalFunction > vertexdata
    Definition vtkwriter.hh:1589
    \n+
    CornerIterator cornerBegin() const
    Definition vtkwriter.hh:613
    \n+
    std::string getSerialPieceName(const std::string &name, const std::string &path) const
    return name of a serial piece file
    Definition vtkwriter.hh:940
    \n+
    void addCellData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the cells of the grid to the visualization.
    Definition vtkwriter.hh:649
    \n+
    std::string getFormatString() const
    Definition vtkwriter.hh:1217
    \n+
    bool checkForPolyhedralCells() const
    Definition vtkwriter.hh:1445
    \n+
    void addVertexData(F &&f, VTK::FieldInfo vtkFieldInfo)
    Add a function by sampling it on the grid vertices.
    Definition vtkwriter.hh:738
    \n+
    virtual void writeCellData(VTK::VTUWriter &writer)
    write cell data
    Definition vtkwriter.hh:1337
    \n+
    virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    count the vertices, cells and corners
    Definition vtkwriter.hh:1239
    \n+
    std::string getParallelPieceName(const std::string &name, const std::string &path, int commRank, int commSize) const
    return name of a parallel piece file (or header name)
    Definition vtkwriter.hh:855
    \n+
    CellIterator cellBegin() const
    Definition vtkwriter.hh:397
    \n+
    VTK::OutputType outputtype
    Definition vtkwriter.hh:1613
    \n+
    virtual void writeGridCells(VTK::VTUWriter &writer)
    write the connectivity array
    Definition vtkwriter.hh:1389
    \n+
    GridView gridView_
    Definition vtkwriter.hh:1592
    \n+
    virtual void writeCellFaces(VTK::VTUWriter &writer)
    write the connectivity array
    Definition vtkwriter.hh:1459
    \n+
    void fillFaceVertices(CornerIterator it, const CornerIterator end, const IndexSet &indexSet, std::vector< T > &faces, std::vector< T > &faceOffsets)
    Definition vtkwriter.hh:1498
    \n+
    std::list< VTKLocalFunction > celldata
    Definition vtkwriter.hh:1588
    \n+
    std::string write(const std::string &name, VTK::OutputType type, const int commRank, const int commSize)
    write output (interface might change later)
    Definition vtkwriter.hh:965
    \n+
    VTK::Precision coordPrecision() const
    get the precision with which coordinates are written out
    Definition vtkwriter.hh:782
    \n+
    std::list< VTKLocalFunction >::const_iterator FunctionIterator
    Definition vtkwriter.hh:376
    \n+
    std::tuple< std::string, std::string > getDataNames(const T &data) const
    Definition vtkwriter.hh:1268
    \n+
    virtual void writeGridPoints(VTK::VTUWriter &writer)
    write the positions of vertices
    Definition vtkwriter.hh:1365
    \n+
    virtual void writeVertexData(VTK::VTUWriter &writer)
    write vertex data
    Definition vtkwriter.hh:1351
    \n+
    int nvertices
    Definition vtkwriter.hh:1596
    \n+
    void addCellData(F &&f, VTK::FieldInfo vtkFieldInfo)
    Add a function by sampling it on the element centers.
    Definition vtkwriter.hh:674
    \n+
    void addVertexData(const Container &v, const std::string &name, int ncomps=1, VTK::Precision prec=VTK::Precision::float32)
    Add a grid function (represented by container) that lives on the vertices of the grid to the visualiz...
    Definition vtkwriter.hh:760
    \n+
    virtual ~VTKWriter()
    destructor
    Definition vtkwriter.hh:786
    \n+
    static void fillFacesForElement(const Entity &element, const IndexSet &indexSet, const std::vector< T > &vertices, T &offset, std::vector< T > &faces, std::vector< T > &faceOffsets)
    Definition vtkwriter.hh:1539
    \n+
    void writeData(VTK::VTUWriter &writer, const Data &data, const Iterator begin, const Iterator end, int nentries)
    Definition vtkwriter.hh:1295
    \n+
    int ncells
    Definition vtkwriter.hh:1595
    \n+
    VertexIterator vertexEnd() const
    Definition vtkwriter.hh:515
    \n+
    VTKWriter(const GridView &gridView, VTK::DataMode dm=VTK::conforming, VTK::Precision coordPrecision=VTK::Precision::float32)
    Construct a VTKWriter working on a specific GridView.
    Definition vtkwriter.hh:636
    \n+
    std::string pwrite(const std::string &name, const std::string &path, const std::string &extendpath, VTK::OutputType ot, const int commRank, const int commSize)
    write output; interface might change later
    Definition vtkwriter.hh:1043
    \n+
    std::string pwrite(const std::string &name, const std::string &path, const std::string &extendpath, VTK::OutputType type=VTK::ascii)
    write output (interface might change later)
    Definition vtkwriter.hh:835
    \n+
    int ncorners
    Definition vtkwriter.hh:1597
    \n+
    Type erasure wrapper for VTK data sets.
    Definition vtkwriter.hh:156
    \n+
    void unbind() const
    Unbind the data set from the currently bound entity.
    Definition vtkwriter.hh:360
    \n+
    VTKLocalFunction(F &&f, VTK::FieldInfo fieldInfo)
    Construct a VTKLocalFunction for a dune-functions style LocalFunction.
    Definition vtkwriter.hh:307
    \n+
    std::string name() const
    Returns the name of the data set.
    Definition vtkwriter.hh:342
    \n+
    VTK::FieldInfo _fieldInfo
    Definition vtkwriter.hh:372
    \n+
    VTK::DataArrayWriter Writer
    Definition vtkwriter.hh:160
    \n+
    const VTK::FieldInfo & fieldInfo() const
    Returns the VTK::FieldInfo for the data set.
    Definition vtkwriter.hh:348
    \n+
    void bind(const Entity &e) const
    Bind the data set to grid entity e.
    Definition vtkwriter.hh:354
    \n+
    VTKLocalFunction(const std::shared_ptr< const VTKFunction > &vtkFunctionPtr)
    Construct a VTKLocalFunction for a legacy VTKFunction.
    Definition vtkwriter.hh:331
    \n+
    std::shared_ptr< FunctionWrapperBase > _f
    Definition vtkwriter.hh:371
    \n+
    void write(const Coordinate &pos, Writer &w) const
    Write the value of the data set at local coordinate pos to the writer w.
    Definition vtkwriter.hh:366
    \n+
    Base class for polymorphic container of underlying data set.
    Definition vtkwriter.hh:164
    \n+
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const =0
    Evaluate data set at local position pos inside the current entity and write result to w.
    \n+
    virtual ~FunctionWrapperBase()
    Definition vtkwriter.hh:178
    \n+
    virtual void unbind()=0
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    \n+
    virtual void bind(const Entity &e)=0
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    \n+
    Type erasure implementation for functions conforming to the dune-functions LocalFunction interface.
    Definition vtkwriter.hh:188
    \n+
    typename std::decay< F >::type Function
    Definition vtkwriter.hh:189
    \n+
    FunctionWrapper(F_ &&f)
    Definition vtkwriter.hh:192
    \n+
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const
    Evaluate data set at local position pos inside the current entity and write result to w.
    Definition vtkwriter.hh:206
    \n+
    virtual void unbind()
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    Definition vtkwriter.hh:201
    \n+
    virtual void bind(const Entity &e)
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    Definition vtkwriter.hh:196
    \n+
    Type erasure implementation for C++ functions, i.e., functions that can be evaluated in global coordi...
    Definition vtkwriter.hh:236
    \n+
    GlobalFunctionWrapper(F_ &&f)
    Definition vtkwriter.hh:240
    \n+
    virtual void unbind()
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    Definition vtkwriter.hh:250
    \n+
    typename std::decay< F >::type Function
    Definition vtkwriter.hh:237
    \n+
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const
    Evaluate data set at local position pos inside the current entity and write result to w.
    Definition vtkwriter.hh:255
    \n+
    virtual void bind(const Entity &e)
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    Definition vtkwriter.hh:245
    \n+
    Type erasure implementation for legacy VTKFunctions.
    Definition vtkwriter.hh:276
    \n+
    virtual void unbind()
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    Definition vtkwriter.hh:287
    \n+
    VTKFunctionWrapper(const std::shared_ptr< const VTKFunction > &f)
    Definition vtkwriter.hh:277
    \n+
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const
    Evaluate data set at local position pos inside the current entity and write result to w.
    Definition vtkwriter.hh:292
    \n+
    virtual void bind(const Entity &e)
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    Definition vtkwriter.hh:282
    \n+
    Iterator over the grids elements.
    Definition vtkwriter.hh:385
    \n+
    CellIterator(const GridCellIterator &x)
    construct a CellIterator from the gridview's Iterator.
    Definition vtkwriter.hh:388
    \n+
    const FieldVector< DT, n > position() const
    Definition vtkwriter.hh:391
    \n+
    Iterate over the grid's vertices.
    Definition vtkwriter.hh:424
    \n+
    VertexIterator(const GridCellIterator &x, const GridCellIterator &end, const VTK::DataMode &dm, const VertexMapper &vm)
    Definition vtkwriter.hh:457
    \n+
    void basicIncrement()
    Definition vtkwriter.hh:440
    \n+
    void increment()
    Definition vtkwriter.hh:468
    \n+
    EntityReference dereference() const
    Definition vtkwriter.hh:491
    \n+
    bool equals(const VertexIterator &cit) const
    Definition vtkwriter.hh:485
    \n+
    FieldVector< DT, n > position() const
    position of vertex inside the entity
    Definition vtkwriter.hh:501
    \n+
    int localindex() const
    index of vertex within the entity, in Dune-numbering
    Definition vtkwriter.hh:496
    \n+
    Iterate over the elements' corners.
    Definition vtkwriter.hh:539
    \n+
    void increment()
    Definition vtkwriter.hh:566
    \n+
    CornerIterator(const GridCellIterator &x, const GridCellIterator &end, const VTK::DataMode &dm, const VertexMapper &vm, const std::vector< int > &num)
    Definition vtkwriter.hh:558
    \n+
    int id() const
    Process-local consecutive zero-starting vertex id.
    Definition vtkwriter.hh:597
    \n+
    EntityReference dereference() const
    Definition vtkwriter.hh:588
    \n+
    bool equals(const CornerIterator &cit) const
    Definition vtkwriter.hh:582
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n+
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n+
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n+
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n+
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n+
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n+
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n+
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n+
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n+
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,104 +2,1980 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-polygon.hh\n+ * vtk\n+vtkwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=2 sw=2 sts=2:\n-5#ifndef DUNE_POLYGON_HH\n-6#define DUNE_POLYGON_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13\n-14namespace Dune\n-15{\n-16\n-17 namespace dgf\n-18 {\n-19\n-20 // PolygonBlock\n-21 // ------------\n-22\n-23 struct PolygonBlock\n-24 : public BasicBlock\n-25 {\n-26 PolygonBlock ( std::istream &in, int numVtx, int vtxOfs )\n-27 : BasicBlock( in, \"Polygon\" ), vtxBegin_( vtxOfs ), vtxEnd_( vtxOfs + numVtx\n-)\n-28 {}\n-29\n-30 int get ( std::vector< std::vector< int > > &polygons )\n-31 {\n-32 reset();\n-33 std::vector< int > polygon;\n-34 while( getnextline() )\n-35 {\n-36 polygon.clear();\n-37 for( int vtxIdx; getnextentry( vtxIdx ); )\n-38 {\n-39 if( (vtxBegin_ > vtxIdx) || (vtxIdx >= vtxEnd_) )\n-40 DUNE_THROW( DGFException, \"Error in \" << *this << \": Invalid vertex index (\"\n-<< vtxIdx << \" not int [\" << vtxBegin_ << \", \" << vtxEnd_ << \"[)\" );\n-41 polygon.push_back( vtxIdx - vtxBegin_ );\n-42 }\n-43\n-44 polygons.push_back( polygon );\n-45 }\n-46 return polygons.size();\n-47 }\n-48\n-49 protected:\n-50 int vtxBegin_, vtxEnd_;\n-51 };\n+3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=4 sw=2 sts=2:\n+5\n+6#ifndef DUNE_VTKWRITER_HH\n+7#define DUNE_VTKWRITER_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15#include \n+16#include \n+17#include \n+18#include \n+19#include \n+20\n+21#include \n+22#include \n+23#include \n+24#include \n+25#include \n+26#include \n+27#include \n+28#include \n+29#include \n+30#include \n+31#include \n+32#include \n+33#include \n+34#include \n+35#include \n+36\n+50namespace Dune\n+51{\n 52\n-53 } // namespace dgf\n-54} // end namespace Dune\n-55\n-56#endif // #ifndef DUNE_POLYGON_HH\n-basic.hh\n+53 namespace Impl\n+54 {\n+55 // Check whether type F has a method 'bind' (see the dune-functions\n+interface)\n+56 template< class F, class E, class = void >\n+57 struct IsBindable\n+58 : std::false_type\n+59 {};\n+60\n+61 template< class F, class E >\n+62 struct IsBindable< F, E, std::void_t< decltype( std::declval< F & >().bind\n+( std::declval< const E & >() ) ),\n+63 decltype( std::declval< F & >().unbind() ) > >\n+64 : std::true_type\n+65 {};\n+66\n+67 // Check whether localFunction(F) can be called (see the dune-functions\n+interface)\n+68 template< class F, class = void >\n+69 struct HasLocalFunction\n+70 : std::false_type\n+71 {};\n+72\n+73 template< class F >\n+74 struct HasLocalFunction< F, std::void_t< decltype( localFunction( std::\n+declval< F& >() ) ) > >\n+75 : std::true_type\n+76 {};\n+77\n+78 } // namespace Impl\n+79\n+80 // Forward-declaration here, so the class can be friend of VTKWriter\n+81 template \n+82 class VTKSequenceWriterBase;\n+83 template \n+84 class VTKSequenceWriter;\n+85\n+94 template< class GridView >\n+95 class VTKWriter {\n+96\n+97 // VTKSequenceWriterBase needs getSerialPieceName\n+98 // and getParallelHeaderName\n+99 friend class VTKSequenceWriterBase;\n+100 // VTKSequenceWriter needs the grid view, to get the MPI size and rank\n+101 friend class VTKSequenceWriter;\n+102\n+103 // extract types\n+104 typedef typename GridView::Grid Grid;\n+105 typedef typename GridView::ctype DT;\n+106 constexpr static int n = GridView::dimension;\n+107 constexpr static int w = GridView::dimensionworld;\n+108\n+109 typedef typename GridView::template Codim< 0 >::Entity Cell;\n+110 typedef typename GridView::template Codim< n >::Entity Vertex;\n+111 typedef Cell Entity;\n+112\n+113 typedef typename GridView::IndexSet IndexSet;\n+114\n+115 static const PartitionIteratorType VTK_Partition = InteriorBorder_\n+Partition;\n+116 //static const PartitionIteratorType VTK_Partition = All_Partition;\n+117\n+118 typedef typename GridView::template Codim< 0 >\n+119 ::template Partition< VTK_Partition >::Iterator\n+120 GridCellIterator;\n+121 typedef typename GridView::template Codim< n >\n+122 ::template Partition< VTK_Partition >::Iterator\n+123 GridVertexIterator;\n+124\n+125 typedef typename GridCellIterator::Reference EntityReference;\n+126\n+127 typedef typename GridView::template Codim< 0 >\n+128 ::Entity::Geometry::LocalCoordinate Coordinate;\n+129\n+130 typedef MultipleCodimMultipleGeomTypeMapper<_GridView_> VertexMapper;\n+131\n+132 // return true if entity should be skipped in Vertex and Corner iterator\n+133 static bool skipEntity( const PartitionType entityType )\n+134 {\n+135 switch( VTK_Partition )\n+136 {\n+137 // for All_Partition no entity has to be skipped\n+138 case All_Partition: return false;\n+139 case InteriorBorder_Partition: return ( entityType != InteriorEntity );\n+140 default: DUNE_THROW(NotImplemented,\"Add check for this partition type\");\n+141 }\n+142 return false ;\n+143 }\n+144\n+145 public:\n+146\n+147 typedef Dune::VTKFunction<_GridView_> VTKFunction;\n+148\n+149 protected:\n+150\n+152\n+155 class VTKLocalFunction\n+156 {\n+157\n+158 public:\n+159\n+160 typedef VTK::DataArrayWriter Writer;\n+161\n+163 struct FunctionWrapperBase\n+164 {\n+165\n+167 virtual void bind(const Entity& e) = 0;\n+168\n+170 virtual void unbind() = 0;\n+171\n+173\n+176 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n+const = 0;\n+177\n+178 virtual ~FunctionWrapperBase()\n+179 {}\n+180\n+181 };\n+182\n+184 // DUNE_PRIVATE since _f has less visibility\n+185 template\n+186 struct DUNE_PRIVATE FunctionWrapper\n+187 : public FunctionWrapperBase\n+188 {\n+189 using Function = typename std::decay::type;\n+190\n+191 template\n+192 FunctionWrapper(F_&& f)\n+193 : _f(std::forward(f))\n+194 {}\n+195\n+196 virtual void bind(const Entity& e)\n+197 {\n+198 _f.bind(e);\n+199 }\n+200\n+201 virtual void unbind()\n+202 {\n+203 _f.unbind();\n+204 }\n+205\n+206 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n+const\n+207 {\n+208 auto r = _f(pos);\n+209 // we need to do different things here depending on whether r supports\n+indexing into it or not.\n+210 do_write(w,r,count,IsIndexable());\n+211 }\n+212\n+213 private:\n+214\n+215 template\n+216 void do_write(Writer& w, const R& r, std::size_t count, std::true_type)\n+const\n+217 {\n+218 for (std::size_t i = 0; i < count; ++i)\n+219 w.write(r[i]);\n+220 }\n+221\n+222 template\n+223 void do_write(Writer& w, const R& r, std::size_t count, std::false_type)\n+const\n+224 {\n+225 assert(count == 1);\n+226 w.write(r);\n+227 }\n+228\n+229 Function _f;\n+230 };\n+231\n+233 template\n+234 struct GlobalFunctionWrapper\n+235 : public FunctionWrapperBase\n+236 {\n+237 using Function = typename std::decay::type;\n+238\n+239 template\n+240 GlobalFunctionWrapper(F_&& f)\n+241 : _f(std::forward(f))\n+242 , element_(nullptr)\n+243 {}\n+244\n+245 virtual void bind(const Entity& e)\n+246 {\n+247 element_ = &e;\n+248 }\n+249\n+250 virtual void unbind()\n+251 {\n+252 element_ = nullptr;\n+253 }\n+254\n+255 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n+const\n+256 {\n+257 auto globalPos = element_->geometry().global(pos);\n+258 auto r = _f(globalPos);\n+259 if constexpr (IsIndexable()) {\n+260 for (std::size_t i = 0; i < count; ++i)\n+261 w.write(r[i]);\n+262 }\n+263 else {\n+264 assert(count == 1);\n+265 w.write(r);\n+266 }\n+267 }\n+268 private:\n+269 Function _f;\n+270 const Entity* element_;\n+271 };\n+272\n+274 struct VTKFunctionWrapper\n+275 : public FunctionWrapperBase\n+276 {\n+277 VTKFunctionWrapper(const std::shared_ptr< const VTKFunction >& f)\n+278 : _f(f)\n+279 , _entity(nullptr)\n+280 {}\n+281\n+282 virtual void bind(const Entity& e)\n+283 {\n+284 _entity = &e;\n+285 }\n+286\n+287 virtual void unbind()\n+288 {\n+289 _entity = nullptr;\n+290 }\n+291\n+292 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n+const\n+293 {\n+294 for (std::size_t i = 0; i < count; ++i)\n+295 w.write(_f->evaluate(i,*_entity,pos));\n+296 }\n+297\n+298 private:\n+299\n+300 std::shared_ptr< const VTKFunction > _f;\n+301 const Entity* _entity;\n+302\n+303 };\n+304\n+306 template::value,\n+int> = 0>\n+307 VTKLocalFunction(F&& f, VTK::FieldInfo fieldInfo)\n+308 : _f(std::make_unique >(std::forward(f)))\n+309 , _fieldInfo(fieldInfo)\n+310 {}\n+311\n+313 // That is, a function that you can create a LocalFunction for, and\n+evaluate that in element coordinates\n+314 template::\n+value && Impl::HasLocalFunction::value, int> = 0>\n+315 VTKLocalFunction(F&& f, VTK::FieldInfo fieldInfo)\n+316 : _f(std::make_unique< FunctionWrapper<\n+317 typename std::decay(f)))>::type\n+318 > >(localFunction(std::forward(f))))\n+319 , _fieldInfo(fieldInfo)\n+320 {}\n+321\n+323 // That is, a function that can be evaluated in global coordinates of the\n+domain\n+324 template::\n+value && not Impl::HasLocalFunction::value, int> = 0>\n+325 VTKLocalFunction(F&& f, VTK::FieldInfo fieldInfo)\n+326 : _f(std::make_unique< GlobalFunctionWrapper >(std::forward(f)))\n+327 , _fieldInfo(fieldInfo)\n+328 {}\n+329\n+331 explicit VTKLocalFunction (const std::shared_ptr< const VTKFunction >&\n+vtkFunctionPtr)\n+332 : _f(std::make_unique(vtkFunctionPtr))\n+333 , _fieldInfo(\n+334 vtkFunctionPtr->name(),\n+335 (vtkFunctionPtr->ncomps() == 2 || vtkFunctionPtr->ncomps() == 3) ? VTK::\n+FieldInfo::Type::vector : VTK::FieldInfo::Type::scalar,\n+336 vtkFunctionPtr->ncomps(),\n+337 vtkFunctionPtr->precision()\n+338 )\n+339 {}\n+340\n+342 std::string name() const\n+343 {\n+344 return fieldInfo().name();\n+345 }\n+346\n+348 const VTK::FieldInfo& fieldInfo() const\n+349 {\n+350 return _fieldInfo;\n+351 }\n+352\n+354 void bind(const Entity& e) const\n+355 {\n+356 _f->bind(e);\n+357 }\n+358\n+360 void unbind() const\n+361 {\n+362 _f->unbind();\n+363 }\n+364\n+366 void write(const Coordinate& pos, Writer& w) const\n+367 {\n+368 _f->write(pos,w,fieldInfo().size());\n+369 }\n+370\n+371 std::shared_ptr _f;\n+372 VTK::FieldInfo _fieldInfo;\n+373\n+374 };\n+375\n+376 typedef typename std::list::const_iterator\n+FunctionIterator;\n+377\n+379\n+384 class CellIterator : public GridCellIterator\n+385 {\n+386 public:\n+388 CellIterator(const GridCellIterator & x) : GridCellIterator(x) {}\n+391 const FieldVector position() const\n+392 {\n+393 return ReferenceElements::general((*this)->type()).position(0,0);\n+394 }\n+395 };\n+396\n+397 CellIterator cellBegin() const\n+398 {\n+399 return gridView_.template begin< 0, VTK_Partition >();\n+400 }\n+401\n+402 CellIterator cellEnd() const\n+403 {\n+404 return gridView_.template end< 0, VTK_Partition >();\n+405 }\n+406\n+408\n+422 class VertexIterator :\n+423 public ForwardIteratorFacade\n+424 {\n+425 GridCellIterator git;\n+426 GridCellIterator gend;\n+427 VTK::DataMode datamode;\n+428 // Index of the currently visited corner within the current element.\n+429 // NOTE: this is in Dune-numbering, in contrast to CornerIterator.\n+430 int cornerIndexDune;\n+431 const VertexMapper & vertexmapper;\n+432 std::vector visited;\n+433 // in conforming mode, for each vertex id (as obtained by vertexmapper)\n+434 // hold its number in the iteration order (VertexIterator)\n+435 int offset;\n+436\n+437 // hide operator ->\n+438 void operator->();\n+439 protected:\n+440 void basicIncrement ()\n+441 {\n+442 if( git == gend )\n+443 return;\n+444 ++cornerIndexDune;\n+445 const int numCorners = git->subEntities(n);\n+446 if( cornerIndexDune == numCorners )\n+447 {\n+448 offset += numCorners;\n+449 cornerIndexDune = 0;\n+450\n+451 ++git;\n+452 while( (git != gend) && skipEntity( git->partitionType() ) )\n+453 ++git;\n+454 }\n+455 }\n+456 public:\n+457 VertexIterator(const GridCellIterator & x,\n+458 const GridCellIterator & end,\n+459 const VTK::DataMode & dm,\n+460 const VertexMapper & vm) :\n+461 git(x), gend(end), datamode(dm), cornerIndexDune(0),\n+462 vertexmapper(vm), visited(vm.size(), false),\n+463 offset(0)\n+464 {\n+465 if (datamode == VTK::conforming && git != gend)\n+466 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;\n+467 }\n+468 void increment ()\n+469 {\n+470 switch (datamode)\n+471 {\n+472 case VTK::conforming :\n+473 while(visited[vertexmapper.subIndex(*git,cornerIndexDune,n)])\n+474 {\n+475 basicIncrement();\n+476 if (git == gend) return;\n+477 }\n+478 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;\n+479 break;\n+480 case VTK::nonconforming :\n+481 basicIncrement();\n+482 break;\n+483 }\n+484 }\n+485 bool equals (const VertexIterator & cit) const\n+486 {\n+487 return git == cit.git\n+488 && cornerIndexDune == cit.cornerIndexDune\n+489 && datamode == cit.datamode;\n+490 }\n+491 EntityReference dereference() const\n+492 {\n+493 return *git;\n+494 }\n+496 int localindex () const\n+497 {\n+498 return cornerIndexDune;\n+499 }\n+501 FieldVector position () const\n+502 {\n+503 return referenceElement(git->type())\n+504 .position(cornerIndexDune,n);\n+505 }\n+506 };\n+507\n+508 VertexIterator vertexBegin () const\n+509 {\n+510 return VertexIterator( gridView_.template begin< 0, VTK_Partition >(),\n+511 gridView_.template end< 0, VTK_Partition >(),\n+512 datamode, *vertexmapper );\n+513 }\n+514\n+515 VertexIterator vertexEnd () const\n+516 {\n+517 return VertexIterator( gridView_.template end< 0, VTK_Partition >(),\n+518 gridView_.template end< 0, VTK_Partition >(),\n+519 datamode, *vertexmapper );\n+520 }\n+521\n+523\n+537 class CornerIterator :\n+538 public ForwardIteratorFacade\n+539 {\n+540 GridCellIterator git;\n+541 GridCellIterator gend;\n+542 VTK::DataMode datamode;\n+543 // Index of the currently visited corner within the current element.\n+544 // NOTE: this is in VTK-numbering, in contrast to VertexIterator.\n+545 int cornerIndexVTK;\n+546 const VertexMapper & vertexmapper;\n+547 // in conforming mode, for each vertex id (as obtained by vertexmapper)\n+548 // hold its number in the iteration order of VertexIterator (*not*\n+549 // CornerIterator)\n+550 const std::vector & number;\n+551 // holds the number of corners of all the elements we have seen so far,\n+552 // excluding the current element\n+553 int offset;\n+554\n+555 // hide operator ->\n+556 void operator->();\n+557 public:\n+558 CornerIterator(const GridCellIterator & x,\n+559 const GridCellIterator & end,\n+560 const VTK::DataMode & dm,\n+561 const VertexMapper & vm,\n+562 const std::vector & num) :\n+563 git(x), gend(end), datamode(dm), cornerIndexVTK(0),\n+564 vertexmapper(vm),\n+565 number(num), offset(0) {}\n+566 void increment ()\n+567 {\n+568 if( git == gend )\n+569 return;\n+570 ++cornerIndexVTK;\n+571 const int numCorners = git->subEntities(n);\n+572 if( cornerIndexVTK == numCorners )\n+573 {\n+574 offset += numCorners;\n+575 cornerIndexVTK = 0;\n+576\n+577 ++git;\n+578 while( (git != gend) && skipEntity( git->partitionType() ) )\n+579 ++git;\n+580 }\n+581 }\n+582 bool equals (const CornerIterator & cit) const\n+583 {\n+584 return git == cit.git\n+585 && cornerIndexVTK == cit.cornerIndexVTK\n+586 && datamode == cit.datamode;\n+587 }\n+588 EntityReference dereference() const\n+589 {\n+590 return *git;\n+591 }\n+593\n+597 int id () const\n+598 {\n+599 switch (datamode)\n+600 {\n+601 case VTK::conforming :\n+602 return\n+603 number[vertexmapper.subIndex(*git,VTK::renumber(*git,cornerIndexVTK),\n+604 n)];\n+605 case VTK::nonconforming :\n+606 return offset + VTK::renumber(*git,cornerIndexVTK);\n+607 default :\n+608 DUNE_THROW(IOError,\"VTKWriter: unsupported DataMode\" << datamode);\n+609 }\n+610 }\n+611 };\n+612\n+613 CornerIterator cornerBegin () const\n+614 {\n+615 return CornerIterator( gridView_.template begin< 0, VTK_Partition >(),\n+616 gridView_.template end< 0, VTK_Partition >(),\n+617 datamode, *vertexmapper, number );\n+618 }\n+619\n+620 CornerIterator cornerEnd () const\n+621 {\n+622 return CornerIterator( gridView_.template end< 0, VTK_Partition >(),\n+623 gridView_.template end< 0, VTK_Partition >(),\n+624 datamode, *vertexmapper, number );\n+625 }\n+626\n+627 public:\n+636 explicit VTKWriter ( const GridView &gridView,\n+637 VTK::DataMode dm = VTK::conforming,\n+638 VTK::Precision coordPrecision = VTK::Precision::float32)\n+639 : gridView_( gridView ),\n+640 datamode( dm ),\n+641 coordPrec (coordPrecision),\n+642 polyhedralCellsPresent_( checkForPolyhedralCells() )\n+643 { }\n+644\n+649 void addCellData (const std::shared_ptr< const VTKFunction > & p)\n+650 {\n+651 celldata.push_back(VTKLocalFunction(p));\n+652 }\n+653\n+673 template\n+674 void addCellData(F&& f, VTK::FieldInfo vtkFieldInfo)\n+675 {\n+676 celldata.push_back(VTKLocalFunction(std::forward(f),vtkFieldInfo));\n+677 }\n+678\n+694 template\n+695 void addCellData (const Container& v, const std::string &name, int ncomps =\n+1,\n+696 VTK::Precision prec = VTK::Precision::float32)\n+697 {\n+698 typedef P0VTKFunction Function;\n+699 for (int c=0; c1)\n+703 compName << \"[\" << c << \"]\";\n+704 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c,\n+prec);\n+705 addCellData(std::shared_ptr< const VTKFunction >(p));\n+706 }\n+707 }\n+708\n+713 void addVertexData (const std::shared_ptr< const VTKFunction > & p)\n+714 {\n+715 vertexdata.push_back(VTKLocalFunction(p));\n+716 }\n+717\n+737 template\n+738 void addVertexData(F&& f, VTK::FieldInfo vtkFieldInfo)\n+739 {\n+740 vertexdata.push_back(VTKLocalFunction(std::forward(f),vtkFieldInfo));\n+741 }\n+742\n+743\n+759 template\n+760 void addVertexData (const Container& v, const std::string &name, int\n+ncomps=1,\n+761 VTK::Precision prec = VTK::Precision::float32)\n+762 {\n+763 typedef P1VTKFunction Function;\n+764 for (int c=0; c1)\n+768 compName << \"[\" << c << \"]\";\n+769 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c,\n+prec);\n+770 addVertexData(std::shared_ptr< const VTKFunction >(p));\n+771 }\n+772 }\n+773\n+775 void clear ()\n+776 {\n+777 celldata.clear();\n+778 vertexdata.clear();\n+779 }\n+780\n+782 VTK::Precision coordPrecision() const\n+783 { return coordPrec; }\n+784\n+786 virtual ~VTKWriter ()\n+787 {\n+788 this->clear();\n+789 }\n+790\n+803 std::string write ( const std::string &name,\n+804 VTK::OutputType type = VTK::ascii )\n+805 {\n+806 return write( name, type, gridView_.comm().rank(), gridView_.comm().size()\n+);\n+807 }\n+808\n+835 std::string pwrite ( const std::string & name, const std::string & path,\n+const std::string & extendpath,\n+836 VTK::OutputType type = VTK::ascii )\n+837 {\n+838 return pwrite( name, path, extendpath, type, gridView_.comm().rank(),\n+gridView_.comm().size() );\n+839 }\n+840\n+841 protected:\n+843\n+855 std::string getParallelPieceName(const std::string& name,\n+856 const std::string& path,\n+857 int commRank, int commSize) const\n+858 {\n+859 std::ostringstream s;\n+860 // write path first\n+861 if(path.size() > 0)\n+862 {\n+863 s << path;\n+864 if(path[path.size()-1] != '/')\n+865 s << '/';\n+866 }\n+867\n+868 std::string fileprefix;\n+869 // check if a path was already added to name\n+870 // and if yes find filename without path\n+871 auto pos = name.rfind('/');\n+872 if( pos != std::string::npos )\n+873 {\n+874 // extract filename without path\n+875 fileprefix = name.substr( pos+1 );\n+876 // extract the path and added it before\n+877 // the magic below is added\n+878 std::string newpath = name.substr(0, pos);\n+879 s << newpath;\n+880 if(newpath[name.size()-1] != '/')\n+881 s << '/';\n+882 }\n+883 else\n+884 {\n+885 // if no path was found just copy the name\n+886 fileprefix = name;\n+887 }\n+888\n+889 s << 's' << std::setw(4) << std::setfill('0') << commSize << '-';\n+890 const bool writeHeader = commRank < 0;\n+891 if( ! writeHeader )\n+892 {\n+893 s << 'p' << std::setw(4) << std::setfill('0') << commRank << '-';\n+894 }\n+895\n+896 s << fileprefix << \".\";\n+897 // write p for header files\n+898 if( writeHeader )\n+899 s << \"p\";\n+900 s << \"vt\";\n+901\n+902 if(GridView::dimension > 1)\n+903 s << \"u\";\n+904 else\n+905 s << \"p\";\n+906 return s.str();\n+907 }\n+908\n+910\n+920 std::string getParallelHeaderName(const std::string& name,\n+921 const std::string& path,\n+922 int commSize) const\n+923 {\n+924 return getParallelPieceName( name, path, -1, commSize );\n+925 }\n+926\n+928\n+940 std::string getSerialPieceName(const std::string& name,\n+941 const std::string& path) const\n+942 {\n+943 static const std::string extension =\n+944 GridView::dimension == 1 ? \".vtp\" : \".vtu\";\n+945\n+946 return concatPaths(path, name+extension);\n+947 }\n+948\n+965 std::string write ( const std::string &name,\n+966 VTK::OutputType type,\n+967 const int commRank,\n+968 const int commSize )\n+969 {\n+970 // in the parallel case, just use pwrite, it has all the necessary\n+971 // stuff, so we don't need to reimplement it here.\n+972 if(commSize > 1)\n+973 {\n+974 std::string filename = name;\n+975 std::string path = std::string(\"\");\n+976\n+977 // check if a path was already added to name\n+978 // and if yes find filename without path\n+979 auto pos = name.rfind('/');\n+980 if( pos != std::string::npos )\n+981 {\n+982 // extract filename without path\n+983 filename = name.substr( pos+1 );\n+984\n+985 // extract the path and added it before\n+986 // the magic below is added\n+987 path = name.substr(0, pos);\n+988 }\n+989\n+990 return pwrite(filename, path, \"\", type, commRank, commSize);\n+991 }\n+992\n+993 // make data mode visible to private functions\n+994 outputtype = type;\n+995\n+996 // generate filename for process data\n+997 std::string pieceName = getSerialPieceName(name, \"\");\n+998\n+999 // write process data\n+1000 std::ofstream file;\n+1001 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n+1002 std::ios_base::eofbit);\n+1003 // check if file can be opened\n+1004 try {\n+1005 file.open( pieceName.c_str(), std::ios::binary );\n+1006 }\n+1007 catch(...) {\n+1008 std::cerr << \"Filename: \" << pieceName << \" could not be opened\" << std::\n+endl;\n+1009 throw;\n+1010 }\n+1011 if (! file.is_open())\n+1012 DUNE_THROW(IOError, \"Could not write to piece file \" << pieceName);\n+1013 writeDataFile( file );\n+1014 file.close();\n+1015\n+1016 return pieceName;\n+1017 }\n+1018\n+1020\n+1043 std::string pwrite(const std::string& name, const std::string& path,\n+1044 const std::string& extendpath,\n+1045 VTK::OutputType ot, const int commRank,\n+1046 const int commSize )\n+1047 {\n+1048 // make data mode visible to private functions\n+1049 outputtype=ot;\n+1050\n+1051 // do some magic because paraview can only cope with relative paths to\n+piece files\n+1052 std::ofstream file;\n+1053 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n+1054 std::ios_base::eofbit);\n+1055 std::string piecepath = concatPaths(path, extendpath);\n+1056 std::string relpiecepath = relativePath(path, piecepath);\n+1057\n+1058 // write this processes .vtu/.vtp piece file\n+1059 std::string fullname = getParallelPieceName(name, piecepath, commRank,\n+1060 commSize);\n+1061 // check if file can be opened\n+1062 try {\n+1063 file.open(fullname.c_str(),std::ios::binary);\n+1064 }\n+1065 catch(...) {\n+1066 std::cerr << \"Filename: \" << fullname << \" could not be opened\" << std::\n+endl;\n+1067 throw;\n+1068 }\n+1069 if (! file.is_open())\n+1070 DUNE_THROW(IOError, \"Could not write to piecefile file \" << fullname);\n+1071 writeDataFile(file);\n+1072 file.close();\n+1073 gridView_.comm().barrier();\n+1074\n+1075 // if we are rank 0, write .pvtu/.pvtp parallel header\n+1076 fullname = getParallelHeaderName(name, path, commSize);\n+1077 if( commRank ==0 )\n+1078 {\n+1079 file.open(fullname.c_str());\n+1080 if (! file.is_open())\n+1081 DUNE_THROW(IOError, \"Could not write to parallel file \" << fullname);\n+1082 writeParallelHeader(file,name,relpiecepath, commSize );\n+1083 file.close();\n+1084 }\n+1085 gridView_.comm().barrier();\n+1086 return fullname;\n+1087 }\n+1088\n+1089 private:\n+1091\n+1108 void writeParallelHeader(std::ostream& s, const std::string& piecename,\n+1109 const std::string& piecepath, const int commSize)\n+1110 {\n+1111 VTK::FileType fileType =\n+1112 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;\n+1113\n+1114 VTK::PVTUWriter writer(s, fileType);\n+1115\n+1116 writer.beginMain();\n+1117\n+1118 // PPointData\n+1119 {\n+1120 std::string scalars, vectors;\n+1121 std::tie(scalars,vectors) = getDataNames(vertexdata);\n+1122 writer.beginPointData(scalars, vectors);\n+1123 }\n+1124 for (auto it = vertexdata.begin(),\n+1125 end = vertexdata.end();\n+1126 it != end;\n+1127 ++it)\n+1128 {\n+1129 unsigned writecomps = it->fieldInfo().size();\n+1130 // for 2d vector fields should be written as 3d vector fields\n+1131 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps ==\n+2)\n+1132 writecomps = 3;\n+1133 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());\n+1134 }\n+1135 writer.endPointData();\n+1136\n+1137 // PCellData\n+1138 {\n+1139 std::string scalars, vectors;\n+1140 std::tie(scalars,vectors) = getDataNames(celldata);\n+1141 writer.beginCellData(scalars, vectors);\n+1142 }\n+1143 for (auto it = celldata.begin(),\n+1144 end = celldata.end();\n+1145 it != end;\n+1146 ++it)\n+1147 {\n+1148 unsigned writecomps = it->fieldInfo().size();\n+1149 // for 2d vector fields should be written as 3d vector fields\n+1150 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps ==\n+2)\n+1151 writecomps = 3;\n+1152 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());\n+1153 }\n+1154 writer.endCellData();\n+1155\n+1156 // PPoints\n+1157 writer.beginPoints();\n+1158 writer.addArray(\"Coordinates\", 3, coordPrec);\n+1159 writer.endPoints();\n+1160\n+1161 // Pieces\n+1162 for( int i = 0; i < commSize; ++i )\n+1163 {\n+1164 const std::string& fullname = getParallelPieceName(piecename,\n+1165 piecepath, i,\n+1166 commSize);\n+1167 writer.addPiece(fullname);\n+1168 }\n+1169\n+1170 writer.endMain();\n+1171 }\n+1172\n+1174 void writeDataFile (std::ostream& s)\n+1175 {\n+1176 VTK::FileType fileType =\n+1177 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;\n+1178\n+1179 VTK::VTUWriter writer(s, outputtype, fileType);\n+1180\n+1181 // Grid characteristics\n+1182 vertexmapper = new VertexMapper( gridView_, mcmgVertexLayout() );\n+1183 if (datamode == VTK::conforming)\n+1184 {\n+1185 number.resize(vertexmapper->size());\n+1186 for (std::vector::size_type i=0; imap(), this iteration must be\n+1248 // in the order of Dune's numbering.\n+1249 const int subEntities = it->subEntities(n);\n+1250 for (int i=0; isubIndex(*it,i,n);\n+1256 if (number[alpha]<0)\n+1257 number[alpha] = nvertices_++;\n+1258 }\n+1259 else\n+1260 {\n+1261 nvertices_++;\n+1262 }\n+1263 }\n+1264 }\n+1265 }\n+1266\n+1267 template\n+1268 std::tuple getDataNames(const T& data) const\n+1269 {\n+1270 std::string scalars = \"\";\n+1271 for (auto it = data.begin(),\n+1272 end = data.end();\n+1273 it != end;\n+1274 ++it)\n+1275 if (it->fieldInfo().type() == VTK::FieldInfo::Type::scalar)\n+1276 {\n+1277 scalars = it->name();\n+1278 break;\n+1279 }\n+1280\n+1281 std::string vectors = \"\";\n+1282 for (auto it = data.begin(),\n+1283 end = data.end();\n+1284 it != end;\n+1285 ++it)\n+1286 if (it->fieldInfo().type() == VTK::FieldInfo::Type::vector)\n+1287 {\n+1288 vectors = it->name();\n+1289 break;\n+1290 }\n+1291 return std::make_tuple(scalars,vectors);\n+1292 }\n+1293\n+1294 template\n+1295 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator\n+begin, const Iterator end, int nentries)\n+1296 {\n+1297 for (auto it = data.begin(),\n+1298 iend = data.end();\n+1299 it != iend;\n+1300 ++it)\n+1301 {\n+1302 const auto& f = *it;\n+1303 VTK::FieldInfo fieldInfo = f.fieldInfo();\n+1304 std::size_t writecomps = fieldInfo.size();\n+1305 switch (fieldInfo.type())\n+1306 {\n+1307 case VTK::FieldInfo::Type::scalar:\n+1308 break;\n+1309 case VTK::FieldInfo::Type::vector:\n+1310 // vtk file format: a vector data always should have 3 comps (with\n+1311 // 3rd comp = 0 in 2D case)\n+1312 if (writecomps > 3)\n+1313 DUNE_THROW(IOError,\"Cannot write VTK vectors with more than 3 components\n+(components was \" << writecomps << \")\");\n+1314 writecomps = 3;\n+1315 break;\n+1316 case VTK::FieldInfo::Type::tensor:\n+1317 DUNE_THROW(NotImplemented,\"VTK output for tensors not implemented yet\");\n+1318 }\n+1319 std::shared_ptr p\n+1320 (writer.makeArrayWriter(f.name(), writecomps, nentries,\n+fieldInfo.precision()));\n+1321 if(!p->writeIsNoop())\n+1322 for (Iterator eit = begin; eit!=end; ++eit)\n+1323 {\n+1324 const Entity & e = *eit;\n+1325 f.bind(e);\n+1326 f.write(eit.position(),*p);\n+1327 f.unbind();\n+1328 // vtk file format: a vector data always should have 3 comps\n+1329 // (with 3rd comp = 0 in 2D case)\n+1330 for (std::size_t j=fieldInfo.size(); j < writecomps; ++j)\n+1331 p->write(0.0);\n+1332 }\n+1333 }\n+1334 }\n+1335\n+1337 virtual void writeCellData(VTK::VTUWriter& writer)\n+1338 {\n+1339 if(celldata.size() == 0)\n+1340 return;\n+1341\n+1342 std::string scalars, vectors;\n+1343 std::tie(scalars,vectors) = getDataNames(celldata);\n+1344\n+1345 writer.beginCellData(scalars, vectors);\n+1346 writeData(writer,celldata,cellBegin(),cellEnd(),ncells);\n+1347 writer.endCellData();\n+1348 }\n+1349\n+1351 virtual void writeVertexData(VTK::VTUWriter& writer)\n+1352 {\n+1353 if(vertexdata.size() == 0)\n+1354 return;\n+1355\n+1356 std::string scalars, vectors;\n+1357 std::tie(scalars,vectors) = getDataNames(vertexdata);\n+1358\n+1359 writer.beginPointData(scalars, vectors);\n+1360 writeData(writer,vertexdata,vertexBegin(),vertexEnd(),nvertices);\n+1361 writer.endPointData();\n+1362 }\n+1363\n+1365 virtual void writeGridPoints(VTK::VTUWriter& writer)\n+1366 {\n+1367 writer.beginPoints();\n+1368\n+1369 std::shared_ptr p\n+1370 (writer.makeArrayWriter(\"Coordinates\", 3, nvertices, coordPrec));\n+1371 if(!p->writeIsNoop()) {\n+1372 VertexIterator vEnd = vertexEnd();\n+1373 for (VertexIterator vit=vertexBegin(); vit!=vEnd; ++vit)\n+1374 {\n+1375 int dimw=w;\n+1376 for (int j=0; jwrite((*vit).geometry().corner(vit.localindex())[j]);\n+1378 for (int j=std::min(dimw,3); j<3; j++)\n+1379 p->write(0.0);\n+1380 }\n+1381 }\n+1382 // free the VTK::DataArrayWriter before touching the stream\n+1383 p.reset();\n+1384\n+1385 writer.endPoints();\n+1386 }\n+1387\n+1389 virtual void writeGridCells(VTK::VTUWriter& writer)\n+1390 {\n+1391 writer.beginCells();\n+1392\n+1393 // connectivity\n+1394 {\n+1395 std::shared_ptr p1\n+1396 (writer.makeArrayWriter(\"connectivity\", 1, ncorners, VTK::Precision::\n+int32));\n+1397 if(!p1->writeIsNoop())\n+1398 for (CornerIterator it=cornerBegin(); it!=cornerEnd(); ++it)\n+1399 p1->write(it.id());\n+1400 }\n+1401\n+1402 // offsets\n+1403 {\n+1404 std::shared_ptr p2\n+1405 (writer.makeArrayWriter(\"offsets\", 1, ncells, VTK::Precision::int32));\n+1406 if(!p2->writeIsNoop()) {\n+1407 int offset = 0;\n+1408 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)\n+1409 {\n+1410 offset += it->subEntities(n);\n+1411 p2->write(offset);\n+1412 }\n+1413 }\n+1414 }\n+1415\n+1416 // types\n+1417 if (n>1)\n+1418 {\n+1419 {\n+1420 std::shared_ptr p3\n+1421 (writer.makeArrayWriter(\"types\", 1, ncells, VTK::Precision::uint8));\n+1422\n+1423 if(!p3->writeIsNoop())\n+1424 {\n+1425 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)\n+1426 {\n+1427 int vtktype = VTK::geometryType(it->type());\n+1428 p3->write(vtktype);\n+1429 }\n+1430 }\n+1431 }\n+1432\n+1433\n+1434 // if polyhedron cells found also cell faces need to be written\n+1435 if( polyhedralCellsPresent_ )\n+1436 {\n+1437 writeCellFaces( writer );\n+1438 }\n+1439 }\n+1440\n+1441 writer.endCells();\n+1442 }\n+1443\n+1444 protected:\n+1445 bool checkForPolyhedralCells() const\n+1446 {\n+1447 // check if polyhedron cells are present\n+1448 for( const auto& geomType : gridView_.indexSet().types( 0 ) )\n+1449 {\n+1450 if( VTK::geometryType( geomType ) == VTK::polyhedron )\n+1451 {\n+1452 return true;\n+1453 }\n+1454 }\n+1455 return false;\n+1456 }\n+1457\n+1459 virtual void writeCellFaces(VTK::VTUWriter& writer)\n+1460 {\n+1461 if( ! faceVertices_ )\n+1462 {\n+1463 faceVertices_.reset( new std::pair< std::vector, std::vector >\n+() );\n+1464 // fill face vertex structure\n+1465 fillFaceVertices( cornerBegin(), cornerEnd(), gridView_.indexSet(),\n+1466 faceVertices_->first, faceVertices_->second );\n+1467 }\n+1468\n+1469 std::vector< int >& faces = faceVertices_->first;\n+1470 std::vector< int >& faceOffsets = faceVertices_->second;\n+1471 assert( int(faceOffsets.size()) == ncells );\n+1472\n+1473 {\n+1474 std::shared_ptr p4\n+1475 (writer.makeArrayWriter(\"faces\", 1, faces.size(), VTK::Precision::int32));\n+1476 if(!p4->writeIsNoop())\n+1477 {\n+1478 for( const auto& face : faces )\n+1479 p4->write( face );\n+1480 }\n+1481 }\n+1482\n+1483 {\n+1484 std::shared_ptr p5\n+1485 (writer.makeArrayWriter(\"faceoffsets\", 1, ncells, VTK::Precision::int32));\n+1486 if(!p5->writeIsNoop())\n+1487 {\n+1488 for( const auto& offset : faceOffsets )\n+1489 p5->write( offset );\n+1490\n+1491 // clear face vertex structure\n+1492 faceVertices_.reset();\n+1493 }\n+1494 }\n+1495 }\n+1496\n+1497 template \n+1498 inline void fillFaceVertices( CornerIterator it,\n+1499 const CornerIterator end,\n+1500 const IndexSet& indexSet,\n+1501 std::vector& faces,\n+1502 std::vector& faceOffsets )\n+1503 {\n+1504 if( n == 3 && it != end )\n+1505 {\n+1506 // clear output arrays\n+1507 faces.clear();\n+1508 faces.reserve( 15 * ncells );\n+1509 faceOffsets.clear();\n+1510 faceOffsets.reserve( ncells );\n+1511\n+1512 int offset = 0;\n+1513\n+1514 Cell element = *it;\n+1515 int elIndex = indexSet.index( element );\n+1516 std::vector< T > vertices;\n+1517 vertices.reserve( 30 );\n+1518 for( ; it != end; ++it )\n+1519 {\n+1520 const Cell& cell = *it ;\n+1521 const int cellIndex = indexSet.index( cell ) ;\n+1522 if( elIndex != cellIndex )\n+1523 {\n+1524 fillFacesForElement( element, indexSet, vertices, offset, faces,\n+faceOffsets );\n+1525\n+1526 vertices.clear();\n+1527 element = cell ;\n+1528 elIndex = cellIndex ;\n+1529 }\n+1530 vertices.push_back( it.id() );\n+1531 }\n+1532\n+1533 // fill faces for last element\n+1534 fillFacesForElement( element, indexSet, vertices, offset, faces,\n+faceOffsets );\n+1535 }\n+1536 }\n+1537\n+1538 template \n+1539 static void fillFacesForElement( const Entity& element,\n+1540 const IndexSet& indexSet,\n+1541 const std::vector& vertices,\n+1542 T& offset,\n+1543 std::vector& faces,\n+1544 std::vector& faceOffsets )\n+1545 {\n+1546 const int dim = n;\n+1547\n+1548 std::map< T, T > vxMap;\n+1549\n+1550 // get number of local faces\n+1551 const int nVertices = element.subEntities( dim );\n+1552 for( int vx = 0; vx < nVertices; ++ vx )\n+1553 {\n+1554 const int vxIdx = indexSet.subIndex( element, vx, dim );\n+1555 vxMap[ vxIdx ] = vertices[ vx ];\n+1556 }\n+1557\n+1558 // get number of local faces\n+1559 const int nFaces = element.subEntities( 1 );\n+1560 // store number of faces for current element\n+1561 faces.push_back( nFaces );\n+1562 ++offset;\n+1563 // extract each face as a set of vertex indices\n+1564 for( int fce = 0; fce < nFaces; ++ fce )\n+1565 {\n+1566 // obtain face\n+1567 const auto face = element.template subEntity< 1 > ( fce );\n+1568\n+1569 // get all vertex indices from current face\n+1570 const int nVxFace = face.subEntities( dim );\n+1571 faces.push_back( nVxFace );\n+1572 ++offset ;\n+1573 for( int i=0; i celldata;\n+1589 std::list vertexdata;\n+1590\n+1591 // the grid\n+1592 GridView gridView_;\n+1593\n+1594 // temporary grid information\n+1595 int ncells;\n+1596 int nvertices;\n+1597 int ncorners;\n+1598 private:\n+1599 VertexMapper* vertexmapper;\n+1600 // in conforming mode, for each vertex id (as obtained by vertexmapper)\n+1601 // hold its number in the iteration order (VertexIterator)\n+1602 std::vector number;\n+1603 VTK::DataMode datamode;\n+1604 VTK::Precision coordPrec;\n+1605\n+1606 // true if polyhedral cells are present in the grid\n+1607 const bool polyhedralCellsPresent_;\n+1608\n+1609 // pointer holding face vertex connectivity if needed\n+1610 std::shared_ptr< std::pair< std::vector, std::vector > >\n+faceVertices_;\n+1611\n+1612 protected:\n+1613 VTK::OutputType outputtype;\n+1614 };\n+1615\n+1616}\n+1617\n+1618#endif\n+gridenums.hh\n+mcmgmapper.hh\n+Mapper for multiple codim and multiple geometry types.\n+function.hh\n+Functions for VTK output.\n+dataarraywriter.hh\n+Data array writers for the VTKWriter.\n+vtuwriter.hh\n+pvtuwriter.hh\n+streams.hh\n+common.hh\n+Common stuff for the VTKWriter.\n+Dune::PartitionIteratorType\n+PartitionIteratorType\n+Parameter to be used for the parallel level- and leaf iterators.\n+Definition gridenums.hh:136\n+Dune::PartitionType\n+PartitionType\n+Attributes used in the generic overlap model.\n+Definition gridenums.hh:30\n+Dune::All_Partition\n+@ All_Partition\n+all entities\n+Definition gridenums.hh:141\n+Dune::InteriorBorder_Partition\n+@ InteriorBorder_Partition\n+interior and border entities\n+Definition gridenums.hh:138\n+Dune::InteriorEntity\n+@ InteriorEntity\n+all interior entities\n+Definition gridenums.hh:31\n+Dune::GridView::indexSet\n+const IndexSet & indexSet() const\n+obtain the index set\n+Definition common/gridview.hh:177\n+Dune::GridView::Grid\n+Traits::Grid Grid\n+type of the grid\n+Definition common/gridview.hh:83\n+Dune::GridView::IndexSet\n+Traits::IndexSet IndexSet\n+type of the index set\n+Definition common/gridview.hh:86\n+Dune::GridView::comm\n+const Communication & comm() const\n+obtain communication object\n+Definition common/gridview.hh:273\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n+Dune::GridView::ctype\n+Grid::ctype ctype\n+type used for coordinates in grid\n+Definition common/gridview.hh:131\n+Dune::GridView::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/gridview.hh:137\n+Dune::mcmgVertexLayout\n+MCMGLayout mcmgVertexLayout()\n+layout for vertices (dim-0 entities)\n+Definition mcmgmapper.hh:107\n+std\n+STL namespace.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::BasicBlock::reset\n-void reset()\n-Definition basic.hh:51\n-Dune::dgf::BasicBlock::getnextline\n-bool getnextline()\n-Definition basic.cc:93\n-Dune::dgf::BasicBlock::getnextentry\n-bool getnextentry(ENTRY &entry)\n-Definition basic.hh:63\n-Dune::dgf::PolygonBlock\n-Definition polygon.hh:25\n-Dune::dgf::PolygonBlock::PolygonBlock\n-PolygonBlock(std::istream &in, int numVtx, int vtxOfs)\n-Definition polygon.hh:26\n-Dune::dgf::PolygonBlock::get\n-int get(std::vector< std::vector< int > > &polygons)\n-Definition polygon.hh:30\n-Dune::dgf::PolygonBlock::vtxEnd_\n-int vtxEnd_\n-Definition polygon.hh:50\n-Dune::dgf::PolygonBlock::vtxBegin_\n-int vtxBegin_\n-Definition polygon.hh:50\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::int32\n+@ int32\n+Dune::VTK::Precision::uint8\n+@ uint8\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::VTK::OutputType\n+OutputType\n+How the bulk data should be stored in the file.\n+Definition common.hh:43\n+Dune::VTK::ascii\n+@ ascii\n+Output to the file is in ascii.\n+Definition common.hh:45\n+Dune::VTK::appendedraw\n+@ appendedraw\n+Output is to the file is appended raw binary.\n+Definition common.hh:49\n+Dune::VTK::appendedbase64\n+@ appendedbase64\n+Output is to the file is appended base64 binary.\n+Definition common.hh:51\n+Dune::VTK::base64\n+@ base64\n+Output to the file is inline base64 binary.\n+Definition common.hh:47\n+Dune::VTK::renumber\n+int renumber(const Dune::GeometryType &t, int i)\n+renumber VTK <-> Dune\n+Definition common.hh:186\n+Dune::VTK::FileType\n+FileType\n+which type of VTK file to write\n+Definition common.hh:252\n+Dune::VTK::polyData\n+@ polyData\n+for .vtp files (PolyData)\n+Definition common.hh:254\n+Dune::VTK::unstructuredGrid\n+@ unstructuredGrid\n+for .vtu files (UnstructuredGrid)\n+Definition common.hh:256\n+Dune::VTK::DataMode\n+DataMode\n+Whether to produce conforming or non-conforming output.\n+Definition common.hh:67\n+Dune::VTK::conforming\n+@ conforming\n+Output conforming data.\n+Definition common.hh:73\n+Dune::VTK::nonconforming\n+@ nonconforming\n+Output non-conforming data.\n+Definition common.hh:81\n+Dune::VTK::geometryType\n+GeometryType geometryType(const Dune::GeometryType &t)\n+mapping from GeometryType to VTKGeometryType\n+Definition common.hh:151\n+Dune::VTK::polyhedron\n+@ polyhedron\n+Definition common.hh:142\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::GridView::Codim\n+A struct that collects all associated types of one implementation from the\n+Traits class.\n+Definition common/gridview.hh:104\n+Dune::MultipleCodimMultipleGeomTypeMapper\n+Implementation class for a multiple codim and multiple geometry type mapper.\n+Definition mcmgmapper.hh:129\n+Dune::MultipleCodimMultipleGeomTypeMapper::size\n+size_type size() const\n+Return total number of entities in the entity set managed by the mapper.\n+Definition mcmgmapper.hh:204\n+Dune::MultipleCodimMultipleGeomTypeMapper::subIndex\n+Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i,\n+unsigned int codim) const\n+Map subentity of codim 0 entity to starting index in array for dof block.\n+Definition mcmgmapper.hh:185\n+Dune::VTK::FieldInfo\n+Descriptor struct for VTK fields.\n+Definition common.hh:328\n+Dune::VTK::FieldInfo::size\n+std::size_t size() const\n+The number of components in the data field.\n+Definition common.hh:364\n+Dune::VTK::FieldInfo::precision\n+Precision precision() const\n+The precision used for the output of the data field.\n+Definition common.hh:370\n+Dune::VTK::FieldInfo::Type::tensor\n+@ tensor\n+tensor field (always 3x3)\n+Dune::VTK::FieldInfo::Type::vector\n+@ vector\n+vector-valued field (always 3D, will be padded if necessary)\n+Dune::VTK::FieldInfo::Type::scalar\n+@ scalar\n+Dune::VTK::FieldInfo::type\n+Type type() const\n+The type of the data field.\n+Definition common.hh:358\n+Dune::VTK::FieldInfo::name\n+std::string name() const\n+The name of the data field.\n+Definition common.hh:352\n+Dune::VTK::DataArrayWriter\n+base class for data array writers\n+Definition dataarraywriter.hh:56\n+Dune::VTK::DataArrayWriter::write\n+void write(T data)\n+write one element of data\n+Definition dataarraywriter.hh:69\n+Dune::VTKFunction\n+A base class for grid functions with any return type and dimension.\n+Definition function.hh:42\n+Dune::P0VTKFunction\n+Take a vector and interpret it as cell data for the VTKWriter.\n+Definition function.hh:97\n+Dune::P1VTKFunction\n+Take a vector and interpret it as point data for the VTKWriter.\n+Definition function.hh:205\n+Dune::VTK::PVTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition pvtuwriter.hh:62\n+Dune::VTKSequenceWriter\n+Writer for the output of grid functions in the vtk format.\n+Definition vtksequencewriter.hh:29\n+Dune::VTKSequenceWriterBase\n+Base class to write pvd-files which contains a list of all collected vtk-files.\n+Definition vtksequencewriterbase.hh:34\n+Dune::VTKWriter\n+Writer for the output of grid functions in the vtk format.\n+Definition vtkwriter.hh:95\n+Dune::VTKWriter::addCellData\n+void addCellData(const Container &v, const std::string &name, int ncomps=1,\n+VTK::Precision prec=VTK::Precision::float32)\n+Add a grid function (represented by container) that lives on the cells of the\n+grid to the visualizati...\n+Definition vtkwriter.hh:695\n+Dune::VTKWriter::cornerEnd\n+CornerIterator cornerEnd() const\n+Definition vtkwriter.hh:620\n+Dune::VTKWriter::clear\n+void clear()\n+clear list of registered functions\n+Definition vtkwriter.hh:775\n+Dune::VTKWriter::write\n+std::string write(const std::string &name, VTK::OutputType type=VTK::ascii)\n+write output (interface might change later)\n+Definition vtkwriter.hh:803\n+Dune::VTKWriter::vertexBegin\n+VertexIterator vertexBegin() const\n+Definition vtkwriter.hh:508\n+Dune::VTKWriter::getTypeString\n+std::string getTypeString() const\n+Definition vtkwriter.hh:1230\n+Dune::VTKWriter::getParallelHeaderName\n+std::string getParallelHeaderName(const std::string &name, const std::string\n+&path, int commSize) const\n+return name of a parallel header file\n+Definition vtkwriter.hh:920\n+Dune::VTKWriter::addVertexData\n+void addVertexData(const std::shared_ptr< const VTKFunction > &p)\n+Add a grid function that lives on the vertices of the grid to the\n+visualization.\n+Definition vtkwriter.hh:713\n+Dune::VTKWriter::VTKFunction\n+Dune::VTKFunction< GridView > VTKFunction\n+Definition vtkwriter.hh:147\n+Dune::VTKWriter::cellEnd\n+CellIterator cellEnd() const\n+Definition vtkwriter.hh:402\n+Dune::VTKWriter::vertexdata\n+std::list< VTKLocalFunction > vertexdata\n+Definition vtkwriter.hh:1589\n+Dune::VTKWriter::cornerBegin\n+CornerIterator cornerBegin() const\n+Definition vtkwriter.hh:613\n+Dune::VTKWriter::getSerialPieceName\n+std::string getSerialPieceName(const std::string &name, const std::string\n+&path) const\n+return name of a serial piece file\n+Definition vtkwriter.hh:940\n+Dune::VTKWriter::addCellData\n+void addCellData(const std::shared_ptr< const VTKFunction > &p)\n+Add a grid function that lives on the cells of the grid to the visualization.\n+Definition vtkwriter.hh:649\n+Dune::VTKWriter::getFormatString\n+std::string getFormatString() const\n+Definition vtkwriter.hh:1217\n+Dune::VTKWriter::checkForPolyhedralCells\n+bool checkForPolyhedralCells() const\n+Definition vtkwriter.hh:1445\n+Dune::VTKWriter::addVertexData\n+void addVertexData(F &&f, VTK::FieldInfo vtkFieldInfo)\n+Add a function by sampling it on the grid vertices.\n+Definition vtkwriter.hh:738\n+Dune::VTKWriter::writeCellData\n+virtual void writeCellData(VTK::VTUWriter &writer)\n+write cell data\n+Definition vtkwriter.hh:1337\n+Dune::VTKWriter::countEntities\n+virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)\n+count the vertices, cells and corners\n+Definition vtkwriter.hh:1239\n+Dune::VTKWriter::getParallelPieceName\n+std::string getParallelPieceName(const std::string &name, const std::string\n+&path, int commRank, int commSize) const\n+return name of a parallel piece file (or header name)\n+Definition vtkwriter.hh:855\n+Dune::VTKWriter::cellBegin\n+CellIterator cellBegin() const\n+Definition vtkwriter.hh:397\n+Dune::VTKWriter::outputtype\n+VTK::OutputType outputtype\n+Definition vtkwriter.hh:1613\n+Dune::VTKWriter::writeGridCells\n+virtual void writeGridCells(VTK::VTUWriter &writer)\n+write the connectivity array\n+Definition vtkwriter.hh:1389\n+Dune::VTKWriter::gridView_\n+GridView gridView_\n+Definition vtkwriter.hh:1592\n+Dune::VTKWriter::writeCellFaces\n+virtual void writeCellFaces(VTK::VTUWriter &writer)\n+write the connectivity array\n+Definition vtkwriter.hh:1459\n+Dune::VTKWriter::fillFaceVertices\n+void fillFaceVertices(CornerIterator it, const CornerIterator end, const\n+IndexSet &indexSet, std::vector< T > &faces, std::vector< T > &faceOffsets)\n+Definition vtkwriter.hh:1498\n+Dune::VTKWriter::celldata\n+std::list< VTKLocalFunction > celldata\n+Definition vtkwriter.hh:1588\n+Dune::VTKWriter::write\n+std::string write(const std::string &name, VTK::OutputType type, const int\n+commRank, const int commSize)\n+write output (interface might change later)\n+Definition vtkwriter.hh:965\n+Dune::VTKWriter::coordPrecision\n+VTK::Precision coordPrecision() const\n+get the precision with which coordinates are written out\n+Definition vtkwriter.hh:782\n+Dune::VTKWriter::FunctionIterator\n+std::list< VTKLocalFunction >::const_iterator FunctionIterator\n+Definition vtkwriter.hh:376\n+Dune::VTKWriter::getDataNames\n+std::tuple< std::string, std::string > getDataNames(const T &data) const\n+Definition vtkwriter.hh:1268\n+Dune::VTKWriter::writeGridPoints\n+virtual void writeGridPoints(VTK::VTUWriter &writer)\n+write the positions of vertices\n+Definition vtkwriter.hh:1365\n+Dune::VTKWriter::writeVertexData\n+virtual void writeVertexData(VTK::VTUWriter &writer)\n+write vertex data\n+Definition vtkwriter.hh:1351\n+Dune::VTKWriter::nvertices\n+int nvertices\n+Definition vtkwriter.hh:1596\n+Dune::VTKWriter::addCellData\n+void addCellData(F &&f, VTK::FieldInfo vtkFieldInfo)\n+Add a function by sampling it on the element centers.\n+Definition vtkwriter.hh:674\n+Dune::VTKWriter::addVertexData\n+void addVertexData(const Container &v, const std::string &name, int ncomps=1,\n+VTK::Precision prec=VTK::Precision::float32)\n+Add a grid function (represented by container) that lives on the vertices of\n+the grid to the visualiz...\n+Definition vtkwriter.hh:760\n+Dune::VTKWriter::~VTKWriter\n+virtual ~VTKWriter()\n+destructor\n+Definition vtkwriter.hh:786\n+Dune::VTKWriter::fillFacesForElement\n+static void fillFacesForElement(const Entity &element, const IndexSet\n+&indexSet, const std::vector< T > &vertices, T &offset, std::vector< T >\n+&faces, std::vector< T > &faceOffsets)\n+Definition vtkwriter.hh:1539\n+Dune::VTKWriter::writeData\n+void writeData(VTK::VTUWriter &writer, const Data &data, const Iterator begin,\n+const Iterator end, int nentries)\n+Definition vtkwriter.hh:1295\n+Dune::VTKWriter::ncells\n+int ncells\n+Definition vtkwriter.hh:1595\n+Dune::VTKWriter::vertexEnd\n+VertexIterator vertexEnd() const\n+Definition vtkwriter.hh:515\n+Dune::VTKWriter::VTKWriter\n+VTKWriter(const GridView &gridView, VTK::DataMode dm=VTK::conforming, VTK::\n+Precision coordPrecision=VTK::Precision::float32)\n+Construct a VTKWriter working on a specific GridView.\n+Definition vtkwriter.hh:636\n+Dune::VTKWriter::pwrite\n+std::string pwrite(const std::string &name, const std::string &path, const\n+std::string &extendpath, VTK::OutputType ot, const int commRank, const int\n+commSize)\n+write output; interface might change later\n+Definition vtkwriter.hh:1043\n+Dune::VTKWriter::pwrite\n+std::string pwrite(const std::string &name, const std::string &path, const\n+std::string &extendpath, VTK::OutputType type=VTK::ascii)\n+write output (interface might change later)\n+Definition vtkwriter.hh:835\n+Dune::VTKWriter::ncorners\n+int ncorners\n+Definition vtkwriter.hh:1597\n+Dune::VTKWriter::VTKLocalFunction\n+Type erasure wrapper for VTK data sets.\n+Definition vtkwriter.hh:156\n+Dune::VTKWriter::VTKLocalFunction::unbind\n+void unbind() const\n+Unbind the data set from the currently bound entity.\n+Definition vtkwriter.hh:360\n+Dune::VTKWriter::VTKLocalFunction::VTKLocalFunction\n+VTKLocalFunction(F &&f, VTK::FieldInfo fieldInfo)\n+Construct a VTKLocalFunction for a dune-functions style LocalFunction.\n+Definition vtkwriter.hh:307\n+Dune::VTKWriter::VTKLocalFunction::name\n+std::string name() const\n+Returns the name of the data set.\n+Definition vtkwriter.hh:342\n+Dune::VTKWriter::VTKLocalFunction::_fieldInfo\n+VTK::FieldInfo _fieldInfo\n+Definition vtkwriter.hh:372\n+Dune::VTKWriter::VTKLocalFunction::Writer\n+VTK::DataArrayWriter Writer\n+Definition vtkwriter.hh:160\n+Dune::VTKWriter::VTKLocalFunction::fieldInfo\n+const VTK::FieldInfo & fieldInfo() const\n+Returns the VTK::FieldInfo for the data set.\n+Definition vtkwriter.hh:348\n+Dune::VTKWriter::VTKLocalFunction::bind\n+void bind(const Entity &e) const\n+Bind the data set to grid entity e.\n+Definition vtkwriter.hh:354\n+Dune::VTKWriter::VTKLocalFunction::VTKLocalFunction\n+VTKLocalFunction(const std::shared_ptr< const VTKFunction > &vtkFunctionPtr)\n+Construct a VTKLocalFunction for a legacy VTKFunction.\n+Definition vtkwriter.hh:331\n+Dune::VTKWriter::VTKLocalFunction::_f\n+std::shared_ptr< FunctionWrapperBase > _f\n+Definition vtkwriter.hh:371\n+Dune::VTKWriter::VTKLocalFunction::write\n+void write(const Coordinate &pos, Writer &w) const\n+Write the value of the data set at local coordinate pos to the writer w.\n+Definition vtkwriter.hh:366\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase\n+Base class for polymorphic container of underlying data set.\n+Definition vtkwriter.hh:164\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::write\n+virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n+=0\n+Evaluate data set at local position pos inside the current entity and write\n+result to w.\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::~FunctionWrapperBase\n+virtual ~FunctionWrapperBase()\n+Definition vtkwriter.hh:178\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::unbind\n+virtual void unbind()=0\n+Unbind data set from current grid entity - mostly here for performance and\n+symmetry reasons.\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::bind\n+virtual void bind(const Entity &e)=0\n+Bind data set to grid entity - must be called before evaluating (i.e. calling\n+write())\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapper\n+Type erasure implementation for functions conforming to the dune-functions\n+LocalFunction interface.\n+Definition vtkwriter.hh:188\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::Function\n+typename std::decay< F >::type Function\n+Definition vtkwriter.hh:189\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::FunctionWrapper\n+FunctionWrapper(F_ &&f)\n+Definition vtkwriter.hh:192\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::write\n+virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n+Evaluate data set at local position pos inside the current entity and write\n+result to w.\n+Definition vtkwriter.hh:206\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::unbind\n+virtual void unbind()\n+Unbind data set from current grid entity - mostly here for performance and\n+symmetry reasons.\n+Definition vtkwriter.hh:201\n+Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::bind\n+virtual void bind(const Entity &e)\n+Bind data set to grid entity - must be called before evaluating (i.e. calling\n+write())\n+Definition vtkwriter.hh:196\n+Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper\n+Type erasure implementation for C++ functions, i.e., functions that can be\n+evaluated in global coordi...\n+Definition vtkwriter.hh:236\n+Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::GlobalFunctionWrapper\n+GlobalFunctionWrapper(F_ &&f)\n+Definition vtkwriter.hh:240\n+Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::unbind\n+virtual void unbind()\n+Unbind data set from current grid entity - mostly here for performance and\n+symmetry reasons.\n+Definition vtkwriter.hh:250\n+Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::Function\n+typename std::decay< F >::type Function\n+Definition vtkwriter.hh:237\n+Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::write\n+virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n+Evaluate data set at local position pos inside the current entity and write\n+result to w.\n+Definition vtkwriter.hh:255\n+Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::bind\n+virtual void bind(const Entity &e)\n+Bind data set to grid entity - must be called before evaluating (i.e. calling\n+write())\n+Definition vtkwriter.hh:245\n+Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper\n+Type erasure implementation for legacy VTKFunctions.\n+Definition vtkwriter.hh:276\n+Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::unbind\n+virtual void unbind()\n+Unbind data set from current grid entity - mostly here for performance and\n+symmetry reasons.\n+Definition vtkwriter.hh:287\n+Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::VTKFunctionWrapper\n+VTKFunctionWrapper(const std::shared_ptr< const VTKFunction > &f)\n+Definition vtkwriter.hh:277\n+Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::write\n+virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n+Evaluate data set at local position pos inside the current entity and write\n+result to w.\n+Definition vtkwriter.hh:292\n+Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::bind\n+virtual void bind(const Entity &e)\n+Bind data set to grid entity - must be called before evaluating (i.e. calling\n+write())\n+Definition vtkwriter.hh:282\n+Dune::VTKWriter::CellIterator\n+Iterator over the grids elements.\n+Definition vtkwriter.hh:385\n+Dune::VTKWriter::CellIterator::CellIterator\n+CellIterator(const GridCellIterator &x)\n+construct a CellIterator from the gridview's Iterator.\n+Definition vtkwriter.hh:388\n+Dune::VTKWriter::CellIterator::position\n+const FieldVector< DT, n > position() const\n+Definition vtkwriter.hh:391\n+Dune::VTKWriter::VertexIterator\n+Iterate over the grid's vertices.\n+Definition vtkwriter.hh:424\n+Dune::VTKWriter::VertexIterator::VertexIterator\n+VertexIterator(const GridCellIterator &x, const GridCellIterator &end, const\n+VTK::DataMode &dm, const VertexMapper &vm)\n+Definition vtkwriter.hh:457\n+Dune::VTKWriter::VertexIterator::basicIncrement\n+void basicIncrement()\n+Definition vtkwriter.hh:440\n+Dune::VTKWriter::VertexIterator::increment\n+void increment()\n+Definition vtkwriter.hh:468\n+Dune::VTKWriter::VertexIterator::dereference\n+EntityReference dereference() const\n+Definition vtkwriter.hh:491\n+Dune::VTKWriter::VertexIterator::equals\n+bool equals(const VertexIterator &cit) const\n+Definition vtkwriter.hh:485\n+Dune::VTKWriter::VertexIterator::position\n+FieldVector< DT, n > position() const\n+position of vertex inside the entity\n+Definition vtkwriter.hh:501\n+Dune::VTKWriter::VertexIterator::localindex\n+int localindex() const\n+index of vertex within the entity, in Dune-numbering\n+Definition vtkwriter.hh:496\n+Dune::VTKWriter::CornerIterator\n+Iterate over the elements' corners.\n+Definition vtkwriter.hh:539\n+Dune::VTKWriter::CornerIterator::increment\n+void increment()\n+Definition vtkwriter.hh:566\n+Dune::VTKWriter::CornerIterator::CornerIterator\n+CornerIterator(const GridCellIterator &x, const GridCellIterator &end, const\n+VTK::DataMode &dm, const VertexMapper &vm, const std::vector< int > &num)\n+Definition vtkwriter.hh:558\n+Dune::VTKWriter::CornerIterator::id\n+int id() const\n+Process-local consecutive zero-starting vertex id.\n+Definition vtkwriter.hh:597\n+Dune::VTKWriter::CornerIterator::dereference\n+EntityReference dereference() const\n+Definition vtkwriter.hh:588\n+Dune::VTKWriter::CornerIterator::equals\n+bool equals(const CornerIterator &cit) const\n+Definition vtkwriter.hh:582\n+Dune::VTK::VTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition vtuwriter.hh:98\n+Dune::VTK::VTUWriter::makeArrayWriter\n+DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n+unsigned nitems, Precision prec)\n+acquire a DataArrayWriter\n+Definition vtuwriter.hh:380\n+Dune::VTK::VTUWriter::endCellData\n+void endCellData()\n+finish CellData section\n+Definition vtuwriter.hh:220\n+Dune::VTK::VTUWriter::beginCells\n+void beginCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:274\n+Dune::VTK::VTUWriter::endPointData\n+void endPointData()\n+finish PointData section\n+Definition vtuwriter.hh:182\n+Dune::VTK::VTUWriter::beginCellData\n+void beginCellData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start CellData section\n+Definition vtuwriter.hh:205\n+Dune::VTK::VTUWriter::beginPointData\n+void beginPointData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start PointData section\n+Definition vtuwriter.hh:167\n+Dune::VTK::VTUWriter::endPoints\n+void endPoints()\n+finish section for the point coordinates\n+Definition vtuwriter.hh:249\n+Dune::VTK::VTUWriter::endCells\n+void endCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:285\n+Dune::VTK::VTUWriter::beginPoints\n+void beginPoints()\n+start section for the point coordinates\n+Definition vtuwriter.hh:238\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00791.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00791.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: interval.hh File Reference\n+dune-grid: dataarraywriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,52 +65,78 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    interval.hh File Reference
    \n+Namespaces
    \n+
    dataarraywriter.hh File Reference
    \n \n
    \n-
    #include <iostream>
    \n-#include <vector>
    \n-#include <array>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+\n+

    Data array writers for the VTKWriter. \n+More...

    \n+
    #include <cstdint>
    \n+#include <iostream>
    \n+#include <string>
    \n+#include <iomanip>
    \n+#include <cmath>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/indent.hh>
    \n+#include <dune/grid/io/file/vtk/streams.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::dgf::IntervalBlock
    class  Dune::VTK::DataArrayWriter
     base class for data array writers More...
     
    class  Dune::VTK::AsciiDataArrayWriter
     a streaming writer for data array tags, uses ASCII inline format More...
     
    class  Dune::VTK::BinaryDataArrayWriter
     a streaming writer for data array tags, uses binary inline format More...
     
    class  Dune::VTK::AppendedRawDataArrayWriter
     a streaming writer for data array tags, uses appended raw format More...
     
    struct  Dune::dgf::IntervalBlock::Interval
    class  Dune::VTK::AppendedBase64DataArrayWriter
     a streaming writer for data array tags, uses appended base64 format More...
     
    class  Dune::VTK::NakedBase64DataArrayWriter
     a streaming writer for appended data array tags, uses base64 format More...
     
    class  Dune::VTK::NakedRawDataArrayWriter
     a streaming writer for appended data arrays, uses raw format More...
     
    class  Dune::VTK::DataArrayWriterFactory
     a factory for DataArrayWriters More...
     
    \n \n \n \n \n-\n+\n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n-\n-\n-\n

    \n-Functions

    std::ostream & Dune::dgf::operator<< (std::ostream &out, const IntervalBlock::Interval &interval)
     
    \n-
    \n+

    Detailed Description

    \n+

    Data array writers for the VTKWriter.

    \n+
    Author
    Peter Bastian, Christian Engwer
    \n+

    This file contains classes to help writing data in the difeerent VTK output modes

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,33 +2,65 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Classes | Namespaces | Functions\n-interval.hh File Reference\n+ * vtk\n+Classes | Namespaces\n+dataarraywriter.hh File Reference\n+Data array writers for the VTKWriter. 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 \u00a0 Dune::dgf::IntervalBlock\n+class \u00a0 Dune::VTK::DataArrayWriter\n+\u00a0 base class for data array writers More...\n \u00a0\n-struct \u00a0 Dune::dgf::IntervalBlock::Interval\n+class \u00a0 Dune::VTK::AsciiDataArrayWriter\n+\u00a0 a streaming writer for data array tags, uses ASCII inline format\n+ More...\n+\u00a0\n+class \u00a0 Dune::VTK::BinaryDataArrayWriter\n+\u00a0 a streaming writer for data array tags, uses binary inline format\n+ More...\n+\u00a0\n+class \u00a0 Dune::VTK::AppendedRawDataArrayWriter\n+\u00a0 a streaming writer for data array tags, uses appended raw format\n+ More...\n+\u00a0\n+class \u00a0 Dune::VTK::AppendedBase64DataArrayWriter\n+\u00a0 a streaming writer for data array tags, uses appended base64 format\n+ More...\n+\u00a0\n+class \u00a0 Dune::VTK::NakedBase64DataArrayWriter\n+\u00a0 a streaming writer for appended data array tags, uses base64 format\n+ More...\n+\u00a0\n+class \u00a0 Dune::VTK::NakedRawDataArrayWriter\n+\u00a0 a streaming writer for appended data arrays, uses raw format More...\n+\u00a0\n+class \u00a0 Dune::VTK::DataArrayWriterFactory\n+\u00a0 a factory for DataArrayWriters More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n-Functions\n-std::ostream &\u00a0 Dune::dgf::operator<< (std::ostream &out, const IntervalBlock::\n- Interval &interval)\n+namespace \u00a0 Dune::VTK\n \u00a0\n+***** Detailed Description *****\n+Data array writers for the VTKWriter.\n+ Author\n+ Peter Bastian, Christian Engwer\n+This file contains classes to help writing data in the difeerent VTK output\n+modes\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00791_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00791_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: interval.hh Source File\n+dune-grid: dataarraywriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,210 +70,526 @@\n \n \n \n \n \n \n \n
    \n-
    interval.hh
    \n+
    dataarraywriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_INTERVALBLOCK_HH
    \n-
    6#define DUNE_DGF_INTERVALBLOCK_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n-
    10#include <array>
    \n-
    11
    \n-\n-
    13
    \n-
    14
    \n-
    15namespace Dune
    \n-
    16{
    \n-
    17
    \n-
    18 namespace dgf
    \n-
    19 {
    \n-
    20
    \n-
    \n-\n-
    22 : public BasicBlock
    \n-
    23 {
    \n-
    \n-
    24 struct Interval
    \n-
    25 {
    \n-\n-
    \n-
    27 Interval( const Interval& interval, const std::vector<int>& map )
    \n-
    28 {
    \n-
    29 copy( interval, map );
    \n-
    30 }
    \n-
    \n-
    \n-
    31 void copy(const Interval& interval, const std::vector<int>& map )
    \n-
    32 {
    \n-
    33 const int size = map.size();
    \n-
    34 p[0].resize( size );
    \n-
    35 p[1].resize( size );
    \n-
    36 n.resize( size );
    \n-
    37 h.resize( size );
    \n-
    38 assert( size == int(interval.n.size()) );
    \n-
    39 for( int i=0; i<size; ++i )
    \n-
    40 {
    \n-
    41 p[ 0 ][ i ] = interval.p[ 0 ][ map[ i ] ];
    \n-
    42 p[ 1 ][ i ] = interval.p[ 1 ][ map[ i ] ];
    \n-
    43 n[ i ] = interval.n[ map[ i ] ];
    \n-
    44 h[ i ] = interval.h[ map[ i ] ];
    \n-
    45 }
    \n-
    46 }
    \n-
    \n-
    47 std::array< std::vector< double >, 2 > p; // lower and upper boundary points
    \n-
    48 std::vector< double > h; // width of the cells in each direction
    \n-
    49 std::vector< int > n; // number of cells in each direction
    \n-
    50 };
    \n-
    \n-
    51
    \n-
    52 private:
    \n-
    53 std::vector< Interval > intervals_;
    \n-
    54 std::vector< int > map_;
    \n-
    55 bool good_; //data read correctly
    \n-
    56 int dimw_; //dimension of world
    \n-
    57
    \n-
    58 public:
    \n-
    59 explicit IntervalBlock ( std::istream &in );
    \n-
    60
    \n-
    \n-
    61 void get ( std::vector< std::vector< double > > &vtx, int &nofvtx,
    \n-
    62 std::vector< std::vector< unsigned int > > &simplex, int &nofsimpl )
    \n-
    63 {
    \n-
    64 for( size_t i = 0; i < intervals_.size(); ++i )
    \n-
    65 {
    \n-
    66 int oldvtx = nofvtx;
    \n-
    67 nofvtx += getVtx( i, vtx );
    \n-
    68 nofsimpl += getHexa( i, simplex, oldvtx );
    \n-
    69 }
    \n-
    70 }
    \n-
    \n-
    71
    \n-
    \n-
    72 void get ( std::vector< std::vector< double > > &vtx, int &nofvtx )
    \n-
    73 {
    \n-
    74 for( size_t i = 0; i < intervals_.size(); ++i )
    \n-
    75 nofvtx += getVtx( i, vtx );
    \n-
    76 }
    \n-
    \n-
    77
    \n-
    \n-
    78 const Interval &get ( int block ) const
    \n-
    79 {
    \n-
    80 return intervals_[ block ];
    \n-
    81 }
    \n-
    \n-
    82
    \n-
    \n-
    83 int numIntervals () const
    \n-
    84 {
    \n-
    85 return intervals_.size();
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH
    \n+
    8
    \n+
    9#include <cstdint>
    \n+
    10#include <iostream>
    \n+
    11#include <string>
    \n+
    12#include <iomanip>
    \n+
    13#include <cstdint>
    \n+
    14#include <cmath>
    \n+
    15
    \n+
    16#include <dune/common/exceptions.hh>
    \n+
    17#include <dune/common/indent.hh>
    \n+
    18
    \n+\n+\n+
    21
    \n+
    30namespace Dune
    \n+
    31{
    \n+
    34
    \n+
    35 namespace VTK {
    \n+
    36
    \n+
    38
    \n+
    \n+\n+
    56 {
    \n+
    57 public:
    \n+
    59
    \n+
    \n+\n+
    64 : prec(_prec)
    \n+
    65 {}
    \n+
    \n+
    66
    \n+
    68 template<class T>
    \n+
    \n+
    69 void write(T data)
    \n+
    70 {
    \n+
    71 switch(prec)
    \n+
    72 {
    \n+\n+
    74 writeFloat32(data); break;
    \n+\n+
    76 writeFloat64(data); break;
    \n+\n+
    78 writeUInt32(data); break;
    \n+\n+
    80 writeUInt8(data); break;
    \n+\n+
    82 writeInt32(data); break;
    \n+
    83 default:
    \n+
    84 DUNE_THROW(Dune::NotImplemented, "Unknown precision type");
    \n+
    85 }
    \n
    86 }
    \n
    \n
    87
    \n-
    \n-
    88 int dimw () const
    \n-
    89 {
    \n-
    90 return dimw_;
    \n-
    91 }
    \n-
    \n+
    89 virtual bool writeIsNoop() const { return false; }
    \n+
    91 virtual ~DataArrayWriter () {}
    \n
    92
    \n-
    93 int getVtx ( int block, std::vector< std::vector< double > > &vtx ) const;
    \n-
    94 int getHexa ( int block, std::vector< std::vector< unsigned int > > &cubes,
    \n-
    95 int offset = 0 ) const;
    \n-
    96
    \n-
    \n-
    97 int nofvtx ( int block ) const
    \n-
    98 {
    \n-
    99 const Interval &interval = get( block );
    \n-
    100 int n = 1;
    \n-
    101 for( int i = 0; i < dimw_; ++i )
    \n-
    102 n *= (interval.n[ i ] + 1);
    \n-
    103 return n;
    \n-
    104 }
    \n-
    \n-
    105
    \n-
    \n-
    106 int nofhexa ( int block ) const
    \n-
    107 {
    \n-
    108 const Interval &interval = get( block );
    \n-
    109 int n = 1;
    \n-
    110 for( int i = 0; i < dimw_; ++i )
    \n-
    111 n *= interval.n[ i ];
    \n-
    112 return n;
    \n-
    113 }
    \n-
    \n-
    114
    \n-
    115 private:
    \n-
    116 template< class T >
    \n-
    117 void parseLine ( std::vector< T > &v );
    \n-
    118
    \n-
    119 bool next ();
    \n-
    120 };
    \n-
    \n-
    121
    \n-
    \n-
    122 inline std::ostream &
    \n-
    123 operator<< ( std::ostream &out, const IntervalBlock::Interval &interval )
    \n-
    124 {
    \n-
    125 if( interval.p[ 0 ].empty() || interval.p[ 1 ].empty() || interval.n.empty() )
    \n-
    126 return out << "Interval {}";
    \n-
    127
    \n-
    128 out << "Interval { p0 = (" << interval.p[ 0 ][ 0 ];
    \n-
    129 for( size_t i = 1; i < interval.p[ 0 ].size(); ++i )
    \n-
    130 out << ", " << interval.p[ 0 ][ i ];
    \n-
    131 out << "), p1 = (" << interval.p[ 1 ][ 0 ];
    \n-
    132 for( size_t i = 1; i < interval.p[ 1 ].size(); ++i )
    \n-
    133 out << ", " << interval.p[ 1 ][ i ];
    \n-
    134 out << "), n = (" << interval.n[ 0 ];
    \n-
    135 for( size_t i = 1; i < interval.n.size(); ++i )
    \n-
    136 out << ", " << interval.n[ i ];
    \n-
    137 return out << ") }";
    \n-
    138 }
    \n+
    93 private:
    \n+
    95 virtual void writeFloat32 (float data) = 0;
    \n+
    97 virtual void writeFloat64 (double data) = 0;
    \n+
    99 virtual void writeInt32 (std::int32_t data) = 0;
    \n+
    101 virtual void writeUInt8 (std::uint8_t data) = 0;
    \n+
    103 virtual void writeUInt32 (std::uint32_t data) = 0;
    \n+
    104
    \n+
    105 Precision prec;
    \n+
    106 };
    \n+
    \n+
    107
    \n+
    \n+\n+
    110 {
    \n+
    111 public:
    \n+
    113
    \n+
    \n+
    121 AsciiDataArrayWriter(std::ostream& theStream, std::string name,
    \n+
    122 int ncomps, const Indent& indent_, Precision prec_)
    \n+
    123 : DataArrayWriter(prec_), s(theStream), counter(0), numPerLine(12), indent(indent_)
    \n+
    124 {
    \n+
    125 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n+
    126 << "Name=\\"" << name << "\\" ";
    \n+
    127 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n+
    128 s << "format=\\"ascii\\">\\n";
    \n+
    129 ++indent;
    \n+
    130 }
    \n+
    \n+
    131
    \n+
    \n+\n+
    134 {
    \n+
    135 if (counter%numPerLine!=0) s << "\\n";
    \n+
    136 --indent;
    \n+
    137 s << indent << "</DataArray>\\n";
    \n+
    138 }
    \n
    \n
    139
    \n-
    140 } // end namespace dgf
    \n-
    141
    \n-
    142} // end namespace Dune
    \n-
    143
    \n-
    144#endif
    \n-\n+
    140 private:
    \n+
    142 void writeFloat64 (double data) final
    \n+
    143 { write_float(data); }
    \n+
    145 void writeFloat32 (float data) final
    \n+
    146 { write_float(data); }
    \n+
    148 void writeInt32 (std::int32_t data) final
    \n+
    149 { write_(data); }
    \n+
    151 void writeUInt32 (std::uint32_t data) final
    \n+
    152 { write_(data); }
    \n+
    154 void writeUInt8 (std::uint8_t data) final
    \n+
    155 { write_(data); }
    \n+
    156
    \n+
    157 template<class T>
    \n+
    158 void write_(T data)
    \n+
    159 {
    \n+
    160 typedef typename PrintType<T>::Type PT;
    \n+
    161 if(counter%numPerLine==0) s << indent;
    \n+
    162 else s << " ";
    \n+
    163 const auto original_precision = std::cout.precision();
    \n+
    164 s << std::setprecision(std::numeric_limits<PT>::digits10) << (PT) data;
    \n+
    165 std::cout.precision(original_precision);
    \n+
    166 counter++;
    \n+
    167 if (counter%numPerLine==0) s << "\\n";
    \n+
    168 }
    \n+
    169
    \n+
    170 template<class T>
    \n+
    171 void write_float(T data)
    \n+
    172 {
    \n+
    173 typedef typename PrintType<T>::Type PT;
    \n+
    174 if(counter%numPerLine==0) s << indent;
    \n+
    175 else s << " ";
    \n+
    176 PT out_data = (PT) data;
    \n+
    177 if (std::fpclassify(out_data) == FP_SUBNORMAL)
    \n+
    178 {
    \n+
    179 // truncate denormalized data to 0 to avoid Paraview segfaults on macOS
    \n+
    180 out_data = 0;
    \n+
    181 }
    \n+
    182 const auto original_precision = std::cout.precision();
    \n+
    183 s << std::setprecision(std::numeric_limits<PT>::digits10) << out_data;
    \n+
    184 std::cout.precision(original_precision);
    \n+
    185 counter++;
    \n+
    186 if (counter%numPerLine==0) s << "\\n";
    \n+
    187 }
    \n+
    188
    \n+
    189 std::ostream& s;
    \n+
    190 int counter;
    \n+
    191 int numPerLine;
    \n+
    192 Indent indent;
    \n+
    193 };
    \n+
    \n+
    194
    \n+
    \n+\n+
    197 {
    \n+
    198 public:
    \n+
    200
    \n+
    \n+
    210 BinaryDataArrayWriter(std::ostream& theStream, std::string name,
    \n+
    211 int ncomps, int nitems, const Indent& indent_, Precision prec_)
    \n+
    212 : DataArrayWriter(prec_), s(theStream), b64(theStream), indent(indent_)
    \n+
    213 {
    \n+
    214 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n+
    215 << "Name=\\"" << name << "\\" ";
    \n+
    216 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n+
    217 s << "format=\\"binary\\">\\n";
    \n+
    218
    \n+
    219 // write indentation for the data chunk
    \n+
    220 s << indent+1;
    \n+
    221 // store size, needs to be exactly 32 bit
    \n+
    222 std::uint32_t size = ncomps*nitems*typeSize(prec_);
    \n+
    223 b64.write(size);
    \n+
    224 b64.flush();
    \n+
    225 }
    \n+
    \n+
    226
    \n+
    \n+\n+
    229 {
    \n+
    230 b64.flush();
    \n+
    231 // append newline to written data
    \n+
    232 s << "\\n";
    \n+
    233 s << indent << "</DataArray>\\n";
    \n+
    234 s.flush();
    \n+
    235 }
    \n+
    \n+
    236
    \n+
    237 private:
    \n+
    239 void writeFloat64 (double data) final
    \n+
    240 { write_(data); }
    \n+
    242 void writeFloat32 (float data) final
    \n+
    243 { write_(data); }
    \n+
    245 void writeInt32 (std::int32_t data) final
    \n+
    246 { write_(data); }
    \n+
    248 void writeUInt32 (std::uint32_t data) final
    \n+
    249 { write_(data); }
    \n+
    251 void writeUInt8 (std::uint8_t data) final
    \n+
    252 { write_(data); }
    \n+
    253
    \n+
    255 template<class T>
    \n+
    256 void write_(T data)
    \n+
    257 {
    \n+
    258 b64.write(data);
    \n+
    259 }
    \n+
    260
    \n+
    261 std::ostream& s;
    \n+
    262 Base64Stream b64;
    \n+
    263 const Indent& indent;
    \n+
    264 };
    \n+
    \n+
    265
    \n+
    \n+\n+
    268 {
    \n+
    269 public:
    \n+
    271
    \n+
    \n+
    283 AppendedRawDataArrayWriter(std::ostream& s, std::string name,
    \n+
    284 int ncomps, unsigned nitems, unsigned& offset,
    \n+
    285 const Indent& indent, Precision prec_)
    \n+
    286 : DataArrayWriter(prec_)
    \n+
    287 {
    \n+
    288 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n+
    289 << "Name=\\"" << name << "\\" ";
    \n+
    290 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n+
    291 s << "format=\\"appended\\" offset=\\""<< offset << "\\" />\\n";
    \n+
    292 offset += 4; // header
    \n+
    293 offset += ncomps*nitems*typeSize(prec_);
    \n+
    294 }
    \n+
    \n+
    295
    \n+
    297 bool writeIsNoop() const { return true; }
    \n+
    298
    \n+
    299 private:
    \n+
    301 void writeFloat64 (double) final {}
    \n+
    302 void writeFloat32 (float) final {}
    \n+
    303 void writeInt32 (std::int32_t) final {}
    \n+
    304 void writeUInt32 (std::uint32_t) final {}
    \n+
    305 void writeUInt8 (std::uint8_t) final {}
    \n+
    306 };
    \n+
    \n+
    307
    \n+
    \n+\n+
    310 {
    \n+
    311 public:
    \n+
    313
    \n+
    \n+
    325 AppendedBase64DataArrayWriter(std::ostream& s, std::string name,
    \n+
    326 int ncomps, unsigned nitems,
    \n+
    327 unsigned& offset, const Indent& indent, Precision prec_)
    \n+
    328 : DataArrayWriter(prec_)
    \n+
    329 {
    \n+
    330 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n+
    331 << "Name=\\"" << name << "\\" ";
    \n+
    332 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n+
    333 s << "format=\\"appended\\" offset=\\""<< offset << "\\" />\\n";
    \n+
    334 offset += 8; // header
    \n+
    335 std::size_t bytes = ncomps*nitems*typeSize(prec_);
    \n+
    336 offset += bytes/3*4;
    \n+
    337 if(bytes%3 != 0)
    \n+
    338 offset += 4;
    \n+
    339 }
    \n+
    \n+
    340
    \n+
    342 bool writeIsNoop() const { return true; }
    \n+
    343
    \n+
    344 private:
    \n+
    346 void writeFloat64 (double) final {}
    \n+
    347 void writeFloat32 (float) final {}
    \n+
    348 void writeInt32 (std::int32_t) final {}
    \n+
    349 void writeUInt32 (std::uint32_t) final {}
    \n+
    350 void writeUInt8 (std::uint8_t) final {}
    \n+
    351 };
    \n+
    \n+
    352
    \n+
    354 //
    \n+
    355 // Naked ArrayWriters for the appended section
    \n+
    356 //
    \n+
    357
    \n+
    \n+\n+
    360 {
    \n+
    361 public:
    \n+
    363
    \n+
    \n+
    369 NakedBase64DataArrayWriter(std::ostream& theStream, int ncomps,
    \n+
    370 int nitems, Precision prec_)
    \n+
    371 : DataArrayWriter(prec_), b64(theStream)
    \n+
    372 {
    \n+
    373 // store size
    \n+
    374 std::uint32_t size = ncomps*nitems*typeSize(prec_);
    \n+
    375 b64.write(size);
    \n+
    376 b64.flush();
    \n+
    377 }
    \n+
    \n+
    378
    \n+
    379 private:
    \n+
    381 void writeFloat64 (double data) final
    \n+
    382 { write_(data); }
    \n+
    384 void writeFloat32 (float data) final
    \n+
    385 { write_(data); }
    \n+
    387 void writeInt32 (std::int32_t data) final
    \n+
    388 { write_(data); }
    \n+
    390 void writeUInt32 (std::uint32_t data) final
    \n+
    391 { write_(data); }
    \n+
    393 void writeUInt8 (std::uint8_t data) final
    \n+
    394 { write_(data); }
    \n+
    395
    \n+
    397 template<class T>
    \n+
    398 void write_(T data)
    \n+
    399 {
    \n+
    400 b64.write(data);
    \n+
    401 }
    \n+
    402
    \n+
    403 Base64Stream b64;
    \n+
    404 };
    \n+
    \n+
    405
    \n+
    \n+\n+
    408 {
    \n+
    409 RawStream s;
    \n+
    410
    \n+
    411 public:
    \n+
    413
    \n+
    \n+
    419 NakedRawDataArrayWriter(std::ostream& theStream, int ncomps,
    \n+
    420 int nitems, Precision prec_)
    \n+
    421 : DataArrayWriter(prec_), s(theStream)
    \n+
    422 {
    \n+
    423 s.write((unsigned int)(ncomps*nitems*typeSize(prec_)));
    \n+
    424 }
    \n+
    \n+
    425
    \n+
    426 private:
    \n+
    428 void writeFloat64 (double data) final
    \n+
    429 { write_(data); }
    \n+
    431 void writeFloat32 (float data) final
    \n+
    432 { write_(data); }
    \n+
    434 void writeInt32 (std::int32_t data) final
    \n+
    435 { write_(data); }
    \n+
    437 void writeUInt32 (std::uint32_t data) final
    \n+
    438 { write_(data); }
    \n+
    440 void writeUInt8 (std::uint8_t data) final
    \n+
    441 { write_(data); }
    \n+
    442
    \n+
    444 template<class T>
    \n+
    445 void write_(T data)
    \n+
    446 {
    \n+
    447 s.write(data);
    \n+
    448 }
    \n+
    449 };
    \n+
    \n+
    450
    \n+
    452 //
    \n+
    453 // Factory
    \n+
    454 //
    \n+
    455
    \n+
    457
    \n+
    \n+\n+
    463 enum Phase { main, appended };
    \n+
    464
    \n+
    465 OutputType type;
    \n+
    466 std::ostream& stream;
    \n+
    467 unsigned offset;
    \n+
    469 Phase phase;
    \n+
    470
    \n+
    471 public:
    \n+
    473
    \n+
    \n+
    482 inline DataArrayWriterFactory(OutputType type_, std::ostream& stream_)
    \n+
    483 : type(type_), stream(stream_), offset(0), phase(main)
    \n+
    484 { }
    \n+
    \n+
    485
    \n+
    487
    \n+
    \n+
    497 inline bool beginAppended() {
    \n+
    498 phase = appended;
    \n+
    499 switch(type) {
    \n+
    500 case ascii : return false;
    \n+
    501 case base64 : return false;
    \n+
    502 case appendedraw : return true;
    \n+
    503 case appendedbase64 : return true;
    \n+
    504 }
    \n+
    505 DUNE_THROW(IOError, "Dune::VTK::DataArrayWriter: unsupported "
    \n+
    506 "OutputType " << type);
    \n+
    507 }
    \n+
    \n+
    508
    \n+
    \n+
    510 const std::string& appendedEncoding() const {
    \n+
    511 static const std::string rawString = "raw";
    \n+
    512 static const std::string base64String = "base64";
    \n+
    513
    \n+
    514 switch(type) {
    \n+
    515 case ascii :
    \n+
    516 case base64 :
    \n+
    517 DUNE_THROW(IOError, "DataArrayWriterFactory::appendedEncoding(): No "
    \n+
    518 "appended encoding for OutputType " << type);
    \n+
    519 case appendedraw : return rawString;
    \n+
    520 case appendedbase64 : return base64String;
    \n+
    521 }
    \n+
    522 DUNE_THROW(IOError, "DataArrayWriterFactory::appendedEncoding(): "
    \n+
    523 "unsupported OutputType " << type);
    \n+
    524 }
    \n+
    \n+
    525
    \n+
    527
    \n+
    \n+
    541 DataArrayWriter* make(const std::string& name, unsigned ncomps,
    \n+
    542 unsigned nitems, const Indent& indent,
    \n+
    543 Precision prec)
    \n+
    544 {
    \n+
    545 switch(phase) {
    \n+
    546 case main :
    \n+
    547 switch(type) {
    \n+
    548 case ascii :
    \n+
    549 return new AsciiDataArrayWriter(stream, name, ncomps, indent, prec);
    \n+
    550 case base64 :
    \n+
    551 return new BinaryDataArrayWriter(stream, name, ncomps, nitems,
    \n+
    552 indent, prec);
    \n+
    553 case appendedraw :
    \n+
    554 return new AppendedRawDataArrayWriter(stream, name, ncomps,
    \n+
    555 nitems, offset, indent, prec);
    \n+
    556 case appendedbase64 :
    \n+
    557 return new AppendedBase64DataArrayWriter(stream, name, ncomps,
    \n+
    558 nitems, offset,
    \n+
    559 indent, prec);
    \n+
    560 }
    \n+
    561 break;
    \n+
    562 case appended :
    \n+
    563 switch(type) {
    \n+
    564 case ascii :
    \n+
    565 case base64 :
    \n+
    566 break; // invalid in appended mode
    \n+
    567 case appendedraw :
    \n+
    568 return new NakedRawDataArrayWriter(stream, ncomps, nitems, prec);
    \n+
    569 case appendedbase64 :
    \n+
    570 return new NakedBase64DataArrayWriter(stream, ncomps, nitems, prec);
    \n+
    571 }
    \n+
    572 break;
    \n+
    573 }
    \n+
    574 DUNE_THROW(IOError, "Dune::VTK::DataArrayWriter: unsupported "
    \n+
    575 "OutputType " << type << " in phase " << phase);
    \n+
    576 }
    \n+
    \n+
    577 };
    \n+
    \n+
    578
    \n+
    579 } // namespace VTK
    \n+
    580
    \n+
    582
    \n+
    583} // namespace Dune
    \n+
    584
    \n+
    585#endif // DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH
    \n+\n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval &interval)
    Definition interval.hh:123
    \n-
    Definition basic.hh:31
    \n-
    Definition interval.hh:23
    \n-
    void get(std::vector< std::vector< double > > &vtx, int &nofvtx, std::vector< std::vector< unsigned int > > &simplex, int &nofsimpl)
    Definition interval.hh:61
    \n-
    int numIntervals() const
    Definition interval.hh:83
    \n-
    int getVtx(int block, std::vector< std::vector< double > > &vtx) const
    Definition interval.cc:83
    \n-
    const Interval & get(int block) const
    Definition interval.hh:78
    \n-
    int getHexa(int block, std::vector< std::vector< unsigned int > > &cubes, int offset=0) const
    Definition interval.cc:121
    \n-
    int nofhexa(int block) const
    Definition interval.hh:106
    \n-
    int dimw() const
    Definition interval.hh:88
    \n-
    int nofvtx(int block) const
    Definition interval.hh:97
    \n-
    void get(std::vector< std::vector< double > > &vtx, int &nofvtx)
    Definition interval.hh:72
    \n-
    Definition interval.hh:25
    \n-
    Interval()
    Definition interval.hh:26
    \n-
    std::array< std::vector< double >, 2 > p
    Definition interval.hh:47
    \n-
    std::vector< int > n
    Definition interval.hh:49
    \n-
    Interval(const Interval &interval, const std::vector< int > &map)
    Definition interval.hh:27
    \n-
    void copy(const Interval &interval, const std::vector< int > &map)
    Definition interval.hh:31
    \n-
    std::vector< double > h
    Definition interval.hh:48
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+\n+\n+\n+\n+
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n+
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n+
    @ appendedraw
    Output is to the file is appended raw binary.
    Definition common.hh:49
    \n+
    @ appendedbase64
    Output is to the file is appended base64 binary.
    Definition common.hh:51
    \n+
    @ base64
    Output to the file is inline base64 binary.
    Definition common.hh:47
    \n+
    std::string toString(Precision p)
    map precision to VTK type name
    Definition common.hh:280
    \n+
    std::size_t typeSize(Precision p)
    map precision to byte size
    Definition common.hh:300
    \n+
    T Type
    type to convert T to before putting it into a stream with <<
    Definition common.hh:97
    \n+
    base class for data array writers
    Definition dataarraywriter.hh:56
    \n+
    void write(T data)
    write one element of data
    Definition dataarraywriter.hh:69
    \n+
    DataArrayWriter(Precision _prec)
    construct a data array writer
    Definition dataarraywriter.hh:63
    \n+
    virtual bool writeIsNoop() const
    whether calls to write may be skipped
    Definition dataarraywriter.hh:89
    \n+
    virtual ~DataArrayWriter()
    virtual destructor
    Definition dataarraywriter.hh:91
    \n+
    a streaming writer for data array tags, uses ASCII inline format
    Definition dataarraywriter.hh:110
    \n+
    ~AsciiDataArrayWriter()
    finish output; writes end tag
    Definition dataarraywriter.hh:133
    \n+
    AsciiDataArrayWriter(std::ostream &theStream, std::string name, int ncomps, const Indent &indent_, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:121
    \n+
    a streaming writer for data array tags, uses binary inline format
    Definition dataarraywriter.hh:197
    \n+
    ~BinaryDataArrayWriter()
    finish output; writes end tag
    Definition dataarraywriter.hh:228
    \n+
    BinaryDataArrayWriter(std::ostream &theStream, std::string name, int ncomps, int nitems, const Indent &indent_, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:210
    \n+
    a streaming writer for data array tags, uses appended raw format
    Definition dataarraywriter.hh:268
    \n+
    AppendedRawDataArrayWriter(std::ostream &s, std::string name, int ncomps, unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:283
    \n+
    bool writeIsNoop() const
    whether calls to write may be skipped
    Definition dataarraywriter.hh:297
    \n+
    a streaming writer for data array tags, uses appended base64 format
    Definition dataarraywriter.hh:310
    \n+
    AppendedBase64DataArrayWriter(std::ostream &s, std::string name, int ncomps, unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:325
    \n+
    bool writeIsNoop() const
    whether calls to write may be skipped
    Definition dataarraywriter.hh:342
    \n+
    a streaming writer for appended data array tags, uses base64 format
    Definition dataarraywriter.hh:360
    \n+
    NakedBase64DataArrayWriter(std::ostream &theStream, int ncomps, int nitems, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:369
    \n+
    a streaming writer for appended data arrays, uses raw format
    Definition dataarraywriter.hh:408
    \n+
    NakedRawDataArrayWriter(std::ostream &theStream, int ncomps, int nitems, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:419
    \n+
    a factory for DataArrayWriters
    Definition dataarraywriter.hh:462
    \n+
    bool beginAppended()
    signal start of the appended section
    Definition dataarraywriter.hh:497
    \n+
    DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned nitems, const Indent &indent, Precision prec)
    create a DataArrayWriter
    Definition dataarraywriter.hh:541
    \n+
    DataArrayWriterFactory(OutputType type_, std::ostream &stream_)
    create a DataArrayWriterFactory
    Definition dataarraywriter.hh:482
    \n+
    const std::string & appendedEncoding() const
    query encoding string for appended data
    Definition dataarraywriter.hh:510
    \n+
    void write(X &data)
    encode a data item
    Definition streams.hh:42
    \n+
    void flush()
    flush the current unwritten data to the stream.
    Definition streams.hh:64
    \n+
    write out data in binary
    Definition streams.hh:84
    \n+
    void write(T data)
    write data to stream
    Definition streams.hh:93
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,220 +2,598 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-interval.hh\n+ * vtk\n+dataarraywriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_INTERVALBLOCK_HH\n-6#define DUNE_DGF_INTERVALBLOCK_HH\n-7\n-8#include \n-9#include \n-10#include \n-11\n-12#include \n-13\n-14\n-15namespace Dune\n-16{\n-17\n-18 namespace dgf\n-19 {\n-20\n-21 struct IntervalBlock\n-22 : public BasicBlock\n-23 {\n-24 struct Interval\n-25 {\n-26 Interval() {}\n-27 Interval( const Interval& interval, const std::vector& map )\n-28 {\n-29 copy( interval, map );\n-30 }\n-31 void copy(const Interval& interval, const std::vector& map )\n-32 {\n-33 const int size = map.size();\n-34 p[0].resize( size );\n-35 p[1].resize( size );\n-36 n.resize( size );\n-37 h.resize( size );\n-38 assert( size == int(interval.n.size()) );\n-39 for( int i=0; i, 2 > p; // lower and upper boundary points\n-48 std::vector< double > h; // width of the cells in each direction\n-49 std::vector< int > n; // number of cells in each direction\n-50 };\n-51\n-52 private:\n-53 std::vector< Interval > intervals_;\n-54 std::vector< int > map_;\n-55 bool good_; //data read correctly\n-56 int dimw_; //dimension of world\n-57\n-58 public:\n-59 explicit IntervalBlock ( std::istream &in );\n-60\n-61 void get ( std::vector< std::vector< double > > &vtx, int &nofvtx,\n-62 std::vector< std::vector< unsigned int > > &simplex, int &nofsimpl )\n-63 {\n-64 for( size_t i = 0; i < intervals_.size(); ++i )\n-65 {\n-66 int oldvtx = nofvtx;\n-67 nofvtx += getVtx( i, vtx );\n-68 nofsimpl += getHexa( i, simplex, oldvtx );\n-69 }\n-70 }\n-71\n-72 void get ( std::vector< std::vector< double > > &vtx, int &nofvtx )\n-73 {\n-74 for( size_t i = 0; i < intervals_.size(); ++i )\n-75 nofvtx += getVtx( i, vtx );\n-76 }\n-77\n-78 const Interval &get ( int block ) const\n-79 {\n-80 return intervals_[ block ];\n-81 }\n-82\n-83 int numIntervals () const\n-84 {\n-85 return intervals_.size();\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15\n+16#include \n+17#include \n+18\n+19#include \n+20#include \n+21\n+30namespace Dune\n+31{\n+34\n+35 namespace VTK {\n+36\n+38\n+55 class DataArrayWriter\n+56 {\n+57 public:\n+59\n+63 DataArrayWriter(Precision _prec)\n+64 : prec(_prec)\n+65 {}\n+66\n+68 template\n+69 void write(T data)\n+70 {\n+71 switch(prec)\n+72 {\n+73 case Precision::float32:\n+74 writeFloat32(data); break;\n+75 case Precision::float64:\n+76 writeFloat64(data); break;\n+77 case Precision::uint32:\n+78 writeUInt32(data); break;\n+79 case Precision::uint8:\n+80 writeUInt8(data); break;\n+81 case Precision::int32:\n+82 writeInt32(data); break;\n+83 default:\n+84 DUNE_THROW(Dune::NotImplemented, \"Unknown precision type\");\n+85 }\n 86 }\n 87\n-88 int dimw () const\n-89 {\n-90 return dimw_;\n-91 }\n+89 virtual bool writeIsNoop() const { return false; }\n+91 virtual ~DataArrayWriter () {}\n 92\n-93 int getVtx ( int block, std::vector< std::vector< double > > &vtx ) const;\n-94 int getHexa ( int block, std::vector< std::vector< unsigned int > > &cubes,\n-95 int offset = 0 ) const;\n-96\n-97 int nofvtx ( int block ) const\n-98 {\n-99 const Interval &interval = get( block );\n-100 int n = 1;\n-101 for( int i = 0; i < dimw_; ++i )\n-102 n *= (interval.n[ i ] + 1);\n-103 return n;\n-104 }\n-105\n-106 int nofhexa ( int block ) const\n-107 {\n-108 const Interval &interval = get( block );\n-109 int n = 1;\n-110 for( int i = 0; i < dimw_; ++i )\n-111 n *= interval.n[ i ];\n-112 return n;\n-113 }\n-114\n-115 private:\n-116 template< class T >\n-117 void parseLine ( std::vector< T > &v );\n-118\n-119 bool next ();\n-120 };\n-121\n-122 inline std::ostream &\n-123 operator<<_( std::ostream &out, const IntervalBlock::Interval &interval )\n+93 private:\n+95 virtual void writeFloat32 (float data) = 0;\n+97 virtual void writeFloat64 (double data) = 0;\n+99 virtual void writeInt32 (std::int32_t data) = 0;\n+101 virtual void writeUInt8 (std::uint8_t data) = 0;\n+103 virtual void writeUInt32 (std::uint32_t data) = 0;\n+104\n+105 Precision prec;\n+106 };\n+107\n+109 class AsciiDataArrayWriter : public DataArrayWriter\n+110 {\n+111 public:\n+113\n+121 AsciiDataArrayWriter(std::ostream& theStream, std::string name,\n+122 int ncomps, const Indent& indent_, Precision prec_)\n+123 : DataArrayWriter(prec_), s(theStream), counter(0), numPerLine(12), indent\n+(indent_)\n 124 {\n-125 if( interval.p[ 0 ].empty() || interval.p[ 1 ].empty() || interval.n.empty\n-() )\n-126 return out << \"Interval {}\";\n-127\n-128 out << \"Interval { p0 = (\" << interval.p[ 0 ][ 0 ];\n-129 for( size_t i = 1; i < interval.p[ 0 ].size(); ++i )\n-130 out << \", \" << interval.p[ 0 ][ i ];\n-131 out << \"), p1 = (\" << interval.p[ 1 ][ 0 ];\n-132 for( size_t i = 1; i < interval.p[ 1 ].size(); ++i )\n-133 out << \", \" << interval.p[ 1 ][ i ];\n-134 out << \"), n = (\" << interval.n[ 0 ];\n-135 for( size_t i = 1; i < interval.n.size(); ++i )\n-136 out << \", \" << interval.n[ i ];\n-137 return out << \") }\";\n+125 s << indent << \"\\n\";\n+129 ++indent;\n+130 }\n+131\n+133 ~AsciiDataArrayWriter ()\n+134 {\n+135 if (counter%numPerLine!=0) s << \"\\n\";\n+136 --indent;\n+137 s << indent << \"\\n\";\n 138 }\n 139\n-140 } // end namespace dgf\n-141\n-142} // end namespace Dune\n-143\n-144#endif\n-basic.hh\n+140 private:\n+142 void writeFloat64 (double data) final\n+143 { write_float(data); }\n+145 void writeFloat32 (float data) final\n+146 { write_float(data); }\n+148 void writeInt32 (std::int32_t data) final\n+149 { write_(data); }\n+151 void writeUInt32 (std::uint32_t data) final\n+152 { write_(data); }\n+154 void writeUInt8 (std::uint8_t data) final\n+155 { write_(data); }\n+156\n+157 template\n+158 void write_(T data)\n+159 {\n+160 typedef typename PrintType::Type PT;\n+161 if(counter%numPerLine==0) s << indent;\n+162 else s << \" \";\n+163 const auto original_precision = std::cout.precision();\n+164 s << std::setprecision(std::numeric_limits::digits10) << (PT) data;\n+165 std::cout.precision(original_precision);\n+166 counter++;\n+167 if (counter%numPerLine==0) s << \"\\n\";\n+168 }\n+169\n+170 template\n+171 void write_float(T data)\n+172 {\n+173 typedef typename PrintType::Type PT;\n+174 if(counter%numPerLine==0) s << indent;\n+175 else s << \" \";\n+176 PT out_data = (PT) data;\n+177 if (std::fpclassify(out_data) == FP_SUBNORMAL)\n+178 {\n+179 // truncate denormalized data to 0 to avoid Paraview segfaults on macOS\n+180 out_data = 0;\n+181 }\n+182 const auto original_precision = std::cout.precision();\n+183 s << std::setprecision(std::numeric_limits::digits10) << out_data;\n+184 std::cout.precision(original_precision);\n+185 counter++;\n+186 if (counter%numPerLine==0) s << \"\\n\";\n+187 }\n+188\n+189 std::ostream& s;\n+190 int counter;\n+191 int numPerLine;\n+192 Indent indent;\n+193 };\n+194\n+196 class BinaryDataArrayWriter : public DataArrayWriter\n+197 {\n+198 public:\n+200\n+210 BinaryDataArrayWriter(std::ostream& theStream, std::string name,\n+211 int ncomps, int nitems, const Indent& indent_, Precision prec_)\n+212 : DataArrayWriter(prec_), s(theStream), b64(theStream), indent(indent_)\n+213 {\n+214 s << indent << \"\\n\";\n+218\n+219 // write indentation for the data chunk\n+220 s << indent+1;\n+221 // store size, needs to be exactly 32 bit\n+222 std::uint32_t size = ncomps*nitems*typeSize(prec_);\n+223 b64.write(size);\n+224 b64.flush();\n+225 }\n+226\n+228 ~BinaryDataArrayWriter ()\n+229 {\n+230 b64.flush();\n+231 // append newline to written data\n+232 s << \"\\n\";\n+233 s << indent << \"\\n\";\n+234 s.flush();\n+235 }\n+236\n+237 private:\n+239 void writeFloat64 (double data) final\n+240 { write_(data); }\n+242 void writeFloat32 (float data) final\n+243 { write_(data); }\n+245 void writeInt32 (std::int32_t data) final\n+246 { write_(data); }\n+248 void writeUInt32 (std::uint32_t data) final\n+249 { write_(data); }\n+251 void writeUInt8 (std::uint8_t data) final\n+252 { write_(data); }\n+253\n+255 template\n+256 void write_(T data)\n+257 {\n+258 b64.write(data);\n+259 }\n+260\n+261 std::ostream& s;\n+262 Base64Stream b64;\n+263 const Indent& indent;\n+264 };\n+265\n+267 class AppendedRawDataArrayWriter : public DataArrayWriter\n+268 {\n+269 public:\n+271\n+283 AppendedRawDataArrayWriter(std::ostream& s, std::string name,\n+284 int ncomps, unsigned nitems, unsigned& offset,\n+285 const Indent& indent, Precision prec_)\n+286 : DataArrayWriter(prec_)\n+287 {\n+288 s << indent << \"\\n\";\n+292 offset += 4; // header\n+293 offset += ncomps*nitems*typeSize(prec_);\n+294 }\n+295\n+297 bool writeIsNoop() const { return true; }\n+298\n+299 private:\n+301 void writeFloat64 (double) final {}\n+302 void writeFloat32 (float) final {}\n+303 void writeInt32 (std::int32_t) final {}\n+304 void writeUInt32 (std::uint32_t) final {}\n+305 void writeUInt8 (std::uint8_t) final {}\n+306 };\n+307\n+309 class AppendedBase64DataArrayWriter : public DataArrayWriter\n+310 {\n+311 public:\n+313\n+325 AppendedBase64DataArrayWriter(std::ostream& s, std::string name,\n+326 int ncomps, unsigned nitems,\n+327 unsigned& offset, const Indent& indent, Precision prec_)\n+328 : DataArrayWriter(prec_)\n+329 {\n+330 s << indent << \"\\n\";\n+334 offset += 8; // header\n+335 std::size_t bytes = ncomps*nitems*typeSize(prec_);\n+336 offset += bytes/3*4;\n+337 if(bytes%3 != 0)\n+338 offset += 4;\n+339 }\n+340\n+342 bool writeIsNoop() const { return true; }\n+343\n+344 private:\n+346 void writeFloat64 (double) final {}\n+347 void writeFloat32 (float) final {}\n+348 void writeInt32 (std::int32_t) final {}\n+349 void writeUInt32 (std::uint32_t) final {}\n+350 void writeUInt8 (std::uint8_t) final {}\n+351 };\n+352\n+354 //\n+355 // Naked ArrayWriters for the appended section\n+356 //\n+357\n+359 class NakedBase64DataArrayWriter : public DataArrayWriter\n+360 {\n+361 public:\n+363\n+369 NakedBase64DataArrayWriter(std::ostream& theStream, int ncomps,\n+370 int nitems, Precision prec_)\n+371 : DataArrayWriter(prec_), b64(theStream)\n+372 {\n+373 // store size\n+374 std::uint32_t size = ncomps*nitems*typeSize(prec_);\n+375 b64.write(size);\n+376 b64.flush();\n+377 }\n+378\n+379 private:\n+381 void writeFloat64 (double data) final\n+382 { write_(data); }\n+384 void writeFloat32 (float data) final\n+385 { write_(data); }\n+387 void writeInt32 (std::int32_t data) final\n+388 { write_(data); }\n+390 void writeUInt32 (std::uint32_t data) final\n+391 { write_(data); }\n+393 void writeUInt8 (std::uint8_t data) final\n+394 { write_(data); }\n+395\n+397 template\n+398 void write_(T data)\n+399 {\n+400 b64.write(data);\n+401 }\n+402\n+403 Base64Stream b64;\n+404 };\n+405\n+407 class NakedRawDataArrayWriter : public DataArrayWriter\n+408 {\n+409 RawStream s;\n+410\n+411 public:\n+413\n+419 NakedRawDataArrayWriter(std::ostream& theStream, int ncomps,\n+420 int nitems, Precision prec_)\n+421 : DataArrayWriter(prec_), s(theStream)\n+422 {\n+423 s.write((unsigned int)(ncomps*nitems*typeSize(prec_)));\n+424 }\n+425\n+426 private:\n+428 void writeFloat64 (double data) final\n+429 { write_(data); }\n+431 void writeFloat32 (float data) final\n+432 { write_(data); }\n+434 void writeInt32 (std::int32_t data) final\n+435 { write_(data); }\n+437 void writeUInt32 (std::uint32_t data) final\n+438 { write_(data); }\n+440 void writeUInt8 (std::uint8_t data) final\n+441 { write_(data); }\n+442\n+444 template\n+445 void write_(T data)\n+446 {\n+447 s.write(data);\n+448 }\n+449 };\n+450\n+452 //\n+453 // Factory\n+454 //\n+455\n+457\n+462 class DataArrayWriterFactory {\n+463 enum Phase { main, appended };\n+464\n+465 OutputType type;\n+466 std::ostream& stream;\n+467 unsigned offset;\n+469 Phase phase;\n+470\n+471 public:\n+473\n+482 inline DataArrayWriterFactory(OutputType type_, std::ostream& stream_)\n+483 : type(type_), stream(stream_), offset(0), phase(main)\n+484 { }\n+485\n+487\n+497 inline bool beginAppended() {\n+498 phase = appended;\n+499 switch(type) {\n+500 case ascii : return false;\n+501 case base64 : return false;\n+502 case appendedraw : return true;\n+503 case appendedbase64 : return true;\n+504 }\n+505 DUNE_THROW(IOError, \"Dune::VTK::DataArrayWriter: unsupported \"\n+506 \"OutputType \" << type);\n+507 }\n+508\n+510 const std::string& appendedEncoding() const {\n+511 static const std::string rawString = \"raw\";\n+512 static const std::string base64String = \"base64\";\n+513\n+514 switch(type) {\n+515 case ascii :\n+516 case base64 :\n+517 DUNE_THROW(IOError, \"DataArrayWriterFactory::appendedEncoding(): No \"\n+518 \"appended encoding for OutputType \" << type);\n+519 case appendedraw : return rawString;\n+520 case appendedbase64 : return base64String;\n+521 }\n+522 DUNE_THROW(IOError, \"DataArrayWriterFactory::appendedEncoding(): \"\n+523 \"unsupported OutputType \" << type);\n+524 }\n+525\n+527\n+541 DataArrayWriter* make(const std::string& name, unsigned ncomps,\n+542 unsigned nitems, const Indent& indent,\n+543 Precision prec)\n+544 {\n+545 switch(phase) {\n+546 case main :\n+547 switch(type) {\n+548 case ascii :\n+549 return new AsciiDataArrayWriter(stream, name, ncomps, indent, prec);\n+550 case base64 :\n+551 return new BinaryDataArrayWriter(stream, name, ncomps, nitems,\n+552 indent, prec);\n+553 case appendedraw :\n+554 return new AppendedRawDataArrayWriter(stream, name, ncomps,\n+555 nitems, offset, indent, prec);\n+556 case appendedbase64 :\n+557 return new AppendedBase64DataArrayWriter(stream, name, ncomps,\n+558 nitems, offset,\n+559 indent, prec);\n+560 }\n+561 break;\n+562 case appended :\n+563 switch(type) {\n+564 case ascii :\n+565 case base64 :\n+566 break; // invalid in appended mode\n+567 case appendedraw :\n+568 return new NakedRawDataArrayWriter(stream, ncomps, nitems, prec);\n+569 case appendedbase64 :\n+570 return new NakedBase64DataArrayWriter(stream, ncomps, nitems, prec);\n+571 }\n+572 break;\n+573 }\n+574 DUNE_THROW(IOError, \"Dune::VTK::DataArrayWriter: unsupported \"\n+575 \"OutputType \" << type << \" in phase \" << phase);\n+576 }\n+577 };\n+578\n+579 } // namespace VTK\n+580\n+582\n+583} // namespace Dune\n+584\n+585#endif // DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH\n+streams.hh\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::operator<<\n-std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval\n-&interval)\n-Definition interval.hh:123\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::IntervalBlock\n-Definition interval.hh:23\n-Dune::dgf::IntervalBlock::get\n-void get(std::vector< std::vector< double > > &vtx, int &nofvtx, std::vector<\n-std::vector< unsigned int > > &simplex, int &nofsimpl)\n-Definition interval.hh:61\n-Dune::dgf::IntervalBlock::numIntervals\n-int numIntervals() const\n-Definition interval.hh:83\n-Dune::dgf::IntervalBlock::getVtx\n-int getVtx(int block, std::vector< std::vector< double > > &vtx) const\n-Definition interval.cc:83\n-Dune::dgf::IntervalBlock::get\n-const Interval & get(int block) const\n-Definition interval.hh:78\n-Dune::dgf::IntervalBlock::getHexa\n-int getHexa(int block, std::vector< std::vector< unsigned int > > &cubes, int\n-offset=0) const\n-Definition interval.cc:121\n-Dune::dgf::IntervalBlock::nofhexa\n-int nofhexa(int block) const\n-Definition interval.hh:106\n-Dune::dgf::IntervalBlock::dimw\n-int dimw() const\n-Definition interval.hh:88\n-Dune::dgf::IntervalBlock::nofvtx\n-int nofvtx(int block) const\n-Definition interval.hh:97\n-Dune::dgf::IntervalBlock::get\n-void get(std::vector< std::vector< double > > &vtx, int &nofvtx)\n-Definition interval.hh:72\n-Dune::dgf::IntervalBlock::Interval\n-Definition interval.hh:25\n-Dune::dgf::IntervalBlock::Interval::Interval\n-Interval()\n-Definition interval.hh:26\n-Dune::dgf::IntervalBlock::Interval::p\n-std::array< std::vector< double >, 2 > p\n-Definition interval.hh:47\n-Dune::dgf::IntervalBlock::Interval::n\n-std::vector< int > n\n-Definition interval.hh:49\n-Dune::dgf::IntervalBlock::Interval::Interval\n-Interval(const Interval &interval, const std::vector< int > &map)\n-Definition interval.hh:27\n-Dune::dgf::IntervalBlock::Interval::copy\n-void copy(const Interval &interval, const std::vector< int > &map)\n-Definition interval.hh:31\n-Dune::dgf::IntervalBlock::Interval::h\n-std::vector< double > h\n-Definition interval.hh:48\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::int32\n+@ int32\n+Dune::VTK::Precision::uint32\n+@ uint32\n+Dune::VTK::Precision::uint8\n+@ uint8\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::VTK::Precision::float64\n+@ float64\n+Dune::VTK::OutputType\n+OutputType\n+How the bulk data should be stored in the file.\n+Definition common.hh:43\n+Dune::VTK::ascii\n+@ ascii\n+Output to the file is in ascii.\n+Definition common.hh:45\n+Dune::VTK::appendedraw\n+@ appendedraw\n+Output is to the file is appended raw binary.\n+Definition common.hh:49\n+Dune::VTK::appendedbase64\n+@ appendedbase64\n+Output is to the file is appended base64 binary.\n+Definition common.hh:51\n+Dune::VTK::base64\n+@ base64\n+Output to the file is inline base64 binary.\n+Definition common.hh:47\n+Dune::VTK::toString\n+std::string toString(Precision p)\n+map precision to VTK type name\n+Definition common.hh:280\n+Dune::VTK::typeSize\n+std::size_t typeSize(Precision p)\n+map precision to byte size\n+Definition common.hh:300\n+Dune::VTK::PrintType::Type\n+T Type\n+type to convert T to before putting it into a stream with <<\n+Definition common.hh:97\n+Dune::VTK::DataArrayWriter\n+base class for data array writers\n+Definition dataarraywriter.hh:56\n+Dune::VTK::DataArrayWriter::write\n+void write(T data)\n+write one element of data\n+Definition dataarraywriter.hh:69\n+Dune::VTK::DataArrayWriter::DataArrayWriter\n+DataArrayWriter(Precision _prec)\n+construct a data array writer\n+Definition dataarraywriter.hh:63\n+Dune::VTK::DataArrayWriter::writeIsNoop\n+virtual bool writeIsNoop() const\n+whether calls to write may be skipped\n+Definition dataarraywriter.hh:89\n+Dune::VTK::DataArrayWriter::~DataArrayWriter\n+virtual ~DataArrayWriter()\n+virtual destructor\n+Definition dataarraywriter.hh:91\n+Dune::VTK::AsciiDataArrayWriter\n+a streaming writer for data array tags, uses ASCII inline format\n+Definition dataarraywriter.hh:110\n+Dune::VTK::AsciiDataArrayWriter::~AsciiDataArrayWriter\n+~AsciiDataArrayWriter()\n+finish output; writes end tag\n+Definition dataarraywriter.hh:133\n+Dune::VTK::AsciiDataArrayWriter::AsciiDataArrayWriter\n+AsciiDataArrayWriter(std::ostream &theStream, std::string name, int ncomps,\n+const Indent &indent_, Precision prec_)\n+make a new data array writer\n+Definition dataarraywriter.hh:121\n+Dune::VTK::BinaryDataArrayWriter\n+a streaming writer for data array tags, uses binary inline format\n+Definition dataarraywriter.hh:197\n+Dune::VTK::BinaryDataArrayWriter::~BinaryDataArrayWriter\n+~BinaryDataArrayWriter()\n+finish output; writes end tag\n+Definition dataarraywriter.hh:228\n+Dune::VTK::BinaryDataArrayWriter::BinaryDataArrayWriter\n+BinaryDataArrayWriter(std::ostream &theStream, std::string name, int ncomps,\n+int nitems, const Indent &indent_, Precision prec_)\n+make a new data array writer\n+Definition dataarraywriter.hh:210\n+Dune::VTK::AppendedRawDataArrayWriter\n+a streaming writer for data array tags, uses appended raw format\n+Definition dataarraywriter.hh:268\n+Dune::VTK::AppendedRawDataArrayWriter::AppendedRawDataArrayWriter\n+AppendedRawDataArrayWriter(std::ostream &s, std::string name, int ncomps,\n+unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)\n+make a new data array writer\n+Definition dataarraywriter.hh:283\n+Dune::VTK::AppendedRawDataArrayWriter::writeIsNoop\n+bool writeIsNoop() const\n+whether calls to write may be skipped\n+Definition dataarraywriter.hh:297\n+Dune::VTK::AppendedBase64DataArrayWriter\n+a streaming writer for data array tags, uses appended base64 format\n+Definition dataarraywriter.hh:310\n+Dune::VTK::AppendedBase64DataArrayWriter::AppendedBase64DataArrayWriter\n+AppendedBase64DataArrayWriter(std::ostream &s, std::string name, int ncomps,\n+unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)\n+make a new data array writer\n+Definition dataarraywriter.hh:325\n+Dune::VTK::AppendedBase64DataArrayWriter::writeIsNoop\n+bool writeIsNoop() const\n+whether calls to write may be skipped\n+Definition dataarraywriter.hh:342\n+Dune::VTK::NakedBase64DataArrayWriter\n+a streaming writer for appended data array tags, uses base64 format\n+Definition dataarraywriter.hh:360\n+Dune::VTK::NakedBase64DataArrayWriter::NakedBase64DataArrayWriter\n+NakedBase64DataArrayWriter(std::ostream &theStream, int ncomps, int nitems,\n+Precision prec_)\n+make a new data array writer\n+Definition dataarraywriter.hh:369\n+Dune::VTK::NakedRawDataArrayWriter\n+a streaming writer for appended data arrays, uses raw format\n+Definition dataarraywriter.hh:408\n+Dune::VTK::NakedRawDataArrayWriter::NakedRawDataArrayWriter\n+NakedRawDataArrayWriter(std::ostream &theStream, int ncomps, int nitems,\n+Precision prec_)\n+make a new data array writer\n+Definition dataarraywriter.hh:419\n+Dune::VTK::DataArrayWriterFactory\n+a factory for DataArrayWriters\n+Definition dataarraywriter.hh:462\n+Dune::VTK::DataArrayWriterFactory::beginAppended\n+bool beginAppended()\n+signal start of the appended section\n+Definition dataarraywriter.hh:497\n+Dune::VTK::DataArrayWriterFactory::make\n+DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned\n+nitems, const Indent &indent, Precision prec)\n+create a DataArrayWriter\n+Definition dataarraywriter.hh:541\n+Dune::VTK::DataArrayWriterFactory::DataArrayWriterFactory\n+DataArrayWriterFactory(OutputType type_, std::ostream &stream_)\n+create a DataArrayWriterFactory\n+Definition dataarraywriter.hh:482\n+Dune::VTK::DataArrayWriterFactory::appendedEncoding\n+const std::string & appendedEncoding() const\n+query encoding string for appended data\n+Definition dataarraywriter.hh:510\n+Dune::Base64Stream::write\n+void write(X &data)\n+encode a data item\n+Definition streams.hh:42\n+Dune::Base64Stream::flush\n+void flush()\n+flush the current unwritten data to the stream.\n+Definition streams.hh:64\n+Dune::RawStream\n+write out data in binary\n+Definition streams.hh:84\n+Dune::RawStream::write\n+void write(T data)\n+write data to stream\n+Definition streams.hh:93\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00794.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00794.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundaryseg.cc File Reference\n+dune-grid: pointiterator.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,45 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    boundaryseg.cc File Reference
    \n+
    pointiterator.hh File Reference
    \n
    \n
    \n-\n+
    #include <iterator>
    \n+#include <vector>
    \n+#include <dune/common/iteratorfacades.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/io/file/vtk/corner.hh>
    \n+#include <dune/grid/io/file/vtk/corneriterator.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::PointIterator< CellIterator, IS >
     iterate over the points of some corner range More...
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-boundaryseg.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+pointiterator.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::VTK::PointIterator<_CellIterator,_IS_>\n+\u00a0 iterate over the points of some corner range More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00797.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00797.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: periodicfacetrans.cc File Reference\n+dune-grid: vtuwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,45 @@\n \n \n \n \n \n \n \n
    \n \n-
    periodicfacetrans.cc File Reference
    \n+
    vtuwriter.hh File Reference
    \n
    \n
    \n-\n+
    #include <ostream>
    \n+#include <string>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/indent.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <dune/grid/io/file/vtk/dataarraywriter.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::VTUWriter
     Dump a .vtu/.vtp files contents to a stream. More...
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-periodicfacetrans.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+vtuwriter.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::VTK::VTUWriter\n+\u00a0 Dump a .vtu/.vtp files contents to a stream. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00800.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00800.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: basic.cc File Reference\n+dune-grid: vtksequencewriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,32 +65,42 @@\n \n \n \n \n \n \n \n
    \n \n-
    basic.cc File Reference
    \n+
    vtksequencewriter.hh File Reference
    \n
    \n
    \n-\n+\n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTKSequenceWriter< GridView >
     Writer for the output of grid functions in the vtk format. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,25 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-basic.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+vtksequencewriter.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::VTKSequenceWriter<_GridView_>\n+\u00a0 Writer for the output of grid functions in the vtk format. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00803.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00803.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: polyhedron.hh File Reference\n+dune-grid: boundarywriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,40 +65,43 @@\n \n \n \n \n \n \n \n
    \n \n-
    polyhedron.hh File Reference
    \n+
    boundarywriter.hh File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <dune/grid/io/file/dgfparser/blocks/polygon.hh>
    \n+
    #include <memory>
    \n+#include <string>
    \n+#include <dune/grid/io/file/vtk/basicwriter.hh>
    \n+#include <dune/grid/io/file/vtk/boundaryiterators.hh>
    \n+#include <dune/grid/io/file/vtk/skeletonfunction.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::dgf::PolyhedronBlock
    class  Dune::VTK::NonConformingBoundaryWriter< GV >
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,25 +2,27 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n+ * vtk\n Classes | Namespaces\n-polyhedron.hh File Reference\n-#include \n-#include \n+boundarywriter.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 \u00a0 Dune::dgf::PolyhedronBlock\n+class \u00a0 Dune::VTK::NonConformingBoundaryWriter<_GV_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00803_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00803_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: polyhedron.hh Source File\n+dune-grid: boundarywriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,109 +70,116 @@\n
    \n \n \n \n \n \n \n
    \n-
    polyhedron.hh
    \n+
    boundarywriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=2 sw=2 sts=2:
    \n-
    5#ifndef DUNE_POLYHEDRON_HH
    \n-
    6#define DUNE_POLYHEDRON_HH
    \n-
    7
    \n-
    8#include <algorithm>
    \n-
    9
    \n-\n+
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=4 sw=2 sts=2:
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
    \n+
    8
    \n+
    9#include <memory>
    \n+
    10#include <string>
    \n
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    15 namespace dgf
    \n-
    16 {
    \n-
    17
    \n-
    18 // PolyhedronBlock
    \n-
    19 // ---------------
    \n-
    20
    \n-
    \n-\n-
    22 : public BasicBlock
    \n-
    23 {
    \n-
    \n-
    24 explicit PolyhedronBlock ( std::istream &in, int numPolys )
    \n-
    25 : BasicBlock( in, "Polyhedron" ), numPolys_( numPolys )
    \n-
    26 {}
    \n-
    \n-
    27
    \n-
    \n-
    28 int get ( std::vector< std::vector< int > > &polyhedra )
    \n-
    29 {
    \n-
    30 reset();
    \n-
    31 std::vector< int > polyhedron;
    \n-
    32 int minPolyId = 1;
    \n-
    33 while( getnextline() )
    \n-
    34 {
    \n-
    35 polyhedron.clear();
    \n-
    36 for( int polyIdx; getnextentry( polyIdx ); )
    \n-
    37 {
    \n-
    38 if( (polyIdx < 0) || (polyIdx > numPolys_) )
    \n-
    39 DUNE_THROW( DGFException, "Error in " << *this << ": Invalid polygon index (" << polyIdx << " not int [0, " << numPolys_ << "])" );
    \n-
    40
    \n-
    41 minPolyId = std::min( minPolyId, polyIdx );
    \n-
    42 polyhedron.push_back( polyIdx );
    \n-
    43 }
    \n+\n+\n+\n+
    15
    \n+
    16namespace Dune {
    \n+
    19
    \n+
    20 namespace VTK {
    \n+
    21
    \n+
    22 template<typename GV>
    \n+
    \n+\n+\n+
    25 public BasicWriter<NonConformingBoundaryIteratorFactory<GV> >
    \n+
    26 {
    \n+\n+\n+
    29
    \n+
    30 const GV& gv;
    \n+
    31
    \n+
    32 public:
    \n+
    \n+\n+
    34 : Factory(gv_), Base(static_cast<const Factory&>(*this)), gv(gv_)
    \n+
    35 { }
    \n+
    \n+
    36
    \n+\n+
    38
    \n+
    39 template<typename Func>
    \n+
    \n+
    40 void addCellData(const std::shared_ptr<Func>& p, const std::string& name) {
    \n+
    41 addCellData(std::shared_ptr<typename Base::FunctionWriter>
    \n+
    42 (new SkeletonFunctionWriter<Func>(p, name)));
    \n+
    43 }
    \n+
    \n
    44
    \n-
    45 polyhedra.push_back( polyhedron );
    \n-
    46 }
    \n-
    47
    \n-
    48 // subtract minimal number to have 0 starting numbering
    \n-
    49 if( minPolyId > 0 )
    \n-
    50 {
    \n-
    51 const size_t polySize = polyhedra.size();
    \n-
    52 for( size_t i=0; i<polySize; ++i )
    \n-
    53 {
    \n-
    54 const size_t pSize = polyhedra[ i ].size();
    \n-
    55 for( size_t j=0; j<pSize; ++j )
    \n-
    56 {
    \n-
    57 polyhedra[ i ][ j ] -= minPolyId;
    \n-
    58 }
    \n-
    59 }
    \n-
    60 }
    \n-
    61 return polyhedra.size();
    \n-
    62 }
    \n-
    \n-
    63
    \n-
    64 protected:
    \n-
    65 const int numPolys_;
    \n-
    66 };
    \n-
    \n-
    67
    \n-
    68 } // namespace dgf
    \n-
    69} // end namespace Dune
    \n+
    45 template<typename Func>
    \n+
    \n+
    46 void addCellData(Func* p, const std::string& name) {
    \n+
    47 addCellData(std::shared_ptr<Func>(p), name);
    \n+
    48 }
    \n+
    \n+
    49
    \n+\n+
    51
    \n+
    52 template<typename Func>
    \n+
    \n+
    53 void addPointData(const std::shared_ptr<Func>& p, const std::string& name) {
    \n+
    54 addPointData(std::shared_ptr<typename Base::FunctionWriter>
    \n+
    55 (new SkeletonFunctionWriter<Func>(p, name)));
    \n+
    56 }
    \n+
    \n+
    57
    \n+
    58 template<typename Func>
    \n+
    \n+
    59 void addPointData(Func* p, const std::string& name) {
    \n+
    60 addPointData(std::shared_ptr<Func>(p), name);
    \n+
    61 }
    \n+
    \n+
    62
    \n+
    63 };
    \n+
    \n+
    64
    \n+
    65 } // namespace VTK
    \n+
    66
    \n+
    68
    \n+
    69} // namespace Dune
    \n
    70
    \n-
    71#endif // #ifndef DUNE_POLYHEDRON_HH
    \n-\n+
    71#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
    \n+
    Functions for VTK output on the skeleton.
    \n+\n+
    Functions for VTK output on the skeleton.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    void reset()
    Definition basic.hh:51
    \n-
    bool getnextline()
    Definition basic.cc:93
    \n-
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n-
    Definition polyhedron.hh:23
    \n-
    const int numPolys_
    Definition polyhedron.hh:65
    \n-
    PolyhedronBlock(std::istream &in, int numPolys)
    Definition polyhedron.hh:24
    \n-
    int get(std::vector< std::vector< int > > &polyhedra)
    Definition polyhedron.hh:28
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Definition basicwriter.hh:35
    \n+
    void addCellData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:76
    \n+
    void addPointData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:80
    \n+
    Definition boundaryiterators.hh:159
    \n+
    Definition boundarywriter.hh:26
    \n+
    void addPointData(const std::shared_ptr< Func > &p, const std::string &name)
    Definition boundarywriter.hh:53
    \n+
    void addCellData(Func *p, const std::string &name)
    Definition boundarywriter.hh:46
    \n+
    void addPointData(Func *p, const std::string &name)
    Definition boundarywriter.hh:59
    \n+
    NonConformingBoundaryWriter(const GV &gv_)
    Definition boundarywriter.hh:33
    \n+
    void addCellData(const std::shared_ptr< Func > &p, const std::string &name)
    Definition boundarywriter.hh:40
    \n+
    function writer for skeleton functions
    Definition skeletonfunction.hh:83
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,115 +2,119 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-polyhedron.hh\n+ * vtk\n+boundarywriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=2 sw=2 sts=2:\n-5#ifndef DUNE_POLYHEDRON_HH\n-6#define DUNE_POLYHEDRON_HH\n-7\n-8#include \n-9\n-10#include \n+3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=4 sw=2 sts=2:\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH\n+8\n+9#include \n+10#include \n 11\n-12namespace Dune\n-13{\n-14\n-15 namespace dgf\n-16 {\n-17\n-18 // PolyhedronBlock\n-19 // ---------------\n-20\n-21 struct PolyhedronBlock\n-22 : public BasicBlock\n-23 {\n-24 explicit PolyhedronBlock ( std::istream &in, int numPolys )\n-25 : BasicBlock( in, \"Polyhedron\" ), numPolys_( numPolys )\n-26 {}\n-27\n-28 int get ( std::vector< std::vector< int > > &polyhedra )\n-29 {\n-30 reset();\n-31 std::vector< int > polyhedron;\n-32 int minPolyId = 1;\n-33 while( getnextline() )\n-34 {\n-35 polyhedron.clear();\n-36 for( int polyIdx; getnextentry( polyIdx ); )\n-37 {\n-38 if( (polyIdx < 0) || (polyIdx > numPolys_) )\n-39 DUNE_THROW( DGFException, \"Error in \" << *this << \": Invalid polygon index\n-(\" << polyIdx << \" not int [0, \" << numPolys_ << \"])\" );\n-40\n-41 minPolyId = std::min( minPolyId, polyIdx );\n-42 polyhedron.push_back( polyIdx );\n+12#include \n+13#include \n+14#include \n+15\n+16namespace Dune {\n+19\n+20 namespace VTK {\n+21\n+22 template\n+23 class NonConformingBoundaryWriter\n+24 : public NonConformingBoundaryIteratorFactory,\n+25 public BasicWriter >\n+26 {\n+27 typedef NonConformingBoundaryIteratorFactory Factory;\n+28 typedef BasicWriter Base;\n+29\n+30 const GV& gv;\n+31\n+32 public:\n+33 NonConformingBoundaryWriter(const GV& gv_)\n+34 : Factory(gv_), Base(static_cast(*this)), gv(gv_)\n+35 { }\n+36\n+37 using Base::addCellData;\n+38\n+39 template\n+40 void addCellData(const std::shared_ptr& p, const std::string& name) {\n+41 addCellData(std::shared_ptr\n+42 (new SkeletonFunctionWriter(p, name)));\n 43 }\n 44\n-45 polyhedra.push_back( polyhedron );\n-46 }\n-47\n-48 // subtract minimal number to have 0 starting numbering\n-49 if( minPolyId > 0 )\n-50 {\n-51 const size_t polySize = polyhedra.size();\n-52 for( size_t i=0; i\n+46 void addCellData(Func* p, const std::string& name) {\n+47 addCellData(std::shared_ptr(p), name);\n+48 }\n+49\n+50 using Base::addPointData;\n+51\n+52 template\n+53 void addPointData(const std::shared_ptr& p, const std::string& name) {\n+54 addPointData(std::shared_ptr\n+55 (new SkeletonFunctionWriter(p, name)));\n+56 }\n+57\n+58 template\n+59 void addPointData(Func* p, const std::string& name) {\n+60 addPointData(std::shared_ptr(p), name);\n+61 }\n+62\n+63 };\n+64\n+65 } // namespace VTK\n+66\n+68\n+69} // namespace Dune\n 70\n-71#endif // #ifndef DUNE_POLYHEDRON_HH\n-polygon.hh\n+71#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH\n+skeletonfunction.hh\n+Functions for VTK output on the skeleton.\n+basicwriter.hh\n+boundaryiterators.hh\n+Functions for VTK output on the skeleton.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::BasicBlock::reset\n-void reset()\n-Definition basic.hh:51\n-Dune::dgf::BasicBlock::getnextline\n-bool getnextline()\n-Definition basic.cc:93\n-Dune::dgf::BasicBlock::getnextentry\n-bool getnextentry(ENTRY &entry)\n-Definition basic.hh:63\n-Dune::dgf::PolyhedronBlock\n-Definition polyhedron.hh:23\n-Dune::dgf::PolyhedronBlock::numPolys_\n-const int numPolys_\n-Definition polyhedron.hh:65\n-Dune::dgf::PolyhedronBlock::PolyhedronBlock\n-PolyhedronBlock(std::istream &in, int numPolys)\n-Definition polyhedron.hh:24\n-Dune::dgf::PolyhedronBlock::get\n-int get(std::vector< std::vector< int > > &polyhedra)\n-Definition polyhedron.hh:28\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n+Dune::VTK::BasicWriter\n+Definition basicwriter.hh:35\n+Dune::VTK::BasicWriter::addCellData\n+void addCellData(const std::shared_ptr< FunctionWriter > &writer)\n+Definition basicwriter.hh:76\n+Dune::VTK::BasicWriter::addPointData\n+void addPointData(const std::shared_ptr< FunctionWriter > &writer)\n+Definition basicwriter.hh:80\n+Dune::VTK::NonConformingBoundaryIteratorFactory\n+Definition boundaryiterators.hh:159\n+Dune::VTK::NonConformingBoundaryWriter\n+Definition boundarywriter.hh:26\n+Dune::VTK::NonConformingBoundaryWriter::addPointData\n+void addPointData(const std::shared_ptr< Func > &p, const std::string &name)\n+Definition boundarywriter.hh:53\n+Dune::VTK::NonConformingBoundaryWriter::addCellData\n+void addCellData(Func *p, const std::string &name)\n+Definition boundarywriter.hh:46\n+Dune::VTK::NonConformingBoundaryWriter::addPointData\n+void addPointData(Func *p, const std::string &name)\n+Definition boundarywriter.hh:59\n+Dune::VTK::NonConformingBoundaryWriter::NonConformingBoundaryWriter\n+NonConformingBoundaryWriter(const GV &gv_)\n+Definition boundarywriter.hh:33\n+Dune::VTK::NonConformingBoundaryWriter::addCellData\n+void addCellData(const std::shared_ptr< Func > &p, const std::string &name)\n+Definition boundarywriter.hh:40\n+Dune::VTK::SkeletonFunctionWriter\n+function writer for skeleton functions\n+Definition skeletonfunction.hh:83\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00806.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00806.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridparameter.cc File Reference\n+dune-grid: pvtuwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,44 @@\n \n \n \n \n \n \n \n
    \n \n-
    gridparameter.cc File Reference
    \n+
    pvtuwriter.hh File Reference
    \n
    \n
    \n-\n+
    #include <ostream>
    \n+#include <string>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/indent.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::PVTUWriter
     Dump a .vtu/.vtp files contents to a stream. More...
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,28 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-gridparameter.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+pvtuwriter.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 \u00a0 Dune::VTK::PVTUWriter\n+\u00a0 Dump a .vtu/.vtp files contents to a stream. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00809.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00809.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: periodicfacetrans.hh File Reference\n+dune-grid: streams.hh File Reference\n \n \n \n \n \n \n \n@@ -65,52 +65,43 @@\n \n \n \n \n \n \n \n
    \n \n-
    periodicfacetrans.hh File Reference
    \n+Namespaces
    \n+
    streams.hh File Reference
    \n \n
    \n-
    #include <iostream>
    \n-#include <vector>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+
    #include <ostream>
    \n+#include <dune/grid/io/file/vtk/b64enc.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

    struct  Dune::dgf::PeriodicFaceTransformationBlock
    class  Dune::Base64Stream
     class to base64 encode a stream of data More...
     
    class  Dune::dgf::PeriodicFaceTransformationBlock::Matrix< T >
     
    struct  Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation
    class  Dune::RawStream
     write out data in binary More...
     
    \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-\n-\n-\n

    \n-Functions

    std::ostream & Dune::dgf::operator<< (std::ostream &out, const PeriodicFaceTransformationBlock::AffineTransformation &trafo)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,34 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Classes | Namespaces | Functions\n-periodicfacetrans.hh File Reference\n-#include \n-#include \n-#include \n+ * vtk\n+Classes | Namespaces\n+streams.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::dgf::PeriodicFaceTransformationBlock\n+class \u00a0 Dune::Base64Stream\n+\u00a0 class to base64 encode a stream of data More...\n \u00a0\n- class \u00a0 Dune::dgf::PeriodicFaceTransformationBlock::Matrix<_T_>\n-\u00a0\n-struct \u00a0 Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation\n+class \u00a0 Dune::RawStream\n+\u00a0 write out data in binary More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n-Functions\n-std::ostream &\u00a0 Dune::dgf::operator<< (std::ostream &out, const\n- PeriodicFaceTransformationBlock::AffineTransformation &trafo)\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00809_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00809_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: periodicfacetrans.hh Source File\n+dune-grid: streams.hh Source File\n \n \n \n \n \n \n \n@@ -70,183 +70,132 @@\n
    \n \n \n \n \n \n \n
    \n-
    periodicfacetrans.hh
    \n+
    streams.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_PERIODICFACETRANSBLOCK_HH
    \n-
    6#define DUNE_DGF_PERIODICFACETRANSBLOCK_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_STREAMS_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_STREAMS_HH
    \n+
    8
    \n+
    9#include <ostream>
    \n
    10
    \n-\n+\n
    12
    \n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 namespace dgf
    \n-
    18 {
    \n-
    19
    \n-
    20 // PeriodicFaceTransformationBlock
    \n-
    21 // -------------------------------
    \n-
    22
    \n-
    \n-\n-
    24 : public BasicBlock
    \n-
    25 {
    \n-
    26 template< class T >
    \n-
    \n-
    27 class Matrix
    \n-
    28 {
    \n-
    29 int rows_;
    \n-
    30 int cols_;
    \n-
    31 std::vector< T > fields_;
    \n-
    32
    \n-
    33 public:
    \n-
    \n-
    34 Matrix ( int rows, int cols )
    \n-
    35 : rows_( rows ),
    \n-
    36 cols_( cols ),
    \n-
    37 fields_( rows * cols )
    \n-
    38 {}
    \n-
    \n-
    39
    \n-
    \n-
    40 const T &operator() ( int i, int j ) const
    \n-
    41 {
    \n-
    42 return fields_[ i * cols_ + j ];
    \n-
    43 }
    \n-
    \n-
    44
    \n-
    \n-
    45 T &operator() ( int i, int j )
    \n-
    46 {
    \n-
    47 return fields_[ i * cols_ + j ];
    \n-
    48 }
    \n-
    \n-
    49
    \n-
    \n-
    50 int rows () const
    \n-
    51 {
    \n-
    52 return rows_;
    \n-
    53 }
    \n-
    \n-
    54
    \n-
    \n-
    55 int cols () const
    \n-
    56 {
    \n-
    57 return cols_;
    \n-
    58 }
    \n-
    \n-
    59 };
    \n-
    \n-
    60
    \n-
    \n-\n-
    62 {
    \n-\n-
    64 std::vector< double > shift;
    \n-
    65
    \n-
    \n-
    66 explicit AffineTransformation ( int dimworld )
    \n-
    67 : matrix( dimworld, dimworld ),
    \n-
    68 shift( dimworld )
    \n-
    69 {}
    \n-
    \n-
    70 };
    \n-
    \n-
    71
    \n-
    72 private:
    \n-
    73 std::vector< AffineTransformation > transformations_;
    \n+
    13namespace Dune {
    \n+
    14
    \n+
    \n+\n+
    17 std::ostream& s;
    \n+
    18 b64chunk chunk;
    \n+
    19 char obuf[4];
    \n+
    20
    \n+
    21 public:
    \n+
    23
    \n+
    \n+
    27 Base64Stream(std::ostream& s_)
    \n+
    28 : s(s_)
    \n+
    29 {
    \n+
    30 // reset chunk
    \n+
    31 chunk.reset();
    \n+
    32 }
    \n+
    \n+
    33
    \n+
    35
    \n+
    41 template <class X>
    \n+
    \n+
    42 void write(X & data)
    \n+
    43 {
    \n+
    44 char* p = reinterpret_cast<char*>(&data);
    \n+
    45 for (size_t len = sizeof(X); len > 0; len--,p++)
    \n+
    46 {
    \n+
    47 chunk.put(*p);
    \n+
    48 if (chunk.size == 3)
    \n+
    49 {
    \n+
    50 chunk.write(obuf);
    \n+
    51 s.write(obuf,4);
    \n+
    52 }
    \n+
    53 }
    \n+
    54 }
    \n+
    \n+
    55
    \n+
    57
    \n+
    \n+
    64 void flush()
    \n+
    65 {
    \n+
    66 if (chunk.size > 0)
    \n+
    67 {
    \n+
    68 chunk.write(obuf);
    \n+
    69 s.write(obuf,4);
    \n+
    70 }
    \n+
    71 }
    \n+
    \n+
    72
    \n
    74
    \n-
    75 // copy not implemented
    \n-\n-
    77
    \n-
    78 public:
    \n-
    79 // initialize block and get dimension of world
    \n-
    80 PeriodicFaceTransformationBlock ( std::istream &in, int dimworld );
    \n+
    \n+\n+
    78 flush();
    \n+
    79 }
    \n+
    \n+
    80 };
    \n+
    \n
    81
    \n-
    \n-
    82 const AffineTransformation &transformation ( int i ) const
    \n-
    83 {
    \n-
    84 assert( i < numTransformations() );
    \n-
    85 return transformations_[ i ];
    \n-
    86 }
    \n-
    \n-
    87
    \n-
    \n-
    88 int numTransformations () const
    \n-
    89 {
    \n-
    90 return transformations_.size();
    \n-
    91 }
    \n-
    \n-
    92
    \n-
    93 private:
    \n-
    94 void match ( char what );
    \n-
    95 };
    \n-
    \n-
    96
    \n-
    97
    \n-
    98
    \n-
    99 // PeriodicFaceTransformationBlock::AffineTransformation
    \n-
    100 // -----------------------------------------------------
    \n+
    \n+\n+
    84 {
    \n+
    85 public:
    \n+
    \n+
    87 inline RawStream (std::ostream& theStream)
    \n+
    88 : s(theStream)
    \n+
    89 {}
    \n+
    \n+
    90
    \n+
    92 template<class T>
    \n+
    \n+
    93 void write (T data)
    \n+
    94 {
    \n+
    95 char* p = reinterpret_cast<char*>(&data);
    \n+
    96 s.write(p,sizeof(T));
    \n+
    97 }
    \n+
    \n+
    98 private:
    \n+
    99 std::ostream& s;
    \n+
    100 };
    \n+
    \n
    101
    \n-
    102
    \n-
    \n-
    103 inline std::ostream &
    \n-\n-
    105 {
    \n-
    106 for( int i = 0; i < trafo.matrix.rows(); ++i )
    \n-
    107 {
    \n-
    108 out << (i > 0 ? ", " : "");
    \n-
    109 for( int j = 0; j < trafo.matrix.cols(); ++j )
    \n-
    110 out << (j > 0 ? " " : "") << trafo.matrix( i, j );
    \n-
    111 }
    \n-
    112 out << " +";
    \n-
    113 for( unsigned int i = 0; i < trafo.shift.size(); ++i )
    \n-
    114 out << " " << trafo.shift[ i ];
    \n-
    115 return out;
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    118 } // end namespace dgf
    \n-
    119
    \n-
    120} // end namespace Dune
    \n-
    121
    \n-
    122#endif
    \n-\n+
    102} // namespace Dune
    \n+
    103
    \n+
    104#endif // DUNE_GRID_IO_FILE_VTK_STREAMS_HH
    \n+
    Simple base64 encode.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval &interval)
    Definition interval.hh:123
    \n-
    Definition basic.hh:31
    \n-
    Definition periodicfacetrans.hh:25
    \n-
    int numTransformations() const
    Definition periodicfacetrans.hh:88
    \n-
    const AffineTransformation & transformation(int i) const
    Definition periodicfacetrans.hh:82
    \n-
    Definition periodicfacetrans.hh:28
    \n-
    int rows() const
    Definition periodicfacetrans.hh:50
    \n-
    const T & operator()(int i, int j) const
    Definition periodicfacetrans.hh:40
    \n-
    int cols() const
    Definition periodicfacetrans.hh:55
    \n-
    Matrix(int rows, int cols)
    Definition periodicfacetrans.hh:34
    \n-\n-
    Matrix< double > matrix
    Definition periodicfacetrans.hh:63
    \n-
    std::vector< double > shift
    Definition periodicfacetrans.hh:64
    \n-
    AffineTransformation(int dimworld)
    Definition periodicfacetrans.hh:66
    \n+
    struct representing the three byte text as well as the four 6 bit chunks
    Definition b64enc.hh:34
    \n+
    void write(char *t)
    Definition b64enc.hh:60
    \n+
    size_type size
    Definition b64enc.hh:36
    \n+
    void put(const char c)
    Definition b64enc.hh:54
    \n+
    void reset()
    Definition b64enc.hh:39
    \n+
    class to base64 encode a stream of data
    Definition streams.hh:16
    \n+
    void write(X &data)
    encode a data item
    Definition streams.hh:42
    \n+
    void flush()
    flush the current unwritten data to the stream.
    Definition streams.hh:64
    \n+
    Base64Stream(std::ostream &s_)
    Construct a Base64Stream.
    Definition streams.hh:27
    \n+
    ~Base64Stream()
    destroy the object
    Definition streams.hh:77
    \n+
    write out data in binary
    Definition streams.hh:84
    \n+
    void write(T data)
    write data to stream
    Definition streams.hh:93
    \n+
    RawStream(std::ostream &theStream)
    make a new stream
    Definition streams.hh:87
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,181 +2,143 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-periodicfacetrans.hh\n+ * vtk\n+streams.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_PERIODICFACETRANSBLOCK_HH\n-6#define DUNE_DGF_PERIODICFACETRANSBLOCK_HH\n-7\n-8#include \n-9#include \n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_STREAMS_HH\n+7#define DUNE_GRID_IO_FILE_VTK_STREAMS_HH\n+8\n+9#include \n 10\n-11#include \n+11#include \n 12\n-13\n-14namespace Dune\n-15{\n-16\n-17 namespace dgf\n-18 {\n-19\n-20 // PeriodicFaceTransformationBlock\n-21 // -------------------------------\n-22\n-23 struct PeriodicFaceTransformationBlock\n-24 : public BasicBlock\n-25 {\n-26 template< class T >\n-27 class Matrix\n-28 {\n-29 int rows_;\n-30 int cols_;\n-31 std::vector< T > fields_;\n-32\n-33 public:\n-34 Matrix ( int rows, int cols )\n-35 : rows_( rows ),\n-36 cols_( cols ),\n-37 fields_( rows * cols )\n-38 {}\n-39\n-40 const T &operator()_( int i, int j ) const\n-41 {\n-42 return fields_[ i * cols_ + j ];\n-43 }\n-44\n-45 T &operator()_( int i, int j )\n+13namespace Dune {\n+14\n+16 class Base64Stream {\n+17 std::ostream& s;\n+18 b64chunk chunk;\n+19 char obuf[4];\n+20\n+21 public:\n+23\n+27 Base64Stream(std::ostream& s_)\n+28 : s(s_)\n+29 {\n+30 // reset chunk\n+31 chunk.reset();\n+32 }\n+33\n+35\n+41 template \n+42 void write(X & data)\n+43 {\n+44 char* p = reinterpret_cast(&data);\n+45 for (size_t len = sizeof(X); len > 0; len--,p++)\n 46 {\n-47 return fields_[ i * cols_ + j ];\n-48 }\n-49\n-50 int rows () const\n-51 {\n-52 return rows_;\n+47 chunk.put(*p);\n+48 if (chunk.size == 3)\n+49 {\n+50 chunk.write(obuf);\n+51 s.write(obuf,4);\n+52 }\n 53 }\n-54\n-55 int cols () const\n-56 {\n-57 return cols_;\n-58 }\n-59 };\n-60\n-61 struct AffineTransformation\n-62 {\n-63 Matrix<_double_> matrix;\n-64 std::vector< double > shift;\n-65\n-66 explicit AffineTransformation ( int dimworld )\n-67 : matrix( dimworld, dimworld ),\n-68 shift( dimworld )\n-69 {}\n-70 };\n-71\n-72 private:\n-73 std::vector< AffineTransformation > transformations_;\n+54 }\n+55\n+57\n+64 void flush()\n+65 {\n+66 if (chunk.size > 0)\n+67 {\n+68 chunk.write(obuf);\n+69 s.write(obuf,4);\n+70 }\n+71 }\n+72\n 74\n-75 // copy not implemented\n-76 PeriodicFaceTransformationBlock ( const PeriodicFaceTransformationBlock & );\n-77\n-78 public:\n-79 // initialize block and get dimension of world\n-80 PeriodicFaceTransformationBlock ( std::istream &in, int dimworld );\n+77 ~Base64Stream() {\n+78 flush();\n+79 }\n+80 };\n 81\n-82 const AffineTransformation &transformation ( int i ) const\n-83 {\n-84 assert( i < numTransformations() );\n-85 return transformations_[ i ];\n-86 }\n-87\n-88 int numTransformations () const\n-89 {\n-90 return transformations_.size();\n-91 }\n-92\n-93 private:\n-94 void match ( char what );\n-95 };\n-96\n-97\n-98\n-99 // PeriodicFaceTransformationBlock::AffineTransformation\n-100 // -----------------------------------------------------\n+83 class RawStream\n+84 {\n+85 public:\n+87 inline RawStream (std::ostream& theStream)\n+88 : s(theStream)\n+89 {}\n+90\n+92 template\n+93 void write (T data)\n+94 {\n+95 char* p = reinterpret_cast(&data);\n+96 s.write(p,sizeof(T));\n+97 }\n+98 private:\n+99 std::ostream& s;\n+100 };\n 101\n-102\n-103 inline std::ostream &\n-104 operator<<_( std::ostream &out, const PeriodicFaceTransformationBlock::\n-AffineTransformation &trafo )\n-105 {\n-106 for( int i = 0; i < trafo.matrix.rows(); ++i )\n-107 {\n-108 out << (i > 0 ? \", \" : \"\");\n-109 for( int j = 0; j < trafo.matrix.cols(); ++j )\n-110 out << (j > 0 ? \" \" : \"\") << trafo.matrix( i, j );\n-111 }\n-112 out << \" +\";\n-113 for( unsigned int i = 0; i < trafo.shift.size(); ++i )\n-114 out << \" \" << trafo.shift[ i ];\n-115 return out;\n-116 }\n-117\n-118 } // end namespace dgf\n-119\n-120} // end namespace Dune\n-121\n-122#endif\n-basic.hh\n+102} // namespace Dune\n+103\n+104#endif // DUNE_GRID_IO_FILE_VTK_STREAMS_HH\n+b64enc.hh\n+Simple base64 encode.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::operator<<\n-std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval\n-&interval)\n-Definition interval.hh:123\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::PeriodicFaceTransformationBlock\n-Definition periodicfacetrans.hh:25\n-Dune::dgf::PeriodicFaceTransformationBlock::numTransformations\n-int numTransformations() const\n-Definition periodicfacetrans.hh:88\n-Dune::dgf::PeriodicFaceTransformationBlock::transformation\n-const AffineTransformation & transformation(int i) const\n-Definition periodicfacetrans.hh:82\n-Dune::dgf::PeriodicFaceTransformationBlock::Matrix\n-Definition periodicfacetrans.hh:28\n-Dune::dgf::PeriodicFaceTransformationBlock::Matrix::rows\n-int rows() const\n-Definition periodicfacetrans.hh:50\n-Dune::dgf::PeriodicFaceTransformationBlock::Matrix::operator()\n-const T & operator()(int i, int j) const\n-Definition periodicfacetrans.hh:40\n-Dune::dgf::PeriodicFaceTransformationBlock::Matrix::cols\n-int cols() const\n-Definition periodicfacetrans.hh:55\n-Dune::dgf::PeriodicFaceTransformationBlock::Matrix::Matrix\n-Matrix(int rows, int cols)\n-Definition periodicfacetrans.hh:34\n-Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation\n-Definition periodicfacetrans.hh:62\n-Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation::matrix\n-Matrix< double > matrix\n-Definition periodicfacetrans.hh:63\n-Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation::shift\n-std::vector< double > shift\n-Definition periodicfacetrans.hh:64\n-Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation::\n-AffineTransformation\n-AffineTransformation(int dimworld)\n-Definition periodicfacetrans.hh:66\n+Dune::b64chunk\n+struct representing the three byte text as well as the four 6 bit chunks\n+Definition b64enc.hh:34\n+Dune::b64chunk::write\n+void write(char *t)\n+Definition b64enc.hh:60\n+Dune::b64chunk::size\n+size_type size\n+Definition b64enc.hh:36\n+Dune::b64chunk::put\n+void put(const char c)\n+Definition b64enc.hh:54\n+Dune::b64chunk::reset\n+void reset()\n+Definition b64enc.hh:39\n+Dune::Base64Stream\n+class to base64 encode a stream of data\n+Definition streams.hh:16\n+Dune::Base64Stream::write\n+void write(X &data)\n+encode a data item\n+Definition streams.hh:42\n+Dune::Base64Stream::flush\n+void flush()\n+flush the current unwritten data to the stream.\n+Definition streams.hh:64\n+Dune::Base64Stream::Base64Stream\n+Base64Stream(std::ostream &s_)\n+Construct a Base64Stream.\n+Definition streams.hh:27\n+Dune::Base64Stream::~Base64Stream\n+~Base64Stream()\n+destroy the object\n+Definition streams.hh:77\n+Dune::RawStream\n+write out data in binary\n+Definition streams.hh:84\n+Dune::RawStream::write\n+void write(T data)\n+write data to stream\n+Definition streams.hh:93\n+Dune::RawStream::RawStream\n+RawStream(std::ostream &theStream)\n+make a new stream\n+Definition streams.hh:87\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00812.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00812.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dim.hh File Reference\n+dune-grid: functionwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,40 +65,69 @@\n \n \n \n \n \n \n \n
    \n \n-
    dim.hh File Reference
    \n+
    functionwriter.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+
    #include <cstddef>
    \n+#include <memory>
    \n+#include <string>
    \n+#include <typeinfo>
    \n+#include <vector>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <dune/grid/io/file/vtk/dataarraywriter.hh>
    \n+#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n+#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::dgf::DimBlock
    class  Dune::VTK::FunctionWriterBase< Cell_ >
     Base class for function writers. More...
     
    class  Dune::VTK::VTKFunctionWriter< Func >
     Base class for function writers. More...
     
    class  Dune::VTK::CoordinatesWriter< Cell >
     writer for the Coordinates array More...
     
    class  Dune::VTK::ConformingConnectivityWriter< IteratorFactory >
     writer for the connectivity array in conforming mode More...
     
    class  Dune::VTK::NonConformingConnectivityWriter< Cell >
     writer for the connectivity array in nonconforming mode More...
     
    class  Dune::VTK::OffsetsWriter< Cell >
     writer for the offsets array More...
     
    class  Dune::VTK::TypesWriter< Cell >
     writer for the types array More...
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,25 +2,53 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n+ * vtk\n Classes | Namespaces\n-dim.hh File Reference\n-#include \n-#include \n+functionwriter.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::dgf::DimBlock\n+class \u00a0 Dune::VTK::FunctionWriterBase<_Cell__>\n+\u00a0 Base class for function writers. More...\n+\u00a0\n+class \u00a0 Dune::VTK::VTKFunctionWriter<_Func_>\n+\u00a0 Base class for function writers. More...\n+\u00a0\n+class \u00a0 Dune::VTK::CoordinatesWriter<_Cell_>\n+\u00a0 writer for the Coordinates array More...\n+\u00a0\n+class \u00a0 Dune::VTK::ConformingConnectivityWriter<_IteratorFactory_>\n+\u00a0 writer for the connectivity array in conforming mode More...\n+\u00a0\n+class \u00a0 Dune::VTK::NonConformingConnectivityWriter<_Cell_>\n+\u00a0 writer for the connectivity array in nonconforming mode More...\n+\u00a0\n+class \u00a0 Dune::VTK::OffsetsWriter<_Cell_>\n+\u00a0 writer for the offsets array More...\n+\u00a0\n+class \u00a0 Dune::VTK::TypesWriter<_Cell_>\n+\u00a0 writer for the types array More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00812_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00812_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dim.hh Source File\n+dune-grid: functionwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,79 +70,479 @@\n
    \n \n \n \n \n \n \n
    \n-
    dim.hh
    \n+
    functionwriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_DIMBLOCK_HH
    \n-
    6#define DUNE_DGF_DIMBLOCK_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9
    \n-\n-
    11
    \n-
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n-
    15
    \n-
    16 namespace dgf
    \n-
    17 {
    \n-
    \n-
    18 class DimBlock : public BasicBlock {
    \n-
    19 int _dimworld; // dimension of world
    \n-
    20 int _dim; // dimension of grid
    \n-
    21 public:
    \n-
    22 const static char* ID;
    \n-
    23 // initialize block and get dimension of world
    \n-
    24 DimBlock ( std :: istream &in );
    \n-
    25 // get dimension of world found in block
    \n-
    \n-
    26 int dim() {
    \n-
    27 return _dim;
    \n-
    28 }
    \n-
    \n-
    \n-
    29 int dimworld() {
    \n-
    30 return _dimworld;
    \n-
    31 }
    \n-
    \n-
    32 // some information
    \n-
    \n-
    33 bool ok() {
    \n-
    34 return true;
    \n-
    35 }
    \n-
    \n-
    36 };
    \n-
    \n-
    37
    \n-
    38 } // end namespace dgf
    \n-
    39
    \n-
    40} // end namespace Dune
    \n-
    41
    \n-
    42#endif
    \n-\n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH
    \n+
    8
    \n+
    9#include <cstddef>
    \n+
    10#include <memory>
    \n+
    11#include <string>
    \n+
    12#include <typeinfo>
    \n+
    13#include <vector>
    \n+
    14
    \n+
    15#include <dune/common/exceptions.hh>
    \n+
    16#include <dune/common/fvector.hh>
    \n+
    17
    \n+
    18#include <dune/geometry/referenceelements.hh>
    \n+
    19
    \n+\n+\n+\n+\n+
    24
    \n+
    25namespace Dune
    \n+
    26{
    \n+
    29
    \n+
    30 namespace VTK {
    \n+
    31
    \n+
    33 template<typename Cell_>
    \n+
    \n+\n+
    35 typedef typename Cell_::Geometry::ctype DF;
    \n+
    36 static const unsigned mydim = Cell_::mydimension;
    \n+
    37 typedef ReferenceElements<DF, mydim> Refelems;
    \n+
    38
    \n+
    39 public:
    \n+
    40 typedef FieldVector<DF, mydim> Domain;
    \n+
    41 typedef Cell_ Cell;
    \n+
    42
    \n+
    44 virtual std::string name() const = 0;
    \n+
    45
    \n+
    47 virtual unsigned ncomps() const = 0;
    \n+
    48
    \n+
    50 virtual void addArray(PVTUWriter& writer) = 0;
    \n+
    52 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) = 0;
    \n+
    54
    \n+
    \n+
    59 virtual void write(const Cell& /* cell */, const Domain& /* xl */) {
    \n+
    60 DUNE_THROW(NotImplemented, "FunctionWriterBase::write(const Cell&, "
    \n+
    61 "const Domain&): Either the derived class " <<
    \n+
    62 typeid(*this).name() << " failed to implement this method "
    \n+
    63 "or this method is not meant to be called on the derived "
    \n+
    64 "class and was called in error.");
    \n+
    65 }
    \n+
    \n+
    67
    \n+
    \n+
    71 virtual void write(const Cell& cell, unsigned cornerIndex) {
    \n+
    72 write(cell,
    \n+
    73 Refelems::general(cell.type()).position(cornerIndex, mydim));
    \n+
    74 }
    \n+
    \n+
    76 virtual void endWrite() = 0;
    \n+\n+
    79 };
    \n+
    \n+
    80
    \n+
    82 //
    \n+
    83 // A Generic Function writer for VTKFunctions
    \n+
    84 //
    \n+
    85
    \n+
    87 template<typename Func>
    \n+
    \n+\n+
    89 : public FunctionWriterBase<typename Func::Entity>
    \n+
    90 {
    \n+\n+
    92 std::shared_ptr<const Func> func;
    \n+
    93 VTK::Precision precision_;
    \n+
    94 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    95
    \n+
    96 public:
    \n+
    \n+
    97 VTKFunctionWriter(const std::shared_ptr<const Func>& func_,
    \n+\n+
    99 : func(func_), precision_(prec)
    \n+
    100 { }
    \n+
    \n+
    101
    \n+
    103 virtual std::string name() const { return func->name(); }
    \n+
    104
    \n+
    \n+
    106 virtual unsigned ncomps() const {
    \n+
    107 if(func->ncomps() == 2) return 3;
    \n+
    108 else return func->ncomps();
    \n+
    109 }
    \n+
    \n+
    110
    \n+
    \n+
    112 virtual void addArray(PVTUWriter& writer) {
    \n+
    113 writer.addArray(name(), ncomps(), precision_);
    \n+
    114 }
    \n+
    \n+
    115
    \n+
    \n+
    117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n+
    119 nitems, precision_));
    \n+
    120 return !arraywriter->writeIsNoop();
    \n+
    121 }
    \n+
    \n+
    122
    \n+
    \n+
    124 virtual void write(const typename Base::Cell& cell,
    \n+
    125 const typename Base::Domain& xl) {
    \n+
    126 for(int d = 0; d < func->ncomps(); ++d)
    \n+
    127 arraywriter->write(func->evaluate(d, cell, xl));
    \n+
    128 for(unsigned d = func->ncomps(); d < ncomps(); ++d)
    \n+
    129 arraywriter->write(0);
    \n+
    130 }
    \n+
    \n+
    131
    \n+
    \n+
    133 virtual void endWrite() {
    \n+
    134 arraywriter.reset();
    \n+
    135 }
    \n+
    \n+
    136 };
    \n+
    \n+
    137
    \n+
    139 //
    \n+
    140 // Writers for the grid information
    \n+
    141 //
    \n+
    142
    \n+
    144 template<typename Cell>
    \n+
    \n+\n+
    146 : public FunctionWriterBase<Cell>
    \n+
    147 {
    \n+\n+
    149
    \n+
    150 VTK::Precision precision_;
    \n+
    151 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    152
    \n+
    153 public:
    \n+
    \n+\n+
    155 : precision_(prec)
    \n+
    156 {}
    \n+
    \n+
    157
    \n+
    159 virtual std::string name() const { return "Coordinates"; }
    \n+
    160
    \n+
    162 virtual unsigned ncomps() const { return 3; }
    \n+
    163
    \n+
    \n+
    165 virtual void addArray(PVTUWriter& writer) {
    \n+
    166 writer.addArray(name(), ncomps(), precision_);
    \n+
    167 }
    \n+
    \n+
    168
    \n+
    \n+
    170 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    171 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n+
    172 nitems, precision_));
    \n+
    173 return !arraywriter->writeIsNoop();
    \n+
    174 }
    \n+
    \n+
    \n+
    176 virtual void write(const typename Base::Cell& cell,
    \n+
    177 const typename Base::Domain& xl) {
    \n+
    178 FieldVector<typename Base::Cell::Geometry::ctype, Base::Cell::Geometry::coorddimension> xg
    \n+
    179 = cell.geometry().global(xl);
    \n+
    180 for(unsigned d = 0; d < 3 && d < Base::Cell::Geometry::coorddimension; ++d)
    \n+
    181 arraywriter->write(xg[d]);
    \n+
    182 for(unsigned d = Base::Cell::Geometry::coorddimension; d < 3; ++d)
    \n+
    183 arraywriter->write(0);
    \n+
    184 }
    \n+
    \n+
    \n+
    186 virtual void endWrite() {
    \n+
    187 arraywriter.reset();
    \n+
    188 }
    \n+
    \n+
    189 };
    \n+
    \n+
    190
    \n+
    192 template<typename IteratorFactory>
    \n+
    \n+\n+
    194 : public FunctionWriterBase<typename IteratorFactory::Cell>
    \n+
    195 {
    \n+\n+
    197 static const unsigned mydim = Base::Cell::mydimension;
    \n+
    198
    \n+
    199 const IteratorFactory& factory;
    \n+
    200 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    201 std::vector<unsigned> pointIndices;
    \n+
    202
    \n+
    203 public:
    \n+
    \n+
    205 ConformingConnectivityWriter(const IteratorFactory& factory_)
    \n+
    206 : factory(factory_)
    \n+
    207 { }
    \n+
    \n+
    208
    \n+
    210 virtual std::string name() const { return "connectivity"; }
    \n+
    211
    \n+
    213 virtual unsigned ncomps() const { return 1; }
    \n+
    214
    \n+
    \n+
    216 virtual void addArray(PVTUWriter& writer) {
    \n+
    217 writer.addArray(name(), ncomps(), Precision::int32);
    \n+
    218 }
    \n+
    \n+
    219
    \n+
    \n+
    221 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    222 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n+
    223 nitems, Precision::int32));
    \n+
    224 if(arraywriter->writeIsNoop())
    \n+
    225 return false;
    \n+
    226
    \n+
    228 pointIndices.resize(factory.indexSet().size(mydim));
    \n+
    229 const typename IteratorFactory::PointIterator& pend =
    \n+
    230 factory.endPoints();
    \n+
    231 typename IteratorFactory::PointIterator pit = factory.beginPoints();
    \n+
    232 unsigned counter = 0;
    \n+
    233 while(pit != pend) {
    \n+
    234 pointIndices[factory.indexSet().subIndex
    \n+
    235 (pit->cell(), pit->duneIndex(), mydim)] = counter;
    \n+
    236 ++counter;
    \n+
    237 ++pit;
    \n+
    238 }
    \n+
    239 return true;
    \n+
    240 }
    \n+
    \n+
    \n+
    242 virtual void write(const typename Base::Cell& cell, unsigned cornerIndex)
    \n+
    243 {
    \n+
    244 // if pointIndices is empty, we're in writeIsNoop mode
    \n+
    245 if(pointIndices.size() == 0)
    \n+
    246 return;
    \n+
    247 arraywriter->write(pointIndices[factory.indexSet().subIndex
    \n+
    248 (cell, cornerIndex, mydim)]);
    \n+
    249 }
    \n+
    \n+
    \n+
    251 virtual void endWrite() {
    \n+
    252 arraywriter.reset();
    \n+
    253 pointIndices.clear();
    \n+
    254 }
    \n+
    \n+
    255 };
    \n+
    \n+
    256
    \n+
    258 template<typename Cell>
    \n+
    \n+\n+
    260 : public FunctionWriterBase<Cell>
    \n+
    261 {
    \n+
    262 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    263 unsigned counter;
    \n+
    264
    \n+
    265 public:
    \n+
    267 virtual std::string name() const { return "connectivity"; }
    \n+
    268
    \n+
    270 virtual unsigned ncomps() const { return 1; }
    \n+
    271
    \n+
    \n+
    273 virtual void addArray(PVTUWriter& writer) {
    \n+
    274 writer.addArray(name(), ncomps(), Precision::int32);
    \n+
    275 }
    \n+
    \n+
    276
    \n+
    \n+
    278 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    279 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n+
    280 nitems, Precision::int32));
    \n+
    281 counter = 0;
    \n+
    282 return !arraywriter->writeIsNoop();
    \n+
    283 }
    \n+
    \n+
    \n+
    285 virtual void write(const Cell& /* cell */, unsigned /* cornerIndex */)
    \n+
    286 {
    \n+
    287 arraywriter->write(counter);
    \n+
    288 ++counter;
    \n+
    289 }
    \n+
    \n+
    \n+
    291 virtual void endWrite() {
    \n+
    292 arraywriter.reset();
    \n+
    293 }
    \n+
    \n+
    294 };
    \n+
    \n+
    295
    \n+
    297 template<typename Cell>
    \n+
    \n+\n+
    299 : public FunctionWriterBase<Cell>
    \n+
    300 {
    \n+\n+
    302
    \n+
    303 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    304 unsigned offset;
    \n+
    305
    \n+
    306 public:
    \n+
    308 virtual std::string name() const { return "offsets"; }
    \n+
    309
    \n+
    311 virtual unsigned ncomps() const { return 1; }
    \n+
    312
    \n+
    \n+
    314 virtual void addArray(PVTUWriter& writer) {
    \n+
    315 writer.addArray(name(), ncomps(), Precision::int32);
    \n+
    316 }
    \n+
    \n+
    317
    \n+
    \n+
    319 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    320 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n+
    321 nitems, Precision::int32));
    \n+
    322 offset = 0;
    \n+
    323 return !arraywriter->writeIsNoop();
    \n+
    324 }
    \n+
    \n+
    \n+
    326 virtual void write(const Cell& cell, const typename Base::Domain&) {
    \n+
    327 offset += cell.geometry().corners();
    \n+
    328 arraywriter->write(offset);
    \n+
    329 }
    \n+
    \n+
    \n+
    331 virtual void endWrite() {
    \n+
    332 arraywriter.reset();
    \n+
    333 }
    \n+
    \n+
    334 };
    \n+
    \n+
    335
    \n+
    337 template<typename Cell>
    \n+
    \n+\n+
    339 : public FunctionWriterBase<Cell>
    \n+
    340 {
    \n+\n+
    342
    \n+
    343 std::shared_ptr<DataArrayWriter> arraywriter;
    \n+
    344
    \n+
    345 public:
    \n+
    347 virtual std::string name() const { return "types"; }
    \n+
    348
    \n+
    350 virtual unsigned ncomps() const { return 1; }
    \n+
    351
    \n+
    \n+
    353 virtual void addArray(PVTUWriter& writer) {
    \n+
    354 writer.addArray(name(), ncomps(), Precision::uint8);
    \n+
    355 }
    \n+
    \n+
    356
    \n+
    \n+
    358 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n+
    359 arraywriter.reset(writer.makeArrayWriter
    \n+
    360 ( name(), ncomps(), nitems, Precision::uint8));
    \n+
    361 return !arraywriter->writeIsNoop();
    \n+
    362 }
    \n+
    \n+
    \n+
    364 virtual void write(const Cell& cell, const typename Base::Domain&) {
    \n+
    365 arraywriter->write(geometryType(cell.type()));
    \n+
    366 }
    \n+
    \n+
    \n+
    368 virtual void endWrite() {
    \n+
    369 arraywriter.reset();
    \n+
    370 }
    \n+
    \n+
    371 };
    \n+
    \n+
    372
    \n+
    373 } // namespace VTK
    \n+
    374
    \n+
    376
    \n+
    377} // namespace Dune
    \n+
    378
    \n+
    379#endif // DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH
    \n+
    Data array writers for the VTKWriter.
    \n+\n+\n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    Definition dim.hh:18
    \n-
    int dimworld()
    Definition dim.hh:29
    \n-
    static const char * ID
    Definition dim.hh:22
    \n-
    bool ok()
    Definition dim.hh:33
    \n-
    int dim()
    Definition dim.hh:26
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+\n+\n+
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n+
    Base class for function writers.
    Definition functionwriter.hh:34
    \n+
    virtual std::string name() const =0
    return name
    \n+
    virtual unsigned ncomps() const =0
    return number of components of the vector
    \n+
    virtual void write(const Cell &, const Domain &)
    write at the given position
    Definition functionwriter.hh:59
    \n+
    Cell_ Cell
    Definition functionwriter.hh:41
    \n+
    virtual void addArray(PVTUWriter &writer)=0
    add this field to the given parallel writer
    \n+
    virtual void endWrite()=0
    signal end of writing
    \n+
    FieldVector< DF, mydim > Domain
    Definition functionwriter.hh:40
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0
    start writing with the given writer
    \n+
    virtual ~FunctionWriterBase()
    destructor
    Definition functionwriter.hh:78
    \n+
    virtual void write(const Cell &cell, unsigned cornerIndex)
    write at the given corner
    Definition functionwriter.hh:71
    \n+
    Base class for function writers.
    Definition functionwriter.hh:90
    \n+
    VTKFunctionWriter(const std::shared_ptr< const Func > &func_, VTK::Precision prec=VTK::Precision::float32)
    Definition functionwriter.hh:97
    \n+
    virtual std::string name() const
    return name
    Definition functionwriter.hh:103
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:106
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:117
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:112
    \n+
    virtual void write(const typename Base::Cell &cell, const typename Base::Domain &xl)
    write at the given position
    Definition functionwriter.hh:124
    \n+
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:133
    \n+
    writer for the Coordinates array
    Definition functionwriter.hh:147
    \n+
    virtual void write(const typename Base::Cell &cell, const typename Base::Domain &xl)
    write at the given position
    Definition functionwriter.hh:176
    \n+
    virtual std::string name() const
    return name
    Definition functionwriter.hh:159
    \n+
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:186
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:162
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:165
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:170
    \n+
    CoordinatesWriter(VTK::Precision prec=VTK::Precision::float32)
    Definition functionwriter.hh:154
    \n+
    writer for the connectivity array in conforming mode
    Definition functionwriter.hh:195
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:216
    \n+
    virtual std::string name() const
    return name
    Definition functionwriter.hh:210
    \n+
    virtual void write(const typename Base::Cell &cell, unsigned cornerIndex)
    write at the given corner
    Definition functionwriter.hh:242
    \n+
    ConformingConnectivityWriter(const IteratorFactory &factory_)
    create a writer with the given iteratorfactory
    Definition functionwriter.hh:205
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:213
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:221
    \n+
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:251
    \n+
    writer for the connectivity array in nonconforming mode
    Definition functionwriter.hh:261
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:270
    \n+
    virtual std::string name() const
    return name
    Definition functionwriter.hh:267
    \n+
    virtual void write(const Cell &, unsigned)
    write at the given corner
    Definition functionwriter.hh:285
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:273
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:278
    \n+
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:291
    \n+
    writer for the offsets array
    Definition functionwriter.hh:300
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:314
    \n+
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:331
    \n+
    virtual std::string name() const
    return name
    Definition functionwriter.hh:308
    \n+
    virtual void write(const Cell &cell, const typename Base::Domain &)
    write at the given position
    Definition functionwriter.hh:326
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:319
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:311
    \n+
    writer for the types array
    Definition functionwriter.hh:340
    \n+
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:350
    \n+
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:358
    \n+
    virtual std::string name() const
    return name
    Definition functionwriter.hh:347
    \n+
    virtual void write(const Cell &cell, const typename Base::Domain &)
    write at the given position
    Definition functionwriter.hh:364
    \n+
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:353
    \n+
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:368
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n+
    void addArray(const std::string &name, unsigned ncomps, Precision prec)
    Add an array to the output file.
    Definition pvtuwriter.hh:207
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n+
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,76 +2,577 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-dim.hh\n+ * vtk\n+functionwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_DIMBLOCK_HH\n-6#define DUNE_DGF_DIMBLOCK_HH\n-7\n-8#include \n-9\n-10#include \n-11\n-12\n-13namespace Dune\n-14{\n-15\n-16 namespace dgf\n-17 {\n-18 class DimBlock : public BasicBlock {\n-19 int _dimworld; // dimension of world\n-20 int _dim; // dimension of grid\n-21 public:\n-22 const static char* ID;\n-23 // initialize block and get dimension of world\n-24 DimBlock ( std :: istream &in );\n-25 // get dimension of world found in block\n-26 int dim() {\n-27 return _dim;\n-28 }\n-29 int dimworld() {\n-30 return _dimworld;\n-31 }\n-32 // some information\n-33 bool ok() {\n-34 return true;\n-35 }\n-36 };\n-37\n-38 } // end namespace dgf\n-39\n-40} // end namespace Dune\n-41\n-42#endif\n-basic.hh\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14\n+15#include \n+16#include \n+17\n+18#include \n+19\n+20#include \n+21#include \n+22#include \n+23#include \n+24\n+25namespace Dune\n+26{\n+29\n+30 namespace VTK {\n+31\n+33 template\n+34 class FunctionWriterBase {\n+35 typedef typename Cell_::Geometry::ctype DF;\n+36 static const unsigned mydim = Cell_::mydimension;\n+37 typedef ReferenceElements Refelems;\n+38\n+39 public:\n+40 typedef FieldVector Domain;\n+41 typedef Cell_ Cell;\n+42\n+44 virtual std::string name() const = 0;\n+45\n+47 virtual unsigned ncomps() const = 0;\n+48\n+50 virtual void addArray(PVTUWriter& writer) = 0;\n+52 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) = 0;\n+54\n+59 virtual void write(const Cell& /* cell */, const Domain& /* xl */) {\n+60 DUNE_THROW(NotImplemented, \"FunctionWriterBase::write(const Cell&, \"\n+61 \"const Domain&): Either the derived class \" <<\n+62 typeid(*this).name() << \" failed to implement this method \"\n+63 \"or this method is not meant to be called on the derived \"\n+64 \"class and was called in error.\");\n+65 }\n+67\n+71 virtual void write(const Cell& cell, unsigned cornerIndex) {\n+72 write(cell,\n+73 Refelems::general(cell.type()).position(cornerIndex, mydim));\n+74 }\n+76 virtual void endWrite() = 0;\n+78 virtual ~FunctionWriterBase() {}\n+79 };\n+80\n+82 //\n+83 // A Generic Function writer for VTKFunctions\n+84 //\n+85\n+87 template\n+88 class VTKFunctionWriter\n+89 : public FunctionWriterBase\n+90 {\n+91 typedef FunctionWriterBase Base;\n+92 std::shared_ptr func;\n+93 VTK::Precision precision_;\n+94 std::shared_ptr arraywriter;\n+95\n+96 public:\n+97 VTKFunctionWriter(const std::shared_ptr& func_,\n+98 VTK::Precision prec = VTK::Precision::float32)\n+99 : func(func_), precision_(prec)\n+100 { }\n+101\n+103 virtual std::string name() const { return func->name(); }\n+104\n+106 virtual unsigned ncomps() const {\n+107 if(func->ncomps() == 2) return 3;\n+108 else return func->ncomps();\n+109 }\n+110\n+112 virtual void addArray(PVTUWriter& writer) {\n+113 writer.addArray(name(), ncomps(), precision_);\n+114 }\n+115\n+117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n+119 nitems, precision_));\n+120 return !arraywriter->writeIsNoop();\n+121 }\n+122\n+124 virtual void write(const typename Base::Cell& cell,\n+125 const typename Base::Domain& xl) {\n+126 for(int d = 0; d < func->ncomps(); ++d)\n+127 arraywriter->write(func->evaluate(d, cell, xl));\n+128 for(unsigned d = func->ncomps(); d < ncomps(); ++d)\n+129 arraywriter->write(0);\n+130 }\n+131\n+133 virtual void endWrite() {\n+134 arraywriter.reset();\n+135 }\n+136 };\n+137\n+139 //\n+140 // Writers for the grid information\n+141 //\n+142\n+144 template\n+145 class CoordinatesWriter\n+146 : public FunctionWriterBase\n+147 {\n+148 typedef FunctionWriterBase Base;\n+149\n+150 VTK::Precision precision_;\n+151 std::shared_ptr arraywriter;\n+152\n+153 public:\n+154 explicit CoordinatesWriter(VTK::Precision prec = VTK::Precision::float32)\n+155 : precision_(prec)\n+156 {}\n+157\n+159 virtual std::string name() const { return \"Coordinates\"; }\n+160\n+162 virtual unsigned ncomps() const { return 3; }\n+163\n+165 virtual void addArray(PVTUWriter& writer) {\n+166 writer.addArray(name(), ncomps(), precision_);\n+167 }\n+168\n+170 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+171 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n+172 nitems, precision_));\n+173 return !arraywriter->writeIsNoop();\n+174 }\n+176 virtual void write(const typename Base::Cell& cell,\n+177 const typename Base::Domain& xl) {\n+178 FieldVector xg\n+179 = cell.geometry().global(xl);\n+180 for(unsigned d = 0; d < 3 && d < Base::Cell::Geometry::coorddimension; ++d)\n+181 arraywriter->write(xg[d]);\n+182 for(unsigned d = Base::Cell::Geometry::coorddimension; d < 3; ++d)\n+183 arraywriter->write(0);\n+184 }\n+186 virtual void endWrite() {\n+187 arraywriter.reset();\n+188 }\n+189 };\n+190\n+192 template\n+193 class ConformingConnectivityWriter\n+194 : public FunctionWriterBase\n+195 {\n+196 typedef FunctionWriterBase Base;\n+197 static const unsigned mydim = Base::Cell::mydimension;\n+198\n+199 const IteratorFactory& factory;\n+200 std::shared_ptr arraywriter;\n+201 std::vector pointIndices;\n+202\n+203 public:\n+205 ConformingConnectivityWriter(const IteratorFactory& factory_)\n+206 : factory(factory_)\n+207 { }\n+208\n+210 virtual std::string name() const { return \"connectivity\"; }\n+211\n+213 virtual unsigned ncomps() const { return 1; }\n+214\n+216 virtual void addArray(PVTUWriter& writer) {\n+217 writer.addArray(name(), ncomps(), Precision::int32);\n+218 }\n+219\n+221 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+222 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n+223 nitems, Precision::int32));\n+224 if(arraywriter->writeIsNoop())\n+225 return false;\n+226\n+228 pointIndices.resize(factory.indexSet().size(mydim));\n+229 const typename IteratorFactory::PointIterator& pend =\n+230 factory.endPoints();\n+231 typename IteratorFactory::PointIterator pit = factory.beginPoints();\n+232 unsigned counter = 0;\n+233 while(pit != pend) {\n+234 pointIndices[factory.indexSet().subIndex\n+235 (pit->cell(), pit->duneIndex(), mydim)] = counter;\n+236 ++counter;\n+237 ++pit;\n+238 }\n+239 return true;\n+240 }\n+242 virtual void write(const typename Base::Cell& cell, unsigned cornerIndex)\n+243 {\n+244 // if pointIndices is empty, we're in writeIsNoop mode\n+245 if(pointIndices.size() == 0)\n+246 return;\n+247 arraywriter->write(pointIndices[factory.indexSet().subIndex\n+248 (cell, cornerIndex, mydim)]);\n+249 }\n+251 virtual void endWrite() {\n+252 arraywriter.reset();\n+253 pointIndices.clear();\n+254 }\n+255 };\n+256\n+258 template\n+259 class NonConformingConnectivityWriter\n+260 : public FunctionWriterBase\n+261 {\n+262 std::shared_ptr arraywriter;\n+263 unsigned counter;\n+264\n+265 public:\n+267 virtual std::string name() const { return \"connectivity\"; }\n+268\n+270 virtual unsigned ncomps() const { return 1; }\n+271\n+273 virtual void addArray(PVTUWriter& writer) {\n+274 writer.addArray(name(), ncomps(), Precision::int32);\n+275 }\n+276\n+278 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+279 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n+280 nitems, Precision::int32));\n+281 counter = 0;\n+282 return !arraywriter->writeIsNoop();\n+283 }\n+285 virtual void write(const Cell& /* cell */, unsigned /* cornerIndex */)\n+286 {\n+287 arraywriter->write(counter);\n+288 ++counter;\n+289 }\n+291 virtual void endWrite() {\n+292 arraywriter.reset();\n+293 }\n+294 };\n+295\n+297 template\n+298 class OffsetsWriter\n+299 : public FunctionWriterBase\n+300 {\n+301 typedef FunctionWriterBase Base;\n+302\n+303 std::shared_ptr arraywriter;\n+304 unsigned offset;\n+305\n+306 public:\n+308 virtual std::string name() const { return \"offsets\"; }\n+309\n+311 virtual unsigned ncomps() const { return 1; }\n+312\n+314 virtual void addArray(PVTUWriter& writer) {\n+315 writer.addArray(name(), ncomps(), Precision::int32);\n+316 }\n+317\n+319 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+320 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n+321 nitems, Precision::int32));\n+322 offset = 0;\n+323 return !arraywriter->writeIsNoop();\n+324 }\n+326 virtual void write(const Cell& cell, const typename Base::Domain&) {\n+327 offset += cell.geometry().corners();\n+328 arraywriter->write(offset);\n+329 }\n+331 virtual void endWrite() {\n+332 arraywriter.reset();\n+333 }\n+334 };\n+335\n+337 template\n+338 class TypesWriter\n+339 : public FunctionWriterBase\n+340 {\n+341 typedef FunctionWriterBase Base;\n+342\n+343 std::shared_ptr arraywriter;\n+344\n+345 public:\n+347 virtual std::string name() const { return \"types\"; }\n+348\n+350 virtual unsigned ncomps() const { return 1; }\n+351\n+353 virtual void addArray(PVTUWriter& writer) {\n+354 writer.addArray(name(), ncomps(), Precision::uint8);\n+355 }\n+356\n+358 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n+359 arraywriter.reset(writer.makeArrayWriter\n+360 ( name(), ncomps(), nitems, Precision::uint8));\n+361 return !arraywriter->writeIsNoop();\n+362 }\n+364 virtual void write(const Cell& cell, const typename Base::Domain&) {\n+365 arraywriter->write(geometryType(cell.type()));\n+366 }\n+368 virtual void endWrite() {\n+369 arraywriter.reset();\n+370 }\n+371 };\n+372\n+373 } // namespace VTK\n+374\n+376\n+377} // namespace Dune\n+378\n+379#endif // DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH\n+dataarraywriter.hh\n+Data array writers for the VTKWriter.\n+vtuwriter.hh\n+pvtuwriter.hh\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::DimBlock\n-Definition dim.hh:18\n-Dune::dgf::DimBlock::dimworld\n-int dimworld()\n-Definition dim.hh:29\n-Dune::dgf::DimBlock::ID\n-static const char * ID\n-Definition dim.hh:22\n-Dune::dgf::DimBlock::ok\n-bool ok()\n-Definition dim.hh:33\n-Dune::dgf::DimBlock::dim\n-int dim()\n-Definition dim.hh:26\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::int32\n+@ int32\n+Dune::VTK::Precision::uint8\n+@ uint8\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::VTK::geometryType\n+GeometryType geometryType(const Dune::GeometryType &t)\n+mapping from GeometryType to VTKGeometryType\n+Definition common.hh:151\n+Dune::VTK::FunctionWriterBase\n+Base class for function writers.\n+Definition functionwriter.hh:34\n+Dune::VTK::FunctionWriterBase::name\n+virtual std::string name() const =0\n+return name\n+Dune::VTK::FunctionWriterBase::ncomps\n+virtual unsigned ncomps() const =0\n+return number of components of the vector\n+Dune::VTK::FunctionWriterBase::write\n+virtual void write(const Cell &, const Domain &)\n+write at the given position\n+Definition functionwriter.hh:59\n+Dune::VTK::FunctionWriterBase::Cell\n+Cell_ Cell\n+Definition functionwriter.hh:41\n+Dune::VTK::FunctionWriterBase::addArray\n+virtual void addArray(PVTUWriter &writer)=0\n+add this field to the given parallel writer\n+Dune::VTK::FunctionWriterBase::endWrite\n+virtual void endWrite()=0\n+signal end of writing\n+Dune::VTK::FunctionWriterBase::Domain\n+FieldVector< DF, mydim > Domain\n+Definition functionwriter.hh:40\n+Dune::VTK::FunctionWriterBase::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0\n+start writing with the given writer\n+Dune::VTK::FunctionWriterBase::~FunctionWriterBase\n+virtual ~FunctionWriterBase()\n+destructor\n+Definition functionwriter.hh:78\n+Dune::VTK::FunctionWriterBase::write\n+virtual void write(const Cell &cell, unsigned cornerIndex)\n+write at the given corner\n+Definition functionwriter.hh:71\n+Dune::VTK::VTKFunctionWriter\n+Base class for function writers.\n+Definition functionwriter.hh:90\n+Dune::VTK::VTKFunctionWriter::VTKFunctionWriter\n+VTKFunctionWriter(const std::shared_ptr< const Func > &func_, VTK::Precision\n+prec=VTK::Precision::float32)\n+Definition functionwriter.hh:97\n+Dune::VTK::VTKFunctionWriter::name\n+virtual std::string name() const\n+return name\n+Definition functionwriter.hh:103\n+Dune::VTK::VTKFunctionWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition functionwriter.hh:106\n+Dune::VTK::VTKFunctionWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition functionwriter.hh:117\n+Dune::VTK::VTKFunctionWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:112\n+Dune::VTK::VTKFunctionWriter::write\n+virtual void write(const typename Base::Cell &cell, const typename Base::Domain\n+&xl)\n+write at the given position\n+Definition functionwriter.hh:124\n+Dune::VTK::VTKFunctionWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition functionwriter.hh:133\n+Dune::VTK::CoordinatesWriter\n+writer for the Coordinates array\n+Definition functionwriter.hh:147\n+Dune::VTK::CoordinatesWriter::write\n+virtual void write(const typename Base::Cell &cell, const typename Base::Domain\n+&xl)\n+write at the given position\n+Definition functionwriter.hh:176\n+Dune::VTK::CoordinatesWriter::name\n+virtual std::string name() const\n+return name\n+Definition functionwriter.hh:159\n+Dune::VTK::CoordinatesWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition functionwriter.hh:186\n+Dune::VTK::CoordinatesWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition functionwriter.hh:162\n+Dune::VTK::CoordinatesWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:165\n+Dune::VTK::CoordinatesWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition functionwriter.hh:170\n+Dune::VTK::CoordinatesWriter::CoordinatesWriter\n+CoordinatesWriter(VTK::Precision prec=VTK::Precision::float32)\n+Definition functionwriter.hh:154\n+Dune::VTK::ConformingConnectivityWriter\n+writer for the connectivity array in conforming mode\n+Definition functionwriter.hh:195\n+Dune::VTK::ConformingConnectivityWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:216\n+Dune::VTK::ConformingConnectivityWriter::name\n+virtual std::string name() const\n+return name\n+Definition functionwriter.hh:210\n+Dune::VTK::ConformingConnectivityWriter::write\n+virtual void write(const typename Base::Cell &cell, unsigned cornerIndex)\n+write at the given corner\n+Definition functionwriter.hh:242\n+Dune::VTK::ConformingConnectivityWriter::ConformingConnectivityWriter\n+ConformingConnectivityWriter(const IteratorFactory &factory_)\n+create a writer with the given iteratorfactory\n+Definition functionwriter.hh:205\n+Dune::VTK::ConformingConnectivityWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition functionwriter.hh:213\n+Dune::VTK::ConformingConnectivityWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition functionwriter.hh:221\n+Dune::VTK::ConformingConnectivityWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition functionwriter.hh:251\n+Dune::VTK::NonConformingConnectivityWriter\n+writer for the connectivity array in nonconforming mode\n+Definition functionwriter.hh:261\n+Dune::VTK::NonConformingConnectivityWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition functionwriter.hh:270\n+Dune::VTK::NonConformingConnectivityWriter::name\n+virtual std::string name() const\n+return name\n+Definition functionwriter.hh:267\n+Dune::VTK::NonConformingConnectivityWriter::write\n+virtual void write(const Cell &, unsigned)\n+write at the given corner\n+Definition functionwriter.hh:285\n+Dune::VTK::NonConformingConnectivityWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:273\n+Dune::VTK::NonConformingConnectivityWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition functionwriter.hh:278\n+Dune::VTK::NonConformingConnectivityWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition functionwriter.hh:291\n+Dune::VTK::OffsetsWriter\n+writer for the offsets array\n+Definition functionwriter.hh:300\n+Dune::VTK::OffsetsWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:314\n+Dune::VTK::OffsetsWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition functionwriter.hh:331\n+Dune::VTK::OffsetsWriter::name\n+virtual std::string name() const\n+return name\n+Definition functionwriter.hh:308\n+Dune::VTK::OffsetsWriter::write\n+virtual void write(const Cell &cell, const typename Base::Domain &)\n+write at the given position\n+Definition functionwriter.hh:326\n+Dune::VTK::OffsetsWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition functionwriter.hh:319\n+Dune::VTK::OffsetsWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition functionwriter.hh:311\n+Dune::VTK::TypesWriter\n+writer for the types array\n+Definition functionwriter.hh:340\n+Dune::VTK::TypesWriter::ncomps\n+virtual unsigned ncomps() const\n+return number of components of the vector\n+Definition functionwriter.hh:350\n+Dune::VTK::TypesWriter::beginWrite\n+virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n+start writing with the given writer\n+Definition functionwriter.hh:358\n+Dune::VTK::TypesWriter::name\n+virtual std::string name() const\n+return name\n+Definition functionwriter.hh:347\n+Dune::VTK::TypesWriter::write\n+virtual void write(const Cell &cell, const typename Base::Domain &)\n+write at the given position\n+Definition functionwriter.hh:364\n+Dune::VTK::TypesWriter::addArray\n+virtual void addArray(PVTUWriter &writer)\n+add this field to the given parallel writer\n+Definition functionwriter.hh:353\n+Dune::VTK::TypesWriter::endWrite\n+virtual void endWrite()\n+signal end of writing\n+Definition functionwriter.hh:368\n+Dune::VTK::PVTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition pvtuwriter.hh:62\n+Dune::VTK::PVTUWriter::addArray\n+void addArray(const std::string &name, unsigned ncomps, Precision prec)\n+Add an array to the output file.\n+Definition pvtuwriter.hh:207\n+Dune::VTK::VTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition vtuwriter.hh:98\n+Dune::VTK::VTUWriter::makeArrayWriter\n+DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n+unsigned nitems, Precision prec)\n+acquire a DataArrayWriter\n+Definition vtuwriter.hh:380\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00815.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00815.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dim.cc File Reference\n+dune-grid: volumeiterators.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,45 @@\n \n \n \n \n \n \n \n
    \n \n-
    dim.cc File Reference
    \n+
    volumeiterators.hh File Reference
    \n
    \n
    \n-\n+\n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::ConformingVolumeIteratorFactory< GV >
     
    class  Dune::VTK::NonConformingVolumeIteratorFactory< GV >
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-dim.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+volumeiterators.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 \u00a0 Dune::VTK::ConformingVolumeIteratorFactory<_GV_>\n+\u00a0\n+class \u00a0 Dune::VTK::NonConformingVolumeIteratorFactory<_GV_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00818.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00818.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: simplex.cc File Reference\n+dune-grid: volumewriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,43 @@\n \n \n \n \n \n \n \n
    \n \n-
    simplex.cc File Reference
    \n+
    volumewriter.hh File Reference
    \n
    \n
    \n-\n+\n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::ConformingVolumeWriter< GV >
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,27 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-simplex.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+volumewriter.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 \u00a0 Dune::VTK::ConformingVolumeWriter<_GV_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00821.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00821.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: simplex.hh File Reference\n+dune-grid: common.hh File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,136 @@\n \n \n \n \n \n \n \n
    \n \n-
    simplex.hh File Reference
    \n+Namespaces |\n+Enumerations |\n+Functions
    \n+
    common.hh File Reference
    \n \n
    \n-
    #include <iostream>
    \n-#include <vector>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+\n+

    Common stuff for the VTKWriter. \n+More...

    \n+
    #include <limits>
    \n+#include <sstream>
    \n+#include <string>
    \n+#include <cstdint>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/common/typetraits.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 Classes

    class  Dune::dgf::SimplexBlock
    struct  Dune::VTK::PrintType< T >
     determine a type to safely put another type into a stream More...
     
    struct  Dune::VTK::PrintType< unsigned char >
     
    struct  Dune::VTK::PrintType< signed char >
     
    struct  Dune::VTK::PrintType< char >
     
    class  Dune::VTK::FieldInfo
     Descriptor struct for VTK fields. More...
     
    \n \n \n \n \n-\n+\n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Enumerations

    enum  Dune::VTK::OutputType { Dune::VTK::ascii\n+, Dune::VTK::base64\n+, Dune::VTK::appendedraw\n+, Dune::VTK::appendedbase64\n+ }
     How the bulk data should be stored in the file. More...
     
    enum  Dune::VTK::DataMode { Dune::VTK::conforming\n+, Dune::VTK::nonconforming\n+ }
     Whether to produce conforming or non-conforming output. More...
     
    enum  Dune::VTK::GeometryType {
    \n+  Dune::VTK::vertex = 1\n+, Dune::VTK::line = 3\n+, Dune::VTK::triangle = 5\n+, Dune::VTK::polygon = 7\n+,
    \n+  Dune::VTK::quadrilateral = 9\n+, Dune::VTK::tetrahedron = 10\n+, Dune::VTK::hexahedron = 12\n+, Dune::VTK::prism = 13\n+,
    \n+  Dune::VTK::pyramid = 14\n+, Dune::VTK::polyhedron = 42\n+
    \n+ }
     Type representing VTK's entity geometry types. More...
     
    enum  Dune::VTK::FileType { Dune::VTK::polyData\n+, Dune::VTK::unstructuredGrid\n+ }
     which type of VTK file to write More...
     
    enum class  Dune::VTK::Precision {
    \n+  Dune::VTK::int32\n+, Dune::VTK::uint8\n+, Dune::VTK::uint32\n+, Dune::VTK::float32\n+,
    \n+  Dune::VTK::float64\n+
    \n+ }
     which precision to use when writing out data to vtk files More...
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    GeometryType Dune::VTK::geometryType (const Dune::GeometryType &t)
     mapping from GeometryType to VTKGeometryType
     
    int Dune::VTK::renumber (const Dune::GeometryType &t, int i)
     renumber VTK <-> Dune
     
    template<typename T >
    int Dune::VTK::renumber (const T &t, int i)
     renumber VTK <-> Dune
     
    std::string Dune::VTK::getEndiannessString ()
     determine endianness of this C++ implementation
     
    std::string Dune::VTK::toString (Precision p)
     map precision to VTK type name
     
    std::size_t Dune::VTK::typeSize (Precision p)
     map precision to byte size
     
    \n-
    \n+

    Detailed Description

    \n+

    Common stuff for the VTKWriter.

    \n+
    Author
    Peter Bastian, Christian Engwer
    \n+

    This file contains common stuff for all instances of VTKWriter.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,94 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Classes | Namespaces\n-simplex.hh File Reference\n-#include \n-#include \n-#include \n+ * vtk\n+Classes | Namespaces | Enumerations | Functions\n+common.hh File Reference\n+Common stuff for the VTKWriter. More...\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 \u00a0 Dune::dgf::SimplexBlock\n+struct \u00a0 Dune::VTK::PrintType<_T_>\n+\u00a0 determine a type to safely put another type into a stream More...\n+\u00a0\n+struct \u00a0 Dune::VTK::PrintType<_unsigned_char_>\n+\u00a0\n+struct \u00a0 Dune::VTK::PrintType<_signed_char_>\n+\u00a0\n+struct \u00a0 Dune::VTK::PrintType<_char_>\n+\u00a0\n+ class \u00a0 Dune::VTK::FieldInfo\n+\u00a0 Descriptor struct for VTK fields. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n+\u00a0\n+Enumerations\n+ enum \u00a0 Dune::VTK::OutputType { Dune::VTK::ascii , Dune::VTK::base64 ,\n+ Dune::VTK::appendedraw , Dune::VTK::appendedbase64 }\n+\u00a0 How the bulk data should be stored in the file. More...\n+\u00a0\n+ enum \u00a0 Dune::VTK::DataMode { Dune::VTK::conforming , Dune::VTK::\n+ nonconforming }\n+\u00a0 Whether to produce conforming or non-conforming output. More...\n+\u00a0\n+ enum \u00a0 Dune::VTK::GeometryType {\n+ \u00a0\u00a0Dune::VTK::vertex = 1 , Dune::VTK::line = 3 , Dune::VTK::\n+ triangle = 5 , Dune::VTK::polygon = 7 ,\n+ \u00a0\u00a0Dune::VTK::quadrilateral = 9 , Dune::VTK::tetrahedron = 10 ,\n+ Dune::VTK::hexahedron = 12 , Dune::VTK::prism = 13 ,\n+ \u00a0\u00a0Dune::VTK::pyramid = 14 , Dune::VTK::polyhedron = 42\n+ }\n+\u00a0 Type representing VTK's entity geometry types. More...\n+\u00a0\n+ enum \u00a0 Dune::VTK::FileType { Dune::VTK::polyData , Dune::VTK::\n+ unstructuredGrid }\n+\u00a0 which type of VTK file to write More...\n+\u00a0\n+enum class \u00a0 Dune::VTK::Precision {\n+ \u00a0\u00a0Dune::VTK::int32 , Dune::VTK::uint8 , Dune::VTK::uint32 , Dune::\n+ VTK::float32 ,\n+ \u00a0\u00a0Dune::VTK::float64\n+ }\n+\u00a0 which precision to use when writing out data to vtk files More...\n+\u00a0\n+Functions\n+GeometryType\u00a0 Dune::VTK::geometryType (const Dune::GeometryType &t)\n+\u00a0 mapping from GeometryType to VTKGeometryType\n+\u00a0\n+ int\u00a0 Dune::VTK::renumber (const Dune::GeometryType &t, int i)\n+\u00a0 renumber VTK <-> Dune\n+\u00a0\n+template\n+ int\u00a0 Dune::VTK::renumber (const T &t, int i)\n+\u00a0 renumber VTK <-> Dune\n+\u00a0\n+ std::string\u00a0 Dune::VTK::getEndiannessString ()\n+\u00a0 determine endianness of this C++ implementation\n+\u00a0\n+ std::string\u00a0 Dune::VTK::toString (Precision p)\n+\u00a0 map precision to VTK type name\n+\u00a0\n+ std::size_t\u00a0 Dune::VTK::typeSize (Precision p)\n+\u00a0 map precision to byte size\n \u00a0\n+***** Detailed Description *****\n+Common stuff for the VTKWriter.\n+ Author\n+ Peter Bastian, Christian Engwer\n+This file contains common stuff for all instances of VTKWriter.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00821_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00821_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: simplex.hh Source File\n+dune-grid: common.hh Source File\n \n \n \n \n \n \n \n@@ -70,102 +70,384 @@\n \n \n \n \n \n \n \n
    \n-
    simplex.hh
    \n+
    common.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_SIMPLEXBLOCK_HH
    \n-
    6#define DUNE_DGF_SIMPLEXBLOCK_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n-
    10
    \n-\n-
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n-
    15
    \n-
    16 namespace dgf
    \n-
    17 {
    \n-
    18 // SimplexBlock
    \n-
    19 // ------------
    \n-
    20
    \n-
    \n-\n-
    22 : public BasicBlock
    \n-
    23 {
    \n-
    24 unsigned int nofvtx;
    \n-
    25 int vtxoffset;
    \n-
    26 int dimgrid;
    \n-
    27 bool goodline; // active line describes a vertex
    \n-
    28 int nofparams; // nof parameters
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_COMMON_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_COMMON_HH
    \n+
    8
    \n+
    9#include <limits>
    \n+
    10#include <sstream>
    \n+
    11#include <string>
    \n+
    12#include <cstdint>
    \n+
    13
    \n+
    14#include <dune/common/exceptions.hh>
    \n+
    15#include <dune/geometry/type.hh>
    \n+
    16#include <dune/common/typetraits.hh>
    \n+
    17
    \n+
    25namespace Dune
    \n+
    26{
    \n
    29
    \n-
    30 public:
    \n-
    31 SimplexBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
    \n-
    32
    \n-
    33 int get ( std :: vector< std :: vector< unsigned int > > &simplex,
    \n-
    34 std :: vector< std :: vector< double > > &params,
    \n-
    35 int &nofp );
    \n+
    30 namespace VTK {
    \n+
    31
    \n+
    33 //
    \n+
    34 // VTKOptions
    \n+
    35 //
    \n
    36
    \n-
    37 // cubes -> simplex
    \n-
    38 static int
    \n-
    39 cube2simplex ( std :: vector< std :: vector< double > > &vtx,
    \n-
    40 std :: vector< std :: vector< unsigned int > > &elements,
    \n-
    41 std :: vector< std :: vector< double > > &params );
    \n-
    42
    \n-
    43 // some information
    \n-
    \n-
    44 bool ok ()
    \n-
    45 {
    \n-
    46 return goodline;
    \n-
    47 }
    \n-
    \n-
    48
    \n-
    \n-\n-
    50 {
    \n-
    51 return noflines();
    \n-
    52 }
    \n-
    \n-
    53
    \n-
    54 private:
    \n-
    55 // get the dimension of the grid
    \n-
    56 int getDimGrid ();
    \n-
    57 // get next simplex
    \n-
    58 bool next ( std :: vector< unsigned int > &simplex,
    \n-
    59 std :: vector< double > &param );
    \n-
    60 };
    \n-
    \n-
    61
    \n-
    62 } // end namespace dgf
    \n-
    63
    \n-
    64} // end namespace Dune
    \n-
    65
    \n-
    66#endif
    \n-\n+
    38
    \n+
    \n+\n+\n+\n+\n+\n+
    52 // //! Output to the file is compressed inline binary.
    \n+
    53 // binarycompressed,
    \n+
    54 // //! Output is compressed and appended to the file.
    \n+
    55 // compressedappended
    \n+
    56 };
    \n+
    \n+
    58
    \n+
    \n+
    67 enum DataMode {
    \n+
    69
    \n+\n+
    75
    \n+\n+
    82 };
    \n+
    \n+
    83
    \n+
    85 //
    \n+
    86 // PrintType
    \n+
    87 //
    \n+
    88
    \n+
    90
    \n+
    94 template<typename T>
    \n+
    \n+
    95 struct PrintType {
    \n+
    97 typedef T Type;
    \n+
    98 };
    \n+
    \n+
    99
    \n+
    100 template<>
    \n+
    \n+
    101 struct PrintType<unsigned char> {
    \n+
    102 typedef unsigned Type;
    \n+
    103 };
    \n+
    \n+
    104
    \n+
    105 template<>
    \n+
    \n+
    106 struct PrintType<signed char> {
    \n+
    107 typedef int Type;
    \n+
    108 };
    \n+
    \n+
    109
    \n+
    110 template<>
    \n+
    \n+
    111 struct PrintType<char> {
    \n+
    112 typedef std::conditional<std::numeric_limits<char>::is_signed,
    \n+
    113 int, unsigned>::type
    \n+\n+
    115 };
    \n+
    \n+
    116
    \n+
    118 //
    \n+
    119 // VTK::GeometryType related stuff
    \n+
    120 //
    \n+
    121
    \n+
    123
    \n+
    \n+\n+\n+
    134 line = 3,
    \n+\n+\n+\n+\n+\n+
    140 prism = 13,
    \n+\n+
    142 polyhedron = 42
    \n+
    143 };
    \n+
    \n+
    144
    \n+
    146
    \n+
    \n+
    151 inline GeometryType geometryType(const Dune::GeometryType& t)
    \n+
    152 {
    \n+
    153 if (t.isVertex()) return vertex;
    \n+
    154 if (t.isLine()) return line;
    \n+
    155 if (t.isTriangle()) return triangle;
    \n+
    156 if (t.isQuadrilateral()) return quadrilateral;
    \n+
    157 if (t.isTetrahedron()) return tetrahedron;
    \n+
    158 if (t.isPyramid()) return pyramid;
    \n+
    159 if (t.isPrism()) return prism;
    \n+
    160 if (t.isHexahedron()) return hexahedron;
    \n+
    161
    \n+
    162 if (t.isNone() )
    \n+
    163 {
    \n+
    164 if( t.dim() == 2 ) return polygon;
    \n+
    165 if( t.dim() == 3 ) return polyhedron;
    \n+
    166 }
    \n+
    167
    \n+
    168 DUNE_THROW(IOError,"VTKWriter: unsupported GeometryType " << t);
    \n+
    169 }
    \n+
    \n+
    170
    \n+
    172 //
    \n+
    173 // Functions for transforming the index of a corner inside an entity
    \n+
    174 // between Dune and VTK
    \n+
    175 //
    \n+
    176
    \n+
    178
    \n+
    \n+
    186 inline int renumber(const Dune::GeometryType &t, int i)
    \n+
    187 {
    \n+
    188 static const int quadRenumbering[4] = {0,1,3,2};
    \n+
    189 static const int cubeRenumbering[8] = {0,1,3,2,4,5,7,6};
    \n+
    190 static const int prismRenumbering[6] = {0,2,1,3,5,4};
    \n+
    191 static const int pyramidRenumbering[5] = {0,1,3,2,4};
    \n+
    192
    \n+
    193 if (t.isQuadrilateral()) return quadRenumbering[i];
    \n+
    194 if (t.isPyramid()) return pyramidRenumbering[i];
    \n+
    195 if (t.isPrism()) return prismRenumbering[i];
    \n+
    196 if (t.isHexahedron()) return cubeRenumbering[i];
    \n+
    197
    \n+
    198 return i;
    \n+
    199 }
    \n+
    \n+
    200
    \n+
    202
    \n+
    216 template<typename T>
    \n+
    \n+
    217 int renumber(const T& t, int i)
    \n+
    218 {
    \n+
    219 return renumber(t.type(), i);
    \n+
    220 }
    \n+
    \n+
    221
    \n+
    223 //
    \n+
    224 // Determine Endianness
    \n+
    225 //
    \n+
    226
    \n+
    228
    \n+
    \n+
    232 inline std::string getEndiannessString()
    \n+
    233 {
    \n+
    234 short i = 1;
    \n+
    235 if (reinterpret_cast<char*>(&i)[1] == 1)
    \n+
    236 return "BigEndian";
    \n+
    237 else
    \n+
    238 return "LittleEndian";
    \n+
    239 }
    \n+
    \n+
    240
    \n+
    242 //
    \n+
    243 // which type of vtkfile to write
    \n+
    244 //
    \n+
    245
    \n+
    247
    \n+
    \n+
    252 enum FileType {
    \n+\n+\n+
    257 };
    \n+
    \n+
    258
    \n+
    259
    \n+
    261 //
    \n+
    262 // which precision to use when writing out data
    \n+
    263 //
    \n+
    264
    \n+
    266
    \n+
    \n+
    271 enum class Precision {
    \n+
    272 int32,
    \n+
    273 uint8,
    \n+
    274 uint32,
    \n+
    275 float32,
    \n+
    276 float64
    \n+
    277 };
    \n+
    \n+
    278
    \n+
    \n+
    280 inline std::string toString(Precision p)
    \n+
    281 {
    \n+
    282 switch(p)
    \n+
    283 {
    \n+\n+
    285 return "Float32";
    \n+\n+
    287 return "Float64";
    \n+\n+
    289 return "UInt32";
    \n+
    290 case Precision::uint8:
    \n+
    291 return "UInt8";
    \n+
    292 case Precision::int32:
    \n+
    293 return "Int32";
    \n+
    294 default:
    \n+
    295 DUNE_THROW(Dune::NotImplemented, "Unknown precision type");
    \n+
    296 }
    \n+
    297 }
    \n+
    \n+
    298
    \n+
    \n+
    300 inline std::size_t typeSize(Precision p)
    \n+
    301 {
    \n+
    302 switch(p)
    \n+
    303 {
    \n+\n+
    305 return sizeof(float);
    \n+\n+
    307 return sizeof(double);
    \n+\n+
    309 return sizeof(std::uint32_t);
    \n+
    310 case Precision::uint8:
    \n+
    311 return sizeof(std::uint8_t);
    \n+
    312 case Precision::int32:
    \n+
    313 return sizeof(std::int32_t);
    \n+
    314 default:
    \n+
    315 DUNE_THROW(Dune::NotImplemented, "Unknown precision type");
    \n+
    316 }
    \n+
    317 }
    \n+
    \n+
    318
    \n+
    320
    \n+
    \n+\n+
    328 {
    \n+
    329
    \n+
    330 public:
    \n+
    331
    \n+
    \n+
    333 enum class Type {
    \n+
    336 scalar,
    \n+
    338 vector,
    \n+
    340 tensor
    \n+
    341 };
    \n+
    \n+
    342
    \n+
    \n+
    344 FieldInfo(std::string name, Type type, std::size_t size, Precision prec = Precision::float32)
    \n+
    345 : _name(name)
    \n+
    346 , _type(type)
    \n+
    347 , _size(size)
    \n+
    348 , _prec(prec)
    \n+
    349 {}
    \n+
    \n+
    350
    \n+
    \n+
    352 std::string name() const
    \n+
    353 {
    \n+
    354 return _name;
    \n+
    355 }
    \n+
    \n+
    356
    \n+
    \n+
    358 Type type() const
    \n+
    359 {
    \n+
    360 return _type;
    \n+
    361 }
    \n+
    \n+
    362
    \n+
    \n+
    364 std::size_t size() const
    \n+
    365 {
    \n+
    366 return _size;
    \n+
    367 }
    \n+
    \n+
    368
    \n+
    \n+\n+
    371 {
    \n+
    372 return _prec;
    \n+
    373 }
    \n+
    \n+
    374
    \n+
    375 private:
    \n+
    376
    \n+
    377 std::string _name;
    \n+
    378 Type _type;
    \n+
    379 std::size_t _size;
    \n+
    380 Precision _prec;
    \n+
    381
    \n+
    382 };
    \n+
    \n+
    383
    \n+
    384
    \n+
    385 } // namespace VTK
    \n+
    386
    \n+
    388
    \n+
    389} // namespace Dune
    \n+
    390
    \n+
    391#endif // DUNE_GRID_IO_FILE_VTK_COMMON_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    int & noflines()
    Definition basic.hh:87
    \n-
    Definition simplex.hh:23
    \n-
    static int cube2simplex(std ::vector< std ::vector< double > > &vtx, std ::vector< std ::vector< unsigned int > > &elements, std ::vector< std ::vector< double > > &params)
    Definition simplex.cc:145
    \n-
    int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector< std ::vector< double > > &params, int &nofp)
    Definition simplex.cc:68
    \n-
    int nofsimplex()
    Definition simplex.hh:49
    \n-
    bool ok()
    Definition simplex.hh:44
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+\n+\n+\n+\n+
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n+
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n+
    @ appendedraw
    Output is to the file is appended raw binary.
    Definition common.hh:49
    \n+
    @ appendedbase64
    Output is to the file is appended base64 binary.
    Definition common.hh:51
    \n+
    @ base64
    Output to the file is inline base64 binary.
    Definition common.hh:47
    \n+
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n+
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n+
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n+
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n+
    std::string toString(Precision p)
    map precision to VTK type name
    Definition common.hh:280
    \n+
    DataMode
    Whether to produce conforming or non-conforming output.
    Definition common.hh:67
    \n+
    @ conforming
    Output conforming data.
    Definition common.hh:73
    \n+
    @ nonconforming
    Output non-conforming data.
    Definition common.hh:81
    \n+
    std::size_t typeSize(Precision p)
    map precision to byte size
    Definition common.hh:300
    \n+
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n+
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n+
    GeometryType
    Type representing VTK's entity geometry types.
    Definition common.hh:132
    \n+
    @ line
    Definition common.hh:134
    \n+
    @ pyramid
    Definition common.hh:141
    \n+
    @ polyhedron
    Definition common.hh:142
    \n+
    @ quadrilateral
    Definition common.hh:137
    \n+
    @ vertex
    Definition common.hh:133
    \n+
    @ tetrahedron
    Definition common.hh:138
    \n+
    @ prism
    Definition common.hh:140
    \n+
    @ hexahedron
    Definition common.hh:139
    \n+
    @ triangle
    Definition common.hh:135
    \n+
    @ polygon
    Definition common.hh:136
    \n+
    determine a type to safely put another type into a stream
    Definition common.hh:95
    \n+
    T Type
    type to convert T to before putting it into a stream with <<
    Definition common.hh:97
    \n+
    unsigned Type
    Definition common.hh:102
    \n+
    int Type
    Definition common.hh:107
    \n+
    std::conditional< std::numeric_limits< char >::is_signed, int, unsigned >::type Type
    Definition common.hh:114
    \n+
    Descriptor struct for VTK fields.
    Definition common.hh:328
    \n+
    std::size_t size() const
    The number of components in the data field.
    Definition common.hh:364
    \n+
    Precision precision() const
    The precision used for the output of the data field.
    Definition common.hh:370
    \n+
    Type
    VTK data type.
    Definition common.hh:333
    \n+
    @ tensor
    tensor field (always 3x3)
    \n+
    @ vector
    vector-valued field (always 3D, will be padded if necessary)
    \n+\n+
    FieldInfo(std::string name, Type type, std::size_t size, Precision prec=Precision::float32)
    Create a FieldInfo instance with the given name, type and size.
    Definition common.hh:344
    \n+
    Type type() const
    The type of the data field.
    Definition common.hh:358
    \n+
    std::string name() const
    The name of the data field.
    Definition common.hh:352
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,107 +2,452 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-simplex.hh\n+ * vtk\n+common.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_SIMPLEXBLOCK_HH\n-6#define DUNE_DGF_SIMPLEXBLOCK_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12\n-13namespace Dune\n-14{\n-15\n-16 namespace dgf\n-17 {\n-18 // SimplexBlock\n-19 // ------------\n-20\n-21 class SimplexBlock\n-22 : public BasicBlock\n-23 {\n-24 unsigned int nofvtx;\n-25 int vtxoffset;\n-26 int dimgrid;\n-27 bool goodline; // active line describes a vertex\n-28 int nofparams; // nof parameters\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_COMMON_HH\n+7#define DUNE_GRID_IO_FILE_VTK_COMMON_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16#include \n+17\n+25namespace Dune\n+26{\n 29\n-30 public:\n-31 SimplexBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int\n-&pdimgrid );\n-32\n-33 int get ( std :: vector< std :: vector< unsigned int > > &simplex,\n-34 std :: vector< std :: vector< double > > ¶ms,\n-35 int &nofp );\n+30 namespace VTK {\n+31\n+33 //\n+34 // VTKOptions\n+35 //\n 36\n-37 // cubes -> simplex\n-38 static int\n-39 cube2simplex ( std :: vector< std :: vector< double > > &vtx,\n-40 std :: vector< std :: vector< unsigned int > > &elements,\n-41 std :: vector< std :: vector< double > > ¶ms );\n-42\n-43 // some information\n-44 bool ok ()\n-45 {\n-46 return goodline;\n-47 }\n-48\n-49 int nofsimplex ()\n-50 {\n-51 return noflines();\n-52 }\n-53\n-54 private:\n-55 // get the dimension of the grid\n-56 int getDimGrid ();\n-57 // get next simplex\n-58 bool next ( std :: vector< unsigned int > &simplex,\n-59 std :: vector< double > ¶m );\n-60 };\n-61\n-62 } // end namespace dgf\n-63\n-64} // end namespace Dune\n-65\n-66#endif\n-basic.hh\n+38\n+43 enum OutputType {\n+45 ascii,\n+47 base64,\n+49 appendedraw,\n+51 appendedbase64\n+52 // //! Output to the file is compressed inline binary.\n+53 // binarycompressed,\n+54 // //! Output is compressed and appended to the file.\n+55 // compressedappended\n+56 };\n+58\n+67 enum DataMode {\n+69\n+73 conforming,\n+75\n+81 nonconforming\n+82 };\n+83\n+85 //\n+86 // PrintType\n+87 //\n+88\n+90\n+94 template\n+95 struct PrintType {\n+97 typedef T Type;\n+98 };\n+99\n+100 template<>\n+101 struct PrintType {\n+102 typedef unsigned Type;\n+103 };\n+104\n+105 template<>\n+106 struct PrintType {\n+107 typedef int Type;\n+108 };\n+109\n+110 template<>\n+111 struct PrintType {\n+112 typedef std::conditional::is_signed,\n+113 int, unsigned>::type\n+114 Type;\n+115 };\n+116\n+118 //\n+119 // VTK::GeometryType related stuff\n+120 //\n+121\n+123\n+132 enum GeometryType {\n+133 vertex = 1,\n+134 line = 3,\n+135 triangle = 5,\n+136 polygon = 7,\n+137 quadrilateral = 9,\n+138 tetrahedron = 10,\n+139 hexahedron = 12,\n+140 prism = 13,\n+141 pyramid = 14,\n+142 polyhedron = 42\n+143 };\n+144\n+146\n+151 inline GeometryType geometryType(const Dune::GeometryType& t)\n+152 {\n+153 if (t.isVertex()) return vertex;\n+154 if (t.isLine()) return line;\n+155 if (t.isTriangle()) return triangle;\n+156 if (t.isQuadrilateral()) return quadrilateral;\n+157 if (t.isTetrahedron()) return tetrahedron;\n+158 if (t.isPyramid()) return pyramid;\n+159 if (t.isPrism()) return prism;\n+160 if (t.isHexahedron()) return hexahedron;\n+161\n+162 if (t.isNone() )\n+163 {\n+164 if( t.dim() == 2 ) return polygon;\n+165 if( t.dim() == 3 ) return polyhedron;\n+166 }\n+167\n+168 DUNE_THROW(IOError,\"VTKWriter: unsupported GeometryType \" << t);\n+169 }\n+170\n+172 //\n+173 // Functions for transforming the index of a corner inside an entity\n+174 // between Dune and VTK\n+175 //\n+176\n+178\n+186 inline int renumber(const Dune::GeometryType &t, int i)\n+187 {\n+188 static const int quadRenumbering[4] = {0,1,3,2};\n+189 static const int cubeRenumbering[8] = {0,1,3,2,4,5,7,6};\n+190 static const int prismRenumbering[6] = {0,2,1,3,5,4};\n+191 static const int pyramidRenumbering[5] = {0,1,3,2,4};\n+192\n+193 if (t.isQuadrilateral()) return quadRenumbering[i];\n+194 if (t.isPyramid()) return pyramidRenumbering[i];\n+195 if (t.isPrism()) return prismRenumbering[i];\n+196 if (t.isHexahedron()) return cubeRenumbering[i];\n+197\n+198 return i;\n+199 }\n+200\n+202\n+216 template\n+217 int renumber(const T& t, int i)\n+218 {\n+219 return renumber(t.type(), i);\n+220 }\n+221\n+223 //\n+224 // Determine Endianness\n+225 //\n+226\n+228\n+232 inline std::string getEndiannessString()\n+233 {\n+234 short i = 1;\n+235 if (reinterpret_cast(&i)[1] == 1)\n+236 return \"BigEndian\";\n+237 else\n+238 return \"LittleEndian\";\n+239 }\n+240\n+242 //\n+243 // which type of vtkfile to write\n+244 //\n+245\n+247\n+252 enum FileType {\n+254 polyData,\n+256 unstructuredGrid\n+257 };\n+258\n+259\n+261 //\n+262 // which precision to use when writing out data\n+263 //\n+264\n+266\n+271 enum class Precision {\n+272 int32,\n+273 uint8,\n+274 uint32,\n+275 float32,\n+276 float64\n+277 };\n+278\n+280 inline std::string toString(Precision p)\n+281 {\n+282 switch(p)\n+283 {\n+284 case Precision::float32:\n+285 return \"Float32\";\n+286 case Precision::float64:\n+287 return \"Float64\";\n+288 case Precision::uint32:\n+289 return \"UInt32\";\n+290 case Precision::uint8:\n+291 return \"UInt8\";\n+292 case Precision::int32:\n+293 return \"Int32\";\n+294 default:\n+295 DUNE_THROW(Dune::NotImplemented, \"Unknown precision type\");\n+296 }\n+297 }\n+298\n+300 inline std::size_t typeSize(Precision p)\n+301 {\n+302 switch(p)\n+303 {\n+304 case Precision::float32:\n+305 return sizeof(float);\n+306 case Precision::float64:\n+307 return sizeof(double);\n+308 case Precision::uint32:\n+309 return sizeof(std::uint32_t);\n+310 case Precision::uint8:\n+311 return sizeof(std::uint8_t);\n+312 case Precision::int32:\n+313 return sizeof(std::int32_t);\n+314 default:\n+315 DUNE_THROW(Dune::NotImplemented, \"Unknown precision type\");\n+316 }\n+317 }\n+318\n+320\n+327 class FieldInfo\n+328 {\n+329\n+330 public:\n+331\n+333 enum class Type {\n+336 scalar,\n+338 vector,\n+340 tensor\n+341 };\n+342\n+344 FieldInfo(std::string name, Type type, std::size_t size, Precision prec =\n+Precision::float32)\n+345 : _name(name)\n+346 , _type(type)\n+347 , _size(size)\n+348 , _prec(prec)\n+349 {}\n+350\n+352 std::string name() const\n+353 {\n+354 return _name;\n+355 }\n+356\n+358 Type type() const\n+359 {\n+360 return _type;\n+361 }\n+362\n+364 std::size_t size() const\n+365 {\n+366 return _size;\n+367 }\n+368\n+370 Precision precision() const\n+371 {\n+372 return _prec;\n+373 }\n+374\n+375 private:\n+376\n+377 std::string _name;\n+378 Type _type;\n+379 std::size_t _size;\n+380 Precision _prec;\n+381\n+382 };\n+383\n+384\n+385 } // namespace VTK\n+386\n+388\n+389} // namespace Dune\n+390\n+391#endif // DUNE_GRID_IO_FILE_VTK_COMMON_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::BasicBlock::noflines\n-int & noflines()\n-Definition basic.hh:87\n-Dune::dgf::SimplexBlock\n-Definition simplex.hh:23\n-Dune::dgf::SimplexBlock::cube2simplex\n-static int cube2simplex(std ::vector< std ::vector< double > > &vtx, std ::\n-vector< std ::vector< unsigned int > > &elements, std ::vector< std ::vector<\n-double > > ¶ms)\n-Definition simplex.cc:145\n-Dune::dgf::SimplexBlock::get\n-int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector<\n-std ::vector< double > > ¶ms, int &nofp)\n-Definition simplex.cc:68\n-Dune::dgf::SimplexBlock::nofsimplex\n-int nofsimplex()\n-Definition simplex.hh:49\n-Dune::dgf::SimplexBlock::ok\n-bool ok()\n-Definition simplex.hh:44\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::int32\n+@ int32\n+Dune::VTK::Precision::uint32\n+@ uint32\n+Dune::VTK::Precision::uint8\n+@ uint8\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::VTK::Precision::float64\n+@ float64\n+Dune::VTK::OutputType\n+OutputType\n+How the bulk data should be stored in the file.\n+Definition common.hh:43\n+Dune::VTK::ascii\n+@ ascii\n+Output to the file is in ascii.\n+Definition common.hh:45\n+Dune::VTK::appendedraw\n+@ appendedraw\n+Output is to the file is appended raw binary.\n+Definition common.hh:49\n+Dune::VTK::appendedbase64\n+@ appendedbase64\n+Output is to the file is appended base64 binary.\n+Definition common.hh:51\n+Dune::VTK::base64\n+@ base64\n+Output to the file is inline base64 binary.\n+Definition common.hh:47\n+Dune::VTK::renumber\n+int renumber(const Dune::GeometryType &t, int i)\n+renumber VTK <-> Dune\n+Definition common.hh:186\n+Dune::VTK::FileType\n+FileType\n+which type of VTK file to write\n+Definition common.hh:252\n+Dune::VTK::polyData\n+@ polyData\n+for .vtp files (PolyData)\n+Definition common.hh:254\n+Dune::VTK::unstructuredGrid\n+@ unstructuredGrid\n+for .vtu files (UnstructuredGrid)\n+Definition common.hh:256\n+Dune::VTK::toString\n+std::string toString(Precision p)\n+map precision to VTK type name\n+Definition common.hh:280\n+Dune::VTK::DataMode\n+DataMode\n+Whether to produce conforming or non-conforming output.\n+Definition common.hh:67\n+Dune::VTK::conforming\n+@ conforming\n+Output conforming data.\n+Definition common.hh:73\n+Dune::VTK::nonconforming\n+@ nonconforming\n+Output non-conforming data.\n+Definition common.hh:81\n+Dune::VTK::typeSize\n+std::size_t typeSize(Precision p)\n+map precision to byte size\n+Definition common.hh:300\n+Dune::VTK::geometryType\n+GeometryType geometryType(const Dune::GeometryType &t)\n+mapping from GeometryType to VTKGeometryType\n+Definition common.hh:151\n+Dune::VTK::getEndiannessString\n+std::string getEndiannessString()\n+determine endianness of this C++ implementation\n+Definition common.hh:232\n+Dune::VTK::GeometryType\n+GeometryType\n+Type representing VTK's entity geometry types.\n+Definition common.hh:132\n+Dune::VTK::line\n+@ line\n+Definition common.hh:134\n+Dune::VTK::pyramid\n+@ pyramid\n+Definition common.hh:141\n+Dune::VTK::polyhedron\n+@ polyhedron\n+Definition common.hh:142\n+Dune::VTK::quadrilateral\n+@ quadrilateral\n+Definition common.hh:137\n+Dune::VTK::vertex\n+@ vertex\n+Definition common.hh:133\n+Dune::VTK::tetrahedron\n+@ tetrahedron\n+Definition common.hh:138\n+Dune::VTK::prism\n+@ prism\n+Definition common.hh:140\n+Dune::VTK::hexahedron\n+@ hexahedron\n+Definition common.hh:139\n+Dune::VTK::triangle\n+@ triangle\n+Definition common.hh:135\n+Dune::VTK::polygon\n+@ polygon\n+Definition common.hh:136\n+Dune::VTK::PrintType\n+determine a type to safely put another type into a stream\n+Definition common.hh:95\n+Dune::VTK::PrintType::Type\n+T Type\n+type to convert T to before putting it into a stream with <<\n+Definition common.hh:97\n+Dune::VTK::PrintType<_unsigned_char_>::Type\n+unsigned Type\n+Definition common.hh:102\n+Dune::VTK::PrintType<_signed_char_>::Type\n+int Type\n+Definition common.hh:107\n+Dune::VTK::PrintType<_char_>::Type\n+std::conditional< std::numeric_limits< char >::is_signed, int, unsigned >::type\n+Type\n+Definition common.hh:114\n+Dune::VTK::FieldInfo\n+Descriptor struct for VTK fields.\n+Definition common.hh:328\n+Dune::VTK::FieldInfo::size\n+std::size_t size() const\n+The number of components in the data field.\n+Definition common.hh:364\n+Dune::VTK::FieldInfo::precision\n+Precision precision() const\n+The precision used for the output of the data field.\n+Definition common.hh:370\n+Dune::VTK::FieldInfo::Type\n+Type\n+VTK data type.\n+Definition common.hh:333\n+Dune::VTK::FieldInfo::Type::tensor\n+@ tensor\n+tensor field (always 3x3)\n+Dune::VTK::FieldInfo::Type::vector\n+@ vector\n+vector-valued field (always 3D, will be padded if necessary)\n+Dune::VTK::FieldInfo::Type::scalar\n+@ scalar\n+Dune::VTK::FieldInfo::FieldInfo\n+FieldInfo(std::string name, Type type, std::size_t size, Precision\n+prec=Precision::float32)\n+Create a FieldInfo instance with the given name, type and size.\n+Definition common.hh:344\n+Dune::VTK::FieldInfo::type\n+Type type() const\n+The type of the data field.\n+Definition common.hh:358\n+Dune::VTK::FieldInfo::name\n+std::string name() const\n+The name of the data field.\n+Definition common.hh:352\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00824.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00824.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vertex.hh File Reference\n+dune-grid: boundaryiterators.hh File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,57 @@\n \n \n \n \n \n \n \n
    \n \n-
    vertex.hh File Reference
    \n+
    boundaryiterators.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n-#include <vector>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+\n+

    Functions for VTK output on the skeleton. \n+More...

    \n+
    #include <iterator>
    \n+#include <memory>
    \n+#include <dune/common/iteratorfacades.hh>
    \n+#include <dune/grid/io/file/vtk/corner.hh>
    \n+#include <dune/grid/io/file/vtk/corneriterator.hh>
    \n+#include <dune/grid/io/file/vtk/functionwriter.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::dgf::VertexBlock
    class  Dune::VTK::BoundaryIterator< GV >
     iterate over the GridViews boundary intersections More...
     
    class  Dune::VTK::IntersectionIndexSet< ElementIndexSet >
     
    class  Dune::VTK::NonConformingBoundaryIteratorFactory< GV >
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n-
    \n+

    Detailed Description

    \n+

    Functions for VTK output on the skeleton.

    \n+
    Author
    J\u00f6 Fahlke
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,39 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n+ * vtk\n Classes | Namespaces\n-vertex.hh File Reference\n-#include \n-#include \n-#include \n+boundaryiterators.hh File Reference\n+dune-grid \u00bb I/O \u00bb Visualization_ToolKit_(VTK)\n+Functions for VTK output on the skeleton. More...\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::dgf::VertexBlock\n+class \u00a0 Dune::VTK::BoundaryIterator<_GV_>\n+\u00a0 iterate over the GridViews boundary intersections More...\n+\u00a0\n+class \u00a0 Dune::VTK::IntersectionIndexSet<_ElementIndexSet_>\n+\u00a0\n+class \u00a0 Dune::VTK::NonConformingBoundaryIteratorFactory<_GV_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n+***** Detailed Description *****\n+Functions for VTK output on the skeleton.\n+ Author\n+ J\u00c3\u00b6 Fahlke\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00824_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00824_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vertex.hh Source File\n+dune-grid: boundaryiterators.hh Source File\n \n \n \n \n \n \n \n@@ -70,93 +70,283 @@\n \n \n \n \n \n \n \n
    \n-
    vertex.hh
    \n+
    boundaryiterators.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_VERTEXBLOCK_HH
    \n-
    6#define DUNE_DGF_VERTEXBLOCK_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n-
    10
    \n-\n-
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n-
    15
    \n-
    16 namespace dgf
    \n-
    17 {
    \n-
    18
    \n-
    \n-\n-
    20 : public BasicBlock
    \n-
    21 {
    \n-
    22 int dimvertex; // the dimension of the vertices (determined from DGF file)
    \n-
    23 int dimworld; // the dimension of the world (either dimvertex or given by user)
    \n-
    24 bool goodline; // active line describes a vertex
    \n-
    25 int vtxoffset;
    \n-
    26 int nofParam;
    \n-
    27
    \n-
    28 public:
    \n-
    29 // initialize vertex block
    \n-
    30 VertexBlock ( std :: istream &in, int &pdimworld );
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
    \n+
    8
    \n+
    9#include <iterator>
    \n+
    10#include <memory>
    \n+
    11
    \n+
    12#include <dune/common/iteratorfacades.hh>
    \n+
    13
    \n+\n+\n+\n+
    17
    \n+
    18namespace Dune {
    \n+
    19
    \n+
    22
    \n+
    28 namespace VTK {
    \n+
    29
    \n
    31
    \n-
    32 int get ( std :: vector< std :: vector< double > > &vtx,
    \n-
    33 std :: vector< std :: vector< double > > &param,
    \n-
    34 int &nofp );
    \n-
    35
    \n-
    36 // some information
    \n-
    \n-
    37 bool ok () const
    \n-
    38 {
    \n-
    39 return goodline;
    \n-
    40 }
    \n-
    \n-
    41
    \n-
    \n-
    42 int offset () const
    \n-
    43 {
    \n-
    44 return vtxoffset;
    \n-
    45 }
    \n-
    \n-
    46
    \n-
    47 private:
    \n-
    48 // get dimworld
    \n-
    49 int getDimWorld ();
    \n-
    50
    \n-
    51 // get next vertex
    \n-
    52 bool next ( std :: vector< double > &point, std :: vector< double > &param );
    \n-
    53 };
    \n-
    \n-
    54
    \n-
    55 } // end namespace dgf
    \n-
    56
    \n-
    57} // end namespace Dune
    \n-
    58
    \n-
    59#endif
    \n-\n+
    35 template<typename GV>
    \n+
    \n+\n+
    37 : public ForwardIteratorFacade
    \n+
    38 < BoundaryIterator<GV>,
    \n+
    39 const typename GV::Intersection,
    \n+
    40 const typename GV::Intersection&,
    \n+
    41 typename std::iterator_traits<typename GV::template Codim<0>::
    \n+
    42 Iterator>::difference_type>
    \n+
    43 {
    \n+
    44 public:
    \n+
    45 // reiterator the facades typedefs here
    \n+\n+
    47 typedef const typename GV::Intersection Value;
    \n+
    48 typedef Value& Reference;
    \n+
    49 typedef typename GV::template Codim<0>::Iterator ElementIterator;
    \n+
    50 typedef typename GV::IntersectionIterator IntersectionIterator;
    \n+
    51 typedef typename std::iterator_traits<ElementIterator>::difference_type
    \n+\n+
    53
    \n+
    54 private:
    \n+
    55 typedef ForwardIteratorFacade<DerivedType, Value, Reference,
    \n+
    56 DifferenceType> Facade;
    \n+
    57
    \n+
    58 const GV* gv;
    \n+\n+
    60 std::shared_ptr<IntersectionIterator> iit;
    \n+
    61
    \n+
    62 bool valid() const {
    \n+
    63 // we're valid if we're passed-the-end
    \n+
    64 if(eit == gv->template end<0>()) return true;
    \n+
    65 // or if we're on a boundary
    \n+
    66 if((*iit)->boundary() && !(*iit)->neighbor()) return true;
    \n+
    67 // otherwise we're invalid
    \n+
    68 return false;
    \n+
    69 }
    \n+
    70
    \n+
    71 void basic_increment() {
    \n+
    72 ++*iit;
    \n+
    73 if(*iit == gv->iend(*eit)) {
    \n+
    74 iit.reset();
    \n+
    75 ++eit;
    \n+
    76 if(eit != gv->template end<0>())
    \n+
    77 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));
    \n+
    78 }
    \n+
    79 }
    \n+
    80
    \n+
    81 public:
    \n+
    \n+\n+
    83 return **iit;
    \n+
    84 }
    \n+
    \n+
    \n+
    85 bool equals(const DerivedType& other) const {
    \n+
    86 if(eit != other.eit) return false;
    \n+
    87
    \n+
    88 // this is a bit tricky, since we may not compare iit if we are
    \n+
    89 // passed-the-end
    \n+
    90 bool mePassedTheEnd = eit == gv->template end<0>();
    \n+
    91 bool otherPassedTheEnd = other.eit == other.gv->template end<0>();
    \n+
    92
    \n+
    93 // both passed-the-end => consider them equal
    \n+
    94 if(mePassedTheEnd && otherPassedTheEnd) return true;
    \n+
    95
    \n+
    96 // one passed the end => not equal
    \n+
    97 if(mePassedTheEnd || otherPassedTheEnd) return false;
    \n+
    98
    \n+
    99 // none passed-the-end => do their iit iterators match?
    \n+
    100 return *iit == *other.iit;
    \n+
    101 }
    \n+
    \n+
    102
    \n+
    \n+
    103 void increment() {
    \n+
    104 basic_increment();
    \n+
    105 while(!valid()) basic_increment();
    \n+
    106 }
    \n+
    \n+
    107
    \n+
    109
    \n+
    \n+
    113 BoundaryIterator(const GV& gv_, const ElementIterator& eit_,
    \n+
    114 const IntersectionIterator& iit_)
    \n+
    115 : gv(&gv_), eit(eit_), iit(new IntersectionIterator(iit_))
    \n+
    116 {
    \n+
    117 while(!valid()) basic_increment();
    \n+
    118 }
    \n+
    \n+
    120
    \n+
    \n+
    125 BoundaryIterator(const GV& gv_, const ElementIterator& eit_)
    \n+
    126 : gv(&gv_), eit(eit_)
    \n+
    127 {
    \n+
    128 if(eit != gv->template end<0>())
    \n+
    129 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));
    \n+
    130
    \n+
    131 while(!valid()) basic_increment();
    \n+
    132 }
    \n+
    \n+
    134
    \n+
    \n+
    138 BoundaryIterator(const GV& gv_, bool end = false)
    \n+
    139 : gv(&gv_), eit(end ? gv->template end<0>() : gv->template begin<0>())
    \n+
    140 {
    \n+
    141 if(eit != gv->template end<0>())
    \n+
    142 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));
    \n+
    143
    \n+
    144 while(!valid()) basic_increment();
    \n+
    145 }
    \n+
    \n+
    146 };
    \n+
    \n+
    147
    \n+
    148 template<typename ElementIndexSet>
    \n+
    \n+\n+
    150 const ElementIndexSet& eis;
    \n+
    151
    \n+
    152 public:
    \n+
    \n+
    153 IntersectionIndexSet(const ElementIndexSet& eis_)
    \n+
    154 : eis(eis_)
    \n+
    155 { }
    \n+
    \n+
    156 };
    \n+
    \n+
    157
    \n+
    158 template<typename GV>
    \n+
    \n+\n+
    160 const GV& gv;
    \n+
    161
    \n+
    162 public:
    \n+
    163 static const unsigned dimCell = GV::dimension-1;
    \n+
    164
    \n+
    165 typedef typename GV::Intersection Cell;
    \n+\n+
    167
    \n+\n+\n+
    170
    \n+
    171 typedef Corner Point;
    \n+\n+
    173
    \n+\n+
    175 typedef typename GV::Communication Communication;
    \n+
    176
    \n+
    \n+\n+
    178 : gv(gv_)
    \n+
    179 { }
    \n+
    \n+
    180
    \n+
    \n+\n+
    182 return CellIterator(gv);
    \n+
    183 }
    \n+
    \n+
    \n+\n+
    185 return CellIterator(gv, true);
    \n+
    186 }
    \n+
    \n+
    187
    \n+
    \n+\n+\n+
    190 }
    \n+
    \n+
    \n+\n+
    192 return CornerIterator(endCells());
    \n+
    193 }
    \n+
    \n+
    194
    \n+\n+
    196 PointIterator endPoints() const { return endCorners(); }
    \n+
    197
    \n+
    \n+\n+
    199 return ConnectivityWriter();
    \n+
    200 }
    \n+
    \n+
    \n+
    201 const Communication& comm() const {
    \n+
    202 return gv.comm();
    \n+
    203 }
    \n+
    \n+
    204 };
    \n+
    \n+
    205
    \n+
    206 } // namespace VTK
    \n+
    207
    \n+
    209
    \n+
    210} // namespace Dune
    \n+
    211
    \n+
    212#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
    \n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    Definition vertex.hh:21
    \n-
    int get(std ::vector< std ::vector< double > > &vtx, std ::vector< std ::vector< double > > &param, int &nofp)
    Definition vertex.cc:62
    \n-
    int offset() const
    Definition vertex.hh:42
    \n-
    bool ok() const
    Definition vertex.hh:37
    \n+
    iterate over the GridViews boundary intersections
    Definition boundaryiterators.hh:43
    \n+
    BoundaryIterator< GV > DerivedType
    Definition boundaryiterators.hh:46
    \n+
    BoundaryIterator(const GV &gv_, const ElementIterator &eit_)
    construct a BoundaryIterator
    Definition boundaryiterators.hh:125
    \n+
    Reference dereference() const
    Definition boundaryiterators.hh:82
    \n+
    const GV::Intersection Value
    Definition boundaryiterators.hh:47
    \n+
    BoundaryIterator(const GV &gv_, bool end=false)
    construct a BoundaryIterator
    Definition boundaryiterators.hh:138
    \n+
    BoundaryIterator(const GV &gv_, const ElementIterator &eit_, const IntersectionIterator &iit_)
    construct a BoundaryIterator
    Definition boundaryiterators.hh:113
    \n+
    GV::template Codim< 0 >::Iterator ElementIterator
    Definition boundaryiterators.hh:49
    \n+
    Value & Reference
    Definition boundaryiterators.hh:48
    \n+
    GV::IntersectionIterator IntersectionIterator
    Definition boundaryiterators.hh:50
    \n+
    bool equals(const DerivedType &other) const
    Definition boundaryiterators.hh:85
    \n+
    std::iterator_traits< ElementIterator >::difference_type DifferenceType
    Definition boundaryiterators.hh:52
    \n+
    void increment()
    Definition boundaryiterators.hh:103
    \n+
    Definition boundaryiterators.hh:149
    \n+
    IntersectionIndexSet(const ElementIndexSet &eis_)
    Definition boundaryiterators.hh:153
    \n+
    Definition boundaryiterators.hh:159
    \n+
    PointIterator beginPoints() const
    Definition boundaryiterators.hh:195
    \n+
    ConnectivityWriter makeConnectivity() const
    Definition boundaryiterators.hh:198
    \n+
    GV::Communication Communication
    Definition boundaryiterators.hh:175
    \n+
    static const unsigned dimCell
    Definition boundaryiterators.hh:163
    \n+
    VTK::CornerIterator< CellIterator > CornerIterator
    Definition boundaryiterators.hh:169
    \n+
    BoundaryIterator< GV > CellIterator
    Definition boundaryiterators.hh:166
    \n+
    Corner Point
    Definition boundaryiterators.hh:171
    \n+
    CornerIterator beginCorners() const
    Definition boundaryiterators.hh:188
    \n+
    CellIterator beginCells() const
    Definition boundaryiterators.hh:181
    \n+
    NonConformingConnectivityWriter< Cell > ConnectivityWriter
    Definition boundaryiterators.hh:174
    \n+
    CornerIterator endCorners() const
    Definition boundaryiterators.hh:191
    \n+
    VTK::Corner< Cell > Corner
    Definition boundaryiterators.hh:168
    \n+
    GV::Intersection Cell
    Definition boundaryiterators.hh:165
    \n+
    CornerIterator PointIterator
    Definition boundaryiterators.hh:172
    \n+
    NonConformingBoundaryIteratorFactory(const GV &gv_)
    Definition boundaryiterators.hh:177
    \n+
    CellIterator endCells() const
    Definition boundaryiterators.hh:184
    \n+
    const Communication & comm() const
    Definition boundaryiterators.hh:201
    \n+
    PointIterator endPoints() const
    Definition boundaryiterators.hh:196
    \n+
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n+
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n+
    writer for the connectivity array in nonconforming mode
    Definition functionwriter.hh:261
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,93 +2,320 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-vertex.hh\n+ * vtk\n+boundaryiterators.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_VERTEXBLOCK_HH\n-6#define DUNE_DGF_VERTEXBLOCK_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12\n-13namespace Dune\n-14{\n-15\n-16 namespace dgf\n-17 {\n-18\n-19 class VertexBlock\n-20 : public BasicBlock\n-21 {\n-22 int dimvertex; // the dimension of the vertices (determined from DGF file)\n-23 int dimworld; // the dimension of the world (either dimvertex or given by\n-user)\n-24 bool goodline; // active line describes a vertex\n-25 int vtxoffset;\n-26 int nofParam;\n-27\n-28 public:\n-29 // initialize vertex block\n-30 VertexBlock ( std :: istream &in, int &pdimworld );\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH\n+7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH\n+8\n+9#include \n+10#include \n+11\n+12#include \n+13\n+14#include \n+15#include \n+16#include \n+17\n+18namespace Dune {\n+19\n+22\n+28 namespace VTK {\n+29\n 31\n-32 int get ( std :: vector< std :: vector< double > > &vtx,\n-33 std :: vector< std :: vector< double > > ¶m,\n-34 int &nofp );\n-35\n-36 // some information\n-37 bool ok () const\n-38 {\n-39 return goodline;\n-40 }\n-41\n-42 int offset () const\n+35 template\n+36 class BoundaryIterator\n+37 : public ForwardIteratorFacade\n+38 < BoundaryIterator,\n+39 const typename GV::Intersection,\n+40 const typename GV::Intersection&,\n+41 typename std::iterator_traits::\n+42 Iterator>::difference_type>\n 43 {\n-44 return vtxoffset;\n-45 }\n-46\n-47 private:\n-48 // get dimworld\n-49 int getDimWorld ();\n-50\n-51 // get next vertex\n-52 bool next ( std :: vector< double > &point, std :: vector< double > ¶m\n-);\n-53 };\n-54\n-55 } // end namespace dgf\n-56\n-57} // end namespace Dune\n-58\n-59#endif\n-basic.hh\n+44 public:\n+45 // reiterator the facades typedefs here\n+46 typedef BoundaryIterator DerivedType;\n+47 typedef const typename GV::Intersection Value;\n+48 typedef Value& Reference;\n+49 typedef typename GV::template Codim<0>::Iterator ElementIterator;\n+50 typedef typename GV::IntersectionIterator IntersectionIterator;\n+51 typedef typename std::iterator_traits::difference_type\n+52 DifferenceType;\n+53\n+54 private:\n+55 typedef ForwardIteratorFacade Facade;\n+57\n+58 const GV* gv;\n+59 ElementIterator eit;\n+60 std::shared_ptr iit;\n+61\n+62 bool valid() const {\n+63 // we're valid if we're passed-the-end\n+64 if(eit == gv->template end<0>()) return true;\n+65 // or if we're on a boundary\n+66 if((*iit)->boundary() && !(*iit)->neighbor()) return true;\n+67 // otherwise we're invalid\n+68 return false;\n+69 }\n+70\n+71 void basic_increment() {\n+72 ++*iit;\n+73 if(*iit == gv->iend(*eit)) {\n+74 iit.reset();\n+75 ++eit;\n+76 if(eit != gv->template end<0>())\n+77 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));\n+78 }\n+79 }\n+80\n+81 public:\n+82 Reference dereference() const {\n+83 return **iit;\n+84 }\n+85 bool equals(const DerivedType& other) const {\n+86 if(eit != other.eit) return false;\n+87\n+88 // this is a bit tricky, since we may not compare iit if we are\n+89 // passed-the-end\n+90 bool mePassedTheEnd = eit == gv->template end<0>();\n+91 bool otherPassedTheEnd = other.eit == other.gv->template end<0>();\n+92\n+93 // both passed-the-end => consider them equal\n+94 if(mePassedTheEnd && otherPassedTheEnd) return true;\n+95\n+96 // one passed the end => not equal\n+97 if(mePassedTheEnd || otherPassedTheEnd) return false;\n+98\n+99 // none passed-the-end => do their iit iterators match?\n+100 return *iit == *other.iit;\n+101 }\n+102\n+103 void increment() {\n+104 basic_increment();\n+105 while(!valid()) basic_increment();\n+106 }\n+107\n+109\n+113 BoundaryIterator(const GV& gv_, const ElementIterator& eit_,\n+114 const IntersectionIterator& iit_)\n+115 : gv(&gv_), eit(eit_), iit(new IntersectionIterator(iit_))\n+116 {\n+117 while(!valid()) basic_increment();\n+118 }\n+120\n+125 BoundaryIterator(const GV& gv_, const ElementIterator& eit_)\n+126 : gv(&gv_), eit(eit_)\n+127 {\n+128 if(eit != gv->template end<0>())\n+129 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));\n+130\n+131 while(!valid()) basic_increment();\n+132 }\n+134\n+138 BoundaryIterator(const GV& gv_, bool end = false)\n+139 : gv(&gv_), eit(end ? gv->template end<0>() : gv->template begin<0>())\n+140 {\n+141 if(eit != gv->template end<0>())\n+142 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));\n+143\n+144 while(!valid()) basic_increment();\n+145 }\n+146 };\n+147\n+148 template\n+149 class IntersectionIndexSet {\n+150 const ElementIndexSet& eis;\n+151\n+152 public:\n+153 IntersectionIndexSet(const ElementIndexSet& eis_)\n+154 : eis(eis_)\n+155 { }\n+156 };\n+157\n+158 template\n+159 class NonConformingBoundaryIteratorFactory {\n+160 const GV& gv;\n+161\n+162 public:\n+163 static const unsigned dimCell = GV::dimension-1;\n+164\n+165 typedef typename GV::Intersection Cell;\n+166 typedef BoundaryIterator CellIterator;\n+167\n+168 typedef VTK::Corner Corner;\n+169 typedef VTK::CornerIterator CornerIterator;\n+170\n+171 typedef Corner Point;\n+172 typedef CornerIterator PointIterator;\n+173\n+174 typedef NonConformingConnectivityWriter ConnectivityWriter;\n+175 typedef typename GV::Communication Communication;\n+176\n+177 explicit NonConformingBoundaryIteratorFactory(const GV& gv_)\n+178 : gv(gv_)\n+179 { }\n+180\n+181 CellIterator beginCells() const {\n+182 return CellIterator(gv);\n+183 }\n+184 CellIterator endCells() const {\n+185 return CellIterator(gv, true);\n+186 }\n+187\n+188 CornerIterator beginCorners() const {\n+189 return CornerIterator(beginCells(), endCells());\n+190 }\n+191 CornerIterator endCorners() const {\n+192 return CornerIterator(endCells());\n+193 }\n+194\n+195 PointIterator beginPoints() const { return beginCorners(); }\n+196 PointIterator endPoints() const { return endCorners(); }\n+197\n+198 ConnectivityWriter makeConnectivity() const {\n+199 return ConnectivityWriter();\n+200 }\n+201 const Communication& comm() const {\n+202 return gv.comm();\n+203 }\n+204 };\n+205\n+206 } // namespace VTK\n+207\n+209\n+210} // namespace Dune\n+211\n+212#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH\n+corneriterator.hh\n+functionwriter.hh\n+corner.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::VertexBlock\n-Definition vertex.hh:21\n-Dune::dgf::VertexBlock::get\n-int get(std ::vector< std ::vector< double > > &vtx, std ::vector< std ::\n-vector< double > > ¶m, int &nofp)\n-Definition vertex.cc:62\n-Dune::dgf::VertexBlock::offset\n-int offset() const\n-Definition vertex.hh:42\n-Dune::dgf::VertexBlock::ok\n-bool ok() const\n-Definition vertex.hh:37\n+Dune::VTK::BoundaryIterator\n+iterate over the GridViews boundary intersections\n+Definition boundaryiterators.hh:43\n+Dune::VTK::BoundaryIterator::DerivedType\n+BoundaryIterator< GV > DerivedType\n+Definition boundaryiterators.hh:46\n+Dune::VTK::BoundaryIterator::BoundaryIterator\n+BoundaryIterator(const GV &gv_, const ElementIterator &eit_)\n+construct a BoundaryIterator\n+Definition boundaryiterators.hh:125\n+Dune::VTK::BoundaryIterator::dereference\n+Reference dereference() const\n+Definition boundaryiterators.hh:82\n+Dune::VTK::BoundaryIterator::Value\n+const GV::Intersection Value\n+Definition boundaryiterators.hh:47\n+Dune::VTK::BoundaryIterator::BoundaryIterator\n+BoundaryIterator(const GV &gv_, bool end=false)\n+construct a BoundaryIterator\n+Definition boundaryiterators.hh:138\n+Dune::VTK::BoundaryIterator::BoundaryIterator\n+BoundaryIterator(const GV &gv_, const ElementIterator &eit_, const\n+IntersectionIterator &iit_)\n+construct a BoundaryIterator\n+Definition boundaryiterators.hh:113\n+Dune::VTK::BoundaryIterator::ElementIterator\n+GV::template Codim< 0 >::Iterator ElementIterator\n+Definition boundaryiterators.hh:49\n+Dune::VTK::BoundaryIterator::Reference\n+Value & Reference\n+Definition boundaryiterators.hh:48\n+Dune::VTK::BoundaryIterator::IntersectionIterator\n+GV::IntersectionIterator IntersectionIterator\n+Definition boundaryiterators.hh:50\n+Dune::VTK::BoundaryIterator::equals\n+bool equals(const DerivedType &other) const\n+Definition boundaryiterators.hh:85\n+Dune::VTK::BoundaryIterator::DifferenceType\n+std::iterator_traits< ElementIterator >::difference_type DifferenceType\n+Definition boundaryiterators.hh:52\n+Dune::VTK::BoundaryIterator::increment\n+void increment()\n+Definition boundaryiterators.hh:103\n+Dune::VTK::IntersectionIndexSet\n+Definition boundaryiterators.hh:149\n+Dune::VTK::IntersectionIndexSet::IntersectionIndexSet\n+IntersectionIndexSet(const ElementIndexSet &eis_)\n+Definition boundaryiterators.hh:153\n+Dune::VTK::NonConformingBoundaryIteratorFactory\n+Definition boundaryiterators.hh:159\n+Dune::VTK::NonConformingBoundaryIteratorFactory::beginPoints\n+PointIterator beginPoints() const\n+Definition boundaryiterators.hh:195\n+Dune::VTK::NonConformingBoundaryIteratorFactory::makeConnectivity\n+ConnectivityWriter makeConnectivity() const\n+Definition boundaryiterators.hh:198\n+Dune::VTK::NonConformingBoundaryIteratorFactory::Communication\n+GV::Communication Communication\n+Definition boundaryiterators.hh:175\n+Dune::VTK::NonConformingBoundaryIteratorFactory::dimCell\n+static const unsigned dimCell\n+Definition boundaryiterators.hh:163\n+Dune::VTK::NonConformingBoundaryIteratorFactory::CornerIterator\n+VTK::CornerIterator< CellIterator > CornerIterator\n+Definition boundaryiterators.hh:169\n+Dune::VTK::NonConformingBoundaryIteratorFactory::CellIterator\n+BoundaryIterator< GV > CellIterator\n+Definition boundaryiterators.hh:166\n+Dune::VTK::NonConformingBoundaryIteratorFactory::Point\n+Corner Point\n+Definition boundaryiterators.hh:171\n+Dune::VTK::NonConformingBoundaryIteratorFactory::beginCorners\n+CornerIterator beginCorners() const\n+Definition boundaryiterators.hh:188\n+Dune::VTK::NonConformingBoundaryIteratorFactory::beginCells\n+CellIterator beginCells() const\n+Definition boundaryiterators.hh:181\n+Dune::VTK::NonConformingBoundaryIteratorFactory::ConnectivityWriter\n+NonConformingConnectivityWriter< Cell > ConnectivityWriter\n+Definition boundaryiterators.hh:174\n+Dune::VTK::NonConformingBoundaryIteratorFactory::endCorners\n+CornerIterator endCorners() const\n+Definition boundaryiterators.hh:191\n+Dune::VTK::NonConformingBoundaryIteratorFactory::Corner\n+VTK::Corner< Cell > Corner\n+Definition boundaryiterators.hh:168\n+Dune::VTK::NonConformingBoundaryIteratorFactory::Cell\n+GV::Intersection Cell\n+Definition boundaryiterators.hh:165\n+Dune::VTK::NonConformingBoundaryIteratorFactory::PointIterator\n+CornerIterator PointIterator\n+Definition boundaryiterators.hh:172\n+Dune::VTK::NonConformingBoundaryIteratorFactory::\n+NonConformingBoundaryIteratorFactory\n+NonConformingBoundaryIteratorFactory(const GV &gv_)\n+Definition boundaryiterators.hh:177\n+Dune::VTK::NonConformingBoundaryIteratorFactory::endCells\n+CellIterator endCells() const\n+Definition boundaryiterators.hh:184\n+Dune::VTK::NonConformingBoundaryIteratorFactory::comm\n+const Communication & comm() const\n+Definition boundaryiterators.hh:201\n+Dune::VTK::NonConformingBoundaryIteratorFactory::endPoints\n+PointIterator endPoints() const\n+Definition boundaryiterators.hh:196\n+Dune::VTK::Corner\n+simple class representing a corner of a cell\n+Definition corner.hh:25\n+Dune::VTK::CornerIterator\n+iterate over the corners of some cell range\n+Definition corneriterator.hh:39\n+Dune::VTK::NonConformingConnectivityWriter\n+writer for the connectivity array in nonconforming mode\n+Definition functionwriter.hh:261\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00827.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00827.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarydom.cc File Reference\n+dune-grid: corner.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,40 @@\n \n \n \n \n \n \n \n
    \n \n-
    boundarydom.cc File Reference
    \n+
    corner.hh File Reference
    \n
    \n
    \n-\n+\n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTK::Corner< Cell >
     simple class representing a corner of a cell More...
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,24 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-boundarydom.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+corner.hh File Reference\n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::VTK::Corner<_Cell_>\n+\u00a0 simple class representing a corner of a cell More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+namespace \u00a0 Dune::VTK\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00830.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00830.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridparameter.hh File Reference\n+dune-grid: subsamplingvtkwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,44 +65,52 @@\n \n \n \n \n \n \n \n
    \n \n-
    gridparameter.hh File Reference
    \n+
    subsamplingvtkwriter.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n-#include <string>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+\n+

    Provides subsampled file i/o for the visualization toolkit. \n+More...

    \n+
    #include <ostream>
    \n+#include <memory>
    \n+#include <dune/common/indent.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/geometry/virtualrefinement.hh>
    \n+#include <dune/grid/io/file/vtk/vtkwriter.hh>
    \n+#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::dgf::GridParameterBlock
     Common Grid parameters. More...
    class  Dune::SubsamplingVTKWriter< GridView >
     Writer for the output of subsampled grid functions in the vtk format. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-
    \n+

    Detailed Description

    \n+

    Provides subsampled file i/o for the visualization toolkit.

    \n+
    Author
    J\u00f6 Fahlke
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,27 +2,34 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n+ * vtk\n Classes | Namespaces\n-gridparameter.hh File Reference\n-#include \n-#include \n-#include \n+subsamplingvtkwriter.hh File Reference\n+Provides subsampled file i/o for the visualization toolkit. More...\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 \u00a0 Dune::dgf::GridParameterBlock\n-\u00a0 Common Grid parameters. More...\n+class \u00a0 Dune::SubsamplingVTKWriter<_GridView_>\n+\u00a0 Writer for the output of subsampled grid functions in the vtk format.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n+***** Detailed Description *****\n+Provides subsampled file i/o for the visualization toolkit.\n+ Author\n+ J\u00c3\u00b6 Fahlke\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00830_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00830_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridparameter.hh Source File\n+dune-grid: subsamplingvtkwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,151 +70,408 @@\n \n \n \n \n \n \n \n
    \n-
    gridparameter.hh
    \n+
    subsamplingvtkwriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_GRIDPARAMETERBLOCK_HH
    \n-
    6#define DUNE_DGF_GRIDPARAMETERBLOCK_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <string>
    \n-
    10
    \n-\n-
    12
    \n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 namespace dgf
    \n-
    18 {
    \n-
    \n-\n-
    34 : public BasicBlock
    \n-
    35 {
    \n-
    36 public:
    \n-
    37 typedef unsigned int Flags;
    \n-
    38
    \n-
    39 static const Flags foundName = 1 << 0;
    \n-
    40 static const Flags foundDumpFileName = 1 << 1;
    \n-
    41 static const Flags foundLongestEdge = 1 << 5;
    \n-
    42 static const Flags foundCompatible = 1 << 13;
    \n-
    43
    \n-
    44 protected:
    \n-
    45 Flags foundFlags_; // supportFlags, this block was created with
    \n-
    46 std::string name_; // name of the grid
    \n-
    47 std::string dumpFileName_; // name of the grid
    \n-
    48 bool markLongestEdge_; // Mark longest edge for AlbertaGrid or ALUGrid
    \n-
    49 bool bisectionCompatibility_; // true if grid is compatible (bisection refinement works)
    \n+
    5
    \n+
    6#ifndef DUNE_SUBSAMPLINGVTKWRITER_HH
    \n+
    7#define DUNE_SUBSAMPLINGVTKWRITER_HH
    \n+
    8
    \n+
    9#include <ostream>
    \n+
    10#include <memory>
    \n+
    11
    \n+
    12#include <dune/common/indent.hh>
    \n+
    13#include <dune/geometry/type.hh>
    \n+
    14#include <dune/geometry/virtualrefinement.hh>
    \n+\n+\n+
    17
    \n+
    24namespace Dune
    \n+
    25{
    \n+
    37 template< class GridView >
    \n+
    \n+\n+
    39 : public VTKWriter<GridView>
    \n+
    40 {
    \n+\n+
    42 constexpr static int dim = GridView::dimension;
    \n+
    43 constexpr static int dimw = GridView::dimensionworld;
    \n+
    44 typedef typename GridView::Grid::ctype ctype;
    \n+
    45 typedef typename GridView::template Codim< 0 >::Entity Entity;
    \n+
    46 typedef VirtualRefinement<dim, ctype> Refinement;
    \n+
    47 typedef typename Refinement::IndexVector IndexVector;
    \n+
    48 typedef typename Refinement::ElementIterator SubElementIterator;
    \n+
    49 typedef typename Refinement::VertexIterator SubVertexIterator;
    \n
    50
    \n-
    51 private:
    \n-
    52 // copy not implemented
    \n-\n-
    54
    \n-
    55 public:
    \n-
    57 GridParameterBlock ( std::istream &in );
    \n-
    58
    \n-
    \n-
    60 const std::string &name ( const std::string &defaultValue ) const
    \n-
    61 {
    \n-
    62 if( (foundFlags_ & foundName) == 0 )
    \n-
    63 {
    \n-
    64 dwarn << "GridParameterBlock: Parameter 'name' not specified, "
    \n-
    65 << "defaulting to '" << defaultValue << "'." << std::endl;
    \n-
    66 return defaultValue;
    \n-
    67 }
    \n-
    68 else
    \n-
    69 return name_;
    \n-
    70 }
    \n-
    \n-
    71
    \n-
    \n-
    72 const std::string &dumpFileName ( ) const
    \n-
    73 {
    \n-
    74 if( (foundFlags_ & foundDumpFileName) != 0 )
    \n-
    75 {
    \n-
    76 dwarn << "GridParameterBlock: found Parameter 'dumpfilename', "
    \n-
    77 << "dumping file to `" << dumpFileName_ << "'" << std::endl;
    \n-
    78 }
    \n-
    79 return dumpFileName_;
    \n-
    80 }
    \n-
    \n-
    81
    \n-
    \n-
    83 bool markLongestEdge () const
    \n-
    84 {
    \n-
    85 if( (foundFlags_ & foundLongestEdge) == 0 )
    \n-
    86 {
    \n-
    87 dwarn << "GridParameterBlock: Parameter 'refinementedge' not specified, "
    \n-
    88 << "defaulting to 'ARBITRARY'." << std::endl;
    \n-
    89 }
    \n-
    90 return markLongestEdge_;
    \n-
    91 }
    \n-
    \n-
    92
    \n-
    \n-\n-
    95 {
    \n-
    96 if( (foundFlags_ & foundCompatible) == 0 )
    \n-
    97 {
    \n-
    98 dwarn << "GridParameterBlock: Parameter 'bisectioncompatibility' not specified, "
    \n-
    99 << "defaulting to '0' (false)." << std::endl;
    \n-
    100 }
    \n-\n-
    102 }
    \n-
    \n-
    103
    \n-
    104 // some information
    \n-
    \n-
    105 bool ok()
    \n-
    106 {
    \n-
    107 return true;
    \n-
    108 }
    \n-
    \n-
    109 };
    \n-
    \n+
    51 typedef typename Base::CellIterator CellIterator;
    \n+
    52 typedef typename Base::FunctionIterator FunctionIterator;
    \n+
    53 using Base::cellBegin;
    \n+
    54 using Base::cellEnd;
    \n+
    55 using Base::celldata;
    \n+
    56 using Base::ncells;
    \n+
    57 using Base::ncorners;
    \n+
    58 using Base::nvertices;
    \n+
    59 using Base::outputtype;
    \n+\n+
    61 using Base::vertexEnd;
    \n+
    62 using Base::vertexdata;
    \n+
    63
    \n+
    64 public:
    \n+
    \n+
    80 explicit SubsamplingVTKWriter (const GridView &gridView,
    \n+
    81 Dune::RefinementIntervals intervals_, bool coerceToSimplex_ = false,
    \n+\n+
    83 : Base(gridView, VTK::nonconforming, coordPrecision)
    \n+
    84 , intervals(intervals_), coerceToSimplex(coerceToSimplex_)
    \n+
    85 {
    \n+
    86 if(intervals_.intervals() < 1) {
    \n+
    87 DUNE_THROW(Dune::IOError,"SubsamplingVTKWriter: Refinement intervals must be larger than zero! (One interval means no subsampling)");
    \n+
    88 }
    \n+
    89 }
    \n+
    \n+
    90
    \n+
    91 private:
    \n+
    92 GeometryType subsampledGeometryType(GeometryType geometryType)
    \n+
    93 {
    \n+
    94 return (geometryType.isCube() && !coerceToSimplex ? geometryType : GeometryTypes::simplex(dim));
    \n+
    95 }
    \n+
    96
    \n+
    97 template<typename SubIterator>
    \n+
    98 struct IteratorSelector
    \n+
    99 {};
    \n+
    100
    \n+
    101 SubElementIterator refinementBegin(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubElementIterator>)
    \n+
    102 {
    \n+
    103 return refinement.eBegin(intervals);
    \n+
    104 }
    \n+
    105
    \n+
    106 SubVertexIterator refinementBegin(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubVertexIterator>)
    \n+
    107 {
    \n+
    108 return refinement.vBegin(intervals);
    \n+
    109 }
    \n
    110
    \n-
    111
    \n-
    112 } // end namespace dgf
    \n-
    113
    \n-
    114} // end namespace Dune
    \n+
    111 SubElementIterator refinementEnd(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubElementIterator>)
    \n+
    112 {
    \n+
    113 return refinement.eEnd(intervals);
    \n+
    114 }
    \n
    115
    \n-
    116#endif
    \n-\n+
    116 SubVertexIterator refinementEnd(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubVertexIterator>)
    \n+
    117 {
    \n+
    118 return refinement.vEnd(intervals);
    \n+
    119 }
    \n+
    120
    \n+
    121 template<typename Data, typename Iterator, typename SubIterator>
    \n+
    122 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator begin, const Iterator end, int nentries, IteratorSelector<SubIterator> sis)
    \n+
    123 {
    \n+
    124 for (auto it = data.begin(),
    \n+
    125 iend = data.end();
    \n+
    126 it != iend;
    \n+
    127 ++it)
    \n+
    128 {
    \n+
    129 const auto& f = *it;
    \n+
    130 VTK::FieldInfo fieldInfo = f.fieldInfo();
    \n+
    131 std::size_t writecomps = fieldInfo.size();
    \n+
    132 switch (fieldInfo.type())
    \n+
    133 {
    \n+\n+
    135 break;
    \n+\n+
    137 // vtk file format: a vector data always should have 3 comps (with
    \n+
    138 // 3rd comp = 0 in 2D case)
    \n+
    139 if (writecomps > 3)
    \n+
    140 DUNE_THROW(IOError,"Cannot write VTK vectors with more than 3 components (components was " << writecomps << ")");
    \n+
    141 writecomps = 3;
    \n+
    142 break;
    \n+\n+
    144 DUNE_THROW(NotImplemented,"VTK output for tensors not implemented yet");
    \n+
    145 }
    \n+
    146 std::shared_ptr<VTK::DataArrayWriter> p
    \n+
    147 (writer.makeArrayWriter(f.name(), writecomps, nentries, fieldInfo.precision()));
    \n+
    148 if(!p->writeIsNoop())
    \n+
    149 for (Iterator eit = begin; eit!=end; ++eit)
    \n+
    150 {
    \n+
    151 const Entity & e = *eit;
    \n+
    152 f.bind(e);
    \n+
    153 Refinement &refinement =
    \n+
    154 buildRefinement<dim, ctype>(eit->type(),
    \n+
    155 subsampledGeometryType(eit->type()));
    \n+
    156 for(SubIterator sit = refinementBegin(refinement,intervals,sis),
    \n+
    157 send = refinementEnd(refinement,intervals,sis);
    \n+
    158 sit != send;
    \n+
    159 ++sit)
    \n+
    160 {
    \n+
    161 f.write(sit.coords(),*p);
    \n+
    162 // expand 2D-Vectors to 3D for VTK format
    \n+
    163 for(unsigned j = f.fieldInfo().size(); j < writecomps; j++)
    \n+
    164 p->write(0.0);
    \n+
    165 }
    \n+
    166 f.unbind();
    \n+
    167 }
    \n+
    168 }
    \n+
    169 }
    \n+
    170
    \n+
    171
    \n+
    172 protected:
    \n+
    174 virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_);
    \n+
    175
    \n+
    177 virtual void writeCellData(VTK::VTUWriter& writer);
    \n+
    178
    \n+
    180 virtual void writeVertexData(VTK::VTUWriter& writer);
    \n+
    181
    \n+
    183 virtual void writeGridPoints(VTK::VTUWriter& writer);
    \n+
    184
    \n+
    186 virtual void writeGridCells(VTK::VTUWriter& writer);
    \n+
    187
    \n+
    188 public:
    \n+\n+
    190 using Base::addCellData;
    \n+
    191
    \n+
    192 private:
    \n+
    193 // hide addVertexData -- adding raw data directly without a VTKFunction
    \n+
    194 // currently does not make sense for subsampled meshes, as the higher order
    \n+
    195 // information is missing. See FS#676.
    \n+
    196 template<class V>
    \n+
    197 void addVertexData (const V& v, const std::string &name, int ncomps=1);
    \n+
    198 template<class V>
    \n+
    199 void addCellData (const V& v, const std::string &name, int ncomps=1);
    \n+
    200
    \n+
    201 Dune::RefinementIntervals intervals;
    \n+
    202 bool coerceToSimplex;
    \n+
    203 };
    \n+
    \n+
    204
    \n+
    206 template <class GridView>
    \n+
    \n+
    207 void SubsamplingVTKWriter<GridView>::countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    \n+
    208 {
    \n+
    209 nvertices_ = 0;
    \n+
    210 ncells_ = 0;
    \n+
    211 ncorners_ = 0;
    \n+
    212 for (CellIterator it=this->cellBegin(); it!=cellEnd(); ++it)
    \n+
    213 {
    \n+
    214 Refinement &refinement = buildRefinement<dim, ctype>(it->type(), subsampledGeometryType(it->type()));
    \n+
    215
    \n+
    216 ncells_ += refinement.nElements(intervals);
    \n+
    217 nvertices_ += refinement.nVertices(intervals);
    \n+
    218 ncorners_ += refinement.nElements(intervals) * refinement.eBegin(intervals).vertexIndices().size();
    \n+
    219 }
    \n+
    220 }
    \n+
    \n+
    221
    \n+
    222
    \n+
    224 template <class GridView>
    \n+
    \n+\n+
    226 {
    \n+
    227 if(celldata.size() == 0)
    \n+
    228 return;
    \n+
    229
    \n+
    230 // Find the names of the first scalar and vector data fields.
    \n+
    231 // These will be marked as the default fields (the ones that ParaView shows
    \n+
    232 // when the file has just been opened).
    \n+
    233 std::string defaultScalarField, defaultVectorField;
    \n+
    234 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames(celldata);
    \n+
    235
    \n+
    236 writer.beginCellData(defaultScalarField, defaultVectorField);
    \n+
    237 writeData(writer,celldata,cellBegin(),cellEnd(),ncells,IteratorSelector<SubElementIterator>());
    \n+
    238 writer.endCellData();
    \n+
    239 }
    \n+
    \n+
    240
    \n+
    242 template <class GridView>
    \n+
    \n+\n+
    244 {
    \n+
    245 if(vertexdata.size() == 0)
    \n+
    246 return;
    \n+
    247
    \n+
    248 // Find the names of the first scalar and vector data fields.
    \n+
    249 // These will be marked as the default fields (the ones that ParaView shows
    \n+
    250 // when the file has just been opened).
    \n+
    251 std::string defaultScalarField, defaultVectorField;
    \n+
    252 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames(vertexdata);
    \n+
    253
    \n+
    254 writer.beginPointData(defaultScalarField, defaultVectorField);
    \n+
    255 writeData(writer,vertexdata,cellBegin(),cellEnd(),nvertices,IteratorSelector<SubVertexIterator>());
    \n+
    256 writer.endPointData();
    \n+
    257 }
    \n+
    \n+
    258
    \n+
    260 template <class GridView>
    \n+
    \n+\n+
    262 {
    \n+
    263 writer.beginPoints();
    \n+
    264
    \n+
    265 std::shared_ptr<VTK::DataArrayWriter> p
    \n+
    266 (writer.makeArrayWriter("Coordinates", 3, nvertices, this->coordPrecision()));
    \n+
    267 if(!p->writeIsNoop())
    \n+
    268 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)
    \n+
    269 {
    \n+
    270 Refinement &refinement =
    \n+
    271 buildRefinement<dim, ctype>(i->type(),
    \n+
    272 subsampledGeometryType(i->type()));
    \n+
    273 for(SubVertexIterator sit = refinement.vBegin(intervals),
    \n+
    274 send = refinement.vEnd(intervals);
    \n+
    275 sit != send; ++sit)
    \n+
    276 {
    \n+
    277 FieldVector<ctype, dimw> coords = i->geometry().global(sit.coords());
    \n+
    278 for (int j=0; j<std::min(int(dimw),3); j++)
    \n+
    279 p->write(coords[j]);
    \n+
    280 for (int j=std::min(int(dimw),3); j<3; j++)
    \n+
    281 p->write(0.0);
    \n+
    282 }
    \n+
    283 }
    \n+
    284 // free the VTK::DataArrayWriter before touching the stream
    \n+
    285 p.reset();
    \n+
    286
    \n+
    287 writer.endPoints();
    \n+
    288 }
    \n+
    \n+
    289
    \n+
    291 template <class GridView>
    \n+
    \n+\n+
    293 {
    \n+
    294 writer.beginCells();
    \n+
    295
    \n+
    296 // connectivity
    \n+
    297 {
    \n+
    298 std::shared_ptr<VTK::DataArrayWriter> p1
    \n+
    299 (writer.makeArrayWriter("connectivity", 1, ncorners, VTK::Precision::int32));
    \n+
    300 // The offset within the index numbering
    \n+
    301 if(!p1->writeIsNoop()) {
    \n+
    302 int offset = 0;
    \n+
    303 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)
    \n+
    304 {
    \n+
    305 GeometryType coercedToType = subsampledGeometryType(i->type());
    \n+
    306 Refinement &refinement =
    \n+
    307 buildRefinement<dim, ctype>(i->type(), coercedToType);
    \n+
    308 for(SubElementIterator sit = refinement.eBegin(intervals),
    \n+
    309 send = refinement.eEnd(intervals);
    \n+
    310 sit != send; ++sit)
    \n+
    311 {
    \n+
    312 IndexVector indices = sit.vertexIndices();
    \n+
    313 for(unsigned int ii = 0; ii < indices.size(); ++ii)
    \n+
    314 p1->write(offset+indices[VTK::renumber(coercedToType, ii)]);
    \n+
    315 }
    \n+
    316 offset += refinement.nVertices(intervals);
    \n+
    317 }
    \n+
    318 }
    \n+
    319 }
    \n+
    320
    \n+
    321 // offsets
    \n+
    322 {
    \n+
    323 std::shared_ptr<VTK::DataArrayWriter> p2
    \n+
    324 (writer.makeArrayWriter("offsets", 1, ncells, VTK::Precision::int32));
    \n+
    325 if(!p2->writeIsNoop()) {
    \n+
    326 // The offset into the connectivity array
    \n+
    327 int offset = 0;
    \n+
    328 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)
    \n+
    329 {
    \n+
    330 Refinement &refinement =
    \n+
    331 buildRefinement<dim, ctype>(i->type(),
    \n+
    332 subsampledGeometryType(i->type()));
    \n+
    333 unsigned int verticesPerCell =
    \n+
    334 refinement.eBegin(intervals).vertexIndices().size();
    \n+
    335 for(int element = 0; element < refinement.nElements(intervals);
    \n+
    336 ++element)
    \n+
    337 {
    \n+
    338 offset += verticesPerCell;
    \n+
    339 p2->write(offset);
    \n+
    340 }
    \n+
    341 }
    \n+
    342 }
    \n+
    343 }
    \n+
    344
    \n+
    345 // types
    \n+
    346 if (dim>1)
    \n+
    347 {
    \n+
    348 std::shared_ptr<VTK::DataArrayWriter> p3
    \n+
    349 (writer.makeArrayWriter("types", 1, ncells, VTK::Precision::uint8));
    \n+
    350 if(!p3->writeIsNoop())
    \n+
    351 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n+
    352 {
    \n+
    353 GeometryType coerceTo = subsampledGeometryType(it->type());
    \n+
    354 Refinement &refinement =
    \n+
    355 buildRefinement<dim, ctype>(it->type(), coerceTo);
    \n+
    356 int vtktype = VTK::geometryType(coerceTo);
    \n+
    357 for(int i = 0; i < refinement.nElements(intervals); ++i)
    \n+
    358 p3->write(vtktype);
    \n+
    359 }
    \n+
    360 }
    \n+
    361
    \n+
    362 writer.endCells();
    \n+
    363 }
    \n+
    \n+
    364}
    \n+
    365
    \n+
    366#endif // DUNE_SUBSAMPLINGVTKWRITER_HH
    \n+
    Provides file i/o for the visualization toolkit.
    \n+\n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    Common Grid parameters.
    Definition gridparameter.hh:35
    \n-
    static const Flags foundDumpFileName
    Definition gridparameter.hh:40
    \n-
    const std::string & dumpFileName() const
    Definition gridparameter.hh:72
    \n-
    static const Flags foundName
    Definition gridparameter.hh:39
    \n-
    GridParameterBlock(std::istream &in)
    constructor: read common parameters
    \n-
    static const Flags foundCompatible
    Definition gridparameter.hh:42
    \n-
    unsigned int Flags
    Definition gridparameter.hh:37
    \n-
    bool bisectionCompatibility_
    Definition gridparameter.hh:49
    \n-
    std::string dumpFileName_
    Definition gridparameter.hh:47
    \n-
    bool ok()
    Definition gridparameter.hh:105
    \n-
    Flags foundFlags_
    Definition gridparameter.hh:45
    \n-
    const std::string & name(const std::string &defaultValue) const
    return the name of the grid
    Definition gridparameter.hh:60
    \n-
    std::string name_
    Definition gridparameter.hh:46
    \n-
    bool bisectionCompatibility() const
    returns true if grid is compatible for bisection refinement
    Definition gridparameter.hh:94
    \n-
    bool markLongestEdge() const
    returns true if longest edge should be marked for AlbertaGrid
    Definition gridparameter.hh:83
    \n-
    static const Flags foundLongestEdge
    Definition gridparameter.hh:41
    \n-
    bool markLongestEdge_
    Definition gridparameter.hh:48
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+\n+\n+\n+
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n+
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n+
    @ tensor
    tensor field (always 3x3)
    \n+
    @ vector
    vector-valued field (always 3D, will be padded if necessary)
    \n+\n+
    Writer for the output of subsampled grid functions in the vtk format.
    Definition subsamplingvtkwriter.hh:40
    \n+
    virtual void writeGridPoints(VTK::VTUWriter &writer)
    write the positions of vertices
    Definition subsamplingvtkwriter.hh:261
    \n+
    virtual void writeVertexData(VTK::VTUWriter &writer)
    write vertex data
    Definition subsamplingvtkwriter.hh:243
    \n+
    SubsamplingVTKWriter(const GridView &gridView, Dune::RefinementIntervals intervals_, bool coerceToSimplex_=false, VTK::Precision coordPrecision=VTK::Precision::float32)
    Construct a SubsamplingVTKWriter working on a specific GridView.
    Definition subsamplingvtkwriter.hh:80
    \n+
    virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    count the vertices, cells and corners
    Definition subsamplingvtkwriter.hh:207
    \n+
    virtual void writeCellData(VTK::VTUWriter &writer)
    write cell data
    Definition subsamplingvtkwriter.hh:225
    \n+
    virtual void writeGridCells(VTK::VTUWriter &writer)
    write the connectivity array
    Definition subsamplingvtkwriter.hh:292
    \n+
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n+
    VertexIterator vertexBegin() const
    Definition vtkwriter.hh:508
    \n+
    void addVertexData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the vertices of the grid to the visualization.
    Definition vtkwriter.hh:713
    \n+
    CellIterator cellEnd() const
    Definition vtkwriter.hh:402
    \n+
    std::list< VTKLocalFunction > vertexdata
    Definition vtkwriter.hh:1589
    \n+
    void addCellData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the cells of the grid to the visualization.
    Definition vtkwriter.hh:649
    \n+
    CellIterator cellBegin() const
    Definition vtkwriter.hh:397
    \n+
    VTK::OutputType outputtype
    Definition vtkwriter.hh:1613
    \n+
    std::list< VTKLocalFunction > celldata
    Definition vtkwriter.hh:1588
    \n+
    VTK::Precision coordPrecision() const
    get the precision with which coordinates are written out
    Definition vtkwriter.hh:782
    \n+
    std::list< VTKLocalFunction >::const_iterator FunctionIterator
    Definition vtkwriter.hh:376
    \n+
    int nvertices
    Definition vtkwriter.hh:1596
    \n+
    int ncells
    Definition vtkwriter.hh:1595
    \n+
    VertexIterator vertexEnd() const
    Definition vtkwriter.hh:515
    \n+
    int ncorners
    Definition vtkwriter.hh:1597
    \n+
    Iterator over the grids elements.
    Definition vtkwriter.hh:385
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n+
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n+
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n+
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n+
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n+
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n+
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n+
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n+
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n+
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,174 +2,527 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-gridparameter.hh\n+ * vtk\n+subsamplingvtkwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_GRIDPARAMETERBLOCK_HH\n-6#define DUNE_DGF_GRIDPARAMETERBLOCK_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12\n-13\n-14namespace Dune\n-15{\n-16\n-17 namespace dgf\n-18 {\n-33 class GridParameterBlock\n-34 : public BasicBlock\n-35 {\n-36 public:\n-37 typedef unsigned int Flags;\n-38\n-39 static const Flags foundName = 1 << 0;\n-40 static const Flags foundDumpFileName = 1 << 1;\n-41 static const Flags foundLongestEdge = 1 << 5;\n-42 static const Flags foundCompatible = 1 << 13;\n-43\n-44 protected:\n-45 Flags foundFlags_; // supportFlags, this block was created with\n-46 std::string name_; // name of the grid\n-47 std::string dumpFileName_; // name of the grid\n-48 bool markLongestEdge_; // Mark longest edge for AlbertaGrid or ALUGrid\n-49 bool bisectionCompatibility_; // true if grid is compatible (bisection\n-refinement works)\n+5\n+6#ifndef DUNE_SUBSAMPLINGVTKWRITER_HH\n+7#define DUNE_SUBSAMPLINGVTKWRITER_HH\n+8\n+9#include \n+10#include \n+11\n+12#include \n+13#include \n+14#include \n+15#include \n+16#include \n+17\n+24namespace Dune\n+25{\n+37 template< class GridView >\n+38 class SubsamplingVTKWriter\n+39 : public VTKWriter\n+40 {\n+41 typedef VTKWriter Base;\n+42 constexpr static int dim = GridView::dimension;\n+43 constexpr static int dimw = GridView::dimensionworld;\n+44 typedef typename GridView::Grid::ctype ctype;\n+45 typedef typename GridView::template Codim< 0 >::Entity Entity;\n+46 typedef VirtualRefinement Refinement;\n+47 typedef typename Refinement::IndexVector IndexVector;\n+48 typedef typename Refinement::ElementIterator SubElementIterator;\n+49 typedef typename Refinement::VertexIterator SubVertexIterator;\n 50\n-51 private:\n-52 // copy not implemented\n-53 GridParameterBlock(const GridParameterBlock&);\n-54\n-55 public:\n-57 GridParameterBlock ( std::istream &in );\n-58\n-60 const std::string &name ( const std::string &defaultValue ) const\n-61 {\n-62 if( (foundFlags_ & foundName) == 0 )\n-63 {\n-64 dwarn << \"GridParameterBlock: Parameter 'name' not specified, \"\n-65 << \"defaulting to '\" << defaultValue << \"'.\" << std::endl;\n-66 return defaultValue;\n-67 }\n-68 else\n-69 return name_;\n-70 }\n-71\n-72 const std::string &dumpFileName ( ) const\n-73 {\n-74 if( (foundFlags_ & foundDumpFileName) != 0 )\n-75 {\n-76 dwarn << \"GridParameterBlock: found Parameter 'dumpfilename', \"\n-77 << \"dumping file to `\" << dumpFileName_ << \"'\" << std::endl;\n-78 }\n-79 return dumpFileName_;\n-80 }\n-81\n-83 bool markLongestEdge () const\n-84 {\n-85 if( (foundFlags_ & foundLongestEdge) == 0 )\n-86 {\n-87 dwarn << \"GridParameterBlock: Parameter 'refinementedge' not specified, \"\n-88 << \"defaulting to 'ARBITRARY'.\" << std::endl;\n+51 typedef typename Base::CellIterator CellIterator;\n+52 typedef typename Base::FunctionIterator FunctionIterator;\n+53 using Base::cellBegin;\n+54 using Base::cellEnd;\n+55 using Base::celldata;\n+56 using Base::ncells;\n+57 using Base::ncorners;\n+58 using Base::nvertices;\n+59 using Base::outputtype;\n+60 using Base::vertexBegin;\n+61 using Base::vertexEnd;\n+62 using Base::vertexdata;\n+63\n+64 public:\n+80 explicit SubsamplingVTKWriter (const GridView &gridView,\n+81 Dune::RefinementIntervals intervals_, bool coerceToSimplex_ = false,\n+82 VTK::Precision coordPrecision = VTK::Precision::float32)\n+83 : Base(gridView, VTK::nonconforming, coordPrecision)\n+84 , intervals(intervals_), coerceToSimplex(coerceToSimplex_)\n+85 {\n+86 if(intervals_.intervals() < 1) {\n+87 DUNE_THROW(Dune::IOError,\"SubsamplingVTKWriter: Refinement intervals must be\n+larger than zero! (One interval means no subsampling)\");\n+88 }\n 89 }\n-90 return markLongestEdge_;\n-91 }\n-92\n-94 bool bisectionCompatibility() const\n-95 {\n-96 if( (foundFlags_ & foundCompatible) == 0 )\n-97 {\n-98 dwarn << \"GridParameterBlock: Parameter 'bisectioncompatibility' not\n-specified, \"\n-99 << \"defaulting to '0' (false).\" << std::endl;\n-100 }\n-101 return bisectionCompatibility_;\n-102 }\n-103\n-104 // some information\n-105 bool ok()\n-106 {\n-107 return true;\n-108 }\n-109 };\n+90\n+91 private:\n+92 GeometryType subsampledGeometryType(GeometryType geometryType)\n+93 {\n+94 return (geometryType.isCube() && !coerceToSimplex ? geometryType :\n+GeometryTypes::simplex(dim));\n+95 }\n+96\n+97 template\n+98 struct IteratorSelector\n+99 {};\n+100\n+101 SubElementIterator refinementBegin(const Refinement& refinement, Dune::\n+RefinementIntervals intervals, IteratorSelector)\n+102 {\n+103 return refinement.eBegin(intervals);\n+104 }\n+105\n+106 SubVertexIterator refinementBegin(const Refinement& refinement, Dune::\n+RefinementIntervals intervals, IteratorSelector)\n+107 {\n+108 return refinement.vBegin(intervals);\n+109 }\n 110\n-111\n-112 } // end namespace dgf\n-113\n-114} // end namespace Dune\n+111 SubElementIterator refinementEnd(const Refinement& refinement, Dune::\n+RefinementIntervals intervals, IteratorSelector)\n+112 {\n+113 return refinement.eEnd(intervals);\n+114 }\n 115\n-116#endif\n-basic.hh\n+116 SubVertexIterator refinementEnd(const Refinement& refinement, Dune::\n+RefinementIntervals intervals, IteratorSelector)\n+117 {\n+118 return refinement.vEnd(intervals);\n+119 }\n+120\n+121 template\n+122 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator\n+begin, const Iterator end, int nentries, IteratorSelector sis)\n+123 {\n+124 for (auto it = data.begin(),\n+125 iend = data.end();\n+126 it != iend;\n+127 ++it)\n+128 {\n+129 const auto& f = *it;\n+130 VTK::FieldInfo fieldInfo = f.fieldInfo();\n+131 std::size_t writecomps = fieldInfo.size();\n+132 switch (fieldInfo.type())\n+133 {\n+134 case VTK::FieldInfo::Type::scalar:\n+135 break;\n+136 case VTK::FieldInfo::Type::vector:\n+137 // vtk file format: a vector data always should have 3 comps (with\n+138 // 3rd comp = 0 in 2D case)\n+139 if (writecomps > 3)\n+140 DUNE_THROW(IOError,\"Cannot write VTK vectors with more than 3 components\n+(components was \" << writecomps << \")\");\n+141 writecomps = 3;\n+142 break;\n+143 case VTK::FieldInfo::Type::tensor:\n+144 DUNE_THROW(NotImplemented,\"VTK output for tensors not implemented yet\");\n+145 }\n+146 std::shared_ptr p\n+147 (writer.makeArrayWriter(f.name(), writecomps, nentries, fieldInfo.precision\n+()));\n+148 if(!p->writeIsNoop())\n+149 for (Iterator eit = begin; eit!=end; ++eit)\n+150 {\n+151 const Entity & e = *eit;\n+152 f.bind(e);\n+153 Refinement &refinement =\n+154 buildRefinement(eit->type(),\n+155 subsampledGeometryType(eit->type()));\n+156 for(SubIterator sit = refinementBegin(refinement,intervals,sis),\n+157 send = refinementEnd(refinement,intervals,sis);\n+158 sit != send;\n+159 ++sit)\n+160 {\n+161 f.write(sit.coords(),*p);\n+162 // expand 2D-Vectors to 3D for VTK format\n+163 for(unsigned j = f.fieldInfo().size(); j < writecomps; j++)\n+164 p->write(0.0);\n+165 }\n+166 f.unbind();\n+167 }\n+168 }\n+169 }\n+170\n+171\n+172 protected:\n+174 virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_);\n+175\n+177 virtual void writeCellData(VTK::VTUWriter& writer);\n+178\n+180 virtual void writeVertexData(VTK::VTUWriter& writer);\n+181\n+183 virtual void writeGridPoints(VTK::VTUWriter& writer);\n+184\n+186 virtual void writeGridCells(VTK::VTUWriter& writer);\n+187\n+188 public:\n+189 using Base::addVertexData;\n+190 using Base::addCellData;\n+191\n+192 private:\n+193 // hide addVertexData -- adding raw data directly without a VTKFunction\n+194 // currently does not make sense for subsampled meshes, as the higher order\n+195 // information is missing. See FS#676.\n+196 template\n+197 void addVertexData (const V& v, const std::string &name, int ncomps=1);\n+198 template\n+199 void addCellData (const V& v, const std::string &name, int ncomps=1);\n+200\n+201 Dune::RefinementIntervals intervals;\n+202 bool coerceToSimplex;\n+203 };\n+204\n+206 template \n+207 void SubsamplingVTKWriter::countEntities(int &nvertices_, int\n+&ncells_, int &ncorners_)\n+208 {\n+209 nvertices_ = 0;\n+210 ncells_ = 0;\n+211 ncorners_ = 0;\n+212 for (CellIterator it=this->cellBegin(); it!=cellEnd(); ++it)\n+213 {\n+214 Refinement &refinement = buildRefinement(it->type(),\n+subsampledGeometryType(it->type()));\n+215\n+216 ncells_ += refinement.nElements(intervals);\n+217 nvertices_ += refinement.nVertices(intervals);\n+218 ncorners_ += refinement.nElements(intervals) * refinement.eBegin\n+(intervals).vertexIndices().size();\n+219 }\n+220 }\n+221\n+222\n+224 template \n+225 void SubsamplingVTKWriter::writeCellData(VTK::VTUWriter& writer)\n+226 {\n+227 if(celldata.size() == 0)\n+228 return;\n+229\n+230 // Find the names of the first scalar and vector data fields.\n+231 // These will be marked as the default fields (the ones that ParaView shows\n+232 // when the file has just been opened).\n+233 std::string defaultScalarField, defaultVectorField;\n+234 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames\n+(celldata);\n+235\n+236 writer.beginCellData(defaultScalarField, defaultVectorField);\n+237 writeData(writer,celldata,cellBegin(),cellEnd\n+(),ncells,IteratorSelector());\n+238 writer.endCellData();\n+239 }\n+240\n+242 template \n+243 void SubsamplingVTKWriter::writeVertexData(VTK::VTUWriter&\n+writer)\n+244 {\n+245 if(vertexdata.size() == 0)\n+246 return;\n+247\n+248 // Find the names of the first scalar and vector data fields.\n+249 // These will be marked as the default fields (the ones that ParaView shows\n+250 // when the file has just been opened).\n+251 std::string defaultScalarField, defaultVectorField;\n+252 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames\n+(vertexdata);\n+253\n+254 writer.beginPointData(defaultScalarField, defaultVectorField);\n+255 writeData(writer,vertexdata,cellBegin(),cellEnd\n+(),nvertices,IteratorSelector());\n+256 writer.endPointData();\n+257 }\n+258\n+260 template \n+261 void SubsamplingVTKWriter::writeGridPoints(VTK::VTUWriter&\n+writer)\n+262 {\n+263 writer.beginPoints();\n+264\n+265 std::shared_ptr p\n+266 (writer.makeArrayWriter(\"Coordinates\", 3, nvertices, this->coordPrecision\n+()));\n+267 if(!p->writeIsNoop())\n+268 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)\n+269 {\n+270 Refinement &refinement =\n+271 buildRefinement(i->type(),\n+272 subsampledGeometryType(i->type()));\n+273 for(SubVertexIterator sit = refinement.vBegin(intervals),\n+274 send = refinement.vEnd(intervals);\n+275 sit != send; ++sit)\n+276 {\n+277 FieldVector coords = i->geometry().global(sit.coords());\n+278 for (int j=0; jwrite(coords[j]);\n+280 for (int j=std::min(int(dimw),3); j<3; j++)\n+281 p->write(0.0);\n+282 }\n+283 }\n+284 // free the VTK::DataArrayWriter before touching the stream\n+285 p.reset();\n+286\n+287 writer.endPoints();\n+288 }\n+289\n+291 template \n+292 void SubsamplingVTKWriter::writeGridCells(VTK::VTUWriter& writer)\n+293 {\n+294 writer.beginCells();\n+295\n+296 // connectivity\n+297 {\n+298 std::shared_ptr p1\n+299 (writer.makeArrayWriter(\"connectivity\", 1, ncorners, VTK::Precision::\n+int32));\n+300 // The offset within the index numbering\n+301 if(!p1->writeIsNoop()) {\n+302 int offset = 0;\n+303 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)\n+304 {\n+305 GeometryType coercedToType = subsampledGeometryType(i->type());\n+306 Refinement &refinement =\n+307 buildRefinement(i->type(), coercedToType);\n+308 for(SubElementIterator sit = refinement.eBegin(intervals),\n+309 send = refinement.eEnd(intervals);\n+310 sit != send; ++sit)\n+311 {\n+312 IndexVector indices = sit.vertexIndices();\n+313 for(unsigned int ii = 0; ii < indices.size(); ++ii)\n+314 p1->write(offset+indices[VTK::renumber(coercedToType, ii)]);\n+315 }\n+316 offset += refinement.nVertices(intervals);\n+317 }\n+318 }\n+319 }\n+320\n+321 // offsets\n+322 {\n+323 std::shared_ptr p2\n+324 (writer.makeArrayWriter(\"offsets\", 1, ncells, VTK::Precision::int32));\n+325 if(!p2->writeIsNoop()) {\n+326 // The offset into the connectivity array\n+327 int offset = 0;\n+328 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)\n+329 {\n+330 Refinement &refinement =\n+331 buildRefinement(i->type(),\n+332 subsampledGeometryType(i->type()));\n+333 unsigned int verticesPerCell =\n+334 refinement.eBegin(intervals).vertexIndices().size();\n+335 for(int element = 0; element < refinement.nElements(intervals);\n+336 ++element)\n+337 {\n+338 offset += verticesPerCell;\n+339 p2->write(offset);\n+340 }\n+341 }\n+342 }\n+343 }\n+344\n+345 // types\n+346 if (dim>1)\n+347 {\n+348 std::shared_ptr p3\n+349 (writer.makeArrayWriter(\"types\", 1, ncells, VTK::Precision::uint8));\n+350 if(!p3->writeIsNoop())\n+351 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)\n+352 {\n+353 GeometryType coerceTo = subsampledGeometryType(it->type());\n+354 Refinement &refinement =\n+355 buildRefinement(it->type(), coerceTo);\n+356 int vtktype = VTK::geometryType(coerceTo);\n+357 for(int i = 0; i < refinement.nElements(intervals); ++i)\n+358 p3->write(vtktype);\n+359 }\n+360 }\n+361\n+362 writer.endCells();\n+363 }\n+364}\n+365\n+366#endif // DUNE_SUBSAMPLINGVTKWRITER_HH\n+vtkwriter.hh\n+Provides file i/o for the visualization toolkit.\n+vtuwriter.hh\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n+Dune::GridView::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/gridview.hh:137\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::GridParameterBlock\n-Common Grid parameters.\n-Definition gridparameter.hh:35\n-Dune::dgf::GridParameterBlock::foundDumpFileName\n-static const Flags foundDumpFileName\n-Definition gridparameter.hh:40\n-Dune::dgf::GridParameterBlock::dumpFileName\n-const std::string & dumpFileName() const\n-Definition gridparameter.hh:72\n-Dune::dgf::GridParameterBlock::foundName\n-static const Flags foundName\n-Definition gridparameter.hh:39\n-Dune::dgf::GridParameterBlock::GridParameterBlock\n-GridParameterBlock(std::istream &in)\n-constructor: read common parameters\n-Dune::dgf::GridParameterBlock::foundCompatible\n-static const Flags foundCompatible\n-Definition gridparameter.hh:42\n-Dune::dgf::GridParameterBlock::Flags\n-unsigned int Flags\n-Definition gridparameter.hh:37\n-Dune::dgf::GridParameterBlock::bisectionCompatibility_\n-bool bisectionCompatibility_\n-Definition gridparameter.hh:49\n-Dune::dgf::GridParameterBlock::dumpFileName_\n-std::string dumpFileName_\n-Definition gridparameter.hh:47\n-Dune::dgf::GridParameterBlock::ok\n-bool ok()\n-Definition gridparameter.hh:105\n-Dune::dgf::GridParameterBlock::foundFlags_\n-Flags foundFlags_\n-Definition gridparameter.hh:45\n-Dune::dgf::GridParameterBlock::name\n-const std::string & name(const std::string &defaultValue) const\n-return the name of the grid\n-Definition gridparameter.hh:60\n-Dune::dgf::GridParameterBlock::name_\n-std::string name_\n-Definition gridparameter.hh:46\n-Dune::dgf::GridParameterBlock::bisectionCompatibility\n-bool bisectionCompatibility() const\n-returns true if grid is compatible for bisection refinement\n-Definition gridparameter.hh:94\n-Dune::dgf::GridParameterBlock::markLongestEdge\n-bool markLongestEdge() const\n-returns true if longest edge should be marked for AlbertaGrid\n-Definition gridparameter.hh:83\n-Dune::dgf::GridParameterBlock::foundLongestEdge\n-static const Flags foundLongestEdge\n-Definition gridparameter.hh:41\n-Dune::dgf::GridParameterBlock::markLongestEdge_\n-bool markLongestEdge_\n-Definition gridparameter.hh:48\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::Precision::int32\n+@ int32\n+Dune::VTK::Precision::uint8\n+@ uint8\n+Dune::VTK::Precision::float32\n+@ float32\n+Dune::VTK::renumber\n+int renumber(const Dune::GeometryType &t, int i)\n+renumber VTK <-> Dune\n+Definition common.hh:186\n+Dune::VTK::geometryType\n+GeometryType geometryType(const Dune::GeometryType &t)\n+mapping from GeometryType to VTKGeometryType\n+Definition common.hh:151\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::GridView::Codim\n+A struct that collects all associated types of one implementation from the\n+Traits class.\n+Definition common/gridview.hh:104\n+Dune::VTK::FieldInfo::Type::tensor\n+@ tensor\n+tensor field (always 3x3)\n+Dune::VTK::FieldInfo::Type::vector\n+@ vector\n+vector-valued field (always 3D, will be padded if necessary)\n+Dune::VTK::FieldInfo::Type::scalar\n+@ scalar\n+Dune::SubsamplingVTKWriter\n+Writer for the output of subsampled grid functions in the vtk format.\n+Definition subsamplingvtkwriter.hh:40\n+Dune::SubsamplingVTKWriter::writeGridPoints\n+virtual void writeGridPoints(VTK::VTUWriter &writer)\n+write the positions of vertices\n+Definition subsamplingvtkwriter.hh:261\n+Dune::SubsamplingVTKWriter::writeVertexData\n+virtual void writeVertexData(VTK::VTUWriter &writer)\n+write vertex data\n+Definition subsamplingvtkwriter.hh:243\n+Dune::SubsamplingVTKWriter::SubsamplingVTKWriter\n+SubsamplingVTKWriter(const GridView &gridView, Dune::RefinementIntervals\n+intervals_, bool coerceToSimplex_=false, VTK::Precision coordPrecision=VTK::\n+Precision::float32)\n+Construct a SubsamplingVTKWriter working on a specific GridView.\n+Definition subsamplingvtkwriter.hh:80\n+Dune::SubsamplingVTKWriter::countEntities\n+virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)\n+count the vertices, cells and corners\n+Definition subsamplingvtkwriter.hh:207\n+Dune::SubsamplingVTKWriter::writeCellData\n+virtual void writeCellData(VTK::VTUWriter &writer)\n+write cell data\n+Definition subsamplingvtkwriter.hh:225\n+Dune::SubsamplingVTKWriter::writeGridCells\n+virtual void writeGridCells(VTK::VTUWriter &writer)\n+write the connectivity array\n+Definition subsamplingvtkwriter.hh:292\n+Dune::VTKWriter\n+Writer for the output of grid functions in the vtk format.\n+Definition vtkwriter.hh:95\n+Dune::VTKWriter::vertexBegin\n+VertexIterator vertexBegin() const\n+Definition vtkwriter.hh:508\n+Dune::VTKWriter::addVertexData\n+void addVertexData(const std::shared_ptr< const VTKFunction > &p)\n+Add a grid function that lives on the vertices of the grid to the\n+visualization.\n+Definition vtkwriter.hh:713\n+Dune::VTKWriter::cellEnd\n+CellIterator cellEnd() const\n+Definition vtkwriter.hh:402\n+Dune::VTKWriter::vertexdata\n+std::list< VTKLocalFunction > vertexdata\n+Definition vtkwriter.hh:1589\n+Dune::VTKWriter::addCellData\n+void addCellData(const std::shared_ptr< const VTKFunction > &p)\n+Add a grid function that lives on the cells of the grid to the visualization.\n+Definition vtkwriter.hh:649\n+Dune::VTKWriter::cellBegin\n+CellIterator cellBegin() const\n+Definition vtkwriter.hh:397\n+Dune::VTKWriter::outputtype\n+VTK::OutputType outputtype\n+Definition vtkwriter.hh:1613\n+Dune::VTKWriter::celldata\n+std::list< VTKLocalFunction > celldata\n+Definition vtkwriter.hh:1588\n+Dune::VTKWriter::coordPrecision\n+VTK::Precision coordPrecision() const\n+get the precision with which coordinates are written out\n+Definition vtkwriter.hh:782\n+Dune::VTKWriter::FunctionIterator\n+std::list< VTKLocalFunction >::const_iterator FunctionIterator\n+Definition vtkwriter.hh:376\n+Dune::VTKWriter::nvertices\n+int nvertices\n+Definition vtkwriter.hh:1596\n+Dune::VTKWriter::ncells\n+int ncells\n+Definition vtkwriter.hh:1595\n+Dune::VTKWriter::vertexEnd\n+VertexIterator vertexEnd() const\n+Definition vtkwriter.hh:515\n+Dune::VTKWriter::ncorners\n+int ncorners\n+Definition vtkwriter.hh:1597\n+Dune::VTKWriter::CellIterator\n+Iterator over the grids elements.\n+Definition vtkwriter.hh:385\n+Dune::VTK::VTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition vtuwriter.hh:98\n+Dune::VTK::VTUWriter::makeArrayWriter\n+DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n+unsigned nitems, Precision prec)\n+acquire a DataArrayWriter\n+Definition vtuwriter.hh:380\n+Dune::VTK::VTUWriter::endCellData\n+void endCellData()\n+finish CellData section\n+Definition vtuwriter.hh:220\n+Dune::VTK::VTUWriter::beginCells\n+void beginCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:274\n+Dune::VTK::VTUWriter::endPointData\n+void endPointData()\n+finish PointData section\n+Definition vtuwriter.hh:182\n+Dune::VTK::VTUWriter::beginCellData\n+void beginCellData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start CellData section\n+Definition vtuwriter.hh:205\n+Dune::VTK::VTUWriter::beginPointData\n+void beginPointData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start PointData section\n+Definition vtuwriter.hh:167\n+Dune::VTK::VTUWriter::endPoints\n+void endPoints()\n+finish section for the point coordinates\n+Definition vtuwriter.hh:249\n+Dune::VTK::VTUWriter::endCells\n+void endCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:285\n+Dune::VTK::VTUWriter::beginPoints\n+void beginPoints()\n+start section for the point coordinates\n+Definition vtuwriter.hh:238\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00833.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00833.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: general.cc File Reference\n+dune-grid: vtksequencewriterbase.hh File Reference\n \n \n \n \n \n \n \n@@ -65,32 +65,47 @@\n \n \n \n \n \n \n \n
    \n \n-
    general.cc File Reference
    \n+
    vtksequencewriterbase.hh File Reference
    \n
    \n
    \n-\n+
    #include <vector>
    \n+#include <iostream>
    \n+#include <sstream>
    \n+#include <fstream>
    \n+#include <iomanip>
    \n+#include <memory>
    \n+#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <dune/common/path.hh>
    \n+#include <dune/grid/io/file/vtk/vtkwriter.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::VTKSequenceWriterBase< GridView >
     Base class to write pvd-files which contains a list of all collected vtk-files. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,20 +2,31 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Namespaces\n-general.cc File Reference\n-#include \n+ * vtk\n+Classes | Namespaces\n+vtksequencewriterbase.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::VTKSequenceWriterBase<_GridView_>\n+\u00a0 Base class to write pvd-files which contains a list of all collected\n+ vtk-files. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00836.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00836.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarydom.hh File Reference\n+dune-grid: gmshwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,48 +65,48 @@\n \n \n \n \n \n \n \n
    \n \n-
    boundarydom.hh File Reference
    \n+
    gmshwriter.hh File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n+
    #include <fstream>
    \n+#include <iostream>
    \n+#include <iomanip>
    \n #include <string>
    \n #include <vector>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n-#include <dune/grid/io/file/dgfparser/parser.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/common/grid.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::dgf::DomainData
     
    struct  Dune::dgf::Domain
     
    class  Dune::dgf::BoundaryDomBlock
    class  Dune::GmshWriter< GridView >
     Write Gmsh mesh file. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,32 +2,30 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n Classes | Namespaces\n-boundarydom.hh File Reference\n+gmshwriter.hh File Reference\n+#include \n #include \n+#include \n #include \n #include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::dgf::DomainData\n-\u00a0\n-struct \u00a0 Dune::dgf::Domain\n-\u00a0\n- class \u00a0 Dune::dgf::BoundaryDomBlock\n+class \u00a0 Dune::GmshWriter<_GridView_>\n+\u00a0 Write Gmsh mesh file. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00836_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00836_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarydom.hh Source File\n+dune-grid: gmshwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,419 +70,240 @@\n
    \n \n \n \n \n \n \n
    \n-
    boundarydom.hh
    \n+
    gmshwriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_BOUNDARYDOMBLOCK_HH
    \n-
    6#define DUNE_DGF_BOUNDARYDOMBLOCK_HH
    \n+
    5#ifndef DUNE_GRID_IO_FILE_GMSHWRITER_HH
    \n+
    6#define DUNE_GRID_IO_FILE_GMSHWRITER_HH
    \n
    7
    \n-
    8#include <iostream>
    \n-
    9#include <string>
    \n-
    10#include <vector>
    \n-
    11
    \n-\n-\n-
    14
    \n-
    15
    \n-
    16namespace Dune
    \n-
    17{
    \n-
    18
    \n-
    19 namespace dgf
    \n-
    20 {
    \n+
    8#include <fstream>
    \n+
    9#include <iostream>
    \n+
    10#include <iomanip>
    \n+
    11#include <string>
    \n+
    12#include <vector>
    \n+
    13
    \n+
    14#include <dune/common/exceptions.hh>
    \n+
    15#include <dune/geometry/type.hh>
    \n+
    16#include <dune/geometry/referenceelements.hh>
    \n+\n+\n+
    19
    \n+
    20namespace Dune {
    \n
    21
    \n-
    \n-\n-
    23 {
    \n-\n-
    25
    \n-
    \n-\n-
    27 : id_( 0 ),
    \n-
    28 parameter_( DGFBoundaryParameter::defaultValue() ),
    \n-
    29 defaultData_( false )
    \n-
    30 { }
    \n-
    \n-
    31
    \n-\n-
    33
    \n-
    34 // constructor
    \n-
    \n-
    35 DomainData ( int id, BoundaryParameter parameter, bool defaultData = false )
    \n-
    36 : id_( id ),
    \n-
    37 parameter_( parameter ),
    \n-
    38 defaultData_( defaultData )
    \n-
    39 { }
    \n-
    \n-
    40
    \n-
    41 // return id
    \n-
    \n-
    42 int id () const
    \n-
    43 {
    \n-
    44 return id_;
    \n-
    45 }
    \n-
    \n-
    46
    \n-
    47 // return true, if additional parameters given
    \n-
    \n-
    48 bool hasParameter () const
    \n-
    49 {
    \n-
    50 return (!parameter_.empty());
    \n-
    51 }
    \n-
    \n-
    52
    \n-
    53 // return additional parameters
    \n-
    \n-\n-
    55 {
    \n-
    56 return parameter_;
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    59 // reset data
    \n-
    \n-
    60 void reset ( int id, BoundaryParameter parameter, bool defaultData = false )
    \n-
    61 {
    \n-
    62 id_ = id;
    \n-
    63 parameter_ = parameter;
    \n-
    64 defaultData_ = defaultData;
    \n-
    65 }
    \n-
    \n-
    66
    \n-
    67 // returns true if data origins from default boundary domain
    \n-
    \n-
    68 bool isDefault () const
    \n-
    69 {
    \n-
    70 return defaultData_;
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    \n-
    73 friend std::ostream & operator<< ( std :: ostream & os, const DomainData & ddata )
    \n-
    74 {
    \n-
    75 os << "domain data: id = " << ddata.id();
    \n-
    76 if( ddata.hasParameter() )
    \n-
    77 os << ", parameter = " << ddata.parameter();
    \n-
    78 return os;
    \n-
    79 }
    \n-
    \n-
    80
    \n-
    81 private:
    \n-
    82 int id_;
    \n-
    83 BoundaryParameter parameter_;
    \n-
    84 bool defaultData_;
    \n-
    85
    \n-
    86 }; // end struct DomainData
    \n-
    \n-
    87
    \n-
    88
    \n-
    \n-
    89 struct Domain
    \n-
    90 {
    \n-
    91 // dimension of world coordinates
    \n-
    92 const int dimensionworld;
    \n-
    93
    \n-\n-
    95
    \n-
    96 // constructor
    \n-
    \n-
    97 Domain( std::vector< double > p1, std::vector< double > p2, int id, BoundaryParameter & parameter )
    \n-
    98 : dimensionworld( p1.size() ),
    \n-
    99 left_( p1 ),
    \n-
    100 right_( p2 ),
    \n-
    101 data_( id, parameter )
    \n-
    102 {
    \n-
    103 if( int( p2.size() ) != dimensionworld )
    \n-
    104 {
    \n-
    105 DUNE_THROW(DGFException,
    \n-
    106 "ERROR in " << *this << "!");
    \n-
    107 }
    \n-
    108 }
    \n-
    \n-
    109
    \n-
    110 // constructor
    \n-
    \n-
    111 Domain( std::vector< double > p1, std::vector< double > p2, DomainData & data )
    \n-
    112 : dimensionworld( p1.size() ),
    \n-
    113 left_( p1 ),
    \n-
    114 right_( p2 ),
    \n-
    115 data_( data )
    \n-
    116 {
    \n-
    117 if( int( p2.size() ) != dimensionworld )
    \n-
    118 {
    \n-
    119 DUNE_THROW(DGFException,
    \n-
    120 "ERROR in " << *this << "!");
    \n-
    121 }
    \n-
    122 }
    \n-
    \n-
    123
    \n-
    124 // copy constructor
    \n-
    \n-
    125 Domain ( const Domain & other )
    \n-\n-
    127 left_( other.left_ ),
    \n-
    128 right_( other.right_ ),
    \n-
    129 data_( other.data_ )
    \n-
    130 {
    \n-
    131 if( dimensionworld != other.dimensionworld )
    \n-
    132 {
    \n-
    133 DUNE_THROW(DGFException,
    \n-
    134 "ERROR in " << *this << "!");
    \n-
    135 }
    \n-
    136 }
    \n-
    \n-
    137
    \n-
    138 // assignment
    \n-
    \n-
    139 Domain & operator = ( const Domain & other )
    \n-
    140 {
    \n-
    141 if( dimensionworld != other.dimensionworld )
    \n-
    142 {
    \n-
    143 DUNE_THROW(DGFException,
    \n-
    144 "ERROR in " << *this << "!");
    \n-
    145 }
    \n-
    146
    \n-
    147 left_ = other.left_;
    \n-
    148 right_= other.right_;
    \n-
    149 data_= other.data_;
    \n-
    150 return *this;
    \n-
    151 }
    \n-
    \n+
    35 template <class GridView>
    \n+
    \n+\n+
    37 {
    \n+
    38 private:
    \n+
    39 const GridView gv;
    \n+
    40 int precision;
    \n+
    41
    \n+
    42 static const unsigned int dim = GridView::dimension;
    \n+
    43 static const unsigned int dimWorld = GridView::dimensionworld;
    \n+
    44 static_assert( (dimWorld <= 3), "GmshWriter requires dimWorld <= 3." );
    \n+
    45
    \n+
    47 template<typename Entity>
    \n+
    48 std::size_t nodeIndexFromEntity(const Entity& entity, int i) const {
    \n+
    49 return gv.indexSet().subIndex(entity, i, dim)+1;
    \n+
    50 }
    \n+
    51
    \n+
    55 static std::size_t translateDuneToGmshType(const GeometryType& type) {
    \n+
    56 std::size_t element_type;
    \n+
    57
    \n+
    58 if (type.isLine())
    \n+
    59 element_type = 1;
    \n+
    60 else if (type.isTriangle())
    \n+
    61 element_type = 2;
    \n+
    62 else if (type.isQuadrilateral())
    \n+
    63 element_type = 3;
    \n+
    64 else if (type.isTetrahedron())
    \n+
    65 element_type = 4;
    \n+
    66 else if (type.isHexahedron())
    \n+
    67 element_type = 5;
    \n+
    68 else if (type.isPrism())
    \n+
    69 element_type = 6;
    \n+
    70 else if (type.isPyramid())
    \n+
    71 element_type = 7;
    \n+
    72 else if (type.isVertex())
    \n+
    73 element_type = 15;
    \n+
    74 else
    \n+
    75 DUNE_THROW(Dune::IOError, "GeometryType " << type << " is not supported by gmsh.");
    \n+
    76
    \n+
    77 return element_type;
    \n+
    78 }
    \n+
    79
    \n+
    94 void outputElements(std::ofstream& file, const std::vector<int>& physicalEntities, const std::vector<int>& physicalBoundaries) const {
    \n+\n+
    96 std::size_t counter(1);
    \n+
    97 for (const auto& entity : elements(gv)) {
    \n+
    98 // Check whether the type is compatible. If not, close file and rethrow exception.
    \n+
    99 try {
    \n+
    100 std::size_t element_type = translateDuneToGmshType(entity.type());
    \n+
    101
    \n+
    102 file << counter << " " << element_type;
    \n+
    103 // If present, set the first tag to the physical entity
    \n+
    104 if (!physicalEntities.empty())
    \n+
    105 file << " " << 1 << " " << physicalEntities[elementMapper.index(entity)];
    \n+
    106 else
    \n+
    107 file << " " << 0; // "0" for "I do not use any tags."
    \n+
    108
    \n+
    109 // Output list of nodes.
    \n+
    110 // 3, 5 and 7 got different vertex numbering compared to Dune
    \n+
    111 if (3 == element_type)
    \n+
    112 file << " "
    \n+
    113 << nodeIndexFromEntity(entity, 0) << " " << nodeIndexFromEntity(entity, 1) << " "
    \n+
    114 << nodeIndexFromEntity(entity, 3) << " " << nodeIndexFromEntity(entity, 2);
    \n+
    115 else if (5 == element_type)
    \n+
    116 file << " "
    \n+
    117 << nodeIndexFromEntity(entity, 0) << " " << nodeIndexFromEntity(entity, 1) << " "
    \n+
    118 << nodeIndexFromEntity(entity, 3) << " " << nodeIndexFromEntity(entity, 2) << " "
    \n+
    119 << nodeIndexFromEntity(entity, 4) << " " << nodeIndexFromEntity(entity, 5) << " "
    \n+
    120 << nodeIndexFromEntity(entity, 7) << " " << nodeIndexFromEntity(entity, 6);
    \n+
    121 else if (7 == element_type)
    \n+
    122 file << " "
    \n+
    123 << nodeIndexFromEntity(entity, 0) << " " << nodeIndexFromEntity(entity, 1) << " "
    \n+
    124 << nodeIndexFromEntity(entity, 3) << " " << nodeIndexFromEntity(entity, 2) << " "
    \n+
    125 << nodeIndexFromEntity(entity, 4);
    \n+
    126 else {
    \n+
    127 for (int k = 0; k < entity.geometry().corners(); ++k)
    \n+
    128 file << " " << nodeIndexFromEntity(entity, k);
    \n+
    129 }
    \n+
    130 ++counter;
    \n+
    131
    \n+
    132 file << std::endl;
    \n+
    133
    \n+
    134 // Write boundaries
    \n+
    135 if (!physicalBoundaries.empty()) {
    \n+
    136 auto refElement = referenceElement<typename GridView::ctype,dim>(entity.type());
    \n+
    137 for(const auto& intersection : intersections(gv, entity)) {
    \n+
    138 if(intersection.boundary()) {
    \n+
    139 const auto faceLocalIndex(intersection.indexInInside());
    \n+
    140 file << counter << " " << translateDuneToGmshType(intersection.type())
    \n+
    141 << " " << 1 << " " << physicalBoundaries[intersection.boundarySegmentIndex()];
    \n+
    142 for (int k = 0; k < intersection.geometry().corners(); ++k)
    \n+
    143 {
    \n+
    144 const auto vtxLocalIndex(refElement.subEntity(faceLocalIndex, 1, k, dim));
    \n+
    145 file << " " << nodeIndexFromEntity(entity, vtxLocalIndex);
    \n+
    146 }
    \n+
    147 ++counter;
    \n+
    148 file << std::endl;
    \n+
    149 }
    \n+
    150 }
    \n+
    151 }
    \n
    152
    \n-
    153 // return true if point is contained in boundary domain
    \n-
    154 template< class Vector >
    \n-
    \n-
    155 bool contains ( const Vector & x ) const
    \n-
    156 {
    \n-
    157 bool ret = true;
    \n-
    158 for( int i = 0; i < dimensionworld; ++i )
    \n-
    159 {
    \n-
    160 if( x[ i ] < left_[ i ] || x[ i ] > right_[ i ] )
    \n-
    161 ret = false;
    \n-
    162 }
    \n-
    163 return ret;
    \n-
    164 }
    \n-
    \n-
    165
    \n-
    \n-
    166 const DomainData & data () const
    \n-
    167 {
    \n-
    168 return data_;
    \n-
    169 }
    \n-
    \n-
    170
    \n-
    171 // for error messages
    \n-
    \n-
    172 friend std::ostream & operator<< ( std :: ostream &os, const Domain & domain )
    \n-
    173 {
    \n-
    174 os << "domain: " << std::endl;
    \n-
    175 os << "left = ";
    \n-
    176 for( int i = 0; i < domain.dimensionworld; ++i )
    \n-
    177 os << domain.left_[ i ] << " ";
    \n-
    178 os << std::endl;
    \n-
    179 os << "right = ";
    \n-
    180 for( int i = 0; i < domain.dimensionworld; ++i )
    \n-
    181 os << domain.right_[ i ] << " ";
    \n-
    182 os << std::endl;
    \n-
    183 os << domain.data();
    \n-
    184 return os;
    \n-
    185 }
    \n-
    \n-
    186
    \n-
    187 private:
    \n-
    188 std::vector< double > left_, right_;
    \n-
    189 DomainData data_;
    \n-
    190
    \n-
    191 };
    \n-
    \n-
    192
    \n-
    \n-\n-
    194 : public BasicBlock
    \n-
    195 {
    \n-
    196 typedef DGFBoundaryParameter::type BoundaryParameter;
    \n-
    197
    \n-
    198 // the dimension of the vertices (is given from user)
    \n-
    199 int dimworld_;
    \n-
    200
    \n-
    201 // internal counter
    \n-
    202 int counter_;
    \n-
    203
    \n-
    204 // default values if given
    \n-
    205 DomainData * default_;
    \n-
    206
    \n-
    207 // storage for all domains;
    \n-
    208 int ndomains_;
    \n-
    209 std::vector< Domain > domains_;
    \n-
    210
    \n-
    211 public:
    \n-
    212 // initialize vertex block and get first vertex
    \n-
    213 BoundaryDomBlock ( std::istream & in, int cdimworld );
    \n-
    214
    \n-
    215 // destructor
    \n-
    \n-\n-
    217 {
    \n-
    218 if( default_ )
    \n-
    219 delete default_;
    \n-
    220 }
    \n-
    \n-
    221
    \n-
    222 // go to next domain in block
    \n-
    \n-
    223 bool next ()
    \n-
    224 {
    \n-
    225 counter_++;
    \n-
    226 return ( counter_ < ndomains_ );
    \n-
    227 }
    \n-
    \n+
    153 } catch(Exception& e) {
    \n+
    154 file.close();
    \n+
    155 throw;
    \n+
    156 }
    \n+
    157 }
    \n+
    158 }
    \n+
    159
    \n+
    160
    \n+
    167 void outputNodes(std::ofstream& file) const {
    \n+
    168 for (const auto& vertex : vertices(gv)) {
    \n+
    169 const auto globalCoord = vertex.geometry().center();
    \n+
    170 const auto nodeIndex = gv.indexSet().index(vertex)+1; // Start counting indices by "1".
    \n+
    171
    \n+
    172 if (1 == dimWorld)
    \n+
    173 file << nodeIndex << " " << globalCoord[0] << " " << 0 << " " << 0 << std::endl;
    \n+
    174 else if (2 == dimWorld)
    \n+
    175 file << nodeIndex << " " << globalCoord[0] << " " << globalCoord[1] << " " << 0 << std::endl;
    \n+
    176 else // (3 == dimWorld)
    \n+
    177 file << nodeIndex << " " << globalCoord[0] << " " << globalCoord[1] << " " << globalCoord[2] << std::endl;
    \n+
    178 }
    \n+
    179 }
    \n+
    180
    \n+
    181 public:
    \n+
    187 GmshWriter(const GridView& gridView, int numDigits=6) : gv(gridView), precision(numDigits) {}
    \n+
    188
    \n+
    \n+
    193 void setPrecision(int numDigits) {
    \n+
    194 precision = numDigits;
    \n+
    195 }
    \n+
    \n+
    196
    \n+
    \n+
    218 void write(const std::string& fileName,
    \n+
    219 const std::vector<int>& physicalEntities=std::vector<int>(),
    \n+
    220 const std::vector<int>& physicalBoundaries=std::vector<int>()) const {
    \n+
    221 // Open file
    \n+
    222 std::ofstream file(fileName.c_str());
    \n+
    223 if (!file.is_open())
    \n+
    224 DUNE_THROW(Dune::IOError, "Could not open " << fileName << " with write access.");
    \n+
    225
    \n+
    226 // Set precision
    \n+
    227 file << std::setprecision( precision );
    \n
    228
    \n-
    229 // return domain
    \n-
    \n-
    230 const Domain & domain () const
    \n-
    231 {
    \n-
    232 return domains_.at( counter_ );
    \n-
    233 }
    \n-
    \n-
    234
    \n-
    235 // return true if default is given
    \n-
    \n-
    236 bool hasDefaultData () const
    \n-
    237 {
    \n-
    238 return bool( default_ );
    \n-
    239 }
    \n-
    \n-
    240
    \n-
    241 // return default data
    \n-
    \n-
    242 const DomainData * defaultData () const
    \n-
    243 {
    \n-
    244 return default_;
    \n-
    245 }
    \n-
    \n-
    246
    \n-
    247 // return true if any boundary domain block has
    \n-
    248 // additional parameters
    \n-
    249 bool hasParameter () const;
    \n-
    250
    \n-
    \n-
    251 void reset ()
    \n-
    252 {
    \n-\n-
    254 counter_ = -1;
    \n-
    255 }
    \n-
    \n-
    256
    \n-
    257 // return true while block is active
    \n-
    \n-
    258 bool ok ()
    \n-
    259 {
    \n-
    260 return ( counter_ <= ndomains_ );
    \n-
    261 }
    \n-
    \n-
    262
    \n-
    263 // return data if all vectors in array are contained within
    \n-
    264 // a single domain
    \n-
    265 template< class Vector >
    \n-
    \n-
    266 const DomainData * contains ( const std::vector< Vector > & v ) const
    \n-
    267 {
    \n-
    268 std::vector< int > index( ndomains_ );
    \n-
    269 for( int i = 0; i < ndomains_; ++i)
    \n-
    270 index[ i ] = i;
    \n-
    271
    \n-
    272 size_t N = v.size();
    \n-
    273 for( size_t i = 0; i < N; ++i )
    \n-
    274 {
    \n-
    275 if( index.empty() )
    \n-
    276 break;
    \n-
    277
    \n-
    278 const int n = index.size();
    \n-
    279 assert( n > 0 );
    \n-
    280 for( int j = n-1; j >= 0; --j )
    \n-
    281 {
    \n-
    282 bool inside = domains_[ index[ j ] ].contains( v[ i ] );
    \n-
    283 if( !inside )
    \n-
    284 index.erase( index.begin() + j );
    \n-
    285 }
    \n-
    286 }
    \n-
    287
    \n-
    288 // check whether no boundary domain found
    \n-
    289 if( index.empty() )
    \n-
    290 return default_;
    \n-
    291
    \n-
    292 // check for ambiguity
    \n-
    293 if( index.size() > 1 )
    \n-
    294 dwarn << "WARNING: ambiguous boundary domain assignment, use first boundary domain in list" << std::endl;
    \n-
    295
    \n-
    296 return &domains_[ index[ 0 ] ].data();
    \n-
    297 }
    \n-
    \n-
    298
    \n-
    299 private:
    \n-
    300 void readBlock ();
    \n-
    301 };
    \n-
    \n-
    302
    \n-
    303 } // end namespace dgf
    \n-
    304
    \n-
    305} // end namespace Dune
    \n-
    306
    \n-
    307#endif
    \n-\n-\n+
    229 // Output Header
    \n+
    230 file << "$MeshFormat" << std::endl
    \n+
    231 << "2.0 0 " << sizeof(double) << std::endl // "2.0" for "version 2.0", "0" for ASCII
    \n+
    232 << "$EndMeshFormat" << std::endl;
    \n+
    233
    \n+
    234 // Output Nodes
    \n+
    235 file << "$Nodes" << std::endl
    \n+
    236 << gv.size(dim) << std::endl;
    \n+
    237
    \n+
    238 outputNodes(file);
    \n+
    239
    \n+
    240 file << "$EndNodes" << std::endl;
    \n+
    241
    \n+
    242 // Output Elements;
    \n+
    243 int boundariesSize(0);
    \n+
    244 if(!physicalBoundaries.empty())
    \n+
    245 for(const auto& entity : elements(gv))
    \n+
    246 for(const auto& intersection : intersections(gv, entity))
    \n+
    247 if(intersection.boundary())
    \n+
    248 ++boundariesSize;
    \n+
    249
    \n+
    250 file << "$Elements" << std::endl
    \n+
    251 << gv.size(0) + boundariesSize<< std::endl;
    \n+
    252
    \n+
    253 outputElements(file, physicalEntities, physicalBoundaries);
    \n+
    254
    \n+
    255 file << "$EndElements" << std::endl;
    \n+
    256 }
    \n+
    \n+
    257
    \n+
    258 };
    \n+
    \n+
    259
    \n+
    260} // namespace Dune
    \n+
    261
    \n+
    262#endif // DUNE_GRID_IO_FILE_GMSHWRITER_HH
    \n+
    Mapper for multiple codim and multiple geometry types.
    \n+
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n+
    int size(int codim) const
    obtain number of entities in a given codimension
    Definition common/gridview.hh:183
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n+
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    void reset()
    Definition basic.hh:51
    \n-
    Definition boundarydom.hh:23
    \n-
    void reset(int id, BoundaryParameter parameter, bool defaultData=false)
    Definition boundarydom.hh:60
    \n-
    ~DomainData()
    Definition boundarydom.hh:32
    \n-
    DGFBoundaryParameter::type BoundaryParameter
    Definition boundarydom.hh:24
    \n-
    DomainData()
    Definition boundarydom.hh:26
    \n-
    int id() const
    Definition boundarydom.hh:42
    \n-
    const BoundaryParameter & parameter() const
    Definition boundarydom.hh:54
    \n-
    friend std::ostream & operator<<(std ::ostream &os, const DomainData &ddata)
    Definition boundarydom.hh:73
    \n-
    bool hasParameter() const
    Definition boundarydom.hh:48
    \n-
    DomainData(int id, BoundaryParameter parameter, bool defaultData=false)
    Definition boundarydom.hh:35
    \n-
    bool isDefault() const
    Definition boundarydom.hh:68
    \n-
    Definition boundarydom.hh:90
    \n-
    Domain(std::vector< double > p1, std::vector< double > p2, int id, BoundaryParameter &parameter)
    Definition boundarydom.hh:97
    \n-
    Domain(const Domain &other)
    Definition boundarydom.hh:125
    \n-
    const int dimensionworld
    Definition boundarydom.hh:92
    \n-
    bool contains(const Vector &x) const
    Definition boundarydom.hh:155
    \n-
    DGFBoundaryParameter::type BoundaryParameter
    Definition boundarydom.hh:94
    \n-
    friend std::ostream & operator<<(std ::ostream &os, const Domain &domain)
    Definition boundarydom.hh:172
    \n-
    Domain & operator=(const Domain &other)
    Definition boundarydom.hh:139
    \n-
    const DomainData & data() const
    Definition boundarydom.hh:166
    \n-
    Domain(std::vector< double > p1, std::vector< double > p2, DomainData &data)
    Definition boundarydom.hh:111
    \n-
    Definition boundarydom.hh:195
    \n-
    ~BoundaryDomBlock()
    Definition boundarydom.hh:216
    \n-
    bool hasParameter() const
    Definition boundarydom.cc:137
    \n-
    const Domain & domain() const
    Definition boundarydom.hh:230
    \n-
    const DomainData * contains(const std::vector< Vector > &v) const
    Definition boundarydom.hh:266
    \n-
    bool next()
    Definition boundarydom.hh:223
    \n-
    void reset()
    Definition boundarydom.hh:251
    \n-
    bool ok()
    Definition boundarydom.hh:258
    \n-
    bool hasDefaultData() const
    Definition boundarydom.hh:236
    \n-
    const DomainData * defaultData() const
    Definition boundarydom.hh:242
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n-
    Contains types for additional features.
    Definition parser.hh:23
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Geometry geometry() const
    obtain geometric realization of the entity
    Definition common/entity.hh:141
    \n+
    GeometryType type() const
    Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
    Definition common/entity.hh:146
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n+
    Index index(const EntityType &e) const
    Map entity to starting index in array for dof block.
    Definition mcmgmapper.hh:171
    \n+
    Write Gmsh mesh file.
    Definition gmshwriter.hh:37
    \n+
    GmshWriter(const GridView &gridView, int numDigits=6)
    Constructor expecting GridView of Grid to be written.
    Definition gmshwriter.hh:187
    \n+
    void setPrecision(int numDigits)
    Set the number of digits to be used when writing the vertices. By default is 6.
    Definition gmshwriter.hh:193
    \n+
    void write(const std::string &fileName, const std::vector< int > &physicalEntities=std::vector< int >(), const std::vector< int > &physicalBoundaries=std::vector< int >()) const
    Write given grid in Gmsh 2.0 compatible ASCII file.
    Definition gmshwriter.hh:218
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,437 +2,292 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-boundarydom.hh\n+gmshwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_BOUNDARYDOMBLOCK_HH\n-6#define DUNE_DGF_BOUNDARYDOMBLOCK_HH\n+5#ifndef DUNE_GRID_IO_FILE_GMSHWRITER_HH\n+6#define DUNE_GRID_IO_FILE_GMSHWRITER_HH\n 7\n-8#include \n-9#include \n-10#include \n-11\n-12#include \n-13#include \n-14\n-15\n-16namespace Dune\n-17{\n-18\n-19 namespace dgf\n-20 {\n+8#include \n+9#include \n+10#include \n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16#include \n+17#include \n+18#include \n+19\n+20namespace Dune {\n 21\n-22 struct DomainData\n-23 {\n-24 typedef DGFBoundaryParameter::type BoundaryParameter;\n-25\n-26 DomainData ()\n-27 : id_( 0 ),\n-28 parameter_( DGFBoundaryParameter::defaultValue() ),\n-29 defaultData_( false )\n-30 { }\n-31\n-32 ~DomainData () { }\n-33\n-34 // constructor\n-35 DomainData ( int id, BoundaryParameter parameter, bool defaultData = false )\n-36 : id_( id ),\n-37 parameter_( parameter ),\n-38 defaultData_( defaultData )\n-39 { }\n-40\n-41 // return id\n-42 int id () const\n-43 {\n-44 return id_;\n-45 }\n-46\n-47 // return true, if additional parameters given\n-48 bool hasParameter () const\n-49 {\n-50 return (!parameter_.empty());\n-51 }\n-52\n-53 // return additional parameters\n-54 const BoundaryParameter & parameter () const\n-55 {\n-56 return parameter_;\n-57 }\n-58\n-59 // reset data\n-60 void reset ( int id, BoundaryParameter parameter, bool defaultData = false )\n-61 {\n-62 id_ = id;\n-63 parameter_ = parameter;\n-64 defaultData_ = defaultData;\n-65 }\n-66\n-67 // returns true if data origins from default boundary domain\n-68 bool isDefault () const\n-69 {\n-70 return defaultData_;\n-71 }\n-72\n-73 friend std::ostream & operator<<_( std :: ostream & os, const DomainData &\n-ddata )\n-74 {\n-75 os << \"domain data: id = \" << ddata.id();\n-76 if( ddata.hasParameter() )\n-77 os << \", parameter = \" << ddata.parameter();\n-78 return os;\n-79 }\n-80\n-81 private:\n-82 int id_;\n-83 BoundaryParameter parameter_;\n-84 bool defaultData_;\n-85\n-86 }; // end struct DomainData\n-87\n-88\n-89 struct Domain\n-90 {\n-91 // dimension of world coordinates\n-92 const int dimensionworld;\n-93\n-94 typedef DGFBoundaryParameter::type BoundaryParameter;\n-95\n-96 // constructor\n-97 Domain( std::vector< double > p1, std::vector< double > p2, int id,\n-BoundaryParameter & parameter )\n-98 : dimensionworld( p1.size() ),\n-99 left_( p1 ),\n-100 right_( p2 ),\n-101 data_( id, parameter )\n-102 {\n-103 if( int( p2.size() ) != dimensionworld )\n-104 {\n-105 DUNE_THROW(DGFException,\n-106 \"ERROR in \" << *this << \"!\");\n-107 }\n-108 }\n-109\n-110 // constructor\n-111 Domain( std::vector< double > p1, std::vector< double > p2, DomainData &\n-data )\n-112 : dimensionworld( p1.size() ),\n-113 left_( p1 ),\n-114 right_( p2 ),\n-115 data_( data )\n-116 {\n-117 if( int( p2.size() ) != dimensionworld )\n-118 {\n-119 DUNE_THROW(DGFException,\n-120 \"ERROR in \" << *this << \"!\");\n-121 }\n-122 }\n-123\n-124 // copy constructor\n-125 Domain ( const Domain & other )\n-126 : dimensionworld( other.dimensionworld ),\n-127 left_( other.left_ ),\n-128 right_( other.right_ ),\n-129 data_( other.data_ )\n-130 {\n-131 if( dimensionworld != other.dimensionworld )\n-132 {\n-133 DUNE_THROW(DGFException,\n-134 \"ERROR in \" << *this << \"!\");\n-135 }\n-136 }\n-137\n-138 // assignment\n-139 Domain & operator_=_( const Domain & other )\n-140 {\n-141 if( dimensionworld != other.dimensionworld )\n-142 {\n-143 DUNE_THROW(DGFException,\n-144 \"ERROR in \" << *this << \"!\");\n-145 }\n-146\n-147 left_ = other.left_;\n-148 right_= other.right_;\n-149 data_= other.data_;\n-150 return *this;\n+35 template \n+36 class GmshWriter\n+37 {\n+38 private:\n+39 const GridView gv;\n+40 int precision;\n+41\n+42 static const unsigned int dim = GridView::dimension;\n+43 static const unsigned int dimWorld = GridView::dimensionworld;\n+44 static_assert( (dimWorld <= 3), \"GmshWriter requires dimWorld <= 3.\" );\n+45\n+47 template\n+48 std::size_t nodeIndexFromEntity(const Entity& entity, int i) const {\n+49 return gv.indexSet().subIndex(entity, i, dim)+1;\n+50 }\n+51\n+55 static std::size_t translateDuneToGmshType(const GeometryType& type) {\n+56 std::size_t element_type;\n+57\n+58 if (type.isLine())\n+59 element_type = 1;\n+60 else if (type.isTriangle())\n+61 element_type = 2;\n+62 else if (type.isQuadrilateral())\n+63 element_type = 3;\n+64 else if (type.isTetrahedron())\n+65 element_type = 4;\n+66 else if (type.isHexahedron())\n+67 element_type = 5;\n+68 else if (type.isPrism())\n+69 element_type = 6;\n+70 else if (type.isPyramid())\n+71 element_type = 7;\n+72 else if (type.isVertex())\n+73 element_type = 15;\n+74 else\n+75 DUNE_THROW(Dune::IOError, \"GeometryType \" << type << \" is not supported by\n+gmsh.\");\n+76\n+77 return element_type;\n+78 }\n+79\n+94 void outputElements(std::ofstream& file, const std::vector&\n+physicalEntities, const std::vector& physicalBoundaries) const {\n+95 MultipleCodimMultipleGeomTypeMapper elementMapper(gv,\n+mcmgElementLayout());\n+96 std::size_t counter(1);\n+97 for (const auto& entity : elements(gv)) {\n+98 // Check whether the type is compatible. If not, close file and rethrow\n+exception.\n+99 try {\n+100 std::size_t element_type = translateDuneToGmshType(entity.type());\n+101\n+102 file << counter << \" \" << element_type;\n+103 // If present, set the first tag to the physical entity\n+104 if (!physicalEntities.empty())\n+105 file << \" \" << 1 << \" \" << physicalEntities[elementMapper.index(entity)];\n+106 else\n+107 file << \" \" << 0; // \"0\" for \"I do not use any tags.\"\n+108\n+109 // Output list of nodes.\n+110 // 3, 5 and 7 got different vertex numbering compared to Dune\n+111 if (3 == element_type)\n+112 file << \" \"\n+113 << nodeIndexFromEntity(entity, 0) << \" \" << nodeIndexFromEntity(entity, 1)\n+<< \" \"\n+114 << nodeIndexFromEntity(entity, 3) << \" \" << nodeIndexFromEntity(entity, 2);\n+115 else if (5 == element_type)\n+116 file << \" \"\n+117 << nodeIndexFromEntity(entity, 0) << \" \" << nodeIndexFromEntity(entity, 1)\n+<< \" \"\n+118 << nodeIndexFromEntity(entity, 3) << \" \" << nodeIndexFromEntity(entity, 2)\n+<< \" \"\n+119 << nodeIndexFromEntity(entity, 4) << \" \" << nodeIndexFromEntity(entity, 5)\n+<< \" \"\n+120 << nodeIndexFromEntity(entity, 7) << \" \" << nodeIndexFromEntity(entity, 6);\n+121 else if (7 == element_type)\n+122 file << \" \"\n+123 << nodeIndexFromEntity(entity, 0) << \" \" << nodeIndexFromEntity(entity, 1)\n+<< \" \"\n+124 << nodeIndexFromEntity(entity, 3) << \" \" << nodeIndexFromEntity(entity, 2)\n+<< \" \"\n+125 << nodeIndexFromEntity(entity, 4);\n+126 else {\n+127 for (int k = 0; k < entity.geometry().corners(); ++k)\n+128 file << \" \" << nodeIndexFromEntity(entity, k);\n+129 }\n+130 ++counter;\n+131\n+132 file << std::endl;\n+133\n+134 // Write boundaries\n+135 if (!physicalBoundaries.empty()) {\n+136 auto refElement = referenceElement\n+(entity.type());\n+137 for(const auto& intersection : intersections(gv, entity)) {\n+138 if(intersection.boundary()) {\n+139 const auto faceLocalIndex(intersection.indexInInside());\n+140 file << counter << \" \" << translateDuneToGmshType(intersection.type())\n+141 << \" \" << 1 << \" \" << physicalBoundaries[intersection.boundarySegmentIndex\n+()];\n+142 for (int k = 0; k < intersection.geometry().corners(); ++k)\n+143 {\n+144 const auto vtxLocalIndex(refElement.subEntity(faceLocalIndex, 1, k, dim));\n+145 file << \" \" << nodeIndexFromEntity(entity, vtxLocalIndex);\n+146 }\n+147 ++counter;\n+148 file << std::endl;\n+149 }\n+150 }\n 151 }\n 152\n-153 // return true if point is contained in boundary domain\n-154 template< class Vector >\n-155 bool contains ( const Vector & x ) const\n-156 {\n-157 bool ret = true;\n-158 for( int i = 0; i < dimensionworld; ++i )\n-159 {\n-160 if( x[ i ] < left_[ i ] || x[ i ] > right_[ i ] )\n-161 ret = false;\n-162 }\n-163 return ret;\n-164 }\n-165\n-166 const DomainData & data () const\n-167 {\n-168 return data_;\n-169 }\n-170\n-171 // for error messages\n-172 friend std::ostream & operator<<_( std :: ostream &os, const Domain &\n-domain )\n-173 {\n-174 os << \"domain: \" << std::endl;\n-175 os << \"left = \";\n-176 for( int i = 0; i < domain.dimensionworld; ++i )\n-177 os << domain.left_[ i ] << \" \";\n-178 os << std::endl;\n-179 os << \"right = \";\n-180 for( int i = 0; i < domain.dimensionworld; ++i )\n-181 os << domain.right_[ i ] << \" \";\n-182 os << std::endl;\n-183 os << domain.data();\n-184 return os;\n-185 }\n-186\n-187 private:\n-188 std::vector< double > left_, right_;\n-189 DomainData data_;\n-190\n-191 };\n-192\n-193 class BoundaryDomBlock\n-194 : public BasicBlock\n-195 {\n-196 typedef DGFBoundaryParameter::type BoundaryParameter;\n-197\n-198 // the dimension of the vertices (is given from user)\n-199 int dimworld_;\n-200\n-201 // internal counter\n-202 int counter_;\n-203\n-204 // default values if given\n-205 DomainData * default_;\n-206\n-207 // storage for all domains;\n-208 int ndomains_;\n-209 std::vector< Domain > domains_;\n-210\n-211 public:\n-212 // initialize vertex block and get first vertex\n-213 BoundaryDomBlock ( std::istream & in, int cdimworld );\n-214\n-215 // destructor\n-216 ~BoundaryDomBlock ()\n-217 {\n-218 if( default_ )\n-219 delete default_;\n-220 }\n-221\n-222 // go to next domain in block\n-223 bool next ()\n-224 {\n-225 counter_++;\n-226 return ( counter_ < ndomains_ );\n-227 }\n+153 } catch(Exception& e) {\n+154 file.close();\n+155 throw;\n+156 }\n+157 }\n+158 }\n+159\n+160\n+167 void outputNodes(std::ofstream& file) const {\n+168 for (const auto& vertex : vertices(gv)) {\n+169 const auto globalCoord = vertex.geometry().center();\n+170 const auto nodeIndex = gv.indexSet().index(vertex)+1; // Start counting\n+indices by \"1\".\n+171\n+172 if (1 == dimWorld)\n+173 file << nodeIndex << \" \" << globalCoord[0] << \" \" << 0 << \" \" << 0 << std::\n+endl;\n+174 else if (2 == dimWorld)\n+175 file << nodeIndex << \" \" << globalCoord[0] << \" \" << globalCoord[1] << \" \"\n+<< 0 << std::endl;\n+176 else // (3 == dimWorld)\n+177 file << nodeIndex << \" \" << globalCoord[0] << \" \" << globalCoord[1] << \" \"\n+<< globalCoord[2] << std::endl;\n+178 }\n+179 }\n+180\n+181 public:\n+187 GmshWriter(const GridView& gridView, int numDigits=6) : gv(gridView),\n+precision(numDigits) {}\n+188\n+193 void setPrecision(int numDigits) {\n+194 precision = numDigits;\n+195 }\n+196\n+218 void write(const std::string& fileName,\n+219 const std::vector& physicalEntities=std::vector(),\n+220 const std::vector& physicalBoundaries=std::vector()) const {\n+221 // Open file\n+222 std::ofstream file(fileName.c_str());\n+223 if (!file.is_open())\n+224 DUNE_THROW(Dune::IOError, \"Could not open \" << fileName << \" with write\n+access.\");\n+225\n+226 // Set precision\n+227 file << std::setprecision( precision );\n 228\n-229 // return domain\n-230 const Domain & domain () const\n-231 {\n-232 return domains_.at( counter_ );\n-233 }\n-234\n-235 // return true if default is given\n-236 bool hasDefaultData () const\n-237 {\n-238 return bool( default_ );\n-239 }\n-240\n-241 // return default data\n-242 const DomainData * defaultData () const\n-243 {\n-244 return default_;\n-245 }\n-246\n-247 // return true if any boundary domain block has\n-248 // additional parameters\n-249 bool hasParameter () const;\n-250\n-251 void reset ()\n-252 {\n-253 BasicBlock::reset();\n-254 counter_ = -1;\n-255 }\n-256\n-257 // return true while block is active\n-258 bool ok ()\n-259 {\n-260 return ( counter_ <= ndomains_ );\n-261 }\n-262\n-263 // return data if all vectors in array are contained within\n-264 // a single domain\n-265 template< class Vector >\n-266 const DomainData * contains ( const std::vector< Vector > & v ) const\n-267 {\n-268 std::vector< int > index( ndomains_ );\n-269 for( int i = 0; i < ndomains_; ++i)\n-270 index[ i ] = i;\n-271\n-272 size_t N = v.size();\n-273 for( size_t i = 0; i < N; ++i )\n-274 {\n-275 if( index.empty() )\n-276 break;\n-277\n-278 const int n = index.size();\n-279 assert( n > 0 );\n-280 for( int j = n-1; j >= 0; --j )\n-281 {\n-282 bool inside = domains_[ index[ j ] ].contains( v[ i ] );\n-283 if( !inside )\n-284 index.erase( index.begin() + j );\n-285 }\n-286 }\n-287\n-288 // check whether no boundary domain found\n-289 if( index.empty() )\n-290 return default_;\n-291\n-292 // check for ambiguity\n-293 if( index.size() > 1 )\n-294 dwarn << \"WARNING: ambiguous boundary domain assignment, use first boundary\n-domain in list\" << std::endl;\n-295\n-296 return &domains_[ index[ 0 ] ].data();\n-297 }\n-298\n-299 private:\n-300 void readBlock ();\n-301 };\n-302\n-303 } // end namespace dgf\n-304\n-305} // end namespace Dune\n-306\n-307#endif\n-parser.hh\n-basic.hh\n+229 // Output Header\n+230 file << \"$MeshFormat\" << std::endl\n+231 << \"2.0 0 \" << sizeof(double) << std::endl // \"2.0\" for \"version 2.0\", \"0\"\n+for ASCII\n+232 << \"$EndMeshFormat\" << std::endl;\n+233\n+234 // Output Nodes\n+235 file << \"$Nodes\" << std::endl\n+236 << gv.size(dim) << std::endl;\n+237\n+238 outputNodes(file);\n+239\n+240 file << \"$EndNodes\" << std::endl;\n+241\n+242 // Output Elements;\n+243 int boundariesSize(0);\n+244 if(!physicalBoundaries.empty())\n+245 for(const auto& entity : elements(gv))\n+246 for(const auto& intersection : intersections(gv, entity))\n+247 if(intersection.boundary())\n+248 ++boundariesSize;\n+249\n+250 file << \"$Elements\" << std::endl\n+251 << gv.size(0) + boundariesSize<< std::endl;\n+252\n+253 outputElements(file, physicalEntities, physicalBoundaries);\n+254\n+255 file << \"$EndElements\" << std::endl;\n+256 }\n+257\n+258 };\n+259\n+260} // namespace Dune\n+261\n+262#endif // DUNE_GRID_IO_FILE_GMSHWRITER_HH\n+mcmgmapper.hh\n+Mapper for multiple codim and multiple geometry types.\n+Dune::GridView::indexSet\n+const IndexSet & indexSet() const\n+obtain the index set\n+Definition common/gridview.hh:177\n+Dune::GridView::size\n+int size(int codim) const\n+obtain number of entities in a given codimension\n+Definition common/gridview.hh:183\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n+Dune::GridView::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/gridview.hh:137\n+Dune::mcmgElementLayout\n+MCMGLayout mcmgElementLayout()\n+layout for elements (codim-0 entities)\n+Definition mcmgmapper.hh:97\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::BasicBlock::reset\n-void reset()\n-Definition basic.hh:51\n-Dune::dgf::DomainData\n-Definition boundarydom.hh:23\n-Dune::dgf::DomainData::reset\n-void reset(int id, BoundaryParameter parameter, bool defaultData=false)\n-Definition boundarydom.hh:60\n-Dune::dgf::DomainData::~DomainData\n-~DomainData()\n-Definition boundarydom.hh:32\n-Dune::dgf::DomainData::BoundaryParameter\n-DGFBoundaryParameter::type BoundaryParameter\n-Definition boundarydom.hh:24\n-Dune::dgf::DomainData::DomainData\n-DomainData()\n-Definition boundarydom.hh:26\n-Dune::dgf::DomainData::id\n-int id() const\n-Definition boundarydom.hh:42\n-Dune::dgf::DomainData::parameter\n-const BoundaryParameter & parameter() const\n-Definition boundarydom.hh:54\n-Dune::dgf::DomainData::operator<<\n-friend std::ostream & operator<<(std ::ostream &os, const DomainData &ddata)\n-Definition boundarydom.hh:73\n-Dune::dgf::DomainData::hasParameter\n-bool hasParameter() const\n-Definition boundarydom.hh:48\n-Dune::dgf::DomainData::DomainData\n-DomainData(int id, BoundaryParameter parameter, bool defaultData=false)\n-Definition boundarydom.hh:35\n-Dune::dgf::DomainData::isDefault\n-bool isDefault() const\n-Definition boundarydom.hh:68\n-Dune::dgf::Domain\n-Definition boundarydom.hh:90\n-Dune::dgf::Domain::Domain\n-Domain(std::vector< double > p1, std::vector< double > p2, int id,\n-BoundaryParameter ¶meter)\n-Definition boundarydom.hh:97\n-Dune::dgf::Domain::Domain\n-Domain(const Domain &other)\n-Definition boundarydom.hh:125\n-Dune::dgf::Domain::dimensionworld\n-const int dimensionworld\n-Definition boundarydom.hh:92\n-Dune::dgf::Domain::contains\n-bool contains(const Vector &x) const\n-Definition boundarydom.hh:155\n-Dune::dgf::Domain::BoundaryParameter\n-DGFBoundaryParameter::type BoundaryParameter\n-Definition boundarydom.hh:94\n-Dune::dgf::Domain::operator<<\n-friend std::ostream & operator<<(std ::ostream &os, const Domain &domain)\n-Definition boundarydom.hh:172\n-Dune::dgf::Domain::operator=\n-Domain & operator=(const Domain &other)\n-Definition boundarydom.hh:139\n-Dune::dgf::Domain::data\n-const DomainData & data() const\n-Definition boundarydom.hh:166\n-Dune::dgf::Domain::Domain\n-Domain(std::vector< double > p1, std::vector< double > p2, DomainData &data)\n-Definition boundarydom.hh:111\n-Dune::dgf::BoundaryDomBlock\n-Definition boundarydom.hh:195\n-Dune::dgf::BoundaryDomBlock::~BoundaryDomBlock\n-~BoundaryDomBlock()\n-Definition boundarydom.hh:216\n-Dune::dgf::BoundaryDomBlock::hasParameter\n-bool hasParameter() const\n-Definition boundarydom.cc:137\n-Dune::dgf::BoundaryDomBlock::domain\n-const Domain & domain() const\n-Definition boundarydom.hh:230\n-Dune::dgf::BoundaryDomBlock::contains\n-const DomainData * contains(const std::vector< Vector > &v) const\n-Definition boundarydom.hh:266\n-Dune::dgf::BoundaryDomBlock::next\n-bool next()\n-Definition boundarydom.hh:223\n-Dune::dgf::BoundaryDomBlock::reset\n-void reset()\n-Definition boundarydom.hh:251\n-Dune::dgf::BoundaryDomBlock::ok\n-bool ok()\n-Definition boundarydom.hh:258\n-Dune::dgf::BoundaryDomBlock::hasDefaultData\n-bool hasDefaultData() const\n-Definition boundarydom.hh:236\n-Dune::dgf::BoundaryDomBlock::defaultData\n-const DomainData * defaultData() const\n-Definition boundarydom.hh:242\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n-Dune::DGFBoundaryParameter\n-Contains types for additional features.\n-Definition parser.hh:23\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::geometry\n+Geometry geometry() const\n+obtain geometric realization of the entity\n+Definition common/entity.hh:141\n+Dune::Entity::type\n+GeometryType type() const\n+Return the name of the reference element. The type can be used to access the\n+Dune::ReferenceElement.\n+Definition common/entity.hh:146\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::MultipleCodimMultipleGeomTypeMapper\n+Implementation class for a multiple codim and multiple geometry type mapper.\n+Definition mcmgmapper.hh:129\n+Dune::MultipleCodimMultipleGeomTypeMapper::index\n+Index index(const EntityType &e) const\n+Map entity to starting index in array for dof block.\n+Definition mcmgmapper.hh:171\n+Dune::GmshWriter\n+Write Gmsh mesh file.\n+Definition gmshwriter.hh:37\n+Dune::GmshWriter::GmshWriter\n+GmshWriter(const GridView &gridView, int numDigits=6)\n+Constructor expecting GridView of Grid to be written.\n+Definition gmshwriter.hh:187\n+Dune::GmshWriter::setPrecision\n+void setPrecision(int numDigits)\n+Set the number of digits to be used when writing the vertices. By default is 6.\n+Definition gmshwriter.hh:193\n+Dune::GmshWriter::write\n+void write(const std::string &fileName, const std::vector< int >\n+&physicalEntities=std::vector< int >(), const std::vector< int >\n+&physicalBoundaries=std::vector< int >()) const\n+Write given grid in Gmsh 2.0 compatible ASCII file.\n+Definition gmshwriter.hh:218\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00839.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00839.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: general.hh File Reference\n+dune-grid: printgrid.hh File Reference\n \n \n \n \n \n \n \n@@ -65,42 +65,44 @@\n \n \n \n \n \n \n \n
    \n \n-
    general.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    printgrid.hh File Reference
    \n \n
    \n-
    #include <iostream>
    \n-#include <vector>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+
    #include <fstream>
    \n+#include <string>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/parallel/mpihelper.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

    class  Dune::dgf::GeneralBlock
     
    \n \n \n \n \n-\n-\n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n+\n+\n+\n+\n+\n

    \n+Functions

    template<typename GridType >
    void Dune::printGrid (const GridType &grid, const Dune::MPIHelper &helper, std::string output_file="printgrid", int size=2000, bool execute_plot=true, bool png=true, bool local_corner_indices=true, bool local_intersection_indices=true, bool outer_normals=true)
     Print a grid as a gnuplot for testing and development.
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-Classes | Namespaces\n-general.hh File Reference\n-#include \n-#include \n-#include \n+Namespaces | Functions\n+printgrid.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 \u00a0 Dune::dgf::GeneralBlock\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n+Functions\n+template\n+void\u00a0 Dune::printGrid (const GridType &grid, const Dune::MPIHelper &helper,\n+ std::string output_file=\"printgrid\", int size=2000, bool execute_\n+ plot=true, bool png=true, bool local_corner_indices=true, bool local_\n+ intersection_indices=true, bool outer_normals=true)\n+\u00a0 Print a grid as a gnuplot for testing and development.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00839_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00839_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: general.hh Source File\n+dune-grid: printgrid.hh Source File\n \n \n \n \n \n \n \n@@ -70,98 +70,226 @@\n
    \n \n \n \n \n \n \n
    \n-
    general.hh
    \n+
    printgrid.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
    \n-
    6#define DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
    \n+
    5#ifndef DUNE_PRINTGRID_HH
    \n+
    6#define DUNE_PRINTGRID_HH
    \n
    7
    \n-
    8#include <iostream>
    \n-
    9#include <vector>
    \n+
    8#include <fstream>
    \n+
    9#include <string>
    \n
    10
    \n-\n-
    12
    \n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n+
    11#include <dune/common/exceptions.hh>
    \n+
    12#include <dune/common/parallel/mpihelper.hh>
    \n+\n+
    14
    \n+
    15namespace Dune {
    \n
    16
    \n-
    17 namespace dgf
    \n-
    18 {
    \n-
    19
    \n-
    20 // GeneralBlock
    \n-
    21 // ---------
    \n-
    22
    \n-
    \n-\n-
    24 : public BasicBlock
    \n-
    25 {
    \n-
    26 unsigned int nofvtx;
    \n-
    27 int dimgrid;
    \n-
    28 bool goodline; // active line describes a vertex
    \n-
    29 std :: vector< unsigned int > map; // active vertex
    \n-
    30 int nofparams;
    \n-
    31 int vtxoffset;
    \n-
    32
    \n-
    33 public:
    \n-
    34 GeneralBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
    \n-
    35
    \n-
    36 int get ( std :: vector< std :: vector< unsigned int> > &simplex,
    \n-
    37 std :: vector< std :: vector< double > > &params,
    \n-
    38 int &nofp );
    \n-
    39
    \n-
    40 // some information
    \n-
    \n-
    41 bool ok ()
    \n-
    42 {
    \n-
    43 return goodline;
    \n-
    44 }
    \n-
    \n-
    45
    \n-
    \n-\n-
    47 {
    \n-
    48 return noflines();
    \n-
    49 }
    \n-
    \n-
    50
    \n-
    51 private:
    \n-
    52 // get the dimension of the grid
    \n-
    53 int getDimGrid ();
    \n-
    54 // get next simplex
    \n-
    55 bool next ( std :: vector< unsigned int > &simplex,
    \n-
    56 std :: vector< double > &param );
    \n-
    57 };
    \n-
    \n+
    17 namespace {
    \n+
    18
    \n+
    19 template<int dim>
    \n+
    20 struct ElementDataLayout
    \n+
    21 {
    \n+
    22 bool contains (Dune::GeometryType gt)
    \n+
    23 {
    \n+
    24 return gt.dim()==dim;
    \n+
    25 }
    \n+
    26 };
    \n+
    27
    \n+
    28 template<int dim>
    \n+
    29 struct NodeDataLayout
    \n+
    30 {
    \n+
    31 bool contains (Dune::GeometryType gt)
    \n+
    32 {
    \n+
    33 return gt.dim()==0;
    \n+
    34 }
    \n+
    35 };
    \n+
    36
    \n+
    37 // Move a point closer to basegeo's center by factor scale (used for drawing relative to the element)
    \n+
    38 template <typename B, typename C>
    \n+
    39 C centrify (const B& basegeo, const C& coords, const double scale) {
    \n+
    40 C ret = coords;
    \n+
    41 ret -= basegeo.center();
    \n+
    42 ret *= scale;
    \n+
    43 ret += basegeo.center();
    \n+
    44 return ret;
    \n+
    45 }
    \n+
    46
    \n+
    47 // Add a line to the plotfile from p1 to p2
    \n+
    48 template <typename Coord>
    \n+
    49 void draw_line (std::ofstream &plotfile, const Coord &p1, const Coord &p2, std::string options) {
    \n+
    50 plotfile << "set object poly from ";
    \n+
    51 plotfile << p1[0] << "," << p1[1] << " to ";
    \n+
    52 plotfile << p2[0] << "," << p2[1] << " to ";
    \n+
    53 plotfile << p1[0] << "," << p1[1];
    \n+
    54 plotfile << " " << options << std::endl;
    \n+
    55 }
    \n+
    56
    \n+
    57 }
    \n
    58
    \n-
    59 } // end namespace dgf
    \n-
    60
    \n-
    61} // end namespace Dune
    \n-
    62
    \n-
    63#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
    \n-\n+
    72 template <typename GridType>
    \n+
    \n+
    73 void printGrid (const GridType& grid, const Dune::MPIHelper& helper, std::string output_file = "printgrid",
    \n+
    74 int size = 2000, bool execute_plot = true, bool png = true, bool local_corner_indices = true,
    \n+
    75 bool local_intersection_indices = true, bool outer_normals = true)
    \n+
    76 {
    \n+
    77
    \n+
    78 // Create output file
    \n+
    79 output_file = output_file + "_" + std::to_string(helper.rank());
    \n+
    80 std::string plot_file_name = output_file + ".gnuplot";
    \n+
    81 std::ofstream plotfile (plot_file_name, std::ios::out | std::ios::trunc);
    \n+
    82 if (!plotfile.is_open()) {
    \n+
    83 DUNE_THROW(Dune::IOError, "Could not create plot file " << output_file << "!");
    \n+
    84 return;
    \n+
    85 }
    \n+
    86
    \n+
    87 // Basic plot settings
    \n+
    88 plotfile << "set size ratio -1" << std::endl;
    \n+
    89 if (png) {
    \n+
    90 plotfile << "set terminal png size " << size << "," << size << std::endl;
    \n+
    91 plotfile << "set output '" << output_file << ".png'" << std::endl;
    \n+
    92 } else {
    \n+
    93 plotfile << "set terminal svg size " << size << "," << size << " enhanced background rgb 'white'" << std::endl;
    \n+
    94 plotfile << "set output '" << output_file << ".svg'" << std::endl;
    \n+
    95 }
    \n+
    96
    \n+
    97 // Get GridView
    \n+
    98 typedef typename GridType::LeafGridView GV;
    \n+
    99 const GV gv = grid.leafGridView();
    \n+
    100
    \n+
    101 // Create mappers used to retrieve indices
    \n+\n+
    103 const Mapper elementmapper(gv, mcmgElementLayout());
    \n+
    104 const Mapper nodemapper(gv, mcmgVertexLayout());
    \n+
    105
    \n+
    106 // Create iterators
    \n+
    107 typedef typename GV::template Codim<0 >::Iterator LeafIterator;
    \n+
    108 typedef typename GV::IntersectionIterator IntersectionIterator;
    \n+
    109
    \n+
    110 LeafIterator it = gv.template begin<0>();
    \n+
    111
    \n+
    112 // Will contain min/max coordinates. Needed for scaling of the plot
    \n+
    113 Dune::FieldVector<typename GridType::ctype,2> max_coord (it->geometry().center()), min_coord (max_coord);
    \n+
    114
    \n+
    115 // Iterate over elements
    \n+
    116 for (; it != gv.template end<0>(); ++it) {
    \n+
    117
    \n+
    118 const auto& entity = *it;
    \n+
    119 auto geo = entity.geometry();
    \n+
    120
    \n+
    121 // Plot element index
    \n+
    122 int element_id = elementmapper.index(entity);
    \n+
    123 plotfile << "set label at " << geo.center()[0] << "," << geo.center()[1] << " '"
    \n+
    124 << element_id << "' center" << std::endl;
    \n+
    125
    \n+
    126 for (int i = 0; i < geo.corners(); ++i) {
    \n+
    127 // Plot corner indices
    \n+
    128 const int globalNodeNumber1 = nodemapper.subIndex(entity, i, 2);
    \n+
    129 auto labelpos = centrify (geo, geo.corner(i), 0.7);
    \n+
    130 plotfile << "set label at " << labelpos[0] << "," << labelpos[1] << " '" << globalNodeNumber1;
    \n+
    131 if (local_corner_indices)
    \n+
    132 plotfile << "(" << i << ")";
    \n+
    133 plotfile << "' center" << std::endl;
    \n+
    134
    \n+
    135 // Adapt min / max coordinates
    \n+
    136 for (int dim = 0; dim < 2; ++dim) {
    \n+
    137 if (geo.corner(i)[dim] < min_coord[dim])
    \n+
    138 min_coord[dim] = geo.corner(i)[dim];
    \n+
    139 else if (geo.corner(i)[dim] > max_coord[dim])
    \n+
    140 max_coord[dim] = geo.corner(i)[dim];
    \n+
    141 }
    \n+
    142 }
    \n+
    143
    \n+
    144 // Iterate over intersections
    \n+
    145 for (IntersectionIterator is = gv.ibegin(entity); is != gv.iend(entity); ++is) {
    \n+
    146
    \n+
    147 const auto& intersection = *is;
    \n+
    148 auto igeo = intersection.geometry();
    \n+
    149
    \n+
    150 // Draw intersection line
    \n+
    151 draw_line (plotfile, igeo.corner(0), igeo.corner(1), "fs empty border 1");
    \n+
    152
    \n+
    153 // Plot local intersection index
    \n+
    154 if (local_intersection_indices) {
    \n+
    155 auto label_pos = centrify (geo, igeo.center(), 0.8);
    \n+
    156 plotfile << "set label at " << label_pos[0] << "," << label_pos[1]
    \n+
    157 << " '" << intersection.indexInInside() << "' center" << std::endl;
    \n+
    158 }
    \n+
    159
    \n+
    160 // Plot outer normal
    \n+
    161 if (outer_normals) {
    \n+
    162 auto intersection_pos = igeo.center();
    \n+
    163 auto normal = intersection.centerUnitOuterNormal();
    \n+
    164 normal *= 0.15 * igeo.volume();
    \n+
    165 auto normal_end = intersection_pos + normal;
    \n+
    166 plotfile << "set arrow from " << intersection_pos[0] << "," << intersection_pos[1]
    \n+
    167 << " to " << normal_end[0] << "," << normal_end[1] << " lt rgb \\"gray\\"" << std::endl;
    \n+
    168 }
    \n+
    169
    \n+
    170 // Get corners for inner intersection representation
    \n+
    171 auto inner_corner1 = centrify (geo, igeo.corner(0), 0.5);
    \n+
    172 auto inner_corner2 = centrify (geo, igeo.corner(1), 0.5);
    \n+
    173
    \n+
    174 // Thick line in case of boundary()
    \n+
    175 if (intersection.boundary())
    \n+
    176 draw_line (plotfile, inner_corner1, inner_corner2, "fs empty border 3 lw 4");
    \n+
    177
    \n+
    178 // Thin line with color according to neighbor()
    \n+
    179 if (intersection.neighbor())
    \n+
    180 draw_line (plotfile, inner_corner1, inner_corner2, "fs empty border 2");
    \n+
    181 else
    \n+
    182 draw_line (plotfile, inner_corner1, inner_corner2, "fs empty border 1");
    \n+
    183 }
    \n+
    184
    \n+
    185 }
    \n+
    186
    \n+
    187 // Finish plot, pass extend of the grid
    \n+
    188 Dune::FieldVector<typename GridType::ctype,2> extend (max_coord - min_coord);
    \n+
    189
    \n+
    190 extend *= 0.2;
    \n+
    191 min_coord -= extend;
    \n+
    192 max_coord += extend;
    \n+
    193 plotfile << "plot [" << min_coord[0] << ":" << max_coord[0] << "] [" << min_coord[1]
    \n+
    194 << ":" << max_coord[1] << "] NaN notitle" << std::endl;
    \n+
    195 plotfile.close();
    \n+
    196
    \n+
    197 if (execute_plot) {
    \n+
    198 std::string cmd = "gnuplot -p '" + plot_file_name + "'";
    \n+
    199 if (std::system (cmd.c_str()) != 0)
    \n+
    200 DUNE_THROW(Dune::Exception,"Error running GNUPlot: " << cmd);
    \n+
    201 }
    \n+
    202 }
    \n+
    \n+
    203
    \n+
    204}
    \n+
    205
    \n+
    206#endif // #ifndef DUNE_PRINTGRID_HH
    \n+
    Mapper for multiple codim and multiple geometry types.
    \n+
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n+
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    int & noflines()
    Definition basic.hh:87
    \n-
    Definition general.hh:25
    \n-
    int nofsimplex()
    Definition general.hh:46
    \n-
    int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector< std ::vector< double > > &params, int &nofp)
    Definition general.cc:100
    \n-
    bool ok()
    Definition general.hh:41
    \n+
    void printGrid(const GridType &grid, const Dune::MPIHelper &helper, std::string output_file="printgrid", int size=2000, bool execute_plot=true, bool png=true, bool local_corner_indices=true, bool local_intersection_indices=true, bool outer_normals=true)
    Print a grid as a gnuplot for testing and development.
    Definition printgrid.hh:73
    \n+
    Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
    Definition common/intersectioniterator.hh:83
    \n+
    Mapper interface.
    Definition mapper.hh:110
    \n+
    Index index(const EntityType &e) const
    Map entity to array index.
    Definition mapper.hh:122
    \n+
    Index subIndex(const typename G::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity i of codim cc of a codim 0 entity to array index.
    Definition mapper.hh:136
    \n+
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,99 +2,259 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n- * blocks\n-general.hh\n+printgrid.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH\n-6#define DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH\n+5#ifndef DUNE_PRINTGRID_HH\n+6#define DUNE_PRINTGRID_HH\n 7\n-8#include \n-9#include \n+8#include \n+9#include \n 10\n-11#include \n-12\n-13\n-14namespace Dune\n-15{\n+11#include \n+12#include \n+13#include \n+14\n+15namespace Dune {\n 16\n-17 namespace dgf\n-18 {\n-19\n-20 // GeneralBlock\n-21 // ---------\n-22\n-23 class GeneralBlock\n-24 : public BasicBlock\n-25 {\n-26 unsigned int nofvtx;\n-27 int dimgrid;\n-28 bool goodline; // active line describes a vertex\n-29 std :: vector< unsigned int > map; // active vertex\n-30 int nofparams;\n-31 int vtxoffset;\n-32\n-33 public:\n-34 GeneralBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int\n-&pdimgrid );\n-35\n-36 int get ( std :: vector< std :: vector< unsigned int> > &simplex,\n-37 std :: vector< std :: vector< double > > ¶ms,\n-38 int &nofp );\n-39\n-40 // some information\n-41 bool ok ()\n-42 {\n-43 return goodline;\n-44 }\n-45\n-46 int nofsimplex ()\n-47 {\n-48 return noflines();\n-49 }\n-50\n-51 private:\n-52 // get the dimension of the grid\n-53 int getDimGrid ();\n-54 // get next simplex\n-55 bool next ( std :: vector< unsigned int > &simplex,\n-56 std :: vector< double > ¶m );\n-57 };\n+17 namespace {\n+18\n+19 template\n+20 struct ElementDataLayout\n+21 {\n+22 bool contains (Dune::GeometryType gt)\n+23 {\n+24 return gt.dim()==dim;\n+25 }\n+26 };\n+27\n+28 template\n+29 struct NodeDataLayout\n+30 {\n+31 bool contains (Dune::GeometryType gt)\n+32 {\n+33 return gt.dim()==0;\n+34 }\n+35 };\n+36\n+37 // Move a point closer to basegeo's center by factor scale (used for drawing\n+relative to the element)\n+38 template \n+39 C centrify (const B& basegeo, const C& coords, const double scale) {\n+40 C ret = coords;\n+41 ret -= basegeo.center();\n+42 ret *= scale;\n+43 ret += basegeo.center();\n+44 return ret;\n+45 }\n+46\n+47 // Add a line to the plotfile from p1 to p2\n+48 template \n+49 void draw_line (std::ofstream &plotfile, const Coord &p1, const Coord &p2,\n+std::string options) {\n+50 plotfile << \"set object poly from \";\n+51 plotfile << p1[0] << \",\" << p1[1] << \" to \";\n+52 plotfile << p2[0] << \",\" << p2[1] << \" to \";\n+53 plotfile << p1[0] << \",\" << p1[1];\n+54 plotfile << \" \" << options << std::endl;\n+55 }\n+56\n+57 }\n 58\n-59 } // end namespace dgf\n-60\n-61} // end namespace Dune\n-62\n-63#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH\n-basic.hh\n+72 template \n+73 void printGrid (const GridType& grid, const Dune::MPIHelper& helper, std::\n+string output_file = \"printgrid\",\n+74 int size = 2000, bool execute_plot = true, bool png = true, bool local_\n+corner_indices = true,\n+75 bool local_intersection_indices = true, bool outer_normals = true)\n+76 {\n+77\n+78 // Create output file\n+79 output_file = output_file + \"_\" + std::to_string(helper.rank());\n+80 std::string plot_file_name = output_file + \".gnuplot\";\n+81 std::ofstream plotfile (plot_file_name, std::ios::out | std::ios::trunc);\n+82 if (!plotfile.is_open()) {\n+83 DUNE_THROW(Dune::IOError, \"Could not create plot file \" << output_file <<\n+\"!\");\n+84 return;\n+85 }\n+86\n+87 // Basic plot settings\n+88 plotfile << \"set size ratio -1\" << std::endl;\n+89 if (png) {\n+90 plotfile << \"set terminal png size \" << size << \",\" << size << std::endl;\n+91 plotfile << \"set output '\" << output_file << \".png'\" << std::endl;\n+92 } else {\n+93 plotfile << \"set terminal svg size \" << size << \",\" << size << \" enhanced\n+background rgb 'white'\" << std::endl;\n+94 plotfile << \"set output '\" << output_file << \".svg'\" << std::endl;\n+95 }\n+96\n+97 // Get GridView\n+98 typedef typename GridType::LeafGridView GV;\n+99 const GV gv = grid.leafGridView();\n+100\n+101 // Create mappers used to retrieve indices\n+102 typedef typename Dune::MultipleCodimMultipleGeomTypeMapper Mapper;\n+103 const Mapper elementmapper(gv, mcmgElementLayout());\n+104 const Mapper nodemapper(gv, mcmgVertexLayout());\n+105\n+106 // Create iterators\n+107 typedef typename GV::template Codim<0 >::Iterator LeafIterator;\n+108 typedef typename GV::IntersectionIterator IntersectionIterator;\n+109\n+110 LeafIterator it = gv.template begin<0>();\n+111\n+112 // Will contain min/max coordinates. Needed for scaling of the plot\n+113 Dune::FieldVector max_coord (it->geometry\n+().center()), min_coord (max_coord);\n+114\n+115 // Iterate over elements\n+116 for (; it != gv.template end<0>(); ++it) {\n+117\n+118 const auto& entity = *it;\n+119 auto geo = entity.geometry();\n+120\n+121 // Plot element index\n+122 int element_id = elementmapper.index(entity);\n+123 plotfile << \"set label at \" << geo.center()[0] << \",\" << geo.center()[1] <<\n+\" '\"\n+124 << element_id << \"' center\" << std::endl;\n+125\n+126 for (int i = 0; i < geo.corners(); ++i) {\n+127 // Plot corner indices\n+128 const int globalNodeNumber1 = nodemapper.subIndex(entity, i, 2);\n+129 auto labelpos = centrify (geo, geo.corner(i), 0.7);\n+130 plotfile << \"set label at \" << labelpos[0] << \",\" << labelpos[1] << \" '\" <<\n+globalNodeNumber1;\n+131 if (local_corner_indices)\n+132 plotfile << \"(\" << i << \")\";\n+133 plotfile << \"' center\" << std::endl;\n+134\n+135 // Adapt min / max coordinates\n+136 for (int dim = 0; dim < 2; ++dim) {\n+137 if (geo.corner(i)[dim] < min_coord[dim])\n+138 min_coord[dim] = geo.corner(i)[dim];\n+139 else if (geo.corner(i)[dim] > max_coord[dim])\n+140 max_coord[dim] = geo.corner(i)[dim];\n+141 }\n+142 }\n+143\n+144 // Iterate over intersections\n+145 for (IntersectionIterator is = gv.ibegin(entity); is != gv.iend(entity);\n+++is) {\n+146\n+147 const auto& intersection = *is;\n+148 auto igeo = intersection.geometry();\n+149\n+150 // Draw intersection line\n+151 draw_line (plotfile, igeo.corner(0), igeo.corner(1), \"fs empty border 1\");\n+152\n+153 // Plot local intersection index\n+154 if (local_intersection_indices) {\n+155 auto label_pos = centrify (geo, igeo.center(), 0.8);\n+156 plotfile << \"set label at \" << label_pos[0] << \",\" << label_pos[1]\n+157 << \" '\" << intersection.indexInInside() << \"' center\" << std::endl;\n+158 }\n+159\n+160 // Plot outer normal\n+161 if (outer_normals) {\n+162 auto intersection_pos = igeo.center();\n+163 auto normal = intersection.centerUnitOuterNormal();\n+164 normal *= 0.15 * igeo.volume();\n+165 auto normal_end = intersection_pos + normal;\n+166 plotfile << \"set arrow from \" << intersection_pos[0] << \",\" <<\n+intersection_pos[1]\n+167 << \" to \" << normal_end[0] << \",\" << normal_end[1] << \" lt rgb \\\"gray\\\"\" <<\n+std::endl;\n+168 }\n+169\n+170 // Get corners for inner intersection representation\n+171 auto inner_corner1 = centrify (geo, igeo.corner(0), 0.5);\n+172 auto inner_corner2 = centrify (geo, igeo.corner(1), 0.5);\n+173\n+174 // Thick line in case of boundary()\n+175 if (intersection.boundary())\n+176 draw_line (plotfile, inner_corner1, inner_corner2, \"fs empty border 3 lw\n+4\");\n+177\n+178 // Thin line with color according to neighbor()\n+179 if (intersection.neighbor())\n+180 draw_line (plotfile, inner_corner1, inner_corner2, \"fs empty border 2\");\n+181 else\n+182 draw_line (plotfile, inner_corner1, inner_corner2, \"fs empty border 1\");\n+183 }\n+184\n+185 }\n+186\n+187 // Finish plot, pass extend of the grid\n+188 Dune::FieldVector extend (max_coord - min_\n+coord);\n+189\n+190 extend *= 0.2;\n+191 min_coord -= extend;\n+192 max_coord += extend;\n+193 plotfile << \"plot [\" << min_coord[0] << \":\" << max_coord[0] << \"] [\" <<\n+min_coord[1]\n+194 << \":\" << max_coord[1] << \"] NaN notitle\" << std::endl;\n+195 plotfile.close();\n+196\n+197 if (execute_plot) {\n+198 std::string cmd = \"gnuplot -p '\" + plot_file_name + \"'\";\n+199 if (std::system (cmd.c_str()) != 0)\n+200 DUNE_THROW(Dune::Exception,\"Error running GNUPlot: \" << cmd);\n+201 }\n+202 }\n+203\n+204}\n+205\n+206#endif // #ifndef DUNE_PRINTGRID_HH\n+mcmgmapper.hh\n+Mapper for multiple codim and multiple geometry types.\n+Dune::mcmgElementLayout\n+MCMGLayout mcmgElementLayout()\n+layout for elements (codim-0 entities)\n+Definition mcmgmapper.hh:97\n+Dune::mcmgVertexLayout\n+MCMGLayout mcmgVertexLayout()\n+layout for vertices (dim-0 entities)\n+Definition mcmgmapper.hh:107\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::BasicBlock::noflines\n-int & noflines()\n-Definition basic.hh:87\n-Dune::dgf::GeneralBlock\n-Definition general.hh:25\n-Dune::dgf::GeneralBlock::nofsimplex\n-int nofsimplex()\n-Definition general.hh:46\n-Dune::dgf::GeneralBlock::get\n-int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector<\n-std ::vector< double > > ¶ms, int &nofp)\n-Definition general.cc:100\n-Dune::dgf::GeneralBlock::ok\n-bool ok()\n-Definition general.hh:41\n+Dune::printGrid\n+void printGrid(const GridType &grid, const Dune::MPIHelper &helper, std::string\n+output_file=\"printgrid\", int size=2000, bool execute_plot=true, bool png=true,\n+bool local_corner_indices=true, bool local_intersection_indices=true, bool\n+outer_normals=true)\n+Print a grid as a gnuplot for testing and development.\n+Definition printgrid.hh:73\n+Dune::IntersectionIterator\n+Mesh entities of codimension 0 (\"elements\") allow to visit all intersections\n+with \"neighboring\" eleme...\n+Definition common/intersectioniterator.hh:83\n+Dune::Mapper\n+Mapper interface.\n+Definition mapper.hh:110\n+Dune::Mapper::index\n+Index index(const EntityType &e) const\n+Map entity to array index.\n+Definition mapper.hh:122\n+Dune::Mapper::subIndex\n+Index subIndex(const typename G::Traits::template Codim< 0 >::Entity &e, int i,\n+unsigned int codim) const\n+Map subentity i of codim cc of a codim 0 entity to array index.\n+Definition mapper.hh:136\n+Dune::MultipleCodimMultipleGeomTypeMapper\n+Implementation class for a multiple codim and multiple geometry type mapper.\n+Definition mcmgmapper.hh:129\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00842.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00842.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: simplexgeneration.cc File Reference\n+dune-grid: dgfgridfactory.hh File Reference\n \n \n \n \n \n \n \n@@ -65,32 +65,47 @@\n \n \n \n \n \n \n \n
    \n \n-
    simplexgeneration.cc File Reference
    \n+
    dgfgridfactory.hh File Reference
    \n
    \n
    \n-\n+
    #include <iostream>
    \n+#include <string>
    \n+#include <vector>
    \n+#include <map>
    \n+#include <assert.h>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n+#include <dune/grid/io/file/dgfparser/macrogrid.hh>
    \n+#include <dune/grid/io/file/dgfparser/parser.hh>
    \n+#include <dune/grid/common/intersection.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    struct  Dune::DGFGridFactory< G >
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,19 +3,29 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n- * blocks\n-Namespaces\n-simplexgeneration.cc File Reference\n-#include \n+Classes | Namespaces\n+dgfgridfactory.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+struct \u00a0 Dune::DGFGridFactory<_G_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::dgf\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00845.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00845.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cube.cc File Reference\n+dune-grid: dgfug.hh File Reference\n \n \n \n \n \n \n \n@@ -65,25 +65,48 @@\n \n \n \n \n \n \n \n
    \n \n-
    cube.cc File Reference
    \n+
    dgfug.hh File Reference
    \n
    \n
    \n-\n+
    #include <fstream>
    \n+#include <istream>
    \n+#include <string>
    \n+#include <vector>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune-grid-config.hh>
    \n+#include <dune/grid/common/intersection.hh>
    \n+#include <dune/grid/uggrid.hh>
    \n+#include "dgfparser.hh"
    \n+#include "blocks/gridparameter.hh"
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    struct  Dune::dgf::UGGridParameterBlock
     
    struct  Dune::DGFGridInfo< UGGrid< dim > >
     
    struct  Dune::DGFGridFactory< UGGrid< dim > >
     
    \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,18 +3,36 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n- * blocks\n-Namespaces\n-cube.cc File Reference\n-#include \n+Classes | Namespaces\n+dgfug.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 \"dgfparser.hh\"\n+#include \"blocks/gridparameter.hh\"\n+Go_to_the_source_code_of_this_file.\n+Classes\n+struct \u00a0 Dune::dgf::UGGridParameterBlock\n+\u00a0\n+struct \u00a0 Dune::DGFGridInfo<_UGGrid<_dim_>_>\n+\u00a0\n+struct \u00a0 Dune::DGFGridFactory<_UGGrid<_dim_>_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00848.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00848.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: interval.cc File Reference\n+dune-grid: gmsh2dgf.cc File Reference\n \n \n \n \n \n \n \n@@ -65,33 +65,70 @@\n \n \n \n \n \n \n \n
    \n \n-
    interval.cc File Reference
    \n+Functions
    \n+
    gmsh2dgf.cc File Reference
    \n \n
    \n-
    #include <dune/grid/io/file/dgfparser/blocks/interval.hh>
    \n+\n+

    a small program converting a gmsh file into a DGF file \n+More...

    \n+
    #include <iostream>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/grid/io/file/gmshreader.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfwriter.hh>
    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-\n-\n-\n-\n-\n-\n+\n+\n+\n

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     

    \n+Functions

    int main (int argc, char *argv[])
     
    \n+

    Detailed Description

    \n+

    a small program converting a gmsh file into a DGF file

    \n+
    Author
    Matrin Nolte
    \n+

    gmsh2dgf is a small example program for the DGFWriter. It reads a gmsh file into any grid (selected by gridtype.hh) and writes it back as a DGF file.

    \n+

    The program's usage is as follows:

    ./gmsh2dgf <gmshfile>
    \n+

    Function Documentation

    \n+\n+

    ◆ main()

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+
    int main (int argc,
    char * argv[] 
    )
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,19 +3,33 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n- * blocks\n-Namespaces\n-interval.cc File Reference\n-#include \n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n-namespace \u00a0 Dune::dgf\n+ * utils\n+Functions\n+gmsh2dgf.cc File Reference\n+a small program converting a gmsh file into a DGF file More...\n+#include \n+#include \n+#include \n+#include \n+Functions\n+int\u00a0 main (int argc, char *argv[])\n \u00a0\n+***** Detailed Description *****\n+a small program converting a gmsh file into a DGF file\n+ Author\n+ Matrin Nolte\n+gmsh2dgf is a small example program for the DGFWriter. It reads a gmsh file\n+into any grid (selected by gridtype.hh) and writes it back as a DGF file.\n+The program's usage is as follows:\n+./gmsh2dgf \n+***** Function Documentation *****\n+***** \u25c6\u00a0main() *****\n+int main ( int\u00a0 argc,\n+ char *\u00a0 argv[]\u00a0\n+ )\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00851.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00851.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: simplexgeneration.hh File Reference\n+dune-grid: dgf2dgf.cc File Reference\n \n \n \n \n \n \n \n@@ -65,42 +65,74 @@\n \n \n \n \n \n \n \n
    \n \n-
    simplexgeneration.hh File Reference
    \n+Functions
    \n+
    dgf2dgf.cc File Reference
    \n \n
    \n+\n+

    a small program converting a DGF file into a DGF file \n+More...

    \n
    #include <iostream>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::dgf::SimplexGenerationBlock
     
    \n-\n-\n-\n-\n-\n-\n+#include <dune/grid/io/file/dgfparser/dgfwriter.hh>
    \n+

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n+\n+\n+\n

    \n+Functions

    int main (int argc, char *argv[])
     
    \n+

    Detailed Description

    \n+

    a small program converting a DGF file into a DGF file

    \n+
    Author
    Matrin Nolte
    \n+

    dgf2dgf is a small example program for the DGFWriter. It reads a DGF file into any grid, optionally refining the grid globally. The leaf grid is then written back as a DGF file.

    \n+

    The program's usage is as follows:

    ./dgf2dgf <dgffile> [refinement level]
    \n+

    While the program may seem completely useless, it has the following usages:

      \n+
    • Convert an interval block into a simplex or cube grid (depending on the grid implementation used).
    • \n+
    • Resolve the simplex generator block into a vertex and a simplex block, so that it can be used without triangle or tetgen.
    • \n+
    • Construct a refined macro grid, which is very useful when setting up parallel computations with dune-ALUGrid.
    • \n+
    \n+

    The source code of this program also demonstrates the easy use of the DGF parser and the DGFWriter.

    \n+

    Function Documentation

    \n+\n+

    ◆ main()

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+
    int main (int argc,
    char * argv[] 
    )
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,24 +3,41 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n- * blocks\n-Classes | Namespaces\n-simplexgeneration.hh File Reference\n+ * utils\n+Functions\n+dgf2dgf.cc File Reference\n+a small program converting a DGF file into a DGF file More...\n #include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::dgf::SimplexGenerationBlock\n-\u00a0\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n-namespace \u00a0 Dune::dgf\n+#include \n+Functions\n+int\u00a0 main (int argc, char *argv[])\n \u00a0\n+***** Detailed Description *****\n+a small program converting a DGF file into a DGF file\n+ Author\n+ Matrin Nolte\n+dgf2dgf is a small example program for the DGFWriter. It reads a DGF file into\n+any grid, optionally refining the grid globally. The leaf grid is then written\n+back as a DGF file.\n+The program's usage is as follows:\n+./dgf2dgf [refinement level]\n+While the program may seem completely useless, it has the following usages:\n+ * Convert an interval block into a simplex or cube grid (depending on the\n+ grid implementation used).\n+ * Resolve the simplex generator block into a vertex and a simplex block, so\n+ that it can be used without triangle or tetgen.\n+ * Construct a refined macro grid, which is very useful when setting up\n+ parallel computations with dune-ALUGrid.\n+The source code of this program also demonstrates the easy use of the DGF\n+parser and the DGFWriter.\n+***** Function Documentation *****\n+***** \u25c6\u00a0main() *****\n+int main ( int\u00a0 argc,\n+ char *\u00a0 argv[]\u00a0\n+ )\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00854.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00854.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cube.hh File Reference\n+dune-grid: periodicfacetrans.cc File Reference\n \n \n \n \n \n \n \n@@ -70,31 +70,20 @@\n \n \n
    \n \n-
    cube.hh File Reference
    \n+
    periodicfacetrans.cc File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <iostream>
    \n-#include <vector>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::dgf::CubeBlock
     
    \n+
    \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,24 +4,17 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-Classes | Namespaces\n-cube.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::dgf::CubeBlock\n-\u00a0\n+Namespaces\n+periodicfacetrans.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00857.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00857.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: projection.cc File Reference\n+dune-grid: simplex.hh File Reference\n \n \n \n \n \n \n \n@@ -71,69 +71,36 @@\n \n \n \n
    \n \n-
    projection.cc File Reference
    \n+Namespaces
    \n+
    simplex.hh File Reference
    \n \n
    \n-
    #include <dune/common/math.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/projection.hh>
    \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n+
    #include <iostream>
    \n+#include <vector>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::dgf::Expr::ConstantExpression
     
    struct  Dune::dgf::Expr::VariableExpression
     
    struct  Dune::dgf::Expr::FunctionCallExpression
     
    struct  Dune::dgf::Expr::VectorExpression
     
    struct  Dune::dgf::Expr::BracketExpression
     
    struct  Dune::dgf::Expr::MinusExpression
     
    struct  Dune::dgf::Expr::NormExpression
     
    struct  Dune::dgf::Expr::SqrtExpression
     
    struct  Dune::dgf::Expr::SinExpression
     
    struct  Dune::dgf::Expr::CosExpression
     
    struct  Dune::dgf::Expr::PowerExpression
     
    struct  Dune::dgf::Expr::SumExpression
     
    struct  Dune::dgf::Expr::DifferenceExpression
     
    struct  Dune::dgf::Expr::ProductExpression
     
    struct  Dune::dgf::Expr::QuotientExpression
    class  Dune::dgf::SimplexBlock
     
    \n \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    namespace  Dune::dgf::Expr
     
    \n-\n-\n-\n

    \n-Functions

    std::ostream & Dune::dgf::operator<< (std::ostream &out, const ProjectionBlock::Token &token)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,56 +4,24 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-Classes | Namespaces | Functions\n-projection.cc File Reference\n-#include \n-#include \n+Classes | Namespaces\n+simplex.hh File Reference\n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::dgf::Expr::ConstantExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::VariableExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::FunctionCallExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::VectorExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::BracketExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::MinusExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::NormExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::SqrtExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::SinExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::CosExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::PowerExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::SumExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::DifferenceExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::ProductExpression\n-\u00a0\n-struct \u00a0 Dune::dgf::Expr::QuotientExpression\n+class \u00a0 Dune::dgf::SimplexBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n-namespace \u00a0 Dune::dgf::Expr\n-\u00a0\n-Functions\n-std::ostream &\u00a0 Dune::dgf::operator<< (std::ostream &out, const\n- ProjectionBlock::Token &token)\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00860.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00860.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundaryseg.hh File Reference\n+dune-grid: basic.hh File Reference\n \n \n \n \n \n \n \n@@ -71,40 +71,47 @@\n \n \n \n
    \n \n-
    boundaryseg.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    basic.hh File Reference
    \n \n
    \n
    #include <cassert>
    \n+#include <cctype>
    \n #include <iostream>
    \n #include <string>
    \n-#include <vector>
    \n-#include <map>
    \n-#include <dune/grid/io/file/dgfparser/parser.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+#include <sstream>
    \n+#include <dune/common/stdstreams.hh>
    \n+#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::dgf::BoundarySegBlock
    class  Dune::dgf::BasicBlock
     
    \n \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n+\n+\n+\n

    \n+Functions

    void Dune::dgf::makeupcase (std ::string &s)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,28 +4,32 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-Classes | Namespaces\n-boundaryseg.hh File Reference\n+Classes | Namespaces | Functions\n+basic.hh File Reference\n #include \n+#include \n #include \n #include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::dgf::BoundarySegBlock\n+class \u00a0 Dune::dgf::BasicBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n+Functions\n+void\u00a0 Dune::dgf::makeupcase (std ::string &s)\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00860_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00860_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundaryseg.hh Source File\n+dune-grid: basic.hh Source File\n \n \n \n \n \n \n \n@@ -74,118 +74,168 @@\n \n \n \n
    \n-
    boundaryseg.hh
    \n+
    basic.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_BOUNDARYSEGBLOCK_HH
    \n-
    6#define DUNE_DGF_BOUNDARYSEGBLOCK_HH
    \n+
    5#ifndef DUNE_DGF_BASICBLOCK_HH
    \n+
    6#define DUNE_DGF_BASICBLOCK_HH
    \n
    7
    \n
    8#include <cassert>
    \n-
    9#include <iostream>
    \n-
    10#include <string>
    \n-
    11#include <vector>
    \n-
    12#include <map>
    \n+
    9#include <cctype>
    \n+
    10#include <iostream>
    \n+
    11#include <string>
    \n+
    12#include <sstream>
    \n
    13
    \n-\n-\n-
    16
    \n+
    14#include <dune/common/stdstreams.hh>
    \n+\n+\n
    17
    \n
    18namespace Dune
    \n
    19{
    \n
    20
    \n
    21 namespace dgf
    \n
    22 {
    \n-
    \n-\n-
    24 : public BasicBlock
    \n+
    23
    \n+
    \n+
    24 inline void makeupcase( std :: string &s )
    \n
    25 {
    \n-
    26 int dimworld; // the dimension of the vertices (is given from user)
    \n-
    27 bool goodline; // active line describes a vertex
    \n-
    28 std :: vector< unsigned int > p; // active vertex
    \n-
    29 int bndid;
    \n-
    30 typedef DGFBoundaryParameter::type BoundaryParameter;
    \n-
    31 BoundaryParameter parameter;
    \n-
    32 bool simplexgrid;
    \n-
    33
    \n-
    34 public:
    \n-\n-
    36 typedef std::pair < int, BoundaryParameter > BndParam;
    \n-
    37
    \n-
    38 // initialize vertex block and get first vertex
    \n-
    39 BoundarySegBlock ( std :: istream &in, int pnofvtx,
    \n-
    40 int pdimworld, bool psimplexgrid );
    \n-
    41
    \n-
    42 // some information
    \n-
    43 int get( std :: map< EntityKey, BndParam > & facemap,
    \n-
    44 bool fixedsize,
    \n-
    45 int vtxoffset
    \n-
    46 );
    \n-
    47
    \n-
    \n-
    48 bool ok()
    \n-
    49 {
    \n-
    50 return goodline;
    \n-
    51 }
    \n-
    \n-
    52
    \n-
    \n-\n-
    54 {
    \n-
    55 return noflines();
    \n+
    26 for (size_t i=0; i<s.size(); i++)
    \n+
    27 s[i]=std::toupper(s[i]);
    \n+
    28 }
    \n+
    \n+
    29
    \n+
    \n+\n+
    31 {
    \n+
    32 int pos; // line number
    \n+
    33 bool active; // block was found
    \n+
    34 bool empty; // block was found but was empty
    \n+
    35 std::string identifier; // identifier of this block
    \n+
    36 int linecount; // total number of lines in the block
    \n+
    37 std::stringstream block_; // the block itself
    \n+
    38 std::string oneline; // the active line in the block
    \n+
    39
    \n+
    40 // get the block (if it exists)
    \n+
    41 void getblock ( std::istream &in );
    \n+
    42
    \n+
    43 // count the number of lines in the block
    \n+
    44 // int countlines ();
    \n+
    45
    \n+
    46 protected:
    \n+
    47 std::stringstream line; // the active line as string buffer
    \n+
    48 // for use in the derived classes
    \n+
    49
    \n+
    50 // go back to beginning of block
    \n+
    \n+
    51 void reset ()
    \n+
    52 {
    \n+
    53 pos = -1;
    \n+
    54 block_.clear();
    \n+
    55 block_.seekg( 0 );
    \n
    56 }
    \n
    \n
    57
    \n-
    58 private:
    \n-
    59 bool next();
    \n+
    58 // get next line and store in string stream
    \n+
    59 bool getnextline ();
    \n
    60
    \n-
    61 // get coordinates of active vertex
    \n-
    62 int operator[] (int i)
    \n-
    63 {
    \n-
    64 assert(ok());
    \n-
    65 assert(linenumber()>=0);
    \n-
    66 assert(0<=i && i<dimworld+1);
    \n-
    67 return p[i];
    \n-
    68 }
    \n-
    69
    \n-
    70 int size()
    \n-
    71 {
    \n-
    72 return p.size();
    \n-
    73 }
    \n-
    74
    \n-
    75 };
    \n-
    \n-
    76
    \n-
    77 } // end namespace dgf
    \n-
    78
    \n-
    79} // end namespace Dune
    \n-
    80
    \n-
    81#endif
    \n-\n-\n+
    61 // get next entry in line
    \n+
    62 template< class ENTRY >
    \n+
    \n+
    63 bool getnextentry( ENTRY &entry )
    \n+
    64 {
    \n+
    65 line >> entry;
    \n+
    66 return static_cast< bool >( line );
    \n+
    67 }
    \n+
    \n+
    68
    \n+
    69 bool gettokenparam ( std :: string token, std :: string &entry );
    \n+
    70 bool findtoken( std :: string token );
    \n+
    71
    \n+
    72 public:
    \n+
    73 // search for block in file and store in buffer
    \n+
    74 BasicBlock ( std::istream &in, const char* id );
    \n+
    75
    \n+
    76 // some information on this block
    \n+
    \n+
    77 bool isactive ()
    \n+
    78 {
    \n+
    79 return active;
    \n+
    80 }
    \n+
    \n+
    81
    \n+
    \n+
    82 bool isempty ()
    \n+
    83 {
    \n+
    84 return empty;
    \n+
    85 }
    \n+
    \n+
    86
    \n+
    \n+
    87 int &noflines ()
    \n+
    88 {
    \n+
    89 return linecount;
    \n+
    90 }
    \n+
    \n+
    91
    \n+
    \n+\n+
    93 {
    \n+
    94 return pos;
    \n+
    95 }
    \n+
    \n+
    96
    \n+
    \n+
    97 const std::string & id () const
    \n+
    98 {
    \n+
    99 return identifier;
    \n+
    100 }
    \n+
    \n+
    101
    \n+
    102 // for error messages
    \n+
    \n+
    103 friend std :: ostream &operator<< ( std :: ostream &os, const BasicBlock &b )
    \n+
    104 {
    \n+
    105 return os << "block " << b.identifier << " (line " << b.pos << ")";
    \n+
    106 }
    \n+
    \n+
    107
    \n+
    108 };
    \n+
    \n+
    109
    \n+
    110 } // end namespace dgf
    \n+
    111
    \n+
    112} // end namespace Dune
    \n+
    113
    \n+
    114#endif
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n+
    void makeupcase(std ::string &s)
    Definition basic.hh:24
    \n
    Definition basic.hh:31
    \n+
    void reset()
    Definition basic.hh:51
    \n+
    bool getnextline()
    Definition basic.cc:93
    \n+
    bool findtoken(std ::string token)
    Definition basic.cc:122
    \n+
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n+
    const std::string & id() const
    Definition basic.hh:97
    \n
    int & noflines()
    Definition basic.hh:87
    \n+
    friend std::ostream & operator<<(std ::ostream &os, const BasicBlock &b)
    Definition basic.hh:103
    \n+
    bool isempty()
    Definition basic.hh:82
    \n+
    bool isactive()
    Definition basic.hh:77
    \n
    int linenumber()
    Definition basic.hh:92
    \n-
    Definition boundaryseg.hh:25
    \n-
    bool ok()
    Definition boundaryseg.hh:48
    \n-
    int get(std ::map< EntityKey, BndParam > &facemap, bool fixedsize, int vtxoffset)
    Definition boundaryseg.cc:34
    \n-
    std::pair< int, BoundaryParameter > BndParam
    Definition boundaryseg.hh:36
    \n-
    DGFEntityKey< unsigned int > EntityKey
    Definition boundaryseg.hh:35
    \n-
    int nofbound()
    Definition boundaryseg.hh:53
    \n-
    Definition entitykey.hh:21
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    std::stringstream line
    Definition basic.hh:47
    \n+
    bool gettokenparam(std ::string token, std ::string &entry)
    Definition basic.cc:103
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,130 +4,173 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-boundaryseg.hh\n+basic.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_BOUNDARYSEGBLOCK_HH\n-6#define DUNE_DGF_BOUNDARYSEGBLOCK_HH\n+5#ifndef DUNE_DGF_BASICBLOCK_HH\n+6#define DUNE_DGF_BASICBLOCK_HH\n 7\n 8#include \n-9#include \n-10#include \n-11#include \n-12#include \n+9#include \n+10#include \n+11#include \n+12#include \n 13\n-14#include \n-15#include \n-16\n+14#include \n+15#include \n+16#include \n 17\n 18namespace Dune\n 19{\n 20\n 21 namespace dgf\n 22 {\n-23 class BoundarySegBlock\n-24 : public BasicBlock\n+23\n+24 inline void makeupcase( std :: string &s )\n 25 {\n-26 int dimworld; // the dimension of the vertices (is given from user)\n-27 bool goodline; // active line describes a vertex\n-28 std :: vector< unsigned int > p; // active vertex\n-29 int bndid;\n-30 typedef DGFBoundaryParameter::type BoundaryParameter;\n-31 BoundaryParameter parameter;\n-32 bool simplexgrid;\n-33\n-34 public:\n-35 typedef DGFEntityKey<_unsigned_int> EntityKey;\n-36 typedef std::pair < int, BoundaryParameter > BndParam;\n-37\n-38 // initialize vertex block and get first vertex\n-39 BoundarySegBlock ( std :: istream &in, int pnofvtx,\n-40 int pdimworld, bool psimplexgrid );\n-41\n-42 // some information\n-43 int get( std :: map< EntityKey, BndParam > & facemap,\n-44 bool fixedsize,\n-45 int vtxoffset\n-46 );\n-47\n-48 bool ok()\n-49 {\n-50 return goodline;\n-51 }\n-52\n-53 int nofbound()\n-54 {\n-55 return noflines();\n+26 for (size_t i=0; i=0);\n-66 assert(0<=i && i\n+63 bool getnextentry( ENTRY &entry )\n+64 {\n+65 line >> entry;\n+66 return static_cast< bool >( line );\n+67 }\n+68\n+69 bool gettokenparam ( std :: string token, std :: string &entry );\n+70 bool findtoken( std :: string token );\n+71\n+72 public:\n+73 // search for block in file and store in buffer\n+74 BasicBlock ( std::istream &in, const char* id );\n+75\n+76 // some information on this block\n+77 bool isactive ()\n+78 {\n+79 return active;\n+80 }\n+81\n+82 bool isempty ()\n+83 {\n+84 return empty;\n+85 }\n+86\n+87 int &noflines ()\n+88 {\n+89 return linecount;\n+90 }\n+91\n+92 int linenumber ()\n+93 {\n+94 return pos;\n+95 }\n+96\n+97 const std::string & id () const\n+98 {\n+99 return identifier;\n+100 }\n+101\n+102 // for error messages\n+103 friend std :: ostream &operator<<_( std :: ostream &os, const BasicBlock &b\n+)\n+104 {\n+105 return os << \"block \" << b.identifier << \" (line \" << b.pos << \")\";\n+106 }\n+107\n+108 };\n+109\n+110 } // end namespace dgf\n+111\n+112} // end namespace Dune\n+113\n+114#endif\n+dgfexception.hh\n+entitykey.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n+Dune::dgf::makeupcase\n+void makeupcase(std ::string &s)\n+Definition basic.hh:24\n Dune::dgf::BasicBlock\n Definition basic.hh:31\n+Dune::dgf::BasicBlock::reset\n+void reset()\n+Definition basic.hh:51\n+Dune::dgf::BasicBlock::getnextline\n+bool getnextline()\n+Definition basic.cc:93\n+Dune::dgf::BasicBlock::findtoken\n+bool findtoken(std ::string token)\n+Definition basic.cc:122\n+Dune::dgf::BasicBlock::getnextentry\n+bool getnextentry(ENTRY &entry)\n+Definition basic.hh:63\n+Dune::dgf::BasicBlock::id\n+const std::string & id() const\n+Definition basic.hh:97\n Dune::dgf::BasicBlock::noflines\n int & noflines()\n Definition basic.hh:87\n+Dune::dgf::BasicBlock::operator<<\n+friend std::ostream & operator<<(std ::ostream &os, const BasicBlock &b)\n+Definition basic.hh:103\n+Dune::dgf::BasicBlock::isempty\n+bool isempty()\n+Definition basic.hh:82\n+Dune::dgf::BasicBlock::isactive\n+bool isactive()\n+Definition basic.hh:77\n Dune::dgf::BasicBlock::linenumber\n int linenumber()\n Definition basic.hh:92\n-Dune::dgf::BoundarySegBlock\n-Definition boundaryseg.hh:25\n-Dune::dgf::BoundarySegBlock::ok\n-bool ok()\n-Definition boundaryseg.hh:48\n-Dune::dgf::BoundarySegBlock::get\n-int get(std ::map< EntityKey, BndParam > &facemap, bool fixedsize, int\n-vtxoffset)\n-Definition boundaryseg.cc:34\n-Dune::dgf::BoundarySegBlock::BndParam\n-std::pair< int, BoundaryParameter > BndParam\n-Definition boundaryseg.hh:36\n-Dune::dgf::BoundarySegBlock::EntityKey\n-DGFEntityKey< unsigned int > EntityKey\n-Definition boundaryseg.hh:35\n-Dune::dgf::BoundarySegBlock::nofbound\n-int nofbound()\n-Definition boundaryseg.hh:53\n-Dune::DGFEntityKey\n-Definition entitykey.hh:21\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n+Dune::dgf::BasicBlock::line\n+std::stringstream line\n+Definition basic.hh:47\n+Dune::dgf::BasicBlock::gettokenparam\n+bool gettokenparam(std ::string token, std ::string &entry)\n+Definition basic.cc:103\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00863.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00863.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: basic.hh File Reference\n+dune-grid: vertex.hh File Reference\n \n \n \n \n \n \n \n@@ -71,47 +71,36 @@\n \n
    \n \n
    \n \n-
    basic.hh File Reference
    \n+Namespaces
    \n+
    vertex.hh File Reference
    \n \n
    \n-
    #include <cassert>
    \n-#include <cctype>
    \n-#include <iostream>
    \n-#include <string>
    \n-#include <sstream>
    \n-#include <dune/common/stdstreams.hh>
    \n-#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n+
    #include <iostream>
    \n+#include <vector>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::dgf::BasicBlock
    class  Dune::dgf::VertexBlock
     
    \n \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-\n-\n-\n

    \n-Functions

    void Dune::dgf::makeupcase (std ::string &s)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,32 +4,24 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-Classes | Namespaces | Functions\n-basic.hh File Reference\n-#include \n-#include \n+Classes | Namespaces\n+vertex.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::dgf::BasicBlock\n+class \u00a0 Dune::dgf::VertexBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n-Functions\n-void\u00a0 Dune::dgf::makeupcase (std ::string &s)\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00863_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00863_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: basic.hh Source File\n+dune-grid: vertex.hh Source File\n \n \n \n \n \n \n \n@@ -74,168 +74,89 @@\n \n \n
    \n
    \n-
    basic.hh
    \n+
    vertex.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_BASICBLOCK_HH
    \n-
    6#define DUNE_DGF_BASICBLOCK_HH
    \n+
    5#ifndef DUNE_DGF_VERTEXBLOCK_HH
    \n+
    6#define DUNE_DGF_VERTEXBLOCK_HH
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9#include <cctype>
    \n-
    10#include <iostream>
    \n-
    11#include <string>
    \n-
    12#include <sstream>
    \n-
    13
    \n-
    14#include <dune/common/stdstreams.hh>
    \n-\n-\n-
    17
    \n-
    18namespace Dune
    \n-
    19{
    \n-
    20
    \n-
    21 namespace dgf
    \n-
    22 {
    \n-
    23
    \n-
    \n-
    24 inline void makeupcase( std :: string &s )
    \n-
    25 {
    \n-
    26 for (size_t i=0; i<s.size(); i++)
    \n-
    27 s[i]=std::toupper(s[i]);
    \n-
    28 }
    \n-
    \n-
    29
    \n-
    \n-\n-
    31 {
    \n-
    32 int pos; // line number
    \n-
    33 bool active; // block was found
    \n-
    34 bool empty; // block was found but was empty
    \n-
    35 std::string identifier; // identifier of this block
    \n-
    36 int linecount; // total number of lines in the block
    \n-
    37 std::stringstream block_; // the block itself
    \n-
    38 std::string oneline; // the active line in the block
    \n-
    39
    \n-
    40 // get the block (if it exists)
    \n-
    41 void getblock ( std::istream &in );
    \n-
    42
    \n-
    43 // count the number of lines in the block
    \n-
    44 // int countlines ();
    \n-
    45
    \n-
    46 protected:
    \n-
    47 std::stringstream line; // the active line as string buffer
    \n-
    48 // for use in the derived classes
    \n-
    49
    \n-
    50 // go back to beginning of block
    \n-
    \n-
    51 void reset ()
    \n-
    52 {
    \n-
    53 pos = -1;
    \n-
    54 block_.clear();
    \n-
    55 block_.seekg( 0 );
    \n-
    56 }
    \n-
    \n-
    57
    \n-
    58 // get next line and store in string stream
    \n-
    59 bool getnextline ();
    \n-
    60
    \n-
    61 // get next entry in line
    \n-
    62 template< class ENTRY >
    \n-
    \n-
    63 bool getnextentry( ENTRY &entry )
    \n-
    64 {
    \n-
    65 line >> entry;
    \n-
    66 return static_cast< bool >( line );
    \n-
    67 }
    \n-
    \n-
    68
    \n-
    69 bool gettokenparam ( std :: string token, std :: string &entry );
    \n-
    70 bool findtoken( std :: string token );
    \n-
    71
    \n-
    72 public:
    \n-
    73 // search for block in file and store in buffer
    \n-
    74 BasicBlock ( std::istream &in, const char* id );
    \n-
    75
    \n-
    76 // some information on this block
    \n-
    \n-
    77 bool isactive ()
    \n-
    78 {
    \n-
    79 return active;
    \n-
    80 }
    \n-
    \n-
    81
    \n-
    \n-
    82 bool isempty ()
    \n-
    83 {
    \n-
    84 return empty;
    \n-
    85 }
    \n-
    \n-
    86
    \n-
    \n-
    87 int &noflines ()
    \n-
    88 {
    \n-
    89 return linecount;
    \n-
    90 }
    \n-
    \n-
    91
    \n-
    \n-\n-
    93 {
    \n-
    94 return pos;
    \n-
    95 }
    \n-
    \n-
    96
    \n-
    \n-
    97 const std::string & id () const
    \n-
    98 {
    \n-
    99 return identifier;
    \n-
    100 }
    \n-
    \n-
    101
    \n-
    102 // for error messages
    \n-
    \n-
    103 friend std :: ostream &operator<< ( std :: ostream &os, const BasicBlock &b )
    \n-
    104 {
    \n-
    105 return os << "block " << b.identifier << " (line " << b.pos << ")";
    \n-
    106 }
    \n-
    \n-
    107
    \n-
    108 };
    \n-
    \n-
    109
    \n-
    110 } // end namespace dgf
    \n-
    111
    \n-
    112} // end namespace Dune
    \n-
    113
    \n-
    114#endif
    \n-\n-\n+
    8#include <iostream>
    \n+
    9#include <vector>
    \n+
    10
    \n+\n+
    12
    \n+
    13namespace Dune
    \n+
    14{
    \n+
    15
    \n+
    16 namespace dgf
    \n+
    17 {
    \n+
    18
    \n+
    \n+\n+
    20 : public BasicBlock
    \n+
    21 {
    \n+
    22 int dimvertex; // the dimension of the vertices (determined from DGF file)
    \n+
    23 int dimworld; // the dimension of the world (either dimvertex or given by user)
    \n+
    24 bool goodline; // active line describes a vertex
    \n+
    25 int vtxoffset;
    \n+
    26 int nofParam;
    \n+
    27
    \n+
    28 public:
    \n+
    29 // initialize vertex block
    \n+
    30 VertexBlock ( std :: istream &in, int &pdimworld );
    \n+
    31
    \n+
    32 int get ( std :: vector< std :: vector< double > > &vtx,
    \n+
    33 std :: vector< std :: vector< double > > &param,
    \n+
    34 int &nofp );
    \n+
    35
    \n+
    36 // some information
    \n+
    \n+
    37 bool ok () const
    \n+
    38 {
    \n+
    39 return goodline;
    \n+
    40 }
    \n+
    \n+
    41
    \n+
    \n+
    42 int offset () const
    \n+
    43 {
    \n+
    44 return vtxoffset;
    \n+
    45 }
    \n+
    \n+
    46
    \n+
    47 private:
    \n+
    48 // get dimworld
    \n+
    49 int getDimWorld ();
    \n+
    50
    \n+
    51 // get next vertex
    \n+
    52 bool next ( std :: vector< double > &point, std :: vector< double > &param );
    \n+
    53 };
    \n+
    \n+
    54
    \n+
    55 } // end namespace dgf
    \n+
    56
    \n+
    57} // end namespace Dune
    \n+
    58
    \n+
    59#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    void makeupcase(std ::string &s)
    Definition basic.hh:24
    \n
    Definition basic.hh:31
    \n-
    void reset()
    Definition basic.hh:51
    \n-
    bool getnextline()
    Definition basic.cc:93
    \n-
    bool findtoken(std ::string token)
    Definition basic.cc:122
    \n-
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n-
    const std::string & id() const
    Definition basic.hh:97
    \n-
    int & noflines()
    Definition basic.hh:87
    \n-
    friend std::ostream & operator<<(std ::ostream &os, const BasicBlock &b)
    Definition basic.hh:103
    \n-
    bool isempty()
    Definition basic.hh:82
    \n-
    bool isactive()
    Definition basic.hh:77
    \n-
    int linenumber()
    Definition basic.hh:92
    \n-
    std::stringstream line
    Definition basic.hh:47
    \n-
    bool gettokenparam(std ::string token, std ::string &entry)
    Definition basic.cc:103
    \n+
    Definition vertex.hh:21
    \n+
    int get(std ::vector< std ::vector< double > > &vtx, std ::vector< std ::vector< double > > &param, int &nofp)
    Definition vertex.cc:62
    \n+
    int offset() const
    Definition vertex.hh:42
    \n+
    bool ok() const
    Definition vertex.hh:37
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,173 +4,91 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-basic.hh\n+vertex.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_BASICBLOCK_HH\n-6#define DUNE_DGF_BASICBLOCK_HH\n+5#ifndef DUNE_DGF_VERTEXBLOCK_HH\n+6#define DUNE_DGF_VERTEXBLOCK_HH\n 7\n-8#include \n-9#include \n-10#include \n-11#include \n-12#include \n-13\n-14#include \n-15#include \n-16#include \n-17\n-18namespace Dune\n-19{\n-20\n-21 namespace dgf\n-22 {\n-23\n-24 inline void makeupcase( std :: string &s )\n-25 {\n-26 for (size_t i=0; i\n-63 bool getnextentry( ENTRY &entry )\n-64 {\n-65 line >> entry;\n-66 return static_cast< bool >( line );\n-67 }\n-68\n-69 bool gettokenparam ( std :: string token, std :: string &entry );\n-70 bool findtoken( std :: string token );\n-71\n-72 public:\n-73 // search for block in file and store in buffer\n-74 BasicBlock ( std::istream &in, const char* id );\n-75\n-76 // some information on this block\n-77 bool isactive ()\n-78 {\n-79 return active;\n-80 }\n-81\n-82 bool isempty ()\n-83 {\n-84 return empty;\n-85 }\n-86\n-87 int &noflines ()\n-88 {\n-89 return linecount;\n-90 }\n-91\n-92 int linenumber ()\n-93 {\n-94 return pos;\n-95 }\n-96\n-97 const std::string & id () const\n-98 {\n-99 return identifier;\n-100 }\n-101\n-102 // for error messages\n-103 friend std :: ostream &operator<<_( std :: ostream &os, const BasicBlock &b\n-)\n-104 {\n-105 return os << \"block \" << b.identifier << \" (line \" << b.pos << \")\";\n-106 }\n-107\n-108 };\n-109\n-110 } // end namespace dgf\n-111\n-112} // end namespace Dune\n-113\n-114#endif\n-entitykey.hh\n-dgfexception.hh\n+8#include \n+9#include \n+10\n+11#include \n+12\n+13namespace Dune\n+14{\n+15\n+16 namespace dgf\n+17 {\n+18\n+19 class VertexBlock\n+20 : public BasicBlock\n+21 {\n+22 int dimvertex; // the dimension of the vertices (determined from DGF file)\n+23 int dimworld; // the dimension of the world (either dimvertex or given by\n+user)\n+24 bool goodline; // active line describes a vertex\n+25 int vtxoffset;\n+26 int nofParam;\n+27\n+28 public:\n+29 // initialize vertex block\n+30 VertexBlock ( std :: istream &in, int &pdimworld );\n+31\n+32 int get ( std :: vector< std :: vector< double > > &vtx,\n+33 std :: vector< std :: vector< double > > ¶m,\n+34 int &nofp );\n+35\n+36 // some information\n+37 bool ok () const\n+38 {\n+39 return goodline;\n+40 }\n+41\n+42 int offset () const\n+43 {\n+44 return vtxoffset;\n+45 }\n+46\n+47 private:\n+48 // get dimworld\n+49 int getDimWorld ();\n+50\n+51 // get next vertex\n+52 bool next ( std :: vector< double > &point, std :: vector< double > ¶m\n+);\n+53 };\n+54\n+55 } // end namespace dgf\n+56\n+57} // end namespace Dune\n+58\n+59#endif\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::makeupcase\n-void makeupcase(std ::string &s)\n-Definition basic.hh:24\n Dune::dgf::BasicBlock\n Definition basic.hh:31\n-Dune::dgf::BasicBlock::reset\n-void reset()\n-Definition basic.hh:51\n-Dune::dgf::BasicBlock::getnextline\n-bool getnextline()\n-Definition basic.cc:93\n-Dune::dgf::BasicBlock::findtoken\n-bool findtoken(std ::string token)\n-Definition basic.cc:122\n-Dune::dgf::BasicBlock::getnextentry\n-bool getnextentry(ENTRY &entry)\n-Definition basic.hh:63\n-Dune::dgf::BasicBlock::id\n-const std::string & id() const\n-Definition basic.hh:97\n-Dune::dgf::BasicBlock::noflines\n-int & noflines()\n-Definition basic.hh:87\n-Dune::dgf::BasicBlock::operator<<\n-friend std::ostream & operator<<(std ::ostream &os, const BasicBlock &b)\n-Definition basic.hh:103\n-Dune::dgf::BasicBlock::isempty\n-bool isempty()\n-Definition basic.hh:82\n-Dune::dgf::BasicBlock::isactive\n-bool isactive()\n-Definition basic.hh:77\n-Dune::dgf::BasicBlock::linenumber\n-int linenumber()\n-Definition basic.hh:92\n-Dune::dgf::BasicBlock::line\n-std::stringstream line\n-Definition basic.hh:47\n-Dune::dgf::BasicBlock::gettokenparam\n-bool gettokenparam(std ::string token, std ::string &entry)\n-Definition basic.cc:103\n+Dune::dgf::VertexBlock\n+Definition vertex.hh:21\n+Dune::dgf::VertexBlock::get\n+int get(std ::vector< std ::vector< double > > &vtx, std ::vector< std ::\n+vector< double > > ¶m, int &nofp)\n+Definition vertex.cc:62\n+Dune::dgf::VertexBlock::offset\n+int offset() const\n+Definition vertex.hh:42\n+Dune::dgf::VertexBlock::ok\n+bool ok() const\n+Definition vertex.hh:37\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00866.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00866.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vertex.cc File Reference\n+dune-grid: gridparameter.hh File Reference\n \n \n \n \n \n \n \n@@ -70,20 +70,31 @@\n \n \n
    \n \n-
    vertex.cc File Reference
    \n+
    gridparameter.hh File Reference
    \n
    \n
    \n-\n+
    #include <iostream>
    \n+#include <string>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::dgf::GridParameterBlock
     Common Grid parameters. More...
     
    \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,17 +4,24 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-Namespaces\n-vertex.cc File Reference\n-#include \n+Classes | Namespaces\n+gridparameter.hh File Reference\n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::dgf::GridParameterBlock\n+\u00a0 Common Grid parameters. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00869.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00869.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfidentitygrid.hh File Reference\n+dune-grid: gridparameter.cc File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,32 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgfidentitygrid.hh File Reference
    \n+
    gridparameter.cc File Reference
    \n
    \n
    \n-
    #include <dune/common/typetraits.hh>
    \n-#include <dune/grid/identitygrid.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfparser.hh>
    \n-#include <dune/grid/utility/hostgridaccess.hh>
    \n-
    \n-

    Go to the source code of this file.

    \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-\n-\n-\n-\n-\n-

    \n-Classes

    struct  Dune::DGFGridFactory< IdentityGrid< HostGrid > >
     
    struct  Dune::DGFGridInfo< IdentityGrid< HostGrid > >
     
    \n+
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,25 +3,19 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Classes | Namespaces\n-dgfidentitygrid.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-struct \u00a0 Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>\n-\u00a0\n-struct \u00a0 Dune::DGFGridInfo<_IdentityGrid<_HostGrid_>_>\n-\u00a0\n+ * blocks\n+Namespaces\n+gridparameter.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00872.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00872.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfwriter.hh File Reference\n+dune-grid: projection.cc File Reference\n \n \n \n \n \n \n \n@@ -65,59 +65,76 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgfwriter.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    projection.cc File Reference
    \n \n
    \n-\n-

    write a GridView to a DGF file \n-More...

    \n-
    #include <cassert>
    \n-#include <cstddef>
    \n-#include <algorithm>
    \n-#include <fstream>
    \n-#include <string>
    \n-#include <type_traits>
    \n-#include <utility>
    \n-#include <vector>
    \n-#include <dune/common/rangeutilities.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/grid.hh>
    \n-#include <dune/grid/common/rangegenerators.hh>
    \n-
    \n-

    Go to the source code of this file.

    \n-\n+
    #include <dune/common/math.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/projection.hh>
    \n+
    \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\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::DGFWriter< GV >
     write a GridView to a DGF file More...
    struct  Dune::dgf::Expr::ConstantExpression
     
    struct  Dune::dgf::Expr::VariableExpression
     
    struct  Dune::dgf::Expr::FunctionCallExpression
     
    struct  Dune::dgf::Expr::VectorExpression
     
    struct  Dune::dgf::Expr::BracketExpression
     
    struct  Dune::dgf::Expr::MinusExpression
     
    struct  Dune::dgf::Expr::NormExpression
     
    struct  Dune::dgf::Expr::SqrtExpression
     
    struct  Dune::dgf::Expr::SinExpression
     
    struct  Dune::dgf::Expr::CosExpression
     
    struct  Dune::dgf::Expr::PowerExpression
     
    struct  Dune::dgf::Expr::SumExpression
     
    struct  Dune::dgf::Expr::DifferenceExpression
     
    struct  Dune::dgf::Expr::ProductExpression
     
    struct  Dune::dgf::Expr::QuotientExpression
     
    \n \n \n \n \n+\n+\n+\n+\n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    namespace  Dune::dgf::Expr
     
    \n+\n+\n+\n

    \n+Functions

    std::ostream & Dune::dgf::operator<< (std::ostream &out, const ProjectionBlock::Token &token)
     
    \n-

    Detailed Description

    \n-

    write a GridView to a DGF file

    \n-
    Author
    Martin Nolte
    \n-
    \n+\n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,39 +3,57 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Classes | Namespaces\n-dgfwriter.hh File Reference\n-write a GridView to a DGF file 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-Go_to_the_source_code_of_this_file.\n+ * blocks\n+Classes | Namespaces | Functions\n+projection.cc File Reference\n+#include \n+#include \n Classes\n-class \u00a0 Dune::DGFWriter<_GV_>\n-\u00a0 write a GridView to a DGF file More...\n+struct \u00a0 Dune::dgf::Expr::ConstantExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::VariableExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::FunctionCallExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::VectorExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::BracketExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::MinusExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::NormExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::SqrtExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::SinExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::CosExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::PowerExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::SumExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::DifferenceExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::ProductExpression\n+\u00a0\n+struct \u00a0 Dune::dgf::Expr::QuotientExpression\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-write a GridView to a DGF file\n- Author\n- Martin Nolte\n+namespace \u00a0 Dune::dgf\n+\u00a0\n+namespace \u00a0 Dune::dgf::Expr\n+\u00a0\n+Functions\n+std::ostream &\u00a0 Dune::dgf::operator<< (std::ostream &out, const\n+ ProjectionBlock::Token &token)\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00875.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00875.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gmsh2dgf.cc File Reference\n+dune-grid: dim.hh File Reference\n \n \n \n \n \n \n \n@@ -65,70 +65,42 @@\n \n \n \n \n \n \n \n
    \n \n-
    gmsh2dgf.cc File Reference
    \n+Classes |\n+Namespaces
    \n+
    dim.hh File Reference
    \n \n
    \n-\n-

    a small program converting a gmsh file into a DGF file \n-More...

    \n
    #include <iostream>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/grid/io/file/gmshreader.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfwriter.hh>
    \n-
    \n-\n-\n-\n-

    \n-Functions

    int main (int argc, char *argv[])
     
    \n-

    Detailed Description

    \n-

    a small program converting a gmsh file into a DGF file

    \n-
    Author
    Matrin Nolte
    \n-

    gmsh2dgf is a small example program for the DGFWriter. It reads a gmsh file into any grid (selected by gridtype.hh) and writes it back as a DGF file.

    \n-

    The program's usage is as follows:

    ./gmsh2dgf <gmshfile>
    \n-

    Function Documentation

    \n-\n-

    ◆ main()

    \n-\n-
    \n-
    \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n-
    int main (int argc,
    char * argv[] 
    )
    \n-
    \n-\n-
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::dgf::DimBlock
     
    \n+\n+\n+\n+\n+\n+\n+

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,33 +3,24 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n- * utils\n-Functions\n-gmsh2dgf.cc File Reference\n-a small program converting a gmsh file into a DGF file More...\n+ * blocks\n+Classes | Namespaces\n+dim.hh File Reference\n #include \n-#include \n-#include \n-#include \n-Functions\n-int\u00a0 main (int argc, char *argv[])\n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::dgf::DimBlock\n+\u00a0\n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n+namespace \u00a0 Dune::dgf\n \u00a0\n-***** Detailed Description *****\n-a small program converting a gmsh file into a DGF file\n- Author\n- Matrin Nolte\n-gmsh2dgf is a small example program for the DGFWriter. It reads a gmsh file\n-into any grid (selected by gridtype.hh) and writes it back as a DGF file.\n-The program's usage is as follows:\n-./gmsh2dgf \n-***** Function Documentation *****\n-***** \u25c6\u00a0main() *****\n-int main ( int\u00a0 argc,\n- char *\u00a0 argv[]\u00a0\n- )\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00878.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00878.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgf2dgf.cc File Reference\n+dune-grid: vertex.cc File Reference\n \n \n \n \n \n \n \n@@ -65,74 +65,33 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgf2dgf.cc File Reference
    \n+Namespaces
    \n+
    vertex.cc File Reference
    \n \n
    \n-\n-

    a small program converting a DGF file into a DGF file \n-More...

    \n-
    #include <iostream>
    \n-#include <dune/grid/io/file/dgfparser/dgfwriter.hh>
    \n+\n-\n-\n-\n+\n+\n+\n+\n+\n+\n

    \n-Functions

    int main (int argc, char *argv[])
     

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-

    Detailed Description

    \n-

    a small program converting a DGF file into a DGF file

    \n-
    Author
    Matrin Nolte
    \n-

    dgf2dgf is a small example program for the DGFWriter. It reads a DGF file into any grid, optionally refining the grid globally. The leaf grid is then written back as a DGF file.

    \n-

    The program's usage is as follows:

    ./dgf2dgf <dgffile> [refinement level]
    \n-

    While the program may seem completely useless, it has the following usages:

      \n-
    • Convert an interval block into a simplex or cube grid (depending on the grid implementation used).
    • \n-
    • Resolve the simplex generator block into a vertex and a simplex block, so that it can be used without triangle or tetgen.
    • \n-
    • Construct a refined macro grid, which is very useful when setting up parallel computations with dune-ALUGrid.
    • \n-
    \n-

    The source code of this program also demonstrates the easy use of the DGF parser and the DGFWriter.

    \n-

    Function Documentation

    \n-\n-

    ◆ main()

    \n-\n-
    \n-
    \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n- \n-
    int main (int argc,
    char * argv[] 
    )
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,41 +3,19 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n- * utils\n-Functions\n-dgf2dgf.cc File Reference\n-a small program converting a DGF file into a DGF file More...\n-#include \n-#include \n-Functions\n-int\u00a0 main (int argc, char *argv[])\n+ * blocks\n+Namespaces\n+vertex.cc File Reference\n+#include \n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n+namespace \u00a0 Dune::dgf\n \u00a0\n-***** Detailed Description *****\n-a small program converting a DGF file into a DGF file\n- Author\n- Matrin Nolte\n-dgf2dgf is a small example program for the DGFWriter. It reads a DGF file into\n-any grid, optionally refining the grid globally. The leaf grid is then written\n-back as a DGF file.\n-The program's usage is as follows:\n-./dgf2dgf [refinement level]\n-While the program may seem completely useless, it has the following usages:\n- * Convert an interval block into a simplex or cube grid (depending on the\n- grid implementation used).\n- * Resolve the simplex generator block into a vertex and a simplex block, so\n- that it can be used without triangle or tetgen.\n- * Construct a refined macro grid, which is very useful when setting up\n- parallel computations with dune-ALUGrid.\n-The source code of this program also demonstrates the easy use of the DGF\n-parser and the DGFWriter.\n-***** Function Documentation *****\n-***** \u25c6\u00a0main() *****\n-int main ( int\u00a0 argc,\n- char *\u00a0 argv[]\u00a0\n- )\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00881.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00881.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfgridfactory.hh File Reference\n+dune-grid: boundarydom.cc File Reference\n \n \n \n \n \n \n \n@@ -65,47 +65,32 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    dgfgridfactory.hh File Reference
    \n+
    boundarydom.cc File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n-#include <string>
    \n-#include <vector>
    \n-#include <map>
    \n-#include <assert.h>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n-#include <dune/grid/io/file/dgfparser/macrogrid.hh>
    \n-#include <dune/grid/io/file/dgfparser/parser.hh>
    \n-#include <dune/grid/common/intersection.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    struct  Dune::DGFGridFactory< G >
     
    \n+
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,29 +3,19 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Classes | Namespaces\n-dgfgridfactory.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-struct \u00a0 Dune::DGFGridFactory<_G_>\n-\u00a0\n+ * blocks\n+Namespaces\n+boundarydom.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00884.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00884.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macrogrid.hh File Reference\n+dune-grid: basic.cc File Reference\n \n \n \n \n \n \n \n@@ -65,40 +65,32 @@\n \n \n \n \n \n \n \n
    \n \n-
    macrogrid.hh File Reference
    \n+
    basic.cc File Reference
    \n
    \n
    \n-
    #include <iostream>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/grid/io/file/dgfparser/parser.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::MacroGrid
     
    \n+
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,22 +3,19 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Classes | Namespaces\n-macrogrid.hh File Reference\n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::MacroGrid\n-\u00a0\n+ * blocks\n+Namespaces\n+basic.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00887.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00887.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfgeogrid.hh File Reference\n+dune-grid: boundaryseg.cc File Reference\n \n \n \n \n \n \n \n@@ -65,54 +65,32 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgfgeogrid.hh File Reference
    \n+
    boundaryseg.cc File Reference
    \n
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,39 +3,19 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Classes | Namespaces\n-dgfgeogrid.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n- class \u00a0 Dune::DGFCoordFunction<_dimD,_dimR_>\n-\u00a0\n-struct \u00a0 Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_false_>\n-\u00a0\n-struct \u00a0 Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_true_>\n-\u00a0\n-struct \u00a0 Dune::DGFCoordFunctionFactory<_HostGrid,_DGFCoordFunction<_dimD,_dimR\n- >,_false_>\n-\u00a0\n-struct \u00a0 Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator\n- >_>\n-\u00a0\n-struct \u00a0 Dune::DGFGridInfo<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>\n- >\n-\u00a0\n+ * blocks\n+Namespaces\n+boundaryseg.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00890.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00890.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entitykey_inline.hh File Reference\n+dune-grid: cube.cc File Reference\n \n \n \n \n \n \n \n@@ -65,34 +65,32 @@\n \n \n \n \n \n \n \n
    \n \n-
    entitykey_inline.hh File Reference
    \n+
    cube.cc File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,19 +3,19 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n+ * blocks\n Namespaces\n-entitykey_inline.hh File Reference\n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n+cube.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00893.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00893.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfyasp.hh File Reference\n+dune-grid: simplex.cc File Reference\n \n \n \n \n \n \n \n@@ -65,47 +65,25 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgfyasp.hh File Reference
    \n+
    simplex.cc File Reference
    \n
    \n
    \n-\n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::dgf::YaspGridParameterBlock
     Grid parameters for YaspGrid. More...
     
    struct  Dune::DGFGridFactory< YaspGrid< dim, EquidistantCoordinates< ctype, dim > > >
     Grid factory for YaspGrid with equidistant coordinates. More...
     
    struct  Dune::DGFGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > >
     Grid factory for YaspGrid with equidistant coordinates. More...
     
    class  Dune::DGFGridFactory< Dune::YaspGrid< dim, Dune::TensorProductCoordinates< ctype, dim > > >
     Placeholder for grid factory for YaspGrid with tensor product coordinates. More...
     
    struct  Dune::DGFGridInfo< YaspGrid< dim, Coordinates > >
     
    \n+
    \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,39 +3,18 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Classes | Namespaces\n-dgfyasp.hh File Reference\n-#include \n-#include \n-#include \"dgfparser.hh\"\n-Go_to_the_source_code_of_this_file.\n-Classes\n- class \u00a0 Dune::dgf::YaspGridParameterBlock\n-\u00a0 Grid parameters for YaspGrid. More...\n-\u00a0\n-struct \u00a0 Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,\n- dim_>_>_>\n-\u00a0 Grid factory for YaspGrid with equidistant coordinates. More...\n-\u00a0\n-struct \u00a0 Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<\n- ctype,_dim_>_>_>\n-\u00a0 Grid factory for YaspGrid with equidistant coordinates. More...\n-\u00a0\n- class \u00a0 Dune::DGFGridFactory<_Dune::YaspGrid<_dim,_Dune::\n- TensorProductCoordinates<_ctype,_dim_>_>_>\n-\u00a0 Placeholder for grid factory for YaspGrid with tensor product\n- coordinates. More...\n-\u00a0\n-struct \u00a0 Dune::DGFGridInfo<_YaspGrid<_dim,_Coordinates_>_>\n-\u00a0\n+ * blocks\n+Namespaces\n+simplex.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00896.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00896.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfexception.hh File Reference\n+dune-grid: simplexgeneration.hh File Reference\n \n \n \n \n \n \n \n@@ -65,39 +65,41 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgfexception.hh File Reference
    \n+
    simplexgeneration.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/exceptions.hh>
    \n+
    #include <iostream>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n \n-\n-\n+\n \n

    \n Classes

    class  Dune::DGFException
     exception class for IO errors in the DGF parser More...
    class  Dune::dgf::SimplexGenerationBlock
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,21 +3,24 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n+ * blocks\n Classes | Namespaces\n-dgfexception.hh File Reference\n-#include \n+simplexgeneration.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::DGFException\n-\u00a0 exception class for IO errors in the DGF parser More...\n+class \u00a0 Dune::dgf::SimplexGenerationBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00896_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00896_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfexception.hh Source File\n+dune-grid: simplexgeneration.hh Source File\n \n \n \n \n \n \n \n@@ -70,44 +70,156 @@\n \n \n \n \n \n \n \n
    \n-
    dgfexception.hh
    \n+
    simplexgeneration.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_DGFEXCEPTION_HH
    \n-
    6#define DUNE_GRID_DGFEXCEPTION_HH
    \n+
    5#ifndef DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH
    \n+
    6#define DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH
    \n
    7
    \n-
    8#include <dune/common/exceptions.hh>
    \n+
    8#include <iostream>
    \n
    9
    \n-
    10namespace Dune
    \n-
    11{
    \n-
    12
    \n-
    \n-\n-
    15 : public IOError
    \n-
    16 {};
    \n-
    \n+\n+
    11
    \n+
    12namespace Dune
    \n+
    13{
    \n+
    14
    \n+
    15 namespace dgf
    \n+
    16 {
    \n
    17
    \n-
    18}
    \n-
    19
    \n-
    20#endif
    \n+
    \n+\n+
    19 : public BasicBlock
    \n+
    20 {
    \n+
    21 double area_;
    \n+
    22 double angle_;
    \n+
    23 bool display_;
    \n+
    24 std::string path_;
    \n+
    25 bool haspath_;
    \n+
    26 std::string filename_;
    \n+
    27 std::string filetype_;
    \n+
    28 std::string parameter_;
    \n+
    29 std::string dumpfilename_;
    \n+
    30 bool hasfile_;
    \n+
    31 int dimension_;
    \n+
    32
    \n+
    33 public:
    \n+
    34 SimplexGenerationBlock ( std :: istream &in );
    \n+
    35
    \n+
    \n+
    36 double maxArea ()
    \n+
    37 {
    \n+
    38 return area_;
    \n+
    39 }
    \n+
    \n+
    40
    \n+
    \n+
    41 double minAngle ()
    \n+
    42 {
    \n+
    43 return angle_;
    \n+
    44 }
    \n+
    \n+
    45
    \n+
    \n+
    46 bool display ()
    \n+
    47 {
    \n+
    48 return display_;
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    \n+
    51 bool haspath ()
    \n+
    52 {
    \n+
    53 return haspath_;
    \n+
    54 }
    \n+
    \n+
    55
    \n+
    \n+
    56 std :: string path ()
    \n+
    57 {
    \n+
    58 return path_;
    \n+
    59 }
    \n+
    \n+
    60
    \n+
    \n+
    61 bool hasfile ()
    \n+
    62 {
    \n+
    63 return hasfile_;
    \n+
    64 }
    \n+
    \n+
    65
    \n+
    \n+
    66 std :: string filename ()
    \n+
    67 {
    \n+
    68 return filename_;
    \n+
    69 }
    \n+
    \n+
    70
    \n+
    \n+
    71 std :: string filetype ()
    \n+
    72 {
    \n+
    73 return filetype_;
    \n+
    74 }
    \n+
    \n+
    75
    \n+
    \n+
    76 int dimension ()
    \n+
    77 {
    \n+
    78 return dimension_;
    \n+
    79 }
    \n+
    \n+
    80
    \n+
    \n+
    81 std :: string parameter ()
    \n+
    82 {
    \n+
    83 return parameter_;
    \n+
    84 }
    \n+
    \n+
    85
    \n+
    \n+
    86 const std::string dumpFileName ( ) const
    \n+
    87 {
    \n+
    88 return dumpfilename_;
    \n+
    89 }
    \n+
    \n+
    90 };
    \n+
    \n+
    91
    \n+
    92 } // end namespace dgf
    \n+
    93
    \n+
    94} // end namespace Dune
    \n+
    95
    \n+
    96#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Definition basic.hh:31
    \n+
    Definition simplexgeneration.hh:20
    \n+
    std::string filename()
    Definition simplexgeneration.hh:66
    \n+
    double maxArea()
    Definition simplexgeneration.hh:36
    \n+
    bool haspath()
    Definition simplexgeneration.hh:51
    \n+
    std::string parameter()
    Definition simplexgeneration.hh:81
    \n+
    int dimension()
    Definition simplexgeneration.hh:76
    \n+
    std::string path()
    Definition simplexgeneration.hh:56
    \n+
    const std::string dumpFileName() const
    Definition simplexgeneration.hh:86
    \n+
    bool display()
    Definition simplexgeneration.hh:46
    \n+
    double minAngle()
    Definition simplexgeneration.hh:41
    \n+
    bool hasfile()
    Definition simplexgeneration.hh:61
    \n+
    std::string filetype()
    Definition simplexgeneration.hh:71
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,37 +3,150 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-dgfexception.hh\n+ * blocks\n+simplexgeneration.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_DGFEXCEPTION_HH\n-6#define DUNE_GRID_DGFEXCEPTION_HH\n+5#ifndef DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH\n+6#define DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH\n 7\n-8#include \n+8#include \n 9\n-10namespace Dune\n-11{\n-12\n-14 class DGFException\n-15 : public IOError\n-16 {};\n+10#include \n+11\n+12namespace Dune\n+13{\n+14\n+15 namespace dgf\n+16 {\n 17\n-18}\n-19\n-20#endif\n+18 class SimplexGenerationBlock\n+19 : public BasicBlock\n+20 {\n+21 double area_;\n+22 double angle_;\n+23 bool display_;\n+24 std::string path_;\n+25 bool haspath_;\n+26 std::string filename_;\n+27 std::string filetype_;\n+28 std::string parameter_;\n+29 std::string dumpfilename_;\n+30 bool hasfile_;\n+31 int dimension_;\n+32\n+33 public:\n+34 SimplexGenerationBlock ( std :: istream &in );\n+35\n+36 double maxArea ()\n+37 {\n+38 return area_;\n+39 }\n+40\n+41 double minAngle ()\n+42 {\n+43 return angle_;\n+44 }\n+45\n+46 bool display ()\n+47 {\n+48 return display_;\n+49 }\n+50\n+51 bool haspath ()\n+52 {\n+53 return haspath_;\n+54 }\n+55\n+56 std :: string path ()\n+57 {\n+58 return path_;\n+59 }\n+60\n+61 bool hasfile ()\n+62 {\n+63 return hasfile_;\n+64 }\n+65\n+66 std :: string filename ()\n+67 {\n+68 return filename_;\n+69 }\n+70\n+71 std :: string filetype ()\n+72 {\n+73 return filetype_;\n+74 }\n+75\n+76 int dimension ()\n+77 {\n+78 return dimension_;\n+79 }\n+80\n+81 std :: string parameter ()\n+82 {\n+83 return parameter_;\n+84 }\n+85\n+86 const std::string dumpFileName ( ) const\n+87 {\n+88 return dumpfilename_;\n+89 }\n+90 };\n+91\n+92 } // end namespace dgf\n+93\n+94} // end namespace Dune\n+95\n+96#endif\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::SimplexGenerationBlock\n+Definition simplexgeneration.hh:20\n+Dune::dgf::SimplexGenerationBlock::filename\n+std::string filename()\n+Definition simplexgeneration.hh:66\n+Dune::dgf::SimplexGenerationBlock::maxArea\n+double maxArea()\n+Definition simplexgeneration.hh:36\n+Dune::dgf::SimplexGenerationBlock::haspath\n+bool haspath()\n+Definition simplexgeneration.hh:51\n+Dune::dgf::SimplexGenerationBlock::parameter\n+std::string parameter()\n+Definition simplexgeneration.hh:81\n+Dune::dgf::SimplexGenerationBlock::dimension\n+int dimension()\n+Definition simplexgeneration.hh:76\n+Dune::dgf::SimplexGenerationBlock::path\n+std::string path()\n+Definition simplexgeneration.hh:56\n+Dune::dgf::SimplexGenerationBlock::dumpFileName\n+const std::string dumpFileName() const\n+Definition simplexgeneration.hh:86\n+Dune::dgf::SimplexGenerationBlock::display\n+bool display()\n+Definition simplexgeneration.hh:46\n+Dune::dgf::SimplexGenerationBlock::minAngle\n+double minAngle()\n+Definition simplexgeneration.hh:41\n+Dune::dgf::SimplexGenerationBlock::hasfile\n+bool hasfile()\n+Definition simplexgeneration.hh:61\n+Dune::dgf::SimplexGenerationBlock::filetype\n+std::string filetype()\n+Definition simplexgeneration.hh:71\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00899.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00899.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfug.hh File Reference\n+dune-grid: general.hh File Reference\n \n \n \n \n \n \n \n@@ -65,46 +65,33 @@\n \n \n \n \n \n \n \n
    \n \n-
    dgfug.hh File Reference
    \n+
    general.hh File Reference
    \n
    \n
    \n-
    #include <fstream>
    \n-#include <istream>
    \n-#include <string>
    \n+
    #include <iostream>
    \n #include <vector>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune-grid-config.hh>
    \n-#include <dune/grid/common/intersection.hh>
    \n-#include <dune/grid/uggrid.hh>
    \n-#include "dgfparser.hh"
    \n-#include "blocks/gridparameter.hh"
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::dgf::UGGridParameterBlock
     
    struct  Dune::DGFGridInfo< UGGrid< dim > >
     
    struct  Dune::DGFGridFactory< UGGrid< dim > >
    class  Dune::dgf::GeneralBlock
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,35 +3,23 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n+ * blocks\n Classes | Namespaces\n-dgfug.hh File Reference\n-#include \n-#include \n-#include \n+general.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \"dgfparser.hh\"\n-#include \"blocks/gridparameter.hh\"\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::dgf::UGGridParameterBlock\n-\u00a0\n-struct \u00a0 Dune::DGFGridInfo<_UGGrid<_dim_>_>\n-\u00a0\n-struct \u00a0 Dune::DGFGridFactory<_UGGrid<_dim_>_>\n+class \u00a0 Dune::dgf::GeneralBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00899_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00899_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfug.hh Source File\n+dune-grid: general.hh Source File\n \n \n \n \n \n \n \n@@ -70,317 +70,98 @@\n \n \n \n \n \n \n \n
    \n-
    dgfug.hh
    \n+
    general.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH
    \n-
    6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH
    \n+
    5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
    \n+
    6#define DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
    \n
    7
    \n-
    8//- C++ includes
    \n-
    9#include <fstream>
    \n-
    10#include <istream>
    \n-
    11#include <string>
    \n-
    12#include <vector>
    \n+
    8#include <iostream>
    \n+
    9#include <vector>
    \n+
    10
    \n+\n+
    12
    \n
    13
    \n-
    14//- dune-common includes
    \n-
    15#include <dune/common/exceptions.hh>
    \n-
    16#include <dune/common/fvector.hh>
    \n-
    17#include <dune/common/parallel/mpihelper.hh>
    \n-
    18
    \n-
    19//- dune-grid includes
    \n-
    20#include <dune-grid-config.hh> // HAVE_DUNE_UGGRID
    \n-\n-
    22#include <dune/grid/uggrid.hh>
    \n-
    23
    \n-
    24//- local includes
    \n-
    25#include "dgfparser.hh"
    \n-\n-
    27
    \n-
    28
    \n-
    29namespace Dune
    \n-
    30{
    \n-
    31
    \n-
    32 namespace dgf
    \n-
    33 {
    \n-
    34
    \n-
    35 // UGGridParameterBlock
    \n-
    36 // --------------------
    \n-
    37
    \n-
    \n-\n-
    39 : public GridParameterBlock
    \n-
    40 {
    \n-
    42 explicit UGGridParameterBlock ( std::istream &input );
    \n-
    43
    \n-
    45 bool noClosure () const { return noClosure_; }
    \n-
    47 bool noCopy () const { return noCopy_; }
    \n-
    49 size_t heapSize () const { return heapSize_; }
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17 namespace dgf
    \n+
    18 {
    \n+
    19
    \n+
    20 // GeneralBlock
    \n+
    21 // ---------
    \n+
    22
    \n+
    \n+\n+
    24 : public BasicBlock
    \n+
    25 {
    \n+
    26 unsigned int nofvtx;
    \n+
    27 int dimgrid;
    \n+
    28 bool goodline; // active line describes a vertex
    \n+
    29 std :: vector< unsigned int > map; // active vertex
    \n+
    30 int nofparams;
    \n+
    31 int vtxoffset;
    \n+
    32
    \n+
    33 public:
    \n+
    34 GeneralBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
    \n+
    35
    \n+
    36 int get ( std :: vector< std :: vector< unsigned int> > &simplex,
    \n+
    37 std :: vector< std :: vector< double > > &params,
    \n+
    38 int &nofp );
    \n+
    39
    \n+
    40 // some information
    \n+
    \n+
    41 bool ok ()
    \n+
    42 {
    \n+
    43 return goodline;
    \n+
    44 }
    \n+
    \n+
    45
    \n+
    \n+\n+
    47 {
    \n+
    48 return noflines();
    \n+
    49 }
    \n+
    \n
    50
    \n-
    51 protected:
    \n-
    52 bool noClosure_; // no closure for UGGrid
    \n-
    53 bool noCopy_; // no copies for UGGrid
    \n-
    54 size_t heapSize_; // heap size for UGGrid
    \n-
    55 };
    \n+
    51 private:
    \n+
    52 // get the dimension of the grid
    \n+
    53 int getDimGrid ();
    \n+
    54 // get next simplex
    \n+
    55 bool next ( std :: vector< unsigned int > &simplex,
    \n+
    56 std :: vector< double > &param );
    \n+
    57 };
    \n
    \n-
    56
    \n-
    57 } // namespace dgf
    \n
    58
    \n-
    59
    \n+
    59 } // end namespace dgf
    \n
    60
    \n-
    61#if HAVE_DUNE_UGGRID
    \n-
    62 template< int dim >
    \n-
    \n-
    63 struct DGFGridInfo< UGGrid< dim > >
    \n-
    64 {
    \n-
    \n-
    65 static int refineStepsForHalf ()
    \n-
    66 {
    \n-
    67 return 1;
    \n-
    68 }
    \n-
    \n-
    69
    \n-
    \n-
    70 static double refineWeight ()
    \n-
    71 {
    \n-
    72 return -1.;
    \n-
    73 }
    \n-
    \n-
    74 };
    \n-
    \n-
    75
    \n-
    76
    \n-
    77
    \n-
    78 // DGFGridFactory< UGGrid< dim > >
    \n-
    79 // -------------------------------
    \n-
    80
    \n-
    81 template< int dim >
    \n-
    \n-
    82 struct DGFGridFactory< UGGrid< dim > >
    \n-
    83 {
    \n-\n-
    87 static const int dimension = dim;
    \n-
    89 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    90
    \n-
    \n-
    92 explicit DGFGridFactory ( std::istream &input,
    \n-
    93 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    94 : grid_( 0 ),
    \n-
    95 factory_(),
    \n-
    96 dgf_( rank( comm ), size( comm ) )
    \n-
    97 {
    \n-
    98 generate( input );
    \n-
    99 }
    \n-
    \n-
    100
    \n-
    \n-
    102 explicit DGFGridFactory ( const std::string &filename,
    \n-
    103 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    104 : grid_( 0 ),
    \n-
    105 factory_(),
    \n-
    106 dgf_( rank( comm ), size( comm ) )
    \n-
    107 {
    \n-
    108 std::ifstream input( filename.c_str() );
    \n-
    109 if ( !input )
    \n-
    110 DUNE_THROW( DGFException, "Error: Macrofile " << filename << " not found" );
    \n-
    111 generate( input );
    \n-
    112 }
    \n-
    \n-
    113
    \n-
    \n-\n-
    116 {
    \n-
    117 return grid_;
    \n-
    118 }
    \n-
    \n-
    119
    \n-
    121 template< class GG, class II >
    \n-
    \n-
    122 bool wasInserted ( const Dune::Intersection< GG, II > &intersection ) const
    \n-
    123 {
    \n-
    124 return factory_.wasInserted( intersection );
    \n-
    125 }
    \n-
    \n-
    126
    \n-
    128 template< class GG, class II >
    \n-
    \n-
    129 int boundaryId ( const Dune::Intersection< GG, II > &intersection ) const
    \n-
    130 {
    \n-
    131 return intersection.boundarySegmentIndex();
    \n-
    132 }
    \n-
    \n-
    133
    \n-
    135 template< int codim >
    \n-
    \n-
    136 int numParameters () const
    \n-
    137 {
    \n-
    138 if( codim == 0 )
    \n-
    139 return dgf_.nofelparams;
    \n-
    140 else if( codim == dimension )
    \n-
    141 return dgf_.nofvtxparams;
    \n-
    142 else
    \n-
    143 return 0;
    \n-
    144 }
    \n-
    \n-
    145
    \n-
    147 template< class Entity >
    \n-
    \n-
    148 int numParameters ( const Entity & ) const
    \n-
    149 {
    \n-
    150 return numParameters< Entity::codimension >();
    \n-
    151 }
    \n-
    \n-
    152
    \n-
    \n-
    154 std::vector< double > &parameter ( const typename Grid::template Codim< 0 >::Entity &element )
    \n-
    155 {
    \n-
    156 if( numParameters< 0 >() <= 0 )
    \n-
    157 {
    \n-
    158 DUNE_THROW( InvalidStateException,
    \n-
    159 "Calling DGFGridFactory::parameter is only allowed if there are parameters." );
    \n-
    160 }
    \n-
    161 return dgf_.elParams[ factory_.insertionIndex( element ) ];
    \n-
    162 }
    \n-
    \n-
    163
    \n-
    \n-
    165 std::vector< double > &parameter ( const typename Grid::template Codim< dimension >::Entity &vertex )
    \n-
    166 {
    \n-
    167 if( numParameters< dimension >() <= 0 )
    \n-
    168 {
    \n-
    169 DUNE_THROW( InvalidStateException,
    \n-
    170 "Calling DGFGridFactory::parameter is only allowed if there are parameters." );
    \n-
    171 }
    \n-
    172 return dgf_.vtxParams[ factory_.insertionIndex( vertex ) ];
    \n-
    173 }
    \n-
    \n-
    174
    \n-
    \n-\n-
    177 {
    \n-
    178 return dgf_.haveBndParameters;
    \n-
    179 }
    \n-
    \n-
    180
    \n-
    182 template< class GG, class II >
    \n-
    \n-\n-
    184 {
    \n-\n-
    186 typename Intersection::Entity entity = intersection.inside();
    \n-
    187 const int face = intersection.indexInInside();
    \n-
    188
    \n-
    189 auto refElem = referenceElement< double, dimension >( entity.type() );
    \n-
    190 int corners = refElem.size( face, 1, dimension );
    \n-
    191 std::vector< unsigned int > bound( corners );
    \n-
    192 for( int i = 0; i < corners; ++i )
    \n-
    193 {
    \n-
    194 const int k = refElem.subEntity( face, 1, i, dimension );
    \n-
    195 bound[ i ] = factory_.insertionIndex( entity.template subEntity< dimension >( k ) );
    \n-
    196 }
    \n-
    197
    \n-
    198 DuneGridFormatParser::facemap_t::key_type key( bound, false );
    \n-
    199 const DuneGridFormatParser::facemap_t::const_iterator pos = dgf_.facemap.find( key );
    \n-
    200 if( pos != dgf_.facemap.end() )
    \n-
    201 return dgf_.facemap.find( key )->second.second;
    \n-
    202 else
    \n-\n-
    204 }
    \n-
    \n-
    205
    \n-
    206 private:
    \n-
    207 // create grid
    \n-
    208 void generate ( std::istream &input );
    \n-
    209
    \n-
    210 // return rank
    \n-
    211 static int rank( MPICommunicatorType MPICOMM )
    \n-
    212 {
    \n-
    213 int rank = 0;
    \n-
    214#if HAVE_MPI
    \n-
    215 MPI_Comm_rank( MPICOMM, &rank );
    \n-
    216#endif
    \n-
    217 return rank;
    \n-
    218 }
    \n-
    219
    \n-
    220 // return size
    \n-
    221 static int size( MPICommunicatorType MPICOMM )
    \n-
    222 {
    \n-
    223 int size = 1;
    \n-
    224#if HAVE_MPI
    \n-
    225 MPI_Comm_size( MPICOMM, &size );
    \n-
    226#endif
    \n-
    227 return size;
    \n-
    228 }
    \n-
    229
    \n-
    230 Grid *grid_;
    \n-
    231 GridFactory< UGGrid< dim > > factory_;
    \n-
    232 DuneGridFormatParser dgf_;
    \n-
    233 };
    \n-
    \n-
    234#endif // #if HAVE_DUNE_UGGRID
    \n-
    235
    \n-
    236} // namespace Dune
    \n-
    237
    \n-
    238#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH
    \n-\n-
    The UGGrid class.
    \n+
    61} // end namespace Dune
    \n+
    62
    \n+
    63#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n-
    G Grid
    Definition dgfgridfactory.hh:39
    \n-
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n-
    size_t boundarySegmentIndex() const
    index of the boundary segment within the macro grid
    Definition common/intersection.hh:236
    \n-
    Entity inside() const
    return Entity on the inside of this intersection. That is the Entity where we started this.
    Definition common/intersection.hh:250
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Type of entity that this Intersection belongs to.
    Definition common/intersection.hh:192
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-
    Common Grid parameters.
    Definition gridparameter.hh:35
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n-
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n-
    Definition dgfug.hh:40
    \n-
    size_t heapSize() const
    returns heap size used on construction of the grid
    Definition dgfug.hh:49
    \n-
    bool noCopy_
    Definition dgfug.hh:53
    \n-
    size_t heapSize_
    Definition dgfug.hh:54
    \n-
    bool noClosure_
    Definition dgfug.hh:52
    \n-
    bool noCopy() const
    returns true if no copies are made for UGGrid elements
    Definition dgfug.hh:47
    \n-
    bool noClosure() const
    returns true if no closure should be used for UGGrid
    Definition dgfug.hh:45
    \n-
    static double refineWeight()
    Definition dgfug.hh:70
    \n-
    static int refineStepsForHalf()
    Definition dgfug.hh:65
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
    return invalid value
    Definition dgfug.hh:183
    \n-
    std::vector< double > & parameter(const typename Grid::template Codim< dimension >::Entity &vertex)
    return parameter for vertex
    Definition dgfug.hh:165
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking filename
    Definition dgfug.hh:102
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    MPI communicator type.
    Definition dgfug.hh:89
    \n-
    int numParameters(const Entity &) const
    return number of parameters
    Definition dgfug.hh:148
    \n-
    int boundaryId(const Dune::Intersection< GG, II > &intersection) const
    will return boundary segment index
    Definition dgfug.hh:129
    \n-
    UGGrid< dim > Grid
    grid type
    Definition dgfug.hh:85
    \n-
    bool wasInserted(const Dune::Intersection< GG, II > &intersection) const
    please doc me
    Definition dgfug.hh:122
    \n-
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking istream
    Definition dgfug.hh:92
    \n-
    int numParameters() const
    return number of parameters
    Definition dgfug.hh:136
    \n-
    bool haveBoundaryParameters() const
    UGGrid does not support boundary parameters.
    Definition dgfug.hh:176
    \n-
    std::vector< double > & parameter(const typename Grid::template Codim< 0 >::Entity &element)
    return parameter for codim 0 entity
    Definition dgfug.hh:154
    \n-
    Grid * grid()
    return grid
    Definition dgfug.hh:115
    \n-
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-
    Front-end for the grid manager of the finite element toolbox UG3.
    Definition uggrid.hh:208
    \n-\n-\n+
    Definition basic.hh:31
    \n+
    int & noflines()
    Definition basic.hh:87
    \n+
    Definition general.hh:25
    \n+
    int nofsimplex()
    Definition general.hh:46
    \n+
    int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector< std ::vector< double > > &params, int &nofp)
    Definition general.cc:100
    \n+
    bool ok()
    Definition general.hh:41
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,393 +3,98 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-dgfug.hh\n+ * blocks\n+general.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH\n-6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH\n+5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH\n+6#define DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH\n 7\n-8//- C++ includes\n-9#include \n-10#include \n-11#include \n-12#include \n+8#include \n+9#include \n+10\n+11#include \n+12\n 13\n-14//- dune-common includes\n-15#include \n-16#include \n-17#include \n-18\n-19//- dune-grid includes\n-20#include // HAVE_DUNE_UGGRID\n-21#include \n-22#include \n-23\n-24//- local includes\n-25#include \"dgfparser.hh\"\n-26#include \"blocks/gridparameter.hh\"\n-27\n-28\n-29namespace Dune\n-30{\n-31\n-32 namespace dgf\n-33 {\n-34\n-35 // UGGridParameterBlock\n-36 // --------------------\n-37\n-38 struct UGGridParameterBlock\n-39 : public GridParameterBlock\n-40 {\n-42 explicit UGGridParameterBlock ( std::istream &input );\n-43\n-45 bool noClosure () const { return noClosure_; }\n-47 bool noCopy () const { return noCopy_; }\n-49 size_t heapSize () const { return heapSize_; }\n+14namespace Dune\n+15{\n+16\n+17 namespace dgf\n+18 {\n+19\n+20 // GeneralBlock\n+21 // ---------\n+22\n+23 class GeneralBlock\n+24 : public BasicBlock\n+25 {\n+26 unsigned int nofvtx;\n+27 int dimgrid;\n+28 bool goodline; // active line describes a vertex\n+29 std :: vector< unsigned int > map; // active vertex\n+30 int nofparams;\n+31 int vtxoffset;\n+32\n+33 public:\n+34 GeneralBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int\n+&pdimgrid );\n+35\n+36 int get ( std :: vector< std :: vector< unsigned int> > &simplex,\n+37 std :: vector< std :: vector< double > > ¶ms,\n+38 int &nofp );\n+39\n+40 // some information\n+41 bool ok ()\n+42 {\n+43 return goodline;\n+44 }\n+45\n+46 int nofsimplex ()\n+47 {\n+48 return noflines();\n+49 }\n 50\n-51 protected:\n-52 bool noClosure_; // no closure for UGGrid\n-53 bool noCopy_; // no copies for UGGrid\n-54 size_t heapSize_; // heap size for UGGrid\n-55 };\n-56\n-57 } // namespace dgf\n+51 private:\n+52 // get the dimension of the grid\n+53 int getDimGrid ();\n+54 // get next simplex\n+55 bool next ( std :: vector< unsigned int > &simplex,\n+56 std :: vector< double > ¶m );\n+57 };\n 58\n-59\n+59 } // end namespace dgf\n 60\n-61#if HAVE_DUNE_UGGRID\n-62 template< int dim >\n-63 struct DGFGridInfo< UGGrid< dim > >\n-64 {\n-65 static int refineStepsForHalf ()\n-66 {\n-67 return 1;\n-68 }\n-69\n-70 static double refineWeight ()\n-71 {\n-72 return -1.;\n-73 }\n-74 };\n-75\n-76\n-77\n-78 // DGFGridFactory< UGGrid< dim > >\n-79 // -------------------------------\n-80\n-81 template< int dim >\n-82 struct DGFGridFactory< UGGrid< dim > >\n-83 {\n-85 typedef UGGrid<_dim_> Grid;\n-87 static const int dimension = dim;\n-89 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-90\n-92 explicit DGFGridFactory ( std::istream &input,\n-93 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-94 : grid_( 0 ),\n-95 factory_(),\n-96 dgf_( rank( comm ), size( comm ) )\n-97 {\n-98 generate( input );\n-99 }\n-100\n-102 explicit DGFGridFactory ( const std::string &filename,\n-103 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-104 : grid_( 0 ),\n-105 factory_(),\n-106 dgf_( rank( comm ), size( comm ) )\n-107 {\n-108 std::ifstream input( filename.c_str() );\n-109 if ( !input )\n-110 DUNE_THROW( DGFException, \"Error: Macrofile \" << filename << \" not found\"\n-);\n-111 generate( input );\n-112 }\n-113\n-115 Grid *grid ()\n-116 {\n-117 return grid_;\n-118 }\n-119\n-121 template< class GG, class II >\n-122 bool wasInserted ( const Dune::Intersection<_GG,_II_> &intersection ) const\n-123 {\n-124 return factory_.wasInserted( intersection );\n-125 }\n-126\n-128 template< class GG, class II >\n-129 int boundaryId ( const Dune::Intersection<_GG,_II_> &intersection ) const\n-130 {\n-131 return intersection.boundarySegmentIndex();\n-132 }\n-133\n-135 template< int codim >\n-136 int numParameters () const\n-137 {\n-138 if( codim == 0 )\n-139 return dgf_.nofelparams;\n-140 else if( codim == dimension )\n-141 return dgf_.nofvtxparams;\n-142 else\n-143 return 0;\n-144 }\n-145\n-147 template< class Entity >\n-148 int numParameters ( const Entity & ) const\n-149 {\n-150 return numParameters< Entity::codimension >();\n-151 }\n-152\n-154 std::vector< double > ¶meter ( const typename Grid::template Codim< 0\n->::Entity &element )\n-155 {\n-156 if( numParameters< 0 >() <= 0 )\n-157 {\n-158 DUNE_THROW( InvalidStateException,\n-159 \"Calling DGFGridFactory::parameter is only allowed if there are\n-parameters.\" );\n-160 }\n-161 return dgf_.elParams[ factory_.insertionIndex( element ) ];\n-162 }\n-163\n-165 std::vector< double > ¶meter ( const typename Grid::template Codim<\n-dimension >::Entity &vertex )\n-166 {\n-167 if( numParameters< dimension >() <= 0 )\n-168 {\n-169 DUNE_THROW( InvalidStateException,\n-170 \"Calling DGFGridFactory::parameter is only allowed if there are\n-parameters.\" );\n-171 }\n-172 return dgf_.vtxParams[ factory_.insertionIndex( vertex ) ];\n-173 }\n-174\n-176 bool haveBoundaryParameters () const\n-177 {\n-178 return dgf_.haveBndParameters;\n-179 }\n-180\n-182 template< class GG, class II >\n-183 const DGFBoundaryParameter::type &boundaryParameter ( const Dune::\n-Intersection<_GG,_II_> &intersection ) const\n-184 {\n-185 typedef Dune::Intersection<_GG,_II_> Intersection;\n-186 typename Intersection::Entity entity = intersection.inside();\n-187 const int face = intersection.indexInInside();\n-188\n-189 auto refElem = referenceElement< double, dimension >( entity.type() );\n-190 int corners = refElem.size( face, 1, dimension );\n-191 std::vector< unsigned int > bound( corners );\n-192 for( int i = 0; i < corners; ++i )\n-193 {\n-194 const int k = refElem.subEntity( face, 1, i, dimension );\n-195 bound[ i ] = factory_.insertionIndex( entity.template subEntity< dimension\n->( k ) );\n-196 }\n-197\n-198 DuneGridFormatParser::facemap_t::key_type key( bound, false );\n-199 const DuneGridFormatParser::facemap_t::const_iterator pos =\n-dgf_.facemap.find( key );\n-200 if( pos != dgf_.facemap.end() )\n-201 return dgf_.facemap.find( key )->second.second;\n-202 else\n-203 return DGFBoundaryParameter::defaultValue();\n-204 }\n-205\n-206 private:\n-207 // create grid\n-208 void generate ( std::istream &input );\n-209\n-210 // return rank\n-211 static int rank( MPICommunicatorType MPICOMM )\n-212 {\n-213 int rank = 0;\n-214#if HAVE_MPI\n-215 MPI_Comm_rank( MPICOMM, &rank );\n-216#endif\n-217 return rank;\n-218 }\n-219\n-220 // return size\n-221 static int size( MPICommunicatorType MPICOMM )\n-222 {\n-223 int size = 1;\n-224#if HAVE_MPI\n-225 MPI_Comm_size( MPICOMM, &size );\n-226#endif\n-227 return size;\n-228 }\n-229\n-230 Grid *grid_;\n-231 GridFactory< UGGrid< dim > > factory_;\n-232 DuneGridFormatParser dgf_;\n-233 };\n-234#endif // #if HAVE_DUNE_UGGRID\n-235\n-236} // namespace Dune\n-237\n-238#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH\n-gridparameter.hh\n-uggrid.hh\n-The UGGrid class.\n+61} // end namespace Dune\n+62\n+63#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition dgfgridfactory.hh:41\n-Dune::DGFGridFactory::Grid\n-G Grid\n-Definition dgfgridfactory.hh:39\n-Dune::DGFGridFactory::dimension\n-static const int dimension\n-Definition dgfgridfactory.hh:40\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::indexInInside\n-int indexInInside() const\n-Local index of codim 1 entity in the inside() entity where intersection is\n-contained in.\n-Definition common/intersection.hh:346\n-Dune::Intersection::boundarySegmentIndex\n-size_t boundarySegmentIndex() const\n-index of the boundary segment within the macro grid\n-Definition common/intersection.hh:236\n-Dune::Intersection::inside\n-Entity inside() const\n-return Entity on the inside of this intersection. That is the Entity where we\n-started this.\n-Definition common/intersection.hh:250\n-Dune::Intersection::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Type of entity that this Intersection belongs to.\n-Definition common/intersection.hh:192\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-Dune::dgf::GridParameterBlock\n-Common Grid parameters.\n-Definition gridparameter.hh:35\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n-Dune::DGFGridInfo\n-Some simple static information for a given GridType.\n-Definition io/file/dgfparser/dgfparser.hh:56\n-Dune::dgf::UGGridParameterBlock\n-Definition dgfug.hh:40\n-Dune::dgf::UGGridParameterBlock::heapSize\n-size_t heapSize() const\n-returns heap size used on construction of the grid\n-Definition dgfug.hh:49\n-Dune::dgf::UGGridParameterBlock::noCopy_\n-bool noCopy_\n-Definition dgfug.hh:53\n-Dune::dgf::UGGridParameterBlock::heapSize_\n-size_t heapSize_\n-Definition dgfug.hh:54\n-Dune::dgf::UGGridParameterBlock::noClosure_\n-bool noClosure_\n-Definition dgfug.hh:52\n-Dune::dgf::UGGridParameterBlock::noCopy\n-bool noCopy() const\n-returns true if no copies are made for UGGrid elements\n-Definition dgfug.hh:47\n-Dune::dgf::UGGridParameterBlock::noClosure\n-bool noClosure() const\n-returns true if no closure should be used for UGGrid\n-Definition dgfug.hh:45\n-Dune::DGFGridInfo<_UGGrid<_dim_>_>::refineWeight\n-static double refineWeight()\n-Definition dgfug.hh:70\n-Dune::DGFGridInfo<_UGGrid<_dim_>_>::refineStepsForHalf\n-static int refineStepsForHalf()\n-Definition dgfug.hh:65\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection<\n-GG, II > &intersection) const\n-return invalid value\n-Definition dgfug.hh:183\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::parameter\n-std::vector< double > & parameter(const typename Grid::template Codim<\n-dimension >::Entity &vertex)\n-return parameter for vertex\n-Definition dgfug.hh:165\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicatorType\n-comm=MPIHelper::getCommunicator())\n-constructor taking filename\n-Definition dgfug.hh:102\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-MPI communicator type.\n-Definition dgfug.hh:89\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::numParameters\n-int numParameters(const Entity &) const\n-return number of parameters\n-Definition dgfug.hh:148\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::boundaryId\n-int boundaryId(const Dune::Intersection< GG, II > &intersection) const\n-will return boundary segment index\n-Definition dgfug.hh:129\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::Grid\n-UGGrid< dim > Grid\n-grid type\n-Definition dgfug.hh:85\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::wasInserted\n-bool wasInserted(const Dune::Intersection< GG, II > &intersection) const\n-please doc me\n-Definition dgfug.hh:122\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::DGFGridFactory\n-DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n-getCommunicator())\n-constructor taking istream\n-Definition dgfug.hh:92\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::numParameters\n-int numParameters() const\n-return number of parameters\n-Definition dgfug.hh:136\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-UGGrid does not support boundary parameters.\n-Definition dgfug.hh:176\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::parameter\n-std::vector< double > & parameter(const typename Grid::template Codim< 0 >::\n-Entity &element)\n-return parameter for codim 0 entity\n-Definition dgfug.hh:154\n-Dune::DGFGridFactory<_UGGrid<_dim_>_>::grid\n-Grid * grid()\n-return grid\n-Definition dgfug.hh:115\n-Dune::DGFBoundaryParameter::defaultValue\n-static const type & defaultValue()\n-default constructor\n-Definition parser.hh:28\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n-Dune::UGGrid\n-Front-end for the grid manager of the finite element toolbox UG3.\n-Definition uggrid.hh:208\n-dgfparser.hh\n-intersection.hh\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::BasicBlock::noflines\n+int & noflines()\n+Definition basic.hh:87\n+Dune::dgf::GeneralBlock\n+Definition general.hh:25\n+Dune::dgf::GeneralBlock::nofsimplex\n+int nofsimplex()\n+Definition general.hh:46\n+Dune::dgf::GeneralBlock::get\n+int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector<\n+std ::vector< double > > ¶ms, int &nofp)\n+Definition general.cc:100\n+Dune::dgf::GeneralBlock::ok\n+bool ok()\n+Definition general.hh:41\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00902.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00902.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfug.cc File Reference\n+dune-grid: interval.hh File Reference\n \n \n \n \n \n \n \n@@ -65,34 +65,51 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    dgfug.cc File Reference
    \n+Classes |\n+Namespaces |\n+Functions
    \n+
    interval.hh File Reference
    \n \n
    \n-
    #include <dune/geometry/utility/typefromvertexcount.hh>
    \n-#include <dune-grid-config.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfug.hh>
    \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+
    #include <iostream>
    \n+#include <vector>
    \n+#include <array>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+
    \n+

    Go to the source code of this file.

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

    \n+Classes

    struct  Dune::dgf::IntervalBlock
     
    struct  Dune::dgf::IntervalBlock::Interval
     
    \n \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n+\n+\n+\n

    \n+Functions

    std::ostream & Dune::dgf::operator<< (std::ostream &out, const IntervalBlock::Interval &interval)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,20 +3,32 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-Namespaces\n-dgfug.cc File Reference\n-#include \n-#include \n-#include \n+ * blocks\n+Classes | Namespaces | Functions\n+interval.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+Classes\n+struct \u00a0 Dune::dgf::IntervalBlock\n+\u00a0\n+struct \u00a0 Dune::dgf::IntervalBlock::Interval\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n namespace \u00a0 Dune::dgf\n \u00a0\n+Functions\n+std::ostream &\u00a0 Dune::dgf::operator<< (std::ostream &out, const IntervalBlock::\n+ Interval &interval)\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00905.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00905.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfoned.hh File Reference\n+dune-grid: boundaryseg.hh File Reference\n \n \n \n \n \n \n \n@@ -65,48 +65,46 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    dgfoned.hh File Reference
    \n+
    boundaryseg.hh File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <fstream>
    \n+
    #include <cassert>
    \n #include <iostream>
    \n-#include <istream>
    \n+#include <string>
    \n #include <vector>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/grid/common/intersection.hh>
    \n-#include <dune/grid/onedgrid.hh>
    \n-#include "dgfparser.hh"
    \n+#include <map>
    \n+#include <dune/grid/io/file/dgfparser/parser.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::DGFGridInfo< OneDGrid >
     
    struct  Dune::DGFGridFactory< OneDGrid >
    class  Dune::dgf::BoundarySegBlock
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,30 +3,29 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n+ * blocks\n Classes | Namespaces\n-dgfoned.hh File Reference\n-#include \n-#include \n+boundaryseg.hh File Reference\n+#include \n #include \n-#include \n+#include \n #include \n-#include \n-#include \n-#include \n-#include \"dgfparser.hh\"\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::DGFGridInfo<_OneDGrid_>\n-\u00a0\n-struct \u00a0 Dune::DGFGridFactory<_OneDGrid_>\n+class \u00a0 Dune::dgf::BoundarySegBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00905_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00905_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfoned.hh Source File\n+dune-grid: boundaryseg.hh Source File\n \n \n \n \n \n \n \n@@ -70,295 +70,122 @@\n
    \n \n \n \n \n \n \n
    \n-
    dgfoned.hh
    \n+
    boundaryseg.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH
    \n-
    6#define DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH
    \n+
    5#ifndef DUNE_DGF_BOUNDARYSEGBLOCK_HH
    \n+
    6#define DUNE_DGF_BOUNDARYSEGBLOCK_HH
    \n
    7
    \n-
    8//- C++ includes
    \n-
    9#include <algorithm>
    \n-
    10#include <fstream>
    \n-
    11#include <iostream>
    \n-
    12#include <istream>
    \n-
    13#include <vector>
    \n-
    14
    \n-
    15//- dune-common includes
    \n-
    16#include <dune/common/exceptions.hh>
    \n+
    8#include <cassert>
    \n+
    9#include <iostream>
    \n+
    10#include <string>
    \n+
    11#include <vector>
    \n+
    12#include <map>
    \n+
    13
    \n+\n+\n+
    16
    \n
    17
    \n-
    18//- dune-grid includes
    \n-\n-
    20#include <dune/grid/onedgrid.hh>
    \n-
    21
    \n-
    22//- local includes
    \n-
    23#include "dgfparser.hh"
    \n-
    24
    \n-
    25
    \n-
    26namespace
    \n-
    27{
    \n-
    28 // helper method used below
    \n-
    29 double getfirst ( std::vector< double > v )
    \n-
    30 {
    \n-
    31 return v[ 0 ];
    \n-
    32 }
    \n-
    33} // end anonymous namespace
    \n-
    34
    \n-
    35
    \n-
    36
    \n-
    37namespace Dune
    \n-
    38{
    \n-
    39
    \n-
    40 // DGFGridInfo
    \n-
    41 // -----------
    \n-
    42
    \n-
    43 template< >
    \n-
    \n-\n-
    45 {
    \n-
    \n-
    46 static int refineStepsForHalf ()
    \n-
    47 {
    \n-
    48 return 1;
    \n-
    49 }
    \n+
    18namespace Dune
    \n+
    19{
    \n+
    20
    \n+
    21 namespace dgf
    \n+
    22 {
    \n+
    \n+\n+
    24 : public BasicBlock
    \n+
    25 {
    \n+
    26 int dimworld; // the dimension of the vertices (is given from user)
    \n+
    27 bool goodline; // active line describes a vertex
    \n+
    28 std :: vector< unsigned int > p; // active vertex
    \n+
    29 int bndid;
    \n+
    30 typedef DGFBoundaryParameter::type BoundaryParameter;
    \n+
    31 BoundaryParameter parameter;
    \n+
    32 bool simplexgrid;
    \n+
    33
    \n+
    34 public:
    \n+\n+
    36 typedef std::pair < int, BoundaryParameter > BndParam;
    \n+
    37
    \n+
    38 // initialize vertex block and get first vertex
    \n+
    39 BoundarySegBlock ( std :: istream &in, int pnofvtx,
    \n+
    40 int pdimworld, bool psimplexgrid );
    \n+
    41
    \n+
    42 // some information
    \n+
    43 int get( std :: map< EntityKey, BndParam > & facemap,
    \n+
    44 bool fixedsize,
    \n+
    45 int vtxoffset
    \n+
    46 );
    \n+
    47
    \n+
    \n+
    48 bool ok()
    \n+
    49 {
    \n+
    50 return goodline;
    \n+
    51 }
    \n+
    \n+
    52
    \n+
    \n+\n+
    54 {
    \n+
    55 return noflines();
    \n+
    56 }
    \n
    \n-
    50
    \n-
    \n-
    51 static double refineWeight ()
    \n-
    52 {
    \n-
    53 return 0.5;
    \n-
    54 }
    \n-
    \n-
    55 };
    \n-
    \n-
    56
    \n
    57
    \n-
    58
    \n-
    59 // DGFGridFactory< OneDGrid >
    \n-
    60 // --------------------------
    \n-
    61
    \n-
    62 template< >
    \n-
    \n-\n-
    64 {
    \n-
    66 typedef OneDGrid Grid;
    \n-
    68 const static int dimension = Grid::dimension;
    \n-
    70 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    71
    \n-
    \n-
    73 explicit DGFGridFactory ( std::istream &input,
    \n-
    74 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    75 : grid_( 0 ),
    \n-
    76 emptyParameters_( 0 )
    \n-
    77 {
    \n-
    78 generate( input, comm );
    \n-
    79 }
    \n-
    \n+
    58 private:
    \n+
    59 bool next();
    \n+
    60
    \n+
    61 // get coordinates of active vertex
    \n+
    62 int operator[] (int i)
    \n+
    63 {
    \n+
    64 assert(ok());
    \n+
    65 assert(linenumber()>=0);
    \n+
    66 assert(0<=i && i<dimworld+1);
    \n+
    67 return p[i];
    \n+
    68 }
    \n+
    69
    \n+
    70 int size()
    \n+
    71 {
    \n+
    72 return p.size();
    \n+
    73 }
    \n+
    74
    \n+
    75 };
    \n+
    \n+
    76
    \n+
    77 } // end namespace dgf
    \n+
    78
    \n+
    79} // end namespace Dune
    \n
    80
    \n-
    \n-
    82 explicit DGFGridFactory ( const std::string &filename,
    \n-
    83 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    84 : grid_( 0 ),
    \n-
    85 emptyParameters_( 0 )
    \n-
    86 {
    \n-
    87 std::ifstream input( filename.c_str() );
    \n-
    88 generate( input, comm );
    \n-
    89 }
    \n-
    \n-
    90
    \n-
    \n-
    92 Grid *grid () const
    \n-
    93 {
    \n-
    94 return grid_;
    \n-
    95 }
    \n-
    \n-
    96
    \n-
    98 template< class GG, class II >
    \n-
    \n-
    99 bool wasInserted ( const Dune::Intersection< GG, II > &intersection ) const
    \n-
    100 {
    \n-
    101 return false;
    \n-
    102 }
    \n-
    \n-
    103
    \n-
    104 template< class GG, class II >
    \n-
    \n-
    105 int boundaryId ( const Dune::Intersection< GG, II > &intersection ) const
    \n-
    106 {
    \n-
    107 // OneDGrid returns boundary segment index;
    \n-
    108 // we return the index as the method boundaryId is deprecated
    \n-
    109 return intersection.boundarySegmentIndex();
    \n-
    110 }
    \n-
    \n-
    111
    \n-
    113 template< class Entity >
    \n-
    \n-
    114 int numParameters ( const Entity & ) const
    \n-
    115 {
    \n-
    116 return 0;
    \n-
    117 }
    \n-
    \n-
    118
    \n-
    120 template< int codim >
    \n-
    \n-
    121 int numParameters () const
    \n-
    122 {
    \n-
    123 return 0;
    \n-
    124 }
    \n-
    \n-
    125
    \n-
    126 template< class Entity >
    \n-
    \n-
    127 std::vector< double >& parameter ( const Entity &entity )
    \n-
    128 {
    \n-
    129 return parameter< Entity::codimension >( entity );
    \n-
    130 }
    \n-
    \n-
    131
    \n-
    133 template< int codim >
    \n-
    \n-
    134 std::vector< double > &parameter ( [[maybe_unused]] const typename Grid::Codim< codim >::Entity &element )
    \n-
    135 {
    \n-
    136 return emptyParameters_;
    \n-
    137 }
    \n-
    \n-
    138
    \n-
    \n-\n-
    141 {
    \n-
    142 return false;
    \n-
    143 }
    \n-
    \n-
    144
    \n-
    146 template< class GG, class II >
    \n-
    \n-
    147 const DGFBoundaryParameter::type &boundaryParameter ( [[maybe_unused]] const Dune::Intersection< GG, II > &intersection ) const
    \n-
    148 {
    \n-\n-
    150 }
    \n-
    \n-
    151
    \n-
    152 private:
    \n-
    153 // generate grid
    \n-
    154 void generate ( std::istream &input, MPICommunicatorType comm );
    \n-
    155
    \n-
    156 Grid *grid_;
    \n-
    157 std::vector< double > emptyParameters_;
    \n-
    158 };
    \n-
    \n-
    159
    \n-
    160
    \n-
    161
    \n-
    162 // Implementation of DGFGridFactory< OneDGrid >
    \n-
    163 // --------------------------------------------
    \n-
    164
    \n-
    165 inline void DGFGridFactory< OneDGrid >::generate ( std::istream &input, [[maybe_unused]] MPICommunicatorType comm )
    \n-
    166 {
    \n-
    167 // try to open interval block
    \n-
    168 dgf::IntervalBlock intervalBlock( input );
    \n-
    169
    \n-
    170 // try to open vertex block
    \n-
    171 int dimensionworld = Grid::dimensionworld;
    \n-
    172 dgf::VertexBlock vertexBlock( input, dimensionworld );
    \n-
    173
    \n-
    174 // check at least one block is active
    \n-
    175 if( !( vertexBlock.isactive() || intervalBlock.isactive() ))
    \n-
    176 DUNE_THROW( DGFException, "No readable block found" );
    \n-
    177
    \n-
    178 std::vector< std::vector< double > > vertices;
    \n-
    179
    \n-
    180 // read vertices first
    \n-
    181 if( vertexBlock.isactive() )
    \n-
    182 {
    \n-
    183 int nparameter = 0;
    \n-
    184 std::vector< std::vector< double > > parameter;
    \n-
    185 vertexBlock.get( vertices, parameter, nparameter );
    \n-
    186
    \n-
    187 if( nparameter > 0 )
    \n-
    188 std::cerr << "Warning: vertex parameters will be ignored" << std::endl;
    \n-
    189 }
    \n-
    190
    \n-
    191 // get vertices from interval block
    \n-
    192 if ( intervalBlock.isactive() )
    \n-
    193 {
    \n-
    194 if( intervalBlock.dimw() != dimensionworld )
    \n-
    195 {
    \n-
    196 DUNE_THROW( DGFException, "Error: wrong coordinate dimension in interval block \\
    \n-
    197 (got " << intervalBlock.dimw() << ", expected " << dimensionworld << ")" );
    \n-
    198 }
    \n-
    199
    \n-
    200 int nintervals = intervalBlock.numIntervals();
    \n-
    201 for( int i = 0; i < nintervals; ++i )
    \n-
    202 intervalBlock.getVtx( i, vertices );
    \n-
    203 }
    \n-
    204
    \n-
    205 // copy to vector of doubles
    \n-
    206 std::vector< double > vtx( vertices.size() );
    \n-
    207 transform( vertices.begin(), vertices.end(), vtx.begin(), getfirst );
    \n-
    208
    \n-
    209 // remove duplicates
    \n-
    210 std::sort( vtx.begin(), vtx.end() );
    \n-
    211 std::vector< double >::iterator it = std::unique( vtx.begin(), vtx.end() );
    \n-
    212 vtx.erase( it, vtx.end() );
    \n-
    213 if( vertices.size() != vtx.size() )
    \n-
    214 std::cerr << "Warning: removed duplicate vertices" << std::endl;
    \n-
    215
    \n-
    216 // create grid
    \n-
    217 grid_ = new OneDGrid( vtx );
    \n-
    218 }
    \n-
    219
    \n-
    220} // end namespace Dune
    \n-
    221
    \n-
    222#endif // #ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH
    \n-
    The OneDGrid class.
    \n+
    81#endif
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n-
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n-
    std::vector< double > & parameter(const Element &element)
    Definition dgfgridfactory.hh:124
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    size_t boundarySegmentIndex() const
    index of the boundary segment within the macro grid
    Definition common/intersection.hh:236
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n-
    GridFamily::Traits::template Codim< cd >::Entity Entity
    A type that is a model of a Dune::Entity<cd,dim,...>.
    Definition common/grid.hh:419
    \n-
    static double refineWeight()
    Definition dgfoned.hh:51
    \n-
    static int refineStepsForHalf()
    Definition dgfoned.hh:46
    \n-
    OneDGrid Grid
    grid type
    Definition dgfoned.hh:66
    \n-
    std::vector< double > & parameter(const typename Grid::Codim< codim >::Entity &element)
    return empty vector
    Definition dgfoned.hh:134
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    MPI communicator type.
    Definition dgfoned.hh:70
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
    return invalid default value
    Definition dgfoned.hh:147
    \n-
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfoned.hh:127
    \n-
    int boundaryId(const Dune::Intersection< GG, II > &intersection) const
    Definition dgfoned.hh:105
    \n-
    Grid * grid() const
    get grid
    Definition dgfoned.hh:92
    \n-
    bool haveBoundaryParameters() const
    OneDGrid does not support boundary parameters.
    Definition dgfoned.hh:140
    \n-
    int numParameters(const Entity &) const
    OneDGrid does not support parameters, returns 0.
    Definition dgfoned.hh:114
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking filename
    Definition dgfoned.hh:82
    \n-
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking istream
    Definition dgfoned.hh:73
    \n-
    int numParameters() const
    OneDGrid does not support parameters, returns 0.
    Definition dgfoned.hh:121
    \n-
    bool wasInserted(const Dune::Intersection< GG, II > &intersection) const
    always returns false
    Definition dgfoned.hh:99
    \n-
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n-
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    Definition basic.hh:31
    \n+
    int & noflines()
    Definition basic.hh:87
    \n+
    int linenumber()
    Definition basic.hh:92
    \n+
    Definition boundaryseg.hh:25
    \n+
    bool ok()
    Definition boundaryseg.hh:48
    \n+
    int get(std ::map< EntityKey, BndParam > &facemap, bool fixedsize, int vtxoffset)
    Definition boundaryseg.cc:34
    \n+
    std::pair< int, BoundaryParameter > BndParam
    Definition boundaryseg.hh:36
    \n+
    DGFEntityKey< unsigned int > EntityKey
    Definition boundaryseg.hh:35
    \n+
    int nofbound()
    Definition boundaryseg.hh:53
    \n+
    Definition entitykey.hh:21
    \n
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-
    One-dimensional adaptive grid.
    Definition onedgrid.hh:97
    \n-\n-\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,344 +3,131 @@\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n-dgfoned.hh\n+ * blocks\n+boundaryseg.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH\n-6#define DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH\n+5#ifndef DUNE_DGF_BOUNDARYSEGBLOCK_HH\n+6#define DUNE_DGF_BOUNDARYSEGBLOCK_HH\n 7\n-8//- C++ includes\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14\n-15//- dune-common includes\n-16#include \n+8#include \n+9#include \n+10#include \n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16\n 17\n-18//- dune-grid includes\n-19#include \n-20#include \n-21\n-22//- local includes\n-23#include \"dgfparser.hh\"\n-24\n-25\n-26namespace\n-27{\n-28 // helper method used below\n-29 double getfirst ( std::vector< double > v )\n-30 {\n-31 return v[ 0 ];\n-32 }\n-33} // end anonymous namespace\n-34\n-35\n-36\n-37namespace Dune\n-38{\n-39\n-40 // DGFGridInfo\n-41 // -----------\n-42\n-43 template< >\n-44 struct DGFGridInfo< OneDGrid >\n-45 {\n-46 static int refineStepsForHalf ()\n-47 {\n-48 return 1;\n-49 }\n-50\n-51 static double refineWeight ()\n-52 {\n-53 return 0.5;\n-54 }\n-55 };\n-56\n+18namespace Dune\n+19{\n+20\n+21 namespace dgf\n+22 {\n+23 class BoundarySegBlock\n+24 : public BasicBlock\n+25 {\n+26 int dimworld; // the dimension of the vertices (is given from user)\n+27 bool goodline; // active line describes a vertex\n+28 std :: vector< unsigned int > p; // active vertex\n+29 int bndid;\n+30 typedef DGFBoundaryParameter::type BoundaryParameter;\n+31 BoundaryParameter parameter;\n+32 bool simplexgrid;\n+33\n+34 public:\n+35 typedef DGFEntityKey<_unsigned_int> EntityKey;\n+36 typedef std::pair < int, BoundaryParameter > BndParam;\n+37\n+38 // initialize vertex block and get first vertex\n+39 BoundarySegBlock ( std :: istream &in, int pnofvtx,\n+40 int pdimworld, bool psimplexgrid );\n+41\n+42 // some information\n+43 int get( std :: map< EntityKey, BndParam > & facemap,\n+44 bool fixedsize,\n+45 int vtxoffset\n+46 );\n+47\n+48 bool ok()\n+49 {\n+50 return goodline;\n+51 }\n+52\n+53 int nofbound()\n+54 {\n+55 return noflines();\n+56 }\n 57\n-58\n-59 // DGFGridFactory< OneDGrid >\n-60 // --------------------------\n-61\n-62 template< >\n-63 struct DGFGridFactory< OneDGrid >\n-64 {\n-66 typedef OneDGrid Grid;\n-68 const static int dimension = Grid::dimension;\n-70 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-71\n-73 explicit DGFGridFactory ( std::istream &input,\n-74 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-75 : grid_( 0 ),\n-76 emptyParameters_( 0 )\n-77 {\n-78 generate( input, comm );\n-79 }\n+58 private:\n+59 bool next();\n+60\n+61 // get coordinates of active vertex\n+62 int operator[] (int i)\n+63 {\n+64 assert(ok());\n+65 assert(linenumber()>=0);\n+66 assert(0<=i && i\n-99 bool wasInserted ( const Dune::Intersection<_GG,_II_> &intersection ) const\n-100 {\n-101 return false;\n-102 }\n-103\n-104 template< class GG, class II >\n-105 int boundaryId ( const Dune::Intersection<_GG,_II_> &intersection ) const\n-106 {\n-107 // OneDGrid returns boundary segment index;\n-108 // we return the index as the method boundaryId is deprecated\n-109 return intersection.boundarySegmentIndex();\n-110 }\n-111\n-113 template< class Entity >\n-114 int numParameters ( const Entity & ) const\n-115 {\n-116 return 0;\n-117 }\n-118\n-120 template< int codim >\n-121 int numParameters () const\n-122 {\n-123 return 0;\n-124 }\n-125\n-126 template< class Entity >\n-127 std::vector< double >& parameter ( const Entity &entity )\n-128 {\n-129 return parameter< Entity::codimension >( entity );\n-130 }\n-131\n-133 template< int codim >\n-134 std::vector< double > ¶meter ( [[maybe_unused]] const typename Grid::\n-Codim<_codim_>::Entity &element )\n-135 {\n-136 return emptyParameters_;\n-137 }\n-138\n-140 bool haveBoundaryParameters () const\n-141 {\n-142 return false;\n-143 }\n-144\n-146 template< class GG, class II >\n-147 const DGFBoundaryParameter::type &boundaryParameter ( [[maybe_unused]]\n-const Dune::Intersection<_GG,_II_> &intersection ) const\n-148 {\n-149 return DGFBoundaryParameter::defaultValue();\n-150 }\n-151\n-152 private:\n-153 // generate grid\n-154 void generate ( std::istream &input, MPICommunicatorType comm );\n-155\n-156 Grid *grid_;\n-157 std::vector< double > emptyParameters_;\n-158 };\n-159\n-160\n-161\n-162 // Implementation of DGFGridFactory< OneDGrid >\n-163 // --------------------------------------------\n-164\n-165 inline void DGFGridFactory< OneDGrid >::generate ( std::istream &input, [\n-[maybe_unused]] MPICommunicatorType comm )\n-166 {\n-167 // try to open interval block\n-168 dgf::IntervalBlock intervalBlock( input );\n-169\n-170 // try to open vertex block\n-171 int dimensionworld = Grid::dimensionworld;\n-172 dgf::VertexBlock vertexBlock( input, dimensionworld );\n-173\n-174 // check at least one block is active\n-175 if( !( vertexBlock.isactive() || intervalBlock.isactive() ))\n-176 DUNE_THROW( DGFException, \"No readable block found\" );\n-177\n-178 std::vector< std::vector< double > > vertices;\n-179\n-180 // read vertices first\n-181 if( vertexBlock.isactive() )\n-182 {\n-183 int nparameter = 0;\n-184 std::vector< std::vector< double > > parameter;\n-185 vertexBlock.get( vertices, parameter, nparameter );\n-186\n-187 if( nparameter > 0 )\n-188 std::cerr << \"Warning: vertex parameters will be ignored\" << std::endl;\n-189 }\n-190\n-191 // get vertices from interval block\n-192 if ( intervalBlock.isactive() )\n-193 {\n-194 if( intervalBlock.dimw() != dimensionworld )\n-195 {\n-196 DUNE_THROW( DGFException, \"Error: wrong coordinate dimension in interval\n-block \\\n-197 (got \" << intervalBlock.dimw() << \", expected \" << dimensionworld << \")\" );\n-198 }\n-199\n-200 int nintervals = intervalBlock.numIntervals();\n-201 for( int i = 0; i < nintervals; ++i )\n-202 intervalBlock.getVtx( i, vertices );\n-203 }\n-204\n-205 // copy to vector of doubles\n-206 std::vector< double > vtx( vertices.size() );\n-207 transform( vertices.begin(), vertices.end(), vtx.begin(), getfirst );\n-208\n-209 // remove duplicates\n-210 std::sort( vtx.begin(), vtx.end() );\n-211 std::vector< double >::iterator it = std::unique( vtx.begin(), vtx.end() );\n-212 vtx.erase( it, vtx.end() );\n-213 if( vertices.size() != vtx.size() )\n-214 std::cerr << \"Warning: removed duplicate vertices\" << std::endl;\n-215\n-216 // create grid\n-217 grid_ = new OneDGrid( vtx );\n-218 }\n-219\n-220} // end namespace Dune\n-221\n-222#endif // #ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH\n-onedgrid.hh\n-The OneDGrid class.\n+81#endif\n+basic.hh\n+parser.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition dgfgridfactory.hh:41\n-Dune::DGFGridFactory::dimension\n-static const int dimension\n-Definition dgfgridfactory.hh:40\n-Dune::DGFGridFactory::parameter\n-std::vector< double > & parameter(const Element &element)\n-Definition dgfgridfactory.hh:124\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::boundarySegmentIndex\n-size_t boundarySegmentIndex() const\n-index of the boundary segment within the macro grid\n-Definition common/intersection.hh:236\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/grid.hh:390\n-Dune::Grid::Codim::Entity\n-GridFamily::Traits::template Codim< cd >::Entity Entity\n-A type that is a model of a Dune::Entity.\n-Definition common/grid.hh:419\n-Dune::DGFGridInfo<_OneDGrid_>::refineWeight\n-static double refineWeight()\n-Definition dgfoned.hh:51\n-Dune::DGFGridInfo<_OneDGrid_>::refineStepsForHalf\n-static int refineStepsForHalf()\n-Definition dgfoned.hh:46\n-Dune::DGFGridFactory<_OneDGrid_>::Grid\n-OneDGrid Grid\n-grid type\n-Definition dgfoned.hh:66\n-Dune::DGFGridFactory<_OneDGrid_>::parameter\n-std::vector< double > & parameter(const typename Grid::Codim< codim >::Entity\n-&element)\n-return empty vector\n-Definition dgfoned.hh:134\n-Dune::DGFGridFactory<_OneDGrid_>::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-MPI communicator type.\n-Definition dgfoned.hh:70\n-Dune::DGFGridFactory<_OneDGrid_>::boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection<\n-GG, II > &intersection) const\n-return invalid default value\n-Definition dgfoned.hh:147\n-Dune::DGFGridFactory<_OneDGrid_>::parameter\n-std::vector< double > & parameter(const Entity &entity)\n-Definition dgfoned.hh:127\n-Dune::DGFGridFactory<_OneDGrid_>::boundaryId\n-int boundaryId(const Dune::Intersection< GG, II > &intersection) const\n-Definition dgfoned.hh:105\n-Dune::DGFGridFactory<_OneDGrid_>::grid\n-Grid * grid() const\n-get grid\n-Definition dgfoned.hh:92\n-Dune::DGFGridFactory<_OneDGrid_>::haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-OneDGrid does not support boundary parameters.\n-Definition dgfoned.hh:140\n-Dune::DGFGridFactory<_OneDGrid_>::numParameters\n-int numParameters(const Entity &) const\n-OneDGrid does not support parameters, returns 0.\n-Definition dgfoned.hh:114\n-Dune::DGFGridFactory<_OneDGrid_>::DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicatorType\n-comm=MPIHelper::getCommunicator())\n-constructor taking filename\n-Definition dgfoned.hh:82\n-Dune::DGFGridFactory<_OneDGrid_>::DGFGridFactory\n-DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n-getCommunicator())\n-constructor taking istream\n-Definition dgfoned.hh:73\n-Dune::DGFGridFactory<_OneDGrid_>::numParameters\n-int numParameters() const\n-OneDGrid does not support parameters, returns 0.\n-Definition dgfoned.hh:121\n-Dune::DGFGridFactory<_OneDGrid_>::wasInserted\n-bool wasInserted(const Dune::Intersection< GG, II > &intersection) const\n-always returns false\n-Definition dgfoned.hh:99\n-Dune::DGFGridInfo\n-Some simple static information for a given GridType.\n-Definition io/file/dgfparser/dgfparser.hh:56\n-Dune::DGFBoundaryParameter::defaultValue\n-static const type & defaultValue()\n-default constructor\n-Definition parser.hh:28\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::BasicBlock::noflines\n+int & noflines()\n+Definition basic.hh:87\n+Dune::dgf::BasicBlock::linenumber\n+int linenumber()\n+Definition basic.hh:92\n+Dune::dgf::BoundarySegBlock\n+Definition boundaryseg.hh:25\n+Dune::dgf::BoundarySegBlock::ok\n+bool ok()\n+Definition boundaryseg.hh:48\n+Dune::dgf::BoundarySegBlock::get\n+int get(std ::map< EntityKey, BndParam > &facemap, bool fixedsize, int\n+vtxoffset)\n+Definition boundaryseg.cc:34\n+Dune::dgf::BoundarySegBlock::BndParam\n+std::pair< int, BoundaryParameter > BndParam\n+Definition boundaryseg.hh:36\n+Dune::dgf::BoundarySegBlock::EntityKey\n+DGFEntityKey< unsigned int > EntityKey\n+Definition boundaryseg.hh:35\n+Dune::dgf::BoundarySegBlock::nofbound\n+int nofbound()\n+Definition boundaryseg.hh:53\n+Dune::DGFEntityKey\n+Definition entitykey.hh:21\n Dune::DGFBoundaryParameter::type\n std::string type\n type of additional boundary parameters\n Definition parser.hh:25\n-Dune::OneDGrid\n-One-dimensional adaptive grid.\n-Definition onedgrid.hh:97\n-dgfparser.hh\n-intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00908.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00908.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: starcdreader.hh File Reference\n+dune-grid: cube.hh File Reference\n \n \n \n \n \n \n \n@@ -65,44 +65,43 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    starcdreader.hh File Reference
    \n+
    cube.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/exceptions.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/gridfactory.hh>
    \n+
    #include <cassert>
    \n #include <iostream>
    \n-#include <fstream>
    \n-#include <memory>
    \n+#include <vector>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::StarCDReader< GridType >
     File reader for the Star-CD format. More...
    class  Dune::dgf::CubeBlock
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,27 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n+ * dgfparser\n+ * blocks\n Classes | Namespaces\n-starcdreader.hh File Reference\n-#include \n-#include \n-#include \n+cube.hh File Reference\n+#include \n #include \n-#include \n-#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::StarCDReader<_GridType_>\n-\u00a0 File reader for the Star-CD format. More...\n+class \u00a0 Dune::dgf::CubeBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00908_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00908_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: starcdreader.hh Source File\n+dune-grid: cube.hh Source File\n \n \n \n \n \n \n \n@@ -70,180 +70,96 @@\n
    \n \n \n \n \n \n \n
    \n-
    starcdreader.hh
    \n+
    cube.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_STARCD_READER_HH
    \n-
    6#define DUNE_STARCD_READER_HH
    \n+
    5#ifndef DUNE_DGF_CUBEBLOCK_HH
    \n+
    6#define DUNE_DGF_CUBEBLOCK_HH
    \n
    7
    \n-
    8#include <dune/common/exceptions.hh>
    \n-
    9
    \n-
    10#include <dune/geometry/type.hh>
    \n-\n-
    12#include <iostream>
    \n-
    13#include <fstream>
    \n-
    14#include <memory>
    \n-
    15
    \n-
    16namespace Dune {
    \n+
    8#include <cassert>
    \n+
    9#include <iostream>
    \n+
    10#include <vector>
    \n+
    11
    \n+\n+
    13
    \n+
    14
    \n+
    15namespace Dune
    \n+
    16{
    \n
    17
    \n-
    51 template <class GridType>
    \n-
    \n-\n-
    53
    \n-
    54 public:
    \n-
    55
    \n-
    \n-
    65 static std::unique_ptr<GridType> read(const std::string& fileName, bool verbose = true)
    \n-
    66 {
    \n-
    67 // extract the grid dimension
    \n-
    68 const int dim = GridType::dimension;
    \n-
    69
    \n-
    70 // currently only dim = 3 is implemented
    \n-
    71 if (dim != 3)
    \n-
    72 DUNE_THROW(Dune::NotImplemented,
    \n-
    73 "Reading Star-CD format is not implemented for dimension " << dim);
    \n-
    74
    \n-
    75 // set up the grid factory
    \n-\n-
    77
    \n-
    78 // set the name of the vertex file
    \n-
    79 std::string vertexFileName = fileName + ".vrt";
    \n-
    80
    \n-
    81 // set the vertex input stream
    \n-
    82 std::ifstream vertexFile(vertexFileName.c_str());
    \n-
    83 if (!vertexFile)
    \n-
    84 DUNE_THROW(Dune::IOError, "Could not open " << vertexFileName);
    \n-
    85
    \n-
    86 // read the vertices
    \n-
    87 int dummyIdx;
    \n-
    88 int numberOfVertices = 0;
    \n-
    89 while (vertexFile >> dummyIdx) {
    \n-
    90 numberOfVertices++;
    \n-
    91
    \n-
    92 Dune::FieldVector<double,dim> position;
    \n-
    93
    \n-
    94 for (int k = 0; k < dim; k++)
    \n-
    95 vertexFile >> position[k];
    \n-
    96
    \n-
    97 factory.insertVertex(position);
    \n-
    98 }
    \n-
    99 if (verbose)
    \n-
    100 std::cout << numberOfVertices << " vertices read." << std::endl;
    \n-
    101
    \n-
    102 // set the name of the element file
    \n-
    103 std::string elementFileName = fileName + ".cel";
    \n-
    104
    \n-
    105 // set the element input stream
    \n-
    106 std::ifstream elementFile(elementFileName.c_str());
    \n-
    107 if (!elementFile)
    \n-
    108 DUNE_THROW(Dune::IOError, "Could not open " << elementFileName);
    \n-
    109
    \n-
    110 // read the elements
    \n-
    111 int numberOfElements = 0;
    \n-
    112 int numberOfSimplices = 0;
    \n-
    113 int numberOfPyramids = 0;
    \n-
    114 int numberOfPrisms = 0;
    \n-
    115 int numberOfCubes = 0;;
    \n-
    116 int maxNumberOfVertices = (int)pow(2, dim);
    \n-
    117 int isVolume = 1;
    \n-
    118 while (elementFile >> dummyIdx) {
    \n-
    119 std::vector<unsigned int> vertices(maxNumberOfVertices);
    \n-
    120 for (int k = 0; k < maxNumberOfVertices; k++)
    \n-
    121 elementFile >> vertices[k];
    \n-
    122
    \n-
    123 int boundaryId;
    \n-
    124 elementFile >> boundaryId;
    \n-
    125
    \n-
    126 int volumeOrSurface[2];
    \n-
    127 elementFile >> volumeOrSurface[0] >> volumeOrSurface[1];
    \n-
    128
    \n-
    129 if (volumeOrSurface[0] == isVolume) {
    \n-
    130 numberOfElements++;
    \n-
    131
    \n-
    132 if (vertices[2] == vertices[3]) { // simplex or prism
    \n-
    133 if (vertices[4] == vertices[5]) { // simplex
    \n-
    134 numberOfSimplices++;
    \n-
    135 std::vector<unsigned int> simplexVertices(4);
    \n-
    136 for (int k = 0; k < 3; k++)
    \n-
    137 simplexVertices[k] = vertices[k] - 1;
    \n-
    138 simplexVertices[3] = vertices[4] - 1;
    \n-
    139 factory.insertElement(Dune::GeometryTypes::tetrahedron, simplexVertices);
    \n-
    140 }
    \n-
    141 else { // prism
    \n-
    142 numberOfPrisms++;
    \n-
    143 std::vector<unsigned int> prismVertices(6);
    \n-
    144 for (int k = 0; k < 3; k++)
    \n-
    145 prismVertices[k] = vertices[k] - 1;
    \n-
    146 for (int k = 3; k < 6; k++)
    \n-
    147 prismVertices[k] = vertices[k+1] - 1;
    \n-
    148 factory.insertElement(Dune::GeometryTypes::prism, prismVertices);
    \n-
    149 }
    \n-
    150 }
    \n-
    151 else { // cube or pyramid
    \n-
    152 if (vertices[4] == vertices[5]) { // pyramid
    \n-
    153 numberOfPyramids++;
    \n-
    154 std::vector<unsigned int> pyramidVertices(5);
    \n-
    155 for (int k = 0; k < 5; k++)
    \n-
    156 pyramidVertices[k] = vertices[k] - 1;
    \n-
    157 factory.insertElement(Dune::GeometryTypes::pyramid, pyramidVertices);
    \n-
    158 }
    \n-
    159 else { // cube
    \n-
    160 numberOfCubes++;
    \n-
    161 std::vector<unsigned int> cubeVertices(8);
    \n-
    162 for (int k = 0; k < 8; k++)
    \n-
    163 cubeVertices[k] = vertices[k] - 1;
    \n-
    164 std::swap(cubeVertices[2], cubeVertices[3]);
    \n-
    165 std::swap(cubeVertices[6], cubeVertices[7]);
    \n-
    166 factory.insertElement(Dune::GeometryTypes::hexahedron, cubeVertices);
    \n-
    167 }
    \n-
    168 }
    \n-
    169 }
    \n-
    170 }
    \n-
    171 if (verbose)
    \n-
    172 std::cout << numberOfElements << " elements read: "
    \n-
    173 << numberOfSimplices << " simplices, " << numberOfPyramids << " pyramids, "
    \n-
    174 << numberOfPrisms << " prisms, " << numberOfCubes << " cubes." << std::endl;
    \n-
    175
    \n-
    176 // finish off the construction of the grid object
    \n-
    177 if (verbose)
    \n-
    178 std::cout << "Starting createGrid() ... " << std::flush;
    \n-
    179
    \n-
    180 return factory.createGrid();
    \n-
    181
    \n-
    182 }
    \n-
    \n-
    183
    \n-
    184 };
    \n-
    \n-
    185
    \n-
    186}
    \n-
    187
    \n-
    188#endif
    \n-
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n+
    18 namespace dgf
    \n+
    19 {
    \n+
    20
    \n+
    \n+\n+
    22 : public BasicBlock
    \n+
    23 {
    \n+
    24 unsigned int nofvtx;
    \n+
    25 int dimgrid;
    \n+
    26 bool goodline; // active line describes a vertex
    \n+
    27 std :: vector< unsigned int > map; // active vertex
    \n+
    28 int nofparams;
    \n+
    29 int vtxoffset;
    \n+
    30
    \n+
    31 public:
    \n+
    32 CubeBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
    \n+
    33
    \n+
    34 int get ( std :: vector< std :: vector< unsigned int> > &simplex,
    \n+
    35 std :: vector< std :: vector< double > > &params,
    \n+
    36 int &nofp );
    \n+
    37
    \n+
    38 // some information
    \n+
    \n+
    39 bool ok ()
    \n+
    40 {
    \n+
    41 return goodline;
    \n+
    42 }
    \n+
    \n+
    43
    \n+
    \n+\n+
    45 {
    \n+
    46 return noflines();
    \n+
    47 }
    \n+
    \n+
    48
    \n+
    49 private:
    \n+
    50 // get the dimension of the grid
    \n+
    51 int getDimGrid ();
    \n+
    52 // get next simplex
    \n+
    53 bool next ( std :: vector< unsigned int > &simplex,
    \n+
    54 std :: vector< double > &param );
    \n+
    55 };
    \n+
    \n+
    56
    \n+
    57 } // end namespace dgf
    \n+
    58
    \n+
    59} // end namespace Dune
    \n+
    60
    \n+
    61#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n-
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
    Insert an element into the coarse grid.
    Definition common/gridfactory.hh:307
    \n-
    virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
    Insert a vertex into the coarse grid.
    Definition common/gridfactory.hh:296
    \n-
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n-
    File reader for the Star-CD format.
    Definition starcdreader.hh:52
    \n-
    static std::unique_ptr< GridType > read(const std::string &fileName, bool verbose=true)
    Read grid from a Star-CD file.
    Definition starcdreader.hh:65
    \n-
    Provide a generic factory class for unstructured grids.
    \n+
    Definition basic.hh:31
    \n+
    int & noflines()
    Definition basic.hh:87
    \n+
    Definition cube.hh:23
    \n+
    int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector< std ::vector< double > > &params, int &nofp)
    Definition cube.cc:102
    \n+
    int nofsimplex()
    Definition cube.hh:44
    \n+
    bool ok()
    Definition cube.hh:39
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,193 +2,97 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n-starcdreader.hh\n+ * dgfparser\n+ * blocks\n+cube.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_STARCD_READER_HH\n-6#define DUNE_STARCD_READER_HH\n+5#ifndef DUNE_DGF_CUBEBLOCK_HH\n+6#define DUNE_DGF_CUBEBLOCK_HH\n 7\n-8#include \n-9\n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n-15\n-16namespace Dune {\n+8#include \n+9#include \n+10#include \n+11\n+12#include \n+13\n+14\n+15namespace Dune\n+16{\n 17\n-51 template \n-52 class StarCDReader {\n-53\n-54 public:\n-55\n-65 static std::unique_ptr read(const std::string& fileName, bool\n-verbose = true)\n-66 {\n-67 // extract the grid dimension\n-68 const int dim = GridType::dimension;\n-69\n-70 // currently only dim = 3 is implemented\n-71 if (dim != 3)\n-72 DUNE_THROW(Dune::NotImplemented,\n-73 \"Reading Star-CD format is not implemented for dimension \" << dim);\n-74\n-75 // set up the grid factory\n-76 GridFactory factory;\n-77\n-78 // set the name of the vertex file\n-79 std::string vertexFileName = fileName + \".vrt\";\n-80\n-81 // set the vertex input stream\n-82 std::ifstream vertexFile(vertexFileName.c_str());\n-83 if (!vertexFile)\n-84 DUNE_THROW(Dune::IOError, \"Could not open \" << vertexFileName);\n-85\n-86 // read the vertices\n-87 int dummyIdx;\n-88 int numberOfVertices = 0;\n-89 while (vertexFile >> dummyIdx) {\n-90 numberOfVertices++;\n-91\n-92 Dune::FieldVector position;\n-93\n-94 for (int k = 0; k < dim; k++)\n-95 vertexFile >> position[k];\n-96\n-97 factory.insertVertex(position);\n-98 }\n-99 if (verbose)\n-100 std::cout << numberOfVertices << \" vertices read.\" << std::endl;\n-101\n-102 // set the name of the element file\n-103 std::string elementFileName = fileName + \".cel\";\n-104\n-105 // set the element input stream\n-106 std::ifstream elementFile(elementFileName.c_str());\n-107 if (!elementFile)\n-108 DUNE_THROW(Dune::IOError, \"Could not open \" << elementFileName);\n-109\n-110 // read the elements\n-111 int numberOfElements = 0;\n-112 int numberOfSimplices = 0;\n-113 int numberOfPyramids = 0;\n-114 int numberOfPrisms = 0;\n-115 int numberOfCubes = 0;;\n-116 int maxNumberOfVertices = (int)pow(2, dim);\n-117 int isVolume = 1;\n-118 while (elementFile >> dummyIdx) {\n-119 std::vector vertices(maxNumberOfVertices);\n-120 for (int k = 0; k < maxNumberOfVertices; k++)\n-121 elementFile >> vertices[k];\n-122\n-123 int boundaryId;\n-124 elementFile >> boundaryId;\n-125\n-126 int volumeOrSurface[2];\n-127 elementFile >> volumeOrSurface[0] >> volumeOrSurface[1];\n-128\n-129 if (volumeOrSurface[0] == isVolume) {\n-130 numberOfElements++;\n-131\n-132 if (vertices[2] == vertices[3]) { // simplex or prism\n-133 if (vertices[4] == vertices[5]) { // simplex\n-134 numberOfSimplices++;\n-135 std::vector simplexVertices(4);\n-136 for (int k = 0; k < 3; k++)\n-137 simplexVertices[k] = vertices[k] - 1;\n-138 simplexVertices[3] = vertices[4] - 1;\n-139 factory.insertElement(Dune::GeometryTypes::tetrahedron, simplexVertices);\n-140 }\n-141 else { // prism\n-142 numberOfPrisms++;\n-143 std::vector prismVertices(6);\n-144 for (int k = 0; k < 3; k++)\n-145 prismVertices[k] = vertices[k] - 1;\n-146 for (int k = 3; k < 6; k++)\n-147 prismVertices[k] = vertices[k+1] - 1;\n-148 factory.insertElement(Dune::GeometryTypes::prism, prismVertices);\n-149 }\n-150 }\n-151 else { // cube or pyramid\n-152 if (vertices[4] == vertices[5]) { // pyramid\n-153 numberOfPyramids++;\n-154 std::vector pyramidVertices(5);\n-155 for (int k = 0; k < 5; k++)\n-156 pyramidVertices[k] = vertices[k] - 1;\n-157 factory.insertElement(Dune::GeometryTypes::pyramid, pyramidVertices);\n-158 }\n-159 else { // cube\n-160 numberOfCubes++;\n-161 std::vector cubeVertices(8);\n-162 for (int k = 0; k < 8; k++)\n-163 cubeVertices[k] = vertices[k] - 1;\n-164 std::swap(cubeVertices[2], cubeVertices[3]);\n-165 std::swap(cubeVertices[6], cubeVertices[7]);\n-166 factory.insertElement(Dune::GeometryTypes::hexahedron, cubeVertices);\n-167 }\n-168 }\n-169 }\n-170 }\n-171 if (verbose)\n-172 std::cout << numberOfElements << \" elements read: \"\n-173 << numberOfSimplices << \" simplices, \" << numberOfPyramids << \" pyramids, \"\n-174 << numberOfPrisms << \" prisms, \" << numberOfCubes << \" cubes.\" << std::\n-endl;\n-175\n-176 // finish off the construction of the grid object\n-177 if (verbose)\n-178 std::cout << \"Starting createGrid() ... \" << std::flush;\n-179\n-180 return factory.createGrid();\n-181\n-182 }\n-183\n-184 };\n-185\n-186}\n-187\n-188#endif\n-std::swap\n-void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n-> &b)\n-Definition utility/persistentcontainer.hh:83\n+18 namespace dgf\n+19 {\n+20\n+21 class CubeBlock\n+22 : public BasicBlock\n+23 {\n+24 unsigned int nofvtx;\n+25 int dimgrid;\n+26 bool goodline; // active line describes a vertex\n+27 std :: vector< unsigned int > map; // active vertex\n+28 int nofparams;\n+29 int vtxoffset;\n+30\n+31 public:\n+32 CubeBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid\n+);\n+33\n+34 int get ( std :: vector< std :: vector< unsigned int> > &simplex,\n+35 std :: vector< std :: vector< double > > ¶ms,\n+36 int &nofp );\n+37\n+38 // some information\n+39 bool ok ()\n+40 {\n+41 return goodline;\n+42 }\n+43\n+44 int nofsimplex ()\n+45 {\n+46 return noflines();\n+47 }\n+48\n+49 private:\n+50 // get the dimension of the grid\n+51 int getDimGrid ();\n+52 // get next simplex\n+53 bool next ( std :: vector< unsigned int > &simplex,\n+54 std :: vector< double > ¶m );\n+55 };\n+56\n+57 } // end namespace dgf\n+58\n+59} // end namespace Dune\n+60\n+61#endif\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::GridFactory\n-Provide a generic factory class for unstructured grids.\n-Definition common/gridfactory.hh:275\n-Dune::GridFactory::insertElement\n-virtual void insertElement(const GeometryType &type, const std::vector<\n-unsigned int > &vertices)\n-Insert an element into the coarse grid.\n-Definition common/gridfactory.hh:307\n-Dune::GridFactory::insertVertex\n-virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)\n-Insert a vertex into the coarse grid.\n-Definition common/gridfactory.hh:296\n-Dune::GridFactory::createGrid\n-virtual std::unique_ptr< GridType > createGrid()\n-Finalize grid creation and hand over the grid.\n-Definition common/gridfactory.hh:333\n-Dune::StarCDReader\n-File reader for the Star-CD format.\n-Definition starcdreader.hh:52\n-Dune::StarCDReader::read\n-static std::unique_ptr< GridType > read(const std::string &fileName, bool\n-verbose=true)\n-Read grid from a Star-CD file.\n-Definition starcdreader.hh:65\n-gridfactory.hh\n-Provide a generic factory class for unstructured grids.\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::BasicBlock::noflines\n+int & noflines()\n+Definition basic.hh:87\n+Dune::dgf::CubeBlock\n+Definition cube.hh:23\n+Dune::dgf::CubeBlock::get\n+int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector<\n+std ::vector< double > > ¶ms, int &nofp)\n+Definition cube.cc:102\n+Dune::dgf::CubeBlock::nofsimplex\n+int nofsimplex()\n+Definition cube.hh:44\n+Dune::dgf::CubeBlock::ok\n+bool ok()\n+Definition cube.hh:39\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00911.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00911.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: volumewriter.hh File Reference\n+dune-grid: simplexgeneration.cc File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,31 @@\n \n \n \n \n \n \n \n
    \n \n-
    volumewriter.hh File Reference
    \n+
    simplexgeneration.cc File Reference
    \n
    \n
    \n-\n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::VTK::ConformingVolumeWriter< GV >
     
    \n+
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,27 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-volumewriter.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 \u00a0 Dune::VTK::ConformingVolumeWriter<_GV_>\n-\u00a0\n+ * dgfparser\n+ * blocks\n+Namespaces\n+simplexgeneration.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n+namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00914.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00914.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: b64enc.hh File Reference\n+dune-grid: periodicfacetrans.hh File Reference\n \n \n \n \n \n \n \n@@ -65,54 +65,53 @@\n \n \n \n \n \n \n \n
    \n \n-
    b64enc.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    periodicfacetrans.hh File Reference
    \n \n
    \n-\n-

    Simple base64 encode. \n-More...

    \n-
    #include <assert.h>
    \n+
    #include <iostream>
    \n+#include <vector>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::b64chunk
     struct representing the three byte text as well as the four 6 bit chunks More...
    struct  Dune::dgf::PeriodicFaceTransformationBlock
     
    class  Dune::dgf::PeriodicFaceTransformationBlock::Matrix< T >
     
    struct  Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-\n-\n-\n-\n-\n+\n+\n+\n

    \n-Variables

    const char Dune::base64table []
     endoing table
     

    \n+Functions

    std::ostream & Dune::dgf::operator<< (std::ostream &out, const PeriodicFaceTransformationBlock::AffineTransformation &trafo)
     
    \n-

    Detailed Description

    \n-

    Simple base64 encode.

    \n-
    Author
    Christian Engwer
    \n-

    We implement the base64 encoding (c.f. RFC 4648 https://tools.ietf.org/html/rfc4648).

    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,34 +2,34 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-b64enc.hh File Reference\n-Simple base64 encode. More...\n-#include \n+ * dgfparser\n+ * blocks\n+Classes | Namespaces | Functions\n+periodicfacetrans.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::b64chunk\n-\u00a0 struct representing the three byte text as well as the four 6 bit\n- chunks More...\n+struct \u00a0 Dune::dgf::PeriodicFaceTransformationBlock\n+\u00a0\n+ class \u00a0 Dune::dgf::PeriodicFaceTransformationBlock::Matrix<_T_>\n+\u00a0\n+struct \u00a0 Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-Variables\n-const char\u00a0 Dune::base64table []\n-\u00a0 endoing table\n-\u00a0\n-***** Detailed Description *****\n-Simple base64 encode.\n- Author\n- Christian Engwer\n-We implement the base64 encoding (c.f. RFC 4648 https://tools.ietf.org/html/\n-rfc4648).\n+namespace \u00a0 Dune::dgf\n+\u00a0\n+Functions\n+std::ostream &\u00a0 Dune::dgf::operator<< (std::ostream &out, const\n+ PeriodicFaceTransformationBlock::AffineTransformation &trafo)\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00914_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00914_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: b64enc.hh Source File\n+dune-grid: periodicfacetrans.hh Source File\n \n \n \n \n \n \n \n@@ -70,108 +70,183 @@\n \n \n \n \n \n \n \n
    \n-
    b64enc.hh
    \n+
    periodicfacetrans.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_B64ENC_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_B64ENC_HH
    \n-
    8
    \n-
    9#include <assert.h>
    \n+
    5#ifndef DUNE_DGF_PERIODICFACETRANSBLOCK_HH
    \n+
    6#define DUNE_DGF_PERIODICFACETRANSBLOCK_HH
    \n+
    7
    \n+
    8#include <iostream>
    \n+
    9#include <vector>
    \n
    10
    \n-
    11namespace Dune {
    \n+\n
    12
    \n+
    13
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17 namespace dgf
    \n+
    18 {
    \n+
    19
    \n+
    20 // PeriodicFaceTransformationBlock
    \n+
    21 // -------------------------------
    \n+
    22
    \n
    \n-
    23 const char base64table[] =
    \n-
    24 {
    \n-
    25 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
    \n-
    26 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
    \n-
    27 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
    \n-
    28 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
    \n-
    29 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
    \n-
    30 };
    \n-
    \n-
    31
    \n-
    \n-
    33 struct b64chunk
    \n-
    34 {
    \n-
    35 using size_type = unsigned char;
    \n-\n-
    37 char txt[3];
    \n-
    38
    \n-
    \n-
    39 void reset()
    \n-
    40 {
    \n-
    41 size = 0;
    \n-
    42 txt[0] = txt[1] = txt[2] = 0;
    \n-
    43 }
    \n+\n+
    24 : public BasicBlock
    \n+
    25 {
    \n+
    26 template< class T >
    \n+
    \n+
    27 class Matrix
    \n+
    28 {
    \n+
    29 int rows_;
    \n+
    30 int cols_;
    \n+
    31 std::vector< T > fields_;
    \n+
    32
    \n+
    33 public:
    \n+
    \n+
    34 Matrix ( int rows, int cols )
    \n+
    35 : rows_( rows ),
    \n+
    36 cols_( cols ),
    \n+
    37 fields_( rows * cols )
    \n+
    38 {}
    \n+
    \n+
    39
    \n+
    \n+
    40 const T &operator() ( int i, int j ) const
    \n+
    41 {
    \n+
    42 return fields_[ i * cols_ + j ];
    \n+
    43 }
    \n
    \n
    44
    \n
    \n-
    45 int read(const char* t, size_type s)
    \n-
    46 {
    \n-
    47 size = s>=3 ? 3 : s;
    \n-
    48 txt[0] = s>0 ? t[0] : 0;
    \n-
    49 txt[1] = s>1 ? t[1] : 0;
    \n-
    50 txt[2] = s>2 ? t[2] : 0;
    \n-
    51 return size;
    \n-
    52 }
    \n-
    \n-
    53
    \n-
    \n-
    54 void put(const char c)
    \n-
    55 {
    \n-
    56 assert (size < 3);
    \n-
    57 txt[size++] = c;
    \n-
    58 }
    \n-
    \n-
    59
    \n-
    \n-
    60 void write(char* t)
    \n-
    61 {
    \n-
    62 const unsigned A = (txt[0] & 0b1111'1100) >> 2;
    \n-
    63 const unsigned B = (txt[0] & 0b0000'0011) << 4 | (txt[1] & 0b1111'0000) >> 4;
    \n-
    64 const unsigned C = (txt[1] & 0b0000'1111) << 2 | (txt[2] & 0b1100'0000) >> 6;
    \n-
    65 const unsigned D = txt[2] & 0b0011'1111;
    \n-
    66 t[0] = size>0 ? base64table[A] : '=';
    \n-
    67 t[1] = size>0 ? base64table[B] : '=';
    \n-
    68 t[2] = size>1 ? base64table[C] : '=';
    \n-
    69 t[3] = size>2 ? base64table[D] : '=';
    \n-
    70 size = 0;
    \n-
    71 }
    \n-
    \n-
    72 };
    \n-
    \n-
    73
    \n-
    76} // namespace Dune
    \n+
    45 T &operator() ( int i, int j )
    \n+
    46 {
    \n+
    47 return fields_[ i * cols_ + j ];
    \n+
    48 }
    \n+
    \n+
    49
    \n+
    \n+
    50 int rows () const
    \n+
    51 {
    \n+
    52 return rows_;
    \n+
    53 }
    \n+
    \n+
    54
    \n+
    \n+
    55 int cols () const
    \n+
    56 {
    \n+
    57 return cols_;
    \n+
    58 }
    \n+
    \n+
    59 };
    \n+
    \n+
    60
    \n+
    \n+\n+
    62 {
    \n+\n+
    64 std::vector< double > shift;
    \n+
    65
    \n+
    \n+
    66 explicit AffineTransformation ( int dimworld )
    \n+
    67 : matrix( dimworld, dimworld ),
    \n+
    68 shift( dimworld )
    \n+
    69 {}
    \n+
    \n+
    70 };
    \n+
    \n+
    71
    \n+
    72 private:
    \n+
    73 std::vector< AffineTransformation > transformations_;
    \n+
    74
    \n+
    75 // copy not implemented
    \n+\n
    77
    \n-
    78#endif // DUNE_GRID_IO_FILE_VTK_B64ENC_HH
    \n+
    78 public:
    \n+
    79 // initialize block and get dimension of world
    \n+
    80 PeriodicFaceTransformationBlock ( std::istream &in, int dimworld );
    \n+
    81
    \n+
    \n+
    82 const AffineTransformation &transformation ( int i ) const
    \n+
    83 {
    \n+
    84 assert( i < numTransformations() );
    \n+
    85 return transformations_[ i ];
    \n+
    86 }
    \n+
    \n+
    87
    \n+
    \n+
    88 int numTransformations () const
    \n+
    89 {
    \n+
    90 return transformations_.size();
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    93 private:
    \n+
    94 void match ( char what );
    \n+
    95 };
    \n+
    \n+
    96
    \n+
    97
    \n+
    98
    \n+
    99 // PeriodicFaceTransformationBlock::AffineTransformation
    \n+
    100 // -----------------------------------------------------
    \n+
    101
    \n+
    102
    \n+
    \n+
    103 inline std::ostream &
    \n+\n+
    105 {
    \n+
    106 for( int i = 0; i < trafo.matrix.rows(); ++i )
    \n+
    107 {
    \n+
    108 out << (i > 0 ? ", " : "");
    \n+
    109 for( int j = 0; j < trafo.matrix.cols(); ++j )
    \n+
    110 out << (j > 0 ? " " : "") << trafo.matrix( i, j );
    \n+
    111 }
    \n+
    112 out << " +";
    \n+
    113 for( unsigned int i = 0; i < trafo.shift.size(); ++i )
    \n+
    114 out << " " << trafo.shift[ i ];
    \n+
    115 return out;
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    118 } // end namespace dgf
    \n+
    119
    \n+
    120} // end namespace Dune
    \n+
    121
    \n+
    122#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    const char base64table[]
    endoing table
    Definition b64enc.hh:23
    \n-
    struct representing the three byte text as well as the four 6 bit chunks
    Definition b64enc.hh:34
    \n-
    char txt[3]
    Definition b64enc.hh:37
    \n-
    unsigned char size_type
    Definition b64enc.hh:35
    \n-
    void write(char *t)
    Definition b64enc.hh:60
    \n-
    size_type size
    Definition b64enc.hh:36
    \n-
    int read(const char *t, size_type s)
    Definition b64enc.hh:45
    \n-
    void put(const char c)
    Definition b64enc.hh:54
    \n-
    void reset()
    Definition b64enc.hh:39
    \n+
    std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval &interval)
    Definition interval.hh:123
    \n+
    Definition basic.hh:31
    \n+
    Definition periodicfacetrans.hh:25
    \n+
    int numTransformations() const
    Definition periodicfacetrans.hh:88
    \n+
    const AffineTransformation & transformation(int i) const
    Definition periodicfacetrans.hh:82
    \n+
    Definition periodicfacetrans.hh:28
    \n+
    int rows() const
    Definition periodicfacetrans.hh:50
    \n+
    const T & operator()(int i, int j) const
    Definition periodicfacetrans.hh:40
    \n+
    int cols() const
    Definition periodicfacetrans.hh:55
    \n+
    Matrix(int rows, int cols)
    Definition periodicfacetrans.hh:34
    \n+\n+
    Matrix< double > matrix
    Definition periodicfacetrans.hh:63
    \n+
    std::vector< double > shift
    Definition periodicfacetrans.hh:64
    \n+
    AffineTransformation(int dimworld)
    Definition periodicfacetrans.hh:66
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,111 +2,181 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-b64enc.hh\n+ * dgfparser\n+ * blocks\n+periodicfacetrans.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_B64ENC_HH\n-7#define DUNE_GRID_IO_FILE_VTK_B64ENC_HH\n-8\n-9#include \n+5#ifndef DUNE_DGF_PERIODICFACETRANSBLOCK_HH\n+6#define DUNE_DGF_PERIODICFACETRANSBLOCK_HH\n+7\n+8#include \n+9#include \n 10\n-11namespace Dune {\n+11#include \n 12\n-23 const char base64table[] =\n-24 {\n-25 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n-26 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n-27 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\n-28 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',\n-29 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'\n-30 };\n-31\n-33 struct b64chunk\n-34 {\n-35 using size_type = unsigned char;\n-36 size_type size;\n-37 char txt[3];\n-38\n-39 void reset()\n-40 {\n-41 size = 0;\n-42 txt[0] = txt[1] = txt[2] = 0;\n+13\n+14namespace Dune\n+15{\n+16\n+17 namespace dgf\n+18 {\n+19\n+20 // PeriodicFaceTransformationBlock\n+21 // -------------------------------\n+22\n+23 struct PeriodicFaceTransformationBlock\n+24 : public BasicBlock\n+25 {\n+26 template< class T >\n+27 class Matrix\n+28 {\n+29 int rows_;\n+30 int cols_;\n+31 std::vector< T > fields_;\n+32\n+33 public:\n+34 Matrix ( int rows, int cols )\n+35 : rows_( rows ),\n+36 cols_( cols ),\n+37 fields_( rows * cols )\n+38 {}\n+39\n+40 const T &operator()_( int i, int j ) const\n+41 {\n+42 return fields_[ i * cols_ + j ];\n 43 }\n 44\n-45 int read(const char* t, size_type s)\n+45 T &operator()_( int i, int j )\n 46 {\n-47 size = s>=3 ? 3 : s;\n-48 txt[0] = s>0 ? t[0] : 0;\n-49 txt[1] = s>1 ? t[1] : 0;\n-50 txt[2] = s>2 ? t[2] : 0;\n-51 return size;\n-52 }\n-53\n-54 void put(const char c)\n-55 {\n-56 assert (size < 3);\n-57 txt[size++] = c;\n+47 return fields_[ i * cols_ + j ];\n+48 }\n+49\n+50 int rows () const\n+51 {\n+52 return rows_;\n+53 }\n+54\n+55 int cols () const\n+56 {\n+57 return cols_;\n 58 }\n-59\n-60 void write(char* t)\n-61 {\n-62 const unsigned A = (txt[0] & 0b1111'1100) >> 2;\n-63 const unsigned B = (txt[0] & 0b0000'0011) << 4 | (txt[1] & 0b1111'0000) >>\n-4;\n-64 const unsigned C = (txt[1] & 0b0000'1111) << 2 | (txt[2] & 0b1100'0000) >>\n-6;\n-65 const unsigned D = txt[2] & 0b0011'1111;\n-66 t[0] = size>0 ? base64table[A] : '=';\n-67 t[1] = size>0 ? base64table[B] : '=';\n-68 t[2] = size>1 ? base64table[C] : '=';\n-69 t[3] = size>2 ? base64table[D] : '=';\n-70 size = 0;\n-71 }\n-72 };\n-73\n-76} // namespace Dune\n+59 };\n+60\n+61 struct AffineTransformation\n+62 {\n+63 Matrix<_double_> matrix;\n+64 std::vector< double > shift;\n+65\n+66 explicit AffineTransformation ( int dimworld )\n+67 : matrix( dimworld, dimworld ),\n+68 shift( dimworld )\n+69 {}\n+70 };\n+71\n+72 private:\n+73 std::vector< AffineTransformation > transformations_;\n+74\n+75 // copy not implemented\n+76 PeriodicFaceTransformationBlock ( const PeriodicFaceTransformationBlock & );\n 77\n-78#endif // DUNE_GRID_IO_FILE_VTK_B64ENC_HH\n+78 public:\n+79 // initialize block and get dimension of world\n+80 PeriodicFaceTransformationBlock ( std::istream &in, int dimworld );\n+81\n+82 const AffineTransformation &transformation ( int i ) const\n+83 {\n+84 assert( i < numTransformations() );\n+85 return transformations_[ i ];\n+86 }\n+87\n+88 int numTransformations () const\n+89 {\n+90 return transformations_.size();\n+91 }\n+92\n+93 private:\n+94 void match ( char what );\n+95 };\n+96\n+97\n+98\n+99 // PeriodicFaceTransformationBlock::AffineTransformation\n+100 // -----------------------------------------------------\n+101\n+102\n+103 inline std::ostream &\n+104 operator<<_( std::ostream &out, const PeriodicFaceTransformationBlock::\n+AffineTransformation &trafo )\n+105 {\n+106 for( int i = 0; i < trafo.matrix.rows(); ++i )\n+107 {\n+108 out << (i > 0 ? \", \" : \"\");\n+109 for( int j = 0; j < trafo.matrix.cols(); ++j )\n+110 out << (j > 0 ? \" \" : \"\") << trafo.matrix( i, j );\n+111 }\n+112 out << \" +\";\n+113 for( unsigned int i = 0; i < trafo.shift.size(); ++i )\n+114 out << \" \" << trafo.shift[ i ];\n+115 return out;\n+116 }\n+117\n+118 } // end namespace dgf\n+119\n+120} // end namespace Dune\n+121\n+122#endif\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::base64table\n-const char base64table[]\n-endoing table\n-Definition b64enc.hh:23\n-Dune::b64chunk\n-struct representing the three byte text as well as the four 6 bit chunks\n-Definition b64enc.hh:34\n-Dune::b64chunk::txt\n-char txt[3]\n-Definition b64enc.hh:37\n-Dune::b64chunk::size_type\n-unsigned char size_type\n-Definition b64enc.hh:35\n-Dune::b64chunk::write\n-void write(char *t)\n-Definition b64enc.hh:60\n-Dune::b64chunk::size\n-size_type size\n-Definition b64enc.hh:36\n-Dune::b64chunk::read\n-int read(const char *t, size_type s)\n-Definition b64enc.hh:45\n-Dune::b64chunk::put\n-void put(const char c)\n-Definition b64enc.hh:54\n-Dune::b64chunk::reset\n-void reset()\n-Definition b64enc.hh:39\n+Dune::dgf::operator<<\n+std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval\n+&interval)\n+Definition interval.hh:123\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::PeriodicFaceTransformationBlock\n+Definition periodicfacetrans.hh:25\n+Dune::dgf::PeriodicFaceTransformationBlock::numTransformations\n+int numTransformations() const\n+Definition periodicfacetrans.hh:88\n+Dune::dgf::PeriodicFaceTransformationBlock::transformation\n+const AffineTransformation & transformation(int i) const\n+Definition periodicfacetrans.hh:82\n+Dune::dgf::PeriodicFaceTransformationBlock::Matrix\n+Definition periodicfacetrans.hh:28\n+Dune::dgf::PeriodicFaceTransformationBlock::Matrix::rows\n+int rows() const\n+Definition periodicfacetrans.hh:50\n+Dune::dgf::PeriodicFaceTransformationBlock::Matrix::operator()\n+const T & operator()(int i, int j) const\n+Definition periodicfacetrans.hh:40\n+Dune::dgf::PeriodicFaceTransformationBlock::Matrix::cols\n+int cols() const\n+Definition periodicfacetrans.hh:55\n+Dune::dgf::PeriodicFaceTransformationBlock::Matrix::Matrix\n+Matrix(int rows, int cols)\n+Definition periodicfacetrans.hh:34\n+Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation\n+Definition periodicfacetrans.hh:62\n+Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation::matrix\n+Matrix< double > matrix\n+Definition periodicfacetrans.hh:63\n+Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation::shift\n+std::vector< double > shift\n+Definition periodicfacetrans.hh:64\n+Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation::\n+AffineTransformation\n+AffineTransformation(int dimworld)\n+Definition periodicfacetrans.hh:66\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00917.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00917.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundaryiterators.hh File Reference\n+dune-grid: polyhedron.hh File Reference\n \n \n \n \n \n \n \n@@ -65,57 +65,42 @@\n \n \n \n \n \n \n \n
    \n \n-
    boundaryiterators.hh File Reference
    \n+
    polyhedron.hh File Reference
    \n
    \n
    \n-\n-

    Functions for VTK output on the skeleton. \n-More...

    \n-
    #include <iterator>
    \n-#include <memory>
    \n-#include <dune/common/iteratorfacades.hh>
    \n-#include <dune/grid/io/file/vtk/corner.hh>
    \n-#include <dune/grid/io/file/vtk/corneriterator.hh>
    \n-#include <dune/grid/io/file/vtk/functionwriter.hh>
    \n+
    #include <algorithm>
    \n+#include <dune/grid/io/file/dgfparser/blocks/polygon.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::VTK::BoundaryIterator< GV >
     iterate over the GridViews boundary intersections More...
     
    class  Dune::VTK::IntersectionIndexSet< ElementIndexSet >
     
    class  Dune::VTK::NonConformingBoundaryIteratorFactory< GV >
    struct  Dune::dgf::PolyhedronBlock
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
    namespace  Dune::dgf
     
    \n-

    Detailed Description

    \n-

    Functions for VTK output on the skeleton.

    \n-
    Author
    J\u00f6 Fahlke
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-utf-8\n+us-ascii\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,39 +2,25 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n+ * blocks\n Classes | Namespaces\n-boundaryiterators.hh File Reference\n-dune-grid \u00bb I/O \u00bb Visualization_ToolKit_(VTK)\n-Functions for VTK output on the skeleton. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+polyhedron.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::BoundaryIterator<_GV_>\n-\u00a0 iterate over the GridViews boundary intersections More...\n-\u00a0\n-class \u00a0 Dune::VTK::IntersectionIndexSet<_ElementIndexSet_>\n-\u00a0\n-class \u00a0 Dune::VTK::NonConformingBoundaryIteratorFactory<_GV_>\n+struct \u00a0 Dune::dgf::PolyhedronBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n+namespace \u00a0 Dune::dgf\n \u00a0\n-***** Detailed Description *****\n-Functions for VTK output on the skeleton.\n- Author\n- J\u00c3\u00b6 Fahlke\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00917_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00917_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundaryiterators.hh Source File\n+dune-grid: polyhedron.hh Source File\n \n \n \n \n \n \n \n@@ -70,283 +70,109 @@\n \n \n \n \n \n \n \n
    \n-
    boundaryiterators.hh
    \n+
    polyhedron.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
    \n-
    8
    \n-
    9#include <iterator>
    \n-
    10#include <memory>
    \n+
    3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=2 sw=2 sts=2:
    \n+
    5#ifndef DUNE_POLYHEDRON_HH
    \n+
    6#define DUNE_POLYHEDRON_HH
    \n+
    7
    \n+
    8#include <algorithm>
    \n+
    9
    \n+\n
    11
    \n-
    12#include <dune/common/iteratorfacades.hh>
    \n-
    13
    \n-\n-\n-\n+
    12namespace Dune
    \n+
    13{
    \n+
    14
    \n+
    15 namespace dgf
    \n+
    16 {
    \n
    17
    \n-
    18namespace Dune {
    \n-
    19
    \n-
    22
    \n-
    28 namespace VTK {
    \n-
    29
    \n-
    31
    \n-
    35 template<typename GV>
    \n-
    \n-\n-
    37 : public ForwardIteratorFacade
    \n-
    38 < BoundaryIterator<GV>,
    \n-
    39 const typename GV::Intersection,
    \n-
    40 const typename GV::Intersection&,
    \n-
    41 typename std::iterator_traits<typename GV::template Codim<0>::
    \n-
    42 Iterator>::difference_type>
    \n-
    43 {
    \n-
    44 public:
    \n-
    45 // reiterator the facades typedefs here
    \n-\n-
    47 typedef const typename GV::Intersection Value;
    \n-
    48 typedef Value& Reference;
    \n-
    49 typedef typename GV::template Codim<0>::Iterator ElementIterator;
    \n-
    50 typedef typename GV::IntersectionIterator IntersectionIterator;
    \n-
    51 typedef typename std::iterator_traits<ElementIterator>::difference_type
    \n-\n-
    53
    \n-
    54 private:
    \n-
    55 typedef ForwardIteratorFacade<DerivedType, Value, Reference,
    \n-
    56 DifferenceType> Facade;
    \n-
    57
    \n-
    58 const GV* gv;
    \n-\n-
    60 std::shared_ptr<IntersectionIterator> iit;
    \n-
    61
    \n-
    62 bool valid() const {
    \n-
    63 // we're valid if we're passed-the-end
    \n-
    64 if(eit == gv->template end<0>()) return true;
    \n-
    65 // or if we're on a boundary
    \n-
    66 if((*iit)->boundary() && !(*iit)->neighbor()) return true;
    \n-
    67 // otherwise we're invalid
    \n-
    68 return false;
    \n-
    69 }
    \n+
    18 // PolyhedronBlock
    \n+
    19 // ---------------
    \n+
    20
    \n+
    \n+\n+
    22 : public BasicBlock
    \n+
    23 {
    \n+
    \n+
    24 explicit PolyhedronBlock ( std::istream &in, int numPolys )
    \n+
    25 : BasicBlock( in, "Polyhedron" ), numPolys_( numPolys )
    \n+
    26 {}
    \n+
    \n+
    27
    \n+
    \n+
    28 int get ( std::vector< std::vector< int > > &polyhedra )
    \n+
    29 {
    \n+
    30 reset();
    \n+
    31 std::vector< int > polyhedron;
    \n+
    32 int minPolyId = 1;
    \n+
    33 while( getnextline() )
    \n+
    34 {
    \n+
    35 polyhedron.clear();
    \n+
    36 for( int polyIdx; getnextentry( polyIdx ); )
    \n+
    37 {
    \n+
    38 if( (polyIdx < 0) || (polyIdx > numPolys_) )
    \n+
    39 DUNE_THROW( DGFException, "Error in " << *this << ": Invalid polygon index (" << polyIdx << " not int [0, " << numPolys_ << "])" );
    \n+
    40
    \n+
    41 minPolyId = std::min( minPolyId, polyIdx );
    \n+
    42 polyhedron.push_back( polyIdx );
    \n+
    43 }
    \n+
    44
    \n+
    45 polyhedra.push_back( polyhedron );
    \n+
    46 }
    \n+
    47
    \n+
    48 // subtract minimal number to have 0 starting numbering
    \n+
    49 if( minPolyId > 0 )
    \n+
    50 {
    \n+
    51 const size_t polySize = polyhedra.size();
    \n+
    52 for( size_t i=0; i<polySize; ++i )
    \n+
    53 {
    \n+
    54 const size_t pSize = polyhedra[ i ].size();
    \n+
    55 for( size_t j=0; j<pSize; ++j )
    \n+
    56 {
    \n+
    57 polyhedra[ i ][ j ] -= minPolyId;
    \n+
    58 }
    \n+
    59 }
    \n+
    60 }
    \n+
    61 return polyhedra.size();
    \n+
    62 }
    \n+
    \n+
    63
    \n+
    64 protected:
    \n+
    65 const int numPolys_;
    \n+
    66 };
    \n+
    \n+
    67
    \n+
    68 } // namespace dgf
    \n+
    69} // end namespace Dune
    \n
    70
    \n-
    71 void basic_increment() {
    \n-
    72 ++*iit;
    \n-
    73 if(*iit == gv->iend(*eit)) {
    \n-
    74 iit.reset();
    \n-
    75 ++eit;
    \n-
    76 if(eit != gv->template end<0>())
    \n-
    77 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));
    \n-
    78 }
    \n-
    79 }
    \n-
    80
    \n-
    81 public:
    \n-
    \n-\n-
    83 return **iit;
    \n-
    84 }
    \n-
    \n-
    \n-
    85 bool equals(const DerivedType& other) const {
    \n-
    86 if(eit != other.eit) return false;
    \n-
    87
    \n-
    88 // this is a bit tricky, since we may not compare iit if we are
    \n-
    89 // passed-the-end
    \n-
    90 bool mePassedTheEnd = eit == gv->template end<0>();
    \n-
    91 bool otherPassedTheEnd = other.eit == other.gv->template end<0>();
    \n-
    92
    \n-
    93 // both passed-the-end => consider them equal
    \n-
    94 if(mePassedTheEnd && otherPassedTheEnd) return true;
    \n-
    95
    \n-
    96 // one passed the end => not equal
    \n-
    97 if(mePassedTheEnd || otherPassedTheEnd) return false;
    \n-
    98
    \n-
    99 // none passed-the-end => do their iit iterators match?
    \n-
    100 return *iit == *other.iit;
    \n-
    101 }
    \n-
    \n-
    102
    \n-
    \n-
    103 void increment() {
    \n-
    104 basic_increment();
    \n-
    105 while(!valid()) basic_increment();
    \n-
    106 }
    \n-
    \n-
    107
    \n-
    109
    \n-
    \n-
    113 BoundaryIterator(const GV& gv_, const ElementIterator& eit_,
    \n-
    114 const IntersectionIterator& iit_)
    \n-
    115 : gv(&gv_), eit(eit_), iit(new IntersectionIterator(iit_))
    \n-
    116 {
    \n-
    117 while(!valid()) basic_increment();
    \n-
    118 }
    \n-
    \n-
    120
    \n-
    \n-
    125 BoundaryIterator(const GV& gv_, const ElementIterator& eit_)
    \n-
    126 : gv(&gv_), eit(eit_)
    \n-
    127 {
    \n-
    128 if(eit != gv->template end<0>())
    \n-
    129 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));
    \n-
    130
    \n-
    131 while(!valid()) basic_increment();
    \n-
    132 }
    \n-
    \n-
    134
    \n-
    \n-
    138 BoundaryIterator(const GV& gv_, bool end = false)
    \n-
    139 : gv(&gv_), eit(end ? gv->template end<0>() : gv->template begin<0>())
    \n-
    140 {
    \n-
    141 if(eit != gv->template end<0>())
    \n-
    142 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));
    \n-
    143
    \n-
    144 while(!valid()) basic_increment();
    \n-
    145 }
    \n-
    \n-
    146 };
    \n-
    \n-
    147
    \n-
    148 template<typename ElementIndexSet>
    \n-
    \n-\n-
    150 const ElementIndexSet& eis;
    \n-
    151
    \n-
    152 public:
    \n-
    \n-
    153 IntersectionIndexSet(const ElementIndexSet& eis_)
    \n-
    154 : eis(eis_)
    \n-
    155 { }
    \n-
    \n-
    156 };
    \n-
    \n-
    157
    \n-
    158 template<typename GV>
    \n-
    \n-\n-
    160 const GV& gv;
    \n-
    161
    \n-
    162 public:
    \n-
    163 static const unsigned dimCell = GV::dimension-1;
    \n-
    164
    \n-
    165 typedef typename GV::Intersection Cell;
    \n-\n-
    167
    \n-\n-\n-
    170
    \n-
    171 typedef Corner Point;
    \n-\n-
    173
    \n-\n-
    175 typedef typename GV::Communication Communication;
    \n-
    176
    \n-
    \n-\n-
    178 : gv(gv_)
    \n-
    179 { }
    \n-
    \n-
    180
    \n-
    \n-\n-
    182 return CellIterator(gv);
    \n-
    183 }
    \n-
    \n-
    \n-\n-
    185 return CellIterator(gv, true);
    \n-
    186 }
    \n-
    \n-
    187
    \n-
    \n-\n-\n-
    190 }
    \n-
    \n-
    \n-\n-
    192 return CornerIterator(endCells());
    \n-
    193 }
    \n-
    \n-
    194
    \n-\n-
    196 PointIterator endPoints() const { return endCorners(); }
    \n-
    197
    \n-
    \n-\n-
    199 return ConnectivityWriter();
    \n-
    200 }
    \n-
    \n-
    \n-
    201 const Communication& comm() const {
    \n-
    202 return gv.comm();
    \n-
    203 }
    \n-
    \n-
    204 };
    \n-
    \n-
    205
    \n-
    206 } // namespace VTK
    \n-
    207
    \n-
    209
    \n-
    210} // namespace Dune
    \n-
    211
    \n-
    212#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
    \n-\n-\n-\n+
    71#endif // #ifndef DUNE_POLYHEDRON_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    iterate over the GridViews boundary intersections
    Definition boundaryiterators.hh:43
    \n-
    BoundaryIterator< GV > DerivedType
    Definition boundaryiterators.hh:46
    \n-
    BoundaryIterator(const GV &gv_, const ElementIterator &eit_)
    construct a BoundaryIterator
    Definition boundaryiterators.hh:125
    \n-
    Reference dereference() const
    Definition boundaryiterators.hh:82
    \n-
    const GV::Intersection Value
    Definition boundaryiterators.hh:47
    \n-
    BoundaryIterator(const GV &gv_, bool end=false)
    construct a BoundaryIterator
    Definition boundaryiterators.hh:138
    \n-
    BoundaryIterator(const GV &gv_, const ElementIterator &eit_, const IntersectionIterator &iit_)
    construct a BoundaryIterator
    Definition boundaryiterators.hh:113
    \n-
    GV::template Codim< 0 >::Iterator ElementIterator
    Definition boundaryiterators.hh:49
    \n-
    Value & Reference
    Definition boundaryiterators.hh:48
    \n-
    GV::IntersectionIterator IntersectionIterator
    Definition boundaryiterators.hh:50
    \n-
    bool equals(const DerivedType &other) const
    Definition boundaryiterators.hh:85
    \n-
    std::iterator_traits< ElementIterator >::difference_type DifferenceType
    Definition boundaryiterators.hh:52
    \n-
    void increment()
    Definition boundaryiterators.hh:103
    \n-
    Definition boundaryiterators.hh:149
    \n-
    IntersectionIndexSet(const ElementIndexSet &eis_)
    Definition boundaryiterators.hh:153
    \n-
    Definition boundaryiterators.hh:159
    \n-
    PointIterator beginPoints() const
    Definition boundaryiterators.hh:195
    \n-
    ConnectivityWriter makeConnectivity() const
    Definition boundaryiterators.hh:198
    \n-
    GV::Communication Communication
    Definition boundaryiterators.hh:175
    \n-
    static const unsigned dimCell
    Definition boundaryiterators.hh:163
    \n-
    VTK::CornerIterator< CellIterator > CornerIterator
    Definition boundaryiterators.hh:169
    \n-
    BoundaryIterator< GV > CellIterator
    Definition boundaryiterators.hh:166
    \n-
    Corner Point
    Definition boundaryiterators.hh:171
    \n-
    CornerIterator beginCorners() const
    Definition boundaryiterators.hh:188
    \n-
    CellIterator beginCells() const
    Definition boundaryiterators.hh:181
    \n-
    NonConformingConnectivityWriter< Cell > ConnectivityWriter
    Definition boundaryiterators.hh:174
    \n-
    CornerIterator endCorners() const
    Definition boundaryiterators.hh:191
    \n-
    VTK::Corner< Cell > Corner
    Definition boundaryiterators.hh:168
    \n-
    GV::Intersection Cell
    Definition boundaryiterators.hh:165
    \n-
    CornerIterator PointIterator
    Definition boundaryiterators.hh:172
    \n-
    NonConformingBoundaryIteratorFactory(const GV &gv_)
    Definition boundaryiterators.hh:177
    \n-
    CellIterator endCells() const
    Definition boundaryiterators.hh:184
    \n-
    const Communication & comm() const
    Definition boundaryiterators.hh:201
    \n-
    PointIterator endPoints() const
    Definition boundaryiterators.hh:196
    \n-
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n-
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n-
    writer for the connectivity array in nonconforming mode
    Definition functionwriter.hh:261
    \n+
    Definition basic.hh:31
    \n+
    void reset()
    Definition basic.hh:51
    \n+
    bool getnextline()
    Definition basic.cc:93
    \n+
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n+
    Definition polyhedron.hh:23
    \n+
    const int numPolys_
    Definition polyhedron.hh:65
    \n+
    PolyhedronBlock(std::istream &in, int numPolys)
    Definition polyhedron.hh:24
    \n+
    int get(std::vector< std::vector< int > > &polyhedra)
    Definition polyhedron.hh:28
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,320 +2,115 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-boundaryiterators.hh\n+ * dgfparser\n+ * blocks\n+polyhedron.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH\n-7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH\n-8\n-9#include \n-10#include \n+3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=2 sw=2 sts=2:\n+5#ifndef DUNE_POLYHEDRON_HH\n+6#define DUNE_POLYHEDRON_HH\n+7\n+8#include \n+9\n+10#include \n 11\n-12#include \n-13\n-14#include \n-15#include \n-16#include \n+12namespace Dune\n+13{\n+14\n+15 namespace dgf\n+16 {\n 17\n-18namespace Dune {\n-19\n-22\n-28 namespace VTK {\n-29\n-31\n-35 template\n-36 class BoundaryIterator\n-37 : public ForwardIteratorFacade\n-38 < BoundaryIterator,\n-39 const typename GV::Intersection,\n-40 const typename GV::Intersection&,\n-41 typename std::iterator_traits::\n-42 Iterator>::difference_type>\n-43 {\n-44 public:\n-45 // reiterator the facades typedefs here\n-46 typedef BoundaryIterator DerivedType;\n-47 typedef const typename GV::Intersection Value;\n-48 typedef Value& Reference;\n-49 typedef typename GV::template Codim<0>::Iterator ElementIterator;\n-50 typedef typename GV::IntersectionIterator IntersectionIterator;\n-51 typedef typename std::iterator_traits::difference_type\n-52 DifferenceType;\n-53\n-54 private:\n-55 typedef ForwardIteratorFacade Facade;\n-57\n-58 const GV* gv;\n-59 ElementIterator eit;\n-60 std::shared_ptr iit;\n-61\n-62 bool valid() const {\n-63 // we're valid if we're passed-the-end\n-64 if(eit == gv->template end<0>()) return true;\n-65 // or if we're on a boundary\n-66 if((*iit)->boundary() && !(*iit)->neighbor()) return true;\n-67 // otherwise we're invalid\n-68 return false;\n-69 }\n+18 // PolyhedronBlock\n+19 // ---------------\n+20\n+21 struct PolyhedronBlock\n+22 : public BasicBlock\n+23 {\n+24 explicit PolyhedronBlock ( std::istream &in, int numPolys )\n+25 : BasicBlock( in, \"Polyhedron\" ), numPolys_( numPolys )\n+26 {}\n+27\n+28 int get ( std::vector< std::vector< int > > &polyhedra )\n+29 {\n+30 reset();\n+31 std::vector< int > polyhedron;\n+32 int minPolyId = 1;\n+33 while( getnextline() )\n+34 {\n+35 polyhedron.clear();\n+36 for( int polyIdx; getnextentry( polyIdx ); )\n+37 {\n+38 if( (polyIdx < 0) || (polyIdx > numPolys_) )\n+39 DUNE_THROW( DGFException, \"Error in \" << *this << \": Invalid polygon index\n+(\" << polyIdx << \" not int [0, \" << numPolys_ << \"])\" );\n+40\n+41 minPolyId = std::min( minPolyId, polyIdx );\n+42 polyhedron.push_back( polyIdx );\n+43 }\n+44\n+45 polyhedra.push_back( polyhedron );\n+46 }\n+47\n+48 // subtract minimal number to have 0 starting numbering\n+49 if( minPolyId > 0 )\n+50 {\n+51 const size_t polySize = polyhedra.size();\n+52 for( size_t i=0; iiend(*eit)) {\n-74 iit.reset();\n-75 ++eit;\n-76 if(eit != gv->template end<0>())\n-77 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));\n-78 }\n-79 }\n-80\n-81 public:\n-82 Reference dereference() const {\n-83 return **iit;\n-84 }\n-85 bool equals(const DerivedType& other) const {\n-86 if(eit != other.eit) return false;\n-87\n-88 // this is a bit tricky, since we may not compare iit if we are\n-89 // passed-the-end\n-90 bool mePassedTheEnd = eit == gv->template end<0>();\n-91 bool otherPassedTheEnd = other.eit == other.gv->template end<0>();\n-92\n-93 // both passed-the-end => consider them equal\n-94 if(mePassedTheEnd && otherPassedTheEnd) return true;\n-95\n-96 // one passed the end => not equal\n-97 if(mePassedTheEnd || otherPassedTheEnd) return false;\n-98\n-99 // none passed-the-end => do their iit iterators match?\n-100 return *iit == *other.iit;\n-101 }\n-102\n-103 void increment() {\n-104 basic_increment();\n-105 while(!valid()) basic_increment();\n-106 }\n-107\n-109\n-113 BoundaryIterator(const GV& gv_, const ElementIterator& eit_,\n-114 const IntersectionIterator& iit_)\n-115 : gv(&gv_), eit(eit_), iit(new IntersectionIterator(iit_))\n-116 {\n-117 while(!valid()) basic_increment();\n-118 }\n-120\n-125 BoundaryIterator(const GV& gv_, const ElementIterator& eit_)\n-126 : gv(&gv_), eit(eit_)\n-127 {\n-128 if(eit != gv->template end<0>())\n-129 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));\n-130\n-131 while(!valid()) basic_increment();\n-132 }\n-134\n-138 BoundaryIterator(const GV& gv_, bool end = false)\n-139 : gv(&gv_), eit(end ? gv->template end<0>() : gv->template begin<0>())\n-140 {\n-141 if(eit != gv->template end<0>())\n-142 iit.reset(new IntersectionIterator(gv->ibegin(*eit)));\n-143\n-144 while(!valid()) basic_increment();\n-145 }\n-146 };\n-147\n-148 template\n-149 class IntersectionIndexSet {\n-150 const ElementIndexSet& eis;\n-151\n-152 public:\n-153 IntersectionIndexSet(const ElementIndexSet& eis_)\n-154 : eis(eis_)\n-155 { }\n-156 };\n-157\n-158 template\n-159 class NonConformingBoundaryIteratorFactory {\n-160 const GV& gv;\n-161\n-162 public:\n-163 static const unsigned dimCell = GV::dimension-1;\n-164\n-165 typedef typename GV::Intersection Cell;\n-166 typedef BoundaryIterator CellIterator;\n-167\n-168 typedef VTK::Corner Corner;\n-169 typedef VTK::CornerIterator CornerIterator;\n-170\n-171 typedef Corner Point;\n-172 typedef CornerIterator PointIterator;\n-173\n-174 typedef NonConformingConnectivityWriter ConnectivityWriter;\n-175 typedef typename GV::Communication Communication;\n-176\n-177 explicit NonConformingBoundaryIteratorFactory(const GV& gv_)\n-178 : gv(gv_)\n-179 { }\n-180\n-181 CellIterator beginCells() const {\n-182 return CellIterator(gv);\n-183 }\n-184 CellIterator endCells() const {\n-185 return CellIterator(gv, true);\n-186 }\n-187\n-188 CornerIterator beginCorners() const {\n-189 return CornerIterator(beginCells(), endCells());\n-190 }\n-191 CornerIterator endCorners() const {\n-192 return CornerIterator(endCells());\n-193 }\n-194\n-195 PointIterator beginPoints() const { return beginCorners(); }\n-196 PointIterator endPoints() const { return endCorners(); }\n-197\n-198 ConnectivityWriter makeConnectivity() const {\n-199 return ConnectivityWriter();\n-200 }\n-201 const Communication& comm() const {\n-202 return gv.comm();\n-203 }\n-204 };\n-205\n-206 } // namespace VTK\n-207\n-209\n-210} // namespace Dune\n-211\n-212#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH\n-corneriterator.hh\n-corner.hh\n-functionwriter.hh\n+71#endif // #ifndef DUNE_POLYHEDRON_HH\n+polygon.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::BoundaryIterator\n-iterate over the GridViews boundary intersections\n-Definition boundaryiterators.hh:43\n-Dune::VTK::BoundaryIterator::DerivedType\n-BoundaryIterator< GV > DerivedType\n-Definition boundaryiterators.hh:46\n-Dune::VTK::BoundaryIterator::BoundaryIterator\n-BoundaryIterator(const GV &gv_, const ElementIterator &eit_)\n-construct a BoundaryIterator\n-Definition boundaryiterators.hh:125\n-Dune::VTK::BoundaryIterator::dereference\n-Reference dereference() const\n-Definition boundaryiterators.hh:82\n-Dune::VTK::BoundaryIterator::Value\n-const GV::Intersection Value\n-Definition boundaryiterators.hh:47\n-Dune::VTK::BoundaryIterator::BoundaryIterator\n-BoundaryIterator(const GV &gv_, bool end=false)\n-construct a BoundaryIterator\n-Definition boundaryiterators.hh:138\n-Dune::VTK::BoundaryIterator::BoundaryIterator\n-BoundaryIterator(const GV &gv_, const ElementIterator &eit_, const\n-IntersectionIterator &iit_)\n-construct a BoundaryIterator\n-Definition boundaryiterators.hh:113\n-Dune::VTK::BoundaryIterator::ElementIterator\n-GV::template Codim< 0 >::Iterator ElementIterator\n-Definition boundaryiterators.hh:49\n-Dune::VTK::BoundaryIterator::Reference\n-Value & Reference\n-Definition boundaryiterators.hh:48\n-Dune::VTK::BoundaryIterator::IntersectionIterator\n-GV::IntersectionIterator IntersectionIterator\n-Definition boundaryiterators.hh:50\n-Dune::VTK::BoundaryIterator::equals\n-bool equals(const DerivedType &other) const\n-Definition boundaryiterators.hh:85\n-Dune::VTK::BoundaryIterator::DifferenceType\n-std::iterator_traits< ElementIterator >::difference_type DifferenceType\n-Definition boundaryiterators.hh:52\n-Dune::VTK::BoundaryIterator::increment\n-void increment()\n-Definition boundaryiterators.hh:103\n-Dune::VTK::IntersectionIndexSet\n-Definition boundaryiterators.hh:149\n-Dune::VTK::IntersectionIndexSet::IntersectionIndexSet\n-IntersectionIndexSet(const ElementIndexSet &eis_)\n-Definition boundaryiterators.hh:153\n-Dune::VTK::NonConformingBoundaryIteratorFactory\n-Definition boundaryiterators.hh:159\n-Dune::VTK::NonConformingBoundaryIteratorFactory::beginPoints\n-PointIterator beginPoints() const\n-Definition boundaryiterators.hh:195\n-Dune::VTK::NonConformingBoundaryIteratorFactory::makeConnectivity\n-ConnectivityWriter makeConnectivity() const\n-Definition boundaryiterators.hh:198\n-Dune::VTK::NonConformingBoundaryIteratorFactory::Communication\n-GV::Communication Communication\n-Definition boundaryiterators.hh:175\n-Dune::VTK::NonConformingBoundaryIteratorFactory::dimCell\n-static const unsigned dimCell\n-Definition boundaryiterators.hh:163\n-Dune::VTK::NonConformingBoundaryIteratorFactory::CornerIterator\n-VTK::CornerIterator< CellIterator > CornerIterator\n-Definition boundaryiterators.hh:169\n-Dune::VTK::NonConformingBoundaryIteratorFactory::CellIterator\n-BoundaryIterator< GV > CellIterator\n-Definition boundaryiterators.hh:166\n-Dune::VTK::NonConformingBoundaryIteratorFactory::Point\n-Corner Point\n-Definition boundaryiterators.hh:171\n-Dune::VTK::NonConformingBoundaryIteratorFactory::beginCorners\n-CornerIterator beginCorners() const\n-Definition boundaryiterators.hh:188\n-Dune::VTK::NonConformingBoundaryIteratorFactory::beginCells\n-CellIterator beginCells() const\n-Definition boundaryiterators.hh:181\n-Dune::VTK::NonConformingBoundaryIteratorFactory::ConnectivityWriter\n-NonConformingConnectivityWriter< Cell > ConnectivityWriter\n-Definition boundaryiterators.hh:174\n-Dune::VTK::NonConformingBoundaryIteratorFactory::endCorners\n-CornerIterator endCorners() const\n-Definition boundaryiterators.hh:191\n-Dune::VTK::NonConformingBoundaryIteratorFactory::Corner\n-VTK::Corner< Cell > Corner\n-Definition boundaryiterators.hh:168\n-Dune::VTK::NonConformingBoundaryIteratorFactory::Cell\n-GV::Intersection Cell\n-Definition boundaryiterators.hh:165\n-Dune::VTK::NonConformingBoundaryIteratorFactory::PointIterator\n-CornerIterator PointIterator\n-Definition boundaryiterators.hh:172\n-Dune::VTK::NonConformingBoundaryIteratorFactory::\n-NonConformingBoundaryIteratorFactory\n-NonConformingBoundaryIteratorFactory(const GV &gv_)\n-Definition boundaryiterators.hh:177\n-Dune::VTK::NonConformingBoundaryIteratorFactory::endCells\n-CellIterator endCells() const\n-Definition boundaryiterators.hh:184\n-Dune::VTK::NonConformingBoundaryIteratorFactory::comm\n-const Communication & comm() const\n-Definition boundaryiterators.hh:201\n-Dune::VTK::NonConformingBoundaryIteratorFactory::endPoints\n-PointIterator endPoints() const\n-Definition boundaryiterators.hh:196\n-Dune::VTK::Corner\n-simple class representing a corner of a cell\n-Definition corner.hh:25\n-Dune::VTK::CornerIterator\n-iterate over the corners of some cell range\n-Definition corneriterator.hh:39\n-Dune::VTK::NonConformingConnectivityWriter\n-writer for the connectivity array in nonconforming mode\n-Definition functionwriter.hh:261\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::BasicBlock::reset\n+void reset()\n+Definition basic.hh:51\n+Dune::dgf::BasicBlock::getnextline\n+bool getnextline()\n+Definition basic.cc:93\n+Dune::dgf::BasicBlock::getnextentry\n+bool getnextentry(ENTRY &entry)\n+Definition basic.hh:63\n+Dune::dgf::PolyhedronBlock\n+Definition polyhedron.hh:23\n+Dune::dgf::PolyhedronBlock::numPolys_\n+const int numPolys_\n+Definition polyhedron.hh:65\n+Dune::dgf::PolyhedronBlock::PolyhedronBlock\n+PolyhedronBlock(std::istream &in, int numPolys)\n+Definition polyhedron.hh:24\n+Dune::dgf::PolyhedronBlock::get\n+int get(std::vector< std::vector< int > > &polyhedra)\n+Definition polyhedron.hh:28\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00920.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00920.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: volumeiterators.hh File Reference\n+dune-grid: interval.cc File Reference\n \n \n \n \n \n \n \n@@ -65,45 +65,31 @@\n \n \n \n \n \n \n \n
    \n \n-
    volumeiterators.hh File Reference
    \n+
    interval.cc File Reference
    \n
    \n
    \n-\n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::VTK::ConformingVolumeIteratorFactory< GV >
     
    class  Dune::VTK::NonConformingVolumeIteratorFactory< GV >
     
    \n+
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-volumeiterators.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 \u00a0 Dune::VTK::ConformingVolumeIteratorFactory<_GV_>\n-\u00a0\n-class \u00a0 Dune::VTK::NonConformingVolumeIteratorFactory<_GV_>\n-\u00a0\n+ * dgfparser\n+ * blocks\n+Namespaces\n+interval.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n+namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00923.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00923.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: subsamplingvtkwriter.hh File Reference\n+dune-grid: polygon.hh File Reference\n \n \n \n \n \n \n \n@@ -65,52 +65,44 @@\n \n \n \n \n \n \n \n
    \n \n-
    subsamplingvtkwriter.hh File Reference
    \n+
    polygon.hh File Reference
    \n
    \n
    \n-\n-

    Provides subsampled file i/o for the visualization toolkit. \n-More...

    \n-
    #include <ostream>
    \n-#include <memory>
    \n-#include <dune/common/indent.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/geometry/virtualrefinement.hh>
    \n-#include <dune/grid/io/file/vtk/vtkwriter.hh>
    \n-#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n+
    #include <iostream>
    \n+#include <vector>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::SubsamplingVTKWriter< GridView >
     Writer for the output of subsampled grid functions in the vtk format. More...
    struct  Dune::dgf::PolygonBlock
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-

    Detailed Description

    \n-

    Provides subsampled file i/o for the visualization toolkit.

    \n-
    Author
    J\u00f6 Fahlke
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-utf-8\n+us-ascii\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,34 +2,27 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n+ * blocks\n Classes | Namespaces\n-subsamplingvtkwriter.hh File Reference\n-Provides subsampled file i/o for the visualization toolkit. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+polygon.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::SubsamplingVTKWriter<_GridView_>\n-\u00a0 Writer for the output of subsampled grid functions in the vtk format.\n- More...\n+struct \u00a0 Dune::dgf::PolygonBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Provides subsampled file i/o for the visualization toolkit.\n- Author\n- J\u00c3\u00b6 Fahlke\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00923_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00923_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: subsamplingvtkwriter.hh Source File\n+dune-grid: polygon.hh Source File\n \n \n \n \n \n \n \n@@ -70,408 +70,95 @@\n \n \n \n \n \n \n \n
    \n-
    subsamplingvtkwriter.hh
    \n+
    polygon.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_SUBSAMPLINGVTKWRITER_HH
    \n-
    7#define DUNE_SUBSAMPLINGVTKWRITER_HH
    \n-
    8
    \n-
    9#include <ostream>
    \n-
    10#include <memory>
    \n-
    11
    \n-
    12#include <dune/common/indent.hh>
    \n-
    13#include <dune/geometry/type.hh>
    \n-
    14#include <dune/geometry/virtualrefinement.hh>
    \n-\n-\n-
    17
    \n-
    24namespace Dune
    \n-
    25{
    \n-
    37 template< class GridView >
    \n-
    \n-\n-
    39 : public VTKWriter<GridView>
    \n-
    40 {
    \n-\n-
    42 constexpr static int dim = GridView::dimension;
    \n-
    43 constexpr static int dimw = GridView::dimensionworld;
    \n-
    44 typedef typename GridView::Grid::ctype ctype;
    \n-
    45 typedef typename GridView::template Codim< 0 >::Entity Entity;
    \n-
    46 typedef VirtualRefinement<dim, ctype> Refinement;
    \n-
    47 typedef typename Refinement::IndexVector IndexVector;
    \n-
    48 typedef typename Refinement::ElementIterator SubElementIterator;
    \n-
    49 typedef typename Refinement::VertexIterator SubVertexIterator;
    \n-
    50
    \n-
    51 typedef typename Base::CellIterator CellIterator;
    \n-
    52 typedef typename Base::FunctionIterator FunctionIterator;
    \n-
    53 using Base::cellBegin;
    \n-
    54 using Base::cellEnd;
    \n-
    55 using Base::celldata;
    \n-
    56 using Base::ncells;
    \n-
    57 using Base::ncorners;
    \n-
    58 using Base::nvertices;
    \n-
    59 using Base::outputtype;
    \n-\n-
    61 using Base::vertexEnd;
    \n-
    62 using Base::vertexdata;
    \n-
    63
    \n-
    64 public:
    \n-
    \n-
    80 explicit SubsamplingVTKWriter (const GridView &gridView,
    \n-
    81 Dune::RefinementIntervals intervals_, bool coerceToSimplex_ = false,
    \n-\n-
    83 : Base(gridView, VTK::nonconforming, coordPrecision)
    \n-
    84 , intervals(intervals_), coerceToSimplex(coerceToSimplex_)
    \n-
    85 {
    \n-
    86 if(intervals_.intervals() < 1) {
    \n-
    87 DUNE_THROW(Dune::IOError,"SubsamplingVTKWriter: Refinement intervals must be larger than zero! (One interval means no subsampling)");
    \n-
    88 }
    \n-
    89 }
    \n-
    \n-
    90
    \n-
    91 private:
    \n-
    92 GeometryType subsampledGeometryType(GeometryType geometryType)
    \n-
    93 {
    \n-
    94 return (geometryType.isCube() && !coerceToSimplex ? geometryType : GeometryTypes::simplex(dim));
    \n-
    95 }
    \n-
    96
    \n-
    97 template<typename SubIterator>
    \n-
    98 struct IteratorSelector
    \n-
    99 {};
    \n-
    100
    \n-
    101 SubElementIterator refinementBegin(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubElementIterator>)
    \n-
    102 {
    \n-
    103 return refinement.eBegin(intervals);
    \n-
    104 }
    \n-
    105
    \n-
    106 SubVertexIterator refinementBegin(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubVertexIterator>)
    \n-
    107 {
    \n-
    108 return refinement.vBegin(intervals);
    \n-
    109 }
    \n-
    110
    \n-
    111 SubElementIterator refinementEnd(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubElementIterator>)
    \n-
    112 {
    \n-
    113 return refinement.eEnd(intervals);
    \n-
    114 }
    \n-
    115
    \n-
    116 SubVertexIterator refinementEnd(const Refinement& refinement, Dune::RefinementIntervals intervals, IteratorSelector<SubVertexIterator>)
    \n-
    117 {
    \n-
    118 return refinement.vEnd(intervals);
    \n-
    119 }
    \n-
    120
    \n-
    121 template<typename Data, typename Iterator, typename SubIterator>
    \n-
    122 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator begin, const Iterator end, int nentries, IteratorSelector<SubIterator> sis)
    \n-
    123 {
    \n-
    124 for (auto it = data.begin(),
    \n-
    125 iend = data.end();
    \n-
    126 it != iend;
    \n-
    127 ++it)
    \n-
    128 {
    \n-
    129 const auto& f = *it;
    \n-
    130 VTK::FieldInfo fieldInfo = f.fieldInfo();
    \n-
    131 std::size_t writecomps = fieldInfo.size();
    \n-
    132 switch (fieldInfo.type())
    \n-
    133 {
    \n-\n-
    135 break;
    \n-\n-
    137 // vtk file format: a vector data always should have 3 comps (with
    \n-
    138 // 3rd comp = 0 in 2D case)
    \n-
    139 if (writecomps > 3)
    \n-
    140 DUNE_THROW(IOError,"Cannot write VTK vectors with more than 3 components (components was " << writecomps << ")");
    \n-
    141 writecomps = 3;
    \n-
    142 break;
    \n-\n-
    144 DUNE_THROW(NotImplemented,"VTK output for tensors not implemented yet");
    \n-
    145 }
    \n-
    146 std::shared_ptr<VTK::DataArrayWriter> p
    \n-
    147 (writer.makeArrayWriter(f.name(), writecomps, nentries, fieldInfo.precision()));
    \n-
    148 if(!p->writeIsNoop())
    \n-
    149 for (Iterator eit = begin; eit!=end; ++eit)
    \n-
    150 {
    \n-
    151 const Entity & e = *eit;
    \n-
    152 f.bind(e);
    \n-
    153 Refinement &refinement =
    \n-
    154 buildRefinement<dim, ctype>(eit->type(),
    \n-
    155 subsampledGeometryType(eit->type()));
    \n-
    156 for(SubIterator sit = refinementBegin(refinement,intervals,sis),
    \n-
    157 send = refinementEnd(refinement,intervals,sis);
    \n-
    158 sit != send;
    \n-
    159 ++sit)
    \n-
    160 {
    \n-
    161 f.write(sit.coords(),*p);
    \n-
    162 // expand 2D-Vectors to 3D for VTK format
    \n-
    163 for(unsigned j = f.fieldInfo().size(); j < writecomps; j++)
    \n-
    164 p->write(0.0);
    \n-
    165 }
    \n-
    166 f.unbind();
    \n-
    167 }
    \n-
    168 }
    \n-
    169 }
    \n-
    170
    \n-
    171
    \n-
    172 protected:
    \n-
    174 virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_);
    \n-
    175
    \n-
    177 virtual void writeCellData(VTK::VTUWriter& writer);
    \n-
    178
    \n-
    180 virtual void writeVertexData(VTK::VTUWriter& writer);
    \n-
    181
    \n-
    183 virtual void writeGridPoints(VTK::VTUWriter& writer);
    \n-
    184
    \n-
    186 virtual void writeGridCells(VTK::VTUWriter& writer);
    \n-
    187
    \n-
    188 public:
    \n-\n-
    190 using Base::addCellData;
    \n-
    191
    \n-
    192 private:
    \n-
    193 // hide addVertexData -- adding raw data directly without a VTKFunction
    \n-
    194 // currently does not make sense for subsampled meshes, as the higher order
    \n-
    195 // information is missing. See FS#676.
    \n-
    196 template<class V>
    \n-
    197 void addVertexData (const V& v, const std::string &name, int ncomps=1);
    \n-
    198 template<class V>
    \n-
    199 void addCellData (const V& v, const std::string &name, int ncomps=1);
    \n-
    200
    \n-
    201 Dune::RefinementIntervals intervals;
    \n-
    202 bool coerceToSimplex;
    \n-
    203 };
    \n-
    \n-
    204
    \n-
    206 template <class GridView>
    \n-
    \n-
    207 void SubsamplingVTKWriter<GridView>::countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    \n-
    208 {
    \n-
    209 nvertices_ = 0;
    \n-
    210 ncells_ = 0;
    \n-
    211 ncorners_ = 0;
    \n-
    212 for (CellIterator it=this->cellBegin(); it!=cellEnd(); ++it)
    \n-
    213 {
    \n-
    214 Refinement &refinement = buildRefinement<dim, ctype>(it->type(), subsampledGeometryType(it->type()));
    \n-
    215
    \n-
    216 ncells_ += refinement.nElements(intervals);
    \n-
    217 nvertices_ += refinement.nVertices(intervals);
    \n-
    218 ncorners_ += refinement.nElements(intervals) * refinement.eBegin(intervals).vertexIndices().size();
    \n-
    219 }
    \n-
    220 }
    \n-
    \n-
    221
    \n-
    222
    \n-
    224 template <class GridView>
    \n-
    \n-\n-
    226 {
    \n-
    227 if(celldata.size() == 0)
    \n-
    228 return;
    \n-
    229
    \n-
    230 // Find the names of the first scalar and vector data fields.
    \n-
    231 // These will be marked as the default fields (the ones that ParaView shows
    \n-
    232 // when the file has just been opened).
    \n-
    233 std::string defaultScalarField, defaultVectorField;
    \n-
    234 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames(celldata);
    \n-
    235
    \n-
    236 writer.beginCellData(defaultScalarField, defaultVectorField);
    \n-
    237 writeData(writer,celldata,cellBegin(),cellEnd(),ncells,IteratorSelector<SubElementIterator>());
    \n-
    238 writer.endCellData();
    \n-
    239 }
    \n-
    \n-
    240
    \n-
    242 template <class GridView>
    \n-
    \n-\n-
    244 {
    \n-
    245 if(vertexdata.size() == 0)
    \n-
    246 return;
    \n-
    247
    \n-
    248 // Find the names of the first scalar and vector data fields.
    \n-
    249 // These will be marked as the default fields (the ones that ParaView shows
    \n-
    250 // when the file has just been opened).
    \n-
    251 std::string defaultScalarField, defaultVectorField;
    \n-
    252 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames(vertexdata);
    \n-
    253
    \n-
    254 writer.beginPointData(defaultScalarField, defaultVectorField);
    \n-
    255 writeData(writer,vertexdata,cellBegin(),cellEnd(),nvertices,IteratorSelector<SubVertexIterator>());
    \n-
    256 writer.endPointData();
    \n-
    257 }
    \n-
    \n-
    258
    \n-
    260 template <class GridView>
    \n-
    \n-\n-
    262 {
    \n-
    263 writer.beginPoints();
    \n-
    264
    \n-
    265 std::shared_ptr<VTK::DataArrayWriter> p
    \n-
    266 (writer.makeArrayWriter("Coordinates", 3, nvertices, this->coordPrecision()));
    \n-
    267 if(!p->writeIsNoop())
    \n-
    268 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)
    \n-
    269 {
    \n-
    270 Refinement &refinement =
    \n-
    271 buildRefinement<dim, ctype>(i->type(),
    \n-
    272 subsampledGeometryType(i->type()));
    \n-
    273 for(SubVertexIterator sit = refinement.vBegin(intervals),
    \n-
    274 send = refinement.vEnd(intervals);
    \n-
    275 sit != send; ++sit)
    \n-
    276 {
    \n-
    277 FieldVector<ctype, dimw> coords = i->geometry().global(sit.coords());
    \n-
    278 for (int j=0; j<std::min(int(dimw),3); j++)
    \n-
    279 p->write(coords[j]);
    \n-
    280 for (int j=std::min(int(dimw),3); j<3; j++)
    \n-
    281 p->write(0.0);
    \n-
    282 }
    \n-
    283 }
    \n-
    284 // free the VTK::DataArrayWriter before touching the stream
    \n-
    285 p.reset();
    \n-
    286
    \n-
    287 writer.endPoints();
    \n-
    288 }
    \n-
    \n-
    289
    \n-
    291 template <class GridView>
    \n-
    \n-\n-
    293 {
    \n-
    294 writer.beginCells();
    \n-
    295
    \n-
    296 // connectivity
    \n-
    297 {
    \n-
    298 std::shared_ptr<VTK::DataArrayWriter> p1
    \n-
    299 (writer.makeArrayWriter("connectivity", 1, ncorners, VTK::Precision::int32));
    \n-
    300 // The offset within the index numbering
    \n-
    301 if(!p1->writeIsNoop()) {
    \n-
    302 int offset = 0;
    \n-
    303 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)
    \n-
    304 {
    \n-
    305 GeometryType coercedToType = subsampledGeometryType(i->type());
    \n-
    306 Refinement &refinement =
    \n-
    307 buildRefinement<dim, ctype>(i->type(), coercedToType);
    \n-
    308 for(SubElementIterator sit = refinement.eBegin(intervals),
    \n-
    309 send = refinement.eEnd(intervals);
    \n-
    310 sit != send; ++sit)
    \n-
    311 {
    \n-
    312 IndexVector indices = sit.vertexIndices();
    \n-
    313 for(unsigned int ii = 0; ii < indices.size(); ++ii)
    \n-
    314 p1->write(offset+indices[VTK::renumber(coercedToType, ii)]);
    \n-
    315 }
    \n-
    316 offset += refinement.nVertices(intervals);
    \n-
    317 }
    \n-
    318 }
    \n-
    319 }
    \n-
    320
    \n-
    321 // offsets
    \n-
    322 {
    \n-
    323 std::shared_ptr<VTK::DataArrayWriter> p2
    \n-
    324 (writer.makeArrayWriter("offsets", 1, ncells, VTK::Precision::int32));
    \n-
    325 if(!p2->writeIsNoop()) {
    \n-
    326 // The offset into the connectivity array
    \n-
    327 int offset = 0;
    \n-
    328 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)
    \n-
    329 {
    \n-
    330 Refinement &refinement =
    \n-
    331 buildRefinement<dim, ctype>(i->type(),
    \n-
    332 subsampledGeometryType(i->type()));
    \n-
    333 unsigned int verticesPerCell =
    \n-
    334 refinement.eBegin(intervals).vertexIndices().size();
    \n-
    335 for(int element = 0; element < refinement.nElements(intervals);
    \n-
    336 ++element)
    \n-
    337 {
    \n-
    338 offset += verticesPerCell;
    \n-
    339 p2->write(offset);
    \n-
    340 }
    \n-
    341 }
    \n-
    342 }
    \n-
    343 }
    \n-
    344
    \n-
    345 // types
    \n-
    346 if (dim>1)
    \n-
    347 {
    \n-
    348 std::shared_ptr<VTK::DataArrayWriter> p3
    \n-
    349 (writer.makeArrayWriter("types", 1, ncells, VTK::Precision::uint8));
    \n-
    350 if(!p3->writeIsNoop())
    \n-
    351 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n-
    352 {
    \n-
    353 GeometryType coerceTo = subsampledGeometryType(it->type());
    \n-
    354 Refinement &refinement =
    \n-
    355 buildRefinement<dim, ctype>(it->type(), coerceTo);
    \n-
    356 int vtktype = VTK::geometryType(coerceTo);
    \n-
    357 for(int i = 0; i < refinement.nElements(intervals); ++i)
    \n-
    358 p3->write(vtktype);
    \n-
    359 }
    \n-
    360 }
    \n-
    361
    \n-
    362 writer.endCells();
    \n-
    363 }
    \n-
    \n-
    364}
    \n-
    365
    \n-
    366#endif // DUNE_SUBSAMPLINGVTKWRITER_HH
    \n-
    Provides file i/o for the visualization toolkit.
    \n-\n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n+
    3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=2 sw=2 sts=2:
    \n+
    5#ifndef DUNE_POLYGON_HH
    \n+
    6#define DUNE_POLYGON_HH
    \n+
    7
    \n+
    8#include <iostream>
    \n+
    9#include <vector>
    \n+
    10
    \n+
    11#include <dune/common/typetraits.hh>
    \n+\n+
    13
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17 namespace dgf
    \n+
    18 {
    \n+
    19
    \n+
    20 // PolygonBlock
    \n+
    21 // ------------
    \n+
    22
    \n+
    \n+\n+
    24 : public BasicBlock
    \n+
    25 {
    \n+
    \n+
    26 PolygonBlock ( std::istream &in, int numVtx, int vtxOfs )
    \n+
    27 : BasicBlock( in, "Polygon" ), vtxBegin_( vtxOfs ), vtxEnd_( vtxOfs + numVtx )
    \n+
    28 {}
    \n+
    \n+
    29
    \n+
    \n+
    30 int get ( std::vector< std::vector< int > > &polygons )
    \n+
    31 {
    \n+
    32 reset();
    \n+
    33 std::vector< int > polygon;
    \n+
    34 while( getnextline() )
    \n+
    35 {
    \n+
    36 polygon.clear();
    \n+
    37 for( int vtxIdx; getnextentry( vtxIdx ); )
    \n+
    38 {
    \n+
    39 if( (vtxBegin_ > vtxIdx) || (vtxIdx >= vtxEnd_) )
    \n+
    40 DUNE_THROW( DGFException, "Error in " << *this << ": Invalid vertex index (" << vtxIdx << " not int [" << vtxBegin_ << ", " << vtxEnd_ << "[)" );
    \n+
    41 polygon.push_back( vtxIdx - vtxBegin_ );
    \n+
    42 }
    \n+
    43
    \n+
    44 polygons.push_back( polygon );
    \n+
    45 }
    \n+
    46 return polygons.size();
    \n+
    47 }
    \n+
    \n+
    48
    \n+
    49 protected:
    \n+\n+
    51 };
    \n+
    \n+
    52
    \n+
    53 } // namespace dgf
    \n+
    54} // end namespace Dune
    \n+
    55
    \n+
    56#endif // #ifndef DUNE_POLYGON_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-\n-\n-
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n-
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n-
    @ tensor
    tensor field (always 3x3)
    \n-
    @ vector
    vector-valued field (always 3D, will be padded if necessary)
    \n-\n-
    Writer for the output of subsampled grid functions in the vtk format.
    Definition subsamplingvtkwriter.hh:40
    \n-
    virtual void writeGridPoints(VTK::VTUWriter &writer)
    write the positions of vertices
    Definition subsamplingvtkwriter.hh:261
    \n-
    virtual void writeVertexData(VTK::VTUWriter &writer)
    write vertex data
    Definition subsamplingvtkwriter.hh:243
    \n-
    SubsamplingVTKWriter(const GridView &gridView, Dune::RefinementIntervals intervals_, bool coerceToSimplex_=false, VTK::Precision coordPrecision=VTK::Precision::float32)
    Construct a SubsamplingVTKWriter working on a specific GridView.
    Definition subsamplingvtkwriter.hh:80
    \n-
    virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    count the vertices, cells and corners
    Definition subsamplingvtkwriter.hh:207
    \n-
    virtual void writeCellData(VTK::VTUWriter &writer)
    write cell data
    Definition subsamplingvtkwriter.hh:225
    \n-
    virtual void writeGridCells(VTK::VTUWriter &writer)
    write the connectivity array
    Definition subsamplingvtkwriter.hh:292
    \n-
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n-
    VertexIterator vertexBegin() const
    Definition vtkwriter.hh:508
    \n-
    void addVertexData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the vertices of the grid to the visualization.
    Definition vtkwriter.hh:713
    \n-
    CellIterator cellEnd() const
    Definition vtkwriter.hh:402
    \n-
    std::list< VTKLocalFunction > vertexdata
    Definition vtkwriter.hh:1589
    \n-
    void addCellData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the cells of the grid to the visualization.
    Definition vtkwriter.hh:649
    \n-
    CellIterator cellBegin() const
    Definition vtkwriter.hh:397
    \n-
    VTK::OutputType outputtype
    Definition vtkwriter.hh:1613
    \n-
    std::list< VTKLocalFunction > celldata
    Definition vtkwriter.hh:1588
    \n-
    VTK::Precision coordPrecision() const
    get the precision with which coordinates are written out
    Definition vtkwriter.hh:782
    \n-
    std::list< VTKLocalFunction >::const_iterator FunctionIterator
    Definition vtkwriter.hh:376
    \n-
    int nvertices
    Definition vtkwriter.hh:1596
    \n-
    int ncells
    Definition vtkwriter.hh:1595
    \n-
    VertexIterator vertexEnd() const
    Definition vtkwriter.hh:515
    \n-
    int ncorners
    Definition vtkwriter.hh:1597
    \n-
    Iterator over the grids elements.
    Definition vtkwriter.hh:385
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n-
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n-
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n-
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n-
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n-
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n-
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n-
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n-
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n-
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n+
    Definition basic.hh:31
    \n+
    void reset()
    Definition basic.hh:51
    \n+
    bool getnextline()
    Definition basic.cc:93
    \n+
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n+
    Definition polygon.hh:25
    \n+
    PolygonBlock(std::istream &in, int numVtx, int vtxOfs)
    Definition polygon.hh:26
    \n+
    int get(std::vector< std::vector< int > > &polygons)
    Definition polygon.hh:30
    \n+
    int vtxEnd_
    Definition polygon.hh:50
    \n+
    int vtxBegin_
    Definition polygon.hh:50
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,527 +2,104 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-subsamplingvtkwriter.hh\n+ * dgfparser\n+ * blocks\n+polygon.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_SUBSAMPLINGVTKWRITER_HH\n-7#define DUNE_SUBSAMPLINGVTKWRITER_HH\n-8\n-9#include \n-10#include \n-11\n-12#include \n-13#include \n-14#include \n-15#include \n-16#include \n-17\n-24namespace Dune\n-25{\n-37 template< class GridView >\n-38 class SubsamplingVTKWriter\n-39 : public VTKWriter\n-40 {\n-41 typedef VTKWriter Base;\n-42 constexpr static int dim = GridView::dimension;\n-43 constexpr static int dimw = GridView::dimensionworld;\n-44 typedef typename GridView::Grid::ctype ctype;\n-45 typedef typename GridView::template Codim< 0 >::Entity Entity;\n-46 typedef VirtualRefinement Refinement;\n-47 typedef typename Refinement::IndexVector IndexVector;\n-48 typedef typename Refinement::ElementIterator SubElementIterator;\n-49 typedef typename Refinement::VertexIterator SubVertexIterator;\n-50\n-51 typedef typename Base::CellIterator CellIterator;\n-52 typedef typename Base::FunctionIterator FunctionIterator;\n-53 using Base::cellBegin;\n-54 using Base::cellEnd;\n-55 using Base::celldata;\n-56 using Base::ncells;\n-57 using Base::ncorners;\n-58 using Base::nvertices;\n-59 using Base::outputtype;\n-60 using Base::vertexBegin;\n-61 using Base::vertexEnd;\n-62 using Base::vertexdata;\n-63\n-64 public:\n-80 explicit SubsamplingVTKWriter (const GridView &gridView,\n-81 Dune::RefinementIntervals intervals_, bool coerceToSimplex_ = false,\n-82 VTK::Precision coordPrecision = VTK::Precision::float32)\n-83 : Base(gridView, VTK::nonconforming, coordPrecision)\n-84 , intervals(intervals_), coerceToSimplex(coerceToSimplex_)\n-85 {\n-86 if(intervals_.intervals() < 1) {\n-87 DUNE_THROW(Dune::IOError,\"SubsamplingVTKWriter: Refinement intervals must be\n-larger than zero! (One interval means no subsampling)\");\n-88 }\n-89 }\n-90\n-91 private:\n-92 GeometryType subsampledGeometryType(GeometryType geometryType)\n-93 {\n-94 return (geometryType.isCube() && !coerceToSimplex ? geometryType :\n-GeometryTypes::simplex(dim));\n-95 }\n-96\n-97 template\n-98 struct IteratorSelector\n-99 {};\n-100\n-101 SubElementIterator refinementBegin(const Refinement& refinement, Dune::\n-RefinementIntervals intervals, IteratorSelector)\n-102 {\n-103 return refinement.eBegin(intervals);\n-104 }\n-105\n-106 SubVertexIterator refinementBegin(const Refinement& refinement, Dune::\n-RefinementIntervals intervals, IteratorSelector)\n-107 {\n-108 return refinement.vBegin(intervals);\n-109 }\n-110\n-111 SubElementIterator refinementEnd(const Refinement& refinement, Dune::\n-RefinementIntervals intervals, IteratorSelector)\n-112 {\n-113 return refinement.eEnd(intervals);\n-114 }\n-115\n-116 SubVertexIterator refinementEnd(const Refinement& refinement, Dune::\n-RefinementIntervals intervals, IteratorSelector)\n-117 {\n-118 return refinement.vEnd(intervals);\n-119 }\n-120\n-121 template\n-122 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator\n-begin, const Iterator end, int nentries, IteratorSelector sis)\n-123 {\n-124 for (auto it = data.begin(),\n-125 iend = data.end();\n-126 it != iend;\n-127 ++it)\n-128 {\n-129 const auto& f = *it;\n-130 VTK::FieldInfo fieldInfo = f.fieldInfo();\n-131 std::size_t writecomps = fieldInfo.size();\n-132 switch (fieldInfo.type())\n-133 {\n-134 case VTK::FieldInfo::Type::scalar:\n-135 break;\n-136 case VTK::FieldInfo::Type::vector:\n-137 // vtk file format: a vector data always should have 3 comps (with\n-138 // 3rd comp = 0 in 2D case)\n-139 if (writecomps > 3)\n-140 DUNE_THROW(IOError,\"Cannot write VTK vectors with more than 3 components\n-(components was \" << writecomps << \")\");\n-141 writecomps = 3;\n-142 break;\n-143 case VTK::FieldInfo::Type::tensor:\n-144 DUNE_THROW(NotImplemented,\"VTK output for tensors not implemented yet\");\n-145 }\n-146 std::shared_ptr p\n-147 (writer.makeArrayWriter(f.name(), writecomps, nentries, fieldInfo.precision\n-()));\n-148 if(!p->writeIsNoop())\n-149 for (Iterator eit = begin; eit!=end; ++eit)\n-150 {\n-151 const Entity & e = *eit;\n-152 f.bind(e);\n-153 Refinement &refinement =\n-154 buildRefinement(eit->type(),\n-155 subsampledGeometryType(eit->type()));\n-156 for(SubIterator sit = refinementBegin(refinement,intervals,sis),\n-157 send = refinementEnd(refinement,intervals,sis);\n-158 sit != send;\n-159 ++sit)\n-160 {\n-161 f.write(sit.coords(),*p);\n-162 // expand 2D-Vectors to 3D for VTK format\n-163 for(unsigned j = f.fieldInfo().size(); j < writecomps; j++)\n-164 p->write(0.0);\n-165 }\n-166 f.unbind();\n-167 }\n-168 }\n-169 }\n-170\n-171\n-172 protected:\n-174 virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_);\n-175\n-177 virtual void writeCellData(VTK::VTUWriter& writer);\n-178\n-180 virtual void writeVertexData(VTK::VTUWriter& writer);\n-181\n-183 virtual void writeGridPoints(VTK::VTUWriter& writer);\n-184\n-186 virtual void writeGridCells(VTK::VTUWriter& writer);\n-187\n-188 public:\n-189 using Base::addVertexData;\n-190 using Base::addCellData;\n-191\n-192 private:\n-193 // hide addVertexData -- adding raw data directly without a VTKFunction\n-194 // currently does not make sense for subsampled meshes, as the higher order\n-195 // information is missing. See FS#676.\n-196 template\n-197 void addVertexData (const V& v, const std::string &name, int ncomps=1);\n-198 template\n-199 void addCellData (const V& v, const std::string &name, int ncomps=1);\n-200\n-201 Dune::RefinementIntervals intervals;\n-202 bool coerceToSimplex;\n-203 };\n-204\n-206 template \n-207 void SubsamplingVTKWriter::countEntities(int &nvertices_, int\n-&ncells_, int &ncorners_)\n-208 {\n-209 nvertices_ = 0;\n-210 ncells_ = 0;\n-211 ncorners_ = 0;\n-212 for (CellIterator it=this->cellBegin(); it!=cellEnd(); ++it)\n-213 {\n-214 Refinement &refinement = buildRefinement(it->type(),\n-subsampledGeometryType(it->type()));\n-215\n-216 ncells_ += refinement.nElements(intervals);\n-217 nvertices_ += refinement.nVertices(intervals);\n-218 ncorners_ += refinement.nElements(intervals) * refinement.eBegin\n-(intervals).vertexIndices().size();\n-219 }\n-220 }\n-221\n-222\n-224 template \n-225 void SubsamplingVTKWriter::writeCellData(VTK::VTUWriter& writer)\n-226 {\n-227 if(celldata.size() == 0)\n-228 return;\n-229\n-230 // Find the names of the first scalar and vector data fields.\n-231 // These will be marked as the default fields (the ones that ParaView shows\n-232 // when the file has just been opened).\n-233 std::string defaultScalarField, defaultVectorField;\n-234 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames\n-(celldata);\n-235\n-236 writer.beginCellData(defaultScalarField, defaultVectorField);\n-237 writeData(writer,celldata,cellBegin(),cellEnd\n-(),ncells,IteratorSelector());\n-238 writer.endCellData();\n-239 }\n-240\n-242 template \n-243 void SubsamplingVTKWriter::writeVertexData(VTK::VTUWriter&\n-writer)\n-244 {\n-245 if(vertexdata.size() == 0)\n-246 return;\n-247\n-248 // Find the names of the first scalar and vector data fields.\n-249 // These will be marked as the default fields (the ones that ParaView shows\n-250 // when the file has just been opened).\n-251 std::string defaultScalarField, defaultVectorField;\n-252 std::tie(defaultScalarField, defaultVectorField) = this->getDataNames\n-(vertexdata);\n-253\n-254 writer.beginPointData(defaultScalarField, defaultVectorField);\n-255 writeData(writer,vertexdata,cellBegin(),cellEnd\n-(),nvertices,IteratorSelector());\n-256 writer.endPointData();\n-257 }\n-258\n-260 template \n-261 void SubsamplingVTKWriter::writeGridPoints(VTK::VTUWriter&\n-writer)\n-262 {\n-263 writer.beginPoints();\n-264\n-265 std::shared_ptr p\n-266 (writer.makeArrayWriter(\"Coordinates\", 3, nvertices, this->coordPrecision\n-()));\n-267 if(!p->writeIsNoop())\n-268 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)\n-269 {\n-270 Refinement &refinement =\n-271 buildRefinement(i->type(),\n-272 subsampledGeometryType(i->type()));\n-273 for(SubVertexIterator sit = refinement.vBegin(intervals),\n-274 send = refinement.vEnd(intervals);\n-275 sit != send; ++sit)\n-276 {\n-277 FieldVector coords = i->geometry().global(sit.coords());\n-278 for (int j=0; jwrite(coords[j]);\n-280 for (int j=std::min(int(dimw),3); j<3; j++)\n-281 p->write(0.0);\n-282 }\n-283 }\n-284 // free the VTK::DataArrayWriter before touching the stream\n-285 p.reset();\n-286\n-287 writer.endPoints();\n-288 }\n-289\n-291 template \n-292 void SubsamplingVTKWriter::writeGridCells(VTK::VTUWriter& writer)\n-293 {\n-294 writer.beginCells();\n-295\n-296 // connectivity\n-297 {\n-298 std::shared_ptr p1\n-299 (writer.makeArrayWriter(\"connectivity\", 1, ncorners, VTK::Precision::\n-int32));\n-300 // The offset within the index numbering\n-301 if(!p1->writeIsNoop()) {\n-302 int offset = 0;\n-303 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)\n-304 {\n-305 GeometryType coercedToType = subsampledGeometryType(i->type());\n-306 Refinement &refinement =\n-307 buildRefinement(i->type(), coercedToType);\n-308 for(SubElementIterator sit = refinement.eBegin(intervals),\n-309 send = refinement.eEnd(intervals);\n-310 sit != send; ++sit)\n-311 {\n-312 IndexVector indices = sit.vertexIndices();\n-313 for(unsigned int ii = 0; ii < indices.size(); ++ii)\n-314 p1->write(offset+indices[VTK::renumber(coercedToType, ii)]);\n-315 }\n-316 offset += refinement.nVertices(intervals);\n-317 }\n-318 }\n-319 }\n-320\n-321 // offsets\n-322 {\n-323 std::shared_ptr p2\n-324 (writer.makeArrayWriter(\"offsets\", 1, ncells, VTK::Precision::int32));\n-325 if(!p2->writeIsNoop()) {\n-326 // The offset into the connectivity array\n-327 int offset = 0;\n-328 for (CellIterator i=cellBegin(); i!=cellEnd(); ++i)\n-329 {\n-330 Refinement &refinement =\n-331 buildRefinement(i->type(),\n-332 subsampledGeometryType(i->type()));\n-333 unsigned int verticesPerCell =\n-334 refinement.eBegin(intervals).vertexIndices().size();\n-335 for(int element = 0; element < refinement.nElements(intervals);\n-336 ++element)\n-337 {\n-338 offset += verticesPerCell;\n-339 p2->write(offset);\n-340 }\n-341 }\n-342 }\n-343 }\n-344\n-345 // types\n-346 if (dim>1)\n-347 {\n-348 std::shared_ptr p3\n-349 (writer.makeArrayWriter(\"types\", 1, ncells, VTK::Precision::uint8));\n-350 if(!p3->writeIsNoop())\n-351 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)\n-352 {\n-353 GeometryType coerceTo = subsampledGeometryType(it->type());\n-354 Refinement &refinement =\n-355 buildRefinement(it->type(), coerceTo);\n-356 int vtktype = VTK::geometryType(coerceTo);\n-357 for(int i = 0; i < refinement.nElements(intervals); ++i)\n-358 p3->write(vtktype);\n-359 }\n-360 }\n-361\n-362 writer.endCells();\n-363 }\n-364}\n-365\n-366#endif // DUNE_SUBSAMPLINGVTKWRITER_HH\n-vtkwriter.hh\n-Provides file i/o for the visualization toolkit.\n-vtuwriter.hh\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n-Dune::GridView::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/gridview.hh:137\n+3// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=2 sw=2 sts=2:\n+5#ifndef DUNE_POLYGON_HH\n+6#define DUNE_POLYGON_HH\n+7\n+8#include \n+9#include \n+10\n+11#include \n+12#include \n+13\n+14namespace Dune\n+15{\n+16\n+17 namespace dgf\n+18 {\n+19\n+20 // PolygonBlock\n+21 // ------------\n+22\n+23 struct PolygonBlock\n+24 : public BasicBlock\n+25 {\n+26 PolygonBlock ( std::istream &in, int numVtx, int vtxOfs )\n+27 : BasicBlock( in, \"Polygon\" ), vtxBegin_( vtxOfs ), vtxEnd_( vtxOfs + numVtx\n+)\n+28 {}\n+29\n+30 int get ( std::vector< std::vector< int > > &polygons )\n+31 {\n+32 reset();\n+33 std::vector< int > polygon;\n+34 while( getnextline() )\n+35 {\n+36 polygon.clear();\n+37 for( int vtxIdx; getnextentry( vtxIdx ); )\n+38 {\n+39 if( (vtxBegin_ > vtxIdx) || (vtxIdx >= vtxEnd_) )\n+40 DUNE_THROW( DGFException, \"Error in \" << *this << \": Invalid vertex index (\"\n+<< vtxIdx << \" not int [\" << vtxBegin_ << \", \" << vtxEnd_ << \"[)\" );\n+41 polygon.push_back( vtxIdx - vtxBegin_ );\n+42 }\n+43\n+44 polygons.push_back( polygon );\n+45 }\n+46 return polygons.size();\n+47 }\n+48\n+49 protected:\n+50 int vtxBegin_, vtxEnd_;\n+51 };\n+52\n+53 } // namespace dgf\n+54} // end namespace Dune\n+55\n+56#endif // #ifndef DUNE_POLYGON_HH\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::int32\n-@ int32\n-Dune::VTK::Precision::uint8\n-@ uint8\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::VTK::renumber\n-int renumber(const Dune::GeometryType &t, int i)\n-renumber VTK <-> Dune\n-Definition common.hh:186\n-Dune::VTK::geometryType\n-GeometryType geometryType(const Dune::GeometryType &t)\n-mapping from GeometryType to VTKGeometryType\n-Definition common.hh:151\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::GridView::Codim\n-A struct that collects all associated types of one implementation from the\n-Traits class.\n-Definition common/gridview.hh:104\n-Dune::VTK::FieldInfo::Type::tensor\n-@ tensor\n-tensor field (always 3x3)\n-Dune::VTK::FieldInfo::Type::vector\n-@ vector\n-vector-valued field (always 3D, will be padded if necessary)\n-Dune::VTK::FieldInfo::Type::scalar\n-@ scalar\n-Dune::SubsamplingVTKWriter\n-Writer for the output of subsampled grid functions in the vtk format.\n-Definition subsamplingvtkwriter.hh:40\n-Dune::SubsamplingVTKWriter::writeGridPoints\n-virtual void writeGridPoints(VTK::VTUWriter &writer)\n-write the positions of vertices\n-Definition subsamplingvtkwriter.hh:261\n-Dune::SubsamplingVTKWriter::writeVertexData\n-virtual void writeVertexData(VTK::VTUWriter &writer)\n-write vertex data\n-Definition subsamplingvtkwriter.hh:243\n-Dune::SubsamplingVTKWriter::SubsamplingVTKWriter\n-SubsamplingVTKWriter(const GridView &gridView, Dune::RefinementIntervals\n-intervals_, bool coerceToSimplex_=false, VTK::Precision coordPrecision=VTK::\n-Precision::float32)\n-Construct a SubsamplingVTKWriter working on a specific GridView.\n-Definition subsamplingvtkwriter.hh:80\n-Dune::SubsamplingVTKWriter::countEntities\n-virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)\n-count the vertices, cells and corners\n-Definition subsamplingvtkwriter.hh:207\n-Dune::SubsamplingVTKWriter::writeCellData\n-virtual void writeCellData(VTK::VTUWriter &writer)\n-write cell data\n-Definition subsamplingvtkwriter.hh:225\n-Dune::SubsamplingVTKWriter::writeGridCells\n-virtual void writeGridCells(VTK::VTUWriter &writer)\n-write the connectivity array\n-Definition subsamplingvtkwriter.hh:292\n-Dune::VTKWriter\n-Writer for the output of grid functions in the vtk format.\n-Definition vtkwriter.hh:95\n-Dune::VTKWriter::vertexBegin\n-VertexIterator vertexBegin() const\n-Definition vtkwriter.hh:508\n-Dune::VTKWriter::addVertexData\n-void addVertexData(const std::shared_ptr< const VTKFunction > &p)\n-Add a grid function that lives on the vertices of the grid to the\n-visualization.\n-Definition vtkwriter.hh:713\n-Dune::VTKWriter::cellEnd\n-CellIterator cellEnd() const\n-Definition vtkwriter.hh:402\n-Dune::VTKWriter::vertexdata\n-std::list< VTKLocalFunction > vertexdata\n-Definition vtkwriter.hh:1589\n-Dune::VTKWriter::addCellData\n-void addCellData(const std::shared_ptr< const VTKFunction > &p)\n-Add a grid function that lives on the cells of the grid to the visualization.\n-Definition vtkwriter.hh:649\n-Dune::VTKWriter::cellBegin\n-CellIterator cellBegin() const\n-Definition vtkwriter.hh:397\n-Dune::VTKWriter::outputtype\n-VTK::OutputType outputtype\n-Definition vtkwriter.hh:1613\n-Dune::VTKWriter::celldata\n-std::list< VTKLocalFunction > celldata\n-Definition vtkwriter.hh:1588\n-Dune::VTKWriter::coordPrecision\n-VTK::Precision coordPrecision() const\n-get the precision with which coordinates are written out\n-Definition vtkwriter.hh:782\n-Dune::VTKWriter::FunctionIterator\n-std::list< VTKLocalFunction >::const_iterator FunctionIterator\n-Definition vtkwriter.hh:376\n-Dune::VTKWriter::nvertices\n-int nvertices\n-Definition vtkwriter.hh:1596\n-Dune::VTKWriter::ncells\n-int ncells\n-Definition vtkwriter.hh:1595\n-Dune::VTKWriter::vertexEnd\n-VertexIterator vertexEnd() const\n-Definition vtkwriter.hh:515\n-Dune::VTKWriter::ncorners\n-int ncorners\n-Definition vtkwriter.hh:1597\n-Dune::VTKWriter::CellIterator\n-Iterator over the grids elements.\n-Definition vtkwriter.hh:385\n-Dune::VTK::VTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition vtuwriter.hh:98\n-Dune::VTK::VTUWriter::makeArrayWriter\n-DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n-unsigned nitems, Precision prec)\n-acquire a DataArrayWriter\n-Definition vtuwriter.hh:380\n-Dune::VTK::VTUWriter::endCellData\n-void endCellData()\n-finish CellData section\n-Definition vtuwriter.hh:220\n-Dune::VTK::VTUWriter::beginCells\n-void beginCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:274\n-Dune::VTK::VTUWriter::endPointData\n-void endPointData()\n-finish PointData section\n-Definition vtuwriter.hh:182\n-Dune::VTK::VTUWriter::beginCellData\n-void beginCellData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start CellData section\n-Definition vtuwriter.hh:205\n-Dune::VTK::VTUWriter::beginPointData\n-void beginPointData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start PointData section\n-Definition vtuwriter.hh:167\n-Dune::VTK::VTUWriter::endPoints\n-void endPoints()\n-finish section for the point coordinates\n-Definition vtuwriter.hh:249\n-Dune::VTK::VTUWriter::endCells\n-void endCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:285\n-Dune::VTK::VTUWriter::beginPoints\n-void beginPoints()\n-start section for the point coordinates\n-Definition vtuwriter.hh:238\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::BasicBlock::reset\n+void reset()\n+Definition basic.hh:51\n+Dune::dgf::BasicBlock::getnextline\n+bool getnextline()\n+Definition basic.cc:93\n+Dune::dgf::BasicBlock::getnextentry\n+bool getnextentry(ENTRY &entry)\n+Definition basic.hh:63\n+Dune::dgf::PolygonBlock\n+Definition polygon.hh:25\n+Dune::dgf::PolygonBlock::PolygonBlock\n+PolygonBlock(std::istream &in, int numVtx, int vtxOfs)\n+Definition polygon.hh:26\n+Dune::dgf::PolygonBlock::get\n+int get(std::vector< std::vector< int > > &polygons)\n+Definition polygon.hh:30\n+Dune::dgf::PolygonBlock::vtxEnd_\n+int vtxEnd_\n+Definition polygon.hh:50\n+Dune::dgf::PolygonBlock::vtxBegin_\n+int vtxBegin_\n+Definition polygon.hh:50\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00926.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00926.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: streams.hh File Reference\n+dune-grid: dim.cc File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,32 @@\n \n \n \n \n \n \n \n
    \n \n-
    streams.hh File Reference
    \n+
    dim.cc File Reference
    \n
    \n
    \n-
    #include <ostream>
    \n-#include <dune/grid/io/file/vtk/b64enc.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::Base64Stream
     class to base64 encode a stream of data More...
     
    class  Dune::RawStream
     write out data in binary More...
     
    \n+
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-streams.hh File Reference\n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::Base64Stream\n-\u00a0 class to base64 encode a stream of data More...\n-\u00a0\n-class \u00a0 Dune::RawStream\n-\u00a0 write out data in binary More...\n-\u00a0\n+ * dgfparser\n+ * blocks\n+Namespaces\n+dim.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00929.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00929.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtkwriter.hh File Reference\n+dune-grid: boundarydom.hh File Reference\n \n \n \n \n \n \n \n@@ -65,95 +65,49 @@\n \n \n \n \n \n \n \n
    \n \n-
    vtkwriter.hh File Reference
    \n+
    boundarydom.hh File Reference
    \n
    \n
    \n-\n-

    Provides file i/o for the visualization toolkit. \n-More...

    \n-
    #include <cstring>
    \n-#include <iostream>
    \n+
    #include <iostream>
    \n #include <string>
    \n-#include <fstream>
    \n-#include <sstream>
    \n-#include <iomanip>
    \n-#include <memory>
    \n-#include <type_traits>
    \n #include <vector>
    \n-#include <list>
    \n-#include <map>
    \n-#include <dune/common/visibility.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/indent.hh>
    \n-#include <dune/common/iteratorfacades.hh>
    \n-#include <dune/common/path.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n-#include <dune/grid/io/file/vtk/dataarraywriter.hh>
    \n-#include <dune/grid/io/file/vtk/function.hh>
    \n-#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n-#include <dune/grid/io/file/vtk/streams.hh>
    \n-#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+#include <dune/grid/io/file/dgfparser/parser.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::VTKWriter< GridView >
     Writer for the output of grid functions in the vtk format. More...
     
    class  Dune::VTKWriter< GridView >::VTKLocalFunction
     Type erasure wrapper for VTK data sets. More...
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase
     Base class for polymorphic container of underlying data set. More...
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapper< F >
     Type erasure implementation for functions conforming to the dune-functions LocalFunction interface. More...
    struct  Dune::dgf::DomainData
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::GlobalFunctionWrapper< F >
     Type erasure implementation for C++ functions, i.e., functions that can be evaluated in global coordinates. More...
    struct  Dune::dgf::Domain
     
    struct  Dune::VTKWriter< GridView >::VTKLocalFunction::VTKFunctionWrapper
     Type erasure implementation for legacy VTKFunctions. More...
     
    class  Dune::VTKWriter< GridView >::CellIterator
     Iterator over the grids elements. More...
     
    class  Dune::VTKWriter< GridView >::VertexIterator
     Iterate over the grid's vertices. More...
     
    class  Dune::VTKWriter< GridView >::CornerIterator
     Iterate over the elements' corners. More...
    class  Dune::dgf::BoundaryDomBlock
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::dgf
     
    \n-

    Detailed Description

    \n-

    Provides file i/o for the visualization toolkit.

    \n-
    Author
    Peter Bastian, Christian Engwer
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,79 +2,32 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n+ * blocks\n Classes | Namespaces\n-vtkwriter.hh File Reference\n-Provides file i/o for the visualization toolkit. More...\n-#include \n+boundarydom.hh File Reference\n #include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::VTKWriter<_GridView_>\n-\u00a0 Writer for the output of grid functions in the vtk format. More...\n+struct \u00a0 Dune::dgf::DomainData\n \u00a0\n- class \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction\n-\u00a0 Type erasure wrapper for VTK data sets. More...\n+struct \u00a0 Dune::dgf::Domain\n \u00a0\n-struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::FunctionWrapperBase\n-\u00a0 Base class for polymorphic container of underlying data set. More...\n-\u00a0\n-struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::FunctionWrapper<_F_>\n-\u00a0 Type erasure implementation for functions conforming to the dune-\n- functions LocalFunction interface. More...\n-\u00a0\n-struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::GlobalFunctionWrapper<\n- F_>\n-\u00a0 Type erasure implementation for C++ functions, i.e., functions that\n- can be evaluated in global coordinates. More...\n-\u00a0\n-struct \u00a0 Dune::VTKWriter<_GridView_>::VTKLocalFunction::VTKFunctionWrapper\n-\u00a0 Type erasure implementation for legacy VTKFunctions. More...\n-\u00a0\n- class \u00a0 Dune::VTKWriter<_GridView_>::CellIterator\n-\u00a0 Iterator over the grids elements. More...\n-\u00a0\n- class \u00a0 Dune::VTKWriter<_GridView_>::VertexIterator\n-\u00a0 Iterate over the grid's vertices. More...\n-\u00a0\n- class \u00a0 Dune::VTKWriter<_GridView_>::CornerIterator\n-\u00a0 Iterate over the elements' corners. More...\n+ class \u00a0 Dune::dgf::BoundaryDomBlock\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Provides file i/o for the visualization toolkit.\n- Author\n- Peter Bastian, Christian Engwer\n+namespace \u00a0 Dune::dgf\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00929_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00929_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtkwriter.hh Source File\n+dune-grid: boundarydom.hh Source File\n \n \n \n \n \n \n \n@@ -70,1661 +70,419 @@\n \n \n \n \n \n \n \n
    \n-
    vtkwriter.hh
    \n+
    boundarydom.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_VTKWRITER_HH
    \n-
    7#define DUNE_VTKWRITER_HH
    \n-
    8
    \n-
    9#include <cstring>
    \n-
    10#include <iostream>
    \n-
    11#include <string>
    \n-
    12#include <fstream>
    \n-
    13#include <sstream>
    \n-
    14#include <iomanip>
    \n-
    15#include <memory>
    \n-
    16#include <type_traits>
    \n-
    17#include <vector>
    \n-
    18#include <list>
    \n-
    19#include <map>
    \n-
    20
    \n-
    21#include <dune/common/visibility.hh>
    \n-
    22#include <dune/common/typetraits.hh>
    \n-
    23#include <dune/common/exceptions.hh>
    \n-
    24#include <dune/common/indent.hh>
    \n-
    25#include <dune/common/iteratorfacades.hh>
    \n-
    26#include <dune/common/path.hh>
    \n-
    27#include <dune/geometry/referenceelements.hh>
    \n-\n-\n-\n-\n-\n-\n-\n-\n-
    36
    \n-
    50namespace Dune
    \n-
    51{
    \n+
    5#ifndef DUNE_DGF_BOUNDARYDOMBLOCK_HH
    \n+
    6#define DUNE_DGF_BOUNDARYDOMBLOCK_HH
    \n+
    7
    \n+
    8#include <iostream>
    \n+
    9#include <string>
    \n+
    10#include <vector>
    \n+
    11
    \n+\n+\n+
    14
    \n+
    15
    \n+
    16namespace Dune
    \n+
    17{
    \n+
    18
    \n+
    19 namespace dgf
    \n+
    20 {
    \n+
    21
    \n+
    \n+\n+
    23 {
    \n+\n+
    25
    \n+
    \n+\n+
    27 : id_( 0 ),
    \n+
    28 parameter_( DGFBoundaryParameter::defaultValue() ),
    \n+
    29 defaultData_( false )
    \n+
    30 { }
    \n+
    \n+
    31
    \n+\n+
    33
    \n+
    34 // constructor
    \n+
    \n+
    35 DomainData ( int id, BoundaryParameter parameter, bool defaultData = false )
    \n+
    36 : id_( id ),
    \n+
    37 parameter_( parameter ),
    \n+
    38 defaultData_( defaultData )
    \n+
    39 { }
    \n+
    \n+
    40
    \n+
    41 // return id
    \n+
    \n+
    42 int id () const
    \n+
    43 {
    \n+
    44 return id_;
    \n+
    45 }
    \n+
    \n+
    46
    \n+
    47 // return true, if additional parameters given
    \n+
    \n+
    48 bool hasParameter () const
    \n+
    49 {
    \n+
    50 return (!parameter_.empty());
    \n+
    51 }
    \n+
    \n
    52
    \n-
    53 namespace Impl
    \n-
    54 {
    \n-
    55 // Check whether type F has a method 'bind' (see the dune-functions interface)
    \n-
    56 template< class F, class E, class = void >
    \n-
    57 struct IsBindable
    \n-
    58 : std::false_type
    \n-
    59 {};
    \n-
    60
    \n-
    61 template< class F, class E >
    \n-
    62 struct IsBindable< F, E, std::void_t< decltype( std::declval< F & >().bind( std::declval< const E & >() ) ),
    \n-
    63 decltype( std::declval< F & >().unbind() ) > >
    \n-
    64 : std::true_type
    \n-
    65 {};
    \n+
    53 // return additional parameters
    \n+
    \n+\n+
    55 {
    \n+
    56 return parameter_;
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    59 // reset data
    \n+
    \n+
    60 void reset ( int id, BoundaryParameter parameter, bool defaultData = false )
    \n+
    61 {
    \n+
    62 id_ = id;
    \n+
    63 parameter_ = parameter;
    \n+
    64 defaultData_ = defaultData;
    \n+
    65 }
    \n+
    \n
    66
    \n-
    67 // Check whether localFunction(F) can be called (see the dune-functions interface)
    \n-
    68 template< class F, class = void >
    \n-
    69 struct HasLocalFunction
    \n-
    70 : std::false_type
    \n-
    71 {};
    \n+
    67 // returns true if data origins from default boundary domain
    \n+
    \n+
    68 bool isDefault () const
    \n+
    69 {
    \n+
    70 return defaultData_;
    \n+
    71 }
    \n+
    \n
    72
    \n-
    73 template< class F >
    \n-
    74 struct HasLocalFunction< F, std::void_t< decltype( localFunction( std::declval< F& >() ) ) > >
    \n-
    75 : std::true_type
    \n-
    76 {};
    \n-
    77
    \n-
    78 } // namespace Impl
    \n-
    79
    \n-
    80 // Forward-declaration here, so the class can be friend of VTKWriter
    \n-
    81 template <class GridView>
    \n-\n-
    83 template <class GridView>
    \n-\n+
    \n+
    73 friend std::ostream & operator<< ( std :: ostream & os, const DomainData & ddata )
    \n+
    74 {
    \n+
    75 os << "domain data: id = " << ddata.id();
    \n+
    76 if( ddata.hasParameter() )
    \n+
    77 os << ", parameter = " << ddata.parameter();
    \n+
    78 return os;
    \n+
    79 }
    \n+
    \n+
    80
    \n+
    81 private:
    \n+
    82 int id_;
    \n+
    83 BoundaryParameter parameter_;
    \n+
    84 bool defaultData_;
    \n
    85
    \n-
    94 template< class GridView >
    \n-
    \n-
    95 class VTKWriter {
    \n-
    96
    \n-
    97 // VTKSequenceWriterBase needs getSerialPieceName
    \n-
    98 // and getParallelHeaderName
    \n-
    99 friend class VTKSequenceWriterBase<GridView>;
    \n-
    100 // VTKSequenceWriter needs the grid view, to get the MPI size and rank
    \n-
    101 friend class VTKSequenceWriter<GridView>;
    \n-
    102
    \n-
    103 // extract types
    \n-
    104 typedef typename GridView::Grid Grid;
    \n-
    105 typedef typename GridView::ctype DT;
    \n-
    106 constexpr static int n = GridView::dimension;
    \n-
    107 constexpr static int w = GridView::dimensionworld;
    \n-
    108
    \n-
    109 typedef typename GridView::template Codim< 0 >::Entity Cell;
    \n-
    110 typedef typename GridView::template Codim< n >::Entity Vertex;
    \n-
    111 typedef Cell Entity;
    \n-
    112
    \n-
    113 typedef typename GridView::IndexSet IndexSet;
    \n-
    114
    \n-
    115 static const PartitionIteratorType VTK_Partition = InteriorBorder_Partition;
    \n-
    116 //static const PartitionIteratorType VTK_Partition = All_Partition;
    \n-
    117
    \n-
    118 typedef typename GridView::template Codim< 0 >
    \n-
    119 ::template Partition< VTK_Partition >::Iterator
    \n-
    120 GridCellIterator;
    \n-
    121 typedef typename GridView::template Codim< n >
    \n-
    122 ::template Partition< VTK_Partition >::Iterator
    \n-
    123 GridVertexIterator;
    \n-
    124
    \n-
    125 typedef typename GridCellIterator::Reference EntityReference;
    \n-
    126
    \n-
    127 typedef typename GridView::template Codim< 0 >
    \n-
    128 ::Entity::Geometry::LocalCoordinate Coordinate;
    \n-
    129
    \n-\n-
    131
    \n-
    132 // return true if entity should be skipped in Vertex and Corner iterator
    \n-
    133 static bool skipEntity( const PartitionType entityType )
    \n-
    134 {
    \n-
    135 switch( VTK_Partition )
    \n-
    136 {
    \n-
    137 // for All_Partition no entity has to be skipped
    \n-
    138 case All_Partition: return false;
    \n-
    139 case InteriorBorder_Partition: return ( entityType != InteriorEntity );
    \n-
    140 default: DUNE_THROW(NotImplemented,"Add check for this partition type");
    \n-
    141 }
    \n-
    142 return false ;
    \n-
    143 }
    \n-
    144
    \n-
    145 public:
    \n+
    86 }; // end struct DomainData
    \n+
    \n+
    87
    \n+
    88
    \n+
    \n+
    89 struct Domain
    \n+
    90 {
    \n+
    91 // dimension of world coordinates
    \n+
    92 const int dimensionworld;
    \n+
    93
    \n+\n+
    95
    \n+
    96 // constructor
    \n+
    \n+
    97 Domain( std::vector< double > p1, std::vector< double > p2, int id, BoundaryParameter & parameter )
    \n+
    98 : dimensionworld( p1.size() ),
    \n+
    99 left_( p1 ),
    \n+
    100 right_( p2 ),
    \n+
    101 data_( id, parameter )
    \n+
    102 {
    \n+
    103 if( int( p2.size() ) != dimensionworld )
    \n+
    104 {
    \n+
    105 DUNE_THROW(DGFException,
    \n+
    106 "ERROR in " << *this << "!");
    \n+
    107 }
    \n+
    108 }
    \n+
    \n+
    109
    \n+
    110 // constructor
    \n+
    \n+
    111 Domain( std::vector< double > p1, std::vector< double > p2, DomainData & data )
    \n+
    112 : dimensionworld( p1.size() ),
    \n+
    113 left_( p1 ),
    \n+
    114 right_( p2 ),
    \n+
    115 data_( data )
    \n+
    116 {
    \n+
    117 if( int( p2.size() ) != dimensionworld )
    \n+
    118 {
    \n+
    119 DUNE_THROW(DGFException,
    \n+
    120 "ERROR in " << *this << "!");
    \n+
    121 }
    \n+
    122 }
    \n+
    \n+
    123
    \n+
    124 // copy constructor
    \n+
    \n+
    125 Domain ( const Domain & other )
    \n+\n+
    127 left_( other.left_ ),
    \n+
    128 right_( other.right_ ),
    \n+
    129 data_( other.data_ )
    \n+
    130 {
    \n+
    131 if( dimensionworld != other.dimensionworld )
    \n+
    132 {
    \n+
    133 DUNE_THROW(DGFException,
    \n+
    134 "ERROR in " << *this << "!");
    \n+
    135 }
    \n+
    136 }
    \n+
    \n+
    137
    \n+
    138 // assignment
    \n+
    \n+
    139 Domain & operator = ( const Domain & other )
    \n+
    140 {
    \n+
    141 if( dimensionworld != other.dimensionworld )
    \n+
    142 {
    \n+
    143 DUNE_THROW(DGFException,
    \n+
    144 "ERROR in " << *this << "!");
    \n+
    145 }
    \n
    146
    \n-\n-
    148
    \n-
    149 protected:
    \n-
    150
    \n+
    147 left_ = other.left_;
    \n+
    148 right_= other.right_;
    \n+
    149 data_= other.data_;
    \n+
    150 return *this;
    \n+
    151 }
    \n+
    \n
    152
    \n-
    \n-\n-
    156 {
    \n-
    157
    \n-
    158 public:
    \n-
    159
    \n-\n-
    161
    \n-
    \n-\n-
    164 {
    \n+
    153 // return true if point is contained in boundary domain
    \n+
    154 template< class Vector >
    \n+
    \n+
    155 bool contains ( const Vector & x ) const
    \n+
    156 {
    \n+
    157 bool ret = true;
    \n+
    158 for( int i = 0; i < dimensionworld; ++i )
    \n+
    159 {
    \n+
    160 if( x[ i ] < left_[ i ] || x[ i ] > right_[ i ] )
    \n+
    161 ret = false;
    \n+
    162 }
    \n+
    163 return ret;
    \n+
    164 }
    \n+
    \n
    165
    \n-
    167 virtual void bind(const Entity& e) = 0;
    \n-
    168
    \n-
    170 virtual void unbind() = 0;
    \n-
    171
    \n-
    173
    \n-
    176 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const = 0;
    \n-
    177
    \n-
    \n-\n-
    179 {}
    \n-
    \n-
    180
    \n-
    181 };
    \n-
    \n-
    182
    \n-
    184 // DUNE_PRIVATE since _f has less visibility
    \n-
    185 template<typename F>
    \n-
    \n-
    186 struct DUNE_PRIVATE FunctionWrapper
    \n-
    187 : public FunctionWrapperBase
    \n-
    188 {
    \n-
    189 using Function = typename std::decay<F>::type;
    \n+
    \n+
    166 const DomainData & data () const
    \n+
    167 {
    \n+
    168 return data_;
    \n+
    169 }
    \n+
    \n+
    170
    \n+
    171 // for error messages
    \n+
    \n+
    172 friend std::ostream & operator<< ( std :: ostream &os, const Domain & domain )
    \n+
    173 {
    \n+
    174 os << "domain: " << std::endl;
    \n+
    175 os << "left = ";
    \n+
    176 for( int i = 0; i < domain.dimensionworld; ++i )
    \n+
    177 os << domain.left_[ i ] << " ";
    \n+
    178 os << std::endl;
    \n+
    179 os << "right = ";
    \n+
    180 for( int i = 0; i < domain.dimensionworld; ++i )
    \n+
    181 os << domain.right_[ i ] << " ";
    \n+
    182 os << std::endl;
    \n+
    183 os << domain.data();
    \n+
    184 return os;
    \n+
    185 }
    \n+
    \n+
    186
    \n+
    187 private:
    \n+
    188 std::vector< double > left_, right_;
    \n+
    189 DomainData data_;
    \n
    190
    \n-
    191 template<typename F_>
    \n-
    \n-\n-
    193 : _f(std::forward<F_>(f))
    \n-
    194 {}
    \n-
    \n-
    195
    \n-
    \n-
    196 virtual void bind(const Entity& e)
    \n-
    197 {
    \n-
    198 _f.bind(e);
    \n-
    199 }
    \n+
    191 };
    \n
    \n+
    192
    \n+
    \n+\n+
    194 : public BasicBlock
    \n+
    195 {
    \n+
    196 typedef DGFBoundaryParameter::type BoundaryParameter;
    \n+
    197
    \n+
    198 // the dimension of the vertices (is given from user)
    \n+
    199 int dimworld_;
    \n
    200
    \n-
    \n-
    201 virtual void unbind()
    \n-
    202 {
    \n-
    203 _f.unbind();
    \n-
    204 }
    \n-
    \n-
    205
    \n-
    \n-
    206 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const
    \n-
    207 {
    \n-
    208 auto r = _f(pos);
    \n-
    209 // we need to do different things here depending on whether r supports indexing into it or not.
    \n-
    210 do_write(w,r,count,IsIndexable<decltype(r)>());
    \n-
    211 }
    \n-
    \n-
    212
    \n-
    213 private:
    \n+
    201 // internal counter
    \n+
    202 int counter_;
    \n+
    203
    \n+
    204 // default values if given
    \n+
    205 DomainData * default_;
    \n+
    206
    \n+
    207 // storage for all domains;
    \n+
    208 int ndomains_;
    \n+
    209 std::vector< Domain > domains_;
    \n+
    210
    \n+
    211 public:
    \n+
    212 // initialize vertex block and get first vertex
    \n+
    213 BoundaryDomBlock ( std::istream & in, int cdimworld );
    \n
    214
    \n-
    215 template<typename R>
    \n-
    216 void do_write(Writer& w, const R& r, std::size_t count, std::true_type) const
    \n-
    217 {
    \n-
    218 for (std::size_t i = 0; i < count; ++i)
    \n-
    219 w.write(r[i]);
    \n-
    220 }
    \n-
    221
    \n-
    222 template<typename R>
    \n-
    223 void do_write(Writer& w, const R& r, std::size_t count, std::false_type) const
    \n-
    224 {
    \n-
    225 assert(count == 1);
    \n-
    226 w.write(r);
    \n-
    227 }
    \n-
    228
    \n-
    229 Function _f;
    \n-
    230 };
    \n+
    215 // destructor
    \n+
    \n+\n+
    217 {
    \n+
    218 if( default_ )
    \n+
    219 delete default_;
    \n+
    220 }
    \n
    \n-
    231
    \n-
    233 template<typename F>
    \n-
    \n-\n-
    235 : public FunctionWrapperBase
    \n-
    236 {
    \n-
    237 using Function = typename std::decay<F>::type;
    \n-
    238
    \n-
    239 template<typename F_>
    \n-
    \n-\n-
    241 : _f(std::forward<F_>(f))
    \n-
    242 , element_(nullptr)
    \n-
    243 {}
    \n-
    \n-
    244
    \n-
    \n-
    245 virtual void bind(const Entity& e)
    \n-
    246 {
    \n-
    247 element_ = &e;
    \n-
    248 }
    \n-
    \n-
    249
    \n-
    \n-
    250 virtual void unbind()
    \n-
    251 {
    \n-
    252 element_ = nullptr;
    \n-
    253 }
    \n-
    \n-
    254
    \n-
    \n-
    255 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const
    \n-
    256 {
    \n-
    257 auto globalPos = element_->geometry().global(pos);
    \n-
    258 auto r = _f(globalPos);
    \n-
    259 if constexpr (IsIndexable<decltype(r)>()) {
    \n-
    260 for (std::size_t i = 0; i < count; ++i)
    \n-
    261 w.write(r[i]);
    \n-
    262 }
    \n-
    263 else {
    \n-
    264 assert(count == 1);
    \n-
    265 w.write(r);
    \n-
    266 }
    \n-
    267 }
    \n-
    \n-
    268 private:
    \n-
    269 Function _f;
    \n-
    270 const Entity* element_;
    \n-
    271 };
    \n-
    \n-
    272
    \n-
    \n-\n-
    275 : public FunctionWrapperBase
    \n-
    276 {
    \n-
    \n-
    277 VTKFunctionWrapper(const std::shared_ptr< const VTKFunction >& f)
    \n-
    278 : _f(f)
    \n-
    279 , _entity(nullptr)
    \n-
    280 {}
    \n-
    \n-
    281
    \n-
    \n-
    282 virtual void bind(const Entity& e)
    \n-
    283 {
    \n-
    284 _entity = &e;
    \n-
    285 }
    \n-
    \n-
    286
    \n-
    \n-
    287 virtual void unbind()
    \n-
    288 {
    \n-
    289 _entity = nullptr;
    \n-
    290 }
    \n+
    221
    \n+
    222 // go to next domain in block
    \n+
    \n+
    223 bool next ()
    \n+
    224 {
    \n+
    225 counter_++;
    \n+
    226 return ( counter_ < ndomains_ );
    \n+
    227 }
    \n
    \n+
    228
    \n+
    229 // return domain
    \n+
    \n+
    230 const Domain & domain () const
    \n+
    231 {
    \n+
    232 return domains_.at( counter_ );
    \n+
    233 }
    \n+
    \n+
    234
    \n+
    235 // return true if default is given
    \n+
    \n+
    236 bool hasDefaultData () const
    \n+
    237 {
    \n+
    238 return bool( default_ );
    \n+
    239 }
    \n+
    \n+
    240
    \n+
    241 // return default data
    \n+
    \n+
    242 const DomainData * defaultData () const
    \n+
    243 {
    \n+
    244 return default_;
    \n+
    245 }
    \n+
    \n+
    246
    \n+
    247 // return true if any boundary domain block has
    \n+
    248 // additional parameters
    \n+
    249 bool hasParameter () const;
    \n+
    250
    \n+
    \n+
    251 void reset ()
    \n+
    252 {
    \n+\n+
    254 counter_ = -1;
    \n+
    255 }
    \n+
    \n+
    256
    \n+
    257 // return true while block is active
    \n+
    \n+
    258 bool ok ()
    \n+
    259 {
    \n+
    260 return ( counter_ <= ndomains_ );
    \n+
    261 }
    \n+
    \n+
    262
    \n+
    263 // return data if all vectors in array are contained within
    \n+
    264 // a single domain
    \n+
    265 template< class Vector >
    \n+
    \n+
    266 const DomainData * contains ( const std::vector< Vector > & v ) const
    \n+
    267 {
    \n+
    268 std::vector< int > index( ndomains_ );
    \n+
    269 for( int i = 0; i < ndomains_; ++i)
    \n+
    270 index[ i ] = i;
    \n+
    271
    \n+
    272 size_t N = v.size();
    \n+
    273 for( size_t i = 0; i < N; ++i )
    \n+
    274 {
    \n+
    275 if( index.empty() )
    \n+
    276 break;
    \n+
    277
    \n+
    278 const int n = index.size();
    \n+
    279 assert( n > 0 );
    \n+
    280 for( int j = n-1; j >= 0; --j )
    \n+
    281 {
    \n+
    282 bool inside = domains_[ index[ j ] ].contains( v[ i ] );
    \n+
    283 if( !inside )
    \n+
    284 index.erase( index.begin() + j );
    \n+
    285 }
    \n+
    286 }
    \n+
    287
    \n+
    288 // check whether no boundary domain found
    \n+
    289 if( index.empty() )
    \n+
    290 return default_;
    \n
    291
    \n-
    \n-
    292 virtual void write(const Coordinate& pos, Writer& w, std::size_t count) const
    \n-
    293 {
    \n-
    294 for (std::size_t i = 0; i < count; ++i)
    \n-
    295 w.write(_f->evaluate(i,*_entity,pos));
    \n-
    296 }
    \n-
    \n-
    297
    \n-
    298 private:
    \n-
    299
    \n-
    300 std::shared_ptr< const VTKFunction > _f;
    \n-
    301 const Entity* _entity;
    \n-
    302
    \n-
    303 };
    \n+
    292 // check for ambiguity
    \n+
    293 if( index.size() > 1 )
    \n+
    294 dwarn << "WARNING: ambiguous boundary domain assignment, use first boundary domain in list" << std::endl;
    \n+
    295
    \n+
    296 return &domains_[ index[ 0 ] ].data();
    \n+
    297 }
    \n+
    \n+
    298
    \n+
    299 private:
    \n+
    300 void readBlock ();
    \n+
    301 };
    \n
    \n+
    302
    \n+
    303 } // end namespace dgf
    \n
    304
    \n-
    306 template<typename F, std::enable_if_t<Impl::IsBindable<F, Entity>::value, int> = 0>
    \n-
    \n-\n-
    308 : _f(std::make_unique<FunctionWrapper<F> >(std::forward<F>(f)))
    \n-\n-
    310 {}
    \n-
    \n-
    311
    \n-
    313 // That is, a function that you can create a LocalFunction for, and evaluate that in element coordinates
    \n-
    314 template<typename F, std::enable_if_t<not Impl::IsBindable<F, Entity>::value && Impl::HasLocalFunction<F>::value, int> = 0>
    \n-
    \n-\n-
    316 : _f(std::make_unique< FunctionWrapper<
    \n-
    317 typename std::decay<decltype(localFunction(std::forward<F>(f)))>::type
    \n-
    318 > >(localFunction(std::forward<F>(f))))
    \n-\n-
    320 {}
    \n-
    \n-
    321
    \n-
    323 // That is, a function that can be evaluated in global coordinates of the domain
    \n-
    324 template<typename F, std::enable_if_t<not Impl::IsBindable<F, Entity>::value && not Impl::HasLocalFunction<F>::value, int> = 0>
    \n-
    \n-\n-
    326 : _f(std::make_unique< GlobalFunctionWrapper<F> >(std::forward<F>(f)))
    \n-\n-
    328 {}
    \n-
    \n-
    329
    \n-
    \n-
    331 explicit VTKLocalFunction (const std::shared_ptr< const VTKFunction >& vtkFunctionPtr)
    \n-
    332 : _f(std::make_unique<VTKFunctionWrapper>(vtkFunctionPtr))
    \n-
    333 , _fieldInfo(
    \n-
    334 vtkFunctionPtr->name(),
    \n-
    335 (vtkFunctionPtr->ncomps() == 2 || vtkFunctionPtr->ncomps() == 3) ? VTK::FieldInfo::Type::vector : VTK::FieldInfo::Type::scalar,
    \n-
    336 vtkFunctionPtr->ncomps(),
    \n-
    337 vtkFunctionPtr->precision()
    \n-
    338 )
    \n-
    339 {}
    \n-
    \n-
    340
    \n-
    \n-
    342 std::string name() const
    \n-
    343 {
    \n-
    344 return fieldInfo().name();
    \n-
    345 }
    \n-
    \n-
    346
    \n-
    \n-\n-
    349 {
    \n-
    350 return _fieldInfo;
    \n-
    351 }
    \n-
    \n-
    352
    \n-
    \n-
    354 void bind(const Entity& e) const
    \n-
    355 {
    \n-
    356 _f->bind(e);
    \n-
    357 }
    \n-
    \n-
    358
    \n-
    \n-
    360 void unbind() const
    \n-
    361 {
    \n-
    362 _f->unbind();
    \n-
    363 }
    \n-
    \n-
    364
    \n-
    \n-
    366 void write(const Coordinate& pos, Writer& w) const
    \n-
    367 {
    \n-
    368 _f->write(pos,w,fieldInfo().size());
    \n-
    369 }
    \n-
    \n-
    370
    \n-
    371 std::shared_ptr<FunctionWrapperBase> _f;
    \n-\n-
    373
    \n-
    374 };
    \n-
    \n-
    375
    \n-
    376 typedef typename std::list<VTKLocalFunction>::const_iterator FunctionIterator;
    \n-
    377
    \n-
    379
    \n-
    \n-
    384 class CellIterator : public GridCellIterator
    \n-
    385 {
    \n-
    386 public:
    \n-
    388 CellIterator(const GridCellIterator & x) : GridCellIterator(x) {}
    \n-
    \n-
    391 const FieldVector<DT,n> position() const
    \n-
    392 {
    \n-
    393 return ReferenceElements<DT,n>::general((*this)->type()).position(0,0);
    \n-
    394 }
    \n-
    \n-
    395 };
    \n-
    \n-
    396
    \n-
    \n-\n-
    398 {
    \n-
    399 return gridView_.template begin< 0, VTK_Partition >();
    \n-
    400 }
    \n-
    \n-
    401
    \n-
    \n-\n-
    403 {
    \n-
    404 return gridView_.template end< 0, VTK_Partition >();
    \n-
    405 }
    \n-
    \n-
    406
    \n-
    408
    \n-
    \n-\n-
    423 public ForwardIteratorFacade<VertexIterator, const Entity, EntityReference, int>
    \n-
    424 {
    \n-
    425 GridCellIterator git;
    \n-
    426 GridCellIterator gend;
    \n-
    427 VTK::DataMode datamode;
    \n-
    428 // Index of the currently visited corner within the current element.
    \n-
    429 // NOTE: this is in Dune-numbering, in contrast to CornerIterator.
    \n-
    430 int cornerIndexDune;
    \n-
    431 const VertexMapper & vertexmapper;
    \n-
    432 std::vector<bool> visited;
    \n-
    433 // in conforming mode, for each vertex id (as obtained by vertexmapper)
    \n-
    434 // hold its number in the iteration order (VertexIterator)
    \n-
    435 int offset;
    \n-
    436
    \n-
    437 // hide operator ->
    \n-
    438 void operator->();
    \n-
    439 protected:
    \n-
    \n-\n-
    441 {
    \n-
    442 if( git == gend )
    \n-
    443 return;
    \n-
    444 ++cornerIndexDune;
    \n-
    445 const int numCorners = git->subEntities(n);
    \n-
    446 if( cornerIndexDune == numCorners )
    \n-
    447 {
    \n-
    448 offset += numCorners;
    \n-
    449 cornerIndexDune = 0;
    \n-
    450
    \n-
    451 ++git;
    \n-
    452 while( (git != gend) && skipEntity( git->partitionType() ) )
    \n-
    453 ++git;
    \n-
    454 }
    \n-
    455 }
    \n-
    \n-
    456 public:
    \n-
    \n-
    457 VertexIterator(const GridCellIterator & x,
    \n-
    458 const GridCellIterator & end,
    \n-
    459 const VTK::DataMode & dm,
    \n-
    460 const VertexMapper & vm) :
    \n-
    461 git(x), gend(end), datamode(dm), cornerIndexDune(0),
    \n-
    462 vertexmapper(vm), visited(vm.size(), false),
    \n-
    463 offset(0)
    \n-
    464 {
    \n-
    465 if (datamode == VTK::conforming && git != gend)
    \n-
    466 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;
    \n-
    467 }
    \n-
    \n-
    \n-
    468 void increment ()
    \n-
    469 {
    \n-
    470 switch (datamode)
    \n-
    471 {
    \n-
    472 case VTK::conforming :
    \n-
    473 while(visited[vertexmapper.subIndex(*git,cornerIndexDune,n)])
    \n-
    474 {
    \n-\n-
    476 if (git == gend) return;
    \n-
    477 }
    \n-
    478 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;
    \n-
    479 break;
    \n-
    480 case VTK::nonconforming :
    \n-\n-
    482 break;
    \n-
    483 }
    \n-
    484 }
    \n-
    \n-
    \n-
    485 bool equals (const VertexIterator & cit) const
    \n-
    486 {
    \n-
    487 return git == cit.git
    \n-
    488 && cornerIndexDune == cit.cornerIndexDune
    \n-
    489 && datamode == cit.datamode;
    \n-
    490 }
    \n-
    \n-
    \n-
    491 EntityReference dereference() const
    \n-
    492 {
    \n-
    493 return *git;
    \n-
    494 }
    \n-
    \n-
    \n-
    496 int localindex () const
    \n-
    497 {
    \n-
    498 return cornerIndexDune;
    \n-
    499 }
    \n-
    \n-
    \n-
    501 FieldVector<DT,n> position () const
    \n-
    502 {
    \n-
    503 return referenceElement<DT,n>(git->type())
    \n-
    504 .position(cornerIndexDune,n);
    \n-
    505 }
    \n-
    \n-
    506 };
    \n-
    \n-
    507
    \n-
    \n-\n-
    509 {
    \n-
    510 return VertexIterator( gridView_.template begin< 0, VTK_Partition >(),
    \n-
    511 gridView_.template end< 0, VTK_Partition >(),
    \n-
    512 datamode, *vertexmapper );
    \n-
    513 }
    \n-
    \n-
    514
    \n-
    \n-\n-
    516 {
    \n-
    517 return VertexIterator( gridView_.template end< 0, VTK_Partition >(),
    \n-
    518 gridView_.template end< 0, VTK_Partition >(),
    \n-
    519 datamode, *vertexmapper );
    \n-
    520 }
    \n-
    \n-
    521
    \n-
    523
    \n-
    \n-\n-
    538 public ForwardIteratorFacade<CornerIterator, const Entity, EntityReference, int>
    \n-
    539 {
    \n-
    540 GridCellIterator git;
    \n-
    541 GridCellIterator gend;
    \n-
    542 VTK::DataMode datamode;
    \n-
    543 // Index of the currently visited corner within the current element.
    \n-
    544 // NOTE: this is in VTK-numbering, in contrast to VertexIterator.
    \n-
    545 int cornerIndexVTK;
    \n-
    546 const VertexMapper & vertexmapper;
    \n-
    547 // in conforming mode, for each vertex id (as obtained by vertexmapper)
    \n-
    548 // hold its number in the iteration order of VertexIterator (*not*
    \n-
    549 // CornerIterator)
    \n-
    550 const std::vector<int> & number;
    \n-
    551 // holds the number of corners of all the elements we have seen so far,
    \n-
    552 // excluding the current element
    \n-
    553 int offset;
    \n-
    554
    \n-
    555 // hide operator ->
    \n-
    556 void operator->();
    \n-
    557 public:
    \n-
    \n-
    558 CornerIterator(const GridCellIterator & x,
    \n-
    559 const GridCellIterator & end,
    \n-
    560 const VTK::DataMode & dm,
    \n-
    561 const VertexMapper & vm,
    \n-
    562 const std::vector<int> & num) :
    \n-
    563 git(x), gend(end), datamode(dm), cornerIndexVTK(0),
    \n-
    564 vertexmapper(vm),
    \n-
    565 number(num), offset(0) {}
    \n-
    \n-
    \n-
    566 void increment ()
    \n-
    567 {
    \n-
    568 if( git == gend )
    \n-
    569 return;
    \n-
    570 ++cornerIndexVTK;
    \n-
    571 const int numCorners = git->subEntities(n);
    \n-
    572 if( cornerIndexVTK == numCorners )
    \n-
    573 {
    \n-
    574 offset += numCorners;
    \n-
    575 cornerIndexVTK = 0;
    \n-
    576
    \n-
    577 ++git;
    \n-
    578 while( (git != gend) && skipEntity( git->partitionType() ) )
    \n-
    579 ++git;
    \n-
    580 }
    \n-
    581 }
    \n-
    \n-
    \n-
    582 bool equals (const CornerIterator & cit) const
    \n-
    583 {
    \n-
    584 return git == cit.git
    \n-
    585 && cornerIndexVTK == cit.cornerIndexVTK
    \n-
    586 && datamode == cit.datamode;
    \n-
    587 }
    \n-
    \n-
    \n-
    588 EntityReference dereference() const
    \n-
    589 {
    \n-
    590 return *git;
    \n-
    591 }
    \n-
    \n-
    593
    \n-
    \n-
    597 int id () const
    \n-
    598 {
    \n-
    599 switch (datamode)
    \n-
    600 {
    \n-
    601 case VTK::conforming :
    \n-
    602 return
    \n-
    603 number[vertexmapper.subIndex(*git,VTK::renumber(*git,cornerIndexVTK),
    \n-
    604 n)];
    \n-
    605 case VTK::nonconforming :
    \n-
    606 return offset + VTK::renumber(*git,cornerIndexVTK);
    \n-
    607 default :
    \n-
    608 DUNE_THROW(IOError,"VTKWriter: unsupported DataMode" << datamode);
    \n-
    609 }
    \n-
    610 }
    \n-
    \n-
    611 };
    \n-
    \n-
    612
    \n-
    \n-\n-
    614 {
    \n-
    615 return CornerIterator( gridView_.template begin< 0, VTK_Partition >(),
    \n-
    616 gridView_.template end< 0, VTK_Partition >(),
    \n-
    617 datamode, *vertexmapper, number );
    \n-
    618 }
    \n-
    \n-
    619
    \n-
    \n-\n-
    621 {
    \n-
    622 return CornerIterator( gridView_.template end< 0, VTK_Partition >(),
    \n-
    623 gridView_.template end< 0, VTK_Partition >(),
    \n-
    624 datamode, *vertexmapper, number );
    \n-
    625 }
    \n-
    \n-
    626
    \n-
    627 public:
    \n-
    \n-
    636 explicit VTKWriter ( const GridView &gridView,
    \n-\n-\n-
    639 : gridView_( gridView ),
    \n-
    640 datamode( dm ),
    \n-
    641 coordPrec (coordPrecision),
    \n-
    642 polyhedralCellsPresent_( checkForPolyhedralCells() )
    \n-
    643 { }
    \n-
    \n-
    644
    \n-
    \n-
    649 void addCellData (const std::shared_ptr< const VTKFunction > & p)
    \n-
    650 {
    \n-
    651 celldata.push_back(VTKLocalFunction(p));
    \n-
    652 }
    \n-
    \n-
    653
    \n-
    673 template<typename F>
    \n-
    \n-
    674 void addCellData(F&& f, VTK::FieldInfo vtkFieldInfo)
    \n-
    675 {
    \n-
    676 celldata.push_back(VTKLocalFunction(std::forward<F>(f),vtkFieldInfo));
    \n-
    677 }
    \n-
    \n-
    678
    \n-
    694 template<class Container>
    \n-
    \n-
    695 void addCellData (const Container& v, const std::string &name, int ncomps = 1,
    \n-\n-
    697 {
    \n-
    698 typedef P0VTKFunction<GridView, Container> Function;
    \n-
    699 for (int c=0; c<ncomps; ++c) {
    \n-
    700 std::stringstream compName;
    \n-
    701 compName << name;
    \n-
    702 if (ncomps>1)
    \n-
    703 compName << "[" << c << "]";
    \n-
    704 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c, prec);
    \n-
    705 addCellData(std::shared_ptr< const VTKFunction >(p));
    \n-
    706 }
    \n-
    707 }
    \n-
    \n-
    708
    \n-
    \n-
    713 void addVertexData (const std::shared_ptr< const VTKFunction > & p)
    \n-
    714 {
    \n-
    715 vertexdata.push_back(VTKLocalFunction(p));
    \n-
    716 }
    \n-
    \n-
    717
    \n-
    737 template<typename F>
    \n-
    \n-
    738 void addVertexData(F&& f, VTK::FieldInfo vtkFieldInfo)
    \n-
    739 {
    \n-
    740 vertexdata.push_back(VTKLocalFunction(std::forward<F>(f),vtkFieldInfo));
    \n-
    741 }
    \n-
    \n-
    742
    \n-
    743
    \n-
    759 template<class Container>
    \n-
    \n-
    760 void addVertexData (const Container& v, const std::string &name, int ncomps=1,
    \n-\n-
    762 {
    \n-
    763 typedef P1VTKFunction<GridView, Container> Function;
    \n-
    764 for (int c=0; c<ncomps; ++c) {
    \n-
    765 std::stringstream compName;
    \n-
    766 compName << name;
    \n-
    767 if (ncomps>1)
    \n-
    768 compName << "[" << c << "]";
    \n-
    769 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c, prec);
    \n-
    770 addVertexData(std::shared_ptr< const VTKFunction >(p));
    \n-
    771 }
    \n-
    772 }
    \n-
    \n-
    773
    \n-
    \n-
    775 void clear ()
    \n-
    776 {
    \n-
    777 celldata.clear();
    \n-
    778 vertexdata.clear();
    \n-
    779 }
    \n-
    \n-
    780
    \n-
    \n-\n-
    783 { return coordPrec; }
    \n-
    \n-
    784
    \n-
    \n-
    786 virtual ~VTKWriter ()
    \n-
    787 {
    \n-
    788 this->clear();
    \n-
    789 }
    \n-
    \n-
    790
    \n-
    \n-
    803 std::string write ( const std::string &name,
    \n-\n-
    805 {
    \n-
    806 return write( name, type, gridView_.comm().rank(), gridView_.comm().size() );
    \n-
    807 }
    \n-
    \n-
    808
    \n-
    \n-
    835 std::string pwrite ( const std::string & name, const std::string & path, const std::string & extendpath,
    \n-\n-
    837 {
    \n-
    838 return pwrite( name, path, extendpath, type, gridView_.comm().rank(), gridView_.comm().size() );
    \n-
    839 }
    \n-
    \n-
    840
    \n-
    841 protected:
    \n-
    843
    \n-
    \n-
    855 std::string getParallelPieceName(const std::string& name,
    \n-
    856 const std::string& path,
    \n-
    857 int commRank, int commSize) const
    \n-
    858 {
    \n-
    859 std::ostringstream s;
    \n-
    860 // write path first
    \n-
    861 if(path.size() > 0)
    \n-
    862 {
    \n-
    863 s << path;
    \n-
    864 if(path[path.size()-1] != '/')
    \n-
    865 s << '/';
    \n-
    866 }
    \n-
    867
    \n-
    868 std::string fileprefix;
    \n-
    869 // check if a path was already added to name
    \n-
    870 // and if yes find filename without path
    \n-
    871 auto pos = name.rfind('/');
    \n-
    872 if( pos != std::string::npos )
    \n-
    873 {
    \n-
    874 // extract filename without path
    \n-
    875 fileprefix = name.substr( pos+1 );
    \n-
    876 // extract the path and added it before
    \n-
    877 // the magic below is added
    \n-
    878 std::string newpath = name.substr(0, pos);
    \n-
    879 s << newpath;
    \n-
    880 if(newpath[name.size()-1] != '/')
    \n-
    881 s << '/';
    \n-
    882 }
    \n-
    883 else
    \n-
    884 {
    \n-
    885 // if no path was found just copy the name
    \n-
    886 fileprefix = name;
    \n-
    887 }
    \n-
    888
    \n-
    889 s << 's' << std::setw(4) << std::setfill('0') << commSize << '-';
    \n-
    890 const bool writeHeader = commRank < 0;
    \n-
    891 if( ! writeHeader )
    \n-
    892 {
    \n-
    893 s << 'p' << std::setw(4) << std::setfill('0') << commRank << '-';
    \n-
    894 }
    \n-
    895
    \n-
    896 s << fileprefix << ".";
    \n-
    897 // write p for header files
    \n-
    898 if( writeHeader )
    \n-
    899 s << "p";
    \n-
    900 s << "vt";
    \n-
    901
    \n-
    902 if(GridView::dimension > 1)
    \n-
    903 s << "u";
    \n-
    904 else
    \n-
    905 s << "p";
    \n-
    906 return s.str();
    \n-
    907 }
    \n-
    \n-
    908
    \n-
    910
    \n-
    \n-
    920 std::string getParallelHeaderName(const std::string& name,
    \n-
    921 const std::string& path,
    \n-
    922 int commSize) const
    \n-
    923 {
    \n-
    924 return getParallelPieceName( name, path, -1, commSize );
    \n-
    925 }
    \n-
    \n-
    926
    \n-
    928
    \n-
    \n-
    940 std::string getSerialPieceName(const std::string& name,
    \n-
    941 const std::string& path) const
    \n-
    942 {
    \n-
    943 static const std::string extension =
    \n-
    944 GridView::dimension == 1 ? ".vtp" : ".vtu";
    \n-
    945
    \n-
    946 return concatPaths(path, name+extension);
    \n-
    947 }
    \n-
    \n-
    948
    \n-
    \n-
    965 std::string write ( const std::string &name,
    \n-
    966 VTK::OutputType type,
    \n-
    967 const int commRank,
    \n-
    968 const int commSize )
    \n-
    969 {
    \n-
    970 // in the parallel case, just use pwrite, it has all the necessary
    \n-
    971 // stuff, so we don't need to reimplement it here.
    \n-
    972 if(commSize > 1)
    \n-
    973 {
    \n-
    974 std::string filename = name;
    \n-
    975 std::string path = std::string("");
    \n-
    976
    \n-
    977 // check if a path was already added to name
    \n-
    978 // and if yes find filename without path
    \n-
    979 auto pos = name.rfind('/');
    \n-
    980 if( pos != std::string::npos )
    \n-
    981 {
    \n-
    982 // extract filename without path
    \n-
    983 filename = name.substr( pos+1 );
    \n-
    984
    \n-
    985 // extract the path and added it before
    \n-
    986 // the magic below is added
    \n-
    987 path = name.substr(0, pos);
    \n-
    988 }
    \n-
    989
    \n-
    990 return pwrite(filename, path, "", type, commRank, commSize);
    \n-
    991 }
    \n-
    992
    \n-
    993 // make data mode visible to private functions
    \n-
    994 outputtype = type;
    \n-
    995
    \n-
    996 // generate filename for process data
    \n-
    997 std::string pieceName = getSerialPieceName(name, "");
    \n-
    998
    \n-
    999 // write process data
    \n-
    1000 std::ofstream file;
    \n-
    1001 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n-
    1002 std::ios_base::eofbit);
    \n-
    1003 // check if file can be opened
    \n-
    1004 try {
    \n-
    1005 file.open( pieceName.c_str(), std::ios::binary );
    \n-
    1006 }
    \n-
    1007 catch(...) {
    \n-
    1008 std::cerr << "Filename: " << pieceName << " could not be opened" << std::endl;
    \n-
    1009 throw;
    \n-
    1010 }
    \n-
    1011 if (! file.is_open())
    \n-
    1012 DUNE_THROW(IOError, "Could not write to piece file " << pieceName);
    \n-
    1013 writeDataFile( file );
    \n-
    1014 file.close();
    \n-
    1015
    \n-
    1016 return pieceName;
    \n-
    1017 }
    \n-
    \n-
    1018
    \n-
    1020
    \n-
    \n-
    1043 std::string pwrite(const std::string& name, const std::string& path,
    \n-
    1044 const std::string& extendpath,
    \n-
    1045 VTK::OutputType ot, const int commRank,
    \n-
    1046 const int commSize )
    \n-
    1047 {
    \n-
    1048 // make data mode visible to private functions
    \n-
    1049 outputtype=ot;
    \n-
    1050
    \n-
    1051 // do some magic because paraview can only cope with relative paths to piece files
    \n-
    1052 std::ofstream file;
    \n-
    1053 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n-
    1054 std::ios_base::eofbit);
    \n-
    1055 std::string piecepath = concatPaths(path, extendpath);
    \n-
    1056 std::string relpiecepath = relativePath(path, piecepath);
    \n-
    1057
    \n-
    1058 // write this processes .vtu/.vtp piece file
    \n-
    1059 std::string fullname = getParallelPieceName(name, piecepath, commRank,
    \n-
    1060 commSize);
    \n-
    1061 // check if file can be opened
    \n-
    1062 try {
    \n-
    1063 file.open(fullname.c_str(),std::ios::binary);
    \n-
    1064 }
    \n-
    1065 catch(...) {
    \n-
    1066 std::cerr << "Filename: " << fullname << " could not be opened" << std::endl;
    \n-
    1067 throw;
    \n-
    1068 }
    \n-
    1069 if (! file.is_open())
    \n-
    1070 DUNE_THROW(IOError, "Could not write to piecefile file " << fullname);
    \n-
    1071 writeDataFile(file);
    \n-
    1072 file.close();
    \n-
    1073 gridView_.comm().barrier();
    \n-
    1074
    \n-
    1075 // if we are rank 0, write .pvtu/.pvtp parallel header
    \n-
    1076 fullname = getParallelHeaderName(name, path, commSize);
    \n-
    1077 if( commRank ==0 )
    \n-
    1078 {
    \n-
    1079 file.open(fullname.c_str());
    \n-
    1080 if (! file.is_open())
    \n-
    1081 DUNE_THROW(IOError, "Could not write to parallel file " << fullname);
    \n-
    1082 writeParallelHeader(file,name,relpiecepath, commSize );
    \n-
    1083 file.close();
    \n-
    1084 }
    \n-
    1085 gridView_.comm().barrier();
    \n-
    1086 return fullname;
    \n-
    1087 }
    \n-
    \n-
    1088
    \n-
    1089 private:
    \n-
    1091
    \n-
    1108 void writeParallelHeader(std::ostream& s, const std::string& piecename,
    \n-
    1109 const std::string& piecepath, const int commSize)
    \n-
    1110 {
    \n-
    1111 VTK::FileType fileType =
    \n-
    1112 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;
    \n-
    1113
    \n-
    1114 VTK::PVTUWriter writer(s, fileType);
    \n-
    1115
    \n-
    1116 writer.beginMain();
    \n-
    1117
    \n-
    1118 // PPointData
    \n-
    1119 {
    \n-
    1120 std::string scalars, vectors;
    \n-
    1121 std::tie(scalars,vectors) = getDataNames(vertexdata);
    \n-
    1122 writer.beginPointData(scalars, vectors);
    \n-
    1123 }
    \n-
    1124 for (auto it = vertexdata.begin(),
    \n-
    1125 end = vertexdata.end();
    \n-
    1126 it != end;
    \n-
    1127 ++it)
    \n-
    1128 {
    \n-
    1129 unsigned writecomps = it->fieldInfo().size();
    \n-
    1130 // for 2d vector fields should be written as 3d vector fields
    \n-
    1131 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps == 2)
    \n-
    1132 writecomps = 3;
    \n-
    1133 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());
    \n-
    1134 }
    \n-
    1135 writer.endPointData();
    \n-
    1136
    \n-
    1137 // PCellData
    \n-
    1138 {
    \n-
    1139 std::string scalars, vectors;
    \n-
    1140 std::tie(scalars,vectors) = getDataNames(celldata);
    \n-
    1141 writer.beginCellData(scalars, vectors);
    \n-
    1142 }
    \n-
    1143 for (auto it = celldata.begin(),
    \n-
    1144 end = celldata.end();
    \n-
    1145 it != end;
    \n-
    1146 ++it)
    \n-
    1147 {
    \n-
    1148 unsigned writecomps = it->fieldInfo().size();
    \n-
    1149 // for 2d vector fields should be written as 3d vector fields
    \n-
    1150 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps == 2)
    \n-
    1151 writecomps = 3;
    \n-
    1152 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());
    \n-
    1153 }
    \n-
    1154 writer.endCellData();
    \n-
    1155
    \n-
    1156 // PPoints
    \n-
    1157 writer.beginPoints();
    \n-
    1158 writer.addArray("Coordinates", 3, coordPrec);
    \n-
    1159 writer.endPoints();
    \n-
    1160
    \n-
    1161 // Pieces
    \n-
    1162 for( int i = 0; i < commSize; ++i )
    \n-
    1163 {
    \n-
    1164 const std::string& fullname = getParallelPieceName(piecename,
    \n-
    1165 piecepath, i,
    \n-
    1166 commSize);
    \n-
    1167 writer.addPiece(fullname);
    \n-
    1168 }
    \n-
    1169
    \n-
    1170 writer.endMain();
    \n-
    1171 }
    \n-
    1172
    \n-
    1174 void writeDataFile (std::ostream& s)
    \n-
    1175 {
    \n-
    1176 VTK::FileType fileType =
    \n-
    1177 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;
    \n-
    1178
    \n-
    1179 VTK::VTUWriter writer(s, outputtype, fileType);
    \n-
    1180
    \n-
    1181 // Grid characteristics
    \n-
    1182 vertexmapper = new VertexMapper( gridView_, mcmgVertexLayout() );
    \n-
    1183 if (datamode == VTK::conforming)
    \n-
    1184 {
    \n-
    1185 number.resize(vertexmapper->size());
    \n-
    1186 for (std::vector<int>::size_type i=0; i<number.size(); i++) number[i] = -1;
    \n-
    1187 }
    \n-\n-
    1189
    \n-
    1190 writer.beginMain(ncells, nvertices);
    \n-
    1191 writeAllData(writer);
    \n-
    1192 writer.endMain();
    \n-
    1193
    \n-
    1194 // write appended binary data section
    \n-
    1195 if(writer.beginAppended())
    \n-
    1196 writeAllData(writer);
    \n-
    1197 writer.endAppended();
    \n-
    1198
    \n-
    1199 delete vertexmapper; number.clear();
    \n-
    1200 }
    \n-
    1201
    \n-
    1202 void writeAllData(VTK::VTUWriter& writer) {
    \n-
    1203 // PointData
    \n-
    1204 writeVertexData(writer);
    \n-
    1205
    \n-
    1206 // CellData
    \n-
    1207 writeCellData(writer);
    \n-
    1208
    \n-
    1209 // Points
    \n-
    1210 writeGridPoints(writer);
    \n-
    1211
    \n-
    1212 // Cells
    \n-
    1213 writeGridCells(writer);
    \n-
    1214 }
    \n-
    1215
    \n-
    1216 protected:
    \n-
    \n-
    1217 std::string getFormatString() const
    \n-
    1218 {
    \n-\n-
    1220 return "ascii";
    \n-\n-
    1222 return "binary";
    \n-\n-
    1224 return "appended";
    \n-\n-
    1226 return "appended";
    \n-
    1227 DUNE_THROW(IOError, "VTKWriter: unsupported OutputType" << outputtype);
    \n-
    1228 }
    \n-
    \n-
    1229
    \n-
    \n-
    1230 std::string getTypeString() const
    \n-
    1231 {
    \n-
    1232 if (n==1)
    \n-
    1233 return "PolyData";
    \n-
    1234 else
    \n-
    1235 return "UnstructuredGrid";
    \n-
    1236 }
    \n-
    \n-
    1237
    \n-
    \n-
    1239 virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    \n-
    1240 {
    \n-
    1241 nvertices_ = 0;
    \n-
    1242 ncells_ = 0;
    \n-
    1243 ncorners_ = 0;
    \n-
    1244 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n-
    1245 {
    \n-
    1246 ncells_++;
    \n-
    1247 // because of the use of vertexmapper->map(), this iteration must be
    \n-
    1248 // in the order of Dune's numbering.
    \n-
    1249 const int subEntities = it->subEntities(n);
    \n-
    1250 for (int i=0; i<subEntities; ++i)
    \n-
    1251 {
    \n-
    1252 ncorners_++;
    \n-
    1253 if (datamode == VTK::conforming)
    \n-
    1254 {
    \n-
    1255 int alpha = vertexmapper->subIndex(*it,i,n);
    \n-
    1256 if (number[alpha]<0)
    \n-
    1257 number[alpha] = nvertices_++;
    \n-
    1258 }
    \n-
    1259 else
    \n-
    1260 {
    \n-
    1261 nvertices_++;
    \n-
    1262 }
    \n-
    1263 }
    \n-
    1264 }
    \n-
    1265 }
    \n-
    \n-
    1266
    \n-
    1267 template<typename T>
    \n-
    \n-
    1268 std::tuple<std::string,std::string> getDataNames(const T& data) const
    \n-
    1269 {
    \n-
    1270 std::string scalars = "";
    \n-
    1271 for (auto it = data.begin(),
    \n-
    1272 end = data.end();
    \n-
    1273 it != end;
    \n-
    1274 ++it)
    \n-
    1275 if (it->fieldInfo().type() == VTK::FieldInfo::Type::scalar)
    \n-
    1276 {
    \n-
    1277 scalars = it->name();
    \n-
    1278 break;
    \n-
    1279 }
    \n-
    1280
    \n-
    1281 std::string vectors = "";
    \n-
    1282 for (auto it = data.begin(),
    \n-
    1283 end = data.end();
    \n-
    1284 it != end;
    \n-
    1285 ++it)
    \n-
    1286 if (it->fieldInfo().type() == VTK::FieldInfo::Type::vector)
    \n-
    1287 {
    \n-
    1288 vectors = it->name();
    \n-
    1289 break;
    \n-
    1290 }
    \n-
    1291 return std::make_tuple(scalars,vectors);
    \n-
    1292 }
    \n-
    \n-
    1293
    \n-
    1294 template<typename Data, typename Iterator>
    \n-
    \n-
    1295 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator begin, const Iterator end, int nentries)
    \n-
    1296 {
    \n-
    1297 for (auto it = data.begin(),
    \n-
    1298 iend = data.end();
    \n-
    1299 it != iend;
    \n-
    1300 ++it)
    \n-
    1301 {
    \n-
    1302 const auto& f = *it;
    \n-
    1303 VTK::FieldInfo fieldInfo = f.fieldInfo();
    \n-
    1304 std::size_t writecomps = fieldInfo.size();
    \n-
    1305 switch (fieldInfo.type())
    \n-
    1306 {
    \n-\n-
    1308 break;
    \n-\n-
    1310 // vtk file format: a vector data always should have 3 comps (with
    \n-
    1311 // 3rd comp = 0 in 2D case)
    \n-
    1312 if (writecomps > 3)
    \n-
    1313 DUNE_THROW(IOError,"Cannot write VTK vectors with more than 3 components (components was " << writecomps << ")");
    \n-
    1314 writecomps = 3;
    \n-
    1315 break;
    \n-\n-
    1317 DUNE_THROW(NotImplemented,"VTK output for tensors not implemented yet");
    \n-
    1318 }
    \n-
    1319 std::shared_ptr<VTK::DataArrayWriter> p
    \n-
    1320 (writer.makeArrayWriter(f.name(), writecomps, nentries, fieldInfo.precision()));
    \n-
    1321 if(!p->writeIsNoop())
    \n-
    1322 for (Iterator eit = begin; eit!=end; ++eit)
    \n-
    1323 {
    \n-
    1324 const Entity & e = *eit;
    \n-
    1325 f.bind(e);
    \n-
    1326 f.write(eit.position(),*p);
    \n-
    1327 f.unbind();
    \n-
    1328 // vtk file format: a vector data always should have 3 comps
    \n-
    1329 // (with 3rd comp = 0 in 2D case)
    \n-
    1330 for (std::size_t j=fieldInfo.size(); j < writecomps; ++j)
    \n-
    1331 p->write(0.0);
    \n-
    1332 }
    \n-
    1333 }
    \n-
    1334 }
    \n-
    \n-
    1335
    \n-
    \n-
    1337 virtual void writeCellData(VTK::VTUWriter& writer)
    \n-
    1338 {
    \n-
    1339 if(celldata.size() == 0)
    \n-
    1340 return;
    \n-
    1341
    \n-
    1342 std::string scalars, vectors;
    \n-
    1343 std::tie(scalars,vectors) = getDataNames(celldata);
    \n-
    1344
    \n-
    1345 writer.beginCellData(scalars, vectors);
    \n-\n-
    1347 writer.endCellData();
    \n-
    1348 }
    \n-
    \n-
    1349
    \n-
    \n-
    1351 virtual void writeVertexData(VTK::VTUWriter& writer)
    \n-
    1352 {
    \n-
    1353 if(vertexdata.size() == 0)
    \n-
    1354 return;
    \n-
    1355
    \n-
    1356 std::string scalars, vectors;
    \n-
    1357 std::tie(scalars,vectors) = getDataNames(vertexdata);
    \n-
    1358
    \n-
    1359 writer.beginPointData(scalars, vectors);
    \n-\n-
    1361 writer.endPointData();
    \n-
    1362 }
    \n-
    \n-
    1363
    \n-
    \n-
    1365 virtual void writeGridPoints(VTK::VTUWriter& writer)
    \n-
    1366 {
    \n-
    1367 writer.beginPoints();
    \n-
    1368
    \n-
    1369 std::shared_ptr<VTK::DataArrayWriter> p
    \n-
    1370 (writer.makeArrayWriter("Coordinates", 3, nvertices, coordPrec));
    \n-
    1371 if(!p->writeIsNoop()) {
    \n-
    1372 VertexIterator vEnd = vertexEnd();
    \n-
    1373 for (VertexIterator vit=vertexBegin(); vit!=vEnd; ++vit)
    \n-
    1374 {
    \n-
    1375 int dimw=w;
    \n-
    1376 for (int j=0; j<std::min(dimw,3); j++)
    \n-
    1377 p->write((*vit).geometry().corner(vit.localindex())[j]);
    \n-
    1378 for (int j=std::min(dimw,3); j<3; j++)
    \n-
    1379 p->write(0.0);
    \n-
    1380 }
    \n-
    1381 }
    \n-
    1382 // free the VTK::DataArrayWriter before touching the stream
    \n-
    1383 p.reset();
    \n-
    1384
    \n-
    1385 writer.endPoints();
    \n-
    1386 }
    \n-
    \n-
    1387
    \n-
    \n-
    1389 virtual void writeGridCells(VTK::VTUWriter& writer)
    \n-
    1390 {
    \n-
    1391 writer.beginCells();
    \n-
    1392
    \n-
    1393 // connectivity
    \n-
    1394 {
    \n-
    1395 std::shared_ptr<VTK::DataArrayWriter> p1
    \n-
    1396 (writer.makeArrayWriter("connectivity", 1, ncorners, VTK::Precision::int32));
    \n-
    1397 if(!p1->writeIsNoop())
    \n-
    1398 for (CornerIterator it=cornerBegin(); it!=cornerEnd(); ++it)
    \n-
    1399 p1->write(it.id());
    \n-
    1400 }
    \n-
    1401
    \n-
    1402 // offsets
    \n-
    1403 {
    \n-
    1404 std::shared_ptr<VTK::DataArrayWriter> p2
    \n-
    1405 (writer.makeArrayWriter("offsets", 1, ncells, VTK::Precision::int32));
    \n-
    1406 if(!p2->writeIsNoop()) {
    \n-
    1407 int offset = 0;
    \n-
    1408 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n-
    1409 {
    \n-
    1410 offset += it->subEntities(n);
    \n-
    1411 p2->write(offset);
    \n-
    1412 }
    \n-
    1413 }
    \n-
    1414 }
    \n-
    1415
    \n-
    1416 // types
    \n-
    1417 if (n>1)
    \n-
    1418 {
    \n-
    1419 {
    \n-
    1420 std::shared_ptr<VTK::DataArrayWriter> p3
    \n-
    1421 (writer.makeArrayWriter("types", 1, ncells, VTK::Precision::uint8));
    \n-
    1422
    \n-
    1423 if(!p3->writeIsNoop())
    \n-
    1424 {
    \n-
    1425 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)
    \n-
    1426 {
    \n-
    1427 int vtktype = VTK::geometryType(it->type());
    \n-
    1428 p3->write(vtktype);
    \n-
    1429 }
    \n-
    1430 }
    \n-
    1431 }
    \n-
    1432
    \n-
    1433
    \n-
    1434 // if polyhedron cells found also cell faces need to be written
    \n-
    1435 if( polyhedralCellsPresent_ )
    \n-
    1436 {
    \n-
    1437 writeCellFaces( writer );
    \n-
    1438 }
    \n-
    1439 }
    \n-
    1440
    \n-
    1441 writer.endCells();
    \n-
    1442 }
    \n-
    \n-
    1443
    \n-
    1444 protected:
    \n-
    \n-\n-
    1446 {
    \n-
    1447 // check if polyhedron cells are present
    \n-
    1448 for( const auto& geomType : gridView_.indexSet().types( 0 ) )
    \n-
    1449 {
    \n-
    1450 if( VTK::geometryType( geomType ) == VTK::polyhedron )
    \n-
    1451 {
    \n-
    1452 return true;
    \n-
    1453 }
    \n-
    1454 }
    \n-
    1455 return false;
    \n-
    1456 }
    \n-
    \n-
    1457
    \n-
    \n-
    1459 virtual void writeCellFaces(VTK::VTUWriter& writer)
    \n-
    1460 {
    \n-
    1461 if( ! faceVertices_ )
    \n-
    1462 {
    \n-
    1463 faceVertices_.reset( new std::pair< std::vector<int>, std::vector<int> > () );
    \n-
    1464 // fill face vertex structure
    \n-\n-
    1466 faceVertices_->first, faceVertices_->second );
    \n-
    1467 }
    \n-
    1468
    \n-
    1469 std::vector< int >& faces = faceVertices_->first;
    \n-
    1470 std::vector< int >& faceOffsets = faceVertices_->second;
    \n-
    1471 assert( int(faceOffsets.size()) == ncells );
    \n-
    1472
    \n-
    1473 {
    \n-
    1474 std::shared_ptr<VTK::DataArrayWriter> p4
    \n-
    1475 (writer.makeArrayWriter("faces", 1, faces.size(), VTK::Precision::int32));
    \n-
    1476 if(!p4->writeIsNoop())
    \n-
    1477 {
    \n-
    1478 for( const auto& face : faces )
    \n-
    1479 p4->write( face );
    \n-
    1480 }
    \n-
    1481 }
    \n-
    1482
    \n-
    1483 {
    \n-
    1484 std::shared_ptr<VTK::DataArrayWriter> p5
    \n-
    1485 (writer.makeArrayWriter("faceoffsets", 1, ncells, VTK::Precision::int32));
    \n-
    1486 if(!p5->writeIsNoop())
    \n-
    1487 {
    \n-
    1488 for( const auto& offset : faceOffsets )
    \n-
    1489 p5->write( offset );
    \n-
    1490
    \n-
    1491 // clear face vertex structure
    \n-
    1492 faceVertices_.reset();
    \n-
    1493 }
    \n-
    1494 }
    \n-
    1495 }
    \n-
    \n-
    1496
    \n-
    1497 template <class CornerIterator, class IndexSet, class T>
    \n-
    \n-\n-
    1499 const CornerIterator end,
    \n-
    1500 const IndexSet& indexSet,
    \n-
    1501 std::vector<T>& faces,
    \n-
    1502 std::vector<T>& faceOffsets )
    \n-
    1503 {
    \n-
    1504 if( n == 3 && it != end )
    \n-
    1505 {
    \n-
    1506 // clear output arrays
    \n-
    1507 faces.clear();
    \n-
    1508 faces.reserve( 15 * ncells );
    \n-
    1509 faceOffsets.clear();
    \n-
    1510 faceOffsets.reserve( ncells );
    \n-
    1511
    \n-
    1512 int offset = 0;
    \n-
    1513
    \n-
    1514 Cell element = *it;
    \n-
    1515 int elIndex = indexSet.index( element );
    \n-
    1516 std::vector< T > vertices;
    \n-
    1517 vertices.reserve( 30 );
    \n-
    1518 for( ; it != end; ++it )
    \n-
    1519 {
    \n-
    1520 const Cell& cell = *it ;
    \n-
    1521 const int cellIndex = indexSet.index( cell ) ;
    \n-
    1522 if( elIndex != cellIndex )
    \n-
    1523 {
    \n-
    1524 fillFacesForElement( element, indexSet, vertices, offset, faces, faceOffsets );
    \n-
    1525
    \n-
    1526 vertices.clear();
    \n-
    1527 element = cell ;
    \n-
    1528 elIndex = cellIndex ;
    \n-
    1529 }
    \n-
    1530 vertices.push_back( it.id() );
    \n-
    1531 }
    \n-
    1532
    \n-
    1533 // fill faces for last element
    \n-
    1534 fillFacesForElement( element, indexSet, vertices, offset, faces, faceOffsets );
    \n-
    1535 }
    \n-
    1536 }
    \n-
    \n-
    1537
    \n-
    1538 template <class Entity, class IndexSet, class T>
    \n-
    \n-
    1539 static void fillFacesForElement( const Entity& element,
    \n-
    1540 const IndexSet& indexSet,
    \n-
    1541 const std::vector<T>& vertices,
    \n-
    1542 T& offset,
    \n-
    1543 std::vector<T>& faces,
    \n-
    1544 std::vector<T>& faceOffsets )
    \n-
    1545 {
    \n-
    1546 const int dim = n;
    \n-
    1547
    \n-
    1548 std::map< T, T > vxMap;
    \n-
    1549
    \n-
    1550 // get number of local faces
    \n-
    1551 const int nVertices = element.subEntities( dim );
    \n-
    1552 for( int vx = 0; vx < nVertices; ++ vx )
    \n-
    1553 {
    \n-
    1554 const int vxIdx = indexSet.subIndex( element, vx, dim );
    \n-
    1555 vxMap[ vxIdx ] = vertices[ vx ];
    \n-
    1556 }
    \n-
    1557
    \n-
    1558 // get number of local faces
    \n-
    1559 const int nFaces = element.subEntities( 1 );
    \n-
    1560 // store number of faces for current element
    \n-
    1561 faces.push_back( nFaces );
    \n-
    1562 ++offset;
    \n-
    1563 // extract each face as a set of vertex indices
    \n-
    1564 for( int fce = 0; fce < nFaces; ++ fce )
    \n-
    1565 {
    \n-
    1566 // obtain face
    \n-
    1567 const auto face = element.template subEntity< 1 > ( fce );
    \n-
    1568
    \n-
    1569 // get all vertex indices from current face
    \n-
    1570 const int nVxFace = face.subEntities( dim );
    \n-
    1571 faces.push_back( nVxFace );
    \n-
    1572 ++offset ;
    \n-
    1573 for( int i=0; i<nVxFace; ++i )
    \n-
    1574 {
    \n-
    1575 const T vxIndex = indexSet.subIndex( face, i, dim );
    \n-
    1576 assert( vxMap.find( vxIndex ) != vxMap.end() );
    \n-
    1577 faces.push_back( vxMap[ vxIndex ] );
    \n-
    1578 ++offset ;
    \n-
    1579 }
    \n-
    1580 }
    \n-
    1581
    \n-
    1582 // store face offset for each element
    \n-
    1583 faceOffsets.push_back( offset );
    \n-
    1584 }
    \n-
    \n-
    1585
    \n-
    1586 protected:
    \n-
    1587 // the list of registered functions
    \n-
    1588 std::list<VTKLocalFunction> celldata;
    \n-
    1589 std::list<VTKLocalFunction> vertexdata;
    \n-
    1590
    \n-
    1591 // the grid
    \n-\n-
    1593
    \n-
    1594 // temporary grid information
    \n-\n-\n-\n-
    1598 private:
    \n-
    1599 VertexMapper* vertexmapper;
    \n-
    1600 // in conforming mode, for each vertex id (as obtained by vertexmapper)
    \n-
    1601 // hold its number in the iteration order (VertexIterator)
    \n-
    1602 std::vector<int> number;
    \n-
    1603 VTK::DataMode datamode;
    \n-
    1604 VTK::Precision coordPrec;
    \n-
    1605
    \n-
    1606 // true if polyhedral cells are present in the grid
    \n-
    1607 const bool polyhedralCellsPresent_;
    \n-
    1608
    \n-
    1609 // pointer holding face vertex connectivity if needed
    \n-
    1610 std::shared_ptr< std::pair< std::vector<int>, std::vector<int> > > faceVertices_;
    \n-
    1611
    \n-
    1612 protected:
    \n-\n-
    1614 };
    \n-
    \n-
    1615
    \n-
    1616}
    \n-
    1617
    \n-
    1618#endif
    \n-\n-
    Mapper for multiple codim and multiple geometry types.
    \n-\n-
    Functions for VTK output.
    \n-\n-
    Common stuff for the VTKWriter.
    \n-
    Data array writers for the VTKWriter.
    \n-\n-
    PartitionIteratorType
    Parameter to be used for the parallel level- and leaf iterators.
    Definition gridenums.hh:136
    \n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    @ All_Partition
    all entities
    Definition gridenums.hh:141
    \n-
    @ InteriorBorder_Partition
    interior and border entities
    Definition gridenums.hh:138
    \n-
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n-
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n-
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n-
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n-
    const Communication & comm() const
    obtain communication object
    Definition common/gridview.hh:273
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n-
    Grid::ctype ctype
    type used for coordinates in grid
    Definition common/gridview.hh:131
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n-
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n-
    STL namespace.
    \n+
    305} // end namespace Dune
    \n+
    306
    \n+
    307#endif
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-\n-\n-
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n-
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n-
    @ appendedraw
    Output is to the file is appended raw binary.
    Definition common.hh:49
    \n-
    @ appendedbase64
    Output is to the file is appended base64 binary.
    Definition common.hh:51
    \n-
    @ base64
    Output to the file is inline base64 binary.
    Definition common.hh:47
    \n-
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n-
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n-
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n-
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n-
    DataMode
    Whether to produce conforming or non-conforming output.
    Definition common.hh:67
    \n-
    @ conforming
    Output conforming data.
    Definition common.hh:73
    \n-
    @ nonconforming
    Output non-conforming data.
    Definition common.hh:81
    \n-
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n-
    @ polyhedron
    Definition common.hh:142
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n-
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n-
    size_type size() const
    Return total number of entities in the entity set managed by the mapper.
    Definition mcmgmapper.hh:204
    \n-
    Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity of codim 0 entity to starting index in array for dof block.
    Definition mcmgmapper.hh:185
    \n-
    Descriptor struct for VTK fields.
    Definition common.hh:328
    \n-
    std::size_t size() const
    The number of components in the data field.
    Definition common.hh:364
    \n-
    Precision precision() const
    The precision used for the output of the data field.
    Definition common.hh:370
    \n-
    @ tensor
    tensor field (always 3x3)
    \n-
    @ vector
    vector-valued field (always 3D, will be padded if necessary)
    \n-\n-
    Type type() const
    The type of the data field.
    Definition common.hh:358
    \n-
    std::string name() const
    The name of the data field.
    Definition common.hh:352
    \n-
    base class for data array writers
    Definition dataarraywriter.hh:56
    \n-
    void write(T data)
    write one element of data
    Definition dataarraywriter.hh:69
    \n-
    A base class for grid functions with any return type and dimension.
    Definition function.hh:42
    \n-
    Take a vector and interpret it as cell data for the VTKWriter.
    Definition function.hh:97
    \n-
    Take a vector and interpret it as point data for the VTKWriter.
    Definition function.hh:205
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n-
    Writer for the output of grid functions in the vtk format.
    Definition vtksequencewriter.hh:29
    \n-
    Base class to write pvd-files which contains a list of all collected vtk-files.
    Definition vtksequencewriterbase.hh:34
    \n-
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n-
    void addCellData(const Container &v, const std::string &name, int ncomps=1, VTK::Precision prec=VTK::Precision::float32)
    Add a grid function (represented by container) that lives on the cells of the grid to the visualizati...
    Definition vtkwriter.hh:695
    \n-
    CornerIterator cornerEnd() const
    Definition vtkwriter.hh:620
    \n-
    void clear()
    clear list of registered functions
    Definition vtkwriter.hh:775
    \n-
    std::string write(const std::string &name, VTK::OutputType type=VTK::ascii)
    write output (interface might change later)
    Definition vtkwriter.hh:803
    \n-
    VertexIterator vertexBegin() const
    Definition vtkwriter.hh:508
    \n-
    std::string getTypeString() const
    Definition vtkwriter.hh:1230
    \n-
    std::string getParallelHeaderName(const std::string &name, const std::string &path, int commSize) const
    return name of a parallel header file
    Definition vtkwriter.hh:920
    \n-
    void addVertexData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the vertices of the grid to the visualization.
    Definition vtkwriter.hh:713
    \n-
    Dune::VTKFunction< GridView > VTKFunction
    Definition vtkwriter.hh:147
    \n-
    CellIterator cellEnd() const
    Definition vtkwriter.hh:402
    \n-
    std::list< VTKLocalFunction > vertexdata
    Definition vtkwriter.hh:1589
    \n-
    CornerIterator cornerBegin() const
    Definition vtkwriter.hh:613
    \n-
    std::string getSerialPieceName(const std::string &name, const std::string &path) const
    return name of a serial piece file
    Definition vtkwriter.hh:940
    \n-
    void addCellData(const std::shared_ptr< const VTKFunction > &p)
    Add a grid function that lives on the cells of the grid to the visualization.
    Definition vtkwriter.hh:649
    \n-
    std::string getFormatString() const
    Definition vtkwriter.hh:1217
    \n-
    bool checkForPolyhedralCells() const
    Definition vtkwriter.hh:1445
    \n-
    void addVertexData(F &&f, VTK::FieldInfo vtkFieldInfo)
    Add a function by sampling it on the grid vertices.
    Definition vtkwriter.hh:738
    \n-
    virtual void writeCellData(VTK::VTUWriter &writer)
    write cell data
    Definition vtkwriter.hh:1337
    \n-
    virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)
    count the vertices, cells and corners
    Definition vtkwriter.hh:1239
    \n-
    std::string getParallelPieceName(const std::string &name, const std::string &path, int commRank, int commSize) const
    return name of a parallel piece file (or header name)
    Definition vtkwriter.hh:855
    \n-
    CellIterator cellBegin() const
    Definition vtkwriter.hh:397
    \n-
    VTK::OutputType outputtype
    Definition vtkwriter.hh:1613
    \n-
    virtual void writeGridCells(VTK::VTUWriter &writer)
    write the connectivity array
    Definition vtkwriter.hh:1389
    \n-
    GridView gridView_
    Definition vtkwriter.hh:1592
    \n-
    virtual void writeCellFaces(VTK::VTUWriter &writer)
    write the connectivity array
    Definition vtkwriter.hh:1459
    \n-
    void fillFaceVertices(CornerIterator it, const CornerIterator end, const IndexSet &indexSet, std::vector< T > &faces, std::vector< T > &faceOffsets)
    Definition vtkwriter.hh:1498
    \n-
    std::list< VTKLocalFunction > celldata
    Definition vtkwriter.hh:1588
    \n-
    std::string write(const std::string &name, VTK::OutputType type, const int commRank, const int commSize)
    write output (interface might change later)
    Definition vtkwriter.hh:965
    \n-
    VTK::Precision coordPrecision() const
    get the precision with which coordinates are written out
    Definition vtkwriter.hh:782
    \n-
    std::list< VTKLocalFunction >::const_iterator FunctionIterator
    Definition vtkwriter.hh:376
    \n-
    std::tuple< std::string, std::string > getDataNames(const T &data) const
    Definition vtkwriter.hh:1268
    \n-
    virtual void writeGridPoints(VTK::VTUWriter &writer)
    write the positions of vertices
    Definition vtkwriter.hh:1365
    \n-
    virtual void writeVertexData(VTK::VTUWriter &writer)
    write vertex data
    Definition vtkwriter.hh:1351
    \n-
    int nvertices
    Definition vtkwriter.hh:1596
    \n-
    void addCellData(F &&f, VTK::FieldInfo vtkFieldInfo)
    Add a function by sampling it on the element centers.
    Definition vtkwriter.hh:674
    \n-
    void addVertexData(const Container &v, const std::string &name, int ncomps=1, VTK::Precision prec=VTK::Precision::float32)
    Add a grid function (represented by container) that lives on the vertices of the grid to the visualiz...
    Definition vtkwriter.hh:760
    \n-
    virtual ~VTKWriter()
    destructor
    Definition vtkwriter.hh:786
    \n-
    static void fillFacesForElement(const Entity &element, const IndexSet &indexSet, const std::vector< T > &vertices, T &offset, std::vector< T > &faces, std::vector< T > &faceOffsets)
    Definition vtkwriter.hh:1539
    \n-
    void writeData(VTK::VTUWriter &writer, const Data &data, const Iterator begin, const Iterator end, int nentries)
    Definition vtkwriter.hh:1295
    \n-
    int ncells
    Definition vtkwriter.hh:1595
    \n-
    VertexIterator vertexEnd() const
    Definition vtkwriter.hh:515
    \n-
    VTKWriter(const GridView &gridView, VTK::DataMode dm=VTK::conforming, VTK::Precision coordPrecision=VTK::Precision::float32)
    Construct a VTKWriter working on a specific GridView.
    Definition vtkwriter.hh:636
    \n-
    std::string pwrite(const std::string &name, const std::string &path, const std::string &extendpath, VTK::OutputType ot, const int commRank, const int commSize)
    write output; interface might change later
    Definition vtkwriter.hh:1043
    \n-
    std::string pwrite(const std::string &name, const std::string &path, const std::string &extendpath, VTK::OutputType type=VTK::ascii)
    write output (interface might change later)
    Definition vtkwriter.hh:835
    \n-
    int ncorners
    Definition vtkwriter.hh:1597
    \n-
    Type erasure wrapper for VTK data sets.
    Definition vtkwriter.hh:156
    \n-
    void unbind() const
    Unbind the data set from the currently bound entity.
    Definition vtkwriter.hh:360
    \n-
    VTKLocalFunction(F &&f, VTK::FieldInfo fieldInfo)
    Construct a VTKLocalFunction for a dune-functions style LocalFunction.
    Definition vtkwriter.hh:307
    \n-
    std::string name() const
    Returns the name of the data set.
    Definition vtkwriter.hh:342
    \n-
    VTK::FieldInfo _fieldInfo
    Definition vtkwriter.hh:372
    \n-
    VTK::DataArrayWriter Writer
    Definition vtkwriter.hh:160
    \n-
    const VTK::FieldInfo & fieldInfo() const
    Returns the VTK::FieldInfo for the data set.
    Definition vtkwriter.hh:348
    \n-
    void bind(const Entity &e) const
    Bind the data set to grid entity e.
    Definition vtkwriter.hh:354
    \n-
    VTKLocalFunction(const std::shared_ptr< const VTKFunction > &vtkFunctionPtr)
    Construct a VTKLocalFunction for a legacy VTKFunction.
    Definition vtkwriter.hh:331
    \n-
    std::shared_ptr< FunctionWrapperBase > _f
    Definition vtkwriter.hh:371
    \n-
    void write(const Coordinate &pos, Writer &w) const
    Write the value of the data set at local coordinate pos to the writer w.
    Definition vtkwriter.hh:366
    \n-
    Base class for polymorphic container of underlying data set.
    Definition vtkwriter.hh:164
    \n-
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const =0
    Evaluate data set at local position pos inside the current entity and write result to w.
    \n-
    virtual ~FunctionWrapperBase()
    Definition vtkwriter.hh:178
    \n-
    virtual void unbind()=0
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    \n-
    virtual void bind(const Entity &e)=0
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    \n-
    Type erasure implementation for functions conforming to the dune-functions LocalFunction interface.
    Definition vtkwriter.hh:188
    \n-
    typename std::decay< F >::type Function
    Definition vtkwriter.hh:189
    \n-
    FunctionWrapper(F_ &&f)
    Definition vtkwriter.hh:192
    \n-
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const
    Evaluate data set at local position pos inside the current entity and write result to w.
    Definition vtkwriter.hh:206
    \n-
    virtual void unbind()
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    Definition vtkwriter.hh:201
    \n-
    virtual void bind(const Entity &e)
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    Definition vtkwriter.hh:196
    \n-
    Type erasure implementation for C++ functions, i.e., functions that can be evaluated in global coordi...
    Definition vtkwriter.hh:236
    \n-
    GlobalFunctionWrapper(F_ &&f)
    Definition vtkwriter.hh:240
    \n-
    virtual void unbind()
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    Definition vtkwriter.hh:250
    \n-
    typename std::decay< F >::type Function
    Definition vtkwriter.hh:237
    \n-
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const
    Evaluate data set at local position pos inside the current entity and write result to w.
    Definition vtkwriter.hh:255
    \n-
    virtual void bind(const Entity &e)
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    Definition vtkwriter.hh:245
    \n-
    Type erasure implementation for legacy VTKFunctions.
    Definition vtkwriter.hh:276
    \n-
    virtual void unbind()
    Unbind data set from current grid entity - mostly here for performance and symmetry reasons.
    Definition vtkwriter.hh:287
    \n-
    VTKFunctionWrapper(const std::shared_ptr< const VTKFunction > &f)
    Definition vtkwriter.hh:277
    \n-
    virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const
    Evaluate data set at local position pos inside the current entity and write result to w.
    Definition vtkwriter.hh:292
    \n-
    virtual void bind(const Entity &e)
    Bind data set to grid entity - must be called before evaluating (i.e. calling write())
    Definition vtkwriter.hh:282
    \n-
    Iterator over the grids elements.
    Definition vtkwriter.hh:385
    \n-
    CellIterator(const GridCellIterator &x)
    construct a CellIterator from the gridview's Iterator.
    Definition vtkwriter.hh:388
    \n-
    const FieldVector< DT, n > position() const
    Definition vtkwriter.hh:391
    \n-
    Iterate over the grid's vertices.
    Definition vtkwriter.hh:424
    \n-
    VertexIterator(const GridCellIterator &x, const GridCellIterator &end, const VTK::DataMode &dm, const VertexMapper &vm)
    Definition vtkwriter.hh:457
    \n-
    void basicIncrement()
    Definition vtkwriter.hh:440
    \n-
    void increment()
    Definition vtkwriter.hh:468
    \n-
    EntityReference dereference() const
    Definition vtkwriter.hh:491
    \n-
    bool equals(const VertexIterator &cit) const
    Definition vtkwriter.hh:485
    \n-
    FieldVector< DT, n > position() const
    position of vertex inside the entity
    Definition vtkwriter.hh:501
    \n-
    int localindex() const
    index of vertex within the entity, in Dune-numbering
    Definition vtkwriter.hh:496
    \n-
    Iterate over the elements' corners.
    Definition vtkwriter.hh:539
    \n-
    void increment()
    Definition vtkwriter.hh:566
    \n-
    CornerIterator(const GridCellIterator &x, const GridCellIterator &end, const VTK::DataMode &dm, const VertexMapper &vm, const std::vector< int > &num)
    Definition vtkwriter.hh:558
    \n-
    int id() const
    Process-local consecutive zero-starting vertex id.
    Definition vtkwriter.hh:597
    \n-
    EntityReference dereference() const
    Definition vtkwriter.hh:588
    \n-
    bool equals(const CornerIterator &cit) const
    Definition vtkwriter.hh:582
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n-
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n-
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n-
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n-
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n-
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n-
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n-
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n-
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n-
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n+
    Definition basic.hh:31
    \n+
    void reset()
    Definition basic.hh:51
    \n+
    Definition boundarydom.hh:23
    \n+
    void reset(int id, BoundaryParameter parameter, bool defaultData=false)
    Definition boundarydom.hh:60
    \n+
    ~DomainData()
    Definition boundarydom.hh:32
    \n+
    DGFBoundaryParameter::type BoundaryParameter
    Definition boundarydom.hh:24
    \n+
    DomainData()
    Definition boundarydom.hh:26
    \n+
    int id() const
    Definition boundarydom.hh:42
    \n+
    const BoundaryParameter & parameter() const
    Definition boundarydom.hh:54
    \n+
    friend std::ostream & operator<<(std ::ostream &os, const DomainData &ddata)
    Definition boundarydom.hh:73
    \n+
    bool hasParameter() const
    Definition boundarydom.hh:48
    \n+
    DomainData(int id, BoundaryParameter parameter, bool defaultData=false)
    Definition boundarydom.hh:35
    \n+
    bool isDefault() const
    Definition boundarydom.hh:68
    \n+
    Definition boundarydom.hh:90
    \n+
    Domain(std::vector< double > p1, std::vector< double > p2, int id, BoundaryParameter &parameter)
    Definition boundarydom.hh:97
    \n+
    Domain(const Domain &other)
    Definition boundarydom.hh:125
    \n+
    const int dimensionworld
    Definition boundarydom.hh:92
    \n+
    bool contains(const Vector &x) const
    Definition boundarydom.hh:155
    \n+
    DGFBoundaryParameter::type BoundaryParameter
    Definition boundarydom.hh:94
    \n+
    friend std::ostream & operator<<(std ::ostream &os, const Domain &domain)
    Definition boundarydom.hh:172
    \n+
    Domain & operator=(const Domain &other)
    Definition boundarydom.hh:139
    \n+
    const DomainData & data() const
    Definition boundarydom.hh:166
    \n+
    Domain(std::vector< double > p1, std::vector< double > p2, DomainData &data)
    Definition boundarydom.hh:111
    \n+
    Definition boundarydom.hh:195
    \n+
    ~BoundaryDomBlock()
    Definition boundarydom.hh:216
    \n+
    bool hasParameter() const
    Definition boundarydom.cc:137
    \n+
    const Domain & domain() const
    Definition boundarydom.hh:230
    \n+
    const DomainData * contains(const std::vector< Vector > &v) const
    Definition boundarydom.hh:266
    \n+
    bool next()
    Definition boundarydom.hh:223
    \n+
    void reset()
    Definition boundarydom.hh:251
    \n+
    bool ok()
    Definition boundarydom.hh:258
    \n+
    bool hasDefaultData() const
    Definition boundarydom.hh:236
    \n+
    const DomainData * defaultData() const
    Definition boundarydom.hh:242
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Contains types for additional features.
    Definition parser.hh:23
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,1980 +2,437 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-vtkwriter.hh\n+ * dgfparser\n+ * blocks\n+boundarydom.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_VTKWRITER_HH\n-7#define DUNE_VTKWRITER_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n-15#include \n-16#include \n-17#include \n-18#include \n-19#include \n-20\n-21#include \n-22#include \n-23#include \n-24#include \n-25#include \n-26#include \n-27#include \n-28#include \n-29#include \n-30#include \n-31#include \n-32#include \n-33#include \n-34#include \n-35#include \n-36\n-50namespace Dune\n-51{\n+5#ifndef DUNE_DGF_BOUNDARYDOMBLOCK_HH\n+6#define DUNE_DGF_BOUNDARYDOMBLOCK_HH\n+7\n+8#include \n+9#include \n+10#include \n+11\n+12#include \n+13#include \n+14\n+15\n+16namespace Dune\n+17{\n+18\n+19 namespace dgf\n+20 {\n+21\n+22 struct DomainData\n+23 {\n+24 typedef DGFBoundaryParameter::type BoundaryParameter;\n+25\n+26 DomainData ()\n+27 : id_( 0 ),\n+28 parameter_( DGFBoundaryParameter::defaultValue() ),\n+29 defaultData_( false )\n+30 { }\n+31\n+32 ~DomainData () { }\n+33\n+34 // constructor\n+35 DomainData ( int id, BoundaryParameter parameter, bool defaultData = false )\n+36 : id_( id ),\n+37 parameter_( parameter ),\n+38 defaultData_( defaultData )\n+39 { }\n+40\n+41 // return id\n+42 int id () const\n+43 {\n+44 return id_;\n+45 }\n+46\n+47 // return true, if additional parameters given\n+48 bool hasParameter () const\n+49 {\n+50 return (!parameter_.empty());\n+51 }\n 52\n-53 namespace Impl\n-54 {\n-55 // Check whether type F has a method 'bind' (see the dune-functions\n-interface)\n-56 template< class F, class E, class = void >\n-57 struct IsBindable\n-58 : std::false_type\n-59 {};\n-60\n-61 template< class F, class E >\n-62 struct IsBindable< F, E, std::void_t< decltype( std::declval< F & >().bind\n-( std::declval< const E & >() ) ),\n-63 decltype( std::declval< F & >().unbind() ) > >\n-64 : std::true_type\n-65 {};\n+53 // return additional parameters\n+54 const BoundaryParameter & parameter () const\n+55 {\n+56 return parameter_;\n+57 }\n+58\n+59 // reset data\n+60 void reset ( int id, BoundaryParameter parameter, bool defaultData = false )\n+61 {\n+62 id_ = id;\n+63 parameter_ = parameter;\n+64 defaultData_ = defaultData;\n+65 }\n 66\n-67 // Check whether localFunction(F) can be called (see the dune-functions\n-interface)\n-68 template< class F, class = void >\n-69 struct HasLocalFunction\n-70 : std::false_type\n-71 {};\n+67 // returns true if data origins from default boundary domain\n+68 bool isDefault () const\n+69 {\n+70 return defaultData_;\n+71 }\n 72\n-73 template< class F >\n-74 struct HasLocalFunction< F, std::void_t< decltype( localFunction( std::\n-declval< F& >() ) ) > >\n-75 : std::true_type\n-76 {};\n-77\n-78 } // namespace Impl\n-79\n-80 // Forward-declaration here, so the class can be friend of VTKWriter\n-81 template \n-82 class VTKSequenceWriterBase;\n-83 template \n-84 class VTKSequenceWriter;\n+73 friend std::ostream & operator<<_( std :: ostream & os, const DomainData &\n+ddata )\n+74 {\n+75 os << \"domain data: id = \" << ddata.id();\n+76 if( ddata.hasParameter() )\n+77 os << \", parameter = \" << ddata.parameter();\n+78 return os;\n+79 }\n+80\n+81 private:\n+82 int id_;\n+83 BoundaryParameter parameter_;\n+84 bool defaultData_;\n 85\n-94 template< class GridView >\n-95 class VTKWriter {\n-96\n-97 // VTKSequenceWriterBase needs getSerialPieceName\n-98 // and getParallelHeaderName\n-99 friend class VTKSequenceWriterBase;\n-100 // VTKSequenceWriter needs the grid view, to get the MPI size and rank\n-101 friend class VTKSequenceWriter;\n-102\n-103 // extract types\n-104 typedef typename GridView::Grid Grid;\n-105 typedef typename GridView::ctype DT;\n-106 constexpr static int n = GridView::dimension;\n-107 constexpr static int w = GridView::dimensionworld;\n-108\n-109 typedef typename GridView::template Codim< 0 >::Entity Cell;\n-110 typedef typename GridView::template Codim< n >::Entity Vertex;\n-111 typedef Cell Entity;\n-112\n-113 typedef typename GridView::IndexSet IndexSet;\n-114\n-115 static const PartitionIteratorType VTK_Partition = InteriorBorder_\n-Partition;\n-116 //static const PartitionIteratorType VTK_Partition = All_Partition;\n-117\n-118 typedef typename GridView::template Codim< 0 >\n-119 ::template Partition< VTK_Partition >::Iterator\n-120 GridCellIterator;\n-121 typedef typename GridView::template Codim< n >\n-122 ::template Partition< VTK_Partition >::Iterator\n-123 GridVertexIterator;\n-124\n-125 typedef typename GridCellIterator::Reference EntityReference;\n-126\n-127 typedef typename GridView::template Codim< 0 >\n-128 ::Entity::Geometry::LocalCoordinate Coordinate;\n-129\n-130 typedef MultipleCodimMultipleGeomTypeMapper<_GridView_> VertexMapper;\n-131\n-132 // return true if entity should be skipped in Vertex and Corner iterator\n-133 static bool skipEntity( const PartitionType entityType )\n-134 {\n-135 switch( VTK_Partition )\n-136 {\n-137 // for All_Partition no entity has to be skipped\n-138 case All_Partition: return false;\n-139 case InteriorBorder_Partition: return ( entityType != InteriorEntity );\n-140 default: DUNE_THROW(NotImplemented,\"Add check for this partition type\");\n-141 }\n-142 return false ;\n-143 }\n-144\n-145 public:\n+86 }; // end struct DomainData\n+87\n+88\n+89 struct Domain\n+90 {\n+91 // dimension of world coordinates\n+92 const int dimensionworld;\n+93\n+94 typedef DGFBoundaryParameter::type BoundaryParameter;\n+95\n+96 // constructor\n+97 Domain( std::vector< double > p1, std::vector< double > p2, int id,\n+BoundaryParameter & parameter )\n+98 : dimensionworld( p1.size() ),\n+99 left_( p1 ),\n+100 right_( p2 ),\n+101 data_( id, parameter )\n+102 {\n+103 if( int( p2.size() ) != dimensionworld )\n+104 {\n+105 DUNE_THROW(DGFException,\n+106 \"ERROR in \" << *this << \"!\");\n+107 }\n+108 }\n+109\n+110 // constructor\n+111 Domain( std::vector< double > p1, std::vector< double > p2, DomainData &\n+data )\n+112 : dimensionworld( p1.size() ),\n+113 left_( p1 ),\n+114 right_( p2 ),\n+115 data_( data )\n+116 {\n+117 if( int( p2.size() ) != dimensionworld )\n+118 {\n+119 DUNE_THROW(DGFException,\n+120 \"ERROR in \" << *this << \"!\");\n+121 }\n+122 }\n+123\n+124 // copy constructor\n+125 Domain ( const Domain & other )\n+126 : dimensionworld( other.dimensionworld ),\n+127 left_( other.left_ ),\n+128 right_( other.right_ ),\n+129 data_( other.data_ )\n+130 {\n+131 if( dimensionworld != other.dimensionworld )\n+132 {\n+133 DUNE_THROW(DGFException,\n+134 \"ERROR in \" << *this << \"!\");\n+135 }\n+136 }\n+137\n+138 // assignment\n+139 Domain & operator_=_( const Domain & other )\n+140 {\n+141 if( dimensionworld != other.dimensionworld )\n+142 {\n+143 DUNE_THROW(DGFException,\n+144 \"ERROR in \" << *this << \"!\");\n+145 }\n 146\n-147 typedef Dune::VTKFunction<_GridView_> VTKFunction;\n-148\n-149 protected:\n-150\n+147 left_ = other.left_;\n+148 right_= other.right_;\n+149 data_= other.data_;\n+150 return *this;\n+151 }\n 152\n-155 class VTKLocalFunction\n+153 // return true if point is contained in boundary domain\n+154 template< class Vector >\n+155 bool contains ( const Vector & x ) const\n 156 {\n-157\n-158 public:\n-159\n-160 typedef VTK::DataArrayWriter Writer;\n-161\n-163 struct FunctionWrapperBase\n-164 {\n+157 bool ret = true;\n+158 for( int i = 0; i < dimensionworld; ++i )\n+159 {\n+160 if( x[ i ] < left_[ i ] || x[ i ] > right_[ i ] )\n+161 ret = false;\n+162 }\n+163 return ret;\n+164 }\n 165\n-167 virtual void bind(const Entity& e) = 0;\n-168\n-170 virtual void unbind() = 0;\n-171\n-173\n-176 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n-const = 0;\n-177\n-178 virtual ~FunctionWrapperBase()\n-179 {}\n-180\n-181 };\n-182\n-184 // DUNE_PRIVATE since _f has less visibility\n-185 template\n-186 struct DUNE_PRIVATE FunctionWrapper\n-187 : public FunctionWrapperBase\n-188 {\n-189 using Function = typename std::decay::type;\n+166 const DomainData & data () const\n+167 {\n+168 return data_;\n+169 }\n+170\n+171 // for error messages\n+172 friend std::ostream & operator<<_( std :: ostream &os, const Domain &\n+domain )\n+173 {\n+174 os << \"domain: \" << std::endl;\n+175 os << \"left = \";\n+176 for( int i = 0; i < domain.dimensionworld; ++i )\n+177 os << domain.left_[ i ] << \" \";\n+178 os << std::endl;\n+179 os << \"right = \";\n+180 for( int i = 0; i < domain.dimensionworld; ++i )\n+181 os << domain.right_[ i ] << \" \";\n+182 os << std::endl;\n+183 os << domain.data();\n+184 return os;\n+185 }\n+186\n+187 private:\n+188 std::vector< double > left_, right_;\n+189 DomainData data_;\n 190\n-191 template\n-192 FunctionWrapper(F_&& f)\n-193 : _f(std::forward(f))\n-194 {}\n-195\n-196 virtual void bind(const Entity& e)\n-197 {\n-198 _f.bind(e);\n-199 }\n+191 };\n+192\n+193 class BoundaryDomBlock\n+194 : public BasicBlock\n+195 {\n+196 typedef DGFBoundaryParameter::type BoundaryParameter;\n+197\n+198 // the dimension of the vertices (is given from user)\n+199 int dimworld_;\n 200\n-201 virtual void unbind()\n-202 {\n-203 _f.unbind();\n-204 }\n-205\n-206 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n-const\n-207 {\n-208 auto r = _f(pos);\n-209 // we need to do different things here depending on whether r supports\n-indexing into it or not.\n-210 do_write(w,r,count,IsIndexable());\n-211 }\n-212\n-213 private:\n+201 // internal counter\n+202 int counter_;\n+203\n+204 // default values if given\n+205 DomainData * default_;\n+206\n+207 // storage for all domains;\n+208 int ndomains_;\n+209 std::vector< Domain > domains_;\n+210\n+211 public:\n+212 // initialize vertex block and get first vertex\n+213 BoundaryDomBlock ( std::istream & in, int cdimworld );\n 214\n-215 template\n-216 void do_write(Writer& w, const R& r, std::size_t count, std::true_type)\n-const\n+215 // destructor\n+216 ~BoundaryDomBlock ()\n 217 {\n-218 for (std::size_t i = 0; i < count; ++i)\n-219 w.write(r[i]);\n+218 if( default_ )\n+219 delete default_;\n 220 }\n 221\n-222 template\n-223 void do_write(Writer& w, const R& r, std::size_t count, std::false_type)\n-const\n+222 // go to next domain in block\n+223 bool next ()\n 224 {\n-225 assert(count == 1);\n-226 w.write(r);\n+225 counter_++;\n+226 return ( counter_ < ndomains_ );\n 227 }\n 228\n-229 Function _f;\n-230 };\n-231\n-233 template\n-234 struct GlobalFunctionWrapper\n-235 : public FunctionWrapperBase\n-236 {\n-237 using Function = typename std::decay::type;\n-238\n-239 template\n-240 GlobalFunctionWrapper(F_&& f)\n-241 : _f(std::forward(f))\n-242 , element_(nullptr)\n-243 {}\n-244\n-245 virtual void bind(const Entity& e)\n-246 {\n-247 element_ = &e;\n-248 }\n-249\n-250 virtual void unbind()\n-251 {\n-252 element_ = nullptr;\n-253 }\n-254\n-255 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n-const\n-256 {\n-257 auto globalPos = element_->geometry().global(pos);\n-258 auto r = _f(globalPos);\n-259 if constexpr (IsIndexable()) {\n-260 for (std::size_t i = 0; i < count; ++i)\n-261 w.write(r[i]);\n-262 }\n-263 else {\n-264 assert(count == 1);\n-265 w.write(r);\n-266 }\n-267 }\n-268 private:\n-269 Function _f;\n-270 const Entity* element_;\n-271 };\n-272\n-274 struct VTKFunctionWrapper\n-275 : public FunctionWrapperBase\n-276 {\n-277 VTKFunctionWrapper(const std::shared_ptr< const VTKFunction >& f)\n-278 : _f(f)\n-279 , _entity(nullptr)\n-280 {}\n-281\n-282 virtual void bind(const Entity& e)\n-283 {\n-284 _entity = &e;\n+229 // return domain\n+230 const Domain & domain () const\n+231 {\n+232 return domains_.at( counter_ );\n+233 }\n+234\n+235 // return true if default is given\n+236 bool hasDefaultData () const\n+237 {\n+238 return bool( default_ );\n+239 }\n+240\n+241 // return default data\n+242 const DomainData * defaultData () const\n+243 {\n+244 return default_;\n+245 }\n+246\n+247 // return true if any boundary domain block has\n+248 // additional parameters\n+249 bool hasParameter () const;\n+250\n+251 void reset ()\n+252 {\n+253 BasicBlock::reset();\n+254 counter_ = -1;\n+255 }\n+256\n+257 // return true while block is active\n+258 bool ok ()\n+259 {\n+260 return ( counter_ <= ndomains_ );\n+261 }\n+262\n+263 // return data if all vectors in array are contained within\n+264 // a single domain\n+265 template< class Vector >\n+266 const DomainData * contains ( const std::vector< Vector > & v ) const\n+267 {\n+268 std::vector< int > index( ndomains_ );\n+269 for( int i = 0; i < ndomains_; ++i)\n+270 index[ i ] = i;\n+271\n+272 size_t N = v.size();\n+273 for( size_t i = 0; i < N; ++i )\n+274 {\n+275 if( index.empty() )\n+276 break;\n+277\n+278 const int n = index.size();\n+279 assert( n > 0 );\n+280 for( int j = n-1; j >= 0; --j )\n+281 {\n+282 bool inside = domains_[ index[ j ] ].contains( v[ i ] );\n+283 if( !inside )\n+284 index.erase( index.begin() + j );\n 285 }\n-286\n-287 virtual void unbind()\n-288 {\n-289 _entity = nullptr;\n-290 }\n+286 }\n+287\n+288 // check whether no boundary domain found\n+289 if( index.empty() )\n+290 return default_;\n 291\n-292 virtual void write(const Coordinate& pos, Writer& w, std::size_t count)\n-const\n-293 {\n-294 for (std::size_t i = 0; i < count; ++i)\n-295 w.write(_f->evaluate(i,*_entity,pos));\n-296 }\n-297\n-298 private:\n-299\n-300 std::shared_ptr< const VTKFunction > _f;\n-301 const Entity* _entity;\n+292 // check for ambiguity\n+293 if( index.size() > 1 )\n+294 dwarn << \"WARNING: ambiguous boundary domain assignment, use first boundary\n+domain in list\" << std::endl;\n+295\n+296 return &domains_[ index[ 0 ] ].data();\n+297 }\n+298\n+299 private:\n+300 void readBlock ();\n+301 };\n 302\n-303 };\n+303 } // end namespace dgf\n 304\n-306 template::value,\n-int> = 0>\n-307 VTKLocalFunction(F&& f, VTK::FieldInfo fieldInfo)\n-308 : _f(std::make_unique >(std::forward(f)))\n-309 , _fieldInfo(fieldInfo)\n-310 {}\n-311\n-313 // That is, a function that you can create a LocalFunction for, and\n-evaluate that in element coordinates\n-314 template::\n-value && Impl::HasLocalFunction::value, int> = 0>\n-315 VTKLocalFunction(F&& f, VTK::FieldInfo fieldInfo)\n-316 : _f(std::make_unique< FunctionWrapper<\n-317 typename std::decay(f)))>::type\n-318 > >(localFunction(std::forward(f))))\n-319 , _fieldInfo(fieldInfo)\n-320 {}\n-321\n-323 // That is, a function that can be evaluated in global coordinates of the\n-domain\n-324 template::\n-value && not Impl::HasLocalFunction::value, int> = 0>\n-325 VTKLocalFunction(F&& f, VTK::FieldInfo fieldInfo)\n-326 : _f(std::make_unique< GlobalFunctionWrapper >(std::forward(f)))\n-327 , _fieldInfo(fieldInfo)\n-328 {}\n-329\n-331 explicit VTKLocalFunction (const std::shared_ptr< const VTKFunction >&\n-vtkFunctionPtr)\n-332 : _f(std::make_unique(vtkFunctionPtr))\n-333 , _fieldInfo(\n-334 vtkFunctionPtr->name(),\n-335 (vtkFunctionPtr->ncomps() == 2 || vtkFunctionPtr->ncomps() == 3) ? VTK::\n-FieldInfo::Type::vector : VTK::FieldInfo::Type::scalar,\n-336 vtkFunctionPtr->ncomps(),\n-337 vtkFunctionPtr->precision()\n-338 )\n-339 {}\n-340\n-342 std::string name() const\n-343 {\n-344 return fieldInfo().name();\n-345 }\n-346\n-348 const VTK::FieldInfo& fieldInfo() const\n-349 {\n-350 return _fieldInfo;\n-351 }\n-352\n-354 void bind(const Entity& e) const\n-355 {\n-356 _f->bind(e);\n-357 }\n-358\n-360 void unbind() const\n-361 {\n-362 _f->unbind();\n-363 }\n-364\n-366 void write(const Coordinate& pos, Writer& w) const\n-367 {\n-368 _f->write(pos,w,fieldInfo().size());\n-369 }\n-370\n-371 std::shared_ptr _f;\n-372 VTK::FieldInfo _fieldInfo;\n-373\n-374 };\n-375\n-376 typedef typename std::list::const_iterator\n-FunctionIterator;\n-377\n-379\n-384 class CellIterator : public GridCellIterator\n-385 {\n-386 public:\n-388 CellIterator(const GridCellIterator & x) : GridCellIterator(x) {}\n-391 const FieldVector position() const\n-392 {\n-393 return ReferenceElements::general((*this)->type()).position(0,0);\n-394 }\n-395 };\n-396\n-397 CellIterator cellBegin() const\n-398 {\n-399 return gridView_.template begin< 0, VTK_Partition >();\n-400 }\n-401\n-402 CellIterator cellEnd() const\n-403 {\n-404 return gridView_.template end< 0, VTK_Partition >();\n-405 }\n-406\n-408\n-422 class VertexIterator :\n-423 public ForwardIteratorFacade\n-424 {\n-425 GridCellIterator git;\n-426 GridCellIterator gend;\n-427 VTK::DataMode datamode;\n-428 // Index of the currently visited corner within the current element.\n-429 // NOTE: this is in Dune-numbering, in contrast to CornerIterator.\n-430 int cornerIndexDune;\n-431 const VertexMapper & vertexmapper;\n-432 std::vector visited;\n-433 // in conforming mode, for each vertex id (as obtained by vertexmapper)\n-434 // hold its number in the iteration order (VertexIterator)\n-435 int offset;\n-436\n-437 // hide operator ->\n-438 void operator->();\n-439 protected:\n-440 void basicIncrement ()\n-441 {\n-442 if( git == gend )\n-443 return;\n-444 ++cornerIndexDune;\n-445 const int numCorners = git->subEntities(n);\n-446 if( cornerIndexDune == numCorners )\n-447 {\n-448 offset += numCorners;\n-449 cornerIndexDune = 0;\n-450\n-451 ++git;\n-452 while( (git != gend) && skipEntity( git->partitionType() ) )\n-453 ++git;\n-454 }\n-455 }\n-456 public:\n-457 VertexIterator(const GridCellIterator & x,\n-458 const GridCellIterator & end,\n-459 const VTK::DataMode & dm,\n-460 const VertexMapper & vm) :\n-461 git(x), gend(end), datamode(dm), cornerIndexDune(0),\n-462 vertexmapper(vm), visited(vm.size(), false),\n-463 offset(0)\n-464 {\n-465 if (datamode == VTK::conforming && git != gend)\n-466 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;\n-467 }\n-468 void increment ()\n-469 {\n-470 switch (datamode)\n-471 {\n-472 case VTK::conforming :\n-473 while(visited[vertexmapper.subIndex(*git,cornerIndexDune,n)])\n-474 {\n-475 basicIncrement();\n-476 if (git == gend) return;\n-477 }\n-478 visited[vertexmapper.subIndex(*git,cornerIndexDune,n)] = true;\n-479 break;\n-480 case VTK::nonconforming :\n-481 basicIncrement();\n-482 break;\n-483 }\n-484 }\n-485 bool equals (const VertexIterator & cit) const\n-486 {\n-487 return git == cit.git\n-488 && cornerIndexDune == cit.cornerIndexDune\n-489 && datamode == cit.datamode;\n-490 }\n-491 EntityReference dereference() const\n-492 {\n-493 return *git;\n-494 }\n-496 int localindex () const\n-497 {\n-498 return cornerIndexDune;\n-499 }\n-501 FieldVector position () const\n-502 {\n-503 return referenceElement(git->type())\n-504 .position(cornerIndexDune,n);\n-505 }\n-506 };\n-507\n-508 VertexIterator vertexBegin () const\n-509 {\n-510 return VertexIterator( gridView_.template begin< 0, VTK_Partition >(),\n-511 gridView_.template end< 0, VTK_Partition >(),\n-512 datamode, *vertexmapper );\n-513 }\n-514\n-515 VertexIterator vertexEnd () const\n-516 {\n-517 return VertexIterator( gridView_.template end< 0, VTK_Partition >(),\n-518 gridView_.template end< 0, VTK_Partition >(),\n-519 datamode, *vertexmapper );\n-520 }\n-521\n-523\n-537 class CornerIterator :\n-538 public ForwardIteratorFacade\n-539 {\n-540 GridCellIterator git;\n-541 GridCellIterator gend;\n-542 VTK::DataMode datamode;\n-543 // Index of the currently visited corner within the current element.\n-544 // NOTE: this is in VTK-numbering, in contrast to VertexIterator.\n-545 int cornerIndexVTK;\n-546 const VertexMapper & vertexmapper;\n-547 // in conforming mode, for each vertex id (as obtained by vertexmapper)\n-548 // hold its number in the iteration order of VertexIterator (*not*\n-549 // CornerIterator)\n-550 const std::vector & number;\n-551 // holds the number of corners of all the elements we have seen so far,\n-552 // excluding the current element\n-553 int offset;\n-554\n-555 // hide operator ->\n-556 void operator->();\n-557 public:\n-558 CornerIterator(const GridCellIterator & x,\n-559 const GridCellIterator & end,\n-560 const VTK::DataMode & dm,\n-561 const VertexMapper & vm,\n-562 const std::vector & num) :\n-563 git(x), gend(end), datamode(dm), cornerIndexVTK(0),\n-564 vertexmapper(vm),\n-565 number(num), offset(0) {}\n-566 void increment ()\n-567 {\n-568 if( git == gend )\n-569 return;\n-570 ++cornerIndexVTK;\n-571 const int numCorners = git->subEntities(n);\n-572 if( cornerIndexVTK == numCorners )\n-573 {\n-574 offset += numCorners;\n-575 cornerIndexVTK = 0;\n-576\n-577 ++git;\n-578 while( (git != gend) && skipEntity( git->partitionType() ) )\n-579 ++git;\n-580 }\n-581 }\n-582 bool equals (const CornerIterator & cit) const\n-583 {\n-584 return git == cit.git\n-585 && cornerIndexVTK == cit.cornerIndexVTK\n-586 && datamode == cit.datamode;\n-587 }\n-588 EntityReference dereference() const\n-589 {\n-590 return *git;\n-591 }\n-593\n-597 int id () const\n-598 {\n-599 switch (datamode)\n-600 {\n-601 case VTK::conforming :\n-602 return\n-603 number[vertexmapper.subIndex(*git,VTK::renumber(*git,cornerIndexVTK),\n-604 n)];\n-605 case VTK::nonconforming :\n-606 return offset + VTK::renumber(*git,cornerIndexVTK);\n-607 default :\n-608 DUNE_THROW(IOError,\"VTKWriter: unsupported DataMode\" << datamode);\n-609 }\n-610 }\n-611 };\n-612\n-613 CornerIterator cornerBegin () const\n-614 {\n-615 return CornerIterator( gridView_.template begin< 0, VTK_Partition >(),\n-616 gridView_.template end< 0, VTK_Partition >(),\n-617 datamode, *vertexmapper, number );\n-618 }\n-619\n-620 CornerIterator cornerEnd () const\n-621 {\n-622 return CornerIterator( gridView_.template end< 0, VTK_Partition >(),\n-623 gridView_.template end< 0, VTK_Partition >(),\n-624 datamode, *vertexmapper, number );\n-625 }\n-626\n-627 public:\n-636 explicit VTKWriter ( const GridView &gridView,\n-637 VTK::DataMode dm = VTK::conforming,\n-638 VTK::Precision coordPrecision = VTK::Precision::float32)\n-639 : gridView_( gridView ),\n-640 datamode( dm ),\n-641 coordPrec (coordPrecision),\n-642 polyhedralCellsPresent_( checkForPolyhedralCells() )\n-643 { }\n-644\n-649 void addCellData (const std::shared_ptr< const VTKFunction > & p)\n-650 {\n-651 celldata.push_back(VTKLocalFunction(p));\n-652 }\n-653\n-673 template\n-674 void addCellData(F&& f, VTK::FieldInfo vtkFieldInfo)\n-675 {\n-676 celldata.push_back(VTKLocalFunction(std::forward(f),vtkFieldInfo));\n-677 }\n-678\n-694 template\n-695 void addCellData (const Container& v, const std::string &name, int ncomps =\n-1,\n-696 VTK::Precision prec = VTK::Precision::float32)\n-697 {\n-698 typedef P0VTKFunction Function;\n-699 for (int c=0; c1)\n-703 compName << \"[\" << c << \"]\";\n-704 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c,\n-prec);\n-705 addCellData(std::shared_ptr< const VTKFunction >(p));\n-706 }\n-707 }\n-708\n-713 void addVertexData (const std::shared_ptr< const VTKFunction > & p)\n-714 {\n-715 vertexdata.push_back(VTKLocalFunction(p));\n-716 }\n-717\n-737 template\n-738 void addVertexData(F&& f, VTK::FieldInfo vtkFieldInfo)\n-739 {\n-740 vertexdata.push_back(VTKLocalFunction(std::forward(f),vtkFieldInfo));\n-741 }\n-742\n-743\n-759 template\n-760 void addVertexData (const Container& v, const std::string &name, int\n-ncomps=1,\n-761 VTK::Precision prec = VTK::Precision::float32)\n-762 {\n-763 typedef P1VTKFunction Function;\n-764 for (int c=0; c1)\n-768 compName << \"[\" << c << \"]\";\n-769 VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c,\n-prec);\n-770 addVertexData(std::shared_ptr< const VTKFunction >(p));\n-771 }\n-772 }\n-773\n-775 void clear ()\n-776 {\n-777 celldata.clear();\n-778 vertexdata.clear();\n-779 }\n-780\n-782 VTK::Precision coordPrecision() const\n-783 { return coordPrec; }\n-784\n-786 virtual ~VTKWriter ()\n-787 {\n-788 this->clear();\n-789 }\n-790\n-803 std::string write ( const std::string &name,\n-804 VTK::OutputType type = VTK::ascii )\n-805 {\n-806 return write( name, type, gridView_.comm().rank(), gridView_.comm().size()\n-);\n-807 }\n-808\n-835 std::string pwrite ( const std::string & name, const std::string & path,\n-const std::string & extendpath,\n-836 VTK::OutputType type = VTK::ascii )\n-837 {\n-838 return pwrite( name, path, extendpath, type, gridView_.comm().rank(),\n-gridView_.comm().size() );\n-839 }\n-840\n-841 protected:\n-843\n-855 std::string getParallelPieceName(const std::string& name,\n-856 const std::string& path,\n-857 int commRank, int commSize) const\n-858 {\n-859 std::ostringstream s;\n-860 // write path first\n-861 if(path.size() > 0)\n-862 {\n-863 s << path;\n-864 if(path[path.size()-1] != '/')\n-865 s << '/';\n-866 }\n-867\n-868 std::string fileprefix;\n-869 // check if a path was already added to name\n-870 // and if yes find filename without path\n-871 auto pos = name.rfind('/');\n-872 if( pos != std::string::npos )\n-873 {\n-874 // extract filename without path\n-875 fileprefix = name.substr( pos+1 );\n-876 // extract the path and added it before\n-877 // the magic below is added\n-878 std::string newpath = name.substr(0, pos);\n-879 s << newpath;\n-880 if(newpath[name.size()-1] != '/')\n-881 s << '/';\n-882 }\n-883 else\n-884 {\n-885 // if no path was found just copy the name\n-886 fileprefix = name;\n-887 }\n-888\n-889 s << 's' << std::setw(4) << std::setfill('0') << commSize << '-';\n-890 const bool writeHeader = commRank < 0;\n-891 if( ! writeHeader )\n-892 {\n-893 s << 'p' << std::setw(4) << std::setfill('0') << commRank << '-';\n-894 }\n-895\n-896 s << fileprefix << \".\";\n-897 // write p for header files\n-898 if( writeHeader )\n-899 s << \"p\";\n-900 s << \"vt\";\n-901\n-902 if(GridView::dimension > 1)\n-903 s << \"u\";\n-904 else\n-905 s << \"p\";\n-906 return s.str();\n-907 }\n-908\n-910\n-920 std::string getParallelHeaderName(const std::string& name,\n-921 const std::string& path,\n-922 int commSize) const\n-923 {\n-924 return getParallelPieceName( name, path, -1, commSize );\n-925 }\n-926\n-928\n-940 std::string getSerialPieceName(const std::string& name,\n-941 const std::string& path) const\n-942 {\n-943 static const std::string extension =\n-944 GridView::dimension == 1 ? \".vtp\" : \".vtu\";\n-945\n-946 return concatPaths(path, name+extension);\n-947 }\n-948\n-965 std::string write ( const std::string &name,\n-966 VTK::OutputType type,\n-967 const int commRank,\n-968 const int commSize )\n-969 {\n-970 // in the parallel case, just use pwrite, it has all the necessary\n-971 // stuff, so we don't need to reimplement it here.\n-972 if(commSize > 1)\n-973 {\n-974 std::string filename = name;\n-975 std::string path = std::string(\"\");\n-976\n-977 // check if a path was already added to name\n-978 // and if yes find filename without path\n-979 auto pos = name.rfind('/');\n-980 if( pos != std::string::npos )\n-981 {\n-982 // extract filename without path\n-983 filename = name.substr( pos+1 );\n-984\n-985 // extract the path and added it before\n-986 // the magic below is added\n-987 path = name.substr(0, pos);\n-988 }\n-989\n-990 return pwrite(filename, path, \"\", type, commRank, commSize);\n-991 }\n-992\n-993 // make data mode visible to private functions\n-994 outputtype = type;\n-995\n-996 // generate filename for process data\n-997 std::string pieceName = getSerialPieceName(name, \"\");\n-998\n-999 // write process data\n-1000 std::ofstream file;\n-1001 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n-1002 std::ios_base::eofbit);\n-1003 // check if file can be opened\n-1004 try {\n-1005 file.open( pieceName.c_str(), std::ios::binary );\n-1006 }\n-1007 catch(...) {\n-1008 std::cerr << \"Filename: \" << pieceName << \" could not be opened\" << std::\n-endl;\n-1009 throw;\n-1010 }\n-1011 if (! file.is_open())\n-1012 DUNE_THROW(IOError, \"Could not write to piece file \" << pieceName);\n-1013 writeDataFile( file );\n-1014 file.close();\n-1015\n-1016 return pieceName;\n-1017 }\n-1018\n-1020\n-1043 std::string pwrite(const std::string& name, const std::string& path,\n-1044 const std::string& extendpath,\n-1045 VTK::OutputType ot, const int commRank,\n-1046 const int commSize )\n-1047 {\n-1048 // make data mode visible to private functions\n-1049 outputtype=ot;\n-1050\n-1051 // do some magic because paraview can only cope with relative paths to\n-piece files\n-1052 std::ofstream file;\n-1053 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n-1054 std::ios_base::eofbit);\n-1055 std::string piecepath = concatPaths(path, extendpath);\n-1056 std::string relpiecepath = relativePath(path, piecepath);\n-1057\n-1058 // write this processes .vtu/.vtp piece file\n-1059 std::string fullname = getParallelPieceName(name, piecepath, commRank,\n-1060 commSize);\n-1061 // check if file can be opened\n-1062 try {\n-1063 file.open(fullname.c_str(),std::ios::binary);\n-1064 }\n-1065 catch(...) {\n-1066 std::cerr << \"Filename: \" << fullname << \" could not be opened\" << std::\n-endl;\n-1067 throw;\n-1068 }\n-1069 if (! file.is_open())\n-1070 DUNE_THROW(IOError, \"Could not write to piecefile file \" << fullname);\n-1071 writeDataFile(file);\n-1072 file.close();\n-1073 gridView_.comm().barrier();\n-1074\n-1075 // if we are rank 0, write .pvtu/.pvtp parallel header\n-1076 fullname = getParallelHeaderName(name, path, commSize);\n-1077 if( commRank ==0 )\n-1078 {\n-1079 file.open(fullname.c_str());\n-1080 if (! file.is_open())\n-1081 DUNE_THROW(IOError, \"Could not write to parallel file \" << fullname);\n-1082 writeParallelHeader(file,name,relpiecepath, commSize );\n-1083 file.close();\n-1084 }\n-1085 gridView_.comm().barrier();\n-1086 return fullname;\n-1087 }\n-1088\n-1089 private:\n-1091\n-1108 void writeParallelHeader(std::ostream& s, const std::string& piecename,\n-1109 const std::string& piecepath, const int commSize)\n-1110 {\n-1111 VTK::FileType fileType =\n-1112 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;\n-1113\n-1114 VTK::PVTUWriter writer(s, fileType);\n-1115\n-1116 writer.beginMain();\n-1117\n-1118 // PPointData\n-1119 {\n-1120 std::string scalars, vectors;\n-1121 std::tie(scalars,vectors) = getDataNames(vertexdata);\n-1122 writer.beginPointData(scalars, vectors);\n-1123 }\n-1124 for (auto it = vertexdata.begin(),\n-1125 end = vertexdata.end();\n-1126 it != end;\n-1127 ++it)\n-1128 {\n-1129 unsigned writecomps = it->fieldInfo().size();\n-1130 // for 2d vector fields should be written as 3d vector fields\n-1131 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps ==\n-2)\n-1132 writecomps = 3;\n-1133 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());\n-1134 }\n-1135 writer.endPointData();\n-1136\n-1137 // PCellData\n-1138 {\n-1139 std::string scalars, vectors;\n-1140 std::tie(scalars,vectors) = getDataNames(celldata);\n-1141 writer.beginCellData(scalars, vectors);\n-1142 }\n-1143 for (auto it = celldata.begin(),\n-1144 end = celldata.end();\n-1145 it != end;\n-1146 ++it)\n-1147 {\n-1148 unsigned writecomps = it->fieldInfo().size();\n-1149 // for 2d vector fields should be written as 3d vector fields\n-1150 if(it->fieldInfo().type() == VTK::FieldInfo::Type::vector && writecomps ==\n-2)\n-1151 writecomps = 3;\n-1152 writer.addArray(it->name(), writecomps, it->fieldInfo().precision());\n-1153 }\n-1154 writer.endCellData();\n-1155\n-1156 // PPoints\n-1157 writer.beginPoints();\n-1158 writer.addArray(\"Coordinates\", 3, coordPrec);\n-1159 writer.endPoints();\n-1160\n-1161 // Pieces\n-1162 for( int i = 0; i < commSize; ++i )\n-1163 {\n-1164 const std::string& fullname = getParallelPieceName(piecename,\n-1165 piecepath, i,\n-1166 commSize);\n-1167 writer.addPiece(fullname);\n-1168 }\n-1169\n-1170 writer.endMain();\n-1171 }\n-1172\n-1174 void writeDataFile (std::ostream& s)\n-1175 {\n-1176 VTK::FileType fileType =\n-1177 (n == 1) ? VTK::polyData : VTK::unstructuredGrid;\n-1178\n-1179 VTK::VTUWriter writer(s, outputtype, fileType);\n-1180\n-1181 // Grid characteristics\n-1182 vertexmapper = new VertexMapper( gridView_, mcmgVertexLayout() );\n-1183 if (datamode == VTK::conforming)\n-1184 {\n-1185 number.resize(vertexmapper->size());\n-1186 for (std::vector::size_type i=0; imap(), this iteration must be\n-1248 // in the order of Dune's numbering.\n-1249 const int subEntities = it->subEntities(n);\n-1250 for (int i=0; isubIndex(*it,i,n);\n-1256 if (number[alpha]<0)\n-1257 number[alpha] = nvertices_++;\n-1258 }\n-1259 else\n-1260 {\n-1261 nvertices_++;\n-1262 }\n-1263 }\n-1264 }\n-1265 }\n-1266\n-1267 template\n-1268 std::tuple getDataNames(const T& data) const\n-1269 {\n-1270 std::string scalars = \"\";\n-1271 for (auto it = data.begin(),\n-1272 end = data.end();\n-1273 it != end;\n-1274 ++it)\n-1275 if (it->fieldInfo().type() == VTK::FieldInfo::Type::scalar)\n-1276 {\n-1277 scalars = it->name();\n-1278 break;\n-1279 }\n-1280\n-1281 std::string vectors = \"\";\n-1282 for (auto it = data.begin(),\n-1283 end = data.end();\n-1284 it != end;\n-1285 ++it)\n-1286 if (it->fieldInfo().type() == VTK::FieldInfo::Type::vector)\n-1287 {\n-1288 vectors = it->name();\n-1289 break;\n-1290 }\n-1291 return std::make_tuple(scalars,vectors);\n-1292 }\n-1293\n-1294 template\n-1295 void writeData(VTK::VTUWriter& writer, const Data& data, const Iterator\n-begin, const Iterator end, int nentries)\n-1296 {\n-1297 for (auto it = data.begin(),\n-1298 iend = data.end();\n-1299 it != iend;\n-1300 ++it)\n-1301 {\n-1302 const auto& f = *it;\n-1303 VTK::FieldInfo fieldInfo = f.fieldInfo();\n-1304 std::size_t writecomps = fieldInfo.size();\n-1305 switch (fieldInfo.type())\n-1306 {\n-1307 case VTK::FieldInfo::Type::scalar:\n-1308 break;\n-1309 case VTK::FieldInfo::Type::vector:\n-1310 // vtk file format: a vector data always should have 3 comps (with\n-1311 // 3rd comp = 0 in 2D case)\n-1312 if (writecomps > 3)\n-1313 DUNE_THROW(IOError,\"Cannot write VTK vectors with more than 3 components\n-(components was \" << writecomps << \")\");\n-1314 writecomps = 3;\n-1315 break;\n-1316 case VTK::FieldInfo::Type::tensor:\n-1317 DUNE_THROW(NotImplemented,\"VTK output for tensors not implemented yet\");\n-1318 }\n-1319 std::shared_ptr p\n-1320 (writer.makeArrayWriter(f.name(), writecomps, nentries,\n-fieldInfo.precision()));\n-1321 if(!p->writeIsNoop())\n-1322 for (Iterator eit = begin; eit!=end; ++eit)\n-1323 {\n-1324 const Entity & e = *eit;\n-1325 f.bind(e);\n-1326 f.write(eit.position(),*p);\n-1327 f.unbind();\n-1328 // vtk file format: a vector data always should have 3 comps\n-1329 // (with 3rd comp = 0 in 2D case)\n-1330 for (std::size_t j=fieldInfo.size(); j < writecomps; ++j)\n-1331 p->write(0.0);\n-1332 }\n-1333 }\n-1334 }\n-1335\n-1337 virtual void writeCellData(VTK::VTUWriter& writer)\n-1338 {\n-1339 if(celldata.size() == 0)\n-1340 return;\n-1341\n-1342 std::string scalars, vectors;\n-1343 std::tie(scalars,vectors) = getDataNames(celldata);\n-1344\n-1345 writer.beginCellData(scalars, vectors);\n-1346 writeData(writer,celldata,cellBegin(),cellEnd(),ncells);\n-1347 writer.endCellData();\n-1348 }\n-1349\n-1351 virtual void writeVertexData(VTK::VTUWriter& writer)\n-1352 {\n-1353 if(vertexdata.size() == 0)\n-1354 return;\n-1355\n-1356 std::string scalars, vectors;\n-1357 std::tie(scalars,vectors) = getDataNames(vertexdata);\n-1358\n-1359 writer.beginPointData(scalars, vectors);\n-1360 writeData(writer,vertexdata,vertexBegin(),vertexEnd(),nvertices);\n-1361 writer.endPointData();\n-1362 }\n-1363\n-1365 virtual void writeGridPoints(VTK::VTUWriter& writer)\n-1366 {\n-1367 writer.beginPoints();\n-1368\n-1369 std::shared_ptr p\n-1370 (writer.makeArrayWriter(\"Coordinates\", 3, nvertices, coordPrec));\n-1371 if(!p->writeIsNoop()) {\n-1372 VertexIterator vEnd = vertexEnd();\n-1373 for (VertexIterator vit=vertexBegin(); vit!=vEnd; ++vit)\n-1374 {\n-1375 int dimw=w;\n-1376 for (int j=0; jwrite((*vit).geometry().corner(vit.localindex())[j]);\n-1378 for (int j=std::min(dimw,3); j<3; j++)\n-1379 p->write(0.0);\n-1380 }\n-1381 }\n-1382 // free the VTK::DataArrayWriter before touching the stream\n-1383 p.reset();\n-1384\n-1385 writer.endPoints();\n-1386 }\n-1387\n-1389 virtual void writeGridCells(VTK::VTUWriter& writer)\n-1390 {\n-1391 writer.beginCells();\n-1392\n-1393 // connectivity\n-1394 {\n-1395 std::shared_ptr p1\n-1396 (writer.makeArrayWriter(\"connectivity\", 1, ncorners, VTK::Precision::\n-int32));\n-1397 if(!p1->writeIsNoop())\n-1398 for (CornerIterator it=cornerBegin(); it!=cornerEnd(); ++it)\n-1399 p1->write(it.id());\n-1400 }\n-1401\n-1402 // offsets\n-1403 {\n-1404 std::shared_ptr p2\n-1405 (writer.makeArrayWriter(\"offsets\", 1, ncells, VTK::Precision::int32));\n-1406 if(!p2->writeIsNoop()) {\n-1407 int offset = 0;\n-1408 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)\n-1409 {\n-1410 offset += it->subEntities(n);\n-1411 p2->write(offset);\n-1412 }\n-1413 }\n-1414 }\n-1415\n-1416 // types\n-1417 if (n>1)\n-1418 {\n-1419 {\n-1420 std::shared_ptr p3\n-1421 (writer.makeArrayWriter(\"types\", 1, ncells, VTK::Precision::uint8));\n-1422\n-1423 if(!p3->writeIsNoop())\n-1424 {\n-1425 for (CellIterator it=cellBegin(); it!=cellEnd(); ++it)\n-1426 {\n-1427 int vtktype = VTK::geometryType(it->type());\n-1428 p3->write(vtktype);\n-1429 }\n-1430 }\n-1431 }\n-1432\n-1433\n-1434 // if polyhedron cells found also cell faces need to be written\n-1435 if( polyhedralCellsPresent_ )\n-1436 {\n-1437 writeCellFaces( writer );\n-1438 }\n-1439 }\n-1440\n-1441 writer.endCells();\n-1442 }\n-1443\n-1444 protected:\n-1445 bool checkForPolyhedralCells() const\n-1446 {\n-1447 // check if polyhedron cells are present\n-1448 for( const auto& geomType : gridView_.indexSet().types( 0 ) )\n-1449 {\n-1450 if( VTK::geometryType( geomType ) == VTK::polyhedron )\n-1451 {\n-1452 return true;\n-1453 }\n-1454 }\n-1455 return false;\n-1456 }\n-1457\n-1459 virtual void writeCellFaces(VTK::VTUWriter& writer)\n-1460 {\n-1461 if( ! faceVertices_ )\n-1462 {\n-1463 faceVertices_.reset( new std::pair< std::vector, std::vector >\n-() );\n-1464 // fill face vertex structure\n-1465 fillFaceVertices( cornerBegin(), cornerEnd(), gridView_.indexSet(),\n-1466 faceVertices_->first, faceVertices_->second );\n-1467 }\n-1468\n-1469 std::vector< int >& faces = faceVertices_->first;\n-1470 std::vector< int >& faceOffsets = faceVertices_->second;\n-1471 assert( int(faceOffsets.size()) == ncells );\n-1472\n-1473 {\n-1474 std::shared_ptr p4\n-1475 (writer.makeArrayWriter(\"faces\", 1, faces.size(), VTK::Precision::int32));\n-1476 if(!p4->writeIsNoop())\n-1477 {\n-1478 for( const auto& face : faces )\n-1479 p4->write( face );\n-1480 }\n-1481 }\n-1482\n-1483 {\n-1484 std::shared_ptr p5\n-1485 (writer.makeArrayWriter(\"faceoffsets\", 1, ncells, VTK::Precision::int32));\n-1486 if(!p5->writeIsNoop())\n-1487 {\n-1488 for( const auto& offset : faceOffsets )\n-1489 p5->write( offset );\n-1490\n-1491 // clear face vertex structure\n-1492 faceVertices_.reset();\n-1493 }\n-1494 }\n-1495 }\n-1496\n-1497 template \n-1498 inline void fillFaceVertices( CornerIterator it,\n-1499 const CornerIterator end,\n-1500 const IndexSet& indexSet,\n-1501 std::vector& faces,\n-1502 std::vector& faceOffsets )\n-1503 {\n-1504 if( n == 3 && it != end )\n-1505 {\n-1506 // clear output arrays\n-1507 faces.clear();\n-1508 faces.reserve( 15 * ncells );\n-1509 faceOffsets.clear();\n-1510 faceOffsets.reserve( ncells );\n-1511\n-1512 int offset = 0;\n-1513\n-1514 Cell element = *it;\n-1515 int elIndex = indexSet.index( element );\n-1516 std::vector< T > vertices;\n-1517 vertices.reserve( 30 );\n-1518 for( ; it != end; ++it )\n-1519 {\n-1520 const Cell& cell = *it ;\n-1521 const int cellIndex = indexSet.index( cell ) ;\n-1522 if( elIndex != cellIndex )\n-1523 {\n-1524 fillFacesForElement( element, indexSet, vertices, offset, faces,\n-faceOffsets );\n-1525\n-1526 vertices.clear();\n-1527 element = cell ;\n-1528 elIndex = cellIndex ;\n-1529 }\n-1530 vertices.push_back( it.id() );\n-1531 }\n-1532\n-1533 // fill faces for last element\n-1534 fillFacesForElement( element, indexSet, vertices, offset, faces,\n-faceOffsets );\n-1535 }\n-1536 }\n-1537\n-1538 template \n-1539 static void fillFacesForElement( const Entity& element,\n-1540 const IndexSet& indexSet,\n-1541 const std::vector& vertices,\n-1542 T& offset,\n-1543 std::vector& faces,\n-1544 std::vector& faceOffsets )\n-1545 {\n-1546 const int dim = n;\n-1547\n-1548 std::map< T, T > vxMap;\n-1549\n-1550 // get number of local faces\n-1551 const int nVertices = element.subEntities( dim );\n-1552 for( int vx = 0; vx < nVertices; ++ vx )\n-1553 {\n-1554 const int vxIdx = indexSet.subIndex( element, vx, dim );\n-1555 vxMap[ vxIdx ] = vertices[ vx ];\n-1556 }\n-1557\n-1558 // get number of local faces\n-1559 const int nFaces = element.subEntities( 1 );\n-1560 // store number of faces for current element\n-1561 faces.push_back( nFaces );\n-1562 ++offset;\n-1563 // extract each face as a set of vertex indices\n-1564 for( int fce = 0; fce < nFaces; ++ fce )\n-1565 {\n-1566 // obtain face\n-1567 const auto face = element.template subEntity< 1 > ( fce );\n-1568\n-1569 // get all vertex indices from current face\n-1570 const int nVxFace = face.subEntities( dim );\n-1571 faces.push_back( nVxFace );\n-1572 ++offset ;\n-1573 for( int i=0; i celldata;\n-1589 std::list vertexdata;\n-1590\n-1591 // the grid\n-1592 GridView gridView_;\n-1593\n-1594 // temporary grid information\n-1595 int ncells;\n-1596 int nvertices;\n-1597 int ncorners;\n-1598 private:\n-1599 VertexMapper* vertexmapper;\n-1600 // in conforming mode, for each vertex id (as obtained by vertexmapper)\n-1601 // hold its number in the iteration order (VertexIterator)\n-1602 std::vector number;\n-1603 VTK::DataMode datamode;\n-1604 VTK::Precision coordPrec;\n-1605\n-1606 // true if polyhedral cells are present in the grid\n-1607 const bool polyhedralCellsPresent_;\n-1608\n-1609 // pointer holding face vertex connectivity if needed\n-1610 std::shared_ptr< std::pair< std::vector, std::vector > >\n-faceVertices_;\n-1611\n-1612 protected:\n-1613 VTK::OutputType outputtype;\n-1614 };\n-1615\n-1616}\n-1617\n-1618#endif\n-gridenums.hh\n-mcmgmapper.hh\n-Mapper for multiple codim and multiple geometry types.\n-streams.hh\n-function.hh\n-Functions for VTK output.\n-vtuwriter.hh\n-common.hh\n-Common stuff for the VTKWriter.\n-dataarraywriter.hh\n-Data array writers for the VTKWriter.\n-pvtuwriter.hh\n-Dune::PartitionIteratorType\n-PartitionIteratorType\n-Parameter to be used for the parallel level- and leaf iterators.\n-Definition gridenums.hh:136\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-Dune::All_Partition\n-@ All_Partition\n-all entities\n-Definition gridenums.hh:141\n-Dune::InteriorBorder_Partition\n-@ InteriorBorder_Partition\n-interior and border entities\n-Definition gridenums.hh:138\n-Dune::InteriorEntity\n-@ InteriorEntity\n-all interior entities\n-Definition gridenums.hh:31\n-Dune::GridView::indexSet\n-const IndexSet & indexSet() const\n-obtain the index set\n-Definition common/gridview.hh:177\n-Dune::GridView::Grid\n-Traits::Grid Grid\n-type of the grid\n-Definition common/gridview.hh:83\n-Dune::GridView::IndexSet\n-Traits::IndexSet IndexSet\n-type of the index set\n-Definition common/gridview.hh:86\n-Dune::GridView::comm\n-const Communication & comm() const\n-obtain communication object\n-Definition common/gridview.hh:273\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n-Dune::GridView::ctype\n-Grid::ctype ctype\n-type used for coordinates in grid\n-Definition common/gridview.hh:131\n-Dune::GridView::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/gridview.hh:137\n-Dune::mcmgVertexLayout\n-MCMGLayout mcmgVertexLayout()\n-layout for vertices (dim-0 entities)\n-Definition mcmgmapper.hh:107\n-std\n-STL namespace.\n+305} // end namespace Dune\n+306\n+307#endif\n+basic.hh\n+parser.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::int32\n-@ int32\n-Dune::VTK::Precision::uint8\n-@ uint8\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::VTK::OutputType\n-OutputType\n-How the bulk data should be stored in the file.\n-Definition common.hh:43\n-Dune::VTK::ascii\n-@ ascii\n-Output to the file is in ascii.\n-Definition common.hh:45\n-Dune::VTK::appendedraw\n-@ appendedraw\n-Output is to the file is appended raw binary.\n-Definition common.hh:49\n-Dune::VTK::appendedbase64\n-@ appendedbase64\n-Output is to the file is appended base64 binary.\n-Definition common.hh:51\n-Dune::VTK::base64\n-@ base64\n-Output to the file is inline base64 binary.\n-Definition common.hh:47\n-Dune::VTK::renumber\n-int renumber(const Dune::GeometryType &t, int i)\n-renumber VTK <-> Dune\n-Definition common.hh:186\n-Dune::VTK::FileType\n-FileType\n-which type of VTK file to write\n-Definition common.hh:252\n-Dune::VTK::polyData\n-@ polyData\n-for .vtp files (PolyData)\n-Definition common.hh:254\n-Dune::VTK::unstructuredGrid\n-@ unstructuredGrid\n-for .vtu files (UnstructuredGrid)\n-Definition common.hh:256\n-Dune::VTK::DataMode\n-DataMode\n-Whether to produce conforming or non-conforming output.\n-Definition common.hh:67\n-Dune::VTK::conforming\n-@ conforming\n-Output conforming data.\n-Definition common.hh:73\n-Dune::VTK::nonconforming\n-@ nonconforming\n-Output non-conforming data.\n-Definition common.hh:81\n-Dune::VTK::geometryType\n-GeometryType geometryType(const Dune::GeometryType &t)\n-mapping from GeometryType to VTKGeometryType\n-Definition common.hh:151\n-Dune::VTK::polyhedron\n-@ polyhedron\n-Definition common.hh:142\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::GridView::Codim\n-A struct that collects all associated types of one implementation from the\n-Traits class.\n-Definition common/gridview.hh:104\n-Dune::MultipleCodimMultipleGeomTypeMapper\n-Implementation class for a multiple codim and multiple geometry type mapper.\n-Definition mcmgmapper.hh:129\n-Dune::MultipleCodimMultipleGeomTypeMapper::size\n-size_type size() const\n-Return total number of entities in the entity set managed by the mapper.\n-Definition mcmgmapper.hh:204\n-Dune::MultipleCodimMultipleGeomTypeMapper::subIndex\n-Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i,\n-unsigned int codim) const\n-Map subentity of codim 0 entity to starting index in array for dof block.\n-Definition mcmgmapper.hh:185\n-Dune::VTK::FieldInfo\n-Descriptor struct for VTK fields.\n-Definition common.hh:328\n-Dune::VTK::FieldInfo::size\n-std::size_t size() const\n-The number of components in the data field.\n-Definition common.hh:364\n-Dune::VTK::FieldInfo::precision\n-Precision precision() const\n-The precision used for the output of the data field.\n-Definition common.hh:370\n-Dune::VTK::FieldInfo::Type::tensor\n-@ tensor\n-tensor field (always 3x3)\n-Dune::VTK::FieldInfo::Type::vector\n-@ vector\n-vector-valued field (always 3D, will be padded if necessary)\n-Dune::VTK::FieldInfo::Type::scalar\n-@ scalar\n-Dune::VTK::FieldInfo::type\n-Type type() const\n-The type of the data field.\n-Definition common.hh:358\n-Dune::VTK::FieldInfo::name\n-std::string name() const\n-The name of the data field.\n-Definition common.hh:352\n-Dune::VTK::DataArrayWriter\n-base class for data array writers\n-Definition dataarraywriter.hh:56\n-Dune::VTK::DataArrayWriter::write\n-void write(T data)\n-write one element of data\n-Definition dataarraywriter.hh:69\n-Dune::VTKFunction\n-A base class for grid functions with any return type and dimension.\n-Definition function.hh:42\n-Dune::P0VTKFunction\n-Take a vector and interpret it as cell data for the VTKWriter.\n-Definition function.hh:97\n-Dune::P1VTKFunction\n-Take a vector and interpret it as point data for the VTKWriter.\n-Definition function.hh:205\n-Dune::VTK::PVTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition pvtuwriter.hh:62\n-Dune::VTKSequenceWriter\n-Writer for the output of grid functions in the vtk format.\n-Definition vtksequencewriter.hh:29\n-Dune::VTKSequenceWriterBase\n-Base class to write pvd-files which contains a list of all collected vtk-files.\n-Definition vtksequencewriterbase.hh:34\n-Dune::VTKWriter\n-Writer for the output of grid functions in the vtk format.\n-Definition vtkwriter.hh:95\n-Dune::VTKWriter::addCellData\n-void addCellData(const Container &v, const std::string &name, int ncomps=1,\n-VTK::Precision prec=VTK::Precision::float32)\n-Add a grid function (represented by container) that lives on the cells of the\n-grid to the visualizati...\n-Definition vtkwriter.hh:695\n-Dune::VTKWriter::cornerEnd\n-CornerIterator cornerEnd() const\n-Definition vtkwriter.hh:620\n-Dune::VTKWriter::clear\n-void clear()\n-clear list of registered functions\n-Definition vtkwriter.hh:775\n-Dune::VTKWriter::write\n-std::string write(const std::string &name, VTK::OutputType type=VTK::ascii)\n-write output (interface might change later)\n-Definition vtkwriter.hh:803\n-Dune::VTKWriter::vertexBegin\n-VertexIterator vertexBegin() const\n-Definition vtkwriter.hh:508\n-Dune::VTKWriter::getTypeString\n-std::string getTypeString() const\n-Definition vtkwriter.hh:1230\n-Dune::VTKWriter::getParallelHeaderName\n-std::string getParallelHeaderName(const std::string &name, const std::string\n-&path, int commSize) const\n-return name of a parallel header file\n-Definition vtkwriter.hh:920\n-Dune::VTKWriter::addVertexData\n-void addVertexData(const std::shared_ptr< const VTKFunction > &p)\n-Add a grid function that lives on the vertices of the grid to the\n-visualization.\n-Definition vtkwriter.hh:713\n-Dune::VTKWriter::VTKFunction\n-Dune::VTKFunction< GridView > VTKFunction\n-Definition vtkwriter.hh:147\n-Dune::VTKWriter::cellEnd\n-CellIterator cellEnd() const\n-Definition vtkwriter.hh:402\n-Dune::VTKWriter::vertexdata\n-std::list< VTKLocalFunction > vertexdata\n-Definition vtkwriter.hh:1589\n-Dune::VTKWriter::cornerBegin\n-CornerIterator cornerBegin() const\n-Definition vtkwriter.hh:613\n-Dune::VTKWriter::getSerialPieceName\n-std::string getSerialPieceName(const std::string &name, const std::string\n-&path) const\n-return name of a serial piece file\n-Definition vtkwriter.hh:940\n-Dune::VTKWriter::addCellData\n-void addCellData(const std::shared_ptr< const VTKFunction > &p)\n-Add a grid function that lives on the cells of the grid to the visualization.\n-Definition vtkwriter.hh:649\n-Dune::VTKWriter::getFormatString\n-std::string getFormatString() const\n-Definition vtkwriter.hh:1217\n-Dune::VTKWriter::checkForPolyhedralCells\n-bool checkForPolyhedralCells() const\n-Definition vtkwriter.hh:1445\n-Dune::VTKWriter::addVertexData\n-void addVertexData(F &&f, VTK::FieldInfo vtkFieldInfo)\n-Add a function by sampling it on the grid vertices.\n-Definition vtkwriter.hh:738\n-Dune::VTKWriter::writeCellData\n-virtual void writeCellData(VTK::VTUWriter &writer)\n-write cell data\n-Definition vtkwriter.hh:1337\n-Dune::VTKWriter::countEntities\n-virtual void countEntities(int &nvertices_, int &ncells_, int &ncorners_)\n-count the vertices, cells and corners\n-Definition vtkwriter.hh:1239\n-Dune::VTKWriter::getParallelPieceName\n-std::string getParallelPieceName(const std::string &name, const std::string\n-&path, int commRank, int commSize) const\n-return name of a parallel piece file (or header name)\n-Definition vtkwriter.hh:855\n-Dune::VTKWriter::cellBegin\n-CellIterator cellBegin() const\n-Definition vtkwriter.hh:397\n-Dune::VTKWriter::outputtype\n-VTK::OutputType outputtype\n-Definition vtkwriter.hh:1613\n-Dune::VTKWriter::writeGridCells\n-virtual void writeGridCells(VTK::VTUWriter &writer)\n-write the connectivity array\n-Definition vtkwriter.hh:1389\n-Dune::VTKWriter::gridView_\n-GridView gridView_\n-Definition vtkwriter.hh:1592\n-Dune::VTKWriter::writeCellFaces\n-virtual void writeCellFaces(VTK::VTUWriter &writer)\n-write the connectivity array\n-Definition vtkwriter.hh:1459\n-Dune::VTKWriter::fillFaceVertices\n-void fillFaceVertices(CornerIterator it, const CornerIterator end, const\n-IndexSet &indexSet, std::vector< T > &faces, std::vector< T > &faceOffsets)\n-Definition vtkwriter.hh:1498\n-Dune::VTKWriter::celldata\n-std::list< VTKLocalFunction > celldata\n-Definition vtkwriter.hh:1588\n-Dune::VTKWriter::write\n-std::string write(const std::string &name, VTK::OutputType type, const int\n-commRank, const int commSize)\n-write output (interface might change later)\n-Definition vtkwriter.hh:965\n-Dune::VTKWriter::coordPrecision\n-VTK::Precision coordPrecision() const\n-get the precision with which coordinates are written out\n-Definition vtkwriter.hh:782\n-Dune::VTKWriter::FunctionIterator\n-std::list< VTKLocalFunction >::const_iterator FunctionIterator\n-Definition vtkwriter.hh:376\n-Dune::VTKWriter::getDataNames\n-std::tuple< std::string, std::string > getDataNames(const T &data) const\n-Definition vtkwriter.hh:1268\n-Dune::VTKWriter::writeGridPoints\n-virtual void writeGridPoints(VTK::VTUWriter &writer)\n-write the positions of vertices\n-Definition vtkwriter.hh:1365\n-Dune::VTKWriter::writeVertexData\n-virtual void writeVertexData(VTK::VTUWriter &writer)\n-write vertex data\n-Definition vtkwriter.hh:1351\n-Dune::VTKWriter::nvertices\n-int nvertices\n-Definition vtkwriter.hh:1596\n-Dune::VTKWriter::addCellData\n-void addCellData(F &&f, VTK::FieldInfo vtkFieldInfo)\n-Add a function by sampling it on the element centers.\n-Definition vtkwriter.hh:674\n-Dune::VTKWriter::addVertexData\n-void addVertexData(const Container &v, const std::string &name, int ncomps=1,\n-VTK::Precision prec=VTK::Precision::float32)\n-Add a grid function (represented by container) that lives on the vertices of\n-the grid to the visualiz...\n-Definition vtkwriter.hh:760\n-Dune::VTKWriter::~VTKWriter\n-virtual ~VTKWriter()\n-destructor\n-Definition vtkwriter.hh:786\n-Dune::VTKWriter::fillFacesForElement\n-static void fillFacesForElement(const Entity &element, const IndexSet\n-&indexSet, const std::vector< T > &vertices, T &offset, std::vector< T >\n-&faces, std::vector< T > &faceOffsets)\n-Definition vtkwriter.hh:1539\n-Dune::VTKWriter::writeData\n-void writeData(VTK::VTUWriter &writer, const Data &data, const Iterator begin,\n-const Iterator end, int nentries)\n-Definition vtkwriter.hh:1295\n-Dune::VTKWriter::ncells\n-int ncells\n-Definition vtkwriter.hh:1595\n-Dune::VTKWriter::vertexEnd\n-VertexIterator vertexEnd() const\n-Definition vtkwriter.hh:515\n-Dune::VTKWriter::VTKWriter\n-VTKWriter(const GridView &gridView, VTK::DataMode dm=VTK::conforming, VTK::\n-Precision coordPrecision=VTK::Precision::float32)\n-Construct a VTKWriter working on a specific GridView.\n-Definition vtkwriter.hh:636\n-Dune::VTKWriter::pwrite\n-std::string pwrite(const std::string &name, const std::string &path, const\n-std::string &extendpath, VTK::OutputType ot, const int commRank, const int\n-commSize)\n-write output; interface might change later\n-Definition vtkwriter.hh:1043\n-Dune::VTKWriter::pwrite\n-std::string pwrite(const std::string &name, const std::string &path, const\n-std::string &extendpath, VTK::OutputType type=VTK::ascii)\n-write output (interface might change later)\n-Definition vtkwriter.hh:835\n-Dune::VTKWriter::ncorners\n-int ncorners\n-Definition vtkwriter.hh:1597\n-Dune::VTKWriter::VTKLocalFunction\n-Type erasure wrapper for VTK data sets.\n-Definition vtkwriter.hh:156\n-Dune::VTKWriter::VTKLocalFunction::unbind\n-void unbind() const\n-Unbind the data set from the currently bound entity.\n-Definition vtkwriter.hh:360\n-Dune::VTKWriter::VTKLocalFunction::VTKLocalFunction\n-VTKLocalFunction(F &&f, VTK::FieldInfo fieldInfo)\n-Construct a VTKLocalFunction for a dune-functions style LocalFunction.\n-Definition vtkwriter.hh:307\n-Dune::VTKWriter::VTKLocalFunction::name\n-std::string name() const\n-Returns the name of the data set.\n-Definition vtkwriter.hh:342\n-Dune::VTKWriter::VTKLocalFunction::_fieldInfo\n-VTK::FieldInfo _fieldInfo\n-Definition vtkwriter.hh:372\n-Dune::VTKWriter::VTKLocalFunction::Writer\n-VTK::DataArrayWriter Writer\n-Definition vtkwriter.hh:160\n-Dune::VTKWriter::VTKLocalFunction::fieldInfo\n-const VTK::FieldInfo & fieldInfo() const\n-Returns the VTK::FieldInfo for the data set.\n-Definition vtkwriter.hh:348\n-Dune::VTKWriter::VTKLocalFunction::bind\n-void bind(const Entity &e) const\n-Bind the data set to grid entity e.\n-Definition vtkwriter.hh:354\n-Dune::VTKWriter::VTKLocalFunction::VTKLocalFunction\n-VTKLocalFunction(const std::shared_ptr< const VTKFunction > &vtkFunctionPtr)\n-Construct a VTKLocalFunction for a legacy VTKFunction.\n-Definition vtkwriter.hh:331\n-Dune::VTKWriter::VTKLocalFunction::_f\n-std::shared_ptr< FunctionWrapperBase > _f\n-Definition vtkwriter.hh:371\n-Dune::VTKWriter::VTKLocalFunction::write\n-void write(const Coordinate &pos, Writer &w) const\n-Write the value of the data set at local coordinate pos to the writer w.\n-Definition vtkwriter.hh:366\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase\n-Base class for polymorphic container of underlying data set.\n-Definition vtkwriter.hh:164\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::write\n-virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n-=0\n-Evaluate data set at local position pos inside the current entity and write\n-result to w.\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::~FunctionWrapperBase\n-virtual ~FunctionWrapperBase()\n-Definition vtkwriter.hh:178\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::unbind\n-virtual void unbind()=0\n-Unbind data set from current grid entity - mostly here for performance and\n-symmetry reasons.\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase::bind\n-virtual void bind(const Entity &e)=0\n-Bind data set to grid entity - must be called before evaluating (i.e. calling\n-write())\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapper\n-Type erasure implementation for functions conforming to the dune-functions\n-LocalFunction interface.\n-Definition vtkwriter.hh:188\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::Function\n-typename std::decay< F >::type Function\n-Definition vtkwriter.hh:189\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::FunctionWrapper\n-FunctionWrapper(F_ &&f)\n-Definition vtkwriter.hh:192\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::write\n-virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n-Evaluate data set at local position pos inside the current entity and write\n-result to w.\n-Definition vtkwriter.hh:206\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::unbind\n-virtual void unbind()\n-Unbind data set from current grid entity - mostly here for performance and\n-symmetry reasons.\n-Definition vtkwriter.hh:201\n-Dune::VTKWriter::VTKLocalFunction::FunctionWrapper::bind\n-virtual void bind(const Entity &e)\n-Bind data set to grid entity - must be called before evaluating (i.e. calling\n-write())\n-Definition vtkwriter.hh:196\n-Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper\n-Type erasure implementation for C++ functions, i.e., functions that can be\n-evaluated in global coordi...\n-Definition vtkwriter.hh:236\n-Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::GlobalFunctionWrapper\n-GlobalFunctionWrapper(F_ &&f)\n-Definition vtkwriter.hh:240\n-Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::unbind\n-virtual void unbind()\n-Unbind data set from current grid entity - mostly here for performance and\n-symmetry reasons.\n-Definition vtkwriter.hh:250\n-Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::Function\n-typename std::decay< F >::type Function\n-Definition vtkwriter.hh:237\n-Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::write\n-virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n-Evaluate data set at local position pos inside the current entity and write\n-result to w.\n-Definition vtkwriter.hh:255\n-Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper::bind\n-virtual void bind(const Entity &e)\n-Bind data set to grid entity - must be called before evaluating (i.e. calling\n-write())\n-Definition vtkwriter.hh:245\n-Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper\n-Type erasure implementation for legacy VTKFunctions.\n-Definition vtkwriter.hh:276\n-Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::unbind\n-virtual void unbind()\n-Unbind data set from current grid entity - mostly here for performance and\n-symmetry reasons.\n-Definition vtkwriter.hh:287\n-Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::VTKFunctionWrapper\n-VTKFunctionWrapper(const std::shared_ptr< const VTKFunction > &f)\n-Definition vtkwriter.hh:277\n-Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::write\n-virtual void write(const Coordinate &pos, Writer &w, std::size_t count) const\n-Evaluate data set at local position pos inside the current entity and write\n-result to w.\n-Definition vtkwriter.hh:292\n-Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper::bind\n-virtual void bind(const Entity &e)\n-Bind data set to grid entity - must be called before evaluating (i.e. calling\n-write())\n-Definition vtkwriter.hh:282\n-Dune::VTKWriter::CellIterator\n-Iterator over the grids elements.\n-Definition vtkwriter.hh:385\n-Dune::VTKWriter::CellIterator::CellIterator\n-CellIterator(const GridCellIterator &x)\n-construct a CellIterator from the gridview's Iterator.\n-Definition vtkwriter.hh:388\n-Dune::VTKWriter::CellIterator::position\n-const FieldVector< DT, n > position() const\n-Definition vtkwriter.hh:391\n-Dune::VTKWriter::VertexIterator\n-Iterate over the grid's vertices.\n-Definition vtkwriter.hh:424\n-Dune::VTKWriter::VertexIterator::VertexIterator\n-VertexIterator(const GridCellIterator &x, const GridCellIterator &end, const\n-VTK::DataMode &dm, const VertexMapper &vm)\n-Definition vtkwriter.hh:457\n-Dune::VTKWriter::VertexIterator::basicIncrement\n-void basicIncrement()\n-Definition vtkwriter.hh:440\n-Dune::VTKWriter::VertexIterator::increment\n-void increment()\n-Definition vtkwriter.hh:468\n-Dune::VTKWriter::VertexIterator::dereference\n-EntityReference dereference() const\n-Definition vtkwriter.hh:491\n-Dune::VTKWriter::VertexIterator::equals\n-bool equals(const VertexIterator &cit) const\n-Definition vtkwriter.hh:485\n-Dune::VTKWriter::VertexIterator::position\n-FieldVector< DT, n > position() const\n-position of vertex inside the entity\n-Definition vtkwriter.hh:501\n-Dune::VTKWriter::VertexIterator::localindex\n-int localindex() const\n-index of vertex within the entity, in Dune-numbering\n-Definition vtkwriter.hh:496\n-Dune::VTKWriter::CornerIterator\n-Iterate over the elements' corners.\n-Definition vtkwriter.hh:539\n-Dune::VTKWriter::CornerIterator::increment\n-void increment()\n-Definition vtkwriter.hh:566\n-Dune::VTKWriter::CornerIterator::CornerIterator\n-CornerIterator(const GridCellIterator &x, const GridCellIterator &end, const\n-VTK::DataMode &dm, const VertexMapper &vm, const std::vector< int > &num)\n-Definition vtkwriter.hh:558\n-Dune::VTKWriter::CornerIterator::id\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::BasicBlock::reset\n+void reset()\n+Definition basic.hh:51\n+Dune::dgf::DomainData\n+Definition boundarydom.hh:23\n+Dune::dgf::DomainData::reset\n+void reset(int id, BoundaryParameter parameter, bool defaultData=false)\n+Definition boundarydom.hh:60\n+Dune::dgf::DomainData::~DomainData\n+~DomainData()\n+Definition boundarydom.hh:32\n+Dune::dgf::DomainData::BoundaryParameter\n+DGFBoundaryParameter::type BoundaryParameter\n+Definition boundarydom.hh:24\n+Dune::dgf::DomainData::DomainData\n+DomainData()\n+Definition boundarydom.hh:26\n+Dune::dgf::DomainData::id\n int id() const\n-Process-local consecutive zero-starting vertex id.\n-Definition vtkwriter.hh:597\n-Dune::VTKWriter::CornerIterator::dereference\n-EntityReference dereference() const\n-Definition vtkwriter.hh:588\n-Dune::VTKWriter::CornerIterator::equals\n-bool equals(const CornerIterator &cit) const\n-Definition vtkwriter.hh:582\n-Dune::VTK::VTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition vtuwriter.hh:98\n-Dune::VTK::VTUWriter::makeArrayWriter\n-DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n-unsigned nitems, Precision prec)\n-acquire a DataArrayWriter\n-Definition vtuwriter.hh:380\n-Dune::VTK::VTUWriter::endCellData\n-void endCellData()\n-finish CellData section\n-Definition vtuwriter.hh:220\n-Dune::VTK::VTUWriter::beginCells\n-void beginCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:274\n-Dune::VTK::VTUWriter::endPointData\n-void endPointData()\n-finish PointData section\n-Definition vtuwriter.hh:182\n-Dune::VTK::VTUWriter::beginCellData\n-void beginCellData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start CellData section\n-Definition vtuwriter.hh:205\n-Dune::VTK::VTUWriter::beginPointData\n-void beginPointData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start PointData section\n-Definition vtuwriter.hh:167\n-Dune::VTK::VTUWriter::endPoints\n-void endPoints()\n-finish section for the point coordinates\n-Definition vtuwriter.hh:249\n-Dune::VTK::VTUWriter::endCells\n-void endCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:285\n-Dune::VTK::VTUWriter::beginPoints\n-void beginPoints()\n-start section for the point coordinates\n-Definition vtuwriter.hh:238\n+Definition boundarydom.hh:42\n+Dune::dgf::DomainData::parameter\n+const BoundaryParameter & parameter() const\n+Definition boundarydom.hh:54\n+Dune::dgf::DomainData::operator<<\n+friend std::ostream & operator<<(std ::ostream &os, const DomainData &ddata)\n+Definition boundarydom.hh:73\n+Dune::dgf::DomainData::hasParameter\n+bool hasParameter() const\n+Definition boundarydom.hh:48\n+Dune::dgf::DomainData::DomainData\n+DomainData(int id, BoundaryParameter parameter, bool defaultData=false)\n+Definition boundarydom.hh:35\n+Dune::dgf::DomainData::isDefault\n+bool isDefault() const\n+Definition boundarydom.hh:68\n+Dune::dgf::Domain\n+Definition boundarydom.hh:90\n+Dune::dgf::Domain::Domain\n+Domain(std::vector< double > p1, std::vector< double > p2, int id,\n+BoundaryParameter ¶meter)\n+Definition boundarydom.hh:97\n+Dune::dgf::Domain::Domain\n+Domain(const Domain &other)\n+Definition boundarydom.hh:125\n+Dune::dgf::Domain::dimensionworld\n+const int dimensionworld\n+Definition boundarydom.hh:92\n+Dune::dgf::Domain::contains\n+bool contains(const Vector &x) const\n+Definition boundarydom.hh:155\n+Dune::dgf::Domain::BoundaryParameter\n+DGFBoundaryParameter::type BoundaryParameter\n+Definition boundarydom.hh:94\n+Dune::dgf::Domain::operator<<\n+friend std::ostream & operator<<(std ::ostream &os, const Domain &domain)\n+Definition boundarydom.hh:172\n+Dune::dgf::Domain::operator=\n+Domain & operator=(const Domain &other)\n+Definition boundarydom.hh:139\n+Dune::dgf::Domain::data\n+const DomainData & data() const\n+Definition boundarydom.hh:166\n+Dune::dgf::Domain::Domain\n+Domain(std::vector< double > p1, std::vector< double > p2, DomainData &data)\n+Definition boundarydom.hh:111\n+Dune::dgf::BoundaryDomBlock\n+Definition boundarydom.hh:195\n+Dune::dgf::BoundaryDomBlock::~BoundaryDomBlock\n+~BoundaryDomBlock()\n+Definition boundarydom.hh:216\n+Dune::dgf::BoundaryDomBlock::hasParameter\n+bool hasParameter() const\n+Definition boundarydom.cc:137\n+Dune::dgf::BoundaryDomBlock::domain\n+const Domain & domain() const\n+Definition boundarydom.hh:230\n+Dune::dgf::BoundaryDomBlock::contains\n+const DomainData * contains(const std::vector< Vector > &v) const\n+Definition boundarydom.hh:266\n+Dune::dgf::BoundaryDomBlock::next\n+bool next()\n+Definition boundarydom.hh:223\n+Dune::dgf::BoundaryDomBlock::reset\n+void reset()\n+Definition boundarydom.hh:251\n+Dune::dgf::BoundaryDomBlock::ok\n+bool ok()\n+Definition boundarydom.hh:258\n+Dune::dgf::BoundaryDomBlock::hasDefaultData\n+bool hasDefaultData() const\n+Definition boundarydom.hh:236\n+Dune::dgf::BoundaryDomBlock::defaultData\n+const DomainData * defaultData() const\n+Definition boundarydom.hh:242\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n+Dune::DGFBoundaryParameter\n+Contains types for additional features.\n+Definition parser.hh:23\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00932.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00932.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: corneriterator.hh File Reference\n+dune-grid: general.cc File Reference\n \n \n \n \n \n \n \n@@ -65,44 +65,31 @@\n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n-
    corneriterator.hh File Reference
    \n+
    general.cc File Reference
    \n
    \n
    \n-
    #include <iterator>
    \n-#include <dune/common/iteratorfacades.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/io/file/vtk/corner.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::VTK::CornerIterator< CellIterator >
     iterate over the corners of some cell range More...
     
    \n+
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,28 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-corneriterator.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 \u00a0 Dune::VTK::CornerIterator<_CellIterator_>\n-\u00a0 iterate over the corners of some cell range More...\n-\u00a0\n+ * dgfparser\n+ * blocks\n+Namespaces\n+general.cc File Reference\n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n+namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00935.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00935.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: function.hh File Reference\n+dune-grid: dgfoned.hh File Reference\n \n \n \n \n \n \n \n@@ -65,59 +65,49 @@\n \n \n \n \n \n \n \n
    \n \n-
    function.hh File Reference
    \n+
    dgfoned.hh File Reference
    \n
    \n
    \n-\n-

    Functions for VTK output. \n-More...

    \n-
    #include <string>
    \n+
    #include <algorithm>
    \n+#include <fstream>
    \n+#include <iostream>
    \n+#include <istream>
    \n+#include <vector>
    \n #include <dune/common/exceptions.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/multilineargeometry.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <dune/grid/common/intersection.hh>
    \n+#include <dune/grid/onedgrid.hh>
    \n+#include "dgfparser.hh"
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::VTKFunction< GridView >
     A base class for grid functions with any return type and dimension. More...
     
    class  Dune::P0VTKFunction< GV, V >
     Take a vector and interpret it as cell data for the VTKWriter. More...
    struct  Dune::DGFGridInfo< OneDGrid >
     
    class  Dune::P1VTKFunction< GV, V >
     Take a vector and interpret it as point data for the VTKWriter. More...
    struct  Dune::DGFGridFactory< OneDGrid >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-

    Detailed Description

    \n-

    Functions for VTK output.

    \n-
    Author
    Peter Bastian, Christian Engwer
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,41 +2,31 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-function.hh File Reference\n-Functions for VTK output. More...\n-#include \n+dgfoned.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 \"dgfparser.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTKFunction<_GridView_>\n-\u00a0 A base class for grid functions with any return type and dimension.\n- More...\n+struct \u00a0 Dune::DGFGridInfo<_OneDGrid_>\n \u00a0\n-class \u00a0 Dune::P0VTKFunction<_GV,_V_>\n-\u00a0 Take a vector and interpret it as cell data for the VTKWriter. More...\n-\u00a0\n-class \u00a0 Dune::P1VTKFunction<_GV,_V_>\n-\u00a0 Take a vector and interpret it as point data for the VTKWriter. More...\n+struct \u00a0 Dune::DGFGridFactory<_OneDGrid_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Functions for VTK output.\n- Author\n- Peter Bastian, Christian Engwer\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00935_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00935_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: function.hh Source File\n+dune-grid: dgfoned.hh Source File\n \n \n \n \n \n \n \n@@ -70,277 +70,295 @@\n \n \n \n \n \n \n \n
    \n-
    function.hh
    \n+
    dgfoned.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
    \n-
    8
    \n-
    9#include <string>
    \n-
    10
    \n-
    11#include <dune/common/exceptions.hh>
    \n-
    12#include <dune/common/fvector.hh>
    \n-
    13
    \n-
    14#include <dune/geometry/type.hh>
    \n-
    15#include <dune/geometry/referenceelements.hh>
    \n-
    16#include <dune/geometry/multilineargeometry.hh>
    \n+
    5#ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH
    \n+
    6#define DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH
    \n+
    7
    \n+
    8//- C++ includes
    \n+
    9#include <algorithm>
    \n+
    10#include <fstream>
    \n+
    11#include <iostream>
    \n+
    12#include <istream>
    \n+
    13#include <vector>
    \n+
    14
    \n+
    15//- dune-common includes
    \n+
    16#include <dune/common/exceptions.hh>
    \n
    17
    \n-\n-\n-
    20
    \n-
    26namespace Dune
    \n+
    18//- dune-grid includes
    \n+\n+
    20#include <dune/grid/onedgrid.hh>
    \n+
    21
    \n+
    22//- local includes
    \n+
    23#include "dgfparser.hh"
    \n+
    24
    \n+
    25
    \n+
    26namespace
    \n
    27{
    \n-
    30
    \n-
    32 //
    \n-
    33 // Base VTKFunction
    \n-
    34 //
    \n+
    28 // helper method used below
    \n+
    29 double getfirst ( std::vector< double > v )
    \n+
    30 {
    \n+
    31 return v[ 0 ];
    \n+
    32 }
    \n+
    33} // end anonymous namespace
    \n+
    34
    \n
    35
    \n-
    40 template< class GridView >
    \n-
    \n-\n-
    42 {
    \n-
    43 public:
    \n-
    44 typedef typename GridView::ctype ctype;
    \n-
    45 constexpr static int dim = GridView::dimension;
    \n-
    46 typedef typename GridView::template Codim< 0 >::Entity Entity;
    \n-
    47
    \n-
    50 virtual int ncomps () const = 0;
    \n-
    51
    \n-
    53
    \n-
    60 virtual double evaluate (int comp, const Entity& e,
    \n-
    61 const Dune::FieldVector<ctype,dim>& xi) const = 0;
    \n-
    62
    \n-
    64 virtual std::string name () const = 0;
    \n-
    65
    \n-
    \n-
    67 virtual VTK::Precision precision() const
    \n-
    68 { return VTK::Precision::float32; }
    \n-
    \n-
    69
    \n-
    71 virtual ~VTKFunction () {}
    \n-
    72 };
    \n-
    \n-
    73
    \n-
    75 //
    \n-
    76 // P0VTKFunction
    \n-
    77 //
    \n-
    78
    \n-
    80
    \n-
    94 template<typename GV, typename V>
    \n-
    \n-\n-
    96 : public VTKFunction< GV >
    \n-
    97 {
    \n-
    99 typedef VTKFunction< GV > Base;
    \n-\n-
    102
    \n-
    104 const V& v;
    \n-
    106 std::string s;
    \n-
    108 int ncomps_;
    \n-
    111 int mycomp_;
    \n-
    113 VTK::Precision prec_;
    \n-
    115 Mapper mapper;
    \n-
    116
    \n-
    117 public:
    \n-
    118 typedef typename Base::Entity Entity;
    \n-
    119 typedef typename Base::ctype ctype;
    \n-
    120 using Base::dim;
    \n-
    121
    \n-
    \n-
    123 int ncomps () const override
    \n-
    124 {
    \n-
    125 return 1;
    \n-
    126 }
    \n-
    \n-
    127
    \n-
    \n-
    129 double evaluate (int, const Entity& e,
    \n-
    130 const Dune::FieldVector<ctype,dim>&) const override
    \n-
    131 {
    \n-
    132 return v[mapper.index(e)*ncomps_+mycomp_];
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    \n-
    136 std::string name () const override
    \n-
    137 {
    \n-
    138 return s;
    \n-
    139 }
    \n-
    \n-
    140
    \n-
    \n-
    142 VTK::Precision precision() const override
    \n-
    143 {
    \n-
    144 return prec_;
    \n-
    145 }
    \n-
    \n-
    146
    \n-
    148
    \n-
    \n-
    165 P0VTKFunction(const GV &gv, const V &v_, const std::string &s_,
    \n-
    166 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)
    \n-
    167 : v( v_ ),
    \n-
    168 s( s_ ),
    \n-
    169 ncomps_(ncomps),
    \n-
    170 mycomp_(mycomp),
    \n-
    171 prec_(prec),
    \n-
    172 mapper( gv, mcmgElementLayout() )
    \n-
    173 {
    \n-
    174 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))
    \n-
    175 DUNE_THROW(IOError, "P0VTKFunction: size mismatch");
    \n-
    176 }
    \n+
    36
    \n+
    37namespace Dune
    \n+
    38{
    \n+
    39
    \n+
    40 // DGFGridInfo
    \n+
    41 // -----------
    \n+
    42
    \n+
    43 template< >
    \n+
    \n+\n+
    45 {
    \n+
    \n+
    46 static int refineStepsForHalf ()
    \n+
    47 {
    \n+
    48 return 1;
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    \n+
    51 static double refineWeight ()
    \n+
    52 {
    \n+
    53 return 0.5;
    \n+
    54 }
    \n+
    \n+
    55 };
    \n+
    \n+
    56
    \n+
    57
    \n+
    58
    \n+
    59 // DGFGridFactory< OneDGrid >
    \n+
    60 // --------------------------
    \n+
    61
    \n+
    62 template< >
    \n+
    \n+\n+
    64 {
    \n+
    66 typedef OneDGrid Grid;
    \n+
    68 const static int dimension = Grid::dimension;
    \n+
    70 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n+
    71
    \n+
    \n+
    73 explicit DGFGridFactory ( std::istream &input,
    \n+
    74 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    75 : grid_( 0 ),
    \n+
    76 emptyParameters_( 0 )
    \n+
    77 {
    \n+
    78 generate( input, comm );
    \n+
    79 }
    \n
    \n+
    80
    \n+
    \n+
    82 explicit DGFGridFactory ( const std::string &filename,
    \n+
    83 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    84 : grid_( 0 ),
    \n+
    85 emptyParameters_( 0 )
    \n+
    86 {
    \n+
    87 std::ifstream input( filename.c_str() );
    \n+
    88 generate( input, comm );
    \n+
    89 }
    \n+
    \n+
    90
    \n+
    \n+
    92 Grid *grid () const
    \n+
    93 {
    \n+
    94 return grid_;
    \n+
    95 }
    \n+
    \n+
    96
    \n+
    98 template< class GG, class II >
    \n+
    \n+
    99 bool wasInserted ( const Dune::Intersection< GG, II > &intersection ) const
    \n+
    100 {
    \n+
    101 return false;
    \n+
    102 }
    \n+
    \n+
    103
    \n+
    104 template< class GG, class II >
    \n+
    \n+
    105 int boundaryId ( const Dune::Intersection< GG, II > &intersection ) const
    \n+
    106 {
    \n+
    107 // OneDGrid returns boundary segment index;
    \n+
    108 // we return the index as the method boundaryId is deprecated
    \n+
    109 return intersection.boundarySegmentIndex();
    \n+
    110 }
    \n+
    \n+
    111
    \n+
    113 template< class Entity >
    \n+
    \n+
    114 int numParameters ( const Entity & ) const
    \n+
    115 {
    \n+
    116 return 0;
    \n+
    117 }
    \n+
    \n+
    118
    \n+
    120 template< int codim >
    \n+
    \n+
    121 int numParameters () const
    \n+
    122 {
    \n+
    123 return 0;
    \n+
    124 }
    \n+
    \n+
    125
    \n+
    126 template< class Entity >
    \n+
    \n+
    127 std::vector< double >& parameter ( const Entity &entity )
    \n+
    128 {
    \n+
    129 return parameter< Entity::codimension >( entity );
    \n+
    130 }
    \n+
    \n+
    131
    \n+
    133 template< int codim >
    \n+
    \n+
    134 std::vector< double > &parameter ( [[maybe_unused]] const typename Grid::Codim< codim >::Entity &element )
    \n+
    135 {
    \n+
    136 return emptyParameters_;
    \n+
    137 }
    \n+
    \n+
    138
    \n+
    \n+\n+
    141 {
    \n+
    142 return false;
    \n+
    143 }
    \n+
    \n+
    144
    \n+
    146 template< class GG, class II >
    \n+
    \n+
    147 const DGFBoundaryParameter::type &boundaryParameter ( [[maybe_unused]] const Dune::Intersection< GG, II > &intersection ) const
    \n+
    148 {
    \n+\n+
    150 }
    \n+
    \n+
    151
    \n+
    152 private:
    \n+
    153 // generate grid
    \n+
    154 void generate ( std::istream &input, MPICommunicatorType comm );
    \n+
    155
    \n+
    156 Grid *grid_;
    \n+
    157 std::vector< double > emptyParameters_;
    \n+
    158 };
    \n+
    \n+
    159
    \n+
    160
    \n+
    161
    \n+
    162 // Implementation of DGFGridFactory< OneDGrid >
    \n+
    163 // --------------------------------------------
    \n+
    164
    \n+
    165 inline void DGFGridFactory< OneDGrid >::generate ( std::istream &input, [[maybe_unused]] MPICommunicatorType comm )
    \n+
    166 {
    \n+
    167 // try to open interval block
    \n+
    168 dgf::IntervalBlock intervalBlock( input );
    \n+
    169
    \n+
    170 // try to open vertex block
    \n+
    171 int dimensionworld = Grid::dimensionworld;
    \n+
    172 dgf::VertexBlock vertexBlock( input, dimensionworld );
    \n+
    173
    \n+
    174 // check at least one block is active
    \n+
    175 if( !( vertexBlock.isactive() || intervalBlock.isactive() ))
    \n+
    176 DUNE_THROW( DGFException, "No readable block found" );
    \n
    177
    \n-
    179 virtual ~P0VTKFunction() {}
    \n-
    180 };
    \n-
    \n-
    181
    \n-
    183 //
    \n-
    184 // P1VTKFunction
    \n-
    185 //
    \n+
    178 std::vector< std::vector< double > > vertices;
    \n+
    179
    \n+
    180 // read vertices first
    \n+
    181 if( vertexBlock.isactive() )
    \n+
    182 {
    \n+
    183 int nparameter = 0;
    \n+
    184 std::vector< std::vector< double > > parameter;
    \n+
    185 vertexBlock.get( vertices, parameter, nparameter );
    \n
    186
    \n-
    188
    \n-
    202 template<typename GV, typename V>
    \n-
    \n-\n-
    204 : public VTKFunction< GV >
    \n-
    205 {
    \n-
    207 typedef VTKFunction< GV > Base;
    \n-\n-
    210
    \n-
    212 const V& v;
    \n-
    214 std::string s;
    \n-
    216 int ncomps_;
    \n-
    219 int mycomp_;
    \n-
    221 VTK::Precision prec_;
    \n-
    223 Mapper mapper;
    \n-
    224
    \n-
    225 public:
    \n-
    226 typedef typename Base::Entity Entity;
    \n-
    227 typedef typename Base::ctype ctype;
    \n-
    228 using Base::dim;
    \n-
    229
    \n-
    \n-
    231 int ncomps () const override
    \n-
    232 {
    \n-
    233 return 1;
    \n-
    234 }
    \n-
    \n-
    235
    \n-
    \n-
    237 double evaluate ([[maybe_unused]] int comp, const Entity& e,
    \n-
    238 const Dune::FieldVector<ctype,dim>& xi) const override
    \n-
    239 {
    \n-
    240 const unsigned int myDim = Entity::mydimension;
    \n-
    241 const unsigned int nVertices = e.subEntities(dim);
    \n-
    242
    \n-
    243 std::vector<FieldVector<ctype,1> > cornerValues(nVertices);
    \n-
    244 for (unsigned i=0; i<nVertices; ++i)
    \n-
    245 cornerValues[i] = v[mapper.subIndex(e,i,myDim)*ncomps_+mycomp_];
    \n-
    246
    \n-
    247 // (Ab)use the MultiLinearGeometry class to do multi-linear interpolation between scalars
    \n-
    248 const MultiLinearGeometry<ctype,dim,1> interpolation(e.type(), cornerValues);
    \n-
    249 return interpolation.global(xi);
    \n-
    250 }
    \n-
    \n-
    251
    \n-
    \n-
    253 std::string name () const override
    \n-
    254 {
    \n-
    255 return s;
    \n-
    256 }
    \n-
    \n-
    257
    \n-
    \n-
    259 VTK::Precision precision() const override
    \n-
    260 {
    \n-
    261 return prec_;
    \n-
    262 }
    \n-
    \n-
    263
    \n-
    265
    \n-
    \n-
    282 P1VTKFunction(const GV& gv, const V &v_, const std::string &s_,
    \n-
    283 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)
    \n-
    284 : v( v_ ),
    \n-
    285 s( s_ ),
    \n-
    286 ncomps_(ncomps),
    \n-
    287 mycomp_(mycomp),
    \n-
    288 prec_(prec),
    \n-
    289 mapper( gv, mcmgVertexLayout() )
    \n-
    290 {
    \n-
    291 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))
    \n-
    292 DUNE_THROW(IOError,"P1VTKFunction: size mismatch");
    \n-
    293 }
    \n-
    \n-
    294
    \n-
    296 virtual ~P1VTKFunction() {}
    \n-
    297 };
    \n-
    \n-
    298
    \n-
    300
    \n-
    301} // namespace Dune
    \n-
    302
    \n-
    303#endif // DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
    \n-
    Mapper for multiple codim and multiple geometry types.
    \n-
    Common stuff for the VTKWriter.
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n-
    Grid::ctype ctype
    type used for coordinates in grid
    Definition common/gridview.hh:131
    \n-
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n-
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n+
    187 if( nparameter > 0 )
    \n+
    188 std::cerr << "Warning: vertex parameters will be ignored" << std::endl;
    \n+
    189 }
    \n+
    190
    \n+
    191 // get vertices from interval block
    \n+
    192 if ( intervalBlock.isactive() )
    \n+
    193 {
    \n+
    194 if( intervalBlock.dimw() != dimensionworld )
    \n+
    195 {
    \n+
    196 DUNE_THROW( DGFException, "Error: wrong coordinate dimension in interval block \\
    \n+
    197 (got " << intervalBlock.dimw() << ", expected " << dimensionworld << ")" );
    \n+
    198 }
    \n+
    199
    \n+
    200 int nintervals = intervalBlock.numIntervals();
    \n+
    201 for( int i = 0; i < nintervals; ++i )
    \n+
    202 intervalBlock.getVtx( i, vertices );
    \n+
    203 }
    \n+
    204
    \n+
    205 // copy to vector of doubles
    \n+
    206 std::vector< double > vtx( vertices.size() );
    \n+
    207 transform( vertices.begin(), vertices.end(), vtx.begin(), getfirst );
    \n+
    208
    \n+
    209 // remove duplicates
    \n+
    210 std::sort( vtx.begin(), vtx.end() );
    \n+
    211 std::vector< double >::iterator it = std::unique( vtx.begin(), vtx.end() );
    \n+
    212 vtx.erase( it, vtx.end() );
    \n+
    213 if( vertices.size() != vtx.size() )
    \n+
    214 std::cerr << "Warning: removed duplicate vertices" << std::endl;
    \n+
    215
    \n+
    216 // create grid
    \n+
    217 grid_ = new OneDGrid( vtx );
    \n+
    218 }
    \n+
    219
    \n+
    220} // end namespace Dune
    \n+
    221
    \n+
    222#endif // #ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH
    \n+
    The OneDGrid class.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-
    static constexpr int mydimension
    Dimensionality of the reference element of the entity.
    Definition common/entity.hh:112
    \n-
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n-
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n-
    size_type size() const
    Return total number of entities in the entity set managed by the mapper.
    Definition mcmgmapper.hh:204
    \n-
    Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity of codim 0 entity to starting index in array for dof block.
    Definition mcmgmapper.hh:185
    \n-
    Index index(const EntityType &e) const
    Map entity to starting index in array for dof block.
    Definition mcmgmapper.hh:171
    \n-
    A base class for grid functions with any return type and dimension.
    Definition function.hh:42
    \n-
    virtual double evaluate(int comp, const Entity &e, const Dune::FieldVector< ctype, dim > &xi) const =0
    evaluate single component comp in the entity e at local coordinates xi
    \n-
    GridView::ctype ctype
    Definition function.hh:44
    \n-
    GridView::template Codim< 0 >::Entity Entity
    Definition function.hh:46
    \n-
    static constexpr int dim
    Definition function.hh:45
    \n-
    virtual std::string name() const =0
    get name
    \n-
    virtual VTK::Precision precision() const
    get output precision for the field
    Definition function.hh:67
    \n-
    virtual int ncomps() const =0
    \n-
    virtual ~VTKFunction()
    virtual destructor
    Definition function.hh:71
    \n-
    Take a vector and interpret it as cell data for the VTKWriter.
    Definition function.hh:97
    \n-
    std::string name() const override
    get name
    Definition function.hh:136
    \n-
    Base::ctype ctype
    Definition function.hh:119
    \n-
    double evaluate(int, const Entity &e, const Dune::FieldVector< ctype, dim > &) const override
    evaluate
    Definition function.hh:129
    \n-
    P0VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1, int mycomp=0, VTK::Precision prec=VTK::Precision::float32)
    construct from a vector and a name
    Definition function.hh:165
    \n-
    VTK::Precision precision() const override
    get output precision for the field
    Definition function.hh:142
    \n-
    Base::Entity Entity
    Definition function.hh:118
    \n-
    virtual ~P0VTKFunction()
    destructor
    Definition function.hh:179
    \n-
    int ncomps() const override
    return number of components
    Definition function.hh:123
    \n-
    Take a vector and interpret it as point data for the VTKWriter.
    Definition function.hh:205
    \n-
    std::string name() const override
    get name
    Definition function.hh:253
    \n-
    virtual ~P1VTKFunction()
    destructor
    Definition function.hh:296
    \n-
    Base::Entity Entity
    Definition function.hh:226
    \n-
    Base::ctype ctype
    Definition function.hh:227
    \n-
    VTK::Precision precision() const override
    get output precision for the field
    Definition function.hh:259
    \n-
    double evaluate(int comp, const Entity &e, const Dune::FieldVector< ctype, dim > &xi) const override
    evaluate
    Definition function.hh:237
    \n-
    P1VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1, int mycomp=0, VTK::Precision prec=VTK::Precision::float32)
    construct from a vector and a name
    Definition function.hh:282
    \n-
    int ncomps() const override
    return number of components
    Definition function.hh:231
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n+
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n+
    std::vector< double > & parameter(const Element &element)
    Definition dgfgridfactory.hh:124
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    size_t boundarySegmentIndex() const
    index of the boundary segment within the macro grid
    Definition common/intersection.hh:236
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n+
    GridFamily::Traits::template Codim< cd >::Entity Entity
    A type that is a model of a Dune::Entity<cd,dim,...>.
    Definition common/grid.hh:419
    \n+
    static double refineWeight()
    Definition dgfoned.hh:51
    \n+
    static int refineStepsForHalf()
    Definition dgfoned.hh:46
    \n+
    OneDGrid Grid
    grid type
    Definition dgfoned.hh:66
    \n+
    std::vector< double > & parameter(const typename Grid::Codim< codim >::Entity &element)
    return empty vector
    Definition dgfoned.hh:134
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    MPI communicator type.
    Definition dgfoned.hh:70
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
    return invalid default value
    Definition dgfoned.hh:147
    \n+
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfoned.hh:127
    \n+
    int boundaryId(const Dune::Intersection< GG, II > &intersection) const
    Definition dgfoned.hh:105
    \n+
    Grid * grid() const
    get grid
    Definition dgfoned.hh:92
    \n+
    bool haveBoundaryParameters() const
    OneDGrid does not support boundary parameters.
    Definition dgfoned.hh:140
    \n+
    int numParameters(const Entity &) const
    OneDGrid does not support parameters, returns 0.
    Definition dgfoned.hh:114
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking filename
    Definition dgfoned.hh:82
    \n+
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking istream
    Definition dgfoned.hh:73
    \n+
    int numParameters() const
    OneDGrid does not support parameters, returns 0.
    Definition dgfoned.hh:121
    \n+
    bool wasInserted(const Dune::Intersection< GG, II > &intersection) const
    always returns false
    Definition dgfoned.hh:99
    \n+
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n+
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    One-dimensional adaptive grid.
    Definition onedgrid.hh:97
    \n+\n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,353 +2,345 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-function.hh\n+ * dgfparser\n+dgfoned.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTION_HH\n-7#define DUNE_GRID_IO_FILE_VTK_FUNCTION_HH\n-8\n-9#include \n-10\n-11#include \n-12#include \n-13\n-14#include \n-15#include \n-16#include \n+5#ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH\n+6#define DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH\n+7\n+8//- C++ includes\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14\n+15//- dune-common includes\n+16#include \n 17\n-18#include \n-19#include \n-20\n-26namespace Dune\n+18//- dune-grid includes\n+19#include \n+20#include \n+21\n+22//- local includes\n+23#include \"dgfparser.hh\"\n+24\n+25\n+26namespace\n 27{\n-30\n-32 //\n-33 // Base VTKFunction\n-34 //\n+28 // helper method used below\n+29 double getfirst ( std::vector< double > v )\n+30 {\n+31 return v[ 0 ];\n+32 }\n+33} // end anonymous namespace\n+34\n 35\n-40 template< class GridView >\n-41 class VTKFunction\n-42 {\n-43 public:\n-44 typedef typename GridView::ctype ctype;\n-45 constexpr static int dim = GridView::dimension;\n-46 typedef typename GridView::template Codim< 0 >::Entity Entity;\n-47\n-50 virtual int ncomps () const = 0;\n-51\n-53\n-60 virtual double evaluate (int comp, const Entity& e,\n-61 const Dune::FieldVector& xi) const = 0;\n-62\n-64 virtual std::string name () const = 0;\n-65\n-67 virtual VTK::Precision precision() const\n-68 { return VTK::Precision::float32; }\n-69\n-71 virtual ~VTKFunction () {}\n-72 };\n-73\n-75 //\n-76 // P0VTKFunction\n-77 //\n-78\n+36\n+37namespace Dune\n+38{\n+39\n+40 // DGFGridInfo\n+41 // -----------\n+42\n+43 template< >\n+44 struct DGFGridInfo< OneDGrid >\n+45 {\n+46 static int refineStepsForHalf ()\n+47 {\n+48 return 1;\n+49 }\n+50\n+51 static double refineWeight ()\n+52 {\n+53 return 0.5;\n+54 }\n+55 };\n+56\n+57\n+58\n+59 // DGFGridFactory< OneDGrid >\n+60 // --------------------------\n+61\n+62 template< >\n+63 struct DGFGridFactory< OneDGrid >\n+64 {\n+66 typedef OneDGrid Grid;\n+68 const static int dimension = Grid::dimension;\n+70 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n+71\n+73 explicit DGFGridFactory ( std::istream &input,\n+74 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+75 : grid_( 0 ),\n+76 emptyParameters_( 0 )\n+77 {\n+78 generate( input, comm );\n+79 }\n 80\n-94 template\n-95 class P0VTKFunction\n-96 : public VTKFunction< GV >\n-97 {\n-99 typedef VTKFunction<_GV_> Base;\n-101 typedef MultipleCodimMultipleGeomTypeMapper Mapper;\n-102\n-104 const V& v;\n-106 std::string s;\n-108 int ncomps_;\n-111 int mycomp_;\n-113 VTK::Precision prec_;\n-115 Mapper mapper;\n-116\n-117 public:\n-118 typedef typename Base::Entity Entity;\n-119 typedef typename Base::ctype ctype;\n-120 using Base::dim;\n-121\n-123 int ncomps () const override\n-124 {\n-125 return 1;\n-126 }\n-127\n-129 double evaluate (int, const Entity& e,\n-130 const Dune::FieldVector&) const override\n-131 {\n-132 return v[mapper.index(e)*ncomps_+mycomp_];\n-133 }\n-134\n-136 std::string name () const override\n-137 {\n-138 return s;\n-139 }\n-140\n-142 VTK::Precision precision() const override\n-143 {\n-144 return prec_;\n-145 }\n-146\n-148\n-165 P0VTKFunction(const GV &gv, const V &v_, const std::string &s_,\n-166 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)\n-167 : v( v_ ),\n-168 s( s_ ),\n-169 ncomps_(ncomps),\n-170 mycomp_(mycomp),\n-171 prec_(prec),\n-172 mapper( gv, mcmgElementLayout() )\n-173 {\n-174 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))\n-175 DUNE_THROW(IOError, \"P0VTKFunction: size mismatch\");\n-176 }\n+82 explicit DGFGridFactory ( const std::string &filename,\n+83 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+84 : grid_( 0 ),\n+85 emptyParameters_( 0 )\n+86 {\n+87 std::ifstream input( filename.c_str() );\n+88 generate( input, comm );\n+89 }\n+90\n+92 Grid *grid () const\n+93 {\n+94 return grid_;\n+95 }\n+96\n+98 template< class GG, class II >\n+99 bool wasInserted ( const Dune::Intersection<_GG,_II_> &intersection ) const\n+100 {\n+101 return false;\n+102 }\n+103\n+104 template< class GG, class II >\n+105 int boundaryId ( const Dune::Intersection<_GG,_II_> &intersection ) const\n+106 {\n+107 // OneDGrid returns boundary segment index;\n+108 // we return the index as the method boundaryId is deprecated\n+109 return intersection.boundarySegmentIndex();\n+110 }\n+111\n+113 template< class Entity >\n+114 int numParameters ( const Entity & ) const\n+115 {\n+116 return 0;\n+117 }\n+118\n+120 template< int codim >\n+121 int numParameters () const\n+122 {\n+123 return 0;\n+124 }\n+125\n+126 template< class Entity >\n+127 std::vector< double >& parameter ( const Entity &entity )\n+128 {\n+129 return parameter< Entity::codimension >( entity );\n+130 }\n+131\n+133 template< int codim >\n+134 std::vector< double > ¶meter ( [[maybe_unused]] const typename Grid::\n+Codim<_codim_>::Entity &element )\n+135 {\n+136 return emptyParameters_;\n+137 }\n+138\n+140 bool haveBoundaryParameters () const\n+141 {\n+142 return false;\n+143 }\n+144\n+146 template< class GG, class II >\n+147 const DGFBoundaryParameter::type &boundaryParameter ( [[maybe_unused]]\n+const Dune::Intersection<_GG,_II_> &intersection ) const\n+148 {\n+149 return DGFBoundaryParameter::defaultValue();\n+150 }\n+151\n+152 private:\n+153 // generate grid\n+154 void generate ( std::istream &input, MPICommunicatorType comm );\n+155\n+156 Grid *grid_;\n+157 std::vector< double > emptyParameters_;\n+158 };\n+159\n+160\n+161\n+162 // Implementation of DGFGridFactory< OneDGrid >\n+163 // --------------------------------------------\n+164\n+165 inline void DGFGridFactory< OneDGrid >::generate ( std::istream &input, [\n+[maybe_unused]] MPICommunicatorType comm )\n+166 {\n+167 // try to open interval block\n+168 dgf::IntervalBlock intervalBlock( input );\n+169\n+170 // try to open vertex block\n+171 int dimensionworld = Grid::dimensionworld;\n+172 dgf::VertexBlock vertexBlock( input, dimensionworld );\n+173\n+174 // check at least one block is active\n+175 if( !( vertexBlock.isactive() || intervalBlock.isactive() ))\n+176 DUNE_THROW( DGFException, \"No readable block found\" );\n 177\n-179 virtual ~P0VTKFunction() {}\n-180 };\n-181\n-183 //\n-184 // P1VTKFunction\n-185 //\n+178 std::vector< std::vector< double > > vertices;\n+179\n+180 // read vertices first\n+181 if( vertexBlock.isactive() )\n+182 {\n+183 int nparameter = 0;\n+184 std::vector< std::vector< double > > parameter;\n+185 vertexBlock.get( vertices, parameter, nparameter );\n 186\n-188\n-202 template\n-203 class P1VTKFunction\n-204 : public VTKFunction< GV >\n-205 {\n-207 typedef VTKFunction<_GV_> Base;\n-209 typedef MultipleCodimMultipleGeomTypeMapper Mapper;\n-210\n-212 const V& v;\n-214 std::string s;\n-216 int ncomps_;\n-219 int mycomp_;\n-221 VTK::Precision prec_;\n-223 Mapper mapper;\n-224\n-225 public:\n-226 typedef typename Base::Entity Entity;\n-227 typedef typename Base::ctype ctype;\n-228 using Base::dim;\n-229\n-231 int ncomps () const override\n-232 {\n-233 return 1;\n-234 }\n-235\n-237 double evaluate ([[maybe_unused]] int comp, const Entity& e,\n-238 const Dune::FieldVector& xi) const override\n-239 {\n-240 const unsigned int myDim = Entity::mydimension;\n-241 const unsigned int nVertices = e.subEntities(dim);\n-242\n-243 std::vector > cornerValues(nVertices);\n-244 for (unsigned i=0; i interpolation(e.type(),\n-cornerValues);\n-249 return interpolation.global(xi);\n-250 }\n-251\n-253 std::string name () const override\n-254 {\n-255 return s;\n-256 }\n-257\n-259 VTK::Precision precision() const override\n-260 {\n-261 return prec_;\n-262 }\n-263\n-265\n-282 P1VTKFunction(const GV& gv, const V &v_, const std::string &s_,\n-283 int ncomps=1, int mycomp=0, VTK::Precision prec = VTK::Precision::float32)\n-284 : v( v_ ),\n-285 s( s_ ),\n-286 ncomps_(ncomps),\n-287 mycomp_(mycomp),\n-288 prec_(prec),\n-289 mapper( gv, mcmgVertexLayout() )\n-290 {\n-291 if (v.size()!=(unsigned int)(mapper.size()*ncomps_))\n-292 DUNE_THROW(IOError,\"P1VTKFunction: size mismatch\");\n-293 }\n-294\n-296 virtual ~P1VTKFunction() {}\n-297 };\n-298\n-300\n-301} // namespace Dune\n-302\n-303#endif // DUNE_GRID_IO_FILE_VTK_FUNCTION_HH\n-mcmgmapper.hh\n-Mapper for multiple codim and multiple geometry types.\n-common.hh\n-Common stuff for the VTKWriter.\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n-Dune::GridView::ctype\n-Grid::ctype ctype\n-type used for coordinates in grid\n-Definition common/gridview.hh:131\n-Dune::mcmgElementLayout\n-MCMGLayout mcmgElementLayout()\n-layout for elements (codim-0 entities)\n-Definition mcmgmapper.hh:97\n-Dune::mcmgVertexLayout\n-MCMGLayout mcmgVertexLayout()\n-layout for vertices (dim-0 entities)\n-Definition mcmgmapper.hh:107\n+187 if( nparameter > 0 )\n+188 std::cerr << \"Warning: vertex parameters will be ignored\" << std::endl;\n+189 }\n+190\n+191 // get vertices from interval block\n+192 if ( intervalBlock.isactive() )\n+193 {\n+194 if( intervalBlock.dimw() != dimensionworld )\n+195 {\n+196 DUNE_THROW( DGFException, \"Error: wrong coordinate dimension in interval\n+block \\\n+197 (got \" << intervalBlock.dimw() << \", expected \" << dimensionworld << \")\" );\n+198 }\n+199\n+200 int nintervals = intervalBlock.numIntervals();\n+201 for( int i = 0; i < nintervals; ++i )\n+202 intervalBlock.getVtx( i, vertices );\n+203 }\n+204\n+205 // copy to vector of doubles\n+206 std::vector< double > vtx( vertices.size() );\n+207 transform( vertices.begin(), vertices.end(), vtx.begin(), getfirst );\n+208\n+209 // remove duplicates\n+210 std::sort( vtx.begin(), vtx.end() );\n+211 std::vector< double >::iterator it = std::unique( vtx.begin(), vtx.end() );\n+212 vtx.erase( it, vtx.end() );\n+213 if( vertices.size() != vtx.size() )\n+214 std::cerr << \"Warning: removed duplicate vertices\" << std::endl;\n+215\n+216 // create grid\n+217 grid_ = new OneDGrid( vtx );\n+218 }\n+219\n+220} // end namespace Dune\n+221\n+222#endif // #ifndef DUNE_GRID_FILE_IO_DGFPARSER_DGFONED_HH\n+onedgrid.hh\n+The OneDGrid class.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::Entity::mydimension\n-static constexpr int mydimension\n-Dimensionality of the reference element of the entity.\n-Definition common/entity.hh:112\n-Dune::GridView::Codim\n-A struct that collects all associated types of one implementation from the\n-Traits class.\n-Definition common/gridview.hh:104\n-Dune::MultipleCodimMultipleGeomTypeMapper\n-Implementation class for a multiple codim and multiple geometry type mapper.\n-Definition mcmgmapper.hh:129\n-Dune::MultipleCodimMultipleGeomTypeMapper::size\n-size_type size() const\n-Return total number of entities in the entity set managed by the mapper.\n-Definition mcmgmapper.hh:204\n-Dune::MultipleCodimMultipleGeomTypeMapper::subIndex\n-Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i,\n-unsigned int codim) const\n-Map subentity of codim 0 entity to starting index in array for dof block.\n-Definition mcmgmapper.hh:185\n-Dune::MultipleCodimMultipleGeomTypeMapper::index\n-Index index(const EntityType &e) const\n-Map entity to starting index in array for dof block.\n-Definition mcmgmapper.hh:171\n-Dune::VTKFunction\n-A base class for grid functions with any return type and dimension.\n-Definition function.hh:42\n-Dune::VTKFunction::evaluate\n-virtual double evaluate(int comp, const Entity &e, const Dune::FieldVector<\n-ctype, dim > &xi) const =0\n-evaluate single component comp in the entity e at local coordinates xi\n-Dune::VTKFunction::ctype\n-GridView::ctype ctype\n-Definition function.hh:44\n-Dune::VTKFunction::Entity\n-GridView::template Codim< 0 >::Entity Entity\n-Definition function.hh:46\n-Dune::VTKFunction::dim\n-static constexpr int dim\n-Definition function.hh:45\n-Dune::VTKFunction::name\n-virtual std::string name() const =0\n-get name\n-Dune::VTKFunction::precision\n-virtual VTK::Precision precision() const\n-get output precision for the field\n-Definition function.hh:67\n-Dune::VTKFunction::ncomps\n-virtual int ncomps() const =0\n-Dune::VTKFunction::~VTKFunction\n-virtual ~VTKFunction()\n-virtual destructor\n-Definition function.hh:71\n-Dune::P0VTKFunction\n-Take a vector and interpret it as cell data for the VTKWriter.\n-Definition function.hh:97\n-Dune::P0VTKFunction::name\n-std::string name() const override\n-get name\n-Definition function.hh:136\n-Dune::P0VTKFunction::ctype\n-Base::ctype ctype\n-Definition function.hh:119\n-Dune::P0VTKFunction::evaluate\n-double evaluate(int, const Entity &e, const Dune::FieldVector< ctype, dim > &)\n-const override\n-evaluate\n-Definition function.hh:129\n-Dune::P0VTKFunction::P0VTKFunction\n-P0VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1,\n-int mycomp=0, VTK::Precision prec=VTK::Precision::float32)\n-construct from a vector and a name\n-Definition function.hh:165\n-Dune::P0VTKFunction::precision\n-VTK::Precision precision() const override\n-get output precision for the field\n-Definition function.hh:142\n-Dune::P0VTKFunction::Entity\n-Base::Entity Entity\n-Definition function.hh:118\n-Dune::P0VTKFunction::~P0VTKFunction\n-virtual ~P0VTKFunction()\n-destructor\n-Definition function.hh:179\n-Dune::P0VTKFunction::ncomps\n-int ncomps() const override\n-return number of components\n-Definition function.hh:123\n-Dune::P1VTKFunction\n-Take a vector and interpret it as point data for the VTKWriter.\n-Definition function.hh:205\n-Dune::P1VTKFunction::name\n-std::string name() const override\n-get name\n-Definition function.hh:253\n-Dune::P1VTKFunction::~P1VTKFunction\n-virtual ~P1VTKFunction()\n-destructor\n-Definition function.hh:296\n-Dune::P1VTKFunction::Entity\n-Base::Entity Entity\n-Definition function.hh:226\n-Dune::P1VTKFunction::ctype\n-Base::ctype ctype\n-Definition function.hh:227\n-Dune::P1VTKFunction::precision\n-VTK::Precision precision() const override\n-get output precision for the field\n-Definition function.hh:259\n-Dune::P1VTKFunction::evaluate\n-double evaluate(int comp, const Entity &e, const Dune::FieldVector< ctype, dim\n-> &xi) const override\n-evaluate\n-Definition function.hh:237\n-Dune::P1VTKFunction::P1VTKFunction\n-P1VTKFunction(const GV &gv, const V &v_, const std::string &s_, int ncomps=1,\n-int mycomp=0, VTK::Precision prec=VTK::Precision::float32)\n-construct from a vector and a name\n-Definition function.hh:282\n-Dune::P1VTKFunction::ncomps\n-int ncomps() const override\n-return number of components\n-Definition function.hh:231\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition dgfgridfactory.hh:41\n+Dune::DGFGridFactory::dimension\n+static const int dimension\n+Definition dgfgridfactory.hh:40\n+Dune::DGFGridFactory::parameter\n+std::vector< double > & parameter(const Element &element)\n+Definition dgfgridfactory.hh:124\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::boundarySegmentIndex\n+size_t boundarySegmentIndex() const\n+index of the boundary segment within the macro grid\n+Definition common/intersection.hh:236\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/grid.hh:390\n+Dune::Grid::Codim::Entity\n+GridFamily::Traits::template Codim< cd >::Entity Entity\n+A type that is a model of a Dune::Entity.\n+Definition common/grid.hh:419\n+Dune::DGFGridInfo<_OneDGrid_>::refineWeight\n+static double refineWeight()\n+Definition dgfoned.hh:51\n+Dune::DGFGridInfo<_OneDGrid_>::refineStepsForHalf\n+static int refineStepsForHalf()\n+Definition dgfoned.hh:46\n+Dune::DGFGridFactory<_OneDGrid_>::Grid\n+OneDGrid Grid\n+grid type\n+Definition dgfoned.hh:66\n+Dune::DGFGridFactory<_OneDGrid_>::parameter\n+std::vector< double > & parameter(const typename Grid::Codim< codim >::Entity\n+&element)\n+return empty vector\n+Definition dgfoned.hh:134\n+Dune::DGFGridFactory<_OneDGrid_>::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+MPI communicator type.\n+Definition dgfoned.hh:70\n+Dune::DGFGridFactory<_OneDGrid_>::boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection<\n+GG, II > &intersection) const\n+return invalid default value\n+Definition dgfoned.hh:147\n+Dune::DGFGridFactory<_OneDGrid_>::parameter\n+std::vector< double > & parameter(const Entity &entity)\n+Definition dgfoned.hh:127\n+Dune::DGFGridFactory<_OneDGrid_>::boundaryId\n+int boundaryId(const Dune::Intersection< GG, II > &intersection) const\n+Definition dgfoned.hh:105\n+Dune::DGFGridFactory<_OneDGrid_>::grid\n+Grid * grid() const\n+get grid\n+Definition dgfoned.hh:92\n+Dune::DGFGridFactory<_OneDGrid_>::haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+OneDGrid does not support boundary parameters.\n+Definition dgfoned.hh:140\n+Dune::DGFGridFactory<_OneDGrid_>::numParameters\n+int numParameters(const Entity &) const\n+OneDGrid does not support parameters, returns 0.\n+Definition dgfoned.hh:114\n+Dune::DGFGridFactory<_OneDGrid_>::DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicatorType\n+comm=MPIHelper::getCommunicator())\n+constructor taking filename\n+Definition dgfoned.hh:82\n+Dune::DGFGridFactory<_OneDGrid_>::DGFGridFactory\n+DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n+getCommunicator())\n+constructor taking istream\n+Definition dgfoned.hh:73\n+Dune::DGFGridFactory<_OneDGrid_>::numParameters\n+int numParameters() const\n+OneDGrid does not support parameters, returns 0.\n+Definition dgfoned.hh:121\n+Dune::DGFGridFactory<_OneDGrid_>::wasInserted\n+bool wasInserted(const Dune::Intersection< GG, II > &intersection) const\n+always returns false\n+Definition dgfoned.hh:99\n+Dune::DGFGridInfo\n+Some simple static information for a given GridType.\n+Definition io/file/dgfparser/dgfparser.hh:56\n+Dune::DGFBoundaryParameter::defaultValue\n+static const type & defaultValue()\n+default constructor\n+Definition parser.hh:28\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+Dune::OneDGrid\n+One-dimensional adaptive grid.\n+Definition onedgrid.hh:97\n+dgfparser.hh\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00938.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00938.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: corner.hh File Reference\n+dune-grid: gridptr.hh File Reference\n \n \n \n \n \n \n \n@@ -65,41 +65,62 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    corner.hh File Reference
    \n+
    gridptr.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/io/file/vtk/common.hh>
    \n+
    #include <cassert>
    \n+#include <cctype>
    \n+#include <array>
    \n+#include <iostream>
    \n+#include <map>
    \n+#include <memory>
    \n+#include <string>
    \n+#include <type_traits>
    \n+#include <vector>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/common/shared_ptr.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/datahandleif.hh>
    \n+#include <dune/grid/common/intersection.hh>
    \n+#include <dune/grid/common/partitionset.hh>
    \n+#include <dune/grid/common/rangegenerators.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n+#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n+#include <dune/grid/io/file/dgfparser/parser.hh>
    \n+#include <dune/grid/io/file/gmshreader.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::VTK::Corner< Cell >
     simple class representing a corner of a cell More...
    struct  Dune::GridPtr< GridType >
     Class for constructing grids from DGF files. More...
     
    class  Dune::GridPtr< GridType >::mygrid_ptr
     
    struct  Dune::GridPtr< GridType >::DataHandle
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,24 +2,45 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-corner.hh File Reference\n-#include \n+gridptr.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::Corner<_Cell_>\n-\u00a0 simple class representing a corner of a cell More...\n+struct \u00a0 Dune::GridPtr<_GridType_>\n+\u00a0 Class for constructing grids from DGF files. More...\n+\u00a0\n+ class \u00a0 Dune::GridPtr<_GridType_>::mygrid_ptr\n+\u00a0\n+struct \u00a0 Dune::GridPtr<_GridType_>::DataHandle\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00938_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00938_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: corner.hh Source File\n+dune-grid: gridptr.hh Source File\n \n \n \n \n \n \n \n@@ -70,87 +70,964 @@\n
    \n \n \n \n \n \n \n
    \n-
    corner.hh
    \n+
    gridptr.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_CORNER_HH
    \n-
    8
    \n-\n+
    5#ifndef DUNE_DGF_GRIDPTR_HH
    \n+
    6#define DUNE_DGF_GRIDPTR_HH
    \n+
    7
    \n+
    8#include <cassert>
    \n+
    9#include <cctype>
    \n
    10
    \n-
    11namespace Dune
    \n-
    12{
    \n-
    15
    \n-
    16 namespace VTK {
    \n-
    17
    \n-
    19
    \n-
    24 template<typename Cell>
    \n-
    \n-
    25 class Corner {
    \n-
    26 // store a pointer to the element
    \n-
    27 const Cell* cell_;
    \n-
    28 // store index of the corner within element (Dune numbering)
    \n-
    29 unsigned index;
    \n-
    30
    \n-
    31 public:
    \n-
    33
    \n-
    \n-
    38 Corner(const Cell& cell, unsigned duneIndex)
    \n-
    39 : cell_(&cell), index(duneIndex)
    \n-
    40 { }
    \n-
    \n-
    41
    \n-
    43 Corner() { }
    \n-
    44
    \n-
    46 const Cell& cell() const { return *cell_; }
    \n+
    11#include <array>
    \n+
    12#include <iostream>
    \n+
    13#include <map>
    \n+
    14#include <memory>
    \n+
    15#include <string>
    \n+
    16#include <type_traits>
    \n+
    17#include <vector>
    \n+
    18
    \n+
    19//- Dune includes
    \n+
    20#include <dune/common/parallel/mpihelper.hh>
    \n+
    21#include <dune/common/shared_ptr.hh>
    \n+
    22
    \n+\n+\n+\n+\n+\n+
    28
    \n+\n+\n+\n+
    32
    \n+\n+
    34
    \n+
    35namespace Dune
    \n+
    36{
    \n+
    37
    \n+
    38 // External Forward Declarations
    \n+
    39 // -----------------------------
    \n+
    40
    \n+
    41 template < class G >
    \n+
    42 struct DGFGridFactory;
    \n+
    43
    \n+
    44 template< class GridImp, class IntersectionImp >
    \n+
    45 class Intersection;
    \n+
    46
    \n+
    47
    \n
    48
    \n-
    52 void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }
    \n-
    53
    \n-
    55 unsigned duneIndex() const { return index; }
    \n-
    57 void duneIndex(unsigned i) { index = i; }
    \n-
    58
    \n-
    60
    \n-
    63 unsigned vtkIndex() const { return renumber(cell_->type(), index); }
    \n-
    65
    \n-
    68 void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }
    \n-
    69 };
    \n-
    \n-
    70
    \n-
    71 } // namespace VTK
    \n+
    49 // GridPtr
    \n+
    50 // -------
    \n+
    51
    \n+
    64 template< class GridType >
    \n+
    \n+
    65 struct GridPtr
    \n+
    66 {
    \n+
    \n+
    67 class mygrid_ptr : public std::shared_ptr< GridType >
    \n+
    68 {
    \n+
    69 typedef std::shared_ptr< GridType > base_t ;
    \n+
    70 // empty deleter to avoid deletion on release
    \n+
    71 typedef null_deleter< GridType > emptydeleter_t ;
    \n
    72
    \n-
    74
    \n-
    75} // namespace Dune
    \n-
    76
    \n-
    77#endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH
    \n-
    Common stuff for the VTKWriter.
    \n+
    73 void removeObj()
    \n+
    74 {
    \n+
    75 // if use count is only 1 delete object
    \n+
    76 if( use_count() == 1 )
    \n+
    77 {
    \n+
    78 // delete point here, since we use the empty deleter
    \n+
    79 GridType* grd = release();
    \n+
    80 if( grd ) delete grd ;
    \n+
    81 }
    \n+
    82 }
    \n+
    83
    \n+
    84 void assignObj( const mygrid_ptr& other )
    \n+
    85 {
    \n+
    86 removeObj();
    \n+
    87 base_t :: operator = ( other );
    \n+
    88 }
    \n+
    89 public:
    \n+
    90 using base_t :: get ;
    \n+
    91 using base_t :: swap ;
    \n+
    92 using base_t :: use_count ;
    \n+
    93
    \n+
    94 // default constructor
    \n+
    95 mygrid_ptr() : base_t( ( GridType * ) 0, emptydeleter_t() ) {}
    \n+
    96 // copy constructor
    \n+
    97 mygrid_ptr( const mygrid_ptr& other ) : base_t(nullptr) { assignObj( other ); }
    \n+
    98 // constructor taking pointer
    \n+
    99 explicit mygrid_ptr( GridType* grd ) : base_t( grd, emptydeleter_t() ) {}
    \n+
    100
    \n+
    101 // destructor
    \n+
    102 ~mygrid_ptr() { removeObj(); }
    \n+
    103
    \n+
    104 // assignment operator
    \n+
    \n+\n+
    106 {
    \n+
    107 assignObj( other );
    \n+
    108 return *this;
    \n+
    109 }
    \n+
    \n+
    110
    \n+
    111 // release pointer
    \n+
    \n+
    112 GridType* release()
    \n+
    113 {
    \n+
    114 GridType* grd = this->get();
    \n+
    115 base_t ptr(( GridType * ) 0, emptydeleter_t() );
    \n+
    116 this->swap( ptr );
    \n+
    117 return grd ;
    \n+
    118 }
    \n+
    \n+
    119 };
    \n+
    \n+
    120
    \n+
    121 protected:
    \n+
    \n+
    122 std::string getFileExtension( const std::string& filename ) const
    \n+
    123 {
    \n+
    124 // extract file extension
    \n+
    125 auto extpos = filename.find_last_of(".");
    \n+
    126 std::string ext;
    \n+
    127 if( extpos != std::string::npos)
    \n+
    128 ext = filename.substr( extpos + 1 );
    \n+
    129
    \n+
    130 // convert all letters to lower case
    \n+
    131 for( auto& item : ext )
    \n+
    132 item = std::tolower( item );
    \n+
    133 return ext;
    \n+
    134 }
    \n+
    \n+
    135
    \n+
    136 // read gmsh file if dimension world <= 3
    \n+
    \n+
    137 void readGmsh( const std::string& filename, std::integral_constant< bool, true > )
    \n+
    138 {
    \n+
    139 GridFactory<GridType> gridFactory;
    \n+
    140 std::vector<int> boundaryIDs;
    \n+
    141 std::vector<int> elementsIDs;
    \n+
    142 GmshReader<GridType>::read(gridFactory,filename,boundaryIDs,elementsIDs);
    \n+
    143 initialize( gridFactory, boundaryIDs,elementsIDs);
    \n+
    144 }
    \n+
    \n+
    145
    \n+
    146 // if dimension world > 3 throw GridError
    \n+
    \n+
    147 void readGmsh( const std::string& filename, std::integral_constant< bool, false > )
    \n+
    148 {
    \n+
    149 DUNE_THROW(GridError, "GmshReader requires dimWorld <= 3." );
    \n+
    150 }
    \n+
    \n+
    151
    \n+
    152 public:
    \n+
    153
    \n+
    154 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n+
    155 static const int dimension = GridType::dimension;
    \n+
    156
    \n+
    \n+
    158 explicit GridPtr ( const std::string &filename,
    \n+
    159 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    160 : gridPtr_(),
    \n+
    161 elParam_(),
    \n+
    162 vtxParam_(),
    \n+
    163 bndParam_(),
    \n+
    164 bndId_(),
    \n+
    165 emptyParam_(),
    \n+
    166 nofElParam_( 0 ),
    \n+
    167 nofVtxParam_( 0 ),
    \n+
    168 haveBndParam_( false )
    \n+
    169 {
    \n+
    170 std::string fileExt = getFileExtension( filename );
    \n+
    171
    \n+
    172 if( fileExt == "dgf" )
    \n+
    173 {
    \n+
    174 DGFGridFactory< GridType > dgfFactory( filename, comm );
    \n+
    175 initialize( dgfFactory );
    \n+
    176 }
    \n+
    177 else if( fileExt == "msh" )
    \n+
    178 {
    \n+
    179 // Gmsh reader only compiles for dimworld <= 3
    \n+
    180 readGmsh( filename, std::integral_constant< bool, GridType::dimensionworld <= 3 > () );
    \n+
    181 }
    \n+
    182 else if( fileExt == "amc" || fileExt == "2d" || fileExt == "3d" )
    \n+
    183 {
    \n+
    184 // TODO: AlbertaReader
    \n+
    185 DUNE_THROW( NotImplemented, "GridPtr: file format '" << fileExt << "' not supported yet!" );
    \n+
    186 }
    \n+
    187 else if( fileExt == "vtu" )
    \n+
    188 {
    \n+
    189 // TODO: vtu/vtk reader
    \n+
    190 DUNE_THROW( NotImplemented, "GridPtr: file format '" << fileExt << "' not supported yet!" );
    \n+
    191 }
    \n+
    192 else
    \n+
    193 {
    \n+
    194 DUNE_THROW( NotImplemented, "GridPtr: file format '" << fileExt << "' not supported yet!" );
    \n+
    195 }
    \n+
    196 }
    \n+
    \n+
    197
    \n+
    \n+
    199 explicit GridPtr ( std::istream &input,
    \n+
    200 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    201 : gridPtr_(),
    \n+
    202 elParam_(),
    \n+
    203 vtxParam_(),
    \n+
    204 bndParam_(),
    \n+
    205 bndId_(),
    \n+
    206 emptyParam_(),
    \n+
    207 nofElParam_( 0 ),
    \n+
    208 nofVtxParam_( 0 ),
    \n+
    209 haveBndParam_( false )
    \n+
    210 {
    \n+
    211 // input stream only works for DGF format right now
    \n+
    212 DGFGridFactory< GridType > dgfFactory( input, comm );
    \n+
    213 initialize( dgfFactory );
    \n+
    214 }
    \n+
    \n+
    215
    \n+
    \n+\n+
    218 : gridPtr_(),
    \n+
    219 elParam_(),
    \n+
    220 vtxParam_(),
    \n+
    221 bndParam_(),
    \n+
    222 bndId_(),
    \n+
    223 emptyParam_(),
    \n+
    224 nofElParam_(0),
    \n+
    225 nofVtxParam_(0),
    \n+
    226 haveBndParam_( false )
    \n+
    227 {}
    \n+
    \n+
    228
    \n+
    \n+
    230 explicit GridPtr( GridType *grd )
    \n+
    231 : gridPtr_(grd),
    \n+
    232 elParam_(),
    \n+
    233 vtxParam_(),
    \n+
    234 bndParam_(),
    \n+
    235 bndId_(),
    \n+
    236 emptyParam_(),
    \n+
    237 nofElParam_(0),
    \n+
    238 nofVtxParam_(0),
    \n+
    239 haveBndParam_( false )
    \n+
    240 {}
    \n+
    \n+
    241
    \n+
    243 GridPtr( const GridPtr &org ) = default;
    \n+
    244
    \n+
    \n+\n+
    247 {
    \n+
    248 gridPtr_ = org.gridPtr_;
    \n+
    249 elParam_ = org.elParam_;
    \n+
    250 vtxParam_ = org.vtxParam_;
    \n+
    251 bndParam_ = org.bndParam_;
    \n+
    252 bndId_ = org.bndId_;
    \n+\n+
    254
    \n+\n+\n+\n+
    258 return *this;
    \n+
    259 }
    \n+
    \n+
    260
    \n+
    \n+
    262 GridPtr& operator = (GridType * grd)
    \n+
    263 {
    \n+
    264 gridPtr_ = mygrid_ptr( grd );
    \n+
    265 elParam_.resize(0);
    \n+
    266 vtxParam_.resize(0);
    \n+
    267 bndParam_.resize(0);
    \n+
    268 bndId_.resize(0);
    \n+
    269 emptyParam_.resize(0);
    \n+
    270
    \n+
    271 nofVtxParam_ = 0;
    \n+
    272 nofElParam_ = 0;
    \n+
    273 haveBndParam_ = false;
    \n+
    274 return *this;
    \n+
    275 }
    \n+
    \n+
    276
    \n+
    \n+
    278 GridType& operator*() {
    \n+
    279 return *gridPtr_;
    \n+
    280 }
    \n+
    \n+
    281
    \n+
    \n+
    283 GridType* operator->() {
    \n+
    284 return gridPtr_.operator -> ();
    \n+
    285 }
    \n+
    \n+
    286
    \n+
    \n+
    288 const GridType& operator*() const {
    \n+
    289 return *gridPtr_;
    \n+
    290 }
    \n+
    \n+
    291
    \n+
    \n+
    293 const GridType* operator->() const {
    \n+
    294 return gridPtr_.operator -> ();
    \n+
    295 }
    \n+
    \n+
    296
    \n+
    298 GridType* release () { return gridPtr_.release(); }
    \n+
    299
    \n+
    \n+
    301 int nofParameters(int cdim) const {
    \n+
    302 switch (cdim) {
    \n+
    303 case 0 : return nofElParam_; break;
    \n+
    304 case GridType::dimension : return nofVtxParam_; break;
    \n+
    305 }
    \n+
    306 return 0;
    \n+
    307 }
    \n+
    \n+
    308
    \n+
    310 template <class Entity>
    \n+
    \n+
    311 int nofParameters ( const Entity & ) const
    \n+
    312 {
    \n+
    313 return nofParameters( (int) Entity::codimension );
    \n+
    314 }
    \n+
    \n+
    315
    \n+
    317 template< class GridImp, class IntersectionImp >
    \n+
    \n+\n+
    319 {
    \n+
    320 return parameters( intersection ).size();
    \n+
    321 }
    \n+
    \n+
    322
    \n+
    324 template <class Entity>
    \n+
    \n+
    325 const std::vector< double > &parameters ( const Entity &entity ) const
    \n+
    326 {
    \n+
    327 typedef typename GridType::LevelGridView GridView;
    \n+
    328 GridView gridView = gridPtr_->levelGridView( 0 );
    \n+
    329 switch( (int)Entity::codimension )
    \n+
    330 {
    \n+
    331 case 0 :
    \n+
    332 if( nofElParam_ > 0 )
    \n+
    333 {
    \n+
    334 assert( (unsigned int)gridView.indexSet().index( entity ) < elParam_.size() );
    \n+
    335 return elParam_[ gridView.indexSet().index( entity ) ];
    \n+
    336 }
    \n+
    337 break;
    \n+
    338 case GridType::dimension :
    \n+
    339 if( nofVtxParam_ > 0 )
    \n+
    340 {
    \n+
    341 assert( (unsigned int)gridView.indexSet().index( entity ) < vtxParam_.size() );
    \n+
    342 return vtxParam_[ gridView.indexSet().index( entity ) ];
    \n+
    343 }
    \n+
    344 break;
    \n+
    345 }
    \n+
    346 return emptyParam_;
    \n+
    347 }
    \n+
    \n+
    348
    \n+
    350 template< class GridImp, class IntersectionImp >
    \n+
    \n+\n+
    352 {
    \n+
    353 // if no parameters given return empty vector
    \n+
    354 if ( !haveBndParam_ )
    \n+\n+
    356
    \n+
    357 return bndParam_[ intersection.boundarySegmentIndex() ];
    \n+
    358 }
    \n+
    \n+
    359
    \n+
    \n+\n+
    361 {
    \n+
    362 if( gridPtr_->comm().size() > 1 )
    \n+
    363 {
    \n+
    364 DataHandle dh(*this);
    \n+
    365 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_All_Interface,ForwardCommunication );
    \n+
    366 }
    \n+
    367 }
    \n+
    \n+
    368
    \n+
    \n+\n+
    370 {
    \n+
    371 if( gridPtr_->comm().size() > 1 )
    \n+
    372 {
    \n+
    373 DataHandle dh(*this);
    \n+
    374 gridPtr_->loadBalance( dh.interface() );
    \n+
    375 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_All_Interface,ForwardCommunication );
    \n+
    376 }
    \n+
    377 }
    \n+
    \n+
    378
    \n+
    379 protected:
    \n+
    380 template< class Range >
    \n+
    \n+
    381 static bool isEmpty ( Range &&range )
    \n+
    382 {
    \n+
    383 return range.begin() == range.end();
    \n+
    384 }
    \n+
    \n+
    385
    \n+
    \n+\n+
    387 {
    \n+
    388 gridPtr_ = mygrid_ptr( dgfFactory.grid() );
    \n+
    389
    \n+
    390 const auto gridView = gridPtr_->levelGridView( 0 );
    \n+
    391 const auto &indexSet = gridView.indexSet();
    \n+
    392
    \n+
    393 nofElParam_ = dgfFactory.template numParameters< 0 >();
    \n+
    394 nofVtxParam_ = dgfFactory.template numParameters< dimension >();
    \n+\n+
    396
    \n+
    397 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast< int >( haveBndParam_ ) }};
    \n+
    398 gridView.comm().max( nofParams.data(), nofParams.size() );
    \n+
    399
    \n+
    400 // empty grids have no parameters associated
    \n+
    401 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )
    \n+
    402 {
    \n+
    403 nofElParam_ = nofParams[ 0 ];
    \n+
    404 nofVtxParam_ = nofParams[ 1 ];
    \n+
    405 }
    \n+
    406
    \n+
    407 // boundary parameters may be empty
    \n+
    408 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );
    \n+
    409
    \n+
    410 if( (nofElParam_ != nofParams[ 0 ]) || (nofVtxParam_ != nofParams[ 1 ]) )
    \n+
    411 DUNE_THROW( DGFException, "Number of parameters differs between processes" );
    \n+
    412
    \n+
    413 elParam_.resize( nofElParam_ > 0 ? indexSet.size( 0 ) : 0 );
    \n+
    414 vtxParam_.resize( nofVtxParam_ > 0 ? indexSet.size( dimension ) : 0 );
    \n+
    415
    \n+
    416 bndId_.resize( indexSet.size( 1 ) );
    \n+
    417 if( haveBndParam_ )
    \n+
    418 bndParam_.resize( gridPtr_->numBoundarySegments() );
    \n+
    419
    \n+
    420 for( const auto &element : elements( gridView, Partitions::interiorBorder ) )
    \n+
    421 {
    \n+
    422 if( nofElParam_ > 0 )
    \n+
    423 {
    \n+
    424 std::swap( elParam_[ indexSet.index( element ) ], dgfFactory.parameter( element ) );
    \n+
    425 assert( elParam_[ indexSet.index( element ) ].size() == static_cast< std::size_t >( nofElParam_ ) );
    \n+
    426 }
    \n+
    427
    \n+
    428 if( nofVtxParam_ > 0 )
    \n+
    429 {
    \n+
    430 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )
    \n+
    431 {
    \n+
    432 const auto index = indexSet.subIndex( element, v, dimension );
    \n+
    433 if( vtxParam_[ index ].empty() )
    \n+
    434 std::swap( vtxParam_[ index ], dgfFactory.parameter( element.template subEntity< dimension >( v ) ) );
    \n+
    435 assert( vtxParam_[ index ].size() == static_cast< std::size_t >( nofVtxParam_ ) );
    \n+
    436 }
    \n+
    437 }
    \n+
    438
    \n+
    439 if( element.hasBoundaryIntersections() )
    \n+
    440 {
    \n+
    441 for( const auto &intersection : intersections( gridView, element ) )
    \n+
    442 {
    \n+
    443 // dirty hack: check for "none" to make corner point grid work
    \n+
    444 if( !intersection.boundary() || intersection.type().isNone() )
    \n+
    445 continue;
    \n+
    446
    \n+
    447 const auto k = indexSet.subIndex( element, intersection.indexInInside(), 1 );
    \n+
    448 bndId_[ k ] = dgfFactory.boundaryId( intersection );
    \n+
    449 if( haveBndParam_ )
    \n+
    450 bndParam_[ intersection.boundarySegmentIndex() ] = dgfFactory.boundaryParameter( intersection );
    \n+
    451 }
    \n+
    452 }
    \n+
    453 }
    \n+
    454 }
    \n+
    \n+
    455
    \n+
    \n+\n+
    457 std::vector<int>& boundaryIds,
    \n+
    458 std::vector<int>& elementIds )
    \n+
    459 {
    \n+
    460 gridPtr_ = mygrid_ptr( factory.createGrid().release() );
    \n+
    461
    \n+
    462 const auto& gridView = gridPtr_->leafGridView();
    \n+
    463 const auto& indexSet = gridView.indexSet();
    \n+
    464
    \n+
    465 nofElParam_ = elementIds.empty() ? 0 : 1 ;
    \n+
    466 nofVtxParam_ = 0;
    \n+
    467 haveBndParam_ = boundaryIds.empty() ? 0 : 1 ;
    \n+
    468
    \n+
    469 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast< int >( haveBndParam_ ) }};
    \n+
    470 gridView.comm().max( nofParams.data(), nofParams.size() );
    \n+
    471
    \n+
    472 // empty grids have no parameters associated
    \n+
    473 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )
    \n+
    474 {
    \n+
    475 nofElParam_ = nofParams[ 0 ];
    \n+
    476 }
    \n+
    477
    \n+
    478 // boundary parameters may be empty
    \n+
    479 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );
    \n+
    480
    \n+
    481 // Reorder boundary IDs according to the insertion index
    \n+
    482 if(!boundaryIds.empty() || !elementIds.empty() )
    \n+
    483 {
    \n+
    484 bndParam_.resize( boundaryIds.size() );
    \n+
    485 elParam_.resize( elementIds.size(), std::vector<double>(1) );
    \n+
    486 for(const auto& entity : elements( gridView ))
    \n+
    487 {
    \n+
    488 elParam_[ indexSet.index( entity ) ][ 0 ] = elementIds[ factory.insertionIndex( entity ) ];
    \n+
    489 if( haveBndParam_ )
    \n+
    490 {
    \n+
    491 for(const auto& intersection : intersections( gridView,entity) )
    \n+
    492 {
    \n+
    493 if(intersection.boundary())
    \n+
    494 {
    \n+
    495 // DGFBoundaryParameter::type is of type string.
    \n+
    496 bndParam_[intersection.boundarySegmentIndex()] = std::to_string(boundaryIds[factory.insertionIndex(intersection)]);
    \n+
    497 }
    \n+
    498 }
    \n+
    499 }
    \n+
    500 }
    \n+
    501 }
    \n+
    502 }
    \n+
    \n+
    503
    \n+
    504 template <class Entity>
    \n+
    \n+
    505 std::vector< double > &params ( const Entity &entity )
    \n+
    506 {
    \n+
    507 const auto gridView = gridPtr_->levelGridView( 0 );
    \n+
    508 switch( (int)Entity::codimension )
    \n+
    509 {
    \n+
    510 case 0 :
    \n+
    511 if( nofElParam_ > 0 ) {
    \n+
    512 if ( gridView.indexSet().index( entity ) >= elParam_.size() )
    \n+
    513 elParam_.resize( gridView.indexSet().index( entity ) );
    \n+
    514 return elParam_[ gridView.indexSet().index( entity ) ];
    \n+
    515 }
    \n+
    516 break;
    \n+
    517 case GridType::dimension :
    \n+
    518 if( nofVtxParam_ > 0 ) {
    \n+
    519 if ( gridView.indexSet().index( entity ) >= vtxParam_.size() )
    \n+
    520 vtxParam_.resize( gridView.indexSet().index( entity ) );
    \n+
    521 return vtxParam_[ gridView.indexSet().index( entity ) ];
    \n+
    522 }
    \n+
    523 break;
    \n+
    524 }
    \n+
    525 return emptyParam_;
    \n+
    526 }
    \n+
    \n+
    527
    \n+
    \n+
    528 void setNofParams( int cdim, int nofP )
    \n+
    529 {
    \n+
    530 switch (cdim) {
    \n+
    531 case 0 : nofElParam_ = nofP; break;
    \n+
    532 case GridType::dimension : nofVtxParam_ = nofP; break;
    \n+
    533 }
    \n+
    534 }
    \n+
    \n+
    535
    \n+
    \n+\n+
    537 : public CommDataHandleIF< DataHandle, char >
    \n+
    538 {
    \n+
    \n+
    539 explicit DataHandle ( GridPtr &gridPtr )
    \n+
    540 : gridPtr_( gridPtr ), idSet_( gridPtr->localIdSet() )
    \n+
    541 {
    \n+
    542 const auto gridView = gridPtr_->levelGridView( 0 );
    \n+
    543 const auto &indexSet = gridView.indexSet();
    \n+
    544
    \n+
    545 for( const auto &element : elements( gridView, Partitions::interiorBorder ) )
    \n+
    546 {
    \n+
    547 if( gridPtr_.nofElParam_ > 0 )
    \n+
    548 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_[ idSet_.id( element ) ] );
    \n+
    549
    \n+
    550 if( gridPtr_.nofVtxParam_ > 0 )
    \n+
    551 {
    \n+
    552 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )
    \n+
    553 {
    \n+
    554 const auto index = indexSet.subIndex( element, v, dimension );
    \n+
    555 if ( !gridPtr_.vtxParam_[ index ].empty() )
    \n+
    556 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v, dimension ) ] );
    \n+
    557 }
    \n+
    558 }
    \n+
    559
    \n+
    560 if( element.hasBoundaryIntersections() )
    \n+
    561 {
    \n+
    562 for( const auto &intersection : intersections( gridView, element ) )
    \n+
    563 {
    \n+
    564 // dirty hack: check for "none" to make corner point grid work
    \n+
    565 if( !intersection.boundary() || intersection.type().isNone() )
    \n+
    566 continue;
    \n+
    567
    \n+
    568 const int i = intersection.indexInInside();
    \n+
    569 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];
    \n+
    570 bndData.first = gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ];
    \n+
    571 if( gridPtr_.haveBndParam_ )
    \n+
    572 std::swap( bndData.second, gridPtr_.bndParam_[ intersection.boundarySegmentIndex() ] );
    \n+
    573 }
    \n+
    574 }
    \n+
    575 }
    \n+
    576 }
    \n+
    \n+
    577
    \n+
    578 DataHandle ( const DataHandle & ) = delete;
    \n+
    579 DataHandle ( DataHandle && ) = delete;
    \n+
    580
    \n+
    \n+\n+
    582 {
    \n+
    583 const auto gridView = gridPtr_->levelGridView( 0 );
    \n+
    584 const auto &indexSet = gridView.indexSet();
    \n+
    585
    \n+
    586 if( gridPtr_.nofElParam_ > 0 )
    \n+
    587 gridPtr_.elParam_.resize( indexSet.size( 0 ) );
    \n+
    588 if( gridPtr_.nofVtxParam_ > 0 )
    \n+
    589 gridPtr_.vtxParam_.resize( indexSet.size( dimension ) );
    \n+
    590 gridPtr_.bndId_.resize( indexSet.size( 1 ) );
    \n+
    591 if( gridPtr_.haveBndParam_ )
    \n+
    592 gridPtr_.bndParam_.resize( gridPtr_->numBoundarySegments() );
    \n+
    593
    \n+
    594 for( const auto &element : elements( gridView, Partitions::all ) )
    \n+
    595 {
    \n+
    596 if( gridPtr_.nofElParam_ > 0 )
    \n+
    597 {
    \n+
    598 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_[ idSet_.id( element ) ] );
    \n+
    599 assert( gridPtr_.elParam_[ indexSet.index( element ) ].size() == static_cast< std::size_t >( gridPtr_.nofElParam_ ) );
    \n+
    600 }
    \n+
    601
    \n+
    602 if( gridPtr_.nofVtxParam_ > 0 )
    \n+
    603 {
    \n+
    604 for( unsigned int v = 0; v < element.subEntities( dimension ); ++v )
    \n+
    605 {
    \n+
    606 const auto index = indexSet.subIndex( element, v, dimension );
    \n+
    607 if( gridPtr_.vtxParam_[ index ].empty() )
    \n+
    608 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v, dimension ) ] );
    \n+
    609 assert( gridPtr_.vtxParam_[ index ].size() == static_cast< std::size_t >( gridPtr_.nofVtxParam_ ) );
    \n+
    610 }
    \n+
    611 }
    \n+
    612
    \n+
    613 if( element.hasBoundaryIntersections() )
    \n+
    614 {
    \n+
    615 for( const auto &intersection : intersections( gridView, element ) )
    \n+
    616 {
    \n+
    617 // dirty hack: check for "none" to make corner point grid work
    \n+
    618 if( !intersection.boundary() || intersection.type().isNone() )
    \n+
    619 continue;
    \n+
    620
    \n+
    621 const int i = intersection.indexInInside();
    \n+
    622 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];
    \n+
    623 gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ] = bndData.first;
    \n+
    624 if( gridPtr_.haveBndParam_ )
    \n+
    625 std::swap( bndData.second, gridPtr_.bndParam_[ intersection.boundarySegmentIndex() ] );
    \n+
    626 }
    \n+
    627 }
    \n+
    628 }
    \n+
    629 }
    \n+
    630
    \n+\n+
    \n+
    632
    \n+
    \n+
    633 bool contains ( int dim, int codim ) const
    \n+
    634 {
    \n+
    635 assert( dim == dimension );
    \n+
    636 // do not use a switch statement, because dimension == 1 is possible
    \n+
    637 return (codim == 1) || ((codim == dimension) && (gridPtr_.nofVtxParam_ > 0)) || ((codim == 0) && (gridPtr_.nofElParam_ > 0));
    \n+
    638 }
    \n+
    \n+
    639
    \n+
    640 bool fixedSize (int /* dim */, int /* codim */) const { return false; }
    \n+
    641
    \n+
    642 template< class Entity >
    \n+
    \n+
    643 std::size_t size ( const Entity &entity ) const
    \n+
    644 {
    \n+
    645 std::size_t totalSize = 0;
    \n+
    646
    \n+
    647 // do not use a switch statement, because dimension == 1 is possible
    \n+
    648 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )
    \n+
    649 {
    \n+
    650 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofElParam_ ) );
    \n+
    651 for( double &v : elData_[ idSet_.id( entity ) ] )
    \n+
    652 totalSize += dataSize( v );
    \n+
    653 }
    \n+
    654
    \n+
    655 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )
    \n+
    656 {
    \n+
    657 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofVtxParam_ ) );
    \n+
    658 for( double &v : vtxData_[ idSet_.id( entity ) ] )
    \n+
    659 totalSize += dataSize( v );
    \n+
    660 }
    \n+
    661
    \n+
    662 if( Entity::codimension == 1 )
    \n+
    663 {
    \n+
    664 const auto bndData = bndData_.find( idSet_.id( entity ) );
    \n+
    665 if( bndData != bndData_.end() )
    \n+
    666 totalSize += dataSize( bndData->second.first ) + dataSize( bndData->second.second );
    \n+
    667 }
    \n+
    668
    \n+
    669 return totalSize;
    \n+
    670 }
    \n+
    \n+
    671
    \n+
    672 template< class Buffer, class Entity >
    \n+
    \n+
    673 void gather ( Buffer &buffer, const Entity &entity ) const
    \n+
    674 {
    \n+
    675 // do not use a switch statement, because dimension == 1 is possible
    \n+
    676 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )
    \n+
    677 {
    \n+
    678 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofElParam_ ) );
    \n+
    679 for( double &v : elData_[ idSet_.id( entity ) ] )
    \n+
    680 write( buffer, v );
    \n+
    681 }
    \n+
    682
    \n+
    683 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )
    \n+
    684 {
    \n+
    685 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >( gridPtr_.nofVtxParam_ ) );
    \n+
    686 for( double &v : vtxData_[ idSet_.id( entity ) ] )
    \n+
    687 write( buffer, v );
    \n+
    688 }
    \n+
    689
    \n+
    690 if( Entity::codimension == 1 )
    \n+
    691 {
    \n+
    692 const auto bndData = bndData_.find( idSet_.id( entity ) );
    \n+
    693 if( bndData != bndData_.end() )
    \n+
    694 {
    \n+
    695 write( buffer, bndData->second.first );
    \n+
    696 write( buffer, bndData->second.second );
    \n+
    697 }
    \n+
    698 }
    \n+
    699 }
    \n+
    \n+
    700
    \n+
    701 template< class Buffer, class Entity >
    \n+
    \n+
    702 void scatter ( Buffer &buffer, const Entity &entity, std::size_t n )
    \n+
    703 {
    \n+
    704 // do not use a switch statement, because dimension == 1 is possible
    \n+
    705 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )
    \n+
    706 {
    \n+
    707 auto &p = elData_[ idSet_.id( entity ) ];
    \n+
    708 p.resize( gridPtr_.nofElParam_ );
    \n+
    709 for( double &v : p )
    \n+
    710 read( buffer, v, n );
    \n+
    711 }
    \n+
    712
    \n+
    713 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )
    \n+
    714 {
    \n+
    715 auto &p = vtxData_[ idSet_.id( entity ) ];
    \n+
    716 p.resize( gridPtr_.nofVtxParam_ );
    \n+
    717 for( double &v : p )
    \n+
    718 read( buffer, v, n );
    \n+
    719 }
    \n+
    720
    \n+
    721 if( (Entity::codimension == 1) && (n > 0) )
    \n+
    722 {
    \n+
    723 auto &bndData = bndData_[ idSet_.id( entity ) ];
    \n+
    724 read( buffer, bndData.first, n );
    \n+
    725 read( buffer, bndData.second, n );
    \n+
    726 }
    \n+
    727
    \n+
    728 assert( n == 0 );
    \n+
    729 }
    \n+
    \n+
    730
    \n+
    731 private:
    \n+
    732 template< class T >
    \n+
    733 static std::enable_if_t< std::is_trivially_copyable< T >::value, std::size_t > dataSize ( const T & /* value */ )
    \n+
    734 {
    \n+
    735 return sizeof( T );
    \n+
    736 }
    \n+
    737
    \n+
    738 static std::size_t dataSize ( const std::string &s )
    \n+
    739 {
    \n+
    740 return dataSize( s.size() ) + s.size();
    \n+
    741 }
    \n+
    742
    \n+
    743 template< class Buffer, class T >
    \n+
    744 static std::enable_if_t< std::is_trivially_copyable< T >::value > write ( Buffer &buffer, const T &value )
    \n+
    745 {
    \n+
    746 std::array< char, sizeof( T ) > bytes;
    \n+
    747 std::memcpy( bytes.data(), &value, sizeof( T ) );
    \n+
    748 for( char &b : bytes )
    \n+
    749 buffer.write( b );
    \n+
    750 }
    \n+
    751
    \n+
    752 template< class Buffer >
    \n+
    753 static void write ( Buffer &buffer, const std::string &s )
    \n+
    754 {
    \n+
    755 write( buffer, s.size() );
    \n+
    756 for( const char &c : s )
    \n+
    757 buffer.write( c );
    \n+
    758 }
    \n+
    759
    \n+
    760 template< class Buffer, class T >
    \n+
    761 static std::enable_if_t< std::is_trivially_copyable< T >::value > read ( Buffer &buffer, T &value, std::size_t &n )
    \n+
    762 {
    \n+
    763 assert( n >= sizeof( T ) );
    \n+
    764 n -= sizeof( T );
    \n+
    765
    \n+
    766 std::array< char, sizeof( T ) > bytes;
    \n+
    767 for( char &b : bytes )
    \n+
    768 buffer.read( b );
    \n+
    769 std::memcpy( &value, bytes.data(), sizeof( T ) );
    \n+
    770 }
    \n+
    771
    \n+
    772 template< class Buffer >
    \n+
    773 static void read ( Buffer &buffer, std::string &s, std::size_t &n )
    \n+
    774 {
    \n+
    775 std::size_t size;
    \n+
    776 read( buffer, size, n );
    \n+
    777 s.resize( size );
    \n+
    778
    \n+
    779 assert( n >= size );
    \n+
    780 n -= size;
    \n+
    781
    \n+
    782 for( char &c : s )
    \n+
    783 buffer.read( c );
    \n+
    784 }
    \n+
    785
    \n+
    786 GridPtr &gridPtr_;
    \n+
    787 const typename GridType::LocalIdSet &idSet_;
    \n+
    788 mutable std::map< typename GridType::LocalIdSet::IdType, std::vector< double > > elData_, vtxData_;
    \n+
    789 mutable std::map< typename GridType::LocalIdSet::IdType, std::pair< int, DGFBoundaryParameter::type > > bndData_;
    \n+
    790 };
    \n+
    \n+
    791
    \n+
    792 // grid auto pointer
    \n+\n+
    794 // element and vertex parameters
    \n+
    795 std::vector< std::vector< double > > elParam_;
    \n+
    796 std::vector< std::vector< double > > vtxParam_;
    \n+
    797 std::vector< DGFBoundaryParameter::type > bndParam_;
    \n+
    798 std::vector< int > bndId_;
    \n+
    799 std::vector< double > emptyParam_;
    \n+
    800
    \n+\n+\n+\n+
    804 }; // end of class GridPtr
    \n+
    \n+
    805
    \n+
    806} // end namespace Dune
    \n+
    807
    \n+
    808#endif
    \n+\n+\n+
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n+\n+\n+\n+\n+\n+
    @ ForwardCommunication
    communicate as given in InterfaceType
    Definition gridenums.hh:171
    \n+
    @ InteriorBorder_All_Interface
    send interior and border, receive all entities
    Definition gridenums.hh:88
    \n+
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n+
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n-
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n-
    unsigned vtkIndex() const
    get the index of the corner within the cell in VTK-numbering
    Definition corner.hh:63
    \n-
    void vtkIndex(unsigned i)
    set the index of the corner within the cell in VTK-numbering
    Definition corner.hh:68
    \n-
    Corner(const Cell &cell, unsigned duneIndex)
    construct a Corner
    Definition corner.hh:38
    \n-
    void cell(const Cell &cell__)
    set a new cell
    Definition corner.hh:52
    \n-
    void duneIndex(unsigned i)
    set the index of the corner within the cell in Dune-numbering
    Definition corner.hh:57
    \n-
    unsigned duneIndex() const
    get the index of the corner within the cell in Dune-numbering
    Definition corner.hh:55
    \n-
    const Cell & cell() const
    get reference to the cell
    Definition corner.hh:46
    \n-
    Corner()
    construct an invalid Corner
    Definition corner.hh:43
    \n+
    constexpr All all
    PartitionSet for all partitions.
    Definition partitionset.hh:295
    \n+
    constexpr InteriorBorder interiorBorder
    PartitionSet for the interior and border partitions.
    Definition partitionset.hh:286
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    int boundaryId(const Intersection &intersection) const
    Definition dgfgridfactory.hh:102
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfgridfactory.hh:158
    \n+
    Grid * grid()
    Definition dgfgridfactory.hh:90
    \n+
    std::vector< double > & parameter(const Element &element)
    Definition dgfgridfactory.hh:124
    \n+
    bool haveBoundaryParameters() const
    Definition dgfgridfactory.hh:151
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    size_t boundarySegmentIndex() const
    index of the boundary segment within the macro grid
    Definition common/intersection.hh:236
    \n+
    CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
    Definition datahandleif.hh:78
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n+
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n+
    virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
    obtain an element's insertion index
    Definition common/gridfactory.hh:181
    \n+
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n+
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Class for constructing grids from DGF files.
    Definition gridptr.hh:66
    \n+
    GridPtr(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor given a std::istream
    Definition gridptr.hh:199
    \n+
    const std::vector< double > & parameters(const Entity &entity) const
    get parameters defined for each codim 0 und dim entity on the grid through the grid file
    Definition gridptr.hh:325
    \n+
    GridPtr()
    Default constructor, creating empty GridPtr.
    Definition gridptr.hh:217
    \n+
    const GridType & operator*() const
    return const reference to GridType instance
    Definition gridptr.hh:288
    \n+
    bool haveBndParam_
    Definition gridptr.hh:803
    \n+
    static const int dimension
    Definition gridptr.hh:155
    \n+
    std::vector< int > bndId_
    Definition gridptr.hh:798
    \n+
    void setNofParams(int cdim, int nofP)
    Definition gridptr.hh:528
    \n+
    void loadBalance()
    Definition gridptr.hh:369
    \n+
    std::vector< DGFBoundaryParameter::type > bndParam_
    Definition gridptr.hh:797
    \n+
    void initialize(GridFactory< GridType > &factory, std::vector< int > &boundaryIds, std::vector< int > &elementIds)
    Definition gridptr.hh:456
    \n+
    GridPtr(GridType *grd)
    Constructor storing given pointer to internal auto pointer.
    Definition gridptr.hh:230
    \n+
    int nofElParam_
    Definition gridptr.hh:801
    \n+
    const DGFBoundaryParameter::type & parameters(const Intersection< GridImp, IntersectionImp > &intersection) const
    get parameters for intersection
    Definition gridptr.hh:351
    \n+
    GridType & operator*()
    return reference to GridType instance
    Definition gridptr.hh:278
    \n+
    static bool isEmpty(Range &&range)
    Definition gridptr.hh:381
    \n+
    int nofParameters(const Entity &) const
    get parameters defined for given entity
    Definition gridptr.hh:311
    \n+
    GridPtr(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor given the name of a DGF file
    Definition gridptr.hh:158
    \n+
    std::vector< std::vector< double > > elParam_
    Definition gridptr.hh:795
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition gridptr.hh:154
    \n+
    GridPtr & operator=(const GridPtr &org)
    assignment of grid pointer
    Definition gridptr.hh:246
    \n+
    int nofParameters(int cdim) const
    get number of parameters defined for a given codimension
    Definition gridptr.hh:301
    \n+
    int nofParameters(const Intersection< GridImp, IntersectionImp > &intersection) const
    get number of parameters defined for a given intersection
    Definition gridptr.hh:318
    \n+
    std::vector< double > emptyParam_
    Definition gridptr.hh:799
    \n+
    mygrid_ptr gridPtr_
    Definition gridptr.hh:793
    \n+
    void readGmsh(const std::string &filename, std::integral_constant< bool, false >)
    Definition gridptr.hh:147
    \n+
    void readGmsh(const std::string &filename, std::integral_constant< bool, true >)
    Definition gridptr.hh:137
    \n+
    std::vector< double > & params(const Entity &entity)
    Definition gridptr.hh:505
    \n+
    void initialize(DGFGridFactory< GridType > &dgfFactory)
    Definition gridptr.hh:386
    \n+
    GridPtr(const GridPtr &org)=default
    Copy constructor, copies internal auto pointer.
    \n+
    std::string getFileExtension(const std::string &filename) const
    Definition gridptr.hh:122
    \n+
    const GridType * operator->() const
    return const pointer to GridType instance
    Definition gridptr.hh:293
    \n+
    GridType * release()
    release pointer from internal ownership
    Definition gridptr.hh:298
    \n+
    void communicate()
    Definition gridptr.hh:360
    \n+
    std::vector< std::vector< double > > vtxParam_
    Definition gridptr.hh:796
    \n+
    GridType * operator->()
    return pointer to GridType instance
    Definition gridptr.hh:283
    \n+
    int nofVtxParam_
    Definition gridptr.hh:802
    \n+
    Definition gridptr.hh:68
    \n+
    mygrid_ptr(GridType *grd)
    Definition gridptr.hh:99
    \n+
    ~mygrid_ptr()
    Definition gridptr.hh:102
    \n+
    GridType * release()
    Definition gridptr.hh:112
    \n+
    mygrid_ptr(const mygrid_ptr &other)
    Definition gridptr.hh:97
    \n+
    mygrid_ptr & operator=(const mygrid_ptr &other)
    Definition gridptr.hh:105
    \n+
    mygrid_ptr()
    Definition gridptr.hh:95
    \n+
    Definition gridptr.hh:538
    \n+
    CommDataHandleIF< DataHandle, char > & interface()
    Definition gridptr.hh:631
    \n+
    DataHandle(const DataHandle &)=delete
    \n+
    ~DataHandle()
    Definition gridptr.hh:581
    \n+
    DataHandle(GridPtr &gridPtr)
    Definition gridptr.hh:539
    \n+
    void gather(Buffer &buffer, const Entity &entity) const
    Definition gridptr.hh:673
    \n+
    bool fixedSize(int, int) const
    Definition gridptr.hh:640
    \n+
    std::size_t size(const Entity &entity) const
    Definition gridptr.hh:643
    \n+
    DataHandle(DataHandle &&)=delete
    \n+
    void scatter(Buffer &buffer, const Entity &entity, std::size_t n)
    Definition gridptr.hh:702
    \n+
    bool contains(int dim, int codim) const
    Definition gridptr.hh:633
    \n+
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    static std::unique_ptr< Grid > read(const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
    Definition gmshreader.hh:937
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,107 +2,1132 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-corner.hh\n+ * dgfparser\n+gridptr.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_CORNER_HH\n-8\n-9#include \n+5#ifndef DUNE_DGF_GRIDPTR_HH\n+6#define DUNE_DGF_GRIDPTR_HH\n+7\n+8#include \n+9#include \n 10\n-11namespace Dune\n-12{\n-15\n-16 namespace VTK {\n-17\n-19\n-24 template\n-25 class Corner {\n-26 // store a pointer to the element\n-27 const Cell* cell_;\n-28 // store index of the corner within element (Dune numbering)\n-29 unsigned index;\n-30\n-31 public:\n-33\n-38 Corner(const Cell& cell, unsigned duneIndex)\n-39 : cell_(&cell), index(duneIndex)\n-40 { }\n-41\n-43 Corner() { }\n-44\n-46 const Cell& cell() const { return *cell_; }\n+11#include \n+12#include \n+13#include \n+14#include \n+15#include \n+16#include \n+17#include \n+18\n+19//- Dune includes\n+20#include \n+21#include \n+22\n+23#include \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+36{\n+37\n+38 // External Forward Declarations\n+39 // -----------------------------\n+40\n+41 template < class G >\n+42 struct DGFGridFactory;\n+43\n+44 template< class GridImp, class IntersectionImp >\n+45 class Intersection;\n+46\n+47\n 48\n-52 void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }\n-53\n-55 unsigned duneIndex() const { return index; }\n-57 void duneIndex(unsigned i) { index = i; }\n-58\n-60\n-63 unsigned vtkIndex() const { return renumber(cell_->type(), index); }\n-65\n-68 void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }\n-69 };\n-70\n-71 } // namespace VTK\n+49 // GridPtr\n+50 // -------\n+51\n+64 template< class GridType >\n+65 struct GridPtr\n+66 {\n+67 class mygrid_ptr : public std::shared_ptr< GridType >\n+68 {\n+69 typedef std::shared_ptr< GridType > base_t ;\n+70 // empty deleter to avoid deletion on release\n+71 typedef null_deleter< GridType > emptydeleter_t ;\n 72\n-74\n-75} // namespace Dune\n-76\n-77#endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH\n-common.hh\n-Common stuff for the VTKWriter.\n+73 void removeObj()\n+74 {\n+75 // if use count is only 1 delete object\n+76 if( use_count() == 1 )\n+77 {\n+78 // delete point here, since we use the empty deleter\n+79 GridType* grd = release();\n+80 if( grd ) delete grd ;\n+81 }\n+82 }\n+83\n+84 void assignObj( const mygrid_ptr& other )\n+85 {\n+86 removeObj();\n+87 base_t :: operator = ( other );\n+88 }\n+89 public:\n+90 using base_t :: get ;\n+91 using base_t :: swap ;\n+92 using base_t :: use_count ;\n+93\n+94 // default constructor\n+95 mygrid_ptr() : base_t( ( GridType * ) 0, emptydeleter_t() ) {}\n+96 // copy constructor\n+97 mygrid_ptr( const mygrid_ptr& other ) : base_t(nullptr) { assignObj( other\n+); }\n+98 // constructor taking pointer\n+99 explicit mygrid_ptr( GridType* grd ) : base_t( grd, emptydeleter_t() ) {}\n+100\n+101 // destructor\n+102 ~mygrid_ptr() { removeObj(); }\n+103\n+104 // assignment operator\n+105 mygrid_ptr& operator_=_( const mygrid_ptr& other )\n+106 {\n+107 assignObj( other );\n+108 return *this;\n+109 }\n+110\n+111 // release pointer\n+112 GridType* release()\n+113 {\n+114 GridType* grd = this->get();\n+115 base_t ptr(( GridType * ) 0, emptydeleter_t() );\n+116 this->swap( ptr );\n+117 return grd ;\n+118 }\n+119 };\n+120\n+121 protected:\n+122 std::string getFileExtension( const std::string& filename ) const\n+123 {\n+124 // extract file extension\n+125 auto extpos = filename.find_last_of(\".\");\n+126 std::string ext;\n+127 if( extpos != std::string::npos)\n+128 ext = filename.substr( extpos + 1 );\n+129\n+130 // convert all letters to lower case\n+131 for( auto& item : ext )\n+132 item = std::tolower( item );\n+133 return ext;\n+134 }\n+135\n+136 // read gmsh file if dimension world <= 3\n+137 void readGmsh( const std::string& filename, std::integral_constant< bool,\n+true > )\n+138 {\n+139 GridFactory gridFactory;\n+140 std::vector boundaryIDs;\n+141 std::vector elementsIDs;\n+142 GmshReader::read(gridFactory,filename,boundaryIDs,elementsIDs);\n+143 initialize( gridFactory, boundaryIDs,elementsIDs);\n+144 }\n+145\n+146 // if dimension world > 3 throw GridError\n+147 void readGmsh( const std::string& filename, std::integral_constant< bool,\n+false > )\n+148 {\n+149 DUNE_THROW(GridError, \"GmshReader requires dimWorld <= 3.\" );\n+150 }\n+151\n+152 public:\n+153\n+154 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n+155 static const int dimension = GridType::dimension;\n+156\n+158 explicit GridPtr ( const std::string &filename,\n+159 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+160 : gridPtr_(),\n+161 elParam_(),\n+162 vtxParam_(),\n+163 bndParam_(),\n+164 bndId_(),\n+165 emptyParam_(),\n+166 nofElParam_( 0 ),\n+167 nofVtxParam_( 0 ),\n+168 haveBndParam_( false )\n+169 {\n+170 std::string fileExt = getFileExtension( filename );\n+171\n+172 if( fileExt == \"dgf\" )\n+173 {\n+174 DGFGridFactory<_GridType_> dgfFactory( filename, comm );\n+175 initialize( dgfFactory );\n+176 }\n+177 else if( fileExt == \"msh\" )\n+178 {\n+179 // Gmsh reader only compiles for dimworld <= 3\n+180 readGmsh( filename, std::integral_constant< bool, GridType::dimensionworld\n+<= 3 > () );\n+181 }\n+182 else if( fileExt == \"amc\" || fileExt == \"2d\" || fileExt == \"3d\" )\n+183 {\n+184 // TODO: AlbertaReader\n+185 DUNE_THROW( NotImplemented, \"GridPtr: file format '\" << fileExt << \"' not\n+supported yet!\" );\n+186 }\n+187 else if( fileExt == \"vtu\" )\n+188 {\n+189 // TODO: vtu/vtk reader\n+190 DUNE_THROW( NotImplemented, \"GridPtr: file format '\" << fileExt << \"' not\n+supported yet!\" );\n+191 }\n+192 else\n+193 {\n+194 DUNE_THROW( NotImplemented, \"GridPtr: file format '\" << fileExt << \"' not\n+supported yet!\" );\n+195 }\n+196 }\n+197\n+199 explicit GridPtr ( std::istream &input,\n+200 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+201 : gridPtr_(),\n+202 elParam_(),\n+203 vtxParam_(),\n+204 bndParam_(),\n+205 bndId_(),\n+206 emptyParam_(),\n+207 nofElParam_( 0 ),\n+208 nofVtxParam_( 0 ),\n+209 haveBndParam_( false )\n+210 {\n+211 // input stream only works for DGF format right now\n+212 DGFGridFactory<_GridType_> dgfFactory( input, comm );\n+213 initialize( dgfFactory );\n+214 }\n+215\n+217 GridPtr()\n+218 : gridPtr_(),\n+219 elParam_(),\n+220 vtxParam_(),\n+221 bndParam_(),\n+222 bndId_(),\n+223 emptyParam_(),\n+224 nofElParam_(0),\n+225 nofVtxParam_(0),\n+226 haveBndParam_( false )\n+227 {}\n+228\n+230 explicit GridPtr( GridType *grd )\n+231 : gridPtr_(grd),\n+232 elParam_(),\n+233 vtxParam_(),\n+234 bndParam_(),\n+235 bndId_(),\n+236 emptyParam_(),\n+237 nofElParam_(0),\n+238 nofVtxParam_(0),\n+239 haveBndParam_( false )\n+240 {}\n+241\n+243 GridPtr( const GridPtr &org ) = default;\n+244\n+246 GridPtr& operator=_( const GridPtr &org )\n+247 {\n+248 gridPtr_ = org.gridPtr_;\n+249 elParam_ = org.elParam_;\n+250 vtxParam_ = org.vtxParam_;\n+251 bndParam_ = org.bndParam_;\n+252 bndId_ = org.bndId_;\n+253 emptyParam_ = org.emptyParam_;\n+254\n+255 nofElParam_ = org.nofElParam_;\n+256 nofVtxParam_ = org.nofVtxParam_;\n+257 haveBndParam_ = org.haveBndParam_;\n+258 return *this;\n+259 }\n+260\n+262 GridPtr& operator_=_(GridType * grd)\n+263 {\n+264 gridPtr_ = mygrid_ptr( grd );\n+265 elParam_.resize(0);\n+266 vtxParam_.resize(0);\n+267 bndParam_.resize(0);\n+268 bndId_.resize(0);\n+269 emptyParam_.resize(0);\n+270\n+271 nofVtxParam_ = 0;\n+272 nofElParam_ = 0;\n+273 haveBndParam_ = false;\n+274 return *this;\n+275 }\n+276\n+278 GridType& operator*() {\n+279 return *gridPtr_;\n+280 }\n+281\n+283 GridType* operator->() {\n+284 return gridPtr_.operator -> ();\n+285 }\n+286\n+288 const GridType& operator*() const {\n+289 return *gridPtr_;\n+290 }\n+291\n+293 const GridType* operator->() const {\n+294 return gridPtr_.operator -> ();\n+295 }\n+296\n+298 GridType* release () { return gridPtr_.release(); }\n+299\n+301 int nofParameters(int cdim) const {\n+302 switch (cdim) {\n+303 case 0 : return nofElParam_; break;\n+304 case GridType::dimension : return nofVtxParam_; break;\n+305 }\n+306 return 0;\n+307 }\n+308\n+310 template \n+311 int nofParameters ( const Entity & ) const\n+312 {\n+313 return nofParameters( (int) Entity::codimension );\n+314 }\n+315\n+317 template< class GridImp, class IntersectionImp >\n+318 int nofParameters ( const Intersection<_GridImp,_IntersectionImp_> &\n+intersection ) const\n+319 {\n+320 return parameters( intersection ).size();\n+321 }\n+322\n+324 template \n+325 const std::vector< double > ¶meters ( const Entity &entity ) const\n+326 {\n+327 typedef typename GridType::LevelGridView GridView;\n+328 GridView gridView = gridPtr_->levelGridView( 0 );\n+329 switch( (int)Entity::codimension )\n+330 {\n+331 case 0 :\n+332 if( nofElParam_ > 0 )\n+333 {\n+334 assert( (unsigned int)gridView.indexSet().index( entity ) < elParam_.size()\n+);\n+335 return elParam_[ gridView.indexSet().index( entity ) ];\n+336 }\n+337 break;\n+338 case GridType::dimension :\n+339 if( nofVtxParam_ > 0 )\n+340 {\n+341 assert( (unsigned int)gridView.indexSet().index( entity ) < vtxParam_.size\n+() );\n+342 return vtxParam_[ gridView.indexSet().index( entity ) ];\n+343 }\n+344 break;\n+345 }\n+346 return emptyParam_;\n+347 }\n+348\n+350 template< class GridImp, class IntersectionImp >\n+351 const DGFBoundaryParameter::type & parameters ( const Intersection<\n+GridImp,_IntersectionImp_> & intersection ) const\n+352 {\n+353 // if no parameters given return empty vector\n+354 if ( !haveBndParam_ )\n+355 return DGFBoundaryParameter::defaultValue();\n+356\n+357 return bndParam_[ intersection.boundarySegmentIndex() ];\n+358 }\n+359\n+360 void communicate ()\n+361 {\n+362 if( gridPtr_->comm().size() > 1 )\n+363 {\n+364 DataHandle dh(*this);\n+365 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_\n+All_Interface,ForwardCommunication );\n+366 }\n+367 }\n+368\n+369 void loadBalance ()\n+370 {\n+371 if( gridPtr_->comm().size() > 1 )\n+372 {\n+373 DataHandle dh(*this);\n+374 gridPtr_->loadBalance( dh.interface() );\n+375 gridPtr_->levelGridView( 0 ).communicate( dh.interface(), InteriorBorder_\n+All_Interface,ForwardCommunication );\n+376 }\n+377 }\n+378\n+379 protected:\n+380 template< class Range >\n+381 static bool isEmpty ( Range &&range )\n+382 {\n+383 return range.begin() == range.end();\n+384 }\n+385\n+386 void initialize ( DGFGridFactory<_GridType_> &dgfFactory )\n+387 {\n+388 gridPtr_ = mygrid_ptr( dgfFactory.grid() );\n+389\n+390 const auto gridView = gridPtr_->levelGridView( 0 );\n+391 const auto &indexSet = gridView.indexSet();\n+392\n+393 nofElParam_ = dgfFactory.template numParameters< 0 >();\n+394 nofVtxParam_ = dgfFactory.template numParameters< dimension >();\n+395 haveBndParam_ = dgfFactory.haveBoundaryParameters();\n+396\n+397 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast<\n+int >( haveBndParam_ ) }};\n+398 gridView.comm().max( nofParams.data(), nofParams.size() );\n+399\n+400 // empty grids have no parameters associated\n+401 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )\n+402 {\n+403 nofElParam_ = nofParams[ 0 ];\n+404 nofVtxParam_ = nofParams[ 1 ];\n+405 }\n+406\n+407 // boundary parameters may be empty\n+408 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );\n+409\n+410 if( (nofElParam_ != nofParams[ 0 ]) || (nofVtxParam_ != nofParams[ 1 ]) )\n+411 DUNE_THROW( DGFException, \"Number of parameters differs between processes\"\n+);\n+412\n+413 elParam_.resize( nofElParam_ > 0 ? indexSet.size( 0 ) : 0 );\n+414 vtxParam_.resize( nofVtxParam_ > 0 ? indexSet.size( dimension ) : 0 );\n+415\n+416 bndId_.resize( indexSet.size( 1 ) );\n+417 if( haveBndParam_ )\n+418 bndParam_.resize( gridPtr_->numBoundarySegments() );\n+419\n+420 for( const auto &element : elements( gridView, Partitions::interiorBorder )\n+)\n+421 {\n+422 if( nofElParam_ > 0 )\n+423 {\n+424 std::swap( elParam_[ indexSet.index( element ) ], dgfFactory.parameter\n+( element ) );\n+425 assert( elParam_[ indexSet.index( element ) ].size() == static_cast< std::\n+size_t >( nofElParam_ ) );\n+426 }\n+427\n+428 if( nofVtxParam_ > 0 )\n+429 {\n+430 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )\n+431 {\n+432 const auto index = indexSet.subIndex( element, v, dimension );\n+433 if( vtxParam_[ index ].empty() )\n+434 std::swap( vtxParam_[ index ], dgfFactory.parameter( element.template\n+subEntity< dimension >( v ) ) );\n+435 assert( vtxParam_[ index ].size() == static_cast< std::size_t >\n+( nofVtxParam_ ) );\n+436 }\n+437 }\n+438\n+439 if( element.hasBoundaryIntersections() )\n+440 {\n+441 for( const auto &intersection : intersections( gridView, element ) )\n+442 {\n+443 // dirty hack: check for \"none\" to make corner point grid work\n+444 if( !intersection.boundary() || intersection.type().isNone() )\n+445 continue;\n+446\n+447 const auto k = indexSet.subIndex( element, intersection.indexInInside(), 1\n+);\n+448 bndId_[ k ] = dgfFactory.boundaryId( intersection );\n+449 if( haveBndParam_ )\n+450 bndParam_[ intersection.boundarySegmentIndex() ] =\n+dgfFactory.boundaryParameter( intersection );\n+451 }\n+452 }\n+453 }\n+454 }\n+455\n+456 void initialize ( GridFactory<_GridType_> &factory,\n+457 std::vector& boundaryIds,\n+458 std::vector& elementIds )\n+459 {\n+460 gridPtr_ = mygrid_ptr( factory.createGrid().release() );\n+461\n+462 const auto& gridView = gridPtr_->leafGridView();\n+463 const auto& indexSet = gridView.indexSet();\n+464\n+465 nofElParam_ = elementIds.empty() ? 0 : 1 ;\n+466 nofVtxParam_ = 0;\n+467 haveBndParam_ = boundaryIds.empty() ? 0 : 1 ;\n+468\n+469 std::array< int, 3 > nofParams = {{ nofElParam_, nofVtxParam_, static_cast<\n+int >( haveBndParam_ ) }};\n+470 gridView.comm().max( nofParams.data(), nofParams.size() );\n+471\n+472 // empty grids have no parameters associated\n+473 if( isEmpty( elements( gridView, Partitions::interiorBorder ) ) )\n+474 {\n+475 nofElParam_ = nofParams[ 0 ];\n+476 }\n+477\n+478 // boundary parameters may be empty\n+479 haveBndParam_ = static_cast< bool >( nofParams[ 2 ] );\n+480\n+481 // Reorder boundary IDs according to the insertion index\n+482 if(!boundaryIds.empty() || !elementIds.empty() )\n+483 {\n+484 bndParam_.resize( boundaryIds.size() );\n+485 elParam_.resize( elementIds.size(), std::vector(1) );\n+486 for(const auto& entity : elements( gridView ))\n+487 {\n+488 elParam_[ indexSet.index( entity ) ][ 0 ] = elementIds\n+[ factory.insertionIndex( entity ) ];\n+489 if( haveBndParam_ )\n+490 {\n+491 for(const auto& intersection : intersections( gridView,entity) )\n+492 {\n+493 if(intersection.boundary())\n+494 {\n+495 // DGFBoundaryParameter::type is of type string.\n+496 bndParam_[intersection.boundarySegmentIndex()] = std::to_string(boundaryIds\n+[factory.insertionIndex(intersection)]);\n+497 }\n+498 }\n+499 }\n+500 }\n+501 }\n+502 }\n+503\n+504 template \n+505 std::vector< double > ¶ms ( const Entity &entity )\n+506 {\n+507 const auto gridView = gridPtr_->levelGridView( 0 );\n+508 switch( (int)Entity::codimension )\n+509 {\n+510 case 0 :\n+511 if( nofElParam_ > 0 ) {\n+512 if ( gridView.indexSet().index( entity ) >= elParam_.size() )\n+513 elParam_.resize( gridView.indexSet().index( entity ) );\n+514 return elParam_[ gridView.indexSet().index( entity ) ];\n+515 }\n+516 break;\n+517 case GridType::dimension :\n+518 if( nofVtxParam_ > 0 ) {\n+519 if ( gridView.indexSet().index( entity ) >= vtxParam_.size() )\n+520 vtxParam_.resize( gridView.indexSet().index( entity ) );\n+521 return vtxParam_[ gridView.indexSet().index( entity ) ];\n+522 }\n+523 break;\n+524 }\n+525 return emptyParam_;\n+526 }\n+527\n+528 void setNofParams( int cdim, int nofP )\n+529 {\n+530 switch (cdim) {\n+531 case 0 : nofElParam_ = nofP; break;\n+532 case GridType::dimension : nofVtxParam_ = nofP; break;\n+533 }\n+534 }\n+535\n+536 struct DataHandle\n+537 : public CommDataHandleIF< DataHandle, char >\n+538 {\n+539 explicit DataHandle ( GridPtr &gridPtr )\n+540 : gridPtr_( gridPtr ), idSet_( gridPtr->localIdSet() )\n+541 {\n+542 const auto gridView = gridPtr_->levelGridView( 0 );\n+543 const auto &indexSet = gridView.indexSet();\n+544\n+545 for( const auto &element : elements( gridView, Partitions::interiorBorder )\n+)\n+546 {\n+547 if( gridPtr_.nofElParam_ > 0 )\n+548 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_\n+[ idSet_.id( element ) ] );\n+549\n+550 if( gridPtr_.nofVtxParam_ > 0 )\n+551 {\n+552 for( unsigned int v = 0, n = element.subEntities( dimension ); v < n; ++v )\n+553 {\n+554 const auto index = indexSet.subIndex( element, v, dimension );\n+555 if ( !gridPtr_.vtxParam_[ index ].empty() )\n+556 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v,\n+dimension ) ] );\n+557 }\n+558 }\n+559\n+560 if( element.hasBoundaryIntersections() )\n+561 {\n+562 for( const auto &intersection : intersections( gridView, element ) )\n+563 {\n+564 // dirty hack: check for \"none\" to make corner point grid work\n+565 if( !intersection.boundary() || intersection.type().isNone() )\n+566 continue;\n+567\n+568 const int i = intersection.indexInInside();\n+569 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];\n+570 bndData.first = gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ];\n+571 if( gridPtr_.haveBndParam_ )\n+572 std::swap( bndData.second, gridPtr_.bndParam_\n+[ intersection.boundarySegmentIndex() ] );\n+573 }\n+574 }\n+575 }\n+576 }\n+577\n+578 DataHandle ( const DataHandle & ) = delete;\n+579 DataHandle ( DataHandle && ) = delete;\n+580\n+581 ~DataHandle ()\n+582 {\n+583 const auto gridView = gridPtr_->levelGridView( 0 );\n+584 const auto &indexSet = gridView.indexSet();\n+585\n+586 if( gridPtr_.nofElParam_ > 0 )\n+587 gridPtr_.elParam_.resize( indexSet.size( 0 ) );\n+588 if( gridPtr_.nofVtxParam_ > 0 )\n+589 gridPtr_.vtxParam_.resize( indexSet.size( dimension ) );\n+590 gridPtr_.bndId_.resize( indexSet.size( 1 ) );\n+591 if( gridPtr_.haveBndParam_ )\n+592 gridPtr_.bndParam_.resize( gridPtr_->numBoundarySegments() );\n+593\n+594 for( const auto &element : elements( gridView, Partitions::all ) )\n+595 {\n+596 if( gridPtr_.nofElParam_ > 0 )\n+597 {\n+598 std::swap( gridPtr_.elParam_[ indexSet.index( element ) ], elData_\n+[ idSet_.id( element ) ] );\n+599 assert( gridPtr_.elParam_[ indexSet.index( element ) ].size() == static_\n+cast< std::size_t >( gridPtr_.nofElParam_ ) );\n+600 }\n+601\n+602 if( gridPtr_.nofVtxParam_ > 0 )\n+603 {\n+604 for( unsigned int v = 0; v < element.subEntities( dimension ); ++v )\n+605 {\n+606 const auto index = indexSet.subIndex( element, v, dimension );\n+607 if( gridPtr_.vtxParam_[ index ].empty() )\n+608 std::swap( gridPtr_.vtxParam_[ index ], vtxData_[ idSet_.subId( element, v,\n+dimension ) ] );\n+609 assert( gridPtr_.vtxParam_[ index ].size() == static_cast< std::size_t >\n+( gridPtr_.nofVtxParam_ ) );\n+610 }\n+611 }\n+612\n+613 if( element.hasBoundaryIntersections() )\n+614 {\n+615 for( const auto &intersection : intersections( gridView, element ) )\n+616 {\n+617 // dirty hack: check for \"none\" to make corner point grid work\n+618 if( !intersection.boundary() || intersection.type().isNone() )\n+619 continue;\n+620\n+621 const int i = intersection.indexInInside();\n+622 auto &bndData = bndData_[ idSet_.subId( element, i, 1 ) ];\n+623 gridPtr_.bndId_[ indexSet.subIndex( element, i, 1 ) ] = bndData.first;\n+624 if( gridPtr_.haveBndParam_ )\n+625 std::swap( bndData.second, gridPtr_.bndParam_\n+[ intersection.boundarySegmentIndex() ] );\n+626 }\n+627 }\n+628 }\n+629 }\n+630\n+631 CommDataHandleIF<_DataHandle,_char_> &interface () { return *this; }\n+632\n+633 bool contains ( int dim, int codim ) const\n+634 {\n+635 assert( dim == dimension );\n+636 // do not use a switch statement, because dimension == 1 is possible\n+637 return (codim == 1) || ((codim == dimension) && (gridPtr_.nofVtxParam_ >\n+0)) || ((codim == 0) && (gridPtr_.nofElParam_ > 0));\n+638 }\n+639\n+640 bool fixedSize (int /* dim */, int /* codim */) const { return false; }\n+641\n+642 template< class Entity >\n+643 std::size_t size ( const Entity &entity ) const\n+644 {\n+645 std::size_t totalSize = 0;\n+646\n+647 // do not use a switch statement, because dimension == 1 is possible\n+648 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )\n+649 {\n+650 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >\n+( gridPtr_.nofElParam_ ) );\n+651 for( double &v : elData_[ idSet_.id( entity ) ] )\n+652 totalSize += dataSize( v );\n+653 }\n+654\n+655 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )\n+656 {\n+657 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_\n+t >( gridPtr_.nofVtxParam_ ) );\n+658 for( double &v : vtxData_[ idSet_.id( entity ) ] )\n+659 totalSize += dataSize( v );\n+660 }\n+661\n+662 if( Entity::codimension == 1 )\n+663 {\n+664 const auto bndData = bndData_.find( idSet_.id( entity ) );\n+665 if( bndData != bndData_.end() )\n+666 totalSize += dataSize( bndData->second.first ) + dataSize( bndData-\n+>second.second );\n+667 }\n+668\n+669 return totalSize;\n+670 }\n+671\n+672 template< class Buffer, class Entity >\n+673 void gather ( Buffer &buffer, const Entity &entity ) const\n+674 {\n+675 // do not use a switch statement, because dimension == 1 is possible\n+676 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )\n+677 {\n+678 assert( elData_[ idSet_.id( entity ) ].size() == static_cast< std::size_t >\n+( gridPtr_.nofElParam_ ) );\n+679 for( double &v : elData_[ idSet_.id( entity ) ] )\n+680 write( buffer, v );\n+681 }\n+682\n+683 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )\n+684 {\n+685 assert( vtxData_[ idSet_.id( entity ) ].size() == static_cast< std::size_\n+t >( gridPtr_.nofVtxParam_ ) );\n+686 for( double &v : vtxData_[ idSet_.id( entity ) ] )\n+687 write( buffer, v );\n+688 }\n+689\n+690 if( Entity::codimension == 1 )\n+691 {\n+692 const auto bndData = bndData_.find( idSet_.id( entity ) );\n+693 if( bndData != bndData_.end() )\n+694 {\n+695 write( buffer, bndData->second.first );\n+696 write( buffer, bndData->second.second );\n+697 }\n+698 }\n+699 }\n+700\n+701 template< class Buffer, class Entity >\n+702 void scatter ( Buffer &buffer, const Entity &entity, std::size_t n )\n+703 {\n+704 // do not use a switch statement, because dimension == 1 is possible\n+705 if( (Entity::codimension == 0) && (gridPtr_.nofElParam_ > 0) )\n+706 {\n+707 auto &p = elData_[ idSet_.id( entity ) ];\n+708 p.resize( gridPtr_.nofElParam_ );\n+709 for( double &v : p )\n+710 read( buffer, v, n );\n+711 }\n+712\n+713 if( (Entity::codimension == dimension) && (gridPtr_.nofVtxParam_ > 0) )\n+714 {\n+715 auto &p = vtxData_[ idSet_.id( entity ) ];\n+716 p.resize( gridPtr_.nofVtxParam_ );\n+717 for( double &v : p )\n+718 read( buffer, v, n );\n+719 }\n+720\n+721 if( (Entity::codimension == 1) && (n > 0) )\n+722 {\n+723 auto &bndData = bndData_[ idSet_.id( entity ) ];\n+724 read( buffer, bndData.first, n );\n+725 read( buffer, bndData.second, n );\n+726 }\n+727\n+728 assert( n == 0 );\n+729 }\n+730\n+731 private:\n+732 template< class T >\n+733 static std::enable_if_t< std::is_trivially_copyable< T >::value, std::size_\n+t > dataSize ( const T & /* value */ )\n+734 {\n+735 return sizeof( T );\n+736 }\n+737\n+738 static std::size_t dataSize ( const std::string &s )\n+739 {\n+740 return dataSize( s.size() ) + s.size();\n+741 }\n+742\n+743 template< class Buffer, class T >\n+744 static std::enable_if_t< std::is_trivially_copyable< T >::value > write\n+( Buffer &buffer, const T &value )\n+745 {\n+746 std::array< char, sizeof( T ) > bytes;\n+747 std::memcpy( bytes.data(), &value, sizeof( T ) );\n+748 for( char &b : bytes )\n+749 buffer.write( b );\n+750 }\n+751\n+752 template< class Buffer >\n+753 static void write ( Buffer &buffer, const std::string &s )\n+754 {\n+755 write( buffer, s.size() );\n+756 for( const char &c : s )\n+757 buffer.write( c );\n+758 }\n+759\n+760 template< class Buffer, class T >\n+761 static std::enable_if_t< std::is_trivially_copyable< T >::value > read\n+( Buffer &buffer, T &value, std::size_t &n )\n+762 {\n+763 assert( n >= sizeof( T ) );\n+764 n -= sizeof( T );\n+765\n+766 std::array< char, sizeof( T ) > bytes;\n+767 for( char &b : bytes )\n+768 buffer.read( b );\n+769 std::memcpy( &value, bytes.data(), sizeof( T ) );\n+770 }\n+771\n+772 template< class Buffer >\n+773 static void read ( Buffer &buffer, std::string &s, std::size_t &n )\n+774 {\n+775 std::size_t size;\n+776 read( buffer, size, n );\n+777 s.resize( size );\n+778\n+779 assert( n >= size );\n+780 n -= size;\n+781\n+782 for( char &c : s )\n+783 buffer.read( c );\n+784 }\n+785\n+786 GridPtr &gridPtr_;\n+787 const typename GridType::LocalIdSet &idSet_;\n+788 mutable std::map< typename GridType::LocalIdSet::IdType, std::vector<\n+double > > elData_, vtxData_;\n+789 mutable std::map< typename GridType::LocalIdSet::IdType, std::pair< int,\n+DGFBoundaryParameter::type > > bndData_;\n+790 };\n+791\n+792 // grid auto pointer\n+793 mutable mygrid_ptr gridPtr_;\n+794 // element and vertex parameters\n+795 std::vector< std::vector< double > > elParam_;\n+796 std::vector< std::vector< double > > vtxParam_;\n+797 std::vector< DGFBoundaryParameter::type > bndParam_;\n+798 std::vector< int > bndId_;\n+799 std::vector< double > emptyParam_;\n+800\n+801 int nofElParam_;\n+802 int nofVtxParam_;\n+803 bool haveBndParam_;\n+804 }; // end of class GridPtr\n+805\n+806} // end namespace Dune\n+807\n+808#endif\n+gridenums.hh\n+partitionset.hh\n+datahandleif.hh\n+Describes the parallel communication interface class for MessageBuffers and\n+DataHandles.\n+rangegenerators.hh\n+gmshreader.hh\n+dgfexception.hh\n+parser.hh\n+entitykey.hh\n+Dune::ForwardCommunication\n+@ ForwardCommunication\n+communicate as given in InterfaceType\n+Definition gridenums.hh:171\n+Dune::InteriorBorder_All_Interface\n+@ InteriorBorder_All_Interface\n+send interior and border, receive all entities\n+Definition gridenums.hh:88\n+Dune::GridView::indexSet\n+const IndexSet & indexSet() const\n+obtain the index set\n+Definition common/gridview.hh:177\n+std::swap\n+void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n+> &b)\n+Definition utility/persistentcontainer.hh:83\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::renumber\n-int renumber(const Dune::GeometryType &t, int i)\n-renumber VTK <-> Dune\n-Definition common.hh:186\n-Dune::VTK::Corner\n-simple class representing a corner of a cell\n-Definition corner.hh:25\n-Dune::VTK::Corner::vtkIndex\n-unsigned vtkIndex() const\n-get the index of the corner within the cell in VTK-numbering\n-Definition corner.hh:63\n-Dune::VTK::Corner::vtkIndex\n-void vtkIndex(unsigned i)\n-set the index of the corner within the cell in VTK-numbering\n-Definition corner.hh:68\n-Dune::VTK::Corner::Corner\n-Corner(const Cell &cell, unsigned duneIndex)\n-construct a Corner\n-Definition corner.hh:38\n-Dune::VTK::Corner::cell\n-void cell(const Cell &cell__)\n-set a new cell\n-Definition corner.hh:52\n-Dune::VTK::Corner::duneIndex\n-void duneIndex(unsigned i)\n-set the index of the corner within the cell in Dune-numbering\n-Definition corner.hh:57\n-Dune::VTK::Corner::duneIndex\n-unsigned duneIndex() const\n-get the index of the corner within the cell in Dune-numbering\n-Definition corner.hh:55\n-Dune::VTK::Corner::cell\n-const Cell & cell() const\n-get reference to the cell\n-Definition corner.hh:46\n-Dune::VTK::Corner::Corner\n-Corner()\n-construct an invalid Corner\n-Definition corner.hh:43\n+Dune::Partitions::all\n+constexpr All all\n+PartitionSet for all partitions.\n+Definition partitionset.hh:295\n+Dune::Partitions::interiorBorder\n+constexpr InteriorBorder interiorBorder\n+PartitionSet for the interior and border partitions.\n+Definition partitionset.hh:286\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::boundaryId\n+int boundaryId(const Intersection &intersection) const\n+Definition dgfgridfactory.hh:102\n+Dune::DGFGridFactory::boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n+> &intersection) const\n+Definition dgfgridfactory.hh:158\n+Dune::DGFGridFactory::grid\n+Grid * grid()\n+Definition dgfgridfactory.hh:90\n+Dune::DGFGridFactory::parameter\n+std::vector< double > & parameter(const Element &element)\n+Definition dgfgridfactory.hh:124\n+Dune::DGFGridFactory::haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+Definition dgfgridfactory.hh:151\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::boundarySegmentIndex\n+size_t boundarySegmentIndex() const\n+index of the boundary segment within the macro grid\n+Definition common/intersection.hh:236\n+Dune::CommDataHandleIF\n+CommDataHandleIF describes the features of a data handle for communication in\n+parallel runs using the...\n+Definition datahandleif.hh:78\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::codimension\n+static constexpr int codimension\n+Know your own codimension.\n+Definition common/entity.hh:106\n+Dune::GridError\n+Base class for exceptions in Dune grid modules.\n+Definition exceptions.hh:20\n+Dune::GridFactoryInterface::insertionIndex\n+virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity)\n+const\n+obtain an element's insertion index\n+Definition common/gridfactory.hh:181\n+Dune::GridFactory\n+Provide a generic factory class for unstructured grids.\n+Definition common/gridfactory.hh:275\n+Dune::GridFactory::createGrid\n+virtual std::unique_ptr< GridType > createGrid()\n+Finalize grid creation and hand over the grid.\n+Definition common/gridfactory.hh:333\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n+Dune::GridPtr\n+Class for constructing grids from DGF files.\n+Definition gridptr.hh:66\n+Dune::GridPtr::GridPtr\n+GridPtr(std::istream &input, MPICommunicatorType comm=MPIHelper::\n+getCommunicator())\n+constructor given a std::istream\n+Definition gridptr.hh:199\n+Dune::GridPtr::parameters\n+const std::vector< double > & parameters(const Entity &entity) const\n+get parameters defined for each codim 0 und dim entity on the grid through the\n+grid file\n+Definition gridptr.hh:325\n+Dune::GridPtr::GridPtr\n+GridPtr()\n+Default constructor, creating empty GridPtr.\n+Definition gridptr.hh:217\n+Dune::GridPtr::operator*\n+const GridType & operator*() const\n+return const reference to GridType instance\n+Definition gridptr.hh:288\n+Dune::GridPtr::haveBndParam_\n+bool haveBndParam_\n+Definition gridptr.hh:803\n+Dune::GridPtr::dimension\n+static const int dimension\n+Definition gridptr.hh:155\n+Dune::GridPtr::bndId_\n+std::vector< int > bndId_\n+Definition gridptr.hh:798\n+Dune::GridPtr::setNofParams\n+void setNofParams(int cdim, int nofP)\n+Definition gridptr.hh:528\n+Dune::GridPtr::loadBalance\n+void loadBalance()\n+Definition gridptr.hh:369\n+Dune::GridPtr::bndParam_\n+std::vector< DGFBoundaryParameter::type > bndParam_\n+Definition gridptr.hh:797\n+Dune::GridPtr::initialize\n+void initialize(GridFactory< GridType > &factory, std::vector< int >\n+&boundaryIds, std::vector< int > &elementIds)\n+Definition gridptr.hh:456\n+Dune::GridPtr::GridPtr\n+GridPtr(GridType *grd)\n+Constructor storing given pointer to internal auto pointer.\n+Definition gridptr.hh:230\n+Dune::GridPtr::nofElParam_\n+int nofElParam_\n+Definition gridptr.hh:801\n+Dune::GridPtr::parameters\n+const DGFBoundaryParameter::type & parameters(const Intersection< GridImp,\n+IntersectionImp > &intersection) const\n+get parameters for intersection\n+Definition gridptr.hh:351\n+Dune::GridPtr::operator*\n+GridType & operator*()\n+return reference to GridType instance\n+Definition gridptr.hh:278\n+Dune::GridPtr::isEmpty\n+static bool isEmpty(Range &&range)\n+Definition gridptr.hh:381\n+Dune::GridPtr::nofParameters\n+int nofParameters(const Entity &) const\n+get parameters defined for given entity\n+Definition gridptr.hh:311\n+Dune::GridPtr::GridPtr\n+GridPtr(const std::string &filename, MPICommunicatorType comm=MPIHelper::\n+getCommunicator())\n+constructor given the name of a DGF file\n+Definition gridptr.hh:158\n+Dune::GridPtr::elParam_\n+std::vector< std::vector< double > > elParam_\n+Definition gridptr.hh:795\n+Dune::GridPtr::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition gridptr.hh:154\n+Dune::GridPtr::operator=\n+GridPtr & operator=(const GridPtr &org)\n+assignment of grid pointer\n+Definition gridptr.hh:246\n+Dune::GridPtr::nofParameters\n+int nofParameters(int cdim) const\n+get number of parameters defined for a given codimension\n+Definition gridptr.hh:301\n+Dune::GridPtr::nofParameters\n+int nofParameters(const Intersection< GridImp, IntersectionImp > &intersection)\n+const\n+get number of parameters defined for a given intersection\n+Definition gridptr.hh:318\n+Dune::GridPtr::emptyParam_\n+std::vector< double > emptyParam_\n+Definition gridptr.hh:799\n+Dune::GridPtr::gridPtr_\n+mygrid_ptr gridPtr_\n+Definition gridptr.hh:793\n+Dune::GridPtr::readGmsh\n+void readGmsh(const std::string &filename, std::integral_constant< bool, false\n+>)\n+Definition gridptr.hh:147\n+Dune::GridPtr::readGmsh\n+void readGmsh(const std::string &filename, std::integral_constant< bool, true\n+>)\n+Definition gridptr.hh:137\n+Dune::GridPtr::params\n+std::vector< double > & params(const Entity &entity)\n+Definition gridptr.hh:505\n+Dune::GridPtr::initialize\n+void initialize(DGFGridFactory< GridType > &dgfFactory)\n+Definition gridptr.hh:386\n+Dune::GridPtr::GridPtr\n+GridPtr(const GridPtr &org)=default\n+Copy constructor, copies internal auto pointer.\n+Dune::GridPtr::getFileExtension\n+std::string getFileExtension(const std::string &filename) const\n+Definition gridptr.hh:122\n+Dune::GridPtr::operator->\n+const GridType * operator->() const\n+return const pointer to GridType instance\n+Definition gridptr.hh:293\n+Dune::GridPtr::release\n+GridType * release()\n+release pointer from internal ownership\n+Definition gridptr.hh:298\n+Dune::GridPtr::communicate\n+void communicate()\n+Definition gridptr.hh:360\n+Dune::GridPtr::vtxParam_\n+std::vector< std::vector< double > > vtxParam_\n+Definition gridptr.hh:796\n+Dune::GridPtr::operator->\n+GridType * operator->()\n+return pointer to GridType instance\n+Definition gridptr.hh:283\n+Dune::GridPtr::nofVtxParam_\n+int nofVtxParam_\n+Definition gridptr.hh:802\n+Dune::GridPtr::mygrid_ptr\n+Definition gridptr.hh:68\n+Dune::GridPtr::mygrid_ptr::mygrid_ptr\n+mygrid_ptr(GridType *grd)\n+Definition gridptr.hh:99\n+Dune::GridPtr::mygrid_ptr::~mygrid_ptr\n+~mygrid_ptr()\n+Definition gridptr.hh:102\n+Dune::GridPtr::mygrid_ptr::release\n+GridType * release()\n+Definition gridptr.hh:112\n+Dune::GridPtr::mygrid_ptr::mygrid_ptr\n+mygrid_ptr(const mygrid_ptr &other)\n+Definition gridptr.hh:97\n+Dune::GridPtr::mygrid_ptr::operator=\n+mygrid_ptr & operator=(const mygrid_ptr &other)\n+Definition gridptr.hh:105\n+Dune::GridPtr::mygrid_ptr::mygrid_ptr\n+mygrid_ptr()\n+Definition gridptr.hh:95\n+Dune::GridPtr::DataHandle\n+Definition gridptr.hh:538\n+Dune::GridPtr::DataHandle::interface\n+CommDataHandleIF< DataHandle, char > & interface()\n+Definition gridptr.hh:631\n+Dune::GridPtr::DataHandle::DataHandle\n+DataHandle(const DataHandle &)=delete\n+Dune::GridPtr::DataHandle::~DataHandle\n+~DataHandle()\n+Definition gridptr.hh:581\n+Dune::GridPtr::DataHandle::DataHandle\n+DataHandle(GridPtr &gridPtr)\n+Definition gridptr.hh:539\n+Dune::GridPtr::DataHandle::gather\n+void gather(Buffer &buffer, const Entity &entity) const\n+Definition gridptr.hh:673\n+Dune::GridPtr::DataHandle::fixedSize\n+bool fixedSize(int, int) const\n+Definition gridptr.hh:640\n+Dune::GridPtr::DataHandle::size\n+std::size_t size(const Entity &entity) const\n+Definition gridptr.hh:643\n+Dune::GridPtr::DataHandle::DataHandle\n+DataHandle(DataHandle &&)=delete\n+Dune::GridPtr::DataHandle::scatter\n+void scatter(Buffer &buffer, const Entity &entity, std::size_t n)\n+Definition gridptr.hh:702\n+Dune::GridPtr::DataHandle::contains\n+bool contains(int dim, int codim) const\n+Definition gridptr.hh:633\n+Dune::DGFBoundaryParameter::defaultValue\n+static const type & defaultValue()\n+default constructor\n+Definition parser.hh:28\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+Dune::GmshReader::read\n+static std::unique_ptr< Grid > read(const std::string &fileName, bool\n+verbose=true, bool insertBoundarySegments=true)\n+Definition gmshreader.hh:937\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00941.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00941.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: functionwriter.hh File Reference\n+dune-grid: dgfexception.hh File Reference\n \n \n \n \n \n \n \n@@ -65,70 +65,39 @@\n \n \n \n \n \n \n \n
    \n \n-
    functionwriter.hh File Reference
    \n+
    dgfexception.hh File Reference
    \n
    \n
    \n-
    #include <cstddef>
    \n-#include <memory>
    \n-#include <string>
    \n-#include <typeinfo>
    \n-#include <vector>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n-#include <dune/grid/io/file/vtk/dataarraywriter.hh>
    \n-#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n-#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n+
    #include <dune/common/exceptions.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::VTK::FunctionWriterBase< Cell_ >
     Base class for function writers. More...
     
    class  Dune::VTK::VTKFunctionWriter< Func >
     Base class for function writers. More...
     
    class  Dune::VTK::CoordinatesWriter< Cell >
     writer for the Coordinates array More...
     
    class  Dune::VTK::ConformingConnectivityWriter< IteratorFactory >
     writer for the connectivity array in conforming mode More...
     
    class  Dune::VTK::NonConformingConnectivityWriter< Cell >
     writer for the connectivity array in nonconforming mode More...
     
    class  Dune::VTK::OffsetsWriter< Cell >
     writer for the offsets array More...
     
    class  Dune::VTK::TypesWriter< Cell >
     writer for the types array More...
    class  Dune::DGFException
     exception class for IO errors in the DGF parser More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,53 +2,22 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-functionwriter.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+dgfexception.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::FunctionWriterBase<_Cell__>\n-\u00a0 Base class for function writers. More...\n-\u00a0\n-class \u00a0 Dune::VTK::VTKFunctionWriter<_Func_>\n-\u00a0 Base class for function writers. More...\n-\u00a0\n-class \u00a0 Dune::VTK::CoordinatesWriter<_Cell_>\n-\u00a0 writer for the Coordinates array More...\n-\u00a0\n-class \u00a0 Dune::VTK::ConformingConnectivityWriter<_IteratorFactory_>\n-\u00a0 writer for the connectivity array in conforming mode More...\n-\u00a0\n-class \u00a0 Dune::VTK::NonConformingConnectivityWriter<_Cell_>\n-\u00a0 writer for the connectivity array in nonconforming mode More...\n-\u00a0\n-class \u00a0 Dune::VTK::OffsetsWriter<_Cell_>\n-\u00a0 writer for the offsets array More...\n-\u00a0\n-class \u00a0 Dune::VTK::TypesWriter<_Cell_>\n-\u00a0 writer for the types array More...\n+class \u00a0 Dune::DGFException\n+\u00a0 exception class for IO errors in the DGF parser More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00941_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00941_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: functionwriter.hh Source File\n+dune-grid: dgfexception.hh Source File\n \n \n \n \n \n \n \n@@ -70,479 +70,44 @@\n
    \n \n \n \n \n \n \n
    \n-
    functionwriter.hh
    \n+
    dgfexception.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH
    \n-
    8
    \n-
    9#include <cstddef>
    \n-
    10#include <memory>
    \n-
    11#include <string>
    \n-
    12#include <typeinfo>
    \n-
    13#include <vector>
    \n-
    14
    \n-
    15#include <dune/common/exceptions.hh>
    \n-
    16#include <dune/common/fvector.hh>
    \n+
    5#ifndef DUNE_GRID_DGFEXCEPTION_HH
    \n+
    6#define DUNE_GRID_DGFEXCEPTION_HH
    \n+
    7
    \n+
    8#include <dune/common/exceptions.hh>
    \n+
    9
    \n+
    10namespace Dune
    \n+
    11{
    \n+
    12
    \n+
    \n+\n+
    15 : public IOError
    \n+
    16 {};
    \n+
    \n
    17
    \n-
    18#include <dune/geometry/referenceelements.hh>
    \n+
    18}
    \n
    19
    \n-\n-\n-\n-\n-
    24
    \n-
    25namespace Dune
    \n-
    26{
    \n-
    29
    \n-
    30 namespace VTK {
    \n-
    31
    \n-
    33 template<typename Cell_>
    \n-
    \n-\n-
    35 typedef typename Cell_::Geometry::ctype DF;
    \n-
    36 static const unsigned mydim = Cell_::mydimension;
    \n-
    37 typedef ReferenceElements<DF, mydim> Refelems;
    \n-
    38
    \n-
    39 public:
    \n-
    40 typedef FieldVector<DF, mydim> Domain;
    \n-
    41 typedef Cell_ Cell;
    \n-
    42
    \n-
    44 virtual std::string name() const = 0;
    \n-
    45
    \n-
    47 virtual unsigned ncomps() const = 0;
    \n-
    48
    \n-
    50 virtual void addArray(PVTUWriter& writer) = 0;
    \n-
    52 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) = 0;
    \n-
    54
    \n-
    \n-
    59 virtual void write(const Cell& /* cell */, const Domain& /* xl */) {
    \n-
    60 DUNE_THROW(NotImplemented, "FunctionWriterBase::write(const Cell&, "
    \n-
    61 "const Domain&): Either the derived class " <<
    \n-
    62 typeid(*this).name() << " failed to implement this method "
    \n-
    63 "or this method is not meant to be called on the derived "
    \n-
    64 "class and was called in error.");
    \n-
    65 }
    \n-
    \n-
    67
    \n-
    \n-
    71 virtual void write(const Cell& cell, unsigned cornerIndex) {
    \n-
    72 write(cell,
    \n-
    73 Refelems::general(cell.type()).position(cornerIndex, mydim));
    \n-
    74 }
    \n-
    \n-
    76 virtual void endWrite() = 0;
    \n-\n-
    79 };
    \n-
    \n-
    80
    \n-
    82 //
    \n-
    83 // A Generic Function writer for VTKFunctions
    \n-
    84 //
    \n-
    85
    \n-
    87 template<typename Func>
    \n-
    \n-\n-
    89 : public FunctionWriterBase<typename Func::Entity>
    \n-
    90 {
    \n-\n-
    92 std::shared_ptr<const Func> func;
    \n-
    93 VTK::Precision precision_;
    \n-
    94 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    95
    \n-
    96 public:
    \n-
    \n-
    97 VTKFunctionWriter(const std::shared_ptr<const Func>& func_,
    \n-\n-
    99 : func(func_), precision_(prec)
    \n-
    100 { }
    \n-
    \n-
    101
    \n-
    103 virtual std::string name() const { return func->name(); }
    \n-
    104
    \n-
    \n-
    106 virtual unsigned ncomps() const {
    \n-
    107 if(func->ncomps() == 2) return 3;
    \n-
    108 else return func->ncomps();
    \n-
    109 }
    \n-
    \n-
    110
    \n-
    \n-
    112 virtual void addArray(PVTUWriter& writer) {
    \n-
    113 writer.addArray(name(), ncomps(), precision_);
    \n-
    114 }
    \n-
    \n-
    115
    \n-
    \n-
    117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n-
    119 nitems, precision_));
    \n-
    120 return !arraywriter->writeIsNoop();
    \n-
    121 }
    \n-
    \n-
    122
    \n-
    \n-
    124 virtual void write(const typename Base::Cell& cell,
    \n-
    125 const typename Base::Domain& xl) {
    \n-
    126 for(int d = 0; d < func->ncomps(); ++d)
    \n-
    127 arraywriter->write(func->evaluate(d, cell, xl));
    \n-
    128 for(unsigned d = func->ncomps(); d < ncomps(); ++d)
    \n-
    129 arraywriter->write(0);
    \n-
    130 }
    \n-
    \n-
    131
    \n-
    \n-
    133 virtual void endWrite() {
    \n-
    134 arraywriter.reset();
    \n-
    135 }
    \n-
    \n-
    136 };
    \n-
    \n-
    137
    \n-
    139 //
    \n-
    140 // Writers for the grid information
    \n-
    141 //
    \n-
    142
    \n-
    144 template<typename Cell>
    \n-
    \n-\n-
    146 : public FunctionWriterBase<Cell>
    \n-
    147 {
    \n-\n-
    149
    \n-
    150 VTK::Precision precision_;
    \n-
    151 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    152
    \n-
    153 public:
    \n-
    \n-\n-
    155 : precision_(prec)
    \n-
    156 {}
    \n-
    \n-
    157
    \n-
    159 virtual std::string name() const { return "Coordinates"; }
    \n-
    160
    \n-
    162 virtual unsigned ncomps() const { return 3; }
    \n-
    163
    \n-
    \n-
    165 virtual void addArray(PVTUWriter& writer) {
    \n-
    166 writer.addArray(name(), ncomps(), precision_);
    \n-
    167 }
    \n-
    \n-
    168
    \n-
    \n-
    170 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    171 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n-
    172 nitems, precision_));
    \n-
    173 return !arraywriter->writeIsNoop();
    \n-
    174 }
    \n-
    \n-
    \n-
    176 virtual void write(const typename Base::Cell& cell,
    \n-
    177 const typename Base::Domain& xl) {
    \n-
    178 FieldVector<typename Base::Cell::Geometry::ctype, Base::Cell::Geometry::coorddimension> xg
    \n-
    179 = cell.geometry().global(xl);
    \n-
    180 for(unsigned d = 0; d < 3 && d < Base::Cell::Geometry::coorddimension; ++d)
    \n-
    181 arraywriter->write(xg[d]);
    \n-
    182 for(unsigned d = Base::Cell::Geometry::coorddimension; d < 3; ++d)
    \n-
    183 arraywriter->write(0);
    \n-
    184 }
    \n-
    \n-
    \n-
    186 virtual void endWrite() {
    \n-
    187 arraywriter.reset();
    \n-
    188 }
    \n-
    \n-
    189 };
    \n-
    \n-
    190
    \n-
    192 template<typename IteratorFactory>
    \n-
    \n-\n-
    194 : public FunctionWriterBase<typename IteratorFactory::Cell>
    \n-
    195 {
    \n-\n-
    197 static const unsigned mydim = Base::Cell::mydimension;
    \n-
    198
    \n-
    199 const IteratorFactory& factory;
    \n-
    200 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    201 std::vector<unsigned> pointIndices;
    \n-
    202
    \n-
    203 public:
    \n-
    \n-
    205 ConformingConnectivityWriter(const IteratorFactory& factory_)
    \n-
    206 : factory(factory_)
    \n-
    207 { }
    \n-
    \n-
    208
    \n-
    210 virtual std::string name() const { return "connectivity"; }
    \n-
    211
    \n-
    213 virtual unsigned ncomps() const { return 1; }
    \n-
    214
    \n-
    \n-
    216 virtual void addArray(PVTUWriter& writer) {
    \n-
    217 writer.addArray(name(), ncomps(), Precision::int32);
    \n-
    218 }
    \n-
    \n-
    219
    \n-
    \n-
    221 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    222 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n-
    223 nitems, Precision::int32));
    \n-
    224 if(arraywriter->writeIsNoop())
    \n-
    225 return false;
    \n-
    226
    \n-
    228 pointIndices.resize(factory.indexSet().size(mydim));
    \n-
    229 const typename IteratorFactory::PointIterator& pend =
    \n-
    230 factory.endPoints();
    \n-
    231 typename IteratorFactory::PointIterator pit = factory.beginPoints();
    \n-
    232 unsigned counter = 0;
    \n-
    233 while(pit != pend) {
    \n-
    234 pointIndices[factory.indexSet().subIndex
    \n-
    235 (pit->cell(), pit->duneIndex(), mydim)] = counter;
    \n-
    236 ++counter;
    \n-
    237 ++pit;
    \n-
    238 }
    \n-
    239 return true;
    \n-
    240 }
    \n-
    \n-
    \n-
    242 virtual void write(const typename Base::Cell& cell, unsigned cornerIndex)
    \n-
    243 {
    \n-
    244 // if pointIndices is empty, we're in writeIsNoop mode
    \n-
    245 if(pointIndices.size() == 0)
    \n-
    246 return;
    \n-
    247 arraywriter->write(pointIndices[factory.indexSet().subIndex
    \n-
    248 (cell, cornerIndex, mydim)]);
    \n-
    249 }
    \n-
    \n-
    \n-
    251 virtual void endWrite() {
    \n-
    252 arraywriter.reset();
    \n-
    253 pointIndices.clear();
    \n-
    254 }
    \n-
    \n-
    255 };
    \n-
    \n-
    256
    \n-
    258 template<typename Cell>
    \n-
    \n-\n-
    260 : public FunctionWriterBase<Cell>
    \n-
    261 {
    \n-
    262 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    263 unsigned counter;
    \n-
    264
    \n-
    265 public:
    \n-
    267 virtual std::string name() const { return "connectivity"; }
    \n-
    268
    \n-
    270 virtual unsigned ncomps() const { return 1; }
    \n-
    271
    \n-
    \n-
    273 virtual void addArray(PVTUWriter& writer) {
    \n-
    274 writer.addArray(name(), ncomps(), Precision::int32);
    \n-
    275 }
    \n-
    \n-
    276
    \n-
    \n-
    278 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    279 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n-
    280 nitems, Precision::int32));
    \n-
    281 counter = 0;
    \n-
    282 return !arraywriter->writeIsNoop();
    \n-
    283 }
    \n-
    \n-
    \n-
    285 virtual void write(const Cell& /* cell */, unsigned /* cornerIndex */)
    \n-
    286 {
    \n-
    287 arraywriter->write(counter);
    \n-
    288 ++counter;
    \n-
    289 }
    \n-
    \n-
    \n-
    291 virtual void endWrite() {
    \n-
    292 arraywriter.reset();
    \n-
    293 }
    \n-
    \n-
    294 };
    \n-
    \n-
    295
    \n-
    297 template<typename Cell>
    \n-
    \n-\n-
    299 : public FunctionWriterBase<Cell>
    \n-
    300 {
    \n-\n-
    302
    \n-
    303 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    304 unsigned offset;
    \n-
    305
    \n-
    306 public:
    \n-
    308 virtual std::string name() const { return "offsets"; }
    \n-
    309
    \n-
    311 virtual unsigned ncomps() const { return 1; }
    \n-
    312
    \n-
    \n-
    314 virtual void addArray(PVTUWriter& writer) {
    \n-
    315 writer.addArray(name(), ncomps(), Precision::int32);
    \n-
    316 }
    \n-
    \n-
    317
    \n-
    \n-
    319 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    320 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n-
    321 nitems, Precision::int32));
    \n-
    322 offset = 0;
    \n-
    323 return !arraywriter->writeIsNoop();
    \n-
    324 }
    \n-
    \n-
    \n-
    326 virtual void write(const Cell& cell, const typename Base::Domain&) {
    \n-
    327 offset += cell.geometry().corners();
    \n-
    328 arraywriter->write(offset);
    \n-
    329 }
    \n-
    \n-
    \n-
    331 virtual void endWrite() {
    \n-
    332 arraywriter.reset();
    \n-
    333 }
    \n-
    \n-
    334 };
    \n-
    \n-
    335
    \n-
    337 template<typename Cell>
    \n-
    \n-\n-
    339 : public FunctionWriterBase<Cell>
    \n-
    340 {
    \n-\n-
    342
    \n-
    343 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    344
    \n-
    345 public:
    \n-
    347 virtual std::string name() const { return "types"; }
    \n-
    348
    \n-
    350 virtual unsigned ncomps() const { return 1; }
    \n-
    351
    \n-
    \n-
    353 virtual void addArray(PVTUWriter& writer) {
    \n-
    354 writer.addArray(name(), ncomps(), Precision::uint8);
    \n-
    355 }
    \n-
    \n-
    356
    \n-
    \n-
    358 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    359 arraywriter.reset(writer.makeArrayWriter
    \n-
    360 ( name(), ncomps(), nitems, Precision::uint8));
    \n-
    361 return !arraywriter->writeIsNoop();
    \n-
    362 }
    \n-
    \n-
    \n-
    364 virtual void write(const Cell& cell, const typename Base::Domain&) {
    \n-
    365 arraywriter->write(geometryType(cell.type()));
    \n-
    366 }
    \n-
    \n-
    \n-
    368 virtual void endWrite() {
    \n-
    369 arraywriter.reset();
    \n-
    370 }
    \n-
    \n-
    371 };
    \n-
    \n-
    372
    \n-
    373 } // namespace VTK
    \n-
    374
    \n-
    376
    \n-
    377} // namespace Dune
    \n-
    378
    \n-
    379#endif // DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH
    \n-\n-
    Common stuff for the VTKWriter.
    \n-
    Data array writers for the VTKWriter.
    \n-\n+
    20#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-\n-\n-
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n-
    Base class for function writers.
    Definition functionwriter.hh:34
    \n-
    virtual std::string name() const =0
    return name
    \n-
    virtual unsigned ncomps() const =0
    return number of components of the vector
    \n-
    virtual void write(const Cell &, const Domain &)
    write at the given position
    Definition functionwriter.hh:59
    \n-
    Cell_ Cell
    Definition functionwriter.hh:41
    \n-
    virtual void addArray(PVTUWriter &writer)=0
    add this field to the given parallel writer
    \n-
    virtual void endWrite()=0
    signal end of writing
    \n-
    FieldVector< DF, mydim > Domain
    Definition functionwriter.hh:40
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0
    start writing with the given writer
    \n-
    virtual ~FunctionWriterBase()
    destructor
    Definition functionwriter.hh:78
    \n-
    virtual void write(const Cell &cell, unsigned cornerIndex)
    write at the given corner
    Definition functionwriter.hh:71
    \n-
    Base class for function writers.
    Definition functionwriter.hh:90
    \n-
    VTKFunctionWriter(const std::shared_ptr< const Func > &func_, VTK::Precision prec=VTK::Precision::float32)
    Definition functionwriter.hh:97
    \n-
    virtual std::string name() const
    return name
    Definition functionwriter.hh:103
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:106
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:117
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:112
    \n-
    virtual void write(const typename Base::Cell &cell, const typename Base::Domain &xl)
    write at the given position
    Definition functionwriter.hh:124
    \n-
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:133
    \n-
    writer for the Coordinates array
    Definition functionwriter.hh:147
    \n-
    virtual void write(const typename Base::Cell &cell, const typename Base::Domain &xl)
    write at the given position
    Definition functionwriter.hh:176
    \n-
    virtual std::string name() const
    return name
    Definition functionwriter.hh:159
    \n-
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:186
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:162
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:165
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:170
    \n-
    CoordinatesWriter(VTK::Precision prec=VTK::Precision::float32)
    Definition functionwriter.hh:154
    \n-
    writer for the connectivity array in conforming mode
    Definition functionwriter.hh:195
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:216
    \n-
    virtual std::string name() const
    return name
    Definition functionwriter.hh:210
    \n-
    virtual void write(const typename Base::Cell &cell, unsigned cornerIndex)
    write at the given corner
    Definition functionwriter.hh:242
    \n-
    ConformingConnectivityWriter(const IteratorFactory &factory_)
    create a writer with the given iteratorfactory
    Definition functionwriter.hh:205
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:213
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:221
    \n-
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:251
    \n-
    writer for the connectivity array in nonconforming mode
    Definition functionwriter.hh:261
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:270
    \n-
    virtual std::string name() const
    return name
    Definition functionwriter.hh:267
    \n-
    virtual void write(const Cell &, unsigned)
    write at the given corner
    Definition functionwriter.hh:285
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:273
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:278
    \n-
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:291
    \n-
    writer for the offsets array
    Definition functionwriter.hh:300
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:314
    \n-
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:331
    \n-
    virtual std::string name() const
    return name
    Definition functionwriter.hh:308
    \n-
    virtual void write(const Cell &cell, const typename Base::Domain &)
    write at the given position
    Definition functionwriter.hh:326
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:319
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:311
    \n-
    writer for the types array
    Definition functionwriter.hh:340
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition functionwriter.hh:350
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition functionwriter.hh:358
    \n-
    virtual std::string name() const
    return name
    Definition functionwriter.hh:347
    \n-
    virtual void write(const Cell &cell, const typename Base::Domain &)
    write at the given position
    Definition functionwriter.hh:364
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:353
    \n-
    virtual void endWrite()
    signal end of writing
    Definition functionwriter.hh:368
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n-
    void addArray(const std::string &name, unsigned ncomps, Precision prec)
    Add an array to the output file.
    Definition pvtuwriter.hh:207
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n-
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,577 +2,38 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-functionwriter.hh\n+ * dgfparser\n+dgfexception.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14\n-15#include \n-16#include \n+5#ifndef DUNE_GRID_DGFEXCEPTION_HH\n+6#define DUNE_GRID_DGFEXCEPTION_HH\n+7\n+8#include \n+9\n+10namespace Dune\n+11{\n+12\n+14 class DGFException\n+15 : public IOError\n+16 {};\n 17\n-18#include \n+18}\n 19\n-20#include \n-21#include \n-22#include \n-23#include \n-24\n-25namespace Dune\n-26{\n-29\n-30 namespace VTK {\n-31\n-33 template\n-34 class FunctionWriterBase {\n-35 typedef typename Cell_::Geometry::ctype DF;\n-36 static const unsigned mydim = Cell_::mydimension;\n-37 typedef ReferenceElements Refelems;\n-38\n-39 public:\n-40 typedef FieldVector Domain;\n-41 typedef Cell_ Cell;\n-42\n-44 virtual std::string name() const = 0;\n-45\n-47 virtual unsigned ncomps() const = 0;\n-48\n-50 virtual void addArray(PVTUWriter& writer) = 0;\n-52 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) = 0;\n-54\n-59 virtual void write(const Cell& /* cell */, const Domain& /* xl */) {\n-60 DUNE_THROW(NotImplemented, \"FunctionWriterBase::write(const Cell&, \"\n-61 \"const Domain&): Either the derived class \" <<\n-62 typeid(*this).name() << \" failed to implement this method \"\n-63 \"or this method is not meant to be called on the derived \"\n-64 \"class and was called in error.\");\n-65 }\n-67\n-71 virtual void write(const Cell& cell, unsigned cornerIndex) {\n-72 write(cell,\n-73 Refelems::general(cell.type()).position(cornerIndex, mydim));\n-74 }\n-76 virtual void endWrite() = 0;\n-78 virtual ~FunctionWriterBase() {}\n-79 };\n-80\n-82 //\n-83 // A Generic Function writer for VTKFunctions\n-84 //\n-85\n-87 template\n-88 class VTKFunctionWriter\n-89 : public FunctionWriterBase\n-90 {\n-91 typedef FunctionWriterBase Base;\n-92 std::shared_ptr func;\n-93 VTK::Precision precision_;\n-94 std::shared_ptr arraywriter;\n-95\n-96 public:\n-97 VTKFunctionWriter(const std::shared_ptr& func_,\n-98 VTK::Precision prec = VTK::Precision::float32)\n-99 : func(func_), precision_(prec)\n-100 { }\n-101\n-103 virtual std::string name() const { return func->name(); }\n-104\n-106 virtual unsigned ncomps() const {\n-107 if(func->ncomps() == 2) return 3;\n-108 else return func->ncomps();\n-109 }\n-110\n-112 virtual void addArray(PVTUWriter& writer) {\n-113 writer.addArray(name(), ncomps(), precision_);\n-114 }\n-115\n-117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n-119 nitems, precision_));\n-120 return !arraywriter->writeIsNoop();\n-121 }\n-122\n-124 virtual void write(const typename Base::Cell& cell,\n-125 const typename Base::Domain& xl) {\n-126 for(int d = 0; d < func->ncomps(); ++d)\n-127 arraywriter->write(func->evaluate(d, cell, xl));\n-128 for(unsigned d = func->ncomps(); d < ncomps(); ++d)\n-129 arraywriter->write(0);\n-130 }\n-131\n-133 virtual void endWrite() {\n-134 arraywriter.reset();\n-135 }\n-136 };\n-137\n-139 //\n-140 // Writers for the grid information\n-141 //\n-142\n-144 template\n-145 class CoordinatesWriter\n-146 : public FunctionWriterBase\n-147 {\n-148 typedef FunctionWriterBase Base;\n-149\n-150 VTK::Precision precision_;\n-151 std::shared_ptr arraywriter;\n-152\n-153 public:\n-154 explicit CoordinatesWriter(VTK::Precision prec = VTK::Precision::float32)\n-155 : precision_(prec)\n-156 {}\n-157\n-159 virtual std::string name() const { return \"Coordinates\"; }\n-160\n-162 virtual unsigned ncomps() const { return 3; }\n-163\n-165 virtual void addArray(PVTUWriter& writer) {\n-166 writer.addArray(name(), ncomps(), precision_);\n-167 }\n-168\n-170 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-171 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n-172 nitems, precision_));\n-173 return !arraywriter->writeIsNoop();\n-174 }\n-176 virtual void write(const typename Base::Cell& cell,\n-177 const typename Base::Domain& xl) {\n-178 FieldVector xg\n-179 = cell.geometry().global(xl);\n-180 for(unsigned d = 0; d < 3 && d < Base::Cell::Geometry::coorddimension; ++d)\n-181 arraywriter->write(xg[d]);\n-182 for(unsigned d = Base::Cell::Geometry::coorddimension; d < 3; ++d)\n-183 arraywriter->write(0);\n-184 }\n-186 virtual void endWrite() {\n-187 arraywriter.reset();\n-188 }\n-189 };\n-190\n-192 template\n-193 class ConformingConnectivityWriter\n-194 : public FunctionWriterBase\n-195 {\n-196 typedef FunctionWriterBase Base;\n-197 static const unsigned mydim = Base::Cell::mydimension;\n-198\n-199 const IteratorFactory& factory;\n-200 std::shared_ptr arraywriter;\n-201 std::vector pointIndices;\n-202\n-203 public:\n-205 ConformingConnectivityWriter(const IteratorFactory& factory_)\n-206 : factory(factory_)\n-207 { }\n-208\n-210 virtual std::string name() const { return \"connectivity\"; }\n-211\n-213 virtual unsigned ncomps() const { return 1; }\n-214\n-216 virtual void addArray(PVTUWriter& writer) {\n-217 writer.addArray(name(), ncomps(), Precision::int32);\n-218 }\n-219\n-221 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-222 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n-223 nitems, Precision::int32));\n-224 if(arraywriter->writeIsNoop())\n-225 return false;\n-226\n-228 pointIndices.resize(factory.indexSet().size(mydim));\n-229 const typename IteratorFactory::PointIterator& pend =\n-230 factory.endPoints();\n-231 typename IteratorFactory::PointIterator pit = factory.beginPoints();\n-232 unsigned counter = 0;\n-233 while(pit != pend) {\n-234 pointIndices[factory.indexSet().subIndex\n-235 (pit->cell(), pit->duneIndex(), mydim)] = counter;\n-236 ++counter;\n-237 ++pit;\n-238 }\n-239 return true;\n-240 }\n-242 virtual void write(const typename Base::Cell& cell, unsigned cornerIndex)\n-243 {\n-244 // if pointIndices is empty, we're in writeIsNoop mode\n-245 if(pointIndices.size() == 0)\n-246 return;\n-247 arraywriter->write(pointIndices[factory.indexSet().subIndex\n-248 (cell, cornerIndex, mydim)]);\n-249 }\n-251 virtual void endWrite() {\n-252 arraywriter.reset();\n-253 pointIndices.clear();\n-254 }\n-255 };\n-256\n-258 template\n-259 class NonConformingConnectivityWriter\n-260 : public FunctionWriterBase\n-261 {\n-262 std::shared_ptr arraywriter;\n-263 unsigned counter;\n-264\n-265 public:\n-267 virtual std::string name() const { return \"connectivity\"; }\n-268\n-270 virtual unsigned ncomps() const { return 1; }\n-271\n-273 virtual void addArray(PVTUWriter& writer) {\n-274 writer.addArray(name(), ncomps(), Precision::int32);\n-275 }\n-276\n-278 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-279 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n-280 nitems, Precision::int32));\n-281 counter = 0;\n-282 return !arraywriter->writeIsNoop();\n-283 }\n-285 virtual void write(const Cell& /* cell */, unsigned /* cornerIndex */)\n-286 {\n-287 arraywriter->write(counter);\n-288 ++counter;\n-289 }\n-291 virtual void endWrite() {\n-292 arraywriter.reset();\n-293 }\n-294 };\n-295\n-297 template\n-298 class OffsetsWriter\n-299 : public FunctionWriterBase\n-300 {\n-301 typedef FunctionWriterBase Base;\n-302\n-303 std::shared_ptr arraywriter;\n-304 unsigned offset;\n-305\n-306 public:\n-308 virtual std::string name() const { return \"offsets\"; }\n-309\n-311 virtual unsigned ncomps() const { return 1; }\n-312\n-314 virtual void addArray(PVTUWriter& writer) {\n-315 writer.addArray(name(), ncomps(), Precision::int32);\n-316 }\n-317\n-319 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-320 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n-321 nitems, Precision::int32));\n-322 offset = 0;\n-323 return !arraywriter->writeIsNoop();\n-324 }\n-326 virtual void write(const Cell& cell, const typename Base::Domain&) {\n-327 offset += cell.geometry().corners();\n-328 arraywriter->write(offset);\n-329 }\n-331 virtual void endWrite() {\n-332 arraywriter.reset();\n-333 }\n-334 };\n-335\n-337 template\n-338 class TypesWriter\n-339 : public FunctionWriterBase\n-340 {\n-341 typedef FunctionWriterBase Base;\n-342\n-343 std::shared_ptr arraywriter;\n-344\n-345 public:\n-347 virtual std::string name() const { return \"types\"; }\n-348\n-350 virtual unsigned ncomps() const { return 1; }\n-351\n-353 virtual void addArray(PVTUWriter& writer) {\n-354 writer.addArray(name(), ncomps(), Precision::uint8);\n-355 }\n-356\n-358 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-359 arraywriter.reset(writer.makeArrayWriter\n-360 ( name(), ncomps(), nitems, Precision::uint8));\n-361 return !arraywriter->writeIsNoop();\n-362 }\n-364 virtual void write(const Cell& cell, const typename Base::Domain&) {\n-365 arraywriter->write(geometryType(cell.type()));\n-366 }\n-368 virtual void endWrite() {\n-369 arraywriter.reset();\n-370 }\n-371 };\n-372\n-373 } // namespace VTK\n-374\n-376\n-377} // namespace Dune\n-378\n-379#endif // DUNE_GRID_IO_FILE_VTK_FUNCTIONWRITER_HH\n-vtuwriter.hh\n-common.hh\n-Common stuff for the VTKWriter.\n-dataarraywriter.hh\n-Data array writers for the VTKWriter.\n-pvtuwriter.hh\n+20#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::int32\n-@ int32\n-Dune::VTK::Precision::uint8\n-@ uint8\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::VTK::geometryType\n-GeometryType geometryType(const Dune::GeometryType &t)\n-mapping from GeometryType to VTKGeometryType\n-Definition common.hh:151\n-Dune::VTK::FunctionWriterBase\n-Base class for function writers.\n-Definition functionwriter.hh:34\n-Dune::VTK::FunctionWriterBase::name\n-virtual std::string name() const =0\n-return name\n-Dune::VTK::FunctionWriterBase::ncomps\n-virtual unsigned ncomps() const =0\n-return number of components of the vector\n-Dune::VTK::FunctionWriterBase::write\n-virtual void write(const Cell &, const Domain &)\n-write at the given position\n-Definition functionwriter.hh:59\n-Dune::VTK::FunctionWriterBase::Cell\n-Cell_ Cell\n-Definition functionwriter.hh:41\n-Dune::VTK::FunctionWriterBase::addArray\n-virtual void addArray(PVTUWriter &writer)=0\n-add this field to the given parallel writer\n-Dune::VTK::FunctionWriterBase::endWrite\n-virtual void endWrite()=0\n-signal end of writing\n-Dune::VTK::FunctionWriterBase::Domain\n-FieldVector< DF, mydim > Domain\n-Definition functionwriter.hh:40\n-Dune::VTK::FunctionWriterBase::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0\n-start writing with the given writer\n-Dune::VTK::FunctionWriterBase::~FunctionWriterBase\n-virtual ~FunctionWriterBase()\n-destructor\n-Definition functionwriter.hh:78\n-Dune::VTK::FunctionWriterBase::write\n-virtual void write(const Cell &cell, unsigned cornerIndex)\n-write at the given corner\n-Definition functionwriter.hh:71\n-Dune::VTK::VTKFunctionWriter\n-Base class for function writers.\n-Definition functionwriter.hh:90\n-Dune::VTK::VTKFunctionWriter::VTKFunctionWriter\n-VTKFunctionWriter(const std::shared_ptr< const Func > &func_, VTK::Precision\n-prec=VTK::Precision::float32)\n-Definition functionwriter.hh:97\n-Dune::VTK::VTKFunctionWriter::name\n-virtual std::string name() const\n-return name\n-Definition functionwriter.hh:103\n-Dune::VTK::VTKFunctionWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition functionwriter.hh:106\n-Dune::VTK::VTKFunctionWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition functionwriter.hh:117\n-Dune::VTK::VTKFunctionWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:112\n-Dune::VTK::VTKFunctionWriter::write\n-virtual void write(const typename Base::Cell &cell, const typename Base::Domain\n-&xl)\n-write at the given position\n-Definition functionwriter.hh:124\n-Dune::VTK::VTKFunctionWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition functionwriter.hh:133\n-Dune::VTK::CoordinatesWriter\n-writer for the Coordinates array\n-Definition functionwriter.hh:147\n-Dune::VTK::CoordinatesWriter::write\n-virtual void write(const typename Base::Cell &cell, const typename Base::Domain\n-&xl)\n-write at the given position\n-Definition functionwriter.hh:176\n-Dune::VTK::CoordinatesWriter::name\n-virtual std::string name() const\n-return name\n-Definition functionwriter.hh:159\n-Dune::VTK::CoordinatesWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition functionwriter.hh:186\n-Dune::VTK::CoordinatesWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition functionwriter.hh:162\n-Dune::VTK::CoordinatesWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:165\n-Dune::VTK::CoordinatesWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition functionwriter.hh:170\n-Dune::VTK::CoordinatesWriter::CoordinatesWriter\n-CoordinatesWriter(VTK::Precision prec=VTK::Precision::float32)\n-Definition functionwriter.hh:154\n-Dune::VTK::ConformingConnectivityWriter\n-writer for the connectivity array in conforming mode\n-Definition functionwriter.hh:195\n-Dune::VTK::ConformingConnectivityWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:216\n-Dune::VTK::ConformingConnectivityWriter::name\n-virtual std::string name() const\n-return name\n-Definition functionwriter.hh:210\n-Dune::VTK::ConformingConnectivityWriter::write\n-virtual void write(const typename Base::Cell &cell, unsigned cornerIndex)\n-write at the given corner\n-Definition functionwriter.hh:242\n-Dune::VTK::ConformingConnectivityWriter::ConformingConnectivityWriter\n-ConformingConnectivityWriter(const IteratorFactory &factory_)\n-create a writer with the given iteratorfactory\n-Definition functionwriter.hh:205\n-Dune::VTK::ConformingConnectivityWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition functionwriter.hh:213\n-Dune::VTK::ConformingConnectivityWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition functionwriter.hh:221\n-Dune::VTK::ConformingConnectivityWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition functionwriter.hh:251\n-Dune::VTK::NonConformingConnectivityWriter\n-writer for the connectivity array in nonconforming mode\n-Definition functionwriter.hh:261\n-Dune::VTK::NonConformingConnectivityWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition functionwriter.hh:270\n-Dune::VTK::NonConformingConnectivityWriter::name\n-virtual std::string name() const\n-return name\n-Definition functionwriter.hh:267\n-Dune::VTK::NonConformingConnectivityWriter::write\n-virtual void write(const Cell &, unsigned)\n-write at the given corner\n-Definition functionwriter.hh:285\n-Dune::VTK::NonConformingConnectivityWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:273\n-Dune::VTK::NonConformingConnectivityWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition functionwriter.hh:278\n-Dune::VTK::NonConformingConnectivityWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition functionwriter.hh:291\n-Dune::VTK::OffsetsWriter\n-writer for the offsets array\n-Definition functionwriter.hh:300\n-Dune::VTK::OffsetsWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:314\n-Dune::VTK::OffsetsWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition functionwriter.hh:331\n-Dune::VTK::OffsetsWriter::name\n-virtual std::string name() const\n-return name\n-Definition functionwriter.hh:308\n-Dune::VTK::OffsetsWriter::write\n-virtual void write(const Cell &cell, const typename Base::Domain &)\n-write at the given position\n-Definition functionwriter.hh:326\n-Dune::VTK::OffsetsWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition functionwriter.hh:319\n-Dune::VTK::OffsetsWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition functionwriter.hh:311\n-Dune::VTK::TypesWriter\n-writer for the types array\n-Definition functionwriter.hh:340\n-Dune::VTK::TypesWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition functionwriter.hh:350\n-Dune::VTK::TypesWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition functionwriter.hh:358\n-Dune::VTK::TypesWriter::name\n-virtual std::string name() const\n-return name\n-Definition functionwriter.hh:347\n-Dune::VTK::TypesWriter::write\n-virtual void write(const Cell &cell, const typename Base::Domain &)\n-write at the given position\n-Definition functionwriter.hh:364\n-Dune::VTK::TypesWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:353\n-Dune::VTK::TypesWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition functionwriter.hh:368\n-Dune::VTK::PVTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition pvtuwriter.hh:62\n-Dune::VTK::PVTUWriter::addArray\n-void addArray(const std::string &name, unsigned ncomps, Precision prec)\n-Add an array to the output file.\n-Definition pvtuwriter.hh:207\n-Dune::VTK::VTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition vtuwriter.hh:98\n-Dune::VTK::VTUWriter::makeArrayWriter\n-DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n-unsigned nitems, Precision prec)\n-acquire a DataArrayWriter\n-Definition vtuwriter.hh:380\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00944.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00944.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: pointiterator.hh File Reference\n+dune-grid: parser.hh File Reference\n \n \n \n \n \n \n \n@@ -65,46 +65,46 @@\n \n \n \n \n \n \n \n
    \n \n-
    pointiterator.hh File Reference
    \n+
    parser.hh File Reference
    \n
    \n
    \n-
    #include <iterator>
    \n+
    #include <iostream>
    \n+#include <string>
    \n #include <vector>
    \n-#include <dune/common/iteratorfacades.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/grid/io/file/vtk/corner.hh>
    \n-#include <dune/grid/io/file/vtk/corneriterator.hh>
    \n+#include <map>
    \n+#include <dune/grid/io/file/dgfparser/entitykey.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::VTK::PointIterator< CellIterator, IS >
     iterate over the points of some corner range More...
    struct  Dune::DGFBoundaryParameter
     Contains types for additional features. More...
     
    class  Dune::DuneGridFormatParser
     The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,30 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-pointiterator.hh File Reference\n-#include \n+parser.hh File Reference\n+#include \n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::PointIterator<_CellIterator,_IS_>\n-\u00a0 iterate over the points of some corner range More...\n+struct \u00a0 Dune::DGFBoundaryParameter\n+\u00a0 Contains types for additional features. More...\n+\u00a0\n+ class \u00a0 Dune::DuneGridFormatParser\n+\u00a0 The DuneGridFormatParser class: reads a DGF file and stores build\n+ information in vector structures used by the MacroGrid class. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00944_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00944_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: pointiterator.hh Source File\n+dune-grid: parser.hh Source File\n \n \n \n \n \n \n \n@@ -70,151 +70,230 @@\n
    \n \n \n \n \n \n \n
    \n-
    pointiterator.hh
    \n+
    parser.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH
    \n-
    8
    \n-
    9#include <iterator>
    \n+
    5#ifndef DUNE_DGF_DUNEGRIDFORMATPARSER_HH
    \n+
    6#define DUNE_DGF_DUNEGRIDFORMATPARSER_HH
    \n+
    7
    \n+
    8#include <iostream>
    \n+
    9#include <string>
    \n
    10#include <vector>
    \n-
    11
    \n-
    12#include <dune/common/iteratorfacades.hh>
    \n-
    13#include <dune/common/typetraits.hh>
    \n+
    11#include <map>
    \n+
    12
    \n+\n
    14
    \n-\n-\n+
    15namespace Dune
    \n+
    16{
    \n
    17
    \n-
    18namespace Dune
    \n-
    19{
    \n-
    22
    \n-
    23 namespace VTK {
    \n-
    24
    \n+
    18 class DGFPrintInfo;
    \n+
    19
    \n+
    \n+\n+
    23 {
    \n+
    25 typedef std::string type;
    \n
    26
    \n-
    49 template<typename CellIterator, typename IS>
    \n-
    \n-\n-
    51 : public ForwardIteratorFacade
    \n-
    52 < PointIterator<CellIterator, IS>,
    \n-
    53 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n-
    54 CellIterator>::value_type>::type>,
    \n-
    55 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n-
    56 CellIterator>::value_type>::type>&,
    \n-
    57 typename std::iterator_traits<CellIterator>::difference_type>
    \n-
    58 {
    \n-
    59 public:
    \n-
    60 typedef VTK::Corner<typename std::remove_const<typename std::iterator_traits<
    \n-
    61 CellIterator>::value_type>::type> Corner;
    \n-
    62
    \n-
    63 // reiterate the facades typedefs here
    \n-\n-
    65 typedef const Corner Value;
    \n-
    66 typedef Value& Reference;
    \n-
    67 typedef typename std::iterator_traits<CellIterator>::difference_type
    \n-\n-
    69
    \n-
    70 static const unsigned mydim = std::iterator_traits<CellIterator>::
    \n-
    71 value_type::mydimension;
    \n-
    72
    \n-
    73 private:
    \n-
    74 typedef ForwardIteratorFacade<DerivedType, Value, Reference,
    \n-
    75 DifferenceType> Facade;
    \n-
    76
    \n-\n-
    78 const IS* is;
    \n-
    79 std::vector<bool> seen;
    \n-
    80
    \n-
    81 public:
    \n-
    \n-\n-
    83 return *cornerit;
    \n-
    84 }
    \n-
    \n-
    85
    \n-
    \n-
    86 bool isDereferencable() const {
    \n-
    87 return cornerit.isDereferencable();
    \n-
    88 }
    \n-
    \n-
    89
    \n-
    \n-
    90 bool equals(const DerivedType& other) const {
    \n-
    91 return cornerit == other.cornerit;
    \n-
    92 }
    \n-
    \n-
    93
    \n-
    \n-
    94 void increment() {
    \n-
    95 for(++cornerit; isDereferencable(); ++cornerit) {
    \n-
    96 typename IS::IndexType index =
    \n-
    97 is->subIndex(cornerit->cell(), cornerit->duneIndex(), mydim);
    \n-
    98
    \n-
    99 if(!seen[index]) {
    \n-
    100 seen[index] = true;
    \n-
    101 break;
    \n-
    102 }
    \n-
    103 }
    \n-
    104 }
    \n-
    \n-
    105
    \n+
    \n+
    28 static const type &defaultValue ()
    \n+
    29 {
    \n+
    30 static type value;
    \n+
    31 return value;
    \n+
    32 }
    \n+
    \n+
    33
    \n+
    \n+
    35 static type convert ( const std::string & parameter )
    \n+
    36 {
    \n+
    37 return parameter;
    \n+
    38 }
    \n+
    \n+
    39
    \n+
    41 static const char delimiter = ':';
    \n+
    42 };
    \n+
    \n+
    43
    \n+
    \n+\n+
    47 {
    \n+
    48 public:
    \n+
    49 typedef enum {Simplex,Cube,General} element_t;
    \n+
    50
    \n+\n+
    52
    \n+
    54 DuneGridFormatParser ( int rank, int size );
    \n+
    55
    \n+
    66 static bool isDuneGridFormat ( std::istream &input );
    \n+
    67
    \n+
    77 static bool isDuneGridFormat ( const std::string &filename );
    \n+
    78
    \n+
    91 bool readDuneGrid( std::istream &input, int dimG, int dimW );
    \n+
    92
    \n+
    94 void writeTetgenPoly ( const std::string &, std::string &, std::string & );
    \n+
    95
    \n+
    96 void writeTetgenPoly ( std::ostream & out, const bool writeSegments = true );
    \n+
    97
    \n+
    98 protected:
    \n+
    99 void generateBoundaries ( std::istream &, bool );
    \n+
    100
    \n+
    101 // call to tetgen/triangle
    \n+
    102 void generateSimplexGrid ( std::istream & );
    \n+
    103 void readTetgenTriangle ( const std::string & );
    \n+
    104
    \n+
    105 // helper methods
    \n+
    106 void removeCopies ();
    \n
    107
    \n-
    \n-
    112 PointIterator(const CellIterator& cellit, const CellIterator& cellend,
    \n-
    113 const IS& is_)
    \n-
    114 : cornerit(cellit, cellend), is(&is_), seen(is->size(mydim), false)
    \n-
    115 { }
    \n-
    \n-
    117
    \n-
    \n-
    120 PointIterator(const CellIterator& cellend_)
    \n-
    121 : cornerit(cellend_), is(0)
    \n-
    122 { }
    \n-
    \n-
    123 };
    \n-
    \n-
    124
    \n-
    125 } // namespace VTK
    \n+
    108 void setOrientation ( int use1, int use2,
    \n+
    109 orientation_t orientation=counterclockwise );
    \n+
    110
    \n+
    111 void setRefinement ( int use1, int use2, int is1=-1, int is2=-1 );
    \n+
    112
    \n+
    113 double testTriang ( int snr );
    \n+
    114
    \n+
    115 std::vector< double > & getElParam ( int i, std::vector< double > & coord );
    \n+
    116
    \n+
    117 std::vector< double > & getVtxParam ( int i, std::vector< double > & coord );
    \n+
    118
    \n+
    119 static std::string temporaryFileName ();
    \n+
    120
    \n+
    121 // dimension of world and problem: set through the readDuneGrid() method
    \n+\n+
    123
    \n+
    124 // vector of vertex coordinates
    \n+
    125 std::vector < std::vector < double > > vtx;
    \n
    126
    \n+\n
    128
    \n-
    129} // namespace Dune
    \n+\n
    130
    \n-
    131#endif // DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH
    \n-\n-\n+
    131 double minVertexDistance; // min. L^1 distance of distinct points
    \n+
    132
    \n+
    133 // vector of elements
    \n+
    134 std :: vector< std :: vector< unsigned int > > elements;
    \n+
    135
    \n+\n+
    137
    \n+
    138 // vector of boundary segments + identifier
    \n+
    139 std::vector < std::vector < int > > bound;
    \n+
    140
    \n+\n+
    142
    \n+
    143 // map to generate and find boundary segments
    \n+\n+
    145 typedef std::pair < int, BoundaryParameter > BndParam;
    \n+
    146 typedef std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t;
    \n+\n+
    148
    \n+
    149 // true if parameters on a boundary found
    \n+\n+
    151
    \n+
    152 // set by generator depending on element type wanted
    \n+\n+
    154
    \n+
    155 // set by the readDuneGrid method depending
    \n+
    156 // on what type the elements were generated
    \n+\n+
    158
    \n+
    159 // true if grid is generated using the interval Block
    \n+\n+
    161
    \n+
    162 // parameters on elements
    \n+\n+
    164
    \n+
    165 std::vector< std::vector< double > > vtxParams,elParams;
    \n+
    166
    \n+
    167 // write information about generation process
    \n+\n+
    169
    \n+
    170 std::vector < double > emptyParam_;
    \n+
    171
    \n+
    172
    \n+
    173 private:
    \n+
    174 int rank_;
    \n+
    175 int size_;
    \n+
    176
    \n+
    177 template< class GridType >
    \n+
    178 friend struct DGFGridFactory;
    \n+
    179
    \n+
    180 template< class GridType >
    \n+
    181 friend struct DGFBaseFactory;
    \n+
    182
    \n+
    183 };
    \n+
    \n+
    184
    \n+
    185} // end namespace Dune
    \n+
    186
    \n+
    187#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n-
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n-
    bool isDereferencable() const
    Definition corneriterator.hh:69
    \n-
    iterate over the points of some corner range
    Definition pointiterator.hh:58
    \n-
    PointIterator(const CellIterator &cellit, const CellIterator &cellend, const IS &is_)
    construct a CornerIterator
    Definition pointiterator.hh:112
    \n-
    void increment()
    Definition pointiterator.hh:94
    \n-
    VTK::Corner< typename std::remove_const< typename std::iterator_traits< CellIterator >::value_type >::type > Corner
    Definition pointiterator.hh:61
    \n-
    Reference dereference() const
    Definition pointiterator.hh:82
    \n-
    std::iterator_traits< CellIterator >::difference_type DifferenceType
    Definition pointiterator.hh:68
    \n-
    static const unsigned mydim
    Definition pointiterator.hh:70
    \n-
    PointIterator(const CellIterator &cellend_)
    construct a CornerIterator
    Definition pointiterator.hh:120
    \n-
    bool equals(const DerivedType &other) const
    Definition pointiterator.hh:90
    \n-
    PointIterator< CellIterator, IS > DerivedType
    Definition pointiterator.hh:64
    \n-
    const Corner Value
    Definition pointiterator.hh:65
    \n-
    Value & Reference
    Definition pointiterator.hh:66
    \n-
    bool isDereferencable() const
    Definition pointiterator.hh:86
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    Definition io/file/dgfparser/dgfparser.cc:26
    \n+
    Contains types for additional features.
    Definition parser.hh:23
    \n+
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    static const char delimiter
    delimiter
    Definition parser.hh:41
    \n+
    static type convert(const std::string &parameter)
    copy from string
    Definition parser.hh:35
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures us...
    Definition parser.hh:47
    \n+
    int nofvtxparams
    Definition parser.hh:163
    \n+
    int nofbound
    Definition parser.hh:141
    \n+
    std::pair< int, BoundaryParameter > BndParam
    Definition parser.hh:145
    \n+
    void readTetgenTriangle(const std::string &)
    Definition io/file/dgfparser/dgfparser.cc:795
    \n+
    static bool isDuneGridFormat(std::istream &input)
    check whether a stream is in DUNE grid format
    Definition io/file/dgfparser/dgfparser.cc:271
    \n+
    void setOrientation(int use1, int use2, orientation_t orientation=counterclockwise)
    Definition io/file/dgfparser/dgfparser.cc:910
    \n+
    std::vector< std::vector< double > > vtxParams
    Definition parser.hh:165
    \n+
    void setRefinement(int use1, int use2, int is1=-1, int is2=-1)
    Definition io/file/dgfparser/dgfparser.cc:989
    \n+
    friend struct DGFBaseFactory
    Definition parser.hh:181
    \n+
    static std::string temporaryFileName()
    Definition io/file/dgfparser/dgfparser.cc:1096
    \n+
    void removeCopies()
    Definition io/file/dgfparser/dgfparser.cc:464
    \n+
    int dimw
    Definition parser.hh:122
    \n+
    int dimgrid
    Definition parser.hh:122
    \n+
    element_t element
    Definition parser.hh:153
    \n+
    DGFBoundaryParameter::type BoundaryParameter
    Definition parser.hh:144
    \n+
    int nofelements
    Definition parser.hh:136
    \n+
    orientation_t
    Definition parser.hh:51
    \n+
    @ clockwise
    Definition parser.hh:51
    \n+
    @ counterclockwise
    Definition parser.hh:51
    \n+
    double testTriang(int snr)
    Definition io/file/dgfparser/dgfparser.cc:1050
    \n+
    double minVertexDistance
    Definition parser.hh:131
    \n+
    bool simplexgrid
    Definition parser.hh:157
    \n+
    std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t
    Definition parser.hh:146
    \n+
    std::vector< std::vector< int > > bound
    Definition parser.hh:139
    \n+
    void generateSimplexGrid(std::istream &)
    Definition io/file/dgfparser/dgfparser.cc:624
    \n+
    std::vector< double > emptyParam_
    Definition parser.hh:170
    \n+
    int nofelparams
    Definition parser.hh:163
    \n+
    std::vector< std::vector< double > > elParams
    Definition parser.hh:165
    \n+
    facemap_t facemap
    Definition parser.hh:147
    \n+
    element_t
    Definition parser.hh:49
    \n+
    @ General
    Definition parser.hh:49
    \n+
    @ Cube
    Definition parser.hh:49
    \n+
    @ Simplex
    Definition parser.hh:49
    \n+
    bool cube2simplex
    Definition parser.hh:160
    \n+
    int nofvtx
    Definition parser.hh:127
    \n+
    void writeTetgenPoly(const std::string &, std::string &, std::string &)
    method to write in Tetgen/Triangle Poly Format
    Definition io/file/dgfparser/dgfparser.cc:123
    \n+
    std::vector< std::vector< double > > vtx
    Definition parser.hh:125
    \n+
    int vtxoffset
    Definition parser.hh:129
    \n+
    bool readDuneGrid(std::istream &input, int dimG, int dimW)
    parse dune grid format from stream
    Definition io/file/dgfparser/dgfparser.cc:298
    \n+
    std ::vector< std ::vector< unsigned int > > elements
    Definition parser.hh:134
    \n+
    bool haveBndParameters
    Definition parser.hh:150
    \n+
    DGFPrintInfo * info
    Definition parser.hh:168
    \n+
    void generateBoundaries(std::istream &, bool)
    Definition io/file/dgfparser/dgfparser.cc:502
    \n+
    std::vector< double > & getVtxParam(int i, std::vector< double > &coord)
    Definition io/file/dgfparser/dgfparser.cc:1086
    \n+
    std::vector< double > & getElParam(int i, std::vector< double > &coord)
    Definition io/file/dgfparser/dgfparser.cc:1070
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,168 +2,332 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-pointiterator.hh\n+ * dgfparser\n+parser.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH\n-7#define DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH\n-8\n-9#include \n+5#ifndef DUNE_DGF_DUNEGRIDFORMATPARSER_HH\n+6#define DUNE_DGF_DUNEGRIDFORMATPARSER_HH\n+7\n+8#include \n+9#include \n 10#include \n-11\n-12#include \n-13#include \n+11#include \n+12\n+13#include \n 14\n-15#include \n-16#include \n+15namespace Dune\n+16{\n 17\n-18namespace Dune\n-19{\n-22\n-23 namespace VTK {\n-24\n+18 class DGFPrintInfo;\n+19\n+22 struct DGFBoundaryParameter\n+23 {\n+25 typedef std::string type;\n 26\n-49 template\n-50 class PointIterator\n-51 : public ForwardIteratorFacade\n-52 < PointIterator,\n-53 const Corner::value_type>::type>,\n-55 const Corner::value_type>::type>&,\n-57 typename std::iterator_traits::difference_type>\n-58 {\n-59 public:\n-60 typedef VTK::Corner::value_type>::type> Corner;\n-62\n-63 // reiterate the facades typedefs here\n-64 typedef PointIterator DerivedType;\n-65 typedef const Corner Value;\n-66 typedef Value& Reference;\n-67 typedef typename std::iterator_traits::difference_type\n-68 DifferenceType;\n-69\n-70 static const unsigned mydim = std::iterator_traits::\n-71 value_type::mydimension;\n-72\n-73 private:\n-74 typedef ForwardIteratorFacade Facade;\n-76\n-77 CornerIterator cornerit;\n-78 const IS* is;\n-79 std::vector seen;\n-80\n-81 public:\n-82 Reference dereference() const {\n-83 return *cornerit;\n-84 }\n-85\n-86 bool isDereferencable() const {\n-87 return cornerit.isDereferencable();\n-88 }\n-89\n-90 bool equals(const DerivedType& other) const {\n-91 return cornerit == other.cornerit;\n-92 }\n-93\n-94 void increment() {\n-95 for(++cornerit; isDereferencable(); ++cornerit) {\n-96 typename IS::IndexType index =\n-97 is->subIndex(cornerit->cell(), cornerit->duneIndex(), mydim);\n-98\n-99 if(!seen[index]) {\n-100 seen[index] = true;\n-101 break;\n-102 }\n-103 }\n-104 }\n-105\n+28 static const type &defaultValue ()\n+29 {\n+30 static type value;\n+31 return value;\n+32 }\n+33\n+35 static type convert ( const std::string & parameter )\n+36 {\n+37 return parameter;\n+38 }\n+39\n+41 static const char delimiter = ':';\n+42 };\n+43\n+46 class DuneGridFormatParser\n+47 {\n+48 public:\n+49 typedef enum {Simplex,Cube,General} element_t;\n+50\n+51 typedef enum {counterclockwise=1,clockwise=-1} orientation_t;\n+52\n+54 DuneGridFormatParser ( int rank, int size );\n+55\n+66 static bool isDuneGridFormat ( std::istream &input );\n+67\n+77 static bool isDuneGridFormat ( const std::string &filename );\n+78\n+91 bool readDuneGrid( std::istream &input, int dimG, int dimW );\n+92\n+94 void writeTetgenPoly ( const std::string &, std::string &, std::string & );\n+95\n+96 void writeTetgenPoly ( std::ostream & out, const bool writeSegments = true\n+);\n+97\n+98 protected:\n+99 void generateBoundaries ( std::istream &, bool );\n+100\n+101 // call to tetgen/triangle\n+102 void generateSimplexGrid ( std::istream & );\n+103 void readTetgenTriangle ( const std::string & );\n+104\n+105 // helper methods\n+106 void removeCopies ();\n 107\n-112 PointIterator(const CellIterator& cellit, const CellIterator& cellend,\n-113 const IS& is_)\n-114 : cornerit(cellit, cellend), is(&is_), seen(is->size(mydim), false)\n-115 { }\n-117\n-120 PointIterator(const CellIterator& cellend_)\n-121 : cornerit(cellend_), is(0)\n-122 { }\n-123 };\n-124\n-125 } // namespace VTK\n+108 void setOrientation ( int use1, int use2,\n+109 orientation_t orientation=counterclockwise );\n+110\n+111 void setRefinement ( int use1, int use2, int is1=-1, int is2=-1 );\n+112\n+113 double testTriang ( int snr );\n+114\n+115 std::vector< double > & getElParam ( int i, std::vector< double > & coord\n+);\n+116\n+117 std::vector< double > & getVtxParam ( int i, std::vector< double > & coord\n+);\n+118\n+119 static std::string temporaryFileName ();\n+120\n+121 // dimension of world and problem: set through the readDuneGrid() method\n+122 int dimw, dimgrid;\n+123\n+124 // vector of vertex coordinates\n+125 std::vector < std::vector < double > > vtx;\n 126\n+127 int nofvtx;\n 128\n-129} // namespace Dune\n+129 int vtxoffset;\n 130\n-131#endif // DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH\n-corneriterator.hh\n-corner.hh\n+131 double minVertexDistance; // min. L^1 distance of distinct points\n+132\n+133 // vector of elements\n+134 std :: vector< std :: vector< unsigned int > > elements;\n+135\n+136 int nofelements;\n+137\n+138 // vector of boundary segments + identifier\n+139 std::vector < std::vector < int > > bound;\n+140\n+141 int nofbound;\n+142\n+143 // map to generate and find boundary segments\n+144 typedef DGFBoundaryParameter::type BoundaryParameter;\n+145 typedef std::pair < int, BoundaryParameter > BndParam;\n+146 typedef std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t;\n+147 facemap_t facemap;\n+148\n+149 // true if parameters on a boundary found\n+150 bool haveBndParameters;\n+151\n+152 // set by generator depending on element type wanted\n+153 element_t element;\n+154\n+155 // set by the readDuneGrid method depending\n+156 // on what type the elements were generated\n+157 bool simplexgrid;\n+158\n+159 // true if grid is generated using the interval Block\n+160 bool cube2simplex;\n+161\n+162 // parameters on elements\n+163 int nofvtxparams,nofelparams;\n+164\n+165 std::vector< std::vector< double > > vtxParams,elParams;\n+166\n+167 // write information about generation process\n+168 DGFPrintInfo * info;\n+169\n+170 std::vector < double > emptyParam_;\n+171\n+172\n+173 private:\n+174 int rank_;\n+175 int size_;\n+176\n+177 template< class GridType >\n+178 friend struct DGFGridFactory;\n+179\n+180 template< class GridType >\n+181 friend struct DGFBaseFactory;\n+182\n+183 };\n+184\n+185} // end namespace Dune\n+186\n+187#endif\n+entitykey.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Corner\n-simple class representing a corner of a cell\n-Definition corner.hh:25\n-Dune::VTK::CornerIterator\n-iterate over the corners of some cell range\n-Definition corneriterator.hh:39\n-Dune::VTK::CornerIterator::isDereferencable\n-bool isDereferencable() const\n-Definition corneriterator.hh:69\n-Dune::VTK::PointIterator\n-iterate over the points of some corner range\n-Definition pointiterator.hh:58\n-Dune::VTK::PointIterator::PointIterator\n-PointIterator(const CellIterator &cellit, const CellIterator &cellend, const IS\n-&is_)\n-construct a CornerIterator\n-Definition pointiterator.hh:112\n-Dune::VTK::PointIterator::increment\n-void increment()\n-Definition pointiterator.hh:94\n-Dune::VTK::PointIterator::Corner\n-VTK::Corner< typename std::remove_const< typename std::iterator_traits<\n-CellIterator >::value_type >::type > Corner\n-Definition pointiterator.hh:61\n-Dune::VTK::PointIterator::dereference\n-Reference dereference() const\n-Definition pointiterator.hh:82\n-Dune::VTK::PointIterator::DifferenceType\n-std::iterator_traits< CellIterator >::difference_type DifferenceType\n-Definition pointiterator.hh:68\n-Dune::VTK::PointIterator::mydim\n-static const unsigned mydim\n-Definition pointiterator.hh:70\n-Dune::VTK::PointIterator::PointIterator\n-PointIterator(const CellIterator &cellend_)\n-construct a CornerIterator\n-Definition pointiterator.hh:120\n-Dune::VTK::PointIterator::equals\n-bool equals(const DerivedType &other) const\n-Definition pointiterator.hh:90\n-Dune::VTK::PointIterator::DerivedType\n-PointIterator< CellIterator, IS > DerivedType\n-Definition pointiterator.hh:64\n-Dune::VTK::PointIterator::Value\n-const Corner Value\n-Definition pointiterator.hh:65\n-Dune::VTK::PointIterator::Reference\n-Value & Reference\n-Definition pointiterator.hh:66\n-Dune::VTK::PointIterator::isDereferencable\n-bool isDereferencable() const\n-Definition pointiterator.hh:86\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFPrintInfo\n+Definition io/file/dgfparser/dgfparser.cc:26\n+Dune::DGFBoundaryParameter\n+Contains types for additional features.\n+Definition parser.hh:23\n+Dune::DGFBoundaryParameter::defaultValue\n+static const type & defaultValue()\n+default constructor\n+Definition parser.hh:28\n+Dune::DGFBoundaryParameter::delimiter\n+static const char delimiter\n+delimiter\n+Definition parser.hh:41\n+Dune::DGFBoundaryParameter::convert\n+static type convert(const std::string ¶meter)\n+copy from string\n+Definition parser.hh:35\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+Dune::DuneGridFormatParser\n+The DuneGridFormatParser class: reads a DGF file and stores build information\n+in vector structures us...\n+Definition parser.hh:47\n+Dune::DuneGridFormatParser::nofvtxparams\n+int nofvtxparams\n+Definition parser.hh:163\n+Dune::DuneGridFormatParser::nofbound\n+int nofbound\n+Definition parser.hh:141\n+Dune::DuneGridFormatParser::BndParam\n+std::pair< int, BoundaryParameter > BndParam\n+Definition parser.hh:145\n+Dune::DuneGridFormatParser::readTetgenTriangle\n+void readTetgenTriangle(const std::string &)\n+Definition io/file/dgfparser/dgfparser.cc:795\n+Dune::DuneGridFormatParser::isDuneGridFormat\n+static bool isDuneGridFormat(std::istream &input)\n+check whether a stream is in DUNE grid format\n+Definition io/file/dgfparser/dgfparser.cc:271\n+Dune::DuneGridFormatParser::setOrientation\n+void setOrientation(int use1, int use2, orientation_\n+t orientation=counterclockwise)\n+Definition io/file/dgfparser/dgfparser.cc:910\n+Dune::DuneGridFormatParser::vtxParams\n+std::vector< std::vector< double > > vtxParams\n+Definition parser.hh:165\n+Dune::DuneGridFormatParser::setRefinement\n+void setRefinement(int use1, int use2, int is1=-1, int is2=-1)\n+Definition io/file/dgfparser/dgfparser.cc:989\n+Dune::DuneGridFormatParser::DGFBaseFactory\n+friend struct DGFBaseFactory\n+Definition parser.hh:181\n+Dune::DuneGridFormatParser::temporaryFileName\n+static std::string temporaryFileName()\n+Definition io/file/dgfparser/dgfparser.cc:1096\n+Dune::DuneGridFormatParser::removeCopies\n+void removeCopies()\n+Definition io/file/dgfparser/dgfparser.cc:464\n+Dune::DuneGridFormatParser::dimw\n+int dimw\n+Definition parser.hh:122\n+Dune::DuneGridFormatParser::dimgrid\n+int dimgrid\n+Definition parser.hh:122\n+Dune::DuneGridFormatParser::element\n+element_t element\n+Definition parser.hh:153\n+Dune::DuneGridFormatParser::BoundaryParameter\n+DGFBoundaryParameter::type BoundaryParameter\n+Definition parser.hh:144\n+Dune::DuneGridFormatParser::nofelements\n+int nofelements\n+Definition parser.hh:136\n+Dune::DuneGridFormatParser::orientation_t\n+orientation_t\n+Definition parser.hh:51\n+Dune::DuneGridFormatParser::clockwise\n+@ clockwise\n+Definition parser.hh:51\n+Dune::DuneGridFormatParser::counterclockwise\n+@ counterclockwise\n+Definition parser.hh:51\n+Dune::DuneGridFormatParser::testTriang\n+double testTriang(int snr)\n+Definition io/file/dgfparser/dgfparser.cc:1050\n+Dune::DuneGridFormatParser::minVertexDistance\n+double minVertexDistance\n+Definition parser.hh:131\n+Dune::DuneGridFormatParser::simplexgrid\n+bool simplexgrid\n+Definition parser.hh:157\n+Dune::DuneGridFormatParser::facemap_t\n+std::map< DGFEntityKey< unsigned int >, BndParam > facemap_t\n+Definition parser.hh:146\n+Dune::DuneGridFormatParser::bound\n+std::vector< std::vector< int > > bound\n+Definition parser.hh:139\n+Dune::DuneGridFormatParser::generateSimplexGrid\n+void generateSimplexGrid(std::istream &)\n+Definition io/file/dgfparser/dgfparser.cc:624\n+Dune::DuneGridFormatParser::emptyParam_\n+std::vector< double > emptyParam_\n+Definition parser.hh:170\n+Dune::DuneGridFormatParser::nofelparams\n+int nofelparams\n+Definition parser.hh:163\n+Dune::DuneGridFormatParser::elParams\n+std::vector< std::vector< double > > elParams\n+Definition parser.hh:165\n+Dune::DuneGridFormatParser::facemap\n+facemap_t facemap\n+Definition parser.hh:147\n+Dune::DuneGridFormatParser::element_t\n+element_t\n+Definition parser.hh:49\n+Dune::DuneGridFormatParser::General\n+@ General\n+Definition parser.hh:49\n+Dune::DuneGridFormatParser::Cube\n+@ Cube\n+Definition parser.hh:49\n+Dune::DuneGridFormatParser::Simplex\n+@ Simplex\n+Definition parser.hh:49\n+Dune::DuneGridFormatParser::cube2simplex\n+bool cube2simplex\n+Definition parser.hh:160\n+Dune::DuneGridFormatParser::nofvtx\n+int nofvtx\n+Definition parser.hh:127\n+Dune::DuneGridFormatParser::writeTetgenPoly\n+void writeTetgenPoly(const std::string &, std::string &, std::string &)\n+method to write in Tetgen/Triangle Poly Format\n+Definition io/file/dgfparser/dgfparser.cc:123\n+Dune::DuneGridFormatParser::vtx\n+std::vector< std::vector< double > > vtx\n+Definition parser.hh:125\n+Dune::DuneGridFormatParser::vtxoffset\n+int vtxoffset\n+Definition parser.hh:129\n+Dune::DuneGridFormatParser::readDuneGrid\n+bool readDuneGrid(std::istream &input, int dimG, int dimW)\n+parse dune grid format from stream\n+Definition io/file/dgfparser/dgfparser.cc:298\n+Dune::DuneGridFormatParser::elements\n+std ::vector< std ::vector< unsigned int > > elements\n+Definition parser.hh:134\n+Dune::DuneGridFormatParser::haveBndParameters\n+bool haveBndParameters\n+Definition parser.hh:150\n+Dune::DuneGridFormatParser::info\n+DGFPrintInfo * info\n+Definition parser.hh:168\n+Dune::DuneGridFormatParser::generateBoundaries\n+void generateBoundaries(std::istream &, bool)\n+Definition io/file/dgfparser/dgfparser.cc:502\n+Dune::DuneGridFormatParser::getVtxParam\n+std::vector< double > & getVtxParam(int i, std::vector< double > &coord)\n+Definition io/file/dgfparser/dgfparser.cc:1086\n+Dune::DuneGridFormatParser::getElParam\n+std::vector< double > & getElParam(int i, std::vector< double > &coord)\n+Definition io/file/dgfparser/dgfparser.cc:1070\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00947.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00947.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtuwriter.hh File Reference\n+dune-grid: dgfug.cc File Reference\n \n \n \n \n \n \n \n@@ -65,45 +65,33 @@\n \n \n \n \n \n \n \n
    \n \n-
    vtuwriter.hh File Reference
    \n+
    dgfug.cc File Reference
    \n
    \n
    \n-
    #include <ostream>
    \n-#include <string>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/indent.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n-#include <dune/grid/io/file/vtk/dataarraywriter.hh>
    \n-
    \n-

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::VTK::VTUWriter
     Dump a .vtu/.vtp files contents to a stream. More...
     
    \n+
    #include <dune/geometry/utility/typefromvertexcount.hh>
    \n+#include <dune-grid-config.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfug.hh>
    \n+
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,21 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-vtuwriter.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::VTK::VTUWriter\n-\u00a0 Dump a .vtu/.vtp files contents to a stream. More...\n-\u00a0\n+ * dgfparser\n+Namespaces\n+dgfug.cc File Reference\n+#include \n+#include \n+#include \n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n+namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00950.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00950.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: common.hh File Reference\n+dune-grid: dgfidentitygrid.hh File Reference\n \n \n \n \n \n \n \n@@ -65,136 +65,44 @@\n \n \n \n \n \n \n \n
    \n \n-
    common.hh File Reference
    \n+Namespaces
    \n+
    dgfidentitygrid.hh File Reference
    \n \n
    \n-\n-

    Common stuff for the VTKWriter. \n-More...

    \n-
    #include <limits>
    \n-#include <sstream>
    \n-#include <string>
    \n-#include <cstdint>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/common/typetraits.hh>
    \n+
    #include <dune/common/typetraits.hh>
    \n+#include <dune/grid/identitygrid.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfparser.hh>
    \n+#include <dune/grid/utility/hostgridaccess.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 Classes

    struct  Dune::VTK::PrintType< T >
     determine a type to safely put another type into a stream More...
     
    struct  Dune::VTK::PrintType< unsigned char >
     
    struct  Dune::VTK::PrintType< signed char >
     
    struct  Dune::VTK::PrintType< char >
    struct  Dune::DGFGridFactory< IdentityGrid< HostGrid > >
     
    class  Dune::VTK::FieldInfo
     Descriptor struct for VTK fields. More...
    struct  Dune::DGFGridInfo< IdentityGrid< HostGrid > >
     
    \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-Enumerations

    enum  Dune::VTK::OutputType { Dune::VTK::ascii\n-, Dune::VTK::base64\n-, Dune::VTK::appendedraw\n-, Dune::VTK::appendedbase64\n- }
     How the bulk data should be stored in the file. More...
     
    enum  Dune::VTK::DataMode { Dune::VTK::conforming\n-, Dune::VTK::nonconforming\n- }
     Whether to produce conforming or non-conforming output. More...
     
    enum  Dune::VTK::GeometryType {
    \n-  Dune::VTK::vertex = 1\n-, Dune::VTK::line = 3\n-, Dune::VTK::triangle = 5\n-, Dune::VTK::polygon = 7\n-,
    \n-  Dune::VTK::quadrilateral = 9\n-, Dune::VTK::tetrahedron = 10\n-, Dune::VTK::hexahedron = 12\n-, Dune::VTK::prism = 13\n-,
    \n-  Dune::VTK::pyramid = 14\n-, Dune::VTK::polyhedron = 42\n-
    \n- }
     Type representing VTK's entity geometry types. More...
     
    enum  Dune::VTK::FileType { Dune::VTK::polyData\n-, Dune::VTK::unstructuredGrid\n- }
     which type of VTK file to write More...
     
    enum class  Dune::VTK::Precision {
    \n-  Dune::VTK::int32\n-, Dune::VTK::uint8\n-, Dune::VTK::uint32\n-, Dune::VTK::float32\n-,
    \n-  Dune::VTK::float64\n-
    \n- }
     which precision to use when writing out data to vtk files More...
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

    GeometryType Dune::VTK::geometryType (const Dune::GeometryType &t)
     mapping from GeometryType to VTKGeometryType
     
    int Dune::VTK::renumber (const Dune::GeometryType &t, int i)
     renumber VTK <-> Dune
     
    template<typename T >
    int Dune::VTK::renumber (const T &t, int i)
     renumber VTK <-> Dune
     
    std::string Dune::VTK::getEndiannessString ()
     determine endianness of this C++ implementation
     
    std::string Dune::VTK::toString (Precision p)
     map precision to VTK type name
     
    std::size_t Dune::VTK::typeSize (Precision p)
     map precision to byte size
     
    \n-

    Detailed Description

    \n-

    Common stuff for the VTKWriter.

    \n-
    Author
    Peter Bastian, Christian Engwer
    \n-

    This file contains common stuff for all instances of VTKWriter.

    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,94 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces | Enumerations | Functions\n-common.hh File Reference\n-Common stuff for the VTKWriter. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * dgfparser\n+Classes | Namespaces\n+dgfidentitygrid.hh File Reference\n #include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::VTK::PrintType<_T_>\n-\u00a0 determine a type to safely put another type into a stream More...\n+struct \u00a0 Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>\n \u00a0\n-struct \u00a0 Dune::VTK::PrintType<_unsigned_char_>\n-\u00a0\n-struct \u00a0 Dune::VTK::PrintType<_signed_char_>\n-\u00a0\n-struct \u00a0 Dune::VTK::PrintType<_char_>\n-\u00a0\n- class \u00a0 Dune::VTK::FieldInfo\n-\u00a0 Descriptor struct for VTK fields. More...\n+struct \u00a0 Dune::DGFGridInfo<_IdentityGrid<_HostGrid_>_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n-Enumerations\n- enum \u00a0 Dune::VTK::OutputType { Dune::VTK::ascii , Dune::VTK::base64 ,\n- Dune::VTK::appendedraw , Dune::VTK::appendedbase64 }\n-\u00a0 How the bulk data should be stored in the file. More...\n-\u00a0\n- enum \u00a0 Dune::VTK::DataMode { Dune::VTK::conforming , Dune::VTK::\n- nonconforming }\n-\u00a0 Whether to produce conforming or non-conforming output. More...\n-\u00a0\n- enum \u00a0 Dune::VTK::GeometryType {\n- \u00a0\u00a0Dune::VTK::vertex = 1 , Dune::VTK::line = 3 , Dune::VTK::\n- triangle = 5 , Dune::VTK::polygon = 7 ,\n- \u00a0\u00a0Dune::VTK::quadrilateral = 9 , Dune::VTK::tetrahedron = 10 ,\n- Dune::VTK::hexahedron = 12 , Dune::VTK::prism = 13 ,\n- \u00a0\u00a0Dune::VTK::pyramid = 14 , Dune::VTK::polyhedron = 42\n- }\n-\u00a0 Type representing VTK's entity geometry types. More...\n-\u00a0\n- enum \u00a0 Dune::VTK::FileType { Dune::VTK::polyData , Dune::VTK::\n- unstructuredGrid }\n-\u00a0 which type of VTK file to write More...\n-\u00a0\n-enum class \u00a0 Dune::VTK::Precision {\n- \u00a0\u00a0Dune::VTK::int32 , Dune::VTK::uint8 , Dune::VTK::uint32 , Dune::\n- VTK::float32 ,\n- \u00a0\u00a0Dune::VTK::float64\n- }\n-\u00a0 which precision to use when writing out data to vtk files More...\n-\u00a0\n-Functions\n-GeometryType\u00a0 Dune::VTK::geometryType (const Dune::GeometryType &t)\n-\u00a0 mapping from GeometryType to VTKGeometryType\n-\u00a0\n- int\u00a0 Dune::VTK::renumber (const Dune::GeometryType &t, int i)\n-\u00a0 renumber VTK <-> Dune\n-\u00a0\n-template\n- int\u00a0 Dune::VTK::renumber (const T &t, int i)\n-\u00a0 renumber VTK <-> Dune\n-\u00a0\n- std::string\u00a0 Dune::VTK::getEndiannessString ()\n-\u00a0 determine endianness of this C++ implementation\n-\u00a0\n- std::string\u00a0 Dune::VTK::toString (Precision p)\n-\u00a0 map precision to VTK type name\n-\u00a0\n- std::size_t\u00a0 Dune::VTK::typeSize (Precision p)\n-\u00a0 map precision to byte size\n-\u00a0\n-***** Detailed Description *****\n-Common stuff for the VTKWriter.\n- Author\n- Peter Bastian, Christian Engwer\n-This file contains common stuff for all instances of VTKWriter.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00950_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00950_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: common.hh Source File\n+dune-grid: dgfidentitygrid.hh Source File\n \n \n \n \n \n \n \n@@ -70,384 +70,179 @@\n \n \n \n \n \n \n \n
    \n-
    common.hh
    \n+
    dgfidentitygrid.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_COMMON_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_COMMON_HH
    \n-
    8
    \n-
    9#include <limits>
    \n-
    10#include <sstream>
    \n-
    11#include <string>
    \n-
    12#include <cstdint>
    \n+
    5#ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH
    \n+
    6#define DUNE_DGFPARSER_DGFIDENTITYGRID_HH
    \n+
    7
    \n+
    8#include <dune/common/typetraits.hh>
    \n+
    9
    \n+\n+\n+\n
    13
    \n-
    14#include <dune/common/exceptions.hh>
    \n-
    15#include <dune/geometry/type.hh>
    \n-
    16#include <dune/common/typetraits.hh>
    \n-
    17
    \n-
    25namespace Dune
    \n-
    26{
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17 // DGFGridFactory for IdentityGrid
    \n+
    18 // -------------------------------
    \n+
    19
    \n+
    20 template< class HostGrid >
    \n+
    \n+
    21 struct DGFGridFactory< IdentityGrid< HostGrid > >
    \n+
    22 {
    \n+\n+
    24
    \n+
    25 const static int dimension = Grid::dimension;
    \n+
    26 typedef MPIHelper::MPICommunicator MPICommunicator;
    \n+
    27 typedef typename Grid::template Codim<0>::Entity Element;
    \n+
    28 typedef typename Grid::template Codim<dimension>::Entity Vertex;
    \n
    29
    \n-
    30 namespace VTK {
    \n-
    31
    \n-
    33 //
    \n-
    34 // VTKOptions
    \n-
    35 //
    \n-
    36
    \n-
    38
    \n-
    \n-\n-\n-\n-\n-\n-
    52 // //! Output to the file is compressed inline binary.
    \n-
    53 // binarycompressed,
    \n-
    54 // //! Output is compressed and appended to the file.
    \n-
    55 // compressedappended
    \n-
    56 };
    \n-
    \n-
    58
    \n-
    \n-
    67 enum DataMode {
    \n-
    69
    \n-\n-
    75
    \n-\n-
    82 };
    \n-
    \n-
    83
    \n-
    85 //
    \n-
    86 // PrintType
    \n-
    87 //
    \n-
    88
    \n-
    90
    \n-
    94 template<typename T>
    \n-
    \n-
    95 struct PrintType {
    \n-
    97 typedef T Type;
    \n-
    98 };
    \n-
    \n-
    99
    \n-
    100 template<>
    \n-
    \n-
    101 struct PrintType<unsigned char> {
    \n-
    102 typedef unsigned Type;
    \n-
    103 };
    \n-
    \n-
    104
    \n-
    105 template<>
    \n-
    \n-
    106 struct PrintType<signed char> {
    \n-
    107 typedef int Type;
    \n-
    108 };
    \n-
    \n-
    109
    \n-
    110 template<>
    \n-
    \n-
    111 struct PrintType<char> {
    \n-
    112 typedef std::conditional<std::numeric_limits<char>::is_signed,
    \n-
    113 int, unsigned>::type
    \n-\n-
    115 };
    \n-
    \n-
    116
    \n-
    118 //
    \n-
    119 // VTK::GeometryType related stuff
    \n-
    120 //
    \n-
    121
    \n-
    123
    \n-
    \n-\n-\n-
    134 line = 3,
    \n-\n-\n-\n-\n-\n-
    140 prism = 13,
    \n-\n-
    142 polyhedron = 42
    \n-
    143 };
    \n-
    \n-
    144
    \n-
    146
    \n-
    \n-
    151 inline GeometryType geometryType(const Dune::GeometryType& t)
    \n-
    152 {
    \n-
    153 if (t.isVertex()) return vertex;
    \n-
    154 if (t.isLine()) return line;
    \n-
    155 if (t.isTriangle()) return triangle;
    \n-
    156 if (t.isQuadrilateral()) return quadrilateral;
    \n-
    157 if (t.isTetrahedron()) return tetrahedron;
    \n-
    158 if (t.isPyramid()) return pyramid;
    \n-
    159 if (t.isPrism()) return prism;
    \n-
    160 if (t.isHexahedron()) return hexahedron;
    \n-
    161
    \n-
    162 if (t.isNone() )
    \n-
    163 {
    \n-
    164 if( t.dim() == 2 ) return polygon;
    \n-
    165 if( t.dim() == 3 ) return polyhedron;
    \n-
    166 }
    \n-
    167
    \n-
    168 DUNE_THROW(IOError,"VTKWriter: unsupported GeometryType " << t);
    \n-
    169 }
    \n-
    \n-
    170
    \n-
    172 //
    \n-
    173 // Functions for transforming the index of a corner inside an entity
    \n-
    174 // between Dune and VTK
    \n-
    175 //
    \n-
    176
    \n-
    178
    \n-
    \n-
    186 inline int renumber(const Dune::GeometryType &t, int i)
    \n-
    187 {
    \n-
    188 static const int quadRenumbering[4] = {0,1,3,2};
    \n-
    189 static const int cubeRenumbering[8] = {0,1,3,2,4,5,7,6};
    \n-
    190 static const int prismRenumbering[6] = {0,2,1,3,5,4};
    \n-
    191 static const int pyramidRenumbering[5] = {0,1,3,2,4};
    \n-
    192
    \n-
    193 if (t.isQuadrilateral()) return quadRenumbering[i];
    \n-
    194 if (t.isPyramid()) return pyramidRenumbering[i];
    \n-
    195 if (t.isPrism()) return prismRenumbering[i];
    \n-
    196 if (t.isHexahedron()) return cubeRenumbering[i];
    \n-
    197
    \n-
    198 return i;
    \n-
    199 }
    \n-
    \n-
    200
    \n-
    202
    \n-
    216 template<typename T>
    \n-
    \n-
    217 int renumber(const T& t, int i)
    \n-
    218 {
    \n-
    219 return renumber(t.type(), i);
    \n-
    220 }
    \n-
    \n-
    221
    \n-
    223 //
    \n-
    224 // Determine Endianness
    \n-
    225 //
    \n-
    226
    \n-
    228
    \n-
    \n-
    232 inline std::string getEndiannessString()
    \n-
    233 {
    \n-
    234 short i = 1;
    \n-
    235 if (reinterpret_cast<char*>(&i)[1] == 1)
    \n-
    236 return "BigEndian";
    \n-
    237 else
    \n-
    238 return "LittleEndian";
    \n-
    239 }
    \n-
    \n-
    240
    \n-
    242 //
    \n-
    243 // which type of vtkfile to write
    \n-
    244 //
    \n-
    245
    \n-
    247
    \n-
    \n-
    252 enum FileType {
    \n-\n-\n-
    257 };
    \n-
    \n-
    258
    \n-
    259
    \n-
    261 //
    \n-
    262 // which precision to use when writing out data
    \n-
    263 //
    \n-
    264
    \n-
    266
    \n-
    \n-
    271 enum class Precision {
    \n-
    272 int32,
    \n-
    273 uint8,
    \n-
    274 uint32,
    \n-
    275 float32,
    \n-
    276 float64
    \n-
    277 };
    \n-
    \n-
    278
    \n-
    \n-
    280 inline std::string toString(Precision p)
    \n-
    281 {
    \n-
    282 switch(p)
    \n-
    283 {
    \n-\n-
    285 return "Float32";
    \n-\n-
    287 return "Float64";
    \n-\n-
    289 return "UInt32";
    \n-
    290 case Precision::uint8:
    \n-
    291 return "UInt8";
    \n-
    292 case Precision::int32:
    \n-
    293 return "Int32";
    \n-
    294 default:
    \n-
    295 DUNE_THROW(Dune::NotImplemented, "Unknown precision type");
    \n-
    296 }
    \n-
    297 }
    \n-
    \n-
    298
    \n-
    \n-
    300 inline std::size_t typeSize(Precision p)
    \n-
    301 {
    \n-
    302 switch(p)
    \n-
    303 {
    \n-\n-
    305 return sizeof(float);
    \n-\n-
    307 return sizeof(double);
    \n-\n-
    309 return sizeof(std::uint32_t);
    \n-
    310 case Precision::uint8:
    \n-
    311 return sizeof(std::uint8_t);
    \n-
    312 case Precision::int32:
    \n-
    313 return sizeof(std::int32_t);
    \n-
    314 default:
    \n-
    315 DUNE_THROW(Dune::NotImplemented, "Unknown precision type");
    \n-
    316 }
    \n-
    317 }
    \n-
    \n-
    318
    \n-
    320
    \n-
    \n-\n-
    328 {
    \n-
    329
    \n-
    330 public:
    \n-
    331
    \n-
    \n-
    333 enum class Type {
    \n-
    336 scalar,
    \n-
    338 vector,
    \n-
    340 tensor
    \n-
    341 };
    \n-
    \n-
    342
    \n-
    \n-
    344 FieldInfo(std::string name, Type type, std::size_t size, Precision prec = Precision::float32)
    \n-
    345 : _name(name)
    \n-
    346 , _type(type)
    \n-
    347 , _size(size)
    \n-
    348 , _prec(prec)
    \n-
    349 {}
    \n-
    \n-
    350
    \n-
    \n-
    352 std::string name() const
    \n-
    353 {
    \n-
    354 return _name;
    \n-
    355 }
    \n-
    \n-
    356
    \n-
    \n-
    358 Type type() const
    \n-
    359 {
    \n-
    360 return _type;
    \n-
    361 }
    \n-
    \n-
    362
    \n-
    \n-
    364 std::size_t size() const
    \n-
    365 {
    \n-
    366 return _size;
    \n-
    367 }
    \n-
    \n-
    368
    \n-
    \n-\n-
    371 {
    \n-
    372 return _prec;
    \n-
    373 }
    \n-
    \n-
    374
    \n-
    375 private:
    \n-
    376
    \n-
    377 std::string _name;
    \n-
    378 Type _type;
    \n-
    379 std::size_t _size;
    \n-
    380 Precision _prec;
    \n-
    381
    \n-
    382 };
    \n-
    \n-
    383
    \n-
    384
    \n-
    385 } // namespace VTK
    \n-
    386
    \n-
    388
    \n-
    389} // namespace Dune
    \n-
    390
    \n-
    391#endif // DUNE_GRID_IO_FILE_VTK_COMMON_HH
    \n+
    \n+
    30 explicit DGFGridFactory ( std::istream &input,
    \n+
    31 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n+
    32 : dgfHostFactory_( input, comm ),
    \n+
    33 grid_( 0 )
    \n+
    34 {
    \n+
    35 HostGrid *hostGrid = dgfHostFactory_.grid();
    \n+
    36 assert( hostGrid != 0 );
    \n+
    37 grid_ = new Grid( *hostGrid );
    \n+
    38 }
    \n+
    \n+
    39
    \n+
    \n+
    40 explicit DGFGridFactory ( const std::string &filename,
    \n+
    41 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n+
    42 : dgfHostFactory_( filename, comm ),
    \n+
    43 grid_( 0 )
    \n+
    44 {
    \n+
    45 HostGrid *hostGrid = dgfHostFactory_.grid();
    \n+
    46 assert( hostGrid != 0 );
    \n+
    47 std::ifstream input( filename.c_str() );
    \n+
    48 grid_ = new Grid( *hostGrid );
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    \n+
    51 Grid *grid () const
    \n+
    52 {
    \n+
    53 return grid_;
    \n+
    54 }
    \n+
    \n+
    55
    \n+
    56 template< class Intersection >
    \n+
    \n+
    57 bool wasInserted ( const Intersection &intersection ) const
    \n+
    58 {
    \n+
    59 return dgfHostFactory_.wasInserted( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    62 template< class Intersection >
    \n+
    \n+
    63 int boundaryId ( const Intersection &intersection ) const
    \n+
    64 {
    \n+
    65 return dgfHostFactory_.boundaryId( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    68 template< int codim >
    \n+
    \n+
    69 int numParameters () const
    \n+
    70 {
    \n+
    71 return dgfHostFactory_.template numParameters< codim >();
    \n+
    72 }
    \n+
    \n+
    73
    \n+
    74 template< class Entity >
    \n+
    \n+
    75 std::vector< double > &parameter ( const Entity &entity )
    \n+
    76 {
    \n+
    77 return dgfHostFactory_.parameter( HostGridAccess< Grid >::hostEntity( entity ) );
    \n+
    78 }
    \n+
    \n+
    79
    \n+
    80 private:
    \n+
    81 DGFGridFactory< HostGrid > dgfHostFactory_;
    \n+
    82 Grid *grid_;
    \n+
    83 };
    \n+
    \n+
    84
    \n+
    85
    \n+
    86
    \n+
    87 // DGFGridInfo for IdGrid
    \n+
    88 // ----------------------
    \n+
    89
    \n+
    90 template< class HostGrid >
    \n+
    \n+
    91 struct DGFGridInfo< IdentityGrid< HostGrid > >
    \n+
    92 {
    \n+
    \n+
    93 static int refineStepsForHalf ()
    \n+
    94 {
    \n+\n+
    96 }
    \n+
    \n+
    97
    \n+
    \n+
    98 static double refineWeight ()
    \n+
    99 {
    \n+\n+
    101 }
    \n+
    \n+
    102 };
    \n+
    \n+
    103
    \n+
    104}
    \n+
    105
    \n+
    106#endif // #ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH
    \n+
    The IdentityGrid class.
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-\n-\n-\n-\n-
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n-
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n-
    @ appendedraw
    Output is to the file is appended raw binary.
    Definition common.hh:49
    \n-
    @ appendedbase64
    Output is to the file is appended base64 binary.
    Definition common.hh:51
    \n-
    @ base64
    Output to the file is inline base64 binary.
    Definition common.hh:47
    \n-
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n-
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n-
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n-
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n-
    std::string toString(Precision p)
    map precision to VTK type name
    Definition common.hh:280
    \n-
    DataMode
    Whether to produce conforming or non-conforming output.
    Definition common.hh:67
    \n-
    @ conforming
    Output conforming data.
    Definition common.hh:73
    \n-
    @ nonconforming
    Output non-conforming data.
    Definition common.hh:81
    \n-
    std::size_t typeSize(Precision p)
    map precision to byte size
    Definition common.hh:300
    \n-
    GeometryType geometryType(const Dune::GeometryType &t)
    mapping from GeometryType to VTKGeometryType
    Definition common.hh:151
    \n-
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n-
    GeometryType
    Type representing VTK's entity geometry types.
    Definition common.hh:132
    \n-
    @ line
    Definition common.hh:134
    \n-
    @ pyramid
    Definition common.hh:141
    \n-
    @ polyhedron
    Definition common.hh:142
    \n-
    @ quadrilateral
    Definition common.hh:137
    \n-
    @ vertex
    Definition common.hh:133
    \n-
    @ tetrahedron
    Definition common.hh:138
    \n-
    @ prism
    Definition common.hh:140
    \n-
    @ hexahedron
    Definition common.hh:139
    \n-
    @ triangle
    Definition common.hh:135
    \n-
    @ polygon
    Definition common.hh:136
    \n-
    determine a type to safely put another type into a stream
    Definition common.hh:95
    \n-
    T Type
    type to convert T to before putting it into a stream with <<
    Definition common.hh:97
    \n-
    unsigned Type
    Definition common.hh:102
    \n-
    int Type
    Definition common.hh:107
    \n-
    std::conditional< std::numeric_limits< char >::is_signed, int, unsigned >::type Type
    Definition common.hh:114
    \n-
    Descriptor struct for VTK fields.
    Definition common.hh:328
    \n-
    std::size_t size() const
    The number of components in the data field.
    Definition common.hh:364
    \n-
    Precision precision() const
    The precision used for the output of the data field.
    Definition common.hh:370
    \n-
    Type
    VTK data type.
    Definition common.hh:333
    \n-
    @ tensor
    tensor field (always 3x3)
    \n-
    @ vector
    vector-valued field (always 3D, will be padded if necessary)
    \n-\n-
    FieldInfo(std::string name, Type type, std::size_t size, Precision prec=Precision::float32)
    Create a FieldInfo instance with the given name, type and size.
    Definition common.hh:344
    \n-
    Type type() const
    The type of the data field.
    Definition common.hh:358
    \n-
    std::string name() const
    The name of the data field.
    Definition common.hh:352
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    G Grid
    Definition dgfgridfactory.hh:39
    \n+
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    Provides a meta grid that is identical to its host.
    Definition identitygrid.hh:93
    \n+
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n+
    Grid::template Codim< dimension >::Entity Vertex
    Definition dgfidentitygrid.hh:28
    \n+
    IdentityGrid< HostGrid > Grid
    Definition dgfidentitygrid.hh:23
    \n+
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfidentitygrid.hh:75
    \n+
    int numParameters() const
    Definition dgfidentitygrid.hh:69
    \n+
    Grid * grid() const
    Definition dgfidentitygrid.hh:51
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfidentitygrid.hh:40
    \n+
    DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfidentitygrid.hh:30
    \n+
    int boundaryId(const Intersection &intersection) const
    Definition dgfidentitygrid.hh:63
    \n+
    MPIHelper::MPICommunicator MPICommunicator
    Definition dgfidentitygrid.hh:26
    \n+
    Grid::template Codim< 0 >::Entity Element
    Definition dgfidentitygrid.hh:27
    \n+
    bool wasInserted(const Intersection &intersection) const
    Definition dgfidentitygrid.hh:57
    \n+
    static int refineStepsForHalf()
    Definition dgfidentitygrid.hh:93
    \n+
    static double refineWeight()
    Definition dgfidentitygrid.hh:98
    \n+
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n+
    static double refineWeight()
    \n+
    static int refineStepsForHalf()
    number of globalRefine steps needed to refuce h by 0.5
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,452 +2,209 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-common.hh\n+ * dgfparser\n+dgfidentitygrid.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_COMMON_HH\n-7#define DUNE_GRID_IO_FILE_VTK_COMMON_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n+5#ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH\n+6#define DUNE_DGFPARSER_DGFIDENTITYGRID_HH\n+7\n+8#include \n+9\n+10#include \n+11#include \n+12#include \n 13\n-14#include \n-15#include \n-16#include \n-17\n-25namespace Dune\n-26{\n+14namespace Dune\n+15{\n+16\n+17 // DGFGridFactory for IdentityGrid\n+18 // -------------------------------\n+19\n+20 template< class HostGrid >\n+21 struct DGFGridFactory< IdentityGrid< HostGrid > >\n+22 {\n+23 typedef IdentityGrid<_HostGrid_> Grid;\n+24\n+25 const static int dimension = Grid::dimension;\n+26 typedef MPIHelper::MPICommunicator MPICommunicator;\n+27 typedef typename Grid::template Codim<0>::Entity Element;\n+28 typedef typename Grid::template Codim::Entity Vertex;\n 29\n-30 namespace VTK {\n-31\n-33 //\n-34 // VTKOptions\n-35 //\n-36\n-38\n-43 enum OutputType {\n-45 ascii,\n-47 base64,\n-49 appendedraw,\n-51 appendedbase64\n-52 // //! Output to the file is compressed inline binary.\n-53 // binarycompressed,\n-54 // //! Output is compressed and appended to the file.\n-55 // compressedappended\n-56 };\n-58\n-67 enum DataMode {\n-69\n-73 conforming,\n-75\n-81 nonconforming\n-82 };\n-83\n-85 //\n-86 // PrintType\n-87 //\n-88\n-90\n-94 template\n-95 struct PrintType {\n-97 typedef T Type;\n-98 };\n-99\n-100 template<>\n-101 struct PrintType {\n-102 typedef unsigned Type;\n-103 };\n-104\n-105 template<>\n-106 struct PrintType {\n-107 typedef int Type;\n-108 };\n-109\n-110 template<>\n-111 struct PrintType {\n-112 typedef std::conditional::is_signed,\n-113 int, unsigned>::type\n-114 Type;\n-115 };\n-116\n-118 //\n-119 // VTK::GeometryType related stuff\n-120 //\n-121\n-123\n-132 enum GeometryType {\n-133 vertex = 1,\n-134 line = 3,\n-135 triangle = 5,\n-136 polygon = 7,\n-137 quadrilateral = 9,\n-138 tetrahedron = 10,\n-139 hexahedron = 12,\n-140 prism = 13,\n-141 pyramid = 14,\n-142 polyhedron = 42\n-143 };\n-144\n-146\n-151 inline GeometryType geometryType(const Dune::GeometryType& t)\n-152 {\n-153 if (t.isVertex()) return vertex;\n-154 if (t.isLine()) return line;\n-155 if (t.isTriangle()) return triangle;\n-156 if (t.isQuadrilateral()) return quadrilateral;\n-157 if (t.isTetrahedron()) return tetrahedron;\n-158 if (t.isPyramid()) return pyramid;\n-159 if (t.isPrism()) return prism;\n-160 if (t.isHexahedron()) return hexahedron;\n-161\n-162 if (t.isNone() )\n-163 {\n-164 if( t.dim() == 2 ) return polygon;\n-165 if( t.dim() == 3 ) return polyhedron;\n-166 }\n-167\n-168 DUNE_THROW(IOError,\"VTKWriter: unsupported GeometryType \" << t);\n-169 }\n-170\n-172 //\n-173 // Functions for transforming the index of a corner inside an entity\n-174 // between Dune and VTK\n-175 //\n-176\n-178\n-186 inline int renumber(const Dune::GeometryType &t, int i)\n-187 {\n-188 static const int quadRenumbering[4] = {0,1,3,2};\n-189 static const int cubeRenumbering[8] = {0,1,3,2,4,5,7,6};\n-190 static const int prismRenumbering[6] = {0,2,1,3,5,4};\n-191 static const int pyramidRenumbering[5] = {0,1,3,2,4};\n-192\n-193 if (t.isQuadrilateral()) return quadRenumbering[i];\n-194 if (t.isPyramid()) return pyramidRenumbering[i];\n-195 if (t.isPrism()) return prismRenumbering[i];\n-196 if (t.isHexahedron()) return cubeRenumbering[i];\n-197\n-198 return i;\n-199 }\n-200\n-202\n-216 template\n-217 int renumber(const T& t, int i)\n-218 {\n-219 return renumber(t.type(), i);\n-220 }\n-221\n-223 //\n-224 // Determine Endianness\n-225 //\n-226\n-228\n-232 inline std::string getEndiannessString()\n-233 {\n-234 short i = 1;\n-235 if (reinterpret_cast(&i)[1] == 1)\n-236 return \"BigEndian\";\n-237 else\n-238 return \"LittleEndian\";\n-239 }\n-240\n-242 //\n-243 // which type of vtkfile to write\n-244 //\n-245\n-247\n-252 enum FileType {\n-254 polyData,\n-256 unstructuredGrid\n-257 };\n-258\n-259\n-261 //\n-262 // which precision to use when writing out data\n-263 //\n-264\n-266\n-271 enum class Precision {\n-272 int32,\n-273 uint8,\n-274 uint32,\n-275 float32,\n-276 float64\n-277 };\n-278\n-280 inline std::string toString(Precision p)\n-281 {\n-282 switch(p)\n-283 {\n-284 case Precision::float32:\n-285 return \"Float32\";\n-286 case Precision::float64:\n-287 return \"Float64\";\n-288 case Precision::uint32:\n-289 return \"UInt32\";\n-290 case Precision::uint8:\n-291 return \"UInt8\";\n-292 case Precision::int32:\n-293 return \"Int32\";\n-294 default:\n-295 DUNE_THROW(Dune::NotImplemented, \"Unknown precision type\");\n-296 }\n-297 }\n-298\n-300 inline std::size_t typeSize(Precision p)\n-301 {\n-302 switch(p)\n-303 {\n-304 case Precision::float32:\n-305 return sizeof(float);\n-306 case Precision::float64:\n-307 return sizeof(double);\n-308 case Precision::uint32:\n-309 return sizeof(std::uint32_t);\n-310 case Precision::uint8:\n-311 return sizeof(std::uint8_t);\n-312 case Precision::int32:\n-313 return sizeof(std::int32_t);\n-314 default:\n-315 DUNE_THROW(Dune::NotImplemented, \"Unknown precision type\");\n-316 }\n-317 }\n-318\n-320\n-327 class FieldInfo\n-328 {\n-329\n-330 public:\n-331\n-333 enum class Type {\n-336 scalar,\n-338 vector,\n-340 tensor\n-341 };\n-342\n-344 FieldInfo(std::string name, Type type, std::size_t size, Precision prec =\n-Precision::float32)\n-345 : _name(name)\n-346 , _type(type)\n-347 , _size(size)\n-348 , _prec(prec)\n-349 {}\n-350\n-352 std::string name() const\n-353 {\n-354 return _name;\n-355 }\n-356\n-358 Type type() const\n-359 {\n-360 return _type;\n-361 }\n-362\n-364 std::size_t size() const\n-365 {\n-366 return _size;\n-367 }\n-368\n-370 Precision precision() const\n-371 {\n-372 return _prec;\n-373 }\n-374\n-375 private:\n-376\n-377 std::string _name;\n-378 Type _type;\n-379 std::size_t _size;\n-380 Precision _prec;\n-381\n-382 };\n-383\n-384\n-385 } // namespace VTK\n-386\n-388\n-389} // namespace Dune\n-390\n-391#endif // DUNE_GRID_IO_FILE_VTK_COMMON_HH\n+30 explicit DGFGridFactory ( std::istream &input,\n+31 MPICommunicator comm = MPIHelper::getCommunicator() )\n+32 : dgfHostFactory_( input, comm ),\n+33 grid_( 0 )\n+34 {\n+35 HostGrid *hostGrid = dgfHostFactory_.grid();\n+36 assert( hostGrid != 0 );\n+37 grid_ = new Grid( *hostGrid );\n+38 }\n+39\n+40 explicit DGFGridFactory ( const std::string &filename,\n+41 MPICommunicator comm = MPIHelper::getCommunicator() )\n+42 : dgfHostFactory_( filename, comm ),\n+43 grid_( 0 )\n+44 {\n+45 HostGrid *hostGrid = dgfHostFactory_.grid();\n+46 assert( hostGrid != 0 );\n+47 std::ifstream input( filename.c_str() );\n+48 grid_ = new Grid( *hostGrid );\n+49 }\n+50\n+51 Grid *grid () const\n+52 {\n+53 return grid_;\n+54 }\n+55\n+56 template< class Intersection >\n+57 bool wasInserted ( const Intersection &intersection ) const\n+58 {\n+59 return dgfHostFactory_.wasInserted( HostGridAccess<_Grid_>::hostIntersection\n+( intersection ) );\n+60 }\n+61\n+62 template< class Intersection >\n+63 int boundaryId ( const Intersection &intersection ) const\n+64 {\n+65 return dgfHostFactory_.boundaryId( HostGridAccess<_Grid_>::hostIntersection\n+( intersection ) );\n+66 }\n+67\n+68 template< int codim >\n+69 int numParameters () const\n+70 {\n+71 return dgfHostFactory_.template numParameters< codim >();\n+72 }\n+73\n+74 template< class Entity >\n+75 std::vector< double > ¶meter ( const Entity &entity )\n+76 {\n+77 return dgfHostFactory_.parameter( HostGridAccess<_Grid_>::hostEntity( entity\n+) );\n+78 }\n+79\n+80 private:\n+81 DGFGridFactory<_HostGrid_> dgfHostFactory_;\n+82 Grid *grid_;\n+83 };\n+84\n+85\n+86\n+87 // DGFGridInfo for IdGrid\n+88 // ----------------------\n+89\n+90 template< class HostGrid >\n+91 struct DGFGridInfo< IdentityGrid< HostGrid > >\n+92 {\n+93 static int refineStepsForHalf ()\n+94 {\n+95 return DGFGridInfo<_HostGrid_>::refineStepsForHalf();\n+96 }\n+97\n+98 static double refineWeight ()\n+99 {\n+100 return DGFGridInfo<_HostGrid_>::refineWeight();\n+101 }\n+102 };\n+103\n+104}\n+105\n+106#endif // #ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH\n+identitygrid.hh\n+The IdentityGrid class.\n+hostgridaccess.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::int32\n-@ int32\n-Dune::VTK::Precision::uint32\n-@ uint32\n-Dune::VTK::Precision::uint8\n-@ uint8\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::VTK::Precision::float64\n-@ float64\n-Dune::VTK::OutputType\n-OutputType\n-How the bulk data should be stored in the file.\n-Definition common.hh:43\n-Dune::VTK::ascii\n-@ ascii\n-Output to the file is in ascii.\n-Definition common.hh:45\n-Dune::VTK::appendedraw\n-@ appendedraw\n-Output is to the file is appended raw binary.\n-Definition common.hh:49\n-Dune::VTK::appendedbase64\n-@ appendedbase64\n-Output is to the file is appended base64 binary.\n-Definition common.hh:51\n-Dune::VTK::base64\n-@ base64\n-Output to the file is inline base64 binary.\n-Definition common.hh:47\n-Dune::VTK::renumber\n-int renumber(const Dune::GeometryType &t, int i)\n-renumber VTK <-> Dune\n-Definition common.hh:186\n-Dune::VTK::FileType\n-FileType\n-which type of VTK file to write\n-Definition common.hh:252\n-Dune::VTK::polyData\n-@ polyData\n-for .vtp files (PolyData)\n-Definition common.hh:254\n-Dune::VTK::unstructuredGrid\n-@ unstructuredGrid\n-for .vtu files (UnstructuredGrid)\n-Definition common.hh:256\n-Dune::VTK::toString\n-std::string toString(Precision p)\n-map precision to VTK type name\n-Definition common.hh:280\n-Dune::VTK::DataMode\n-DataMode\n-Whether to produce conforming or non-conforming output.\n-Definition common.hh:67\n-Dune::VTK::conforming\n-@ conforming\n-Output conforming data.\n-Definition common.hh:73\n-Dune::VTK::nonconforming\n-@ nonconforming\n-Output non-conforming data.\n-Definition common.hh:81\n-Dune::VTK::typeSize\n-std::size_t typeSize(Precision p)\n-map precision to byte size\n-Definition common.hh:300\n-Dune::VTK::geometryType\n-GeometryType geometryType(const Dune::GeometryType &t)\n-mapping from GeometryType to VTKGeometryType\n-Definition common.hh:151\n-Dune::VTK::getEndiannessString\n-std::string getEndiannessString()\n-determine endianness of this C++ implementation\n-Definition common.hh:232\n-Dune::VTK::GeometryType\n-GeometryType\n-Type representing VTK's entity geometry types.\n-Definition common.hh:132\n-Dune::VTK::line\n-@ line\n-Definition common.hh:134\n-Dune::VTK::pyramid\n-@ pyramid\n-Definition common.hh:141\n-Dune::VTK::polyhedron\n-@ polyhedron\n-Definition common.hh:142\n-Dune::VTK::quadrilateral\n-@ quadrilateral\n-Definition common.hh:137\n-Dune::VTK::vertex\n-@ vertex\n-Definition common.hh:133\n-Dune::VTK::tetrahedron\n-@ tetrahedron\n-Definition common.hh:138\n-Dune::VTK::prism\n-@ prism\n-Definition common.hh:140\n-Dune::VTK::hexahedron\n-@ hexahedron\n-Definition common.hh:139\n-Dune::VTK::triangle\n-@ triangle\n-Definition common.hh:135\n-Dune::VTK::polygon\n-@ polygon\n-Definition common.hh:136\n-Dune::VTK::PrintType\n-determine a type to safely put another type into a stream\n-Definition common.hh:95\n-Dune::VTK::PrintType::Type\n-T Type\n-type to convert T to before putting it into a stream with <<\n-Definition common.hh:97\n-Dune::VTK::PrintType<_unsigned_char_>::Type\n-unsigned Type\n-Definition common.hh:102\n-Dune::VTK::PrintType<_signed_char_>::Type\n-int Type\n-Definition common.hh:107\n-Dune::VTK::PrintType<_char_>::Type\n-std::conditional< std::numeric_limits< char >::is_signed, int, unsigned >::type\n-Type\n-Definition common.hh:114\n-Dune::VTK::FieldInfo\n-Descriptor struct for VTK fields.\n-Definition common.hh:328\n-Dune::VTK::FieldInfo::size\n-std::size_t size() const\n-The number of components in the data field.\n-Definition common.hh:364\n-Dune::VTK::FieldInfo::precision\n-Precision precision() const\n-The precision used for the output of the data field.\n-Definition common.hh:370\n-Dune::VTK::FieldInfo::Type\n-Type\n-VTK data type.\n-Definition common.hh:333\n-Dune::VTK::FieldInfo::Type::tensor\n-@ tensor\n-tensor field (always 3x3)\n-Dune::VTK::FieldInfo::Type::vector\n-@ vector\n-vector-valued field (always 3D, will be padded if necessary)\n-Dune::VTK::FieldInfo::Type::scalar\n-@ scalar\n-Dune::VTK::FieldInfo::FieldInfo\n-FieldInfo(std::string name, Type type, std::size_t size, Precision\n-prec=Precision::float32)\n-Create a FieldInfo instance with the given name, type and size.\n-Definition common.hh:344\n-Dune::VTK::FieldInfo::type\n-Type type() const\n-The type of the data field.\n-Definition common.hh:358\n-Dune::VTK::FieldInfo::name\n-std::string name() const\n-The name of the data field.\n-Definition common.hh:352\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::Grid\n+G Grid\n+Definition dgfgridfactory.hh:39\n+Dune::DGFGridFactory::dimension\n+static const int dimension\n+Definition dgfgridfactory.hh:40\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+Dune::IdentityGrid\n+Provides a meta grid that is identical to its host.\n+Definition identitygrid.hh:93\n+Dune::HostGridAccess\n+provides access to host grid objects from GeometryGrid\n+Definition identitygrid.hh:37\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::Vertex\n+Grid::template Codim< dimension >::Entity Vertex\n+Definition dgfidentitygrid.hh:28\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::Grid\n+IdentityGrid< HostGrid > Grid\n+Definition dgfidentitygrid.hh:23\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::parameter\n+std::vector< double > & parameter(const Entity &entity)\n+Definition dgfidentitygrid.hh:75\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::numParameters\n+int numParameters() const\n+Definition dgfidentitygrid.hh:69\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::grid\n+Grid * grid() const\n+Definition dgfidentitygrid.hh:51\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::\n+getCommunicator())\n+Definition dgfidentitygrid.hh:40\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::DGFGridFactory\n+DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::\n+getCommunicator())\n+Definition dgfidentitygrid.hh:30\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::boundaryId\n+int boundaryId(const Intersection &intersection) const\n+Definition dgfidentitygrid.hh:63\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::MPICommunicator\n+MPIHelper::MPICommunicator MPICommunicator\n+Definition dgfidentitygrid.hh:26\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::Element\n+Grid::template Codim< 0 >::Entity Element\n+Definition dgfidentitygrid.hh:27\n+Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::wasInserted\n+bool wasInserted(const Intersection &intersection) const\n+Definition dgfidentitygrid.hh:57\n+Dune::DGFGridInfo<_IdentityGrid<_HostGrid_>_>::refineStepsForHalf\n+static int refineStepsForHalf()\n+Definition dgfidentitygrid.hh:93\n+Dune::DGFGridInfo<_IdentityGrid<_HostGrid_>_>::refineWeight\n+static double refineWeight()\n+Definition dgfidentitygrid.hh:98\n+Dune::DGFGridInfo\n+Some simple static information for a given GridType.\n+Definition io/file/dgfparser/dgfparser.hh:56\n+Dune::DGFGridInfo::refineWeight\n+static double refineWeight()\n+Dune::DGFGridInfo::refineStepsForHalf\n+static int refineStepsForHalf()\n+number of globalRefine steps needed to refuce h by 0.5\n+dgfparser.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00953.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00953.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtksequencewriter.hh File Reference\n+dune-grid: entitykey.hh File Reference\n \n \n \n \n \n \n \n@@ -65,35 +65,36 @@\n \n \n \n \n \n \n \n
    \n \n-
    vtksequencewriter.hh File Reference
    \n+
    entitykey.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n-#include <dune/grid/io/file/vtk/vtksequencewriterbase.hh>
    \n-#include <dune/grid/io/file/vtk/vtkwriter.hh>
    \n-#include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
    \n+
    #include <iostream>
    \n+#include <vector>
    \n+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n+#include "entitykey_inline.hh"
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::VTKSequenceWriter< GridView >
     Writer for the output of grid functions in the vtk format. More...
    struct  Dune::DGFEntityKey< A >
     
    struct  Dune::ElementFaceUtil
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,25 +2,26 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-vtksequencewriter.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+entitykey.hh File Reference\n+#include \n+#include \n+#include \n+#include \"entitykey_inline.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTKSequenceWriter<_GridView_>\n-\u00a0 Writer for the output of grid functions in the vtk format. More...\n+struct \u00a0 Dune::DGFEntityKey<_A_>\n+\u00a0\n+struct \u00a0 Dune::ElementFaceUtil\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00953_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00953_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtksequencewriter.hh Source File\n+dune-grid: entitykey.hh Source File\n \n \n \n \n \n \n \n@@ -70,102 +70,221 @@\n \n \n \n \n \n \n \n
    \n-
    vtksequencewriter.hh
    \n+
    entitykey.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_VTKSEQUENCE_HH
    \n-
    7#define DUNE_VTKSEQUENCE_HH
    \n-
    8
    \n-
    9#include <memory>
    \n+
    5#ifndef DUNE_DGFEnTITYKEY_HH
    \n+
    6#define DUNE_DGFEnTITYKEY_HH
    \n+
    7
    \n+
    8#include <iostream>
    \n+
    9#include <vector>
    \n
    10
    \n-\n+\n
    12
    \n-\n-\n+
    13namespace Dune
    \n+
    14{
    \n
    15
    \n-
    16namespace Dune {
    \n-
    17
    \n-
    26 template< class GridView >
    \n-
    \n-\n-
    28 public VTKSequenceWriterBase<GridView>
    \n-
    29 {
    \n-
    30 public:
    \n-
    \n-\n-
    43 const std::string& name )
    \n-\n-
    45 name,
    \n-
    46 "",
    \n-
    47 "",
    \n-
    48 vtkWriter->gridView_.comm().rank(),
    \n-
    49 vtkWriter->gridView_.comm().size())
    \n-
    50 {}
    \n+
    16 // DGFEntityKey
    \n+
    17 // ------------
    \n+
    18
    \n+
    19 template< class A >
    \n+
    \n+\n+
    21 {
    \n+
    22 DGFEntityKey ( const std :: vector< A > &key, bool setOrigKey = true );
    \n+
    23 DGFEntityKey ( const std::vector< A > &key,
    \n+
    24 int N, int offset, bool setOrigKey = true );
    \n+\n+
    26
    \n+\n+
    28
    \n+
    \n+
    29 inline const A &operator[] ( int i ) const;
    \n+
    \n+
    30 inline bool operator < ( const DGFEntityKey< A > &k ) const;
    \n+
    31
    \n+
    32 void orientation ( int base, std :: vector< std :: vector< double > > &vtx );
    \n+
    33 void print( std :: ostream &out = std :: cerr ) const;
    \n+
    34
    \n+
    \n+
    35 inline bool origKeySet () const;
    \n+
    \n+
    36 inline const A &origKey ( int i ) const;
    \n+
    \n+
    37 inline int size () const;
    \n+
    38
    \n+
    39 private:
    \n+
    40 std :: vector< A > key_, origKey_;
    \n+
    41 bool origKeySet_;
    \n+
    42 };
    \n+
    43
    \n+
    44
    \n+
    45 template< class A >
    \n+
    \n+
    46 inline const A &DGFEntityKey< A > :: operator[] ( int i ) const
    \n+
    47 {
    \n+
    48 return key_[ i ];
    \n+
    49 }
    \n
    \n+
    50
    \n
    51
    \n-
    \n-\n-
    70 const std::string& name,
    \n-
    71 const std::string& path,
    \n-
    72 const std::string& extendpath )
    \n-\n-
    74 name,
    \n-
    75 path,
    \n-
    76 extendpath,
    \n-
    77 vtkWriter->gridView_.comm().rank(),
    \n-
    78 vtkWriter->gridView_.comm().size())
    \n-
    79 {}
    \n+
    52 template< class A >
    \n+
    \n+\n+
    54 {
    \n+
    55 // assert(k.key_.size()==key_.size());
    \n+
    56 return key_ < k.key_;
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    59
    \n+
    60 template< class A >
    \n+
    \n+\n+
    62 {
    \n+
    63 return origKeySet_;
    \n+
    64 }
    \n+
    \n+
    65
    \n+
    66
    \n+
    67 template< class A >
    \n+
    \n+
    68 inline const A &DGFEntityKey< A > :: origKey ( int i ) const
    \n+
    69 {
    \n+
    70 return origKey_[ i ];
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    73
    \n+
    74 template< class A >
    \n+
    \n+
    75 inline int DGFEntityKey< A > :: size () const
    \n+
    76 {
    \n+
    77 return key_.size();
    \n+
    78 }
    \n
    \n+
    \n+
    79
    \n
    80
    \n-
    \n-
    87 explicit VTKSequenceWriter ( const GridView &gridView,
    \n-
    88 const std::string& name,
    \n-
    89 const std::string& path,
    \n-
    90 const std::string& extendpath,
    \n-\n-
    92 : VTKSequenceWriterBase<GridView>(std::make_shared<VTKWriter<GridView> >(gridView,dm),
    \n-
    93 name,path,extendpath,
    \n-
    94 gridView.comm().rank(), gridView.comm().size())
    \n-
    95 {}
    \n+
    81
    \n+
    82 // ElementFaceUtil
    \n+
    83 // ---------------
    \n+
    84
    \n+
    \n+\n+
    86 {
    \n+
    87 inline static int nofFaces ( int dim, const std::vector< unsigned int > &element );
    \n+
    88 inline static int faceSize ( int dim, bool simpl );
    \n+
    89
    \n+\n+
    91 generateFace ( int dim, const std::vector< unsigned int > &element, int f );
    \n+
    92
    \n+
    93 private:
    \n+
    94 template< int dim >
    \n+\n+
    96 generateCubeFace( const std::vector< unsigned int > &element, int f );
    \n+
    97
    \n+
    98 template< int dim >
    \n+\n+
    100 generateSimplexFace ( const std::vector< unsigned int > &element, int f );
    \n+
    101 };
    \n+
    \n+
    102
    \n+
    103
    \n+
    \n+
    104 inline int ElementFaceUtil::nofFaces ( int dim, const std::vector< unsigned int > &element )
    \n+
    105 {
    \n+
    106 switch( dim )
    \n+
    107 {
    \n+
    108 case 1 :
    \n+
    109 return 2;
    \n+
    110 case 2 :
    \n+
    111 switch( element.size() )
    \n+
    112 {
    \n+
    113 case 3 :
    \n+
    114 return 3;
    \n+
    115 case 4 :
    \n+
    116 return 4;
    \n+
    117 default :
    \n+
    118 return -1;
    \n+
    119 }
    \n+
    120 case 3 :
    \n+
    121 switch( element.size() )
    \n+
    122 {
    \n+
    123 case 4 :
    \n+
    124 return 4;
    \n+
    125 case 8 :
    \n+
    126 return 6;
    \n+
    127 default :
    \n+
    128 return -1;
    \n+
    129 }
    \n+
    130 default :
    \n+
    131 return -1;
    \n+
    132 }
    \n+
    133 }
    \n+
    \n+
    134
    \n+
    135
    \n+
    \n+
    136 inline int ElementFaceUtil::faceSize( int dim, bool simpl )
    \n+
    137 {
    \n+
    138 switch( dim )
    \n+
    139 {
    \n+
    140 case 1 :
    \n+
    141 return 1;
    \n+
    142 case 2 :
    \n+
    143 return 2;
    \n+
    144 case 3 :
    \n+
    145 return (simpl ? 3 : 4);
    \n+
    146 default :
    \n+
    147 return -1;
    \n+
    148 }
    \n+
    149 }
    \n+
    \n+
    150
    \n+
    151} //end namespace Dune
    \n+
    152
    \n+
    153// include inline implementation
    \n+
    154#include "entitykey_inline.hh"
    \n+
    155#endif
    \n
    \n-
    96 };
    \n
    \n-
    97
    \n-
    98} // end namespace Dune
    \n-
    99
    \n-
    100#endif
    \n-
    Provides subsampled file i/o for the visualization toolkit.
    \n-
    Provides file i/o for the visualization toolkit.
    \n-\n-
    STL namespace.
    \n+
    \n+
    \n+
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    DataMode
    Whether to produce conforming or non-conforming output.
    Definition common.hh:67
    \n-
    @ conforming
    Output conforming data.
    Definition common.hh:73
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    Writer for the output of grid functions in the vtk format.
    Definition vtksequencewriter.hh:29
    \n-
    VTKSequenceWriter(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const std::string &name, const std::string &path, const std::string &extendpath)
    Constructor with a given VTKWriter or SubsamplingVTKWriter.
    Definition vtksequencewriter.hh:69
    \n-
    VTKSequenceWriter(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const std::string &name)
    Constructor with a given VTKWriter or SubsamplingVTKWriter.
    Definition vtksequencewriter.hh:42
    \n-
    VTKSequenceWriter(const GridView &gridView, const std::string &name, const std::string &path, const std::string &extendpath, VTK::DataMode dm=VTK::conforming)
    Constructor creating its own VTKWriter object.
    Definition vtksequencewriter.hh:87
    \n-
    Base class to write pvd-files which contains a list of all collected vtk-files.
    Definition vtksequencewriterbase.hh:34
    \n-
    const std::shared_ptr< VTKWriter< GridView > > & vtkWriter() const
    Definition vtksequencewriterbase.hh:63
    \n-
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n+
    Definition entitykey.hh:21
    \n+
    bool operator<(const DGFEntityKey< A > &k) const
    Definition entitykey.hh:53
    \n+
    DGFEntityKey< A > & operator=(const DGFEntityKey< A > &k)
    Definition entitykey_inline.hh:64
    \n+
    bool origKeySet() const
    Definition entitykey.hh:61
    \n+
    int size() const
    Definition entitykey.hh:75
    \n+
    void orientation(int base, std ::vector< std ::vector< double > > &vtx)
    Definition entitykey_inline.hh:78
    \n+
    const A & origKey(int i) const
    Definition entitykey.hh:68
    \n+
    DGFEntityKey(const std::vector< A > &key, int N, int offset, bool setOrigKey=true)
    \n+
    void print(std ::ostream &out=std ::cerr) const
    Definition entitykey_inline.hh:105
    \n+
    const A & operator[](int i) const
    Definition entitykey.hh:46
    \n+
    Definition entitykey.hh:86
    \n+
    static DGFEntityKey< unsigned int > generateFace(int dim, const std::vector< unsigned int > &element, int f)
    Definition entitykey_inline.hh:145
    \n+
    static int faceSize(int dim, bool simpl)
    Definition entitykey.hh:136
    \n+
    static int nofFaces(int dim, const std::vector< unsigned int > &element)
    Definition entitykey.hh:104
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,121 +2,218 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-vtksequencewriter.hh\n+ * dgfparser\n+entitykey.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_VTKSEQUENCE_HH\n-7#define DUNE_VTKSEQUENCE_HH\n-8\n-9#include \n+5#ifndef DUNE_DGFEnTITYKEY_HH\n+6#define DUNE_DGFEnTITYKEY_HH\n+7\n+8#include \n+9#include \n 10\n-11#include \n+11#include \n 12\n-13#include \n-14#include \n+13namespace Dune\n+14{\n 15\n-16namespace Dune {\n-17\n-26 template< class GridView >\n-27 class VTKSequenceWriter :\n-28 public VTKSequenceWriterBase\n-29 {\n-30 public:\n-42 VTKSequenceWriter ( std::shared_ptr > vtkWriter,\n-43 const std::string& name )\n-44 : VTKSequenceWriterBase(vtkWriter,\n-45 name,\n-46 \"\",\n-47 \"\",\n-48 vtkWriter->gridView_.comm().rank(),\n-49 vtkWriter->gridView_.comm().size())\n-50 {}\n+16 // DGFEntityKey\n+17 // ------------\n+18\n+19 template< class A >\n+20 struct DGFEntityKey\n+21 {\n+22 DGFEntityKey ( const std :: vector< A > &key, bool setOrigKey = true );\n+23 DGFEntityKey ( const std::vector< A > &key,\n+24 int N, int offset, bool setOrigKey = true );\n+25 DGFEntityKey ( const DGFEntityKey<_A_> &k );\n+26\n+27 DGFEntityKey<_A_> &operator=_( const DGFEntityKey<_A_> &k );\n+28\n+29 inline const A &operator[]_( int i ) const;\n+30 inline bool operator_<_( const DGFEntityKey<_A_> &k ) const;\n+31\n+32 void orientation ( int base, std :: vector< std :: vector< double > > &vtx\n+);\n+33 void print( std :: ostream &out = std :: cerr ) const;\n+34\n+35 inline bool origKeySet () const;\n+36 inline const A &origKey ( int i ) const;\n+37 inline int size () const;\n+38\n+39 private:\n+40 std :: vector< A > key_, origKey_;\n+41 bool origKeySet_;\n+42 };\n+43\n+44\n+45 template< class A >\n+46 inline const A &DGFEntityKey<_A_>_::_operator[]_( int i ) const\n+47 {\n+48 return key_[ i ];\n+49 }\n+50\n 51\n-69 VTKSequenceWriter ( std::shared_ptr > vtkWriter,\n-70 const std::string& name,\n-71 const std::string& path,\n-72 const std::string& extendpath )\n-73 : VTKSequenceWriterBase(vtkWriter,\n-74 name,\n-75 path,\n-76 extendpath,\n-77 vtkWriter->gridView_.comm().rank(),\n-78 vtkWriter->gridView_.comm().size())\n-79 {}\n+52 template< class A >\n+53 inline bool DGFEntityKey<_A_>_::_operator<_( const DGFEntityKey<_A_> &k )\n+const\n+54 {\n+55 // assert(k.key_.size()==key_.size());\n+56 return key_ < k.key_;\n+57 }\n+58\n+59\n+60 template< class A >\n+61 inline bool DGFEntityKey<_A_>_::_origKeySet () const\n+62 {\n+63 return origKeySet_;\n+64 }\n+65\n+66\n+67 template< class A >\n+68 inline const A &DGFEntityKey<_A_>_::_origKey ( int i ) const\n+69 {\n+70 return origKey_[ i ];\n+71 }\n+72\n+73\n+74 template< class A >\n+75 inline int DGFEntityKey<_A_>_::_size () const\n+76 {\n+77 return key_.size();\n+78 }\n+79\n 80\n-87 explicit VTKSequenceWriter ( const GridView &gridView,\n-88 const std::string& name,\n-89 const std::string& path,\n-90 const std::string& extendpath,\n-91 VTK::DataMode dm = VTK::conforming )\n-92 : VTKSequenceWriterBase(std::make_shared >\n-(gridView,dm),\n-93 name,path,extendpath,\n-94 gridView.comm().rank(), gridView.comm().size())\n-95 {}\n-96 };\n+81\n+82 // ElementFaceUtil\n+83 // ---------------\n+84\n+85 struct ElementFaceUtil\n+86 {\n+87 inline static int nofFaces ( int dim, const std::vector< unsigned int >\n+&element );\n+88 inline static int faceSize ( int dim, bool simpl );\n+89\n+90 static DGFEntityKey<_unsigned_int_>\n+91 generateFace ( int dim, const std::vector< unsigned int > &element, int f );\n+92\n+93 private:\n+94 template< int dim >\n+95 static DGFEntityKey<_unsigned_int_>\n+96 generateCubeFace( const std::vector< unsigned int > &element, int f );\n 97\n-98} // end namespace Dune\n-99\n-100#endif\n-subsamplingvtkwriter.hh\n-Provides subsampled file i/o for the visualization toolkit.\n-vtkwriter.hh\n-Provides file i/o for the visualization toolkit.\n-vtksequencewriterbase.hh\n-std\n-STL namespace.\n+98 template< int dim >\n+99 static DGFEntityKey<_unsigned_int_>\n+100 generateSimplexFace ( const std::vector< unsigned int > &element, int f );\n+101 };\n+102\n+103\n+104 inline int ElementFaceUtil::nofFaces ( int dim, const std::vector< unsigned\n+int > &element )\n+105 {\n+106 switch( dim )\n+107 {\n+108 case 1 :\n+109 return 2;\n+110 case 2 :\n+111 switch( element.size() )\n+112 {\n+113 case 3 :\n+114 return 3;\n+115 case 4 :\n+116 return 4;\n+117 default :\n+118 return -1;\n+119 }\n+120 case 3 :\n+121 switch( element.size() )\n+122 {\n+123 case 4 :\n+124 return 4;\n+125 case 8 :\n+126 return 6;\n+127 default :\n+128 return -1;\n+129 }\n+130 default :\n+131 return -1;\n+132 }\n+133 }\n+134\n+135\n+136 inline int ElementFaceUtil::faceSize( int dim, bool simpl )\n+137 {\n+138 switch( dim )\n+139 {\n+140 case 1 :\n+141 return 1;\n+142 case 2 :\n+143 return 2;\n+144 case 3 :\n+145 return (simpl ? 3 : 4);\n+146 default :\n+147 return -1;\n+148 }\n+149 }\n+150\n+151} //end namespace Dune\n+152\n+153// include inline implementation\n+154#include \"entitykey_inline.hh\"\n+155#endif\n+dgfexception.hh\n+entitykey_inline.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::DataMode\n-DataMode\n-Whether to produce conforming or non-conforming output.\n-Definition common.hh:67\n-Dune::VTK::conforming\n-@ conforming\n-Output conforming data.\n-Definition common.hh:73\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::VTKSequenceWriter\n-Writer for the output of grid functions in the vtk format.\n-Definition vtksequencewriter.hh:29\n-Dune::VTKSequenceWriter::VTKSequenceWriter\n-VTKSequenceWriter(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const\n-std::string &name, const std::string &path, const std::string &extendpath)\n-Constructor with a given VTKWriter or SubsamplingVTKWriter.\n-Definition vtksequencewriter.hh:69\n-Dune::VTKSequenceWriter::VTKSequenceWriter\n-VTKSequenceWriter(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const\n-std::string &name)\n-Constructor with a given VTKWriter or SubsamplingVTKWriter.\n-Definition vtksequencewriter.hh:42\n-Dune::VTKSequenceWriter::VTKSequenceWriter\n-VTKSequenceWriter(const GridView &gridView, const std::string &name, const\n-std::string &path, const std::string &extendpath, VTK::DataMode dm=VTK::\n-conforming)\n-Constructor creating its own VTKWriter object.\n-Definition vtksequencewriter.hh:87\n-Dune::VTKSequenceWriterBase\n-Base class to write pvd-files which contains a list of all collected vtk-files.\n-Definition vtksequencewriterbase.hh:34\n-Dune::VTKSequenceWriterBase::vtkWriter\n-const std::shared_ptr< VTKWriter< GridView > > & vtkWriter() const\n-Definition vtksequencewriterbase.hh:63\n-Dune::VTKWriter\n-Writer for the output of grid functions in the vtk format.\n-Definition vtkwriter.hh:95\n+Dune::DGFEntityKey\n+Definition entitykey.hh:21\n+Dune::DGFEntityKey::operator<\n+bool operator<(const DGFEntityKey< A > &k) const\n+Definition entitykey.hh:53\n+Dune::DGFEntityKey::operator=\n+DGFEntityKey< A > & operator=(const DGFEntityKey< A > &k)\n+Definition entitykey_inline.hh:64\n+Dune::DGFEntityKey::origKeySet\n+bool origKeySet() const\n+Definition entitykey.hh:61\n+Dune::DGFEntityKey::size\n+int size() const\n+Definition entitykey.hh:75\n+Dune::DGFEntityKey::orientation\n+void orientation(int base, std ::vector< std ::vector< double > > &vtx)\n+Definition entitykey_inline.hh:78\n+Dune::DGFEntityKey::origKey\n+const A & origKey(int i) const\n+Definition entitykey.hh:68\n+Dune::DGFEntityKey::DGFEntityKey\n+DGFEntityKey(const std::vector< A > &key, int N, int offset, bool\n+setOrigKey=true)\n+Dune::DGFEntityKey::print\n+void print(std ::ostream &out=std ::cerr) const\n+Definition entitykey_inline.hh:105\n+Dune::DGFEntityKey::operator[]\n+const A & operator[](int i) const\n+Definition entitykey.hh:46\n+Dune::ElementFaceUtil\n+Definition entitykey.hh:86\n+Dune::ElementFaceUtil::generateFace\n+static DGFEntityKey< unsigned int > generateFace(int dim, const std::vector<\n+unsigned int > &element, int f)\n+Definition entitykey_inline.hh:145\n+Dune::ElementFaceUtil::faceSize\n+static int faceSize(int dim, bool simpl)\n+Definition entitykey.hh:136\n+Dune::ElementFaceUtil::nofFaces\n+static int nofFaces(int dim, const std::vector< unsigned int > &element)\n+Definition entitykey.hh:104\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00956.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00956.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtksequencewriterbase.hh File Reference\n+dune-grid: entitykey_inline.hh File Reference\n \n \n \n \n \n \n \n@@ -65,42 +65,29 @@\n
    \n
    \n
    \n
    \n \n \n \n
    \n \n-
    vtksequencewriterbase.hh File Reference
    \n+
    entitykey_inline.hh File Reference
    \n
    \n
    \n-
    #include <vector>
    \n-#include <iostream>
    \n-#include <sstream>
    \n-#include <fstream>
    \n-#include <iomanip>
    \n-#include <memory>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n-#include <dune/common/path.hh>
    \n-#include <dune/grid/io/file/vtk/vtkwriter.hh>
    \n+
    #include <algorithm>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n-\n-

    \n-Classes

    class  Dune::VTKSequenceWriterBase< GridView >
     Base class to write pvd-files which contains a list of all collected vtk-files. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,31 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-Classes | Namespaces\n-vtksequencewriterbase.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * dgfparser\n+Namespaces\n+entitykey_inline.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::VTKSequenceWriterBase<_GridView_>\n-\u00a0 Base class to write pvd-files which contains a list of all collected\n- vtk-files. More...\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00956_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00956_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtksequencewriterbase.hh Source File\n+dune-grid: entitykey_inline.hh Source File\n \n \n \n \n \n \n \n@@ -70,209 +70,230 @@\n
    \n \n \n \n \n \n \n
    \n-
    vtksequencewriterbase.hh
    \n+
    entitykey_inline.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH
    \n-
    8
    \n-
    9#include <vector>
    \n-
    10#include <iostream>
    \n-
    11#include <sstream>
    \n-
    12#include <fstream>
    \n-
    13#include <iomanip>
    \n-
    14#include <memory>
    \n-
    15
    \n-\n-
    17#include <dune/common/path.hh>
    \n-
    18
    \n-\n-
    20
    \n-
    21namespace Dune {
    \n-
    22
    \n-
    32 template<class GridView>
    \n-
    \n-\n-
    34 {
    \n-
    35 std::shared_ptr<VTKWriter<GridView> > vtkWriter_;
    \n-
    36 std::vector<double> timesteps_;
    \n-
    37 std::string name_,path_,extendpath_;
    \n-
    38 int rank_;
    \n-
    39 int size_;
    \n-
    40 public:
    \n-
    \n-\n-
    48 const std::string& name,
    \n-
    49 const std::string& path,
    \n-
    50 const std::string& extendpath,
    \n-
    51 int rank,
    \n-
    52 int size)
    \n-
    53 : vtkWriter_(vtkWriter),
    \n-
    54 name_(name), path_(path),
    \n-
    55 extendpath_(extendpath),
    \n-
    56 rank_(rank),
    \n-
    57 size_(size)
    \n-
    58 {}
    \n-
    \n-
    59
    \n-
    \n-
    63 const std::shared_ptr< VTKWriter<GridView> >& vtkWriter() const
    \n-
    64 {
    \n-
    65 return vtkWriter_;
    \n-
    66 }
    \n-
    \n-
    67
    \n-
    \n-
    69 void addCellData (const std::shared_ptr<const typename VTKWriter<GridView>::VTKFunction> &p)
    \n-
    70 {
    \n-
    71 vtkWriter_->addCellData(p);
    \n-
    72 }
    \n-
    \n-
    73
    \n-
    79 template<class V >
    \n-
    \n-
    80 void addCellData (const V &v, const std::string &name, int ncomps=1)
    \n-
    81 {
    \n-
    82 vtkWriter_->addCellData(v, name, ncomps);
    \n-
    83 }
    \n-
    \n-
    84
    \n-
    \n-
    86 void addVertexData (const std::shared_ptr<const typename VTKWriter<GridView>::VTKFunction> &p)
    \n-
    87 {
    \n-
    88 vtkWriter_->addVertexData(p);
    \n-
    89 }
    \n-
    \n-
    90
    \n-
    96 template<class V >
    \n-
    \n-
    97 void addVertexData (const V &v, const std::string &name, int ncomps=1)
    \n-
    98 {
    \n-
    99 vtkWriter_->addVertexData(v, name, ncomps);
    \n+
    5#ifndef DUNE_ENTITYKEY_INLINE_HH
    \n+
    6#define DUNE_ENTITYKEY_INLINE_HH
    \n+
    7
    \n+
    8#include <algorithm>
    \n+
    9#include <dune/geometry/referenceelements.hh>
    \n+\n+
    11
    \n+
    12namespace Dune
    \n+
    13{
    \n+
    14
    \n+
    15 // DGFEntityKey
    \n+
    16 // ------------
    \n+
    17
    \n+
    18 template< class A >
    \n+
    \n+
    19 inline DGFEntityKey< A > :: DGFEntityKey ( const std :: vector< A > &key, bool setOrigKey )
    \n+
    20 : key_( key.size() ),
    \n+
    21 origKey_( key.size() ),
    \n+
    \n+
    22 origKeySet_( setOrigKey )
    \n+
    23 {
    \n+
    24 for (size_t i=0; i<key_.size(); i++)
    \n+
    \n+
    25 {
    \n+
    26 key_[i]=key[i];
    \n+
    \n+
    27 origKey_[i]=key_[i];
    \n+
    28 }
    \n+
    29 std :: sort( key_.begin(), key_.end() );
    \n+
    30 }
    \n+
    31
    \n+
    \n+\n+
    \n+
    33 template< class A >
    \n+
    34 inline DGFEntityKey< A > :: DGFEntityKey ( const std :: vector< A > &key,
    \n+
    35 int N, int offset, bool setOrigKey )
    \n+
    36 : key_( N ),
    \n+
    37 origKey_( N ),
    \n+
    38 origKeySet_( setOrigKey )
    \n+
    39 {
    \n+
    40 for (size_t i=0; i<key_.size(); i++)
    \n+
    41 {
    \n+
    42 key_[i]=key[(i+offset)%key.size()];
    \n+
    43 origKey_[i]=key[(i+offset)%key.size()];
    \n+
    44 }
    \n+
    45 std :: sort( key_.begin(), key_.end() );
    \n+
    46 }
    \n+
    47
    \n+
    48
    \n+
    49 template< class A >
    \n+
    \n+\n+
    51 : key_( k.key_.size() ),
    \n+
    52 origKey_( k.key_.size() ),
    \n+
    53 origKeySet_( k. origKeySet_ )
    \n+
    54 {
    \n+
    55 for (size_t i=0; i<key_.size(); i++)
    \n+
    56 {
    \n+
    57 key_[i]=k.key_[i];
    \n+
    58 origKey_[i]=k.origKey_[i];
    \n+
    59 }
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    62
    \n+
    63 template< class A >
    \n+
    \n+\n+
    65 {
    \n+
    66 assert(key_.size()==k.key_.size());
    \n+
    67 for (size_t i=0; i<key_.size(); i++) {
    \n+
    68 key_[i]=k.key_[i];
    \n+
    69 origKey_[i]=k.origKey_[i];
    \n+
    70 }
    \n+
    71 origKeySet_ = k.origKeySet_;
    \n+
    72 return *this;
    \n+
    73 }
    \n+
    \n+
    74
    \n+
    75
    \n+
    76 template< class A >
    \n+
    77 inline void DGFEntityKey< A >
    \n+
    \n+
    78 :: orientation ( int base, std::vector< std :: vector< double > > &vtx )
    \n+
    79 {
    \n+
    80 if (key_.size()==3) {
    \n+
    81 assert( (size_t) origKey_[0] < vtx.size() );
    \n+
    82 std::vector<double>& p0 = vtx[origKey_[0]];
    \n+
    83 assert( (size_t) origKey_[1] < vtx.size() );
    \n+
    84 std::vector<double>& p1 = vtx[origKey_[1]];
    \n+
    85 assert( (size_t) origKey_[2] < vtx.size() );
    \n+
    86 std::vector<double>& p2 = vtx[origKey_[2]];
    \n+
    87 assert( (size_t) base < vtx.size() );
    \n+
    88 std::vector<double>& q = vtx[base];
    \n+
    89 double n[3];
    \n+
    90 n[0] = (p1[1]-p0[1])*(p2[2]-p0[2])-(p2[1]-p0[1])*(p1[2]-p0[2]);
    \n+
    91 n[1] = (p1[2]-p0[2])*(p2[0]-p0[0])-(p2[2]-p0[2])*(p1[0]-p0[0]);
    \n+
    92 n[2] = (p1[0]-p0[0])*(p2[1]-p0[1])-(p2[0]-p0[0])*(p1[1]-p0[1]);
    \n+
    93 double test = n[0]*(q[0]-p0[0])+n[1]*(q[1]-p0[1])+n[2]*(q[2]-p0[2]);
    \n+
    94 bool reorient = (test>0);
    \n+
    95 if (reorient) {
    \n+
    96 A key1=origKey_[1];
    \n+
    97 origKey_[1]=origKey_[2];
    \n+
    98 origKey_[2]=key1;
    \n+
    99 }
    \n
    100 }
    \n+
    101 }
    \n
    \n-
    101
    \n
    102
    \n-
    \n-
    108 void write (double time, VTK::OutputType type = VTK::ascii)
    \n-
    109 {
    \n-
    110 /* remember current time step */
    \n-
    111 unsigned int count = timesteps_.size();
    \n-
    112 timesteps_.push_back(time);
    \n-
    113
    \n-
    114 /* write VTK file */
    \n-
    115 if(size_==1)
    \n-
    116 vtkWriter_->write(concatPaths(path_,seqName(count)),type);
    \n-
    117 else
    \n-
    118 vtkWriter_->pwrite(seqName(count), path_,extendpath_,type);
    \n-
    119
    \n-
    120 /* write pvd file ... only on rank 0 */
    \n-
    121 if (rank_==0) {
    \n-
    122 std::ofstream pvdFile;
    \n-
    123 pvdFile.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n-
    124 std::ios_base::eofbit);
    \n-
    125 std::string pvdname = name_ + ".pvd";
    \n-
    126 pvdFile.open(pvdname.c_str());
    \n-
    127 pvdFile << "<?xml version=\\"1.0\\"?> \\n"
    \n-
    128 << "<VTKFile type=\\"Collection\\" version=\\"0.1\\" byte_order=\\"" << VTK::getEndiannessString() << "\\"> \\n"
    \n-
    129 << "<Collection> \\n";
    \n-
    130 for (unsigned int i=0; i<=count; i++)
    \n-
    131 {
    \n-
    132 // filename
    \n-
    133 std::string piecepath;
    \n-
    134 std::string fullname;
    \n-
    135 if(size_==1) {
    \n-
    136 piecepath = path_;
    \n-
    137 fullname = vtkWriter_->getSerialPieceName(seqName(i), piecepath);
    \n-
    138 }
    \n-
    139 else {
    \n-
    140 piecepath = concatPaths(path_, extendpath_);
    \n-
    141 fullname = vtkWriter_->getParallelHeaderName(seqName(i), piecepath, size_);
    \n-
    142 }
    \n-
    143 pvdFile << "<DataSet timestep=\\"" << timesteps_[i]
    \n-
    144 << "\\" group=\\"\\" part=\\"0\\" name=\\"\\" file=\\""
    \n-
    145 << fullname << "\\"/> \\n";
    \n-
    146 }
    \n-
    147 pvdFile << "</Collection> \\n"
    \n-
    148 << "</VTKFile> \\n" << std::flush;
    \n-
    149 pvdFile.close();
    \n-
    150 }
    \n-
    151 }
    \n-
    \n-
    152
    \n-
    \n-
    156 void clear()
    \n-
    157 {
    \n-
    158 vtkWriter_->clear();
    \n-
    159 }
    \n-
    \n-
    160
    \n-
    \n-
    164 const std::vector<double>& getTimeSteps() const
    \n-
    165 {
    \n-
    166 return timesteps_;
    \n-
    167 }
    \n-
    \n-
    168
    \n-
    \n-
    174 void setTimeSteps(const std::vector<double>& timesteps)
    \n-
    175 {
    \n-
    176 timesteps_ = timesteps;
    \n-
    177 }
    \n+
    103
    \n+
    104 template< class A >
    \n+
    \n+
    105 inline void DGFEntityKey< A > :: print ( std :: ostream &out ) const
    \n+
    106 {
    \n+
    107 for( size_t i = 0; i < key_.size(); ++i )
    \n+
    108 out << key_[ i ] << " ";
    \n+
    109 out << std :: endl;
    \n+
    110 }
    \n+
    \n+
    \n+
    111
    \n+
    112
    \n+
    113 // ElementFaceUtil
    \n+
    114 // ---------------
    \n+
    115
    \n+
    116 template< int dim >
    \n+\n+
    118 ElementFaceUtil::generateCubeFace
    \n+
    119 ( const std::vector< unsigned int > &element, int f )
    \n+
    120 {
    \n+
    121 auto refCube = ReferenceElements< double, dim >::cube();
    \n+
    122 const unsigned int size = refCube.size( f, 1, dim );
    \n+
    123 std::vector< unsigned int > k( size );
    \n+
    124 for( unsigned int i = 0; i < size; ++ i )
    \n+
    125 k[ i ] = element[ refCube.subEntity( f, 1, i, dim ) ];
    \n+\n+
    127 }
    \n+
    128
    \n+
    129
    \n+
    130 template< int dim >
    \n+\n+
    \n+
    132 ElementFaceUtil :: generateSimplexFace
    \n+
    133 ( const std :: vector< unsigned int > &element, int f )
    \n+
    134 {
    \n+
    135 auto refSimplex = ReferenceElements< double, dim >::simplex();
    \n+
    136 const unsigned int size = refSimplex.size( f, 1, dim );
    \n+
    137 std :: vector< unsigned int > k( size );
    \n+
    138 for( unsigned int i = 0; i < size; ++i )
    \n+
    139 k[ i ] = element[ refSimplex.subEntity( f, 1, i, dim ) ];
    \n+\n+
    141 }
    \n+
    \n+
    142
    \n+
    143
    \n+\n+
    \n+
    145 ElementFaceUtil::generateFace ( int dim, const std::vector< unsigned int > &element, int f )
    \n+
    146 {
    \n+
    147 if( element.size() == size_t(dim+1) )
    \n+
    148 {
    \n+
    149 // Simplex element
    \n+
    150 switch( dim )
    \n+
    151 {
    \n+
    152 case 3 :
    \n+
    153 return generateSimplexFace< 3 >( element, f );
    \n+
    154 case 2 :
    \n+
    155 return generateSimplexFace< 2 >( element, f );
    \n+
    156 case 1 :
    \n+
    157 return generateSimplexFace< 1 >( element, f );
    \n+
    158 default :
    \n+
    159 DUNE_THROW( NotImplemented, "ElementUtil::generateFace not implemented for dim = " << dim << "." );
    \n+
    160 }
    \n+
    161 }
    \n+
    162 else
    \n+
    163 {
    \n+
    164 // Cube element
    \n+
    165 switch( dim )
    \n+
    166 {
    \n+
    167 case 3 :
    \n+
    168 return generateCubeFace< 3 >( element, f );
    \n+
    169 case 2 :
    \n+
    170 return generateCubeFace< 2 >( element, f );
    \n+
    171 case 1 :
    \n+
    172 return generateCubeFace< 1 >( element, f );
    \n+
    173 default :
    \n+
    174 DUNE_THROW( NotImplemented, "ElementUtil::generateFace not implemented for dim = " << dim << "." );
    \n+
    175 }
    \n+
    176 }
    \n+
    177 }
    \n
    \n
    178
    \n-
    179 private:
    \n+
    179} // end namespace Dune
    \n
    180
    \n-
    181 // create sequence name
    \n-
    182 std::string seqName(unsigned int count) const
    \n-
    183 {
    \n-
    184 std::stringstream n;
    \n-
    185 n.fill('0');
    \n-
    186 n << name_ << "-" << std::setw(5) << count;
    \n-
    187 return n.str();
    \n-
    188 }
    \n-
    189 };
    \n-
    \n-
    190
    \n-
    191} // end namespace Dune
    \n-
    192
    \n-
    193#endif
    \n-
    Provides file i/o for the visualization toolkit.
    \n-
    Common stuff for the VTKWriter.
    \n+
    181#endif // DUNE_ENTITYKEY_INLINE_HH
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n-
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n-
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n-
    A base class for grid functions with any return type and dimension.
    Definition function.hh:42
    \n-
    Base class to write pvd-files which contains a list of all collected vtk-files.
    Definition vtksequencewriterbase.hh:34
    \n-
    void addVertexData(const V &v, const std::string &name, int ncomps=1)
    Adds a field of vertex data to the VTK file.
    Definition vtksequencewriterbase.hh:97
    \n-
    const std::vector< double > & getTimeSteps() const
    Retrieve the current list of time steps.
    Definition vtksequencewriterbase.hh:164
    \n-
    const std::shared_ptr< VTKWriter< GridView > > & vtkWriter() const
    Definition vtksequencewriterbase.hh:63
    \n-
    void write(double time, VTK::OutputType type=VTK::ascii)
    Writes VTK data for the given time,.
    Definition vtksequencewriterbase.hh:108
    \n-
    void addVertexData(const std::shared_ptr< const typename VTKWriter< GridView >::VTKFunction > &p)
    Adds a field of vertex data to the VTK file.
    Definition vtksequencewriterbase.hh:86
    \n-
    void addCellData(const V &v, const std::string &name, int ncomps=1)
    Adds a field of cell data to the VTK file.
    Definition vtksequencewriterbase.hh:80
    \n-
    VTKSequenceWriterBase(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const std::string &name, const std::string &path, const std::string &extendpath, int rank, int size)
    Set up the VTKSequenceWriterBase class.
    Definition vtksequencewriterbase.hh:47
    \n-
    void addCellData(const std::shared_ptr< const typename VTKWriter< GridView >::VTKFunction > &p)
    Adds a field of cell data to the VTK file.
    Definition vtksequencewriterbase.hh:69
    \n-
    void setTimeSteps(const std::vector< double > &timesteps)
    Set the current list of time steps.
    Definition vtksequencewriterbase.hh:174
    \n-
    void clear()
    Clears all VTK data added to the VTK writer.
    Definition vtksequencewriterbase.hh:156
    \n-
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n+
    Definition entitykey.hh:21
    \n+
    static DGFEntityKey< unsigned int > generateFace(int dim, const std::vector< unsigned int > &element, int f)
    Definition entitykey_inline.hh:145
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,235 +2,209 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-vtksequencewriterbase.hh\n+ * dgfparser\n+entitykey_inline.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH\n-7#define DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n-15\n-16#include \n-17#include \n-18\n-19#include \n-20\n-21namespace Dune {\n-22\n-32 template\n-33 class VTKSequenceWriterBase\n-34 {\n-35 std::shared_ptr > vtkWriter_;\n-36 std::vector timesteps_;\n-37 std::string name_,path_,extendpath_;\n-38 int rank_;\n-39 int size_;\n-40 public:\n-47 explicit VTKSequenceWriterBase( std::shared_ptr >\n-vtkWriter,\n-48 const std::string& name,\n-49 const std::string& path,\n-50 const std::string& extendpath,\n-51 int rank,\n-52 int size)\n-53 : vtkWriter_(vtkWriter),\n-54 name_(name), path_(path),\n-55 extendpath_(extendpath),\n-56 rank_(rank),\n-57 size_(size)\n-58 {}\n-59\n-63 const std::shared_ptr< VTKWriter >& vtkWriter() const\n-64 {\n-65 return vtkWriter_;\n-66 }\n-67\n-69 void addCellData (const std::shared_ptr::\n-VTKFunction> &p)\n-70 {\n-71 vtkWriter_->addCellData(p);\n-72 }\n-73\n-79 template\n-80 void addCellData (const V &v, const std::string &name, int ncomps=1)\n-81 {\n-82 vtkWriter_->addCellData(v, name, ncomps);\n-83 }\n-84\n-86 void addVertexData (const std::shared_ptr::VTKFunction> &p)\n-87 {\n-88 vtkWriter_->addVertexData(p);\n-89 }\n-90\n-96 template\n-97 void addVertexData (const V &v, const std::string &name, int ncomps=1)\n-98 {\n-99 vtkWriter_->addVertexData(v, name, ncomps);\n+5#ifndef DUNE_ENTITYKEY_INLINE_HH\n+6#define DUNE_ENTITYKEY_INLINE_HH\n+7\n+8#include \n+9#include \n+10#include \n+11\n+12namespace Dune\n+13{\n+14\n+15 // DGFEntityKey\n+16 // ------------\n+17\n+18 template< class A >\n+19 inline DGFEntityKey<_A_>_::_DGFEntityKey ( const std :: vector< A > &key,\n+bool setOrigKey )\n+20 : key_( key.size() ),\n+21 origKey_( key.size() ),\n+22 origKeySet_( setOrigKey )\n+23 {\n+24 for (size_t i=0; i\n+34 inline DGFEntityKey<_A_>_::_DGFEntityKey ( const std :: vector< A > &key,\n+35 int N, int offset, bool setOrigKey )\n+36 : key_( N ),\n+37 origKey_( N ),\n+38 origKeySet_( setOrigKey )\n+39 {\n+40 for (size_t i=0; i\n+50 inline DGFEntityKey<_A_>_::_DGFEntityKey ( const DGFEntityKey<_A_> &k )\n+51 : key_( k.key_.size() ),\n+52 origKey_( k.key_.size() ),\n+53 origKeySet_( k. origKeySet_ )\n+54 {\n+55 for (size_t i=0; i\n+64 inline DGFEntityKey<_A_> &DGFEntityKey<_A_>_::_operator=_( const\n+DGFEntityKey<_A_> &k )\n+65 {\n+66 assert(key_.size()==k.key_.size());\n+67 for (size_t i=0; i\n+77 inline void DGFEntityKey<_A_>\n+78_::_orientation ( int base, std::vector< std :: vector< double > > &vtx )\n+79 {\n+80 if (key_.size()==3) {\n+81 assert( (size_t) origKey_[0] < vtx.size() );\n+82 std::vector& p0 = vtx[origKey_[0]];\n+83 assert( (size_t) origKey_[1] < vtx.size() );\n+84 std::vector& p1 = vtx[origKey_[1]];\n+85 assert( (size_t) origKey_[2] < vtx.size() );\n+86 std::vector& p2 = vtx[origKey_[2]];\n+87 assert( (size_t) base < vtx.size() );\n+88 std::vector& q = vtx[base];\n+89 double n[3];\n+90 n[0] = (p1[1]-p0[1])*(p2[2]-p0[2])-(p2[1]-p0[1])*(p1[2]-p0[2]);\n+91 n[1] = (p1[2]-p0[2])*(p2[0]-p0[0])-(p2[2]-p0[2])*(p1[0]-p0[0]);\n+92 n[2] = (p1[0]-p0[0])*(p2[1]-p0[1])-(p2[0]-p0[0])*(p1[1]-p0[1]);\n+93 double test = n[0]*(q[0]-p0[0])+n[1]*(q[1]-p0[1])+n[2]*(q[2]-p0[2]);\n+94 bool reorient = (test>0);\n+95 if (reorient) {\n+96 A key1=origKey_[1];\n+97 origKey_[1]=origKey_[2];\n+98 origKey_[2]=key1;\n+99 }\n 100 }\n-101\n+101 }\n 102\n-108 void write (double time, VTK::OutputType type = VTK::ascii)\n-109 {\n-110 /* remember current time step */\n-111 unsigned int count = timesteps_.size();\n-112 timesteps_.push_back(time);\n-113\n-114 /* write VTK file */\n-115 if(size_==1)\n-116 vtkWriter_->write(concatPaths(path_,seqName(count)),type);\n-117 else\n-118 vtkWriter_->pwrite(seqName(count), path_,extendpath_,type);\n-119\n-120 /* write pvd file ... only on rank 0 */\n-121 if (rank_==0) {\n-122 std::ofstream pvdFile;\n-123 pvdFile.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n-124 std::ios_base::eofbit);\n-125 std::string pvdname = name_ + \".pvd\";\n-126 pvdFile.open(pvdname.c_str());\n-127 pvdFile << \" \\n\"\n-128 << \" \\n\"\n-129 << \" \\n\";\n-130 for (unsigned int i=0; i<=count; i++)\n-131 {\n-132 // filename\n-133 std::string piecepath;\n-134 std::string fullname;\n-135 if(size_==1) {\n-136 piecepath = path_;\n-137 fullname = vtkWriter_->getSerialPieceName(seqName(i), piecepath);\n-138 }\n-139 else {\n-140 piecepath = concatPaths(path_, extendpath_);\n-141 fullname = vtkWriter_->getParallelHeaderName(seqName(i), piecepath, size_);\n-142 }\n-143 pvdFile << \" \\n\";\n-146 }\n-147 pvdFile << \" \\n\"\n-148 << \" \\n\" << std::flush;\n-149 pvdFile.close();\n-150 }\n-151 }\n-152\n-156 void clear()\n-157 {\n-158 vtkWriter_->clear();\n-159 }\n-160\n-164 const std::vector& getTimeSteps() const\n-165 {\n-166 return timesteps_;\n-167 }\n-168\n-174 void setTimeSteps(const std::vector& timesteps)\n-175 {\n-176 timesteps_ = timesteps;\n+103\n+104 template< class A >\n+105 inline void DGFEntityKey<_A_>_::_print ( std :: ostream &out ) const\n+106 {\n+107 for( size_t i = 0; i < key_.size(); ++i )\n+108 out << key_[ i ] << \" \";\n+109 out << std :: endl;\n+110 }\n+111\n+112\n+113 // ElementFaceUtil\n+114 // ---------------\n+115\n+116 template< int dim >\n+117 inline DGFEntityKey<_unsigned_int_>\n+118 ElementFaceUtil::generateCubeFace\n+119 ( const std::vector< unsigned int > &element, int f )\n+120 {\n+121 auto refCube = ReferenceElements< double, dim >::cube();\n+122 const unsigned int size = refCube.size( f, 1, dim );\n+123 std::vector< unsigned int > k( size );\n+124 for( unsigned int i = 0; i < size; ++ i )\n+125 k[ i ] = element[ refCube.subEntity( f, 1, i, dim ) ];\n+126 return DGFEntityKey<_unsigned_int_>( k );\n+127 }\n+128\n+129\n+130 template< int dim >\n+131 inline DGFEntityKey<_unsigned_int_>\n+132 ElementFaceUtil :: generateSimplexFace\n+133 ( const std :: vector< unsigned int > &element, int f )\n+134 {\n+135 auto refSimplex = ReferenceElements< double, dim >::simplex();\n+136 const unsigned int size = refSimplex.size( f, 1, dim );\n+137 std :: vector< unsigned int > k( size );\n+138 for( unsigned int i = 0; i < size; ++i )\n+139 k[ i ] = element[ refSimplex.subEntity( f, 1, i, dim ) ];\n+140 return DGFEntityKey<_unsigned_int_>( k );\n+141 }\n+142\n+143\n+144 inline DGFEntityKey<_unsigned_int_>\n+145 ElementFaceUtil::generateFace ( int dim, const std::vector< unsigned int >\n+&element, int f )\n+146 {\n+147 if( element.size() == size_t(dim+1) )\n+148 {\n+149 // Simplex element\n+150 switch( dim )\n+151 {\n+152 case 3 :\n+153 return generateSimplexFace< 3 >( element, f );\n+154 case 2 :\n+155 return generateSimplexFace< 2 >( element, f );\n+156 case 1 :\n+157 return generateSimplexFace< 1 >( element, f );\n+158 default :\n+159 DUNE_THROW( NotImplemented, \"ElementUtil::generateFace not implemented for\n+dim = \" << dim << \".\" );\n+160 }\n+161 }\n+162 else\n+163 {\n+164 // Cube element\n+165 switch( dim )\n+166 {\n+167 case 3 :\n+168 return generateCubeFace< 3 >( element, f );\n+169 case 2 :\n+170 return generateCubeFace< 2 >( element, f );\n+171 case 1 :\n+172 return generateCubeFace< 1 >( element, f );\n+173 default :\n+174 DUNE_THROW( NotImplemented, \"ElementUtil::generateFace not implemented for\n+dim = \" << dim << \".\" );\n+175 }\n+176 }\n 177 }\n 178\n-179 private:\n+179} // end namespace Dune\n 180\n-181 // create sequence name\n-182 std::string seqName(unsigned int count) const\n-183 {\n-184 std::stringstream n;\n-185 n.fill('0');\n-186 n << name_ << \"-\" << std::setw(5) << count;\n-187 return n.str();\n-188 }\n-189 };\n-190\n-191} // end namespace Dune\n-192\n-193#endif\n-vtkwriter.hh\n-Provides file i/o for the visualization toolkit.\n-common.hh\n-Common stuff for the VTKWriter.\n+181#endif // DUNE_ENTITYKEY_INLINE_HH\n+entitykey.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::OutputType\n-OutputType\n-How the bulk data should be stored in the file.\n-Definition common.hh:43\n-Dune::VTK::ascii\n-@ ascii\n-Output to the file is in ascii.\n-Definition common.hh:45\n-Dune::VTK::getEndiannessString\n-std::string getEndiannessString()\n-determine endianness of this C++ implementation\n-Definition common.hh:232\n-Dune::VTKFunction\n-A base class for grid functions with any return type and dimension.\n-Definition function.hh:42\n-Dune::VTKSequenceWriterBase\n-Base class to write pvd-files which contains a list of all collected vtk-files.\n-Definition vtksequencewriterbase.hh:34\n-Dune::VTKSequenceWriterBase::addVertexData\n-void addVertexData(const V &v, const std::string &name, int ncomps=1)\n-Adds a field of vertex data to the VTK file.\n-Definition vtksequencewriterbase.hh:97\n-Dune::VTKSequenceWriterBase::getTimeSteps\n-const std::vector< double > & getTimeSteps() const\n-Retrieve the current list of time steps.\n-Definition vtksequencewriterbase.hh:164\n-Dune::VTKSequenceWriterBase::vtkWriter\n-const std::shared_ptr< VTKWriter< GridView > > & vtkWriter() const\n-Definition vtksequencewriterbase.hh:63\n-Dune::VTKSequenceWriterBase::write\n-void write(double time, VTK::OutputType type=VTK::ascii)\n-Writes VTK data for the given time,.\n-Definition vtksequencewriterbase.hh:108\n-Dune::VTKSequenceWriterBase::addVertexData\n-void addVertexData(const std::shared_ptr< const typename VTKWriter< GridView\n->::VTKFunction > &p)\n-Adds a field of vertex data to the VTK file.\n-Definition vtksequencewriterbase.hh:86\n-Dune::VTKSequenceWriterBase::addCellData\n-void addCellData(const V &v, const std::string &name, int ncomps=1)\n-Adds a field of cell data to the VTK file.\n-Definition vtksequencewriterbase.hh:80\n-Dune::VTKSequenceWriterBase::VTKSequenceWriterBase\n-VTKSequenceWriterBase(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const\n-std::string &name, const std::string &path, const std::string &extendpath, int\n-rank, int size)\n-Set up the VTKSequenceWriterBase class.\n-Definition vtksequencewriterbase.hh:47\n-Dune::VTKSequenceWriterBase::addCellData\n-void addCellData(const std::shared_ptr< const typename VTKWriter< GridView >::\n-VTKFunction > &p)\n-Adds a field of cell data to the VTK file.\n-Definition vtksequencewriterbase.hh:69\n-Dune::VTKSequenceWriterBase::setTimeSteps\n-void setTimeSteps(const std::vector< double > ×teps)\n-Set the current list of time steps.\n-Definition vtksequencewriterbase.hh:174\n-Dune::VTKSequenceWriterBase::clear\n-void clear()\n-Clears all VTK data added to the VTK writer.\n-Definition vtksequencewriterbase.hh:156\n-Dune::VTKWriter\n-Writer for the output of grid functions in the vtk format.\n-Definition vtkwriter.hh:95\n+Dune::DGFEntityKey\n+Definition entitykey.hh:21\n+Dune::ElementFaceUtil::generateFace\n+static DGFEntityKey< unsigned int > generateFace(int dim, const std::vector<\n+unsigned int > &element, int f)\n+Definition entitykey_inline.hh:145\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00959.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00959.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: basicwriter.hh File Reference\n+dune-grid: macrogrid.hh File Reference\n \n \n \n \n \n \n \n@@ -65,53 +65,40 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    basicwriter.hh File Reference
    \n+
    macrogrid.hh File Reference
    \n
    \n
    \n-
    #include <fstream>
    \n-#include <iomanip>
    \n-#include <iterator>
    \n-#include <list>
    \n-#include <memory>
    \n-#include <sstream>
    \n-#include <string>
    \n-#include <dune/common/parallel/mpiguard.hh>
    \n-#include <dune/common/path.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n-#include <dune/grid/io/file/vtk/functionwriter.hh>
    \n-#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n-#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n+
    #include <iostream>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/grid/io/file/dgfparser/parser.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::VTK::BasicWriter< IteratorFactory >
    class  Dune::MacroGrid
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,36 +2,23 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-basicwriter.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+macrogrid.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::BasicWriter<_IteratorFactory_>\n+class \u00a0 Dune::MacroGrid\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00959_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00959_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: basicwriter.hh Source File\n+dune-grid: macrogrid.hh Source File\n \n \n \n \n \n \n \n@@ -70,494 +70,118 @@\n
    \n \n \n \n \n \n \n
    \n-
    basicwriter.hh
    \n+
    macrogrid.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH
    \n+
    5#ifndef DUNE_DGF_MACROGRID_HH
    \n+
    6#define DUNE_DGF_MACROGRID_HH
    \n+
    7
    \n
    8
    \n-
    9#include <fstream>
    \n-
    10#include <iomanip>
    \n-
    11#include <iterator>
    \n-
    12#include <list>
    \n-
    13#include <memory>
    \n-
    14#include <sstream>
    \n-
    15#include <string>
    \n-
    16
    \n-
    17#include <dune/common/parallel/mpiguard.hh>
    \n-
    18#include <dune/common/path.hh>
    \n-
    19
    \n-
    20#include <dune/geometry/referenceelements.hh>
    \n-
    21
    \n-\n-\n-\n-\n+
    9#include <iostream>
    \n+
    10
    \n+
    11#include <dune/common/parallel/mpihelper.hh>
    \n+\n+
    13
    \n+
    14
    \n+
    15namespace Dune
    \n+
    16{
    \n+
    17 // forward declarations
    \n+
    18 // --------------------
    \n+
    19 class DuneGridFormatParser;
    \n+
    20
    \n+
    \n+\n+
    22 : protected DuneGridFormatParser
    \n+
    23 {
    \n+
    24 template< class GridType >
    \n+
    25 friend struct DGFGridFactory;
    \n
    26
    \n-
    27namespace Dune
    \n-
    28{
    \n-
    31
    \n+
    27 public:
    \n+
    28 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n+
    29
    \n+
    30 protected:
    \n
    \n-
    32 namespace VTK {
    \n-
    33
    \n-
    34 template<typename IteratorFactory>
    \n-
    \n-\n-
    36 typedef typename IteratorFactory::CellIterator CellIterator;
    \n-
    37 typedef typename IteratorFactory::CornerIterator CornerIterator;
    \n-
    38 typedef typename IteratorFactory::PointIterator PointIterator;
    \n-
    39
    \n-
    40 typedef typename IteratorFactory::Cell Cell;
    \n-
    41
    \n-
    42 public:
    \n-\n-
    44
    \n-
    45 private:
    \n-
    46 typedef std::list<std::shared_ptr<FunctionWriter> > WriterList;
    \n-
    47 typedef typename WriterList::const_iterator WIterator;
    \n-
    48
    \n-
    49 typedef typename Cell::Geometry::ctype ctype;
    \n-
    50 static const unsigned celldim = Cell::mydimension;
    \n-
    51 typedef ReferenceElements<ctype, celldim> Refelems;
    \n-
    52
    \n-
    53 static const FileType fileType = celldim == 1
    \n-\n-
    55
    \n-
    56 const IteratorFactory& factory;
    \n-
    57
    \n-
    58 WriterList cellData;
    \n-
    59 WriterList pointData;
    \n-
    60
    \n-\n-
    62 typename IteratorFactory::ConnectivityWriter connectivity;
    \n-
    63 OffsetsWriter<Cell> offsets;
    \n-\n-
    65
    \n-
    66 public:
    \n-
    \n-
    67 BasicWriter(const IteratorFactory& factory_)
    \n-
    68 : factory(factory_), connectivity(factory.makeConnectivity())
    \n-
    69 { }
    \n-
    \n-
    70
    \n-
    72 //
    \n-
    73 // Methods for adding data
    \n-
    74 //
    \n-
    75
    \n-
    \n-
    76 void addCellData(const std::shared_ptr<FunctionWriter>& writer) {
    \n-
    77 cellData.push_back(writer);
    \n-
    78 }
    \n-
    \n-
    79
    \n-
    \n-
    80 void addPointData(const std::shared_ptr<FunctionWriter>& writer) {
    \n-
    81 pointData.push_back(writer);
    \n-
    82 }
    \n-
    \n-
    83
    \n-
    \n-
    84 void clear() {
    \n-
    85 cellData.clear();
    \n-
    86 pointData.clear();
    \n-
    87 }
    \n-
    \n-
    88
    \n-
    89 protected:
    \n-
    91 //
    \n-
    92 // Methods for writing single functions
    \n-
    93 //
    \n-
    94
    \n-
    \n-\n-
    96 FunctionWriter& functionWriter,
    \n-
    97 unsigned ncells) const
    \n-
    98 {
    \n-
    99 if(functionWriter.beginWrite(vtuWriter, ncells)) {
    \n-
    100 const CellIterator& cellend = factory.endCells();
    \n-
    101 for(CellIterator cellit = factory.beginCells(); cellit != cellend;
    \n-
    102 ++cellit)
    \n-
    103 functionWriter.write(*cellit, Refelems::general(cellit->type()).
    \n-
    104 position(0,0));
    \n-
    105 }
    \n-
    106 functionWriter.endWrite();
    \n-
    107 }
    \n-
    \n-
    108
    \n-
    \n-\n-
    110 FunctionWriter& functionWriter,
    \n-
    111 unsigned npoints) const
    \n-
    112 {
    \n-
    113 if(functionWriter.beginWrite(vtuWriter, npoints)) {
    \n-
    114 const PointIterator& pend = factory.endPoints();
    \n-
    115 for(PointIterator pit = factory.beginPoints(); pit != pend; ++pit)
    \n-
    116 functionWriter.write(pit->cell(), pit->duneIndex());
    \n-
    117 }
    \n-
    118 functionWriter.endWrite();
    \n-
    119 }
    \n-
    \n-
    120
    \n-
    \n-\n-
    122 FunctionWriter& functionWriter,
    \n-
    123 unsigned ncorners) const
    \n-
    124 {
    \n-
    125 if(functionWriter.beginWrite(vtuWriter, ncorners)) {
    \n-
    126 const CornerIterator& cend = factory.endCorners();
    \n-
    127 for(CornerIterator cit = factory.beginCorners(); cit != cend; ++cit)
    \n-
    128 functionWriter.write(cit->cell(), cit->duneIndex());
    \n-
    129 }
    \n-
    130 functionWriter.endWrite();
    \n-
    131 }
    \n-
    \n-
    132
    \n-
    134 //
    \n-
    135 // Methods for writing whole sections
    \n-
    136 //
    \n-
    137
    \n-
    \n-
    138 static std::string getFirstScalar(const WriterList& data) {
    \n-
    139 for(auto&& d : data)
    \n-
    140 if (d->ncomps() == 1)
    \n-
    141 return d->name();
    \n-
    142 return "";
    \n-
    143 }
    \n-
    \n-
    144
    \n-
    \n-
    145 static std::string getFirstVector(const WriterList& data) {
    \n-
    146 for(auto&& d : data)
    \n-
    147 if (d->ncomps() == 3)
    \n-
    148 return d->name();
    \n-
    149 return "";
    \n-
    150 }
    \n-
    \n-
    151
    \n-
    \n-
    152 void writeCellData(VTUWriter& vtuWriter, unsigned ncells) const {
    \n-
    153 if(cellData.empty()) return;
    \n-
    154
    \n-
    155 vtuWriter.beginCellData(getFirstScalar(cellData),
    \n-
    156 getFirstVector(cellData));
    \n-
    157
    \n-
    158 for (auto&& cD : cellData)
    \n-
    159 writeCellFunction(vtuWriter, *cD, ncells);
    \n-
    160 vtuWriter.endCellData();
    \n-
    161 }
    \n-
    \n-
    162
    \n-
    \n-
    163 void writePointData(VTUWriter& vtuWriter, unsigned npoints) const {
    \n-
    164 if(pointData.empty()) return;
    \n-
    165
    \n-
    166 vtuWriter.beginPointData(getFirstScalar(pointData),
    \n-
    167 getFirstVector(pointData));
    \n-
    168
    \n-
    169 for (auto&& pD : pointData)
    \n-
    170 writePointFunction(vtuWriter, *pD, npoints);
    \n-
    171 vtuWriter.endPointData();
    \n-
    172 }
    \n-
    \n-
    173
    \n-
    \n-
    174 void writeGrid(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,
    \n-
    175 unsigned ncorners) {
    \n-
    176 vtuWriter.beginPoints();
    \n-
    177 writePointFunction(vtuWriter, coords, npoints);
    \n-
    178 vtuWriter.endPoints();
    \n-
    179
    \n-
    180 vtuWriter.beginCells();
    \n-
    181 writeCornerFunction(vtuWriter, connectivity, ncorners);
    \n-
    182 writeCellFunction(vtuWriter, offsets, ncells);
    \n-
    183 if(fileType != polyData)
    \n-
    184 writeCellFunction(vtuWriter, types, ncells);
    \n-
    185 vtuWriter.endCells();
    \n-
    186 }
    \n-
    \n-
    187
    \n-
    \n-
    188 void writeAll(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,
    \n-
    189 unsigned ncorners) {
    \n-
    190 writeCellData(vtuWriter, ncells);
    \n-
    191 writePointData(vtuWriter, npoints);
    \n-
    192 writeGrid(vtuWriter, ncells, npoints, ncorners);
    \n-
    193 }
    \n-
    \n-
    194
    \n-
    195 public:
    \n-
    \n-
    196 void writePiece(const std::string& filename, OutputType outputType) {
    \n-
    197 std::ofstream stream;
    \n-
    198 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n-
    199 std::ios_base::eofbit);
    \n-
    200 stream.open(filename.c_str(), std::ios::binary);
    \n-
    201
    \n-
    202 VTUWriter vtuWriter(stream, outputType, fileType);
    \n-
    203
    \n-
    204 unsigned ncells = std::distance(factory.beginCells(),
    \n-
    205 factory.endCells());
    \n-
    206 unsigned npoints = std::distance(factory.beginPoints(),
    \n-
    207 factory.endPoints());
    \n-
    208 unsigned ncorners = std::distance(factory.beginCorners(),
    \n-
    209 factory.endCorners());
    \n-
    210
    \n-
    211 vtuWriter.beginMain(ncells, npoints);
    \n-
    212 writeAll(vtuWriter, ncells, npoints, ncorners);
    \n-
    213 vtuWriter.endMain();
    \n-
    214
    \n-
    215 if(vtuWriter.beginAppended())
    \n-
    216 writeAll(vtuWriter, ncells, npoints, ncorners);
    \n-
    217 vtuWriter.endAppended();
    \n-
    218
    \n-
    219 }
    \n-
    \n-
    220
    \n-
    222
    \n-
    \n-
    238 void writeCollection(const std::string name,
    \n-
    239 const std::string& piecename,
    \n-
    240 const std::string& piecepath)
    \n-
    241 {
    \n-
    242 std::ofstream stream;
    \n-
    243 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n-
    244 std::ios_base::eofbit);
    \n-
    245 stream.open(name.c_str(), std::ios::binary);
    \n-
    246
    \n-
    247 PVTUWriter writer(stream, fileType);
    \n-
    248
    \n-
    249 writer.beginMain();
    \n-
    250
    \n-
    251 // PPointData
    \n-
    252 writer.beginPointData(getFirstScalar(pointData),
    \n-
    253 getFirstVector(pointData));
    \n-
    254 for(WIterator it=pointData.begin(); it!=pointData.end(); ++it)
    \n-
    255 (*it)->addArray(writer);
    \n-
    256 writer.endPointData();
    \n-
    257
    \n-
    258 // PCellData
    \n-
    259 writer.beginCellData(getFirstScalar(cellData),
    \n-
    260 getFirstVector(cellData));
    \n-
    261 for(WIterator it=cellData.begin(); it!=cellData.end(); ++it)
    \n-
    262 (*it)->addArray(writer);
    \n-
    263 writer.endCellData();
    \n-
    264
    \n-
    265 // PPoints
    \n-
    266 writer.beginPoints();
    \n-
    267 coords.addArray(writer);
    \n-
    268 writer.endPoints();
    \n-
    269
    \n-
    270 // Pieces
    \n-
    271 for( int i = 0; i < factory.comm().size(); ++i )
    \n-
    272 writer.addPiece(getParallelPieceName(piecename, piecepath, i));
    \n-
    273
    \n-
    274 writer.endMain();
    \n-
    275 }
    \n-
    \n-
    276
    \n-
    278 //
    \n-
    279 // Filename generators
    \n-
    280 //
    \n-
    281
    \n-
    283
    \n-
    \n-
    293 std::string getParallelPieceName(const std::string& name,
    \n-
    294 const std::string& path, int rank) const
    \n-
    295 {
    \n-
    296 std::ostringstream s;
    \n-
    297 if(path.size() > 0) {
    \n-
    298 s << path;
    \n-
    299 if(path[path.size()-1] != '/')
    \n-
    300 s << '/';
    \n-
    301 }
    \n-
    302 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()
    \n-
    303 << ':';
    \n-
    304 s << 'p' << std::setw(4) << std::setfill('0') << rank << ':';
    \n-
    305 s << name;
    \n-
    306 switch(fileType) {
    \n-
    307 case polyData : s << ".vtp"; break;
    \n-
    308 case unstructuredGrid : s << ".vtu"; break;
    \n-
    309 }
    \n-
    310 return s.str();
    \n-
    311 }
    \n-
    \n-
    312
    \n-
    314
    \n-
    \n-
    323 std::string getParallelHeaderName(const std::string& name,
    \n-
    324 const std::string& path) const
    \n-
    325 {
    \n-
    326 std::ostringstream s;
    \n-
    327 if(path.size() > 0) {
    \n-
    328 s << path;
    \n-
    329 if(path[path.size()-1] != '/')
    \n-
    330 s << '/';
    \n-
    331 }
    \n-
    332 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()
    \n-
    333 << ':';
    \n-
    334 s << name;
    \n-
    335 switch(fileType) {
    \n-
    336 case polyData : s << ".pvtp"; break;
    \n-
    337 case unstructuredGrid : s << ".pvtu"; break;
    \n-
    338 }
    \n-
    339 return s.str();
    \n-
    340 }
    \n-
    \n-
    341
    \n-
    343
    \n-
    \n-
    355 std::string getSerialPieceName(const std::string& name,
    \n-
    356 const std::string& path) const
    \n-
    357 {
    \n-
    358 switch(fileType) {
    \n-
    359 case polyData : return concatPaths(path, name+".vtp");
    \n-
    360 case unstructuredGrid : return concatPaths(path, name+".vtu");
    \n-
    361 }
    \n-
    362 return concatPaths(path, name); // unknown fileType
    \n-
    363 }
    \n-
    \n-
    364
    \n-
    366 //
    \n-
    367 // User interface functions for writing
    \n-
    368 //
    \n-
    369
    \n-
    371
    \n-
    \n-
    393 std::string pwrite(const std::string& name, const std::string& path,
    \n-
    394 const std::string& extendpath, OutputType outputType)
    \n-
    395 {
    \n-
    396 MPIGuard guard(factory.comm());
    \n-
    397
    \n-
    398 // do some magic because paraview can only cope with relative paths to
    \n-
    399 // piece files
    \n-
    400 std::ofstream file;
    \n-
    401 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n-
    402 std::ios_base::eofbit);
    \n-
    403 std::string piecepath = concatPaths(path, extendpath);
    \n-
    404 std::string relpiecepath = relativePath(path, piecepath);
    \n-
    405
    \n-
    406 // write this processes .vtu/.vtp piece file
    \n-
    407 std::string fullname = getParallelPieceName(name, piecepath,
    \n-
    408 factory.comm().rank());
    \n-
    409 writePiece(fullname, outputType);
    \n-
    410
    \n-
    411 // if we are rank 0, write .pvtu/.pvtp parallel header
    \n-
    412 fullname = getParallelHeaderName(name, path);
    \n-
    413 if(factory.comm().rank() == 0)
    \n-
    414 writeCollection(fullname, name, relpiecepath);
    \n-
    415
    \n-
    416 guard.finalize();
    \n-
    417
    \n-
    418 return fullname;
    \n-
    419 }
    \n-
    \n-
    420
    \n-
    \n-
    434 std::string write(const std::string &name, OutputType outputType)
    \n-
    435 {
    \n-
    436 // in the parallel case, just use pwrite, it has all the necessary
    \n-
    437 // stuff, so we don't need to reimplement it here.
    \n-
    438 if(factory.comm().size() > 1)
    \n-
    439 return pwrite(name, "", "", outputType);
    \n-
    440
    \n-
    441 // generate filename for process data
    \n-
    442 std::string pieceName = getSerialPieceName(name, "");
    \n-
    443
    \n-
    444 writePiece(pieceName, outputType);
    \n-
    445
    \n-
    446 return pieceName;
    \n-
    447 }
    \n-
    \n-
    448
    \n-
    449 };
    \n-
    \n-
    450
    \n-
    451 } // namespace VTK
    \n-
    \n-
    452
    \n-
    454
    \n-
    455} // namespace Dune
    \n-
    456
    \n-
    457#endif // DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH
    \n-\n-\n-
    Common stuff for the VTKWriter.
    \n-\n+
    32 MacroGrid(const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())
    \n+
    33 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )
    \n+
    34 , filename_(filename)
    \n+
    35 , MPICOMM_(MPICOMM) {}
    \n+
    \n+
    36
    \n+
    \n+
    38 MacroGrid(MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())
    \n+
    39 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )
    \n+
    40 , filename_(0)
    \n+
    41 , MPICOMM_(MPICOMM) {}
    \n+
    \n+
    42
    \n+
    44 template <class GridType>
    \n+
    \n+
    45 inline GridType * createGrid ()
    \n+
    46 {
    \n+
    47 return Impl<GridType>::generate(*this,filename_,MPICOMM_);
    \n+
    48 }
    \n+
    \n+
    49 private:
    \n+
    50 static int rank( [[maybe_unused]] MPICommunicatorType MPICOMM )
    \n+
    51 {
    \n+
    52 int rank = 0;
    \n+
    53#if HAVE_MPI
    \n+
    54 MPI_Comm_rank( MPICOMM, &rank );
    \n+
    55#endif
    \n+
    56 return rank;
    \n+
    57 }
    \n+
    58 static int size( [[maybe_unused]] MPICommunicatorType MPICOMM )
    \n+
    59 {
    \n+
    60 int size = 1;
    \n+
    61#if HAVE_MPI
    \n+
    62 MPI_Comm_size( MPICOMM, &size );
    \n+
    63#endif
    \n+
    64 return size;
    \n+
    65 }
    \n+
    77 template< class GridType >
    \n+
    78 struct Impl
    \n+
    79 {
    \n+
    80 static GridType* generate(MacroGrid& mg,
    \n+
    81 const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() )
    \n+
    82 {
    \n+
    83 // make assertion depend on the template argument but always evaluate to false
    \n+
    84 static_assert( GridType::dimension<0,"DGF grid factory missing. Did you forget to add the corresponding dgf header?");
    \n+
    85 }
    \n+
    86 };
    \n+
    87
    \n+
    88 const char* filename_;
    \n+
    89 MPICommunicatorType MPICOMM_;
    \n+
    90 };
    \n+
    \n+
    91
    \n+
    92} // end namespace Dune
    \n+
    93
    \n+
    94#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n-
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n-
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n-
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n-
    Definition basicwriter.hh:35
    \n-
    void writeCellData(VTUWriter &vtuWriter, unsigned ncells) const
    Definition basicwriter.hh:152
    \n-
    BasicWriter(const IteratorFactory &factory_)
    Definition basicwriter.hh:67
    \n-
    std::string getSerialPieceName(const std::string &name, const std::string &path) const
    return name of a serial piece file
    Definition basicwriter.hh:355
    \n-
    void writeCollection(const std::string name, const std::string &piecename, const std::string &piecepath)
    write header file in parallel case to stream
    Definition basicwriter.hh:238
    \n-
    void writeGrid(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned ncorners)
    Definition basicwriter.hh:174
    \n-
    void writeAll(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned ncorners)
    Definition basicwriter.hh:188
    \n-
    std::string pwrite(const std::string &name, const std::string &path, const std::string &extendpath, OutputType outputType)
    write output; interface might change later
    Definition basicwriter.hh:393
    \n-
    void clear()
    Definition basicwriter.hh:84
    \n-
    void writeCellFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned ncells) const
    Definition basicwriter.hh:95
    \n-
    void writeCornerFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned ncorners) const
    Definition basicwriter.hh:121
    \n-
    std::string getParallelHeaderName(const std::string &name, const std::string &path) const
    return name of a parallel header file
    Definition basicwriter.hh:323
    \n-
    void writePointData(VTUWriter &vtuWriter, unsigned npoints) const
    Definition basicwriter.hh:163
    \n-
    static std::string getFirstVector(const WriterList &data)
    Definition basicwriter.hh:145
    \n-
    FunctionWriterBase< Cell > FunctionWriter
    Definition basicwriter.hh:43
    \n-
    void writePointFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned npoints) const
    Definition basicwriter.hh:109
    \n-
    void writePiece(const std::string &filename, OutputType outputType)
    Definition basicwriter.hh:196
    \n-
    void addCellData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:76
    \n-
    static std::string getFirstScalar(const WriterList &data)
    Definition basicwriter.hh:138
    \n-
    std::string getParallelPieceName(const std::string &name, const std::string &path, int rank) const
    return name of a parallel piece file
    Definition basicwriter.hh:293
    \n-
    std::string write(const std::string &name, OutputType outputType)
    write output (interface might change later)
    Definition basicwriter.hh:434
    \n-
    void addPointData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:80
    \n-
    Base class for function writers.
    Definition functionwriter.hh:34
    \n-
    virtual void write(const Cell &, const Domain &)
    write at the given position
    Definition functionwriter.hh:59
    \n-
    virtual void endWrite()=0
    signal end of writing
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0
    start writing with the given writer
    \n-
    writer for the Coordinates array
    Definition functionwriter.hh:147
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition functionwriter.hh:165
    \n-
    writer for the offsets array
    Definition functionwriter.hh:300
    \n-
    writer for the types array
    Definition functionwriter.hh:340
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n-
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition pvtuwriter.hh:195
    \n-
    void endCellData()
    finish CellData section
    Definition pvtuwriter.hh:155
    \n-
    void beginMain(unsigned ghostLevel=0)
    start the main PPolyData/PUnstructuredGrid section
    Definition pvtuwriter.hh:189
    \n-
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition pvtuwriter.hh:146
    \n-
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition pvtuwriter.hh:120
    \n-
    void addPiece(const std::string &filename)
    Add a serial piece to the output file.
    Definition pvtuwriter.hh:215
    \n-
    void endPointData()
    finish PointData section
    Definition pvtuwriter.hh:129
    \n-
    void endPoints()
    finish section for the point coordinates
    Definition pvtuwriter.hh:171
    \n-
    void beginPoints()
    start section for the point coordinates
    Definition pvtuwriter.hh:166
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n-
    bool beginAppended()
    start the appended data section
    Definition vtuwriter.hh:345
    \n-
    void endAppended()
    finish the appended data section
    Definition vtuwriter.hh:359
    \n-
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n-
    void beginMain(unsigned ncells, unsigned npoints)
    start the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:310
    \n-
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n-
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n-
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n-
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n-
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n-
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n-
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n-
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:320
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    Definition macrogrid.hh:23
    \n+
    MacroGrid(const char *filename, MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
    constructor given the name of a DGF file
    Definition macrogrid.hh:32
    \n+
    MacroGrid(MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
    constructor given the name of a DGF file
    Definition macrogrid.hh:38
    \n+
    GridType * createGrid()
    returns pointer to a new instance of type GridType created from a DGF file
    Definition macrogrid.hh:45
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition macrogrid.hh:28
    \n+
    The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures us...
    Definition parser.hh:47
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,605 +2,125 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-basicwriter.hh\n+ * dgfparser\n+macrogrid.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH\n+5#ifndef DUNE_DGF_MACROGRID_HH\n+6#define DUNE_DGF_MACROGRID_HH\n+7\n 8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n-15#include \n-16\n-17#include \n-18#include \n-19\n-20#include \n-21\n-22#include \n-23#include \n-24#include \n-25#include \n+9#include \n+10\n+11#include \n+12#include \n+13\n+14\n+15namespace Dune\n+16{\n+17 // forward declarations\n+18 // --------------------\n+19 class DuneGridFormatParser;\n+20\n+21 class MacroGrid\n+22 : protected DuneGridFormatParser\n+23 {\n+24 template< class GridType >\n+25 friend struct DGFGridFactory;\n 26\n-27namespace Dune\n-28{\n-31\n-32 namespace VTK {\n-33\n-34 template\n-35 class BasicWriter {\n-36 typedef typename IteratorFactory::CellIterator CellIterator;\n-37 typedef typename IteratorFactory::CornerIterator CornerIterator;\n-38 typedef typename IteratorFactory::PointIterator PointIterator;\n-39\n-40 typedef typename IteratorFactory::Cell Cell;\n-41\n-42 public:\n-43 typedef FunctionWriterBase FunctionWriter;\n-44\n-45 private:\n-46 typedef std::list > WriterList;\n-47 typedef typename WriterList::const_iterator WIterator;\n-48\n-49 typedef typename Cell::Geometry::ctype ctype;\n-50 static const unsigned celldim = Cell::mydimension;\n-51 typedef ReferenceElements Refelems;\n-52\n-53 static const FileType fileType = celldim == 1\n-54 ? polyData : unstructuredGrid;\n-55\n-56 const IteratorFactory& factory;\n-57\n-58 WriterList cellData;\n-59 WriterList pointData;\n-60\n-61 CoordinatesWriter coords;\n-62 typename IteratorFactory::ConnectivityWriter connectivity;\n-63 OffsetsWriter offsets;\n-64 TypesWriter types;\n-65\n-66 public:\n-67 BasicWriter(const IteratorFactory& factory_)\n-68 : factory(factory_), connectivity(factory.makeConnectivity())\n-69 { }\n-70\n-72 //\n-73 // Methods for adding data\n-74 //\n-75\n-76 void addCellData(const std::shared_ptr& writer) {\n-77 cellData.push_back(writer);\n-78 }\n-79\n-80 void addPointData(const std::shared_ptr& writer) {\n-81 pointData.push_back(writer);\n-82 }\n-83\n-84 void clear() {\n-85 cellData.clear();\n-86 pointData.clear();\n-87 }\n-88\n-89 protected:\n-91 //\n-92 // Methods for writing single functions\n-93 //\n-94\n-95 void writeCellFunction(VTUWriter& vtuWriter,\n-96 FunctionWriter& functionWriter,\n-97 unsigned ncells) const\n-98 {\n-99 if(functionWriter.beginWrite(vtuWriter, ncells)) {\n-100 const CellIterator& cellend = factory.endCells();\n-101 for(CellIterator cellit = factory.beginCells(); cellit != cellend;\n-102 ++cellit)\n-103 functionWriter.write(*cellit, Refelems::general(cellit->type()).\n-104 position(0,0));\n-105 }\n-106 functionWriter.endWrite();\n-107 }\n-108\n-109 void writePointFunction(VTUWriter& vtuWriter,\n-110 FunctionWriter& functionWriter,\n-111 unsigned npoints) const\n-112 {\n-113 if(functionWriter.beginWrite(vtuWriter, npoints)) {\n-114 const PointIterator& pend = factory.endPoints();\n-115 for(PointIterator pit = factory.beginPoints(); pit != pend; ++pit)\n-116 functionWriter.write(pit->cell(), pit->duneIndex());\n-117 }\n-118 functionWriter.endWrite();\n-119 }\n-120\n-121 void writeCornerFunction(VTUWriter& vtuWriter,\n-122 FunctionWriter& functionWriter,\n-123 unsigned ncorners) const\n-124 {\n-125 if(functionWriter.beginWrite(vtuWriter, ncorners)) {\n-126 const CornerIterator& cend = factory.endCorners();\n-127 for(CornerIterator cit = factory.beginCorners(); cit != cend; ++cit)\n-128 functionWriter.write(cit->cell(), cit->duneIndex());\n-129 }\n-130 functionWriter.endWrite();\n-131 }\n-132\n-134 //\n-135 // Methods for writing whole sections\n-136 //\n-137\n-138 static std::string getFirstScalar(const WriterList& data) {\n-139 for(auto&& d : data)\n-140 if (d->ncomps() == 1)\n-141 return d->name();\n-142 return \"\";\n-143 }\n-144\n-145 static std::string getFirstVector(const WriterList& data) {\n-146 for(auto&& d : data)\n-147 if (d->ncomps() == 3)\n-148 return d->name();\n-149 return \"\";\n-150 }\n-151\n-152 void writeCellData(VTUWriter& vtuWriter, unsigned ncells) const {\n-153 if(cellData.empty()) return;\n-154\n-155 vtuWriter.beginCellData(getFirstScalar(cellData),\n-156 getFirstVector(cellData));\n-157\n-158 for (auto&& cD : cellData)\n-159 writeCellFunction(vtuWriter, *cD, ncells);\n-160 vtuWriter.endCellData();\n-161 }\n-162\n-163 void writePointData(VTUWriter& vtuWriter, unsigned npoints) const {\n-164 if(pointData.empty()) return;\n-165\n-166 vtuWriter.beginPointData(getFirstScalar(pointData),\n-167 getFirstVector(pointData));\n-168\n-169 for (auto&& pD : pointData)\n-170 writePointFunction(vtuWriter, *pD, npoints);\n-171 vtuWriter.endPointData();\n-172 }\n-173\n-174 void writeGrid(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,\n-175 unsigned ncorners) {\n-176 vtuWriter.beginPoints();\n-177 writePointFunction(vtuWriter, coords, npoints);\n-178 vtuWriter.endPoints();\n-179\n-180 vtuWriter.beginCells();\n-181 writeCornerFunction(vtuWriter, connectivity, ncorners);\n-182 writeCellFunction(vtuWriter, offsets, ncells);\n-183 if(fileType != polyData)\n-184 writeCellFunction(vtuWriter, types, ncells);\n-185 vtuWriter.endCells();\n-186 }\n-187\n-188 void writeAll(VTUWriter& vtuWriter, unsigned ncells, unsigned npoints,\n-189 unsigned ncorners) {\n-190 writeCellData(vtuWriter, ncells);\n-191 writePointData(vtuWriter, npoints);\n-192 writeGrid(vtuWriter, ncells, npoints, ncorners);\n-193 }\n-194\n-195 public:\n-196 void writePiece(const std::string& filename, OutputType outputType) {\n-197 std::ofstream stream;\n-198 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n-199 std::ios_base::eofbit);\n-200 stream.open(filename.c_str(), std::ios::binary);\n-201\n-202 VTUWriter vtuWriter(stream, outputType, fileType);\n-203\n-204 unsigned ncells = std::distance(factory.beginCells(),\n-205 factory.endCells());\n-206 unsigned npoints = std::distance(factory.beginPoints(),\n-207 factory.endPoints());\n-208 unsigned ncorners = std::distance(factory.beginCorners(),\n-209 factory.endCorners());\n-210\n-211 vtuWriter.beginMain(ncells, npoints);\n-212 writeAll(vtuWriter, ncells, npoints, ncorners);\n-213 vtuWriter.endMain();\n-214\n-215 if(vtuWriter.beginAppended())\n-216 writeAll(vtuWriter, ncells, npoints, ncorners);\n-217 vtuWriter.endAppended();\n-218\n-219 }\n-220\n-222\n-238 void writeCollection(const std::string name,\n-239 const std::string& piecename,\n-240 const std::string& piecepath)\n-241 {\n-242 std::ofstream stream;\n-243 stream.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n-244 std::ios_base::eofbit);\n-245 stream.open(name.c_str(), std::ios::binary);\n-246\n-247 PVTUWriter writer(stream, fileType);\n-248\n-249 writer.beginMain();\n-250\n-251 // PPointData\n-252 writer.beginPointData(getFirstScalar(pointData),\n-253 getFirstVector(pointData));\n-254 for(WIterator it=pointData.begin(); it!=pointData.end(); ++it)\n-255 (*it)->addArray(writer);\n-256 writer.endPointData();\n-257\n-258 // PCellData\n-259 writer.beginCellData(getFirstScalar(cellData),\n-260 getFirstVector(cellData));\n-261 for(WIterator it=cellData.begin(); it!=cellData.end(); ++it)\n-262 (*it)->addArray(writer);\n-263 writer.endCellData();\n-264\n-265 // PPoints\n-266 writer.beginPoints();\n-267 coords.addArray(writer);\n-268 writer.endPoints();\n-269\n-270 // Pieces\n-271 for( int i = 0; i < factory.comm().size(); ++i )\n-272 writer.addPiece(getParallelPieceName(piecename, piecepath, i));\n-273\n-274 writer.endMain();\n-275 }\n-276\n-278 //\n-279 // Filename generators\n-280 //\n-281\n-283\n-293 std::string getParallelPieceName(const std::string& name,\n-294 const std::string& path, int rank) const\n-295 {\n-296 std::ostringstream s;\n-297 if(path.size() > 0) {\n-298 s << path;\n-299 if(path[path.size()-1] != '/')\n-300 s << '/';\n-301 }\n-302 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()\n-303 << ':';\n-304 s << 'p' << std::setw(4) << std::setfill('0') << rank << ':';\n-305 s << name;\n-306 switch(fileType) {\n-307 case polyData : s << \".vtp\"; break;\n-308 case unstructuredGrid : s << \".vtu\"; break;\n-309 }\n-310 return s.str();\n-311 }\n-312\n-314\n-323 std::string getParallelHeaderName(const std::string& name,\n-324 const std::string& path) const\n-325 {\n-326 std::ostringstream s;\n-327 if(path.size() > 0) {\n-328 s << path;\n-329 if(path[path.size()-1] != '/')\n-330 s << '/';\n-331 }\n-332 s << 's' << std::setw(4) << std::setfill('0') << factory.comm().size()\n-333 << ':';\n-334 s << name;\n-335 switch(fileType) {\n-336 case polyData : s << \".pvtp\"; break;\n-337 case unstructuredGrid : s << \".pvtu\"; break;\n-338 }\n-339 return s.str();\n-340 }\n-341\n-343\n-355 std::string getSerialPieceName(const std::string& name,\n-356 const std::string& path) const\n-357 {\n-358 switch(fileType) {\n-359 case polyData : return concatPaths(path, name+\".vtp\");\n-360 case unstructuredGrid : return concatPaths(path, name+\".vtu\");\n-361 }\n-362 return concatPaths(path, name); // unknown fileType\n-363 }\n-364\n-366 //\n-367 // User interface functions for writing\n-368 //\n-369\n-371\n-393 std::string pwrite(const std::string& name, const std::string& path,\n-394 const std::string& extendpath, OutputType outputType)\n-395 {\n-396 MPIGuard guard(factory.comm());\n-397\n-398 // do some magic because paraview can only cope with relative paths to\n-399 // piece files\n-400 std::ofstream file;\n-401 file.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n-402 std::ios_base::eofbit);\n-403 std::string piecepath = concatPaths(path, extendpath);\n-404 std::string relpiecepath = relativePath(path, piecepath);\n-405\n-406 // write this processes .vtu/.vtp piece file\n-407 std::string fullname = getParallelPieceName(name, piecepath,\n-408 factory.comm().rank());\n-409 writePiece(fullname, outputType);\n-410\n-411 // if we are rank 0, write .pvtu/.pvtp parallel header\n-412 fullname = getParallelHeaderName(name, path);\n-413 if(factory.comm().rank() == 0)\n-414 writeCollection(fullname, name, relpiecepath);\n-415\n-416 guard.finalize();\n-417\n-418 return fullname;\n-419 }\n-420\n-434 std::string write(const std::string &name, OutputType outputType)\n-435 {\n-436 // in the parallel case, just use pwrite, it has all the necessary\n-437 // stuff, so we don't need to reimplement it here.\n-438 if(factory.comm().size() > 1)\n-439 return pwrite(name, \"\", \"\", outputType);\n-440\n-441 // generate filename for process data\n-442 std::string pieceName = getSerialPieceName(name, \"\");\n-443\n-444 writePiece(pieceName, outputType);\n-445\n-446 return pieceName;\n-447 }\n-448\n-449 };\n-450\n-451 } // namespace VTK\n-452\n-454\n-455} // namespace Dune\n-456\n-457#endif // DUNE_GRID_IO_FILE_VTK_BASICWRITER_HH\n-functionwriter.hh\n-vtuwriter.hh\n-common.hh\n-Common stuff for the VTKWriter.\n-pvtuwriter.hh\n+27 public:\n+28 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n+29\n+30 protected:\n+32 MacroGrid(const char* filename, MPICommunicatorType MPICOMM = MPIHelper::\n+getCommunicator())\n+33 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )\n+34 , filename_(filename)\n+35 , MPICOMM_(MPICOMM) {}\n+36\n+38 MacroGrid(MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())\n+39 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )\n+40 , filename_(0)\n+41 , MPICOMM_(MPICOMM) {}\n+42\n+44 template \n+45 inline GridType * createGrid ()\n+46 {\n+47 return Impl::generate(*this,filename_,MPICOMM_);\n+48 }\n+49 private:\n+50 static int rank( [[maybe_unused]] MPICommunicatorType MPICOMM )\n+51 {\n+52 int rank = 0;\n+53#if HAVE_MPI\n+54 MPI_Comm_rank( MPICOMM, &rank );\n+55#endif\n+56 return rank;\n+57 }\n+58 static int size( [[maybe_unused]] MPICommunicatorType MPICOMM )\n+59 {\n+60 int size = 1;\n+61#if HAVE_MPI\n+62 MPI_Comm_size( MPICOMM, &size );\n+63#endif\n+64 return size;\n+65 }\n+77 template< class GridType >\n+78 struct Impl\n+79 {\n+80 static GridType* generate(MacroGrid& mg,\n+81 const char* filename, MPICommunicatorType MPICOMM = MPIHelper::\n+getCommunicator() )\n+82 {\n+83 // make assertion depend on the template argument but always evaluate to\n+false\n+84 static_assert( GridType::dimension<0,\"DGF grid factory missing. Did you\n+forget to add the corresponding dgf header?\");\n+85 }\n+86 };\n+87\n+88 const char* filename_;\n+89 MPICommunicatorType MPICOMM_;\n+90 };\n+91\n+92} // end namespace Dune\n+93\n+94#endif\n+parser.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::OutputType\n-OutputType\n-How the bulk data should be stored in the file.\n-Definition common.hh:43\n-Dune::VTK::FileType\n-FileType\n-which type of VTK file to write\n-Definition common.hh:252\n-Dune::VTK::polyData\n-@ polyData\n-for .vtp files (PolyData)\n-Definition common.hh:254\n-Dune::VTK::unstructuredGrid\n-@ unstructuredGrid\n-for .vtu files (UnstructuredGrid)\n-Definition common.hh:256\n-Dune::VTK::BasicWriter\n-Definition basicwriter.hh:35\n-Dune::VTK::BasicWriter::writeCellData\n-void writeCellData(VTUWriter &vtuWriter, unsigned ncells) const\n-Definition basicwriter.hh:152\n-Dune::VTK::BasicWriter::BasicWriter\n-BasicWriter(const IteratorFactory &factory_)\n-Definition basicwriter.hh:67\n-Dune::VTK::BasicWriter::getSerialPieceName\n-std::string getSerialPieceName(const std::string &name, const std::string\n-&path) const\n-return name of a serial piece file\n-Definition basicwriter.hh:355\n-Dune::VTK::BasicWriter::writeCollection\n-void writeCollection(const std::string name, const std::string &piecename,\n-const std::string &piecepath)\n-write header file in parallel case to stream\n-Definition basicwriter.hh:238\n-Dune::VTK::BasicWriter::writeGrid\n-void writeGrid(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints,\n-unsigned ncorners)\n-Definition basicwriter.hh:174\n-Dune::VTK::BasicWriter::writeAll\n-void writeAll(VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned\n-ncorners)\n-Definition basicwriter.hh:188\n-Dune::VTK::BasicWriter::pwrite\n-std::string pwrite(const std::string &name, const std::string &path, const\n-std::string &extendpath, OutputType outputType)\n-write output; interface might change later\n-Definition basicwriter.hh:393\n-Dune::VTK::BasicWriter::clear\n-void clear()\n-Definition basicwriter.hh:84\n-Dune::VTK::BasicWriter::writeCellFunction\n-void writeCellFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter,\n-unsigned ncells) const\n-Definition basicwriter.hh:95\n-Dune::VTK::BasicWriter::writeCornerFunction\n-void writeCornerFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter,\n-unsigned ncorners) const\n-Definition basicwriter.hh:121\n-Dune::VTK::BasicWriter::getParallelHeaderName\n-std::string getParallelHeaderName(const std::string &name, const std::string\n-&path) const\n-return name of a parallel header file\n-Definition basicwriter.hh:323\n-Dune::VTK::BasicWriter::writePointData\n-void writePointData(VTUWriter &vtuWriter, unsigned npoints) const\n-Definition basicwriter.hh:163\n-Dune::VTK::BasicWriter::getFirstVector\n-static std::string getFirstVector(const WriterList &data)\n-Definition basicwriter.hh:145\n-Dune::VTK::BasicWriter::FunctionWriter\n-FunctionWriterBase< Cell > FunctionWriter\n-Definition basicwriter.hh:43\n-Dune::VTK::BasicWriter::writePointFunction\n-void writePointFunction(VTUWriter &vtuWriter, FunctionWriter &functionWriter,\n-unsigned npoints) const\n-Definition basicwriter.hh:109\n-Dune::VTK::BasicWriter::writePiece\n-void writePiece(const std::string &filename, OutputType outputType)\n-Definition basicwriter.hh:196\n-Dune::VTK::BasicWriter::addCellData\n-void addCellData(const std::shared_ptr< FunctionWriter > &writer)\n-Definition basicwriter.hh:76\n-Dune::VTK::BasicWriter::getFirstScalar\n-static std::string getFirstScalar(const WriterList &data)\n-Definition basicwriter.hh:138\n-Dune::VTK::BasicWriter::getParallelPieceName\n-std::string getParallelPieceName(const std::string &name, const std::string\n-&path, int rank) const\n-return name of a parallel piece file\n-Definition basicwriter.hh:293\n-Dune::VTK::BasicWriter::write\n-std::string write(const std::string &name, OutputType outputType)\n-write output (interface might change later)\n-Definition basicwriter.hh:434\n-Dune::VTK::BasicWriter::addPointData\n-void addPointData(const std::shared_ptr< FunctionWriter > &writer)\n-Definition basicwriter.hh:80\n-Dune::VTK::FunctionWriterBase\n-Base class for function writers.\n-Definition functionwriter.hh:34\n-Dune::VTK::FunctionWriterBase::write\n-virtual void write(const Cell &, const Domain &)\n-write at the given position\n-Definition functionwriter.hh:59\n-Dune::VTK::FunctionWriterBase::endWrite\n-virtual void endWrite()=0\n-signal end of writing\n-Dune::VTK::FunctionWriterBase::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)=0\n-start writing with the given writer\n-Dune::VTK::CoordinatesWriter\n-writer for the Coordinates array\n-Definition functionwriter.hh:147\n-Dune::VTK::CoordinatesWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition functionwriter.hh:165\n-Dune::VTK::OffsetsWriter\n-writer for the offsets array\n-Definition functionwriter.hh:300\n-Dune::VTK::TypesWriter\n-writer for the types array\n-Definition functionwriter.hh:340\n-Dune::VTK::PVTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition pvtuwriter.hh:62\n-Dune::VTK::PVTUWriter::endMain\n-void endMain()\n-finish the main PolyData/UnstructuredGrid section\n-Definition pvtuwriter.hh:195\n-Dune::VTK::PVTUWriter::endCellData\n-void endCellData()\n-finish CellData section\n-Definition pvtuwriter.hh:155\n-Dune::VTK::PVTUWriter::beginMain\n-void beginMain(unsigned ghostLevel=0)\n-start the main PPolyData/PUnstructuredGrid section\n-Definition pvtuwriter.hh:189\n-Dune::VTK::PVTUWriter::beginCellData\n-void beginCellData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start CellData section\n-Definition pvtuwriter.hh:146\n-Dune::VTK::PVTUWriter::beginPointData\n-void beginPointData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start PointData section\n-Definition pvtuwriter.hh:120\n-Dune::VTK::PVTUWriter::addPiece\n-void addPiece(const std::string &filename)\n-Add a serial piece to the output file.\n-Definition pvtuwriter.hh:215\n-Dune::VTK::PVTUWriter::endPointData\n-void endPointData()\n-finish PointData section\n-Definition pvtuwriter.hh:129\n-Dune::VTK::PVTUWriter::endPoints\n-void endPoints()\n-finish section for the point coordinates\n-Definition pvtuwriter.hh:171\n-Dune::VTK::PVTUWriter::beginPoints\n-void beginPoints()\n-start section for the point coordinates\n-Definition pvtuwriter.hh:166\n-Dune::VTK::VTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition vtuwriter.hh:98\n-Dune::VTK::VTUWriter::beginAppended\n-bool beginAppended()\n-start the appended data section\n-Definition vtuwriter.hh:345\n-Dune::VTK::VTUWriter::endAppended\n-void endAppended()\n-finish the appended data section\n-Definition vtuwriter.hh:359\n-Dune::VTK::VTUWriter::endCellData\n-void endCellData()\n-finish CellData section\n-Definition vtuwriter.hh:220\n-Dune::VTK::VTUWriter::beginMain\n-void beginMain(unsigned ncells, unsigned npoints)\n-start the main PolyData/UnstructuredGrid section\n-Definition vtuwriter.hh:310\n-Dune::VTK::VTUWriter::beginCells\n-void beginCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:274\n-Dune::VTK::VTUWriter::endPointData\n-void endPointData()\n-finish PointData section\n-Definition vtuwriter.hh:182\n-Dune::VTK::VTUWriter::beginCellData\n-void beginCellData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start CellData section\n-Definition vtuwriter.hh:205\n-Dune::VTK::VTUWriter::beginPointData\n-void beginPointData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start PointData section\n-Definition vtuwriter.hh:167\n-Dune::VTK::VTUWriter::endPoints\n-void endPoints()\n-finish section for the point coordinates\n-Definition vtuwriter.hh:249\n-Dune::VTK::VTUWriter::endCells\n-void endCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:285\n-Dune::VTK::VTUWriter::beginPoints\n-void beginPoints()\n-start section for the point coordinates\n-Definition vtuwriter.hh:238\n-Dune::VTK::VTUWriter::endMain\n-void endMain()\n-finish the main PolyData/UnstructuredGrid section\n-Definition vtuwriter.hh:320\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::MacroGrid\n+Definition macrogrid.hh:23\n+Dune::MacroGrid::MacroGrid\n+MacroGrid(const char *filename, MPICommunicatorType MPICOMM=MPIHelper::\n+getCommunicator())\n+constructor given the name of a DGF file\n+Definition macrogrid.hh:32\n+Dune::MacroGrid::MacroGrid\n+MacroGrid(MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())\n+constructor given the name of a DGF file\n+Definition macrogrid.hh:38\n+Dune::MacroGrid::createGrid\n+GridType * createGrid()\n+returns pointer to a new instance of type GridType created from a DGF file\n+Definition macrogrid.hh:45\n+Dune::MacroGrid::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition macrogrid.hh:28\n+Dune::DuneGridFormatParser\n+The DuneGridFormatParser class: reads a DGF file and stores build information\n+in vector structures us...\n+Definition parser.hh:47\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00962.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00962.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dataarraywriter.hh File Reference\n+dune-grid: dgfwriter.hh File Reference\n \n \n \n \n \n \n \n@@ -65,78 +65,59 @@\n \n \n \n \n \n \n \n
    \n \n-
    dataarraywriter.hh File Reference
    \n+
    dgfwriter.hh File Reference
    \n
    \n
    \n \n-

    Data array writers for the VTKWriter. \n+

    write a GridView to a DGF file \n More...

    \n-
    #include <cstdint>
    \n-#include <iostream>
    \n+
    #include <cassert>
    \n+#include <cstddef>
    \n+#include <algorithm>
    \n+#include <fstream>
    \n #include <string>
    \n-#include <iomanip>
    \n-#include <cmath>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/indent.hh>
    \n-#include <dune/grid/io/file/vtk/streams.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <type_traits>
    \n+#include <utility>
    \n+#include <vector>
    \n+#include <dune/common/rangeutilities.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/grid/common/grid.hh>
    \n+#include <dune/grid/common/rangegenerators.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::VTK::DataArrayWriter
     base class for data array writers More...
     
    class  Dune::VTK::AsciiDataArrayWriter
     a streaming writer for data array tags, uses ASCII inline format More...
     
    class  Dune::VTK::BinaryDataArrayWriter
     a streaming writer for data array tags, uses binary inline format More...
     
    class  Dune::VTK::AppendedRawDataArrayWriter
     a streaming writer for data array tags, uses appended raw format More...
     
    class  Dune::VTK::AppendedBase64DataArrayWriter
     a streaming writer for data array tags, uses appended base64 format More...
     
    class  Dune::VTK::NakedBase64DataArrayWriter
     a streaming writer for appended data array tags, uses base64 format More...
     
    class  Dune::VTK::NakedRawDataArrayWriter
     a streaming writer for appended data arrays, uses raw format More...
     
    class  Dune::VTK::DataArrayWriterFactory
     a factory for DataArrayWriters More...
    class  Dune::DGFWriter< GV >
     write a GridView to a DGF file More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n

    Detailed Description

    \n-

    Data array writers for the VTKWriter.

    \n-
    Author
    Peter Bastian, Christian Engwer
    \n-

    This file contains classes to help writing data in the difeerent VTK output modes

    \n+

    write a GridView to a DGF file

    \n+
    Author
    Martin Nolte
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,65 +2,40 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-dataarraywriter.hh File Reference\n-Data array writers for the VTKWriter. More...\n-#include \n-#include \n+dgfwriter.hh File Reference\n+write a GridView to a DGF file 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 Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::DataArrayWriter\n-\u00a0 base class for data array writers More...\n-\u00a0\n-class \u00a0 Dune::VTK::AsciiDataArrayWriter\n-\u00a0 a streaming writer for data array tags, uses ASCII inline format\n- More...\n-\u00a0\n-class \u00a0 Dune::VTK::BinaryDataArrayWriter\n-\u00a0 a streaming writer for data array tags, uses binary inline format\n- More...\n-\u00a0\n-class \u00a0 Dune::VTK::AppendedRawDataArrayWriter\n-\u00a0 a streaming writer for data array tags, uses appended raw format\n- More...\n-\u00a0\n-class \u00a0 Dune::VTK::AppendedBase64DataArrayWriter\n-\u00a0 a streaming writer for data array tags, uses appended base64 format\n- More...\n-\u00a0\n-class \u00a0 Dune::VTK::NakedBase64DataArrayWriter\n-\u00a0 a streaming writer for appended data array tags, uses base64 format\n- More...\n-\u00a0\n-class \u00a0 Dune::VTK::NakedRawDataArrayWriter\n-\u00a0 a streaming writer for appended data arrays, uses raw format More...\n-\u00a0\n-class \u00a0 Dune::VTK::DataArrayWriterFactory\n-\u00a0 a factory for DataArrayWriters More...\n+class \u00a0 Dune::DGFWriter<_GV_>\n+\u00a0 write a GridView to a DGF file More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n ***** Detailed Description *****\n-Data array writers for the VTKWriter.\n+write a GridView to a DGF file\n Author\n- Peter Bastian, Christian Engwer\n-This file contains classes to help writing data in the difeerent VTK output\n-modes\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00962_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00962_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dataarraywriter.hh Source File\n+dune-grid: dgfwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,526 +70,466 @@\n
    \n
    \n \n \n \n \n \n
    \n-
    dataarraywriter.hh
    \n+
    dgfwriter.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH
    \n-
    8
    \n-
    9#include <cstdint>
    \n-
    10#include <iostream>
    \n-
    11#include <string>
    \n-
    12#include <iomanip>
    \n-
    13#include <cstdint>
    \n-
    14#include <cmath>
    \n+
    5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH
    \n+
    6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH
    \n+
    7
    \n+
    13#include <cassert>
    \n+
    14#include <cstddef>
    \n
    15
    \n-
    16#include <dune/common/exceptions.hh>
    \n-
    17#include <dune/common/indent.hh>
    \n-
    18
    \n-\n-\n-
    21
    \n-
    30namespace Dune
    \n-
    31{
    \n+
    16#include <algorithm>
    \n+
    17#include <fstream>
    \n+
    18#include <string>
    \n+
    19#include <type_traits>
    \n+
    20#include <utility>
    \n+
    21#include <vector>
    \n+
    22
    \n+
    23#include <dune/common/rangeutilities.hh>
    \n+
    24#include <dune/common/typeutilities.hh>
    \n+
    25
    \n+
    26#include <dune/geometry/referenceelements.hh>
    \n+
    27#include <dune/geometry/type.hh>
    \n+
    28
    \n+\n+\n+
    31
    \n+
    32namespace Dune
    \n+
    33{
    \n
    34
    \n-
    35 namespace VTK {
    \n-
    36
    \n-
    38
    \n-
    \n-\n-
    56 {
    \n-
    57 public:
    \n-
    59
    \n-
    \n-\n-
    64 : prec(_prec)
    \n-
    65 {}
    \n-
    \n+
    44 template< class GV >
    \n+
    \n+\n+
    46 {
    \n+
    47 typedef DGFWriter< GV > This;
    \n+
    48
    \n+
    49 public:
    \n+
    51 typedef GV GridView;
    \n+
    53 typedef typename GridView::Grid Grid;
    \n+
    54
    \n+
    56 static const int dimGrid = GridView::dimension;
    \n+
    57
    \n+
    58 private:
    \n+
    59 typedef typename GridView::IndexSet IndexSet;
    \n+
    60 typedef typename GridView::template Codim< 0 >::Entity Element;
    \n+
    61 typedef typename GridView::Intersection Intersection;
    \n+
    62
    \n+
    63 typedef typename Element::EntitySeed ElementSeed;
    \n+
    64
    \n+
    65 typedef typename IndexSet::IndexType Index;
    \n
    66
    \n-
    68 template<class T>
    \n-
    \n-
    69 void write(T data)
    \n-
    70 {
    \n-
    71 switch(prec)
    \n-
    72 {
    \n-\n-
    74 writeFloat32(data); break;
    \n-\n-
    76 writeFloat64(data); break;
    \n-\n-
    78 writeUInt32(data); break;
    \n-\n-
    80 writeUInt8(data); break;
    \n-\n-
    82 writeInt32(data); break;
    \n-
    83 default:
    \n-
    84 DUNE_THROW(Dune::NotImplemented, "Unknown precision type");
    \n-
    85 }
    \n-
    86 }
    \n-
    \n+
    67 public:
    \n+
    \n+
    72 DGFWriter ( const GridView &gridView )
    \n+
    73 : gridView_( gridView )
    \n+
    74 {}
    \n+
    \n+
    75
    \n+
    85 template< class BoundaryData >
    \n+
    86 void write ( std::ostream &gridout, const std::vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams = std::stringstream() ) const;
    \n
    87
    \n-
    89 virtual bool writeIsNoop() const { return false; }
    \n-
    91 virtual ~DataArrayWriter () {}
    \n-
    92
    \n-
    93 private:
    \n-
    95 virtual void writeFloat32 (float data) = 0;
    \n-
    97 virtual void writeFloat64 (double data) = 0;
    \n-
    99 virtual void writeInt32 (std::int32_t data) = 0;
    \n-
    101 virtual void writeUInt8 (std::uint8_t data) = 0;
    \n-
    103 virtual void writeUInt32 (std::uint32_t data) = 0;
    \n-
    104
    \n-
    105 Precision prec;
    \n-
    106 };
    \n-
    \n-
    107
    \n-
    \n-\n-
    110 {
    \n-
    111 public:
    \n-
    113
    \n-
    \n-
    121 AsciiDataArrayWriter(std::ostream& theStream, std::string name,
    \n-
    122 int ncomps, const Indent& indent_, Precision prec_)
    \n-
    123 : DataArrayWriter(prec_), s(theStream), counter(0), numPerLine(12), indent(indent_)
    \n-
    124 {
    \n-
    125 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n-
    126 << "Name=\\"" << name << "\\" ";
    \n-
    127 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n-
    128 s << "format=\\"ascii\\">\\n";
    \n-
    129 ++indent;
    \n-
    130 }
    \n-
    \n-
    131
    \n-
    \n-\n-
    134 {
    \n-
    135 if (counter%numPerLine!=0) s << "\\n";
    \n-
    136 --indent;
    \n-
    137 s << indent << "</DataArray>\\n";
    \n-
    138 }
    \n-
    \n-
    139
    \n-
    140 private:
    \n-
    142 void writeFloat64 (double data) final
    \n-
    143 { write_float(data); }
    \n-
    145 void writeFloat32 (float data) final
    \n-
    146 { write_float(data); }
    \n-
    148 void writeInt32 (std::int32_t data) final
    \n-
    149 { write_(data); }
    \n-
    151 void writeUInt32 (std::uint32_t data) final
    \n-
    152 { write_(data); }
    \n-
    154 void writeUInt8 (std::uint8_t data) final
    \n-
    155 { write_(data); }
    \n-
    156
    \n-
    157 template<class T>
    \n-
    158 void write_(T data)
    \n-
    159 {
    \n-
    160 typedef typename PrintType<T>::Type PT;
    \n-
    161 if(counter%numPerLine==0) s << indent;
    \n-
    162 else s << " ";
    \n-
    163 const auto original_precision = std::cout.precision();
    \n-
    164 s << std::setprecision(std::numeric_limits<PT>::digits10) << (PT) data;
    \n-
    165 std::cout.precision(original_precision);
    \n-
    166 counter++;
    \n-
    167 if (counter%numPerLine==0) s << "\\n";
    \n-
    168 }
    \n+
    96 template< class BoundaryData >
    \n+
    97 void write ( std::ostream &gridout, BoundaryData &&boundaryData, const std::stringstream &addParams = std::stringstream() ) const;
    \n+
    98
    \n+
    \n+
    107 void write ( std::ostream &gridout, const std::vector< Index > &newElemOrder, const std::stringstream &addParams = std::stringstream() ) const
    \n+
    108 {
    \n+
    109 write( gridout, newElemOrder, [] ( const Intersection &i ) -> int { return boundaryId( i ); }, addParams );
    \n+
    110 }
    \n+
    \n+
    111
    \n+
    \n+
    119 void write ( std::ostream &gridout, const std::stringstream &addParams = std::stringstream() ) const
    \n+
    120 {
    \n+
    121 write( gridout, [] ( const Intersection &i ) -> int { return boundaryId( i ); }, addParams );
    \n+
    122 }
    \n+
    \n+
    123
    \n+
    130 template< class... Args >
    \n+
    \n+
    131 auto write ( const std::string &fileName, Args &&... args ) const
    \n+
    132 -> std::void_t< decltype( this->write( std::declval< std::ostream & >(), std::declval< Args >()... ) ) >
    \n+
    133 {
    \n+
    134 std::ofstream gridout( fileName );
    \n+
    135 if( gridout )
    \n+
    136 write( gridout, std::forward< Args >( args )... );
    \n+
    137 else
    \n+
    138 std::cerr << "Couldn't open file `"<< fileName << "'!"<< std::endl;
    \n+
    139 }
    \n+
    \n+
    140
    \n+
    141 protected:
    \n+
    142 auto elementsSeeds ( const std::vector< Index > &newElemOrder ) const
    \n+
    143 -> std::vector< ElementSeed >;
    \n+
    144
    \n+
    145 void writeHeader ( std::ostream &gridout ) const;
    \n+
    146 void writeFooter ( std::ostream &gridout ) const;
    \n+
    147
    \n+
    148 auto writeVertices ( std::ostream &gridout ) const
    \n+
    149 -> std::vector< Index >;
    \n+
    150
    \n+
    151 void writeElement ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Element &element, const GeometryType &elementType ) const;
    \n+
    152
    \n+
    153 void writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const;
    \n+
    154 void writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;
    \n+
    155
    \n+
    156 void writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const;
    \n+
    157 void writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;
    \n+
    158
    \n+
    159 template< class... Args >
    \n+
    160 void writeElements ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Args &... args ) const;
    \n+
    161
    \n+
    162 private:
    \n+
    163 template< class I >
    \n+
    164 static auto boundaryId ( const I &i, PriorityTag< 1 > )
    \n+
    165 -> std::enable_if_t< std::is_convertible< std::decay_t< decltype( i.impl().boundaryId() ) >, int >::value, int >
    \n+
    166 {
    \n+
    167 return i.impl().boundaryId();
    \n+
    168 }
    \n
    169
    \n-
    170 template<class T>
    \n-
    171 void write_float(T data)
    \n-
    172 {
    \n-
    173 typedef typename PrintType<T>::Type PT;
    \n-
    174 if(counter%numPerLine==0) s << indent;
    \n-
    175 else s << " ";
    \n-
    176 PT out_data = (PT) data;
    \n-
    177 if (std::fpclassify(out_data) == FP_SUBNORMAL)
    \n-
    178 {
    \n-
    179 // truncate denormalized data to 0 to avoid Paraview segfaults on macOS
    \n-
    180 out_data = 0;
    \n-
    181 }
    \n-
    182 const auto original_precision = std::cout.precision();
    \n-
    183 s << std::setprecision(std::numeric_limits<PT>::digits10) << out_data;
    \n-
    184 std::cout.precision(original_precision);
    \n-
    185 counter++;
    \n-
    186 if (counter%numPerLine==0) s << "\\n";
    \n-
    187 }
    \n-
    188
    \n-
    189 std::ostream& s;
    \n-
    190 int counter;
    \n-
    191 int numPerLine;
    \n-
    192 Indent indent;
    \n-
    193 };
    \n-
    \n-
    194
    \n-
    \n-\n-
    197 {
    \n-
    198 public:
    \n-
    200
    \n-
    \n-
    210 BinaryDataArrayWriter(std::ostream& theStream, std::string name,
    \n-
    211 int ncomps, int nitems, const Indent& indent_, Precision prec_)
    \n-
    212 : DataArrayWriter(prec_), s(theStream), b64(theStream), indent(indent_)
    \n-
    213 {
    \n-
    214 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n-
    215 << "Name=\\"" << name << "\\" ";
    \n-
    216 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n-
    217 s << "format=\\"binary\\">\\n";
    \n-
    218
    \n-
    219 // write indentation for the data chunk
    \n-
    220 s << indent+1;
    \n-
    221 // store size, needs to be exactly 32 bit
    \n-
    222 std::uint32_t size = ncomps*nitems*typeSize(prec_);
    \n-
    223 b64.write(size);
    \n-
    224 b64.flush();
    \n-
    225 }
    \n-
    \n-
    226
    \n-
    \n-\n-
    229 {
    \n-
    230 b64.flush();
    \n-
    231 // append newline to written data
    \n-
    232 s << "\\n";
    \n-
    233 s << indent << "</DataArray>\\n";
    \n-
    234 s.flush();
    \n-
    235 }
    \n-
    \n-
    236
    \n-
    237 private:
    \n-
    239 void writeFloat64 (double data) final
    \n-
    240 { write_(data); }
    \n-
    242 void writeFloat32 (float data) final
    \n-
    243 { write_(data); }
    \n-
    245 void writeInt32 (std::int32_t data) final
    \n-
    246 { write_(data); }
    \n-
    248 void writeUInt32 (std::uint32_t data) final
    \n-
    249 { write_(data); }
    \n-
    251 void writeUInt8 (std::uint8_t data) final
    \n-
    252 { write_(data); }
    \n-
    253
    \n-
    255 template<class T>
    \n-
    256 void write_(T data)
    \n-
    257 {
    \n-
    258 b64.write(data);
    \n-
    259 }
    \n-
    260
    \n-
    261 std::ostream& s;
    \n-
    262 Base64Stream b64;
    \n-
    263 const Indent& indent;
    \n-
    264 };
    \n-
    \n-
    265
    \n-
    \n-\n-
    268 {
    \n-
    269 public:
    \n-
    271
    \n-
    \n-
    283 AppendedRawDataArrayWriter(std::ostream& s, std::string name,
    \n-
    284 int ncomps, unsigned nitems, unsigned& offset,
    \n-
    285 const Indent& indent, Precision prec_)
    \n-
    286 : DataArrayWriter(prec_)
    \n-
    287 {
    \n-
    288 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n-
    289 << "Name=\\"" << name << "\\" ";
    \n-
    290 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n-
    291 s << "format=\\"appended\\" offset=\\""<< offset << "\\" />\\n";
    \n-
    292 offset += 4; // header
    \n-
    293 offset += ncomps*nitems*typeSize(prec_);
    \n-
    294 }
    \n-
    \n-
    295
    \n-
    297 bool writeIsNoop() const { return true; }
    \n-
    298
    \n-
    299 private:
    \n-
    301 void writeFloat64 (double) final {}
    \n-
    302 void writeFloat32 (float) final {}
    \n-
    303 void writeInt32 (std::int32_t) final {}
    \n-
    304 void writeUInt32 (std::uint32_t) final {}
    \n-
    305 void writeUInt8 (std::uint8_t) final {}
    \n-
    306 };
    \n-
    \n-
    307
    \n-
    \n-\n-
    310 {
    \n-
    311 public:
    \n-
    313
    \n-
    \n-
    325 AppendedBase64DataArrayWriter(std::ostream& s, std::string name,
    \n-
    326 int ncomps, unsigned nitems,
    \n-
    327 unsigned& offset, const Indent& indent, Precision prec_)
    \n-
    328 : DataArrayWriter(prec_)
    \n-
    329 {
    \n-
    330 s << indent << "<DataArray type=\\"" << toString(prec_) << "\\" "
    \n-
    331 << "Name=\\"" << name << "\\" ";
    \n-
    332 s << "NumberOfComponents=\\"" << ncomps << "\\" ";
    \n-
    333 s << "format=\\"appended\\" offset=\\""<< offset << "\\" />\\n";
    \n-
    334 offset += 8; // header
    \n-
    335 std::size_t bytes = ncomps*nitems*typeSize(prec_);
    \n-
    336 offset += bytes/3*4;
    \n-
    337 if(bytes%3 != 0)
    \n-
    338 offset += 4;
    \n-
    339 }
    \n+
    170 template< class I >
    \n+
    171 static int boundaryId ( const I &i, PriorityTag< 0 > )
    \n+
    172 {
    \n+
    173 return 1;
    \n+
    174 }
    \n+
    175
    \n+
    176 protected:
    \n+
    177 static int boundaryId ( const Intersection &i ) { return boundaryId( i, PriorityTag< 42 >() ); }
    \n+
    178
    \n+
    179 private:
    \n+
    180 static int boundaryId ( const Intersection &, int bndId ) { return bndId; }
    \n+
    181 static int boundaryId ( const Intersection &i, const std::string & ) { return boundaryId( i ); }
    \n+
    182 static int boundaryId ( const Intersection &i, const std::pair< int, std::string > &data ) { return boundrayId( i, data.first ); }
    \n+
    183
    \n+
    184 static void appendBoundaryData ( std::ostream &gridout, int ) { gridout << std::endl; }
    \n+
    185 static void appendBoundaryData ( std::ostream &gridout, std::pair< int, std::string > &data ) { appendBoundaryData( gridout, data.second ); }
    \n+
    186 static void appendBoundaryData ( std::ostream &gridout, const std::string &s ) { gridout << " : " << s << std::endl; }
    \n+
    187
    \n+
    188 protected:
    \n+
    189 template< class BoundaryData >
    \n+
    190 void writeBoundaries ( std::ostream &gridout, const std::vector< Index > &dgfIndices, BoundaryData &&boundaryData ) const;
    \n+
    191
    \n+
    \n+
    192 void writeBoundaries ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const
    \n+
    193 {
    \n+
    194 writeBoundaries( gridout, dgfIndices, [] ( const Intersection &i ) -> int { return boundaryId( i ); } );
    \n+
    195 }
    \n+
    \n+
    196
    \n+
    197 protected:
    \n+\n+
    199 };
    \n
    \n+
    200
    \n+
    201
    \n+
    202 template< class GV >
    \n+
    \n+
    203 inline auto DGFWriter< GV >::elementsSeeds ( const std::vector< Index > &newElemOrder ) const
    \n+
    204 -> std::vector< ElementSeed >
    \n+
    205 {
    \n+
    206 const IndexSet &indexSet = gridView_.indexSet();
    \n+
    207
    \n+
    208 const std::size_t orderSize = newElemOrder.size() ;
    \n+
    209 std::vector< ElementSeed > elementSeeds( orderSize );
    \n+
    210
    \n+
    211 for( const Element &element : elements( gridView_ ) )
    \n+
    212 {
    \n+
    213 assert( newElemOrder[ indexSet.index( element ) ] < orderSize );
    \n+
    214 elementSeeds[ newElemOrder[ indexSet.index( element ) ] ] = element.seed();
    \n+
    215 }
    \n+
    216
    \n+
    217 return elementSeeds;
    \n+
    218 }
    \n+
    \n+
    219
    \n+
    220
    \n+
    221 template< class GV >
    \n+
    \n+
    222 inline void DGFWriter< GV >::writeHeader ( std::ostream &gridout ) const
    \n+
    223 {
    \n+
    224 // set the stream to full double precision
    \n+
    225 gridout.setf( std::ios_base::scientific, std::ios_base::floatfield );
    \n+
    226 gridout.precision( 16 );
    \n+
    227
    \n+
    228 const IndexSet &indexSet = gridView_.indexSet();
    \n+
    229
    \n+
    230 // write DGF header
    \n+
    231 gridout << "DGF" << std::endl;
    \n+
    232 gridout << "%" << " Elements = " << indexSet.size( 0 ) << " | Vertices = " << indexSet.size( dimGrid ) << std::endl;
    \n+
    233 }
    \n+
    \n+
    234
    \n+
    235
    \n+
    236 template< class GV >
    \n+
    \n+
    237 inline void DGFWriter< GV >::writeFooter ( std::ostream &gridout ) const
    \n+
    238 {
    \n+
    239 gridout << std::endl << "#" << std::endl;
    \n+
    240 }
    \n+
    \n+
    241
    \n+
    242
    \n+
    243 template< class GV >
    \n+
    \n+
    244 inline auto DGFWriter< GV >::writeVertices ( std::ostream &gridout ) const
    \n+
    245 -> std::vector< Index >
    \n+
    246 {
    \n+
    247 const IndexSet &indexSet = gridView_.indexSet();
    \n+
    248
    \n+
    249 const Index vxSize = indexSet.size( dimGrid );
    \n+
    250 std::vector< Index > dgfIndices( vxSize, vxSize );
    \n+
    251
    \n+
    252 // write all vertices into the "vertex" block
    \n+
    253 gridout << std::endl << "VERTEX" << std::endl;
    \n+
    254 Index vertexCount = 0;
    \n+
    255 for( const Element &element : elements( gridView_ ) )
    \n+
    256 {
    \n+
    257 for( auto i : range( element.subEntities( dimGrid ) ) )
    \n+
    258 {
    \n+
    259 const Index vxIndex = indexSet.subIndex( element, i, dimGrid );
    \n+
    260 assert( vxIndex < vxSize );
    \n+
    261 if( dgfIndices[ vxIndex ] == vxSize )
    \n+
    262 {
    \n+
    263 dgfIndices[ vxIndex ] = vertexCount++;
    \n+
    264 gridout << element.geometry().corner( i ) << std::endl;
    \n+
    265 }
    \n+
    266 }
    \n+
    267 }
    \n+
    268 gridout << "#" << std::endl;
    \n+
    269
    \n+
    270 if( vertexCount != vxSize )
    \n+
    271 DUNE_THROW( GridError, "IndexSet reports wrong number of vertices." );
    \n+
    272 return dgfIndices;
    \n+
    273 }
    \n+
    \n+
    274
    \n+
    275
    \n+
    276 template< class GV >
    \n+
    \n+
    277 inline void DGFWriter< GV >::writeElement ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Element &element, const GeometryType &elementType ) const
    \n+
    278 {
    \n+
    279 // if element's type is not the same as the type to write the return
    \n+
    280 if( element.type() != elementType )
    \n+
    281 return;
    \n+
    282
    \n+
    283 // write vertex numbers of the element
    \n+
    284 const IndexSet &indexSet = gridView_.indexSet();
    \n+
    285 for( auto i : range( element.subEntities( Element::dimension ) ) )
    \n+
    286 gridout << (i > 0 ? " " : "") << dgfIndices[ indexSet.subIndex( element, i, dimGrid ) ];
    \n+
    287 gridout << std::endl;
    \n+
    288 }
    \n+
    \n+
    289
    \n+
    290
    \n+
    291 template< class GV >
    \n+
    \n+
    292 inline void DGFWriter< GV >::writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const
    \n+
    293 {
    \n+
    294 // write all simplices to the "simplex" block
    \n+
    295 gridout << std::endl << "SIMPLEX" << std::endl;
    \n+
    296
    \n+
    297 // write all simplex elements
    \n+
    298 for( const Element &element : elements( gridView_ ) )
    \n+
    299 writeElement( gridout, dgfIndices, element, GeometryTypes::simplex( dimGrid ) );
    \n+
    300
    \n+
    301 // write end marker for block
    \n+
    302 gridout << "#" << std::endl;
    \n+
    303 }
    \n+
    \n+
    304
    \n+
    305
    \n+
    306 template< class GV >
    \n+
    \n+
    307 inline void DGFWriter< GV >::writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const
    \n+
    308 {
    \n+
    309 // write all simplices to the "simplex" block
    \n+
    310 gridout << std::endl << "SIMPLEX" << std::endl;
    \n+
    311
    \n+
    312 // write all simplex elements
    \n+
    313 for( const ElementSeed &seed : elementSeeds )
    \n+
    314 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ), GeometryTypes::simplex( dimGrid ) );
    \n+
    315
    \n+
    316 // write end marker for block
    \n+
    317 gridout << "#" << std::endl;
    \n+
    318 }
    \n+
    \n+
    319
    \n+
    320
    \n+
    321 template< class GV >
    \n+
    \n+
    322 inline void DGFWriter< GV >::writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const
    \n+
    323 {
    \n+
    324 // write all cubes to the "cube" block
    \n+
    325 gridout << std::endl << "CUBE" << std::endl;
    \n+
    326
    \n+
    327 // write all cube elements
    \n+
    328 for( const Element &element : elements( gridView_ ) )
    \n+
    329 writeElement( gridout, dgfIndices, element, GeometryTypes::cube( dimGrid ) );
    \n+
    330
    \n+
    331 // write end marker for block
    \n+
    332 gridout << "#" << std::endl;
    \n+
    333 }
    \n+
    \n+
    334
    \n+
    335
    \n+
    336 template< class GV >
    \n+
    \n+
    337 inline void DGFWriter< GV >::writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const
    \n+
    338 {
    \n+
    339 const IndexSet &indexSet = gridView_.indexSet();
    \n
    340
    \n-
    342 bool writeIsNoop() const { return true; }
    \n+
    341 // write all cubes to the "cube" block
    \n+
    342 gridout << std::endl << "CUBE" << std::endl;
    \n
    343
    \n-
    344 private:
    \n-
    346 void writeFloat64 (double) final {}
    \n-
    347 void writeFloat32 (float) final {}
    \n-
    348 void writeInt32 (std::int32_t) final {}
    \n-
    349 void writeUInt32 (std::uint32_t) final {}
    \n-
    350 void writeUInt8 (std::uint8_t) final {}
    \n-
    351 };
    \n+
    344 // write all cube elements
    \n+
    345 for( const ElementSeed &seed : elementSeeds )
    \n+
    346 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ), GeometryTypes::cube( dimGrid ) );
    \n+
    347
    \n+
    348 // write end marker for block
    \n+
    349 gridout << "#" << std::endl;
    \n+
    350 }
    \n
    \n+
    351
    \n
    352
    \n-
    354 //
    \n-
    355 // Naked ArrayWriters for the appended section
    \n-
    356 //
    \n-
    357
    \n-
    \n-\n-
    360 {
    \n-
    361 public:
    \n-
    363
    \n+
    353 template< class GV >
    \n+
    354 template< class... Args >
    \n+
    \n+
    355 inline void DGFWriter< GV >::writeElements ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Args &... args ) const
    \n+
    356 {
    \n+
    357 const IndexSet &indexSet = gridView_.indexSet();
    \n+
    358
    \n+
    359 if( (dimGrid > 1) && (indexSet.size( GeometryTypes::simplex( dimGrid ) ) > 0) )
    \n+
    360 writeSimplices( gridout, dgfIndices, args... );
    \n+
    361
    \n+
    362 if( indexSet.size( GeometryTypes::cube( dimGrid ) ) > 0 )
    \n+
    363 writeCubes( gridout, dgfIndices, args... );
    \n+
    364 }
    \n+
    \n+
    365
    \n+
    366
    \n+
    367 template< class GV >
    \n+
    368 template< class BoundaryData >
    \n
    \n-
    369 NakedBase64DataArrayWriter(std::ostream& theStream, int ncomps,
    \n-
    370 int nitems, Precision prec_)
    \n-
    371 : DataArrayWriter(prec_), b64(theStream)
    \n-
    372 {
    \n-
    373 // store size
    \n-
    374 std::uint32_t size = ncomps*nitems*typeSize(prec_);
    \n-
    375 b64.write(size);
    \n-
    376 b64.flush();
    \n-
    377 }
    \n-
    \n-
    378
    \n-
    379 private:
    \n-
    381 void writeFloat64 (double data) final
    \n-
    382 { write_(data); }
    \n-
    384 void writeFloat32 (float data) final
    \n-
    385 { write_(data); }
    \n-
    387 void writeInt32 (std::int32_t data) final
    \n-
    388 { write_(data); }
    \n-
    390 void writeUInt32 (std::uint32_t data) final
    \n-
    391 { write_(data); }
    \n-
    393 void writeUInt8 (std::uint8_t data) final
    \n-
    394 { write_(data); }
    \n-
    395
    \n-
    397 template<class T>
    \n-
    398 void write_(T data)
    \n-
    399 {
    \n-
    400 b64.write(data);
    \n+
    369 inline void DGFWriter< GV >::writeBoundaries ( std::ostream &gridout, const std::vector< Index > &dgfIndices, BoundaryData &&boundaryData ) const
    \n+
    370 {
    \n+
    371 using std::max;
    \n+
    372
    \n+
    373 const IndexSet &indexSet = gridView_.indexSet();
    \n+
    374
    \n+
    375 // write all boundaries to the "boundarysegments" block
    \n+
    376 gridout << std::endl << "BOUNDARYSEGMENTS" << std::endl;
    \n+
    377
    \n+
    378 for( const Element &element : elements( gridView_ ) )
    \n+
    379 {
    \n+
    380 if( !element.hasBoundaryIntersections() )
    \n+
    381 continue;
    \n+
    382
    \n+
    383 const auto &refElement = ReferenceElements< typename Grid::ctype, dimGrid >::general( element.type() );
    \n+
    384 for( const Intersection &intersection : intersections( gridView_, element ) )
    \n+
    385 {
    \n+
    386 if( !intersection.boundary() )
    \n+
    387 continue;
    \n+
    388
    \n+
    389 const auto data = boundaryData( intersection );
    \n+
    390 const int bndId = max( boundaryId( intersection, data ), 1 );
    \n+
    391
    \n+
    392 const int faceNumber = intersection.indexInInside();
    \n+
    393 const unsigned int faceSize = refElement.size( faceNumber, 1, dimGrid );
    \n+
    394 gridout << bndId << " ";
    \n+
    395 for( auto i : range( faceSize ) )
    \n+
    396 {
    \n+
    397 const int j = refElement.subEntity( faceNumber, 1, i, dimGrid );
    \n+
    398 gridout << " " << dgfIndices[ indexSet.subIndex( element, j, dimGrid ) ];
    \n+
    399 }
    \n+
    400 appendBoundaryData( gridout, data );
    \n
    401 }
    \n-
    402
    \n-
    403 Base64Stream b64;
    \n-
    404 };
    \n+
    402 }
    \n+
    403 gridout << "#" << std::endl;
    \n+
    404 }
    \n
    \n
    405
    \n-
    \n-\n-
    408 {
    \n-
    409 RawStream s;
    \n-
    410
    \n-
    411 public:
    \n-
    413
    \n-
    \n-
    419 NakedRawDataArrayWriter(std::ostream& theStream, int ncomps,
    \n-
    420 int nitems, Precision prec_)
    \n-
    421 : DataArrayWriter(prec_), s(theStream)
    \n-
    422 {
    \n-
    423 s.write((unsigned int)(ncomps*nitems*typeSize(prec_)));
    \n-
    424 }
    \n-
    \n-
    425
    \n-
    426 private:
    \n-
    428 void writeFloat64 (double data) final
    \n-
    429 { write_(data); }
    \n-
    431 void writeFloat32 (float data) final
    \n-
    432 { write_(data); }
    \n-
    434 void writeInt32 (std::int32_t data) final
    \n-
    435 { write_(data); }
    \n-
    437 void writeUInt32 (std::uint32_t data) final
    \n-
    438 { write_(data); }
    \n-
    440 void writeUInt8 (std::uint8_t data) final
    \n-
    441 { write_(data); }
    \n-
    442
    \n-
    444 template<class T>
    \n-
    445 void write_(T data)
    \n-
    446 {
    \n-
    447 s.write(data);
    \n-
    448 }
    \n-
    449 };
    \n-
    \n-
    450
    \n-
    452 //
    \n-
    453 // Factory
    \n-
    454 //
    \n-
    455
    \n-
    457
    \n-
    \n-\n-
    463 enum Phase { main, appended };
    \n-
    464
    \n-
    465 OutputType type;
    \n-
    466 std::ostream& stream;
    \n-
    467 unsigned offset;
    \n-
    469 Phase phase;
    \n-
    470
    \n-
    471 public:
    \n-
    473
    \n-
    \n-
    482 inline DataArrayWriterFactory(OutputType type_, std::ostream& stream_)
    \n-
    483 : type(type_), stream(stream_), offset(0), phase(main)
    \n-
    484 { }
    \n-
    \n-
    485
    \n-
    487
    \n-
    \n-
    497 inline bool beginAppended() {
    \n-
    498 phase = appended;
    \n-
    499 switch(type) {
    \n-
    500 case ascii : return false;
    \n-
    501 case base64 : return false;
    \n-
    502 case appendedraw : return true;
    \n-
    503 case appendedbase64 : return true;
    \n-
    504 }
    \n-
    505 DUNE_THROW(IOError, "Dune::VTK::DataArrayWriter: unsupported "
    \n-
    506 "OutputType " << type);
    \n-
    507 }
    \n-
    \n-
    508
    \n-
    \n-
    510 const std::string& appendedEncoding() const {
    \n-
    511 static const std::string rawString = "raw";
    \n-
    512 static const std::string base64String = "base64";
    \n-
    513
    \n-
    514 switch(type) {
    \n-
    515 case ascii :
    \n-
    516 case base64 :
    \n-
    517 DUNE_THROW(IOError, "DataArrayWriterFactory::appendedEncoding(): No "
    \n-
    518 "appended encoding for OutputType " << type);
    \n-
    519 case appendedraw : return rawString;
    \n-
    520 case appendedbase64 : return base64String;
    \n-
    521 }
    \n-
    522 DUNE_THROW(IOError, "DataArrayWriterFactory::appendedEncoding(): "
    \n-
    523 "unsupported OutputType " << type);
    \n-
    524 }
    \n-
    \n-
    525
    \n-
    527
    \n-
    \n-
    541 DataArrayWriter* make(const std::string& name, unsigned ncomps,
    \n-
    542 unsigned nitems, const Indent& indent,
    \n-
    543 Precision prec)
    \n-
    544 {
    \n-
    545 switch(phase) {
    \n-
    546 case main :
    \n-
    547 switch(type) {
    \n-
    548 case ascii :
    \n-
    549 return new AsciiDataArrayWriter(stream, name, ncomps, indent, prec);
    \n-
    550 case base64 :
    \n-
    551 return new BinaryDataArrayWriter(stream, name, ncomps, nitems,
    \n-
    552 indent, prec);
    \n-
    553 case appendedraw :
    \n-
    554 return new AppendedRawDataArrayWriter(stream, name, ncomps,
    \n-
    555 nitems, offset, indent, prec);
    \n-
    556 case appendedbase64 :
    \n-
    557 return new AppendedBase64DataArrayWriter(stream, name, ncomps,
    \n-
    558 nitems, offset,
    \n-
    559 indent, prec);
    \n-
    560 }
    \n-
    561 break;
    \n-
    562 case appended :
    \n-
    563 switch(type) {
    \n-
    564 case ascii :
    \n-
    565 case base64 :
    \n-
    566 break; // invalid in appended mode
    \n-
    567 case appendedraw :
    \n-
    568 return new NakedRawDataArrayWriter(stream, ncomps, nitems, prec);
    \n-
    569 case appendedbase64 :
    \n-
    570 return new NakedBase64DataArrayWriter(stream, ncomps, nitems, prec);
    \n-
    571 }
    \n-
    572 break;
    \n-
    573 }
    \n-
    574 DUNE_THROW(IOError, "Dune::VTK::DataArrayWriter: unsupported "
    \n-
    575 "OutputType " << type << " in phase " << phase);
    \n-
    576 }
    \n-
    \n-
    577 };
    \n-
    \n-
    578
    \n-
    579 } // namespace VTK
    \n-
    580
    \n-
    582
    \n-
    583} // namespace Dune
    \n-
    584
    \n-
    585#endif // DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH
    \n-\n-
    Common stuff for the VTKWriter.
    \n+
    406
    \n+
    407 template< class GV >
    \n+
    408 template< class BoundaryData >
    \n+
    \n+
    409 inline void DGFWriter< GV >::write ( std::ostream &gridout, const std::vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams ) const
    \n+
    410 {
    \n+
    411 writeHeader( gridout );
    \n+
    412 auto dgfIndices = writeVertices( gridout );
    \n+
    413 writeElements( gridout, dgfIndices, elementSeeds( newElemOrder ) );
    \n+
    414 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >( boundaryData ) );
    \n+
    415 gridout << addParams.str();
    \n+
    416 writeFooter( gridout );
    \n+
    417 }
    \n+
    \n+
    418
    \n+
    419
    \n+
    420 template< class GV >
    \n+
    421 template< class BoundaryData >
    \n+
    \n+
    422 inline void DGFWriter< GV >::write ( std::ostream &gridout, BoundaryData &&boundaryData, const std::stringstream &addParams ) const
    \n+
    423 {
    \n+
    424 writeHeader( gridout );
    \n+
    425 auto dgfIndices = writeVertices( gridout );
    \n+
    426 writeElements( gridout, dgfIndices );
    \n+
    427 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >( boundaryData ) );
    \n+
    428 gridout << addParams.str();
    \n+
    429 writeFooter( gridout );
    \n+
    430 }
    \n+
    \n+
    431
    \n+
    432} // namespace Dune
    \n+
    433
    \n+
    434#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH
    \n+\n+
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n+
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    Traits::Intersection Intersection
    type of the intersection
    Definition common/gridview.hh:89
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-\n-\n-\n-\n-
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n-
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n-
    @ appendedraw
    Output is to the file is appended raw binary.
    Definition common.hh:49
    \n-
    @ appendedbase64
    Output is to the file is appended base64 binary.
    Definition common.hh:51
    \n-
    @ base64
    Output to the file is inline base64 binary.
    Definition common.hh:47
    \n-
    std::string toString(Precision p)
    map precision to VTK type name
    Definition common.hh:280
    \n-
    std::size_t typeSize(Precision p)
    map precision to byte size
    Definition common.hh:300
    \n-
    T Type
    type to convert T to before putting it into a stream with <<
    Definition common.hh:97
    \n-
    base class for data array writers
    Definition dataarraywriter.hh:56
    \n-
    void write(T data)
    write one element of data
    Definition dataarraywriter.hh:69
    \n-
    DataArrayWriter(Precision _prec)
    construct a data array writer
    Definition dataarraywriter.hh:63
    \n-
    virtual bool writeIsNoop() const
    whether calls to write may be skipped
    Definition dataarraywriter.hh:89
    \n-
    virtual ~DataArrayWriter()
    virtual destructor
    Definition dataarraywriter.hh:91
    \n-
    a streaming writer for data array tags, uses ASCII inline format
    Definition dataarraywriter.hh:110
    \n-
    ~AsciiDataArrayWriter()
    finish output; writes end tag
    Definition dataarraywriter.hh:133
    \n-
    AsciiDataArrayWriter(std::ostream &theStream, std::string name, int ncomps, const Indent &indent_, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:121
    \n-
    a streaming writer for data array tags, uses binary inline format
    Definition dataarraywriter.hh:197
    \n-
    ~BinaryDataArrayWriter()
    finish output; writes end tag
    Definition dataarraywriter.hh:228
    \n-
    BinaryDataArrayWriter(std::ostream &theStream, std::string name, int ncomps, int nitems, const Indent &indent_, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:210
    \n-
    a streaming writer for data array tags, uses appended raw format
    Definition dataarraywriter.hh:268
    \n-
    AppendedRawDataArrayWriter(std::ostream &s, std::string name, int ncomps, unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:283
    \n-
    bool writeIsNoop() const
    whether calls to write may be skipped
    Definition dataarraywriter.hh:297
    \n-
    a streaming writer for data array tags, uses appended base64 format
    Definition dataarraywriter.hh:310
    \n-
    AppendedBase64DataArrayWriter(std::ostream &s, std::string name, int ncomps, unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:325
    \n-
    bool writeIsNoop() const
    whether calls to write may be skipped
    Definition dataarraywriter.hh:342
    \n-
    a streaming writer for appended data array tags, uses base64 format
    Definition dataarraywriter.hh:360
    \n-
    NakedBase64DataArrayWriter(std::ostream &theStream, int ncomps, int nitems, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:369
    \n-
    a streaming writer for appended data arrays, uses raw format
    Definition dataarraywriter.hh:408
    \n-
    NakedRawDataArrayWriter(std::ostream &theStream, int ncomps, int nitems, Precision prec_)
    make a new data array writer
    Definition dataarraywriter.hh:419
    \n-
    a factory for DataArrayWriters
    Definition dataarraywriter.hh:462
    \n-
    bool beginAppended()
    signal start of the appended section
    Definition dataarraywriter.hh:497
    \n-
    DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned nitems, const Indent &indent, Precision prec)
    create a DataArrayWriter
    Definition dataarraywriter.hh:541
    \n-
    DataArrayWriterFactory(OutputType type_, std::ostream &stream_)
    create a DataArrayWriterFactory
    Definition dataarraywriter.hh:482
    \n-
    const std::string & appendedEncoding() const
    query encoding string for appended data
    Definition dataarraywriter.hh:510
    \n-
    void write(X &data)
    encode a data item
    Definition streams.hh:42
    \n-
    void flush()
    flush the current unwritten data to the stream.
    Definition streams.hh:64
    \n-
    write out data in binary
    Definition streams.hh:84
    \n-
    void write(T data)
    write data to stream
    Definition streams.hh:93
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n+
    IndexTypeImp IndexType
    The type used for the indices.
    Definition common/indexidset.hh:92
    \n+
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n+
    write a GridView to a DGF file
    Definition dgfwriter.hh:46
    \n+
    static const int dimGrid
    dimension of the grid
    Definition dgfwriter.hh:56
    \n+
    DGFWriter(const GridView &gridView)
    constructor
    Definition dgfwriter.hh:72
    \n+
    void write(std::ostream &gridout, const std::stringstream &addParams=std::stringstream()) const
    write the GridView into a std::ostream
    Definition dgfwriter.hh:119
    \n+
    auto write(const std::string &fileName, Args &&... args) const -> std::void_t< decltype(this->write(std::declval< std::ostream & >(), std::declval< Args >()...)) >
    write the GridView to a file
    Definition dgfwriter.hh:131
    \n+
    void writeBoundaries(std::ostream &gridout, const std::vector< Index > &dgfIndices, BoundaryData &&boundaryData) const
    Definition dgfwriter.hh:369
    \n+
    static int boundaryId(const Intersection &i)
    Definition dgfwriter.hh:177
    \n+
    void write(std::ostream &gridout, const std::vector< Index > &newElemOrder, const std::stringstream &addParams=std::stringstream()) const
    write the GridView into a std::ostream
    Definition dgfwriter.hh:107
    \n+
    void write(std::ostream &gridout, const std::vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams=std::stringstream()) const
    write the GridView into a std::ostream
    Definition dgfwriter.hh:409
    \n+
    GridView gridView_
    Definition dgfwriter.hh:198
    \n+
    void writeElement(std::ostream &gridout, const std::vector< Index > &dgfIndices, const Element &element, const GeometryType &elementType) const
    Definition dgfwriter.hh:277
    \n+
    GV GridView
    type of grid view
    Definition dgfwriter.hh:51
    \n+
    void writeFooter(std::ostream &gridout) const
    Definition dgfwriter.hh:237
    \n+
    GridView::Grid Grid
    type of underlying hierarchical grid
    Definition dgfwriter.hh:53
    \n+
    auto writeVertices(std::ostream &gridout) const -> std::vector< Index >
    Definition dgfwriter.hh:244
    \n+
    void writeElements(std::ostream &gridout, const std::vector< Index > &dgfIndices, const Args &... args) const
    Definition dgfwriter.hh:355
    \n+
    void writeBoundaries(std::ostream &gridout, const std::vector< Index > &dgfIndices) const
    Definition dgfwriter.hh:192
    \n+
    void writeCubes(std::ostream &gridout, const std::vector< Index > &dgfIndices) const
    Definition dgfwriter.hh:322
    \n+
    void writeSimplices(std::ostream &gridout, const std::vector< Index > &dgfIndices) const
    Definition dgfwriter.hh:292
    \n+
    void writeHeader(std::ostream &gridout) const
    Definition dgfwriter.hh:222
    \n+
    auto elementsSeeds(const std::vector< Index > &newElemOrder) const -> std::vector< ElementSeed >
    Definition dgfwriter.hh:203
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,598 +2,558 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-dataarraywriter.hh\n+ * dgfparser\n+dgfwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n+5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH\n+6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH\n+7\n+13#include \n+14#include \n 15\n-16#include \n-17#include \n-18\n-19#include \n-20#include \n-21\n-30namespace Dune\n-31{\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\n+26#include \n+27#include \n+28\n+29#include \n+30#include \n+31\n+32namespace Dune\n+33{\n 34\n-35 namespace VTK {\n-36\n-38\n-55 class DataArrayWriter\n-56 {\n-57 public:\n-59\n-63 DataArrayWriter(Precision _prec)\n-64 : prec(_prec)\n-65 {}\n+44 template< class GV >\n+45 class DGFWriter\n+46 {\n+47 typedef DGFWriter<_GV_> This;\n+48\n+49 public:\n+51 typedef GV GridView;\n+53 typedef typename GridView::Grid Grid;\n+54\n+56 static const int dimGrid = GridView::dimension;\n+57\n+58 private:\n+59 typedef typename GridView::IndexSet IndexSet;\n+60 typedef typename GridView::template Codim< 0 >::Entity Element;\n+61 typedef typename GridView::Intersection Intersection;\n+62\n+63 typedef typename Element::EntitySeed ElementSeed;\n+64\n+65 typedef typename IndexSet::IndexType Index;\n 66\n-68 template\n-69 void write(T data)\n-70 {\n-71 switch(prec)\n-72 {\n-73 case Precision::float32:\n-74 writeFloat32(data); break;\n-75 case Precision::float64:\n-76 writeFloat64(data); break;\n-77 case Precision::uint32:\n-78 writeUInt32(data); break;\n-79 case Precision::uint8:\n-80 writeUInt8(data); break;\n-81 case Precision::int32:\n-82 writeInt32(data); break;\n-83 default:\n-84 DUNE_THROW(Dune::NotImplemented, \"Unknown precision type\");\n-85 }\n-86 }\n+67 public:\n+72 DGFWriter ( const GridView &gridView )\n+73 : gridView_( gridView )\n+74 {}\n+75\n+85 template< class BoundaryData >\n+86 void write ( std::ostream &gridout, const std::vector< Index >\n+&newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams\n+= std::stringstream() ) const;\n 87\n-89 virtual bool writeIsNoop() const { return false; }\n-91 virtual ~DataArrayWriter () {}\n-92\n-93 private:\n-95 virtual void writeFloat32 (float data) = 0;\n-97 virtual void writeFloat64 (double data) = 0;\n-99 virtual void writeInt32 (std::int32_t data) = 0;\n-101 virtual void writeUInt8 (std::uint8_t data) = 0;\n-103 virtual void writeUInt32 (std::uint32_t data) = 0;\n-104\n-105 Precision prec;\n-106 };\n-107\n-109 class AsciiDataArrayWriter : public DataArrayWriter\n-110 {\n-111 public:\n-113\n-121 AsciiDataArrayWriter(std::ostream& theStream, std::string name,\n-122 int ncomps, const Indent& indent_, Precision prec_)\n-123 : DataArrayWriter(prec_), s(theStream), counter(0), numPerLine(12), indent\n-(indent_)\n-124 {\n-125 s << indent << \"\\n\";\n-129 ++indent;\n-130 }\n-131\n-133 ~AsciiDataArrayWriter ()\n-134 {\n-135 if (counter%numPerLine!=0) s << \"\\n\";\n-136 --indent;\n-137 s << indent << \"\\n\";\n-138 }\n-139\n-140 private:\n-142 void writeFloat64 (double data) final\n-143 { write_float(data); }\n-145 void writeFloat32 (float data) final\n-146 { write_float(data); }\n-148 void writeInt32 (std::int32_t data) final\n-149 { write_(data); }\n-151 void writeUInt32 (std::uint32_t data) final\n-152 { write_(data); }\n-154 void writeUInt8 (std::uint8_t data) final\n-155 { write_(data); }\n-156\n-157 template\n-158 void write_(T data)\n-159 {\n-160 typedef typename PrintType::Type PT;\n-161 if(counter%numPerLine==0) s << indent;\n-162 else s << \" \";\n-163 const auto original_precision = std::cout.precision();\n-164 s << std::setprecision(std::numeric_limits::digits10) << (PT) data;\n-165 std::cout.precision(original_precision);\n-166 counter++;\n-167 if (counter%numPerLine==0) s << \"\\n\";\n+96 template< class BoundaryData >\n+97 void write ( std::ostream &gridout, BoundaryData &&boundaryData, const std::\n+stringstream &addParams = std::stringstream() ) const;\n+98\n+107 void write ( std::ostream &gridout, const std::vector< Index >\n+&newElemOrder, const std::stringstream &addParams = std::stringstream() ) const\n+108 {\n+109 write( gridout, newElemOrder, [] ( const Intersection &i ) -> int { return\n+boundaryId( i ); }, addParams );\n+110 }\n+111\n+119 void write ( std::ostream &gridout, const std::stringstream &addParams =\n+std::stringstream() ) const\n+120 {\n+121 write( gridout, [] ( const Intersection &i ) -> int { return boundaryId( i\n+); }, addParams );\n+122 }\n+123\n+130 template< class... Args >\n+131 auto write ( const std::string &fileName, Args &&... args ) const\n+132 -> std::void_t< decltype( this->write( std::declval< std::ostream & >(),\n+std::declval< Args >()... ) ) >\n+133 {\n+134 std::ofstream gridout( fileName );\n+135 if( gridout )\n+136 write( gridout, std::forward< Args >( args )... );\n+137 else\n+138 std::cerr << \"Couldn't open file `\"<< fileName << \"'!\"<< std::endl;\n+139 }\n+140\n+141 protected:\n+142 auto elementsSeeds ( const std::vector< Index > &newElemOrder ) const\n+143 -> std::vector< ElementSeed >;\n+144\n+145 void writeHeader ( std::ostream &gridout ) const;\n+146 void writeFooter ( std::ostream &gridout ) const;\n+147\n+148 auto writeVertices ( std::ostream &gridout ) const\n+149 -> std::vector< Index >;\n+150\n+151 void writeElement ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, const Element &element, const GeometryType &elementType ) const;\n+152\n+153 void writeSimplices ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices ) const;\n+154 void writeSimplices ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;\n+155\n+156 void writeCubes ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices ) const;\n+157 void writeCubes ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;\n+158\n+159 template< class... Args >\n+160 void writeElements ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, const Args &... args ) const;\n+161\n+162 private:\n+163 template< class I >\n+164 static auto boundaryId ( const I &i, PriorityTag< 1 > )\n+165 -> std::enable_if_t< std::is_convertible< std::decay_t< decltype( i.impl\n+().boundaryId() ) >, int >::value, int >\n+166 {\n+167 return i.impl().boundaryId();\n 168 }\n 169\n-170 template\n-171 void write_float(T data)\n+170 template< class I >\n+171 static int boundaryId ( const I &i, PriorityTag< 0 > )\n 172 {\n-173 typedef typename PrintType::Type PT;\n-174 if(counter%numPerLine==0) s << indent;\n-175 else s << \" \";\n-176 PT out_data = (PT) data;\n-177 if (std::fpclassify(out_data) == FP_SUBNORMAL)\n-178 {\n-179 // truncate denormalized data to 0 to avoid Paraview segfaults on macOS\n-180 out_data = 0;\n-181 }\n-182 const auto original_precision = std::cout.precision();\n-183 s << std::setprecision(std::numeric_limits::digits10) << out_data;\n-184 std::cout.precision(original_precision);\n-185 counter++;\n-186 if (counter%numPerLine==0) s << \"\\n\";\n-187 }\n-188\n-189 std::ostream& s;\n-190 int counter;\n-191 int numPerLine;\n-192 Indent indent;\n-193 };\n-194\n-196 class BinaryDataArrayWriter : public DataArrayWriter\n-197 {\n-198 public:\n+173 return 1;\n+174 }\n+175\n+176 protected:\n+177 static int boundaryId ( const Intersection &i ) { return boundaryId( i,\n+PriorityTag< 42 >() ); }\n+178\n+179 private:\n+180 static int boundaryId ( const Intersection &, int bndId ) { return bndId; }\n+181 static int boundaryId ( const Intersection &i, const std::string & )\n+{ return boundaryId( i ); }\n+182 static int boundaryId ( const Intersection &i, const std::pair< int, std::\n+string > &data ) { return boundrayId( i, data.first ); }\n+183\n+184 static void appendBoundaryData ( std::ostream &gridout, int ) { gridout <<\n+std::endl; }\n+185 static void appendBoundaryData ( std::ostream &gridout, std::pair< int,\n+std::string > &data ) { appendBoundaryData( gridout, data.second ); }\n+186 static void appendBoundaryData ( std::ostream &gridout, const std::string\n+&s ) { gridout << \" : \" << s << std::endl; }\n+187\n+188 protected:\n+189 template< class BoundaryData >\n+190 void writeBoundaries ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, BoundaryData &&boundaryData ) const;\n+191\n+192 void writeBoundaries ( std::ostream &gridout, const std::vector< Index >\n+&dgfIndices ) const\n+193 {\n+194 writeBoundaries( gridout, dgfIndices, [] ( const Intersection &i ) -> int\n+{ return boundaryId( i ); } );\n+195 }\n+196\n+197 protected:\n+198 GridView gridView_;\n+199 };\n 200\n-210 BinaryDataArrayWriter(std::ostream& theStream, std::string name,\n-211 int ncomps, int nitems, const Indent& indent_, Precision prec_)\n-212 : DataArrayWriter(prec_), s(theStream), b64(theStream), indent(indent_)\n-213 {\n-214 s << indent << \"\\n\";\n-218\n-219 // write indentation for the data chunk\n-220 s << indent+1;\n-221 // store size, needs to be exactly 32 bit\n-222 std::uint32_t size = ncomps*nitems*typeSize(prec_);\n-223 b64.write(size);\n-224 b64.flush();\n-225 }\n-226\n-228 ~BinaryDataArrayWriter ()\n-229 {\n-230 b64.flush();\n-231 // append newline to written data\n-232 s << \"\\n\";\n-233 s << indent << \"\\n\";\n-234 s.flush();\n-235 }\n-236\n-237 private:\n-239 void writeFloat64 (double data) final\n-240 { write_(data); }\n-242 void writeFloat32 (float data) final\n-243 { write_(data); }\n-245 void writeInt32 (std::int32_t data) final\n-246 { write_(data); }\n-248 void writeUInt32 (std::uint32_t data) final\n-249 { write_(data); }\n-251 void writeUInt8 (std::uint8_t data) final\n-252 { write_(data); }\n-253\n-255 template\n-256 void write_(T data)\n-257 {\n-258 b64.write(data);\n-259 }\n-260\n-261 std::ostream& s;\n-262 Base64Stream b64;\n-263 const Indent& indent;\n-264 };\n-265\n-267 class AppendedRawDataArrayWriter : public DataArrayWriter\n-268 {\n-269 public:\n-271\n-283 AppendedRawDataArrayWriter(std::ostream& s, std::string name,\n-284 int ncomps, unsigned nitems, unsigned& offset,\n-285 const Indent& indent, Precision prec_)\n-286 : DataArrayWriter(prec_)\n-287 {\n-288 s << indent << \"\\n\";\n-292 offset += 4; // header\n-293 offset += ncomps*nitems*typeSize(prec_);\n-294 }\n-295\n-297 bool writeIsNoop() const { return true; }\n-298\n-299 private:\n-301 void writeFloat64 (double) final {}\n-302 void writeFloat32 (float) final {}\n-303 void writeInt32 (std::int32_t) final {}\n-304 void writeUInt32 (std::uint32_t) final {}\n-305 void writeUInt8 (std::uint8_t) final {}\n-306 };\n-307\n-309 class AppendedBase64DataArrayWriter : public DataArrayWriter\n-310 {\n-311 public:\n-313\n-325 AppendedBase64DataArrayWriter(std::ostream& s, std::string name,\n-326 int ncomps, unsigned nitems,\n-327 unsigned& offset, const Indent& indent, Precision prec_)\n-328 : DataArrayWriter(prec_)\n-329 {\n-330 s << indent << \"\\n\";\n-334 offset += 8; // header\n-335 std::size_t bytes = ncomps*nitems*typeSize(prec_);\n-336 offset += bytes/3*4;\n-337 if(bytes%3 != 0)\n-338 offset += 4;\n-339 }\n+201\n+202 template< class GV >\n+203 inline auto DGFWriter<_GV_>::elementsSeeds ( const std::vector< Index >\n+&newElemOrder ) const\n+204 -> std::vector< ElementSeed >\n+205 {\n+206 const IndexSet &indexSet = gridView_.indexSet();\n+207\n+208 const std::size_t orderSize = newElemOrder.size() ;\n+209 std::vector< ElementSeed > elementSeeds( orderSize );\n+210\n+211 for( const Element &element : elements( gridView_ ) )\n+212 {\n+213 assert( newElemOrder[ indexSet.index( element ) ] < orderSize );\n+214 elementSeeds[ newElemOrder[ indexSet.index( element ) ] ] = element.seed();\n+215 }\n+216\n+217 return elementSeeds;\n+218 }\n+219\n+220\n+221 template< class GV >\n+222 inline void DGFWriter<_GV_>::writeHeader ( std::ostream &gridout ) const\n+223 {\n+224 // set the stream to full double precision\n+225 gridout.setf( std::ios_base::scientific, std::ios_base::floatfield );\n+226 gridout.precision( 16 );\n+227\n+228 const IndexSet &indexSet = gridView_.indexSet();\n+229\n+230 // write DGF header\n+231 gridout << \"DGF\" << std::endl;\n+232 gridout << \"%\" << \" Elements = \" << indexSet.size( 0 ) << \" | Vertices = \"\n+<< indexSet.size( dimGrid ) << std::endl;\n+233 }\n+234\n+235\n+236 template< class GV >\n+237 inline void DGFWriter<_GV_>::writeFooter ( std::ostream &gridout ) const\n+238 {\n+239 gridout << std::endl << \"#\" << std::endl;\n+240 }\n+241\n+242\n+243 template< class GV >\n+244 inline auto DGFWriter<_GV_>::writeVertices ( std::ostream &gridout ) const\n+245 -> std::vector< Index >\n+246 {\n+247 const IndexSet &indexSet = gridView_.indexSet();\n+248\n+249 const Index vxSize = indexSet.size( dimGrid );\n+250 std::vector< Index > dgfIndices( vxSize, vxSize );\n+251\n+252 // write all vertices into the \"vertex\" block\n+253 gridout << std::endl << \"VERTEX\" << std::endl;\n+254 Index vertexCount = 0;\n+255 for( const Element &element : elements( gridView_ ) )\n+256 {\n+257 for( auto i : range( element.subEntities( dimGrid ) ) )\n+258 {\n+259 const Index vxIndex = indexSet.subIndex( element, i, dimGrid );\n+260 assert( vxIndex < vxSize );\n+261 if( dgfIndices[ vxIndex ] == vxSize )\n+262 {\n+263 dgfIndices[ vxIndex ] = vertexCount++;\n+264 gridout << element.geometry().corner( i ) << std::endl;\n+265 }\n+266 }\n+267 }\n+268 gridout << \"#\" << std::endl;\n+269\n+270 if( vertexCount != vxSize )\n+271 DUNE_THROW( GridError, \"IndexSet reports wrong number of vertices.\" );\n+272 return dgfIndices;\n+273 }\n+274\n+275\n+276 template< class GV >\n+277 inline void DGFWriter<_GV_>::writeElement ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices, const Element &element, const GeometryType\n+&elementType ) const\n+278 {\n+279 // if element's type is not the same as the type to write the return\n+280 if( element.type() != elementType )\n+281 return;\n+282\n+283 // write vertex numbers of the element\n+284 const IndexSet &indexSet = gridView_.indexSet();\n+285 for( auto i : range( element.subEntities( Element::dimension ) ) )\n+286 gridout << (i > 0 ? \" \" : \"\") << dgfIndices[ indexSet.subIndex( element, i,\n+dimGrid ) ];\n+287 gridout << std::endl;\n+288 }\n+289\n+290\n+291 template< class GV >\n+292 inline void DGFWriter<_GV_>::writeSimplices ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices ) const\n+293 {\n+294 // write all simplices to the \"simplex\" block\n+295 gridout << std::endl << \"SIMPLEX\" << std::endl;\n+296\n+297 // write all simplex elements\n+298 for( const Element &element : elements( gridView_ ) )\n+299 writeElement( gridout, dgfIndices, element, GeometryTypes::simplex( dimGrid\n+) );\n+300\n+301 // write end marker for block\n+302 gridout << \"#\" << std::endl;\n+303 }\n+304\n+305\n+306 template< class GV >\n+307 inline void DGFWriter<_GV_>::writeSimplices ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices, const std::vector< ElementSeed >\n+&elementSeeds ) const\n+308 {\n+309 // write all simplices to the \"simplex\" block\n+310 gridout << std::endl << \"SIMPLEX\" << std::endl;\n+311\n+312 // write all simplex elements\n+313 for( const ElementSeed &seed : elementSeeds )\n+314 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ),\n+GeometryTypes::simplex( dimGrid ) );\n+315\n+316 // write end marker for block\n+317 gridout << \"#\" << std::endl;\n+318 }\n+319\n+320\n+321 template< class GV >\n+322 inline void DGFWriter<_GV_>::writeCubes ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices ) const\n+323 {\n+324 // write all cubes to the \"cube\" block\n+325 gridout << std::endl << \"CUBE\" << std::endl;\n+326\n+327 // write all cube elements\n+328 for( const Element &element : elements( gridView_ ) )\n+329 writeElement( gridout, dgfIndices, element, GeometryTypes::cube( dimGrid )\n+);\n+330\n+331 // write end marker for block\n+332 gridout << \"#\" << std::endl;\n+333 }\n+334\n+335\n+336 template< class GV >\n+337 inline void DGFWriter<_GV_>::writeCubes ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices, const std::vector< ElementSeed >\n+&elementSeeds ) const\n+338 {\n+339 const IndexSet &indexSet = gridView_.indexSet();\n 340\n-342 bool writeIsNoop() const { return true; }\n+341 // write all cubes to the \"cube\" block\n+342 gridout << std::endl << \"CUBE\" << std::endl;\n 343\n-344 private:\n-346 void writeFloat64 (double) final {}\n-347 void writeFloat32 (float) final {}\n-348 void writeInt32 (std::int32_t) final {}\n-349 void writeUInt32 (std::uint32_t) final {}\n-350 void writeUInt8 (std::uint8_t) final {}\n-351 };\n+344 // write all cube elements\n+345 for( const ElementSeed &seed : elementSeeds )\n+346 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ),\n+GeometryTypes::cube( dimGrid ) );\n+347\n+348 // write end marker for block\n+349 gridout << \"#\" << std::endl;\n+350 }\n+351\n 352\n-354 //\n-355 // Naked ArrayWriters for the appended section\n-356 //\n-357\n-359 class NakedBase64DataArrayWriter : public DataArrayWriter\n-360 {\n-361 public:\n-363\n-369 NakedBase64DataArrayWriter(std::ostream& theStream, int ncomps,\n-370 int nitems, Precision prec_)\n-371 : DataArrayWriter(prec_), b64(theStream)\n-372 {\n-373 // store size\n-374 std::uint32_t size = ncomps*nitems*typeSize(prec_);\n-375 b64.write(size);\n-376 b64.flush();\n-377 }\n-378\n-379 private:\n-381 void writeFloat64 (double data) final\n-382 { write_(data); }\n-384 void writeFloat32 (float data) final\n-385 { write_(data); }\n-387 void writeInt32 (std::int32_t data) final\n-388 { write_(data); }\n-390 void writeUInt32 (std::uint32_t data) final\n-391 { write_(data); }\n-393 void writeUInt8 (std::uint8_t data) final\n-394 { write_(data); }\n-395\n-397 template\n-398 void write_(T data)\n-399 {\n-400 b64.write(data);\n+353 template< class GV >\n+354 template< class... Args >\n+355 inline void DGFWriter<_GV_>::writeElements ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices, const Args &... args ) const\n+356 {\n+357 const IndexSet &indexSet = gridView_.indexSet();\n+358\n+359 if( (dimGrid > 1) && (indexSet.size( GeometryTypes::simplex( dimGrid ) ) >\n+0) )\n+360 writeSimplices( gridout, dgfIndices, args... );\n+361\n+362 if( indexSet.size( GeometryTypes::cube( dimGrid ) ) > 0 )\n+363 writeCubes( gridout, dgfIndices, args... );\n+364 }\n+365\n+366\n+367 template< class GV >\n+368 template< class BoundaryData >\n+369 inline void DGFWriter<_GV_>::writeBoundaries ( std::ostream &gridout, const\n+std::vector< Index > &dgfIndices, BoundaryData &&boundaryData ) const\n+370 {\n+371 using std::max;\n+372\n+373 const IndexSet &indexSet = gridView_.indexSet();\n+374\n+375 // write all boundaries to the \"boundarysegments\" block\n+376 gridout << std::endl << \"BOUNDARYSEGMENTS\" << std::endl;\n+377\n+378 for( const Element &element : elements( gridView_ ) )\n+379 {\n+380 if( !element.hasBoundaryIntersections() )\n+381 continue;\n+382\n+383 const auto &refElement = ReferenceElements< typename Grid::ctype, dimGrid\n+>::general( element.type() );\n+384 for( const Intersection &intersection : intersections( gridView_, element )\n+)\n+385 {\n+386 if( !intersection.boundary() )\n+387 continue;\n+388\n+389 const auto data = boundaryData( intersection );\n+390 const int bndId = max( boundaryId( intersection, data ), 1 );\n+391\n+392 const int faceNumber = intersection.indexInInside();\n+393 const unsigned int faceSize = refElement.size( faceNumber, 1, dimGrid );\n+394 gridout << bndId << \" \";\n+395 for( auto i : range( faceSize ) )\n+396 {\n+397 const int j = refElement.subEntity( faceNumber, 1, i, dimGrid );\n+398 gridout << \" \" << dgfIndices[ indexSet.subIndex( element, j, dimGrid ) ];\n+399 }\n+400 appendBoundaryData( gridout, data );\n 401 }\n-402\n-403 Base64Stream b64;\n-404 };\n+402 }\n+403 gridout << \"#\" << std::endl;\n+404 }\n 405\n-407 class NakedRawDataArrayWriter : public DataArrayWriter\n-408 {\n-409 RawStream s;\n-410\n-411 public:\n-413\n-419 NakedRawDataArrayWriter(std::ostream& theStream, int ncomps,\n-420 int nitems, Precision prec_)\n-421 : DataArrayWriter(prec_), s(theStream)\n-422 {\n-423 s.write((unsigned int)(ncomps*nitems*typeSize(prec_)));\n-424 }\n-425\n-426 private:\n-428 void writeFloat64 (double data) final\n-429 { write_(data); }\n-431 void writeFloat32 (float data) final\n-432 { write_(data); }\n-434 void writeInt32 (std::int32_t data) final\n-435 { write_(data); }\n-437 void writeUInt32 (std::uint32_t data) final\n-438 { write_(data); }\n-440 void writeUInt8 (std::uint8_t data) final\n-441 { write_(data); }\n-442\n-444 template\n-445 void write_(T data)\n-446 {\n-447 s.write(data);\n-448 }\n-449 };\n-450\n-452 //\n-453 // Factory\n-454 //\n-455\n-457\n-462 class DataArrayWriterFactory {\n-463 enum Phase { main, appended };\n-464\n-465 OutputType type;\n-466 std::ostream& stream;\n-467 unsigned offset;\n-469 Phase phase;\n-470\n-471 public:\n-473\n-482 inline DataArrayWriterFactory(OutputType type_, std::ostream& stream_)\n-483 : type(type_), stream(stream_), offset(0), phase(main)\n-484 { }\n-485\n-487\n-497 inline bool beginAppended() {\n-498 phase = appended;\n-499 switch(type) {\n-500 case ascii : return false;\n-501 case base64 : return false;\n-502 case appendedraw : return true;\n-503 case appendedbase64 : return true;\n-504 }\n-505 DUNE_THROW(IOError, \"Dune::VTK::DataArrayWriter: unsupported \"\n-506 \"OutputType \" << type);\n-507 }\n-508\n-510 const std::string& appendedEncoding() const {\n-511 static const std::string rawString = \"raw\";\n-512 static const std::string base64String = \"base64\";\n-513\n-514 switch(type) {\n-515 case ascii :\n-516 case base64 :\n-517 DUNE_THROW(IOError, \"DataArrayWriterFactory::appendedEncoding(): No \"\n-518 \"appended encoding for OutputType \" << type);\n-519 case appendedraw : return rawString;\n-520 case appendedbase64 : return base64String;\n-521 }\n-522 DUNE_THROW(IOError, \"DataArrayWriterFactory::appendedEncoding(): \"\n-523 \"unsupported OutputType \" << type);\n-524 }\n-525\n-527\n-541 DataArrayWriter* make(const std::string& name, unsigned ncomps,\n-542 unsigned nitems, const Indent& indent,\n-543 Precision prec)\n-544 {\n-545 switch(phase) {\n-546 case main :\n-547 switch(type) {\n-548 case ascii :\n-549 return new AsciiDataArrayWriter(stream, name, ncomps, indent, prec);\n-550 case base64 :\n-551 return new BinaryDataArrayWriter(stream, name, ncomps, nitems,\n-552 indent, prec);\n-553 case appendedraw :\n-554 return new AppendedRawDataArrayWriter(stream, name, ncomps,\n-555 nitems, offset, indent, prec);\n-556 case appendedbase64 :\n-557 return new AppendedBase64DataArrayWriter(stream, name, ncomps,\n-558 nitems, offset,\n-559 indent, prec);\n-560 }\n-561 break;\n-562 case appended :\n-563 switch(type) {\n-564 case ascii :\n-565 case base64 :\n-566 break; // invalid in appended mode\n-567 case appendedraw :\n-568 return new NakedRawDataArrayWriter(stream, ncomps, nitems, prec);\n-569 case appendedbase64 :\n-570 return new NakedBase64DataArrayWriter(stream, ncomps, nitems, prec);\n-571 }\n-572 break;\n-573 }\n-574 DUNE_THROW(IOError, \"Dune::VTK::DataArrayWriter: unsupported \"\n-575 \"OutputType \" << type << \" in phase \" << phase);\n-576 }\n-577 };\n-578\n-579 } // namespace VTK\n-580\n-582\n-583} // namespace Dune\n-584\n-585#endif // DUNE_GRID_IO_FILE_VTK_DATAARRAYWRITER_HH\n-streams.hh\n-common.hh\n-Common stuff for the VTKWriter.\n+406\n+407 template< class GV >\n+408 template< class BoundaryData >\n+409 inline void DGFWriter<_GV_>::write ( std::ostream &gridout, const std::\n+vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::\n+stringstream &addParams ) const\n+410 {\n+411 writeHeader( gridout );\n+412 auto dgfIndices = writeVertices( gridout );\n+413 writeElements( gridout, dgfIndices, elementSeeds( newElemOrder ) );\n+414 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >\n+( boundaryData ) );\n+415 gridout << addParams.str();\n+416 writeFooter( gridout );\n+417 }\n+418\n+419\n+420 template< class GV >\n+421 template< class BoundaryData >\n+422 inline void DGFWriter<_GV_>::write ( std::ostream &gridout, BoundaryData\n+&&boundaryData, const std::stringstream &addParams ) const\n+423 {\n+424 writeHeader( gridout );\n+425 auto dgfIndices = writeVertices( gridout );\n+426 writeElements( gridout, dgfIndices );\n+427 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >\n+( boundaryData ) );\n+428 gridout << addParams.str();\n+429 writeFooter( gridout );\n+430 }\n+431\n+432} // namespace Dune\n+433\n+434#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH\n+rangegenerators.hh\n+Dune::GridView::Grid\n+Traits::Grid Grid\n+type of the grid\n+Definition common/gridview.hh:83\n+Dune::GridView::IndexSet\n+Traits::IndexSet IndexSet\n+type of the index set\n+Definition common/gridview.hh:86\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n+Dune::GridView::Intersection\n+Traits::Intersection Intersection\n+type of the intersection\n+Definition common/gridview.hh:89\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::int32\n-@ int32\n-Dune::VTK::Precision::uint32\n-@ uint32\n-Dune::VTK::Precision::uint8\n-@ uint8\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::VTK::Precision::float64\n-@ float64\n-Dune::VTK::OutputType\n-OutputType\n-How the bulk data should be stored in the file.\n-Definition common.hh:43\n-Dune::VTK::ascii\n-@ ascii\n-Output to the file is in ascii.\n-Definition common.hh:45\n-Dune::VTK::appendedraw\n-@ appendedraw\n-Output is to the file is appended raw binary.\n-Definition common.hh:49\n-Dune::VTK::appendedbase64\n-@ appendedbase64\n-Output is to the file is appended base64 binary.\n-Definition common.hh:51\n-Dune::VTK::base64\n-@ base64\n-Output to the file is inline base64 binary.\n-Definition common.hh:47\n-Dune::VTK::toString\n-std::string toString(Precision p)\n-map precision to VTK type name\n-Definition common.hh:280\n-Dune::VTK::typeSize\n-std::size_t typeSize(Precision p)\n-map precision to byte size\n-Definition common.hh:300\n-Dune::VTK::PrintType::Type\n-T Type\n-type to convert T to before putting it into a stream with <<\n-Definition common.hh:97\n-Dune::VTK::DataArrayWriter\n-base class for data array writers\n-Definition dataarraywriter.hh:56\n-Dune::VTK::DataArrayWriter::write\n-void write(T data)\n-write one element of data\n-Definition dataarraywriter.hh:69\n-Dune::VTK::DataArrayWriter::DataArrayWriter\n-DataArrayWriter(Precision _prec)\n-construct a data array writer\n-Definition dataarraywriter.hh:63\n-Dune::VTK::DataArrayWriter::writeIsNoop\n-virtual bool writeIsNoop() const\n-whether calls to write may be skipped\n-Definition dataarraywriter.hh:89\n-Dune::VTK::DataArrayWriter::~DataArrayWriter\n-virtual ~DataArrayWriter()\n-virtual destructor\n-Definition dataarraywriter.hh:91\n-Dune::VTK::AsciiDataArrayWriter\n-a streaming writer for data array tags, uses ASCII inline format\n-Definition dataarraywriter.hh:110\n-Dune::VTK::AsciiDataArrayWriter::~AsciiDataArrayWriter\n-~AsciiDataArrayWriter()\n-finish output; writes end tag\n-Definition dataarraywriter.hh:133\n-Dune::VTK::AsciiDataArrayWriter::AsciiDataArrayWriter\n-AsciiDataArrayWriter(std::ostream &theStream, std::string name, int ncomps,\n-const Indent &indent_, Precision prec_)\n-make a new data array writer\n-Definition dataarraywriter.hh:121\n-Dune::VTK::BinaryDataArrayWriter\n-a streaming writer for data array tags, uses binary inline format\n-Definition dataarraywriter.hh:197\n-Dune::VTK::BinaryDataArrayWriter::~BinaryDataArrayWriter\n-~BinaryDataArrayWriter()\n-finish output; writes end tag\n-Definition dataarraywriter.hh:228\n-Dune::VTK::BinaryDataArrayWriter::BinaryDataArrayWriter\n-BinaryDataArrayWriter(std::ostream &theStream, std::string name, int ncomps,\n-int nitems, const Indent &indent_, Precision prec_)\n-make a new data array writer\n-Definition dataarraywriter.hh:210\n-Dune::VTK::AppendedRawDataArrayWriter\n-a streaming writer for data array tags, uses appended raw format\n-Definition dataarraywriter.hh:268\n-Dune::VTK::AppendedRawDataArrayWriter::AppendedRawDataArrayWriter\n-AppendedRawDataArrayWriter(std::ostream &s, std::string name, int ncomps,\n-unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)\n-make a new data array writer\n-Definition dataarraywriter.hh:283\n-Dune::VTK::AppendedRawDataArrayWriter::writeIsNoop\n-bool writeIsNoop() const\n-whether calls to write may be skipped\n-Definition dataarraywriter.hh:297\n-Dune::VTK::AppendedBase64DataArrayWriter\n-a streaming writer for data array tags, uses appended base64 format\n-Definition dataarraywriter.hh:310\n-Dune::VTK::AppendedBase64DataArrayWriter::AppendedBase64DataArrayWriter\n-AppendedBase64DataArrayWriter(std::ostream &s, std::string name, int ncomps,\n-unsigned nitems, unsigned &offset, const Indent &indent, Precision prec_)\n-make a new data array writer\n-Definition dataarraywriter.hh:325\n-Dune::VTK::AppendedBase64DataArrayWriter::writeIsNoop\n-bool writeIsNoop() const\n-whether calls to write may be skipped\n-Definition dataarraywriter.hh:342\n-Dune::VTK::NakedBase64DataArrayWriter\n-a streaming writer for appended data array tags, uses base64 format\n-Definition dataarraywriter.hh:360\n-Dune::VTK::NakedBase64DataArrayWriter::NakedBase64DataArrayWriter\n-NakedBase64DataArrayWriter(std::ostream &theStream, int ncomps, int nitems,\n-Precision prec_)\n-make a new data array writer\n-Definition dataarraywriter.hh:369\n-Dune::VTK::NakedRawDataArrayWriter\n-a streaming writer for appended data arrays, uses raw format\n-Definition dataarraywriter.hh:408\n-Dune::VTK::NakedRawDataArrayWriter::NakedRawDataArrayWriter\n-NakedRawDataArrayWriter(std::ostream &theStream, int ncomps, int nitems,\n-Precision prec_)\n-make a new data array writer\n-Definition dataarraywriter.hh:419\n-Dune::VTK::DataArrayWriterFactory\n-a factory for DataArrayWriters\n-Definition dataarraywriter.hh:462\n-Dune::VTK::DataArrayWriterFactory::beginAppended\n-bool beginAppended()\n-signal start of the appended section\n-Definition dataarraywriter.hh:497\n-Dune::VTK::DataArrayWriterFactory::make\n-DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned\n-nitems, const Indent &indent, Precision prec)\n-create a DataArrayWriter\n-Definition dataarraywriter.hh:541\n-Dune::VTK::DataArrayWriterFactory::DataArrayWriterFactory\n-DataArrayWriterFactory(OutputType type_, std::ostream &stream_)\n-create a DataArrayWriterFactory\n-Definition dataarraywriter.hh:482\n-Dune::VTK::DataArrayWriterFactory::appendedEncoding\n-const std::string & appendedEncoding() const\n-query encoding string for appended data\n-Definition dataarraywriter.hh:510\n-Dune::Base64Stream::write\n-void write(X &data)\n-encode a data item\n-Definition streams.hh:42\n-Dune::Base64Stream::flush\n-void flush()\n-flush the current unwritten data to the stream.\n-Definition streams.hh:64\n-Dune::RawStream\n-write out data in binary\n-Definition streams.hh:84\n-Dune::RawStream::write\n-void write(T data)\n-write data to stream\n-Definition streams.hh:93\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::GridError\n+Base class for exceptions in Dune grid modules.\n+Definition exceptions.hh:20\n+Dune::IndexSet::IndexType\n+IndexTypeImp IndexType\n+The type used for the indices.\n+Definition common/indexidset.hh:92\n+Dune::GridView::Codim\n+A struct that collects all associated types of one implementation from the\n+Traits class.\n+Definition common/gridview.hh:104\n+Dune::DGFWriter\n+write a GridView to a DGF file\n+Definition dgfwriter.hh:46\n+Dune::DGFWriter::dimGrid\n+static const int dimGrid\n+dimension of the grid\n+Definition dgfwriter.hh:56\n+Dune::DGFWriter::DGFWriter\n+DGFWriter(const GridView &gridView)\n+constructor\n+Definition dgfwriter.hh:72\n+Dune::DGFWriter::write\n+void write(std::ostream &gridout, const std::stringstream &addParams=std::\n+stringstream()) const\n+write the GridView into a std::ostream\n+Definition dgfwriter.hh:119\n+Dune::DGFWriter::write\n+auto write(const std::string &fileName, Args &&... args) const -> std::void_t<\n+decltype(this->write(std::declval< std::ostream & >(), std::declval< Args >\n+()...)) >\n+write the GridView to a file\n+Definition dgfwriter.hh:131\n+Dune::DGFWriter::writeBoundaries\n+void writeBoundaries(std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, BoundaryData &&boundaryData) const\n+Definition dgfwriter.hh:369\n+Dune::DGFWriter::boundaryId\n+static int boundaryId(const Intersection &i)\n+Definition dgfwriter.hh:177\n+Dune::DGFWriter::write\n+void write(std::ostream &gridout, const std::vector< Index > &newElemOrder,\n+const std::stringstream &addParams=std::stringstream()) const\n+write the GridView into a std::ostream\n+Definition dgfwriter.hh:107\n+Dune::DGFWriter::write\n+void write(std::ostream &gridout, const std::vector< Index > &newElemOrder,\n+BoundaryData &&boundaryData, const std::stringstream &addParams=std::\n+stringstream()) const\n+write the GridView into a std::ostream\n+Definition dgfwriter.hh:409\n+Dune::DGFWriter::gridView_\n+GridView gridView_\n+Definition dgfwriter.hh:198\n+Dune::DGFWriter::writeElement\n+void writeElement(std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, const Element &element, const GeometryType &elementType) const\n+Definition dgfwriter.hh:277\n+Dune::DGFWriter::GridView\n+GV GridView\n+type of grid view\n+Definition dgfwriter.hh:51\n+Dune::DGFWriter::writeFooter\n+void writeFooter(std::ostream &gridout) const\n+Definition dgfwriter.hh:237\n+Dune::DGFWriter::Grid\n+GridView::Grid Grid\n+type of underlying hierarchical grid\n+Definition dgfwriter.hh:53\n+Dune::DGFWriter::writeVertices\n+auto writeVertices(std::ostream &gridout) const -> std::vector< Index >\n+Definition dgfwriter.hh:244\n+Dune::DGFWriter::writeElements\n+void writeElements(std::ostream &gridout, const std::vector< Index >\n+&dgfIndices, const Args &... args) const\n+Definition dgfwriter.hh:355\n+Dune::DGFWriter::writeBoundaries\n+void writeBoundaries(std::ostream &gridout, const std::vector< Index >\n+&dgfIndices) const\n+Definition dgfwriter.hh:192\n+Dune::DGFWriter::writeCubes\n+void writeCubes(std::ostream &gridout, const std::vector< Index > &dgfIndices)\n+const\n+Definition dgfwriter.hh:322\n+Dune::DGFWriter::writeSimplices\n+void writeSimplices(std::ostream &gridout, const std::vector< Index >\n+&dgfIndices) const\n+Definition dgfwriter.hh:292\n+Dune::DGFWriter::writeHeader\n+void writeHeader(std::ostream &gridout) const\n+Definition dgfwriter.hh:222\n+Dune::DGFWriter::elementsSeeds\n+auto elementsSeeds(const std::vector< Index > &newElemOrder) const -> std::\n+vector< ElementSeed >\n+Definition dgfwriter.hh:203\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00965.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00965.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarywriter.hh File Reference\n+dune-grid: dgfyasp.hh File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,53 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    boundarywriter.hh File Reference
    \n+
    dgfyasp.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n-#include <string>
    \n-#include <dune/grid/io/file/vtk/basicwriter.hh>
    \n-#include <dune/grid/io/file/vtk/boundaryiterators.hh>
    \n-#include <dune/grid/io/file/vtk/skeletonfunction.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 Classes

    class  Dune::VTK::NonConformingBoundaryWriter< GV >
    class  Dune::dgf::YaspGridParameterBlock
     Grid parameters for YaspGrid. More...
     
    struct  Dune::DGFGridFactory< YaspGrid< dim, EquidistantCoordinates< ctype, dim > > >
     Grid factory for YaspGrid with equidistant coordinates. More...
     
    struct  Dune::DGFGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > >
     Grid factory for YaspGrid with equidistant coordinates. More...
     
    class  Dune::DGFGridFactory< Dune::YaspGrid< dim, Dune::TensorProductCoordinates< ctype, dim > > >
     Placeholder for grid factory for YaspGrid with tensor product coordinates. More...
     
    struct  Dune::DGFGridInfo< YaspGrid< dim, Coordinates > >
     
    \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
    namespace  Dune::dgf
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,27 +2,41 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-boundarywriter.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+dgfyasp.hh File Reference\n+#include \n+#include \n+#include \"dgfparser.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::NonConformingBoundaryWriter<_GV_>\n+ class \u00a0 Dune::dgf::YaspGridParameterBlock\n+\u00a0 Grid parameters for YaspGrid. More...\n+\u00a0\n+struct \u00a0 Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,\n+ dim_>_>_>\n+\u00a0 Grid factory for YaspGrid with equidistant coordinates. More...\n+\u00a0\n+struct \u00a0 Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<\n+ ctype,_dim_>_>_>\n+\u00a0 Grid factory for YaspGrid with equidistant coordinates. More...\n+\u00a0\n+ class \u00a0 Dune::DGFGridFactory<_Dune::YaspGrid<_dim,_Dune::\n+ TensorProductCoordinates<_ctype,_dim_>_>_>\n+\u00a0 Placeholder for grid factory for YaspGrid with tensor product\n+ coordinates. More...\n+\u00a0\n+struct \u00a0 Dune::DGFGridInfo<_YaspGrid<_dim,_Coordinates_>_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n+namespace \u00a0 Dune::dgf\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00965_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00965_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarywriter.hh Source File\n+dune-grid: dgfyasp.hh Source File\n \n \n \n \n \n \n \n@@ -70,116 +70,619 @@\n
    \n \n \n \n \n \n \n
    \n-
    boundarywriter.hh
    \n+
    dgfyasp.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
    \n-
    8
    \n-
    9#include <memory>
    \n-
    10#include <string>
    \n+
    5#ifndef DUNE_DGFPARSERYASP_HH
    \n+
    6#define DUNE_DGFPARSERYASP_HH
    \n+
    7
    \n+\n+\n+
    10#include "dgfparser.hh"
    \n
    11
    \n-\n-\n-\n-
    15
    \n-
    16namespace Dune {
    \n-
    19
    \n-
    20 namespace VTK {
    \n+
    12namespace Dune
    \n+
    13{
    \n+
    14
    \n+
    15 // External Forward Declarations
    \n+
    16 // -----------------------------
    \n+
    17
    \n+
    18 template< class GridImp, class IntersectionImp >
    \n+
    19 class Intersection;
    \n+
    20
    \n
    21
    \n-
    22 template<typename GV>
    \n-
    \n-\n-\n-
    25 public BasicWriter<NonConformingBoundaryIteratorFactory<GV> >
    \n-
    26 {
    \n-\n-\n-
    29
    \n-
    30 const GV& gv;
    \n-
    31
    \n-
    32 public:
    \n-
    \n-\n-
    34 : Factory(gv_), Base(static_cast<const Factory&>(*this)), gv(gv_)
    \n-
    35 { }
    \n-
    \n-
    36
    \n-\n-
    38
    \n-
    39 template<typename Func>
    \n-
    \n-
    40 void addCellData(const std::shared_ptr<Func>& p, const std::string& name) {
    \n-
    41 addCellData(std::shared_ptr<typename Base::FunctionWriter>
    \n-
    42 (new SkeletonFunctionWriter<Func>(p, name)));
    \n-
    43 }
    \n-
    \n-
    44
    \n-
    45 template<typename Func>
    \n+
    22 namespace dgf
    \n+
    23 {
    \n+
    24
    \n+
    \n+\n+
    39 : public GridParameterBlock
    \n+
    40 {
    \n+
    41 protected:
    \n+
    42 int _overlap; // overlap for YaspGrid
    \n+
    43
    \n+
    44 public:
    \n
    \n-
    46 void addCellData(Func* p, const std::string& name) {
    \n-
    47 addCellData(std::shared_ptr<Func>(p), name);
    \n-
    48 }
    \n-
    \n-
    49
    \n-\n-
    51
    \n-
    52 template<typename Func>
    \n-
    \n-
    53 void addPointData(const std::shared_ptr<Func>& p, const std::string& name) {
    \n-
    54 addPointData(std::shared_ptr<typename Base::FunctionWriter>
    \n-
    55 (new SkeletonFunctionWriter<Func>(p, name)));
    \n-
    56 }
    \n-
    \n-
    57
    \n-
    58 template<typename Func>
    \n-
    \n-
    59 void addPointData(Func* p, const std::string& name) {
    \n-
    60 addPointData(std::shared_ptr<Func>(p), name);
    \n-
    61 }
    \n-
    \n-
    62
    \n-
    63 };
    \n-
    \n-
    64
    \n-
    65 } // namespace VTK
    \n-
    66
    \n-
    68
    \n-
    69} // namespace Dune
    \n+
    46 YaspGridParameterBlock( std::istream &in )
    \n+
    47 : GridParameterBlock( in ),
    \n+
    48 _overlap( 0 ) // default value
    \n+
    49 {
    \n+
    50 // check overlap
    \n+
    51 if( findtoken( "overlap" ) )
    \n+
    52 {
    \n+
    53 int x;
    \n+
    54 if( getnextentry(x) ) _overlap = x;
    \n+
    55 else
    \n+
    56 {
    \n+
    57 dwarn << "GridParameterBlock: found keyword `overlap' but no value, defaulting to `" << _overlap <<"' !\\n";
    \n+
    58 }
    \n+
    59
    \n+
    60 if (_overlap < 0)
    \n+
    61 {
    \n+
    62 DUNE_THROW(DGFException,"Negative overlap specified!");
    \n+
    63 }
    \n+
    64 }
    \n+
    65 else
    \n+
    66 {
    \n+
    67 dwarn << "YaspGridParameterBlock: Parameter 'overlap' not specified, "
    \n+
    68 << "defaulting to '" << _overlap << "'." << std::endl;
    \n+
    69 }
    \n
    70
    \n-
    71#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
    \n-
    Functions for VTK output on the skeleton.
    \n-\n-
    Functions for VTK output on the skeleton.
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    \n+
    74 int overlap () const
    \n+
    75 {
    \n+
    76 return _overlap;
    \n+
    77 }
    \n+
    \n+
    78
    \n+
    79 };
    \n+
    \n+
    80
    \n+
    81 }
    \n+
    82
    \n+
    86 template <typename ctype, int dim>
    \n+
    \n+
    87 struct DGFGridFactory< YaspGrid<dim, EquidistantCoordinates<ctype, dim> > >
    \n+
    88 {
    \n+\n+
    90 const static int dimension = Grid::dimension;
    \n+
    91 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n+
    92
    \n+
    93 private:
    \n+
    94 typedef FieldVector< ctype, dimension > Point;
    \n+\n+
    96
    \n+
    97 public:
    \n+
    \n+
    98 explicit DGFGridFactory ( std::istream &input,
    \n+
    99 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    100 {
    \n+
    101 generate( input, comm );
    \n+
    102 }
    \n+
    \n+
    103
    \n+
    \n+
    104 explicit DGFGridFactory ( const std::string &filename,
    \n+
    105 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    106 {
    \n+
    107 std::ifstream input( filename.c_str() );
    \n+
    108 if( !input )
    \n+
    109 DUNE_THROW( DGFException, "Error: Macrofile '" << filename << "' not found" );
    \n+
    110 generate( input, comm );
    \n+
    111 }
    \n+
    \n+
    112
    \n+
    \n+\n+
    114 {
    \n+
    115 delete boundaryDomainBlock_;
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    \n+
    118 Grid *grid() const
    \n+
    119 {
    \n+
    120 return grid_;
    \n+
    121 }
    \n+
    \n+
    122
    \n+
    123 template <class Intersection>
    \n+
    \n+
    124 bool wasInserted(const Intersection &intersection) const
    \n+
    125 {
    \n+
    126 return false;
    \n+
    127 }
    \n+
    \n+
    128
    \n+
    129 template <class Intersection>
    \n+
    \n+
    130 int boundaryId(const Intersection &intersection) const
    \n+
    131 {
    \n+
    132 if( boundaryDomainBlock_->isactive() )
    \n+
    133 {
    \n+
    134 std::vector< Point > corners;
    \n+
    135 getCorners( intersection.geometry(), corners );
    \n+
    136 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n+
    137 if( data )
    \n+
    138 return data->id();
    \n+
    139 else
    \n+
    140 return intersection.indexInInside();
    \n+
    141 }
    \n+
    142 else
    \n+
    143 return intersection.indexInInside();
    \n+
    144 }
    \n+
    \n+
    145
    \n+
    146 template< int codim >
    \n+
    \n+
    147 int numParameters () const
    \n+
    148 {
    \n+
    149 return 0;
    \n+
    150 }
    \n+
    \n+
    151
    \n+
    152 // return true if boundary parameters found
    \n+
    \n+\n+
    154 {
    \n+
    155 return boundaryDomainBlock_->hasParameter();
    \n+
    156 }
    \n+
    \n+
    157
    \n+
    158 template< class GG, class II >
    \n+
    159 const typename DGFBoundaryParameter::type &
    \n+
    \n+
    160 boundaryParameter ( const Intersection< GG, II > & intersection ) const
    \n+
    161 {
    \n+\n+
    163 {
    \n+
    164 std::vector< Point > corners;
    \n+
    165 getCorners( intersection.geometry(), corners );
    \n+
    166 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n+
    167 if( data )
    \n+
    168 return data->parameter();
    \n+
    169 else
    \n+\n+
    171 }
    \n+
    172 else
    \n+\n+
    174 }
    \n+
    \n+
    175
    \n+
    176 template< class Entity >
    \n+
    \n+
    177 std::vector<double> &parameter ( const Entity & )
    \n+
    178 {
    \n+
    179 return emptyParam;
    \n+
    180 }
    \n+
    \n+
    181
    \n+
    182 private:
    \n+
    183 void generate( std::istream &gridin, MPICommunicatorType comm );
    \n+
    184
    \n+
    185 template< class Geometry >
    \n+
    186 static void getCorners ( const Geometry &geometry, std::vector< Point > &corners )
    \n+
    187 {
    \n+
    188 corners.resize( geometry.corners() );
    \n+
    189 for( int i = 0; i < geometry.corners(); ++i )
    \n+
    190 {
    \n+
    191 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );
    \n+
    192 for( int j = 0; j < dimension; ++j )
    \n+
    193 corners[ i ][ j ] = corner[ j ];
    \n+
    194 }
    \n+
    195 }
    \n+
    196
    \n+
    197 Grid *grid_;
    \n+
    198 dgf::BoundaryDomBlock *boundaryDomainBlock_;
    \n+
    199 std::vector<double> emptyParam;
    \n+
    200 };
    \n+
    \n+
    201
    \n+
    202 // generate YaspGrid from the provided DGF
    \n+
    203 template< typename ctype, int dim >
    \n+
    204 inline void DGFGridFactory< YaspGrid< dim , EquidistantCoordinates<ctype, dim> > >
    \n+
    205 ::generate ( std::istream &gridin, MPICommunicatorType comm )
    \n+
    206 {
    \n+
    207 using std::abs;
    \n+
    208 dgf::IntervalBlock intervalBlock( gridin );
    \n+
    209
    \n+
    210 if( !intervalBlock.isactive() )
    \n+
    211 DUNE_THROW( DGFException, "YaspGrid can only be created from an interval block." );
    \n+
    212
    \n+
    213 if( intervalBlock.numIntervals() != 1 )
    \n+
    214 DUNE_THROW( DGFException, "YaspGrid can only handle 1 interval block." );
    \n+
    215
    \n+
    216 if( intervalBlock.dimw() != dim )
    \n+
    217 {
    \n+
    218 DUNE_THROW( DGFException,
    \n+
    219 "Cannot read an interval of dimension " << intervalBlock.dimw()
    \n+
    220 << " into a YaspGrid< " << dim << " >." );
    \n+
    221 }
    \n+
    222
    \n+
    223 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );
    \n+
    224
    \n+
    225 FieldVector<ctype, dim> lang;
    \n+
    226 std::array<int,dim> anz;
    \n+
    227 for( int i = 0; i < dim; ++i )
    \n+
    228 {
    \n+
    229 // check that start point is 0.0
    \n+
    230 if( abs( interval.p[ 0 ][ i ] ) > 1e-10 )
    \n+
    231 {
    \n+
    232 DUNE_THROW( DGFException,
    \n+
    233 "YaspGrid cannot handle grids with non-zero left lower corner." );
    \n+
    234 }
    \n+
    235
    \n+
    236 lang[ i ] = interval.p[ 1 ][ i ] - interval.p[ 0 ][ i ];
    \n+
    237 anz[ i ] = interval.n[ i ];
    \n+
    238 }
    \n+
    239
    \n+
    240 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation Transformation;
    \n+
    241 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );
    \n+
    242 std::bitset< dim > per;
    \n+
    243 const int numTrafos = trafoBlock.numTransformations();
    \n+
    244 for( int k = 0; k < numTrafos; ++k )
    \n+
    245 {
    \n+
    246 const Transformation &trafo = trafoBlock.transformation( k );
    \n+
    247
    \n+
    248 bool identity = true;
    \n+
    249 for( int i = 0; i < dim; ++i )
    \n+
    250 for( int j = 0; j < dim; ++j )
    \n+
    251 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);
    \n+
    252 if( !identity )
    \n+
    253 DUNE_THROW( DGFException, "YaspGrid can only handle shifts as periodic face transformations." );
    \n+
    254
    \n+
    255 int numDirs = 0;
    \n+
    256 int dir = -1;
    \n+
    257 for( int i = 0; i < dim; ++i )
    \n+
    258 {
    \n+
    259 if( abs( trafo.shift[ i ] ) < 1e-10 )
    \n+
    260 continue;
    \n+
    261 dir = i;
    \n+
    262 ++numDirs;
    \n+
    263 }
    \n+
    264 if( (numDirs != 1) || (abs( abs( trafo.shift[ dir ] ) - lang[ dir ] ) >= 1e-10) )
    \n+
    265 {
    \n+
    266 std::cerr << "Transformation '" << trafo
    \n+
    267 << "' does not map boundaries on boundaries." << std::endl;
    \n+
    268 }
    \n+
    269 else
    \n+
    270 per[ dir ] = true;
    \n+
    271 }
    \n+
    272
    \n+
    273 // get grid parameters
    \n+
    274 dgf::YaspGridParameterBlock grdParam( gridin );
    \n+
    275
    \n+
    276 grid_ = new YaspGrid< dim , EquidistantCoordinates<ctype, dim> >( lang, anz, per, grdParam.overlap(), comm );
    \n+
    277
    \n+
    278 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );
    \n+
    279 }
    \n+
    280
    \n+
    284 template <typename ctype, int dim>
    \n+
    \n+\n+
    286 {
    \n+\n+
    288 const static int dimension = Grid::dimension;
    \n+
    289 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n+
    290
    \n+
    291 private:
    \n+
    292 typedef FieldVector< ctype, dimension > Point;
    \n+\n+
    294
    \n+
    295 public:
    \n+
    \n+
    296 explicit DGFGridFactory ( std::istream &input,
    \n+
    297 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    298 {
    \n+
    299 generate( input, comm );
    \n+
    300 }
    \n+
    \n+
    301
    \n+
    \n+
    302 explicit DGFGridFactory ( const std::string &filename,
    \n+
    303 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    304 {
    \n+
    305 std::ifstream input( filename.c_str() );
    \n+
    306 generate( input, comm );
    \n+
    307 }
    \n+
    \n+
    308
    \n+
    \n+\n+
    310 {
    \n+
    311 delete boundaryDomainBlock_;
    \n+
    312 }
    \n+
    \n+
    313
    \n+
    \n+
    314 Grid *grid() const
    \n+
    315 {
    \n+
    316 return grid_;
    \n+
    317 }
    \n+
    \n+
    318
    \n+
    319 template <class Intersection>
    \n+
    \n+
    320 bool wasInserted(const Intersection &intersection) const
    \n+
    321 {
    \n+
    322 return false;
    \n+
    323 }
    \n+
    \n+
    324
    \n+
    325 template <class Intersection>
    \n+
    \n+
    326 int boundaryId(const Intersection &intersection) const
    \n+
    327 {
    \n+
    328 if( boundaryDomainBlock_->isactive() )
    \n+
    329 {
    \n+
    330 std::vector< Point > corners;
    \n+
    331 getCorners( intersection.geometry(), corners );
    \n+
    332 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n+
    333 if( data )
    \n+
    334 return data->id();
    \n+
    335 else
    \n+
    336 return intersection.indexInInside();
    \n+
    337 }
    \n+
    338 else
    \n+
    339 return intersection.indexInInside();
    \n+
    340 }
    \n+
    \n+
    341
    \n+
    342 template< int codim >
    \n+
    \n+
    343 int numParameters () const
    \n+
    344 {
    \n+
    345 return 0;
    \n+
    346 }
    \n+
    \n+
    347
    \n+
    348 // return true if boundary parameters found
    \n+
    \n+\n+
    350 {
    \n+
    351 return boundaryDomainBlock_->hasParameter();
    \n+
    352 }
    \n+
    \n+
    353
    \n+
    354 template< class GG, class II >
    \n+
    355 const typename DGFBoundaryParameter::type &
    \n+
    \n+
    356 boundaryParameter ( const Intersection< GG, II > & intersection ) const
    \n+
    357 {
    \n+\n+
    359 {
    \n+
    360 std::vector< Point > corners;
    \n+
    361 getCorners( intersection.geometry(), corners );
    \n+
    362 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n+
    363 if( data )
    \n+
    364 return data->parameter();
    \n+
    365 else
    \n+\n+
    367 }
    \n+
    368 else
    \n+\n+
    370 }
    \n+
    \n+
    371
    \n+
    372 template< class Entity >
    \n+
    \n+
    373 std::vector<double> &parameter ( [[maybe_unused]] const Entity &entity )
    \n+
    374 {
    \n+
    375 return emptyParam;
    \n+
    376 }
    \n+
    \n+
    377
    \n+
    378 private:
    \n+
    379 void generate( std::istream &gridin, MPICommunicatorType comm );
    \n+
    380
    \n+
    381 template< class Geometry >
    \n+
    382 static void getCorners ( const Geometry &geometry, std::vector< Point > &corners )
    \n+
    383 {
    \n+
    384 corners.resize( geometry.corners() );
    \n+
    385 for( int i = 0; i < geometry.corners(); ++i )
    \n+
    386 {
    \n+
    387 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );
    \n+
    388 for( int j = 0; j < dimension; ++j )
    \n+
    389 corners[ i ][ j ] = corner[ j ];
    \n+
    390 }
    \n+
    391 }
    \n+
    392
    \n+
    393 Grid *grid_;
    \n+
    394 dgf::BoundaryDomBlock *boundaryDomainBlock_;
    \n+
    395 std::vector<double> emptyParam;
    \n+
    396 };
    \n+
    \n+
    397
    \n+
    398 // generate YaspGrid from the provided DGF
    \n+
    399 template< typename ctype, int dim >
    \n+
    400 inline void DGFGridFactory< YaspGrid<dim, EquidistantOffsetCoordinates<ctype, dim> > >
    \n+
    401 ::generate ( std::istream &gridin, MPICommunicatorType comm )
    \n+
    402 {
    \n+
    403 using std::abs;
    \n+
    404 dgf::IntervalBlock intervalBlock( gridin );
    \n+
    405
    \n+
    406 if( !intervalBlock.isactive() )
    \n+
    407 DUNE_THROW( DGFException, "YaspGrid can only be created from an interval block." );
    \n+
    408
    \n+
    409 if( intervalBlock.numIntervals() != 1 )
    \n+
    410 DUNE_THROW( DGFException, "YaspGrid can only handle 1 interval block." );
    \n+
    411
    \n+
    412 if( intervalBlock.dimw() != dim )
    \n+
    413 {
    \n+
    414 DUNE_THROW( DGFException,
    \n+
    415 "Cannot read an interval of dimension "
    \n+
    416 << intervalBlock.dimw()
    \n+
    417 << " into a YaspGrid< " << dim << " >." );
    \n+
    418 }
    \n+
    419
    \n+
    420 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );
    \n+
    421
    \n+
    422 FieldVector<ctype, dim> lower;
    \n+
    423 FieldVector<ctype, dim> upper;
    \n+
    424 std::array<int,dim> anz;
    \n+
    425 for( int i = 0; i < dim; ++i )
    \n+
    426 {
    \n+
    427 lower[ i ] = interval.p[ 0 ][ i ];
    \n+
    428 upper[ i ] = interval.p[ 1 ][ i ];
    \n+
    429 anz[ i ] = interval.n[ i ];
    \n+
    430 }
    \n+
    431
    \n+
    432 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation Transformation;
    \n+
    433 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );
    \n+
    434 std::bitset< dim > periodic;
    \n+
    435 const int numTrafos = trafoBlock.numTransformations();
    \n+
    436 for( int k = 0; k < numTrafos; ++k )
    \n+
    437 {
    \n+
    438 const Transformation &trafo = trafoBlock.transformation( k );
    \n+
    439
    \n+
    440 bool identity = true;
    \n+
    441 for( int i = 0; i < dim; ++i )
    \n+
    442 for( int j = 0; j < dim; ++j )
    \n+
    443 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);
    \n+
    444 if( !identity )
    \n+
    445 DUNE_THROW( DGFException, "YaspGrid can only handle shifts as periodic face transformations." );
    \n+
    446
    \n+
    447 int numDirs = 0;
    \n+
    448 int dir = -1;
    \n+
    449 for( int currentDir = 0; currentDir < dim; ++currentDir )
    \n+
    450 {
    \n+
    451 if( abs( trafo.shift[ currentDir ] ) > 1e-10 )
    \n+
    452 {
    \n+
    453 dir = currentDir;
    \n+
    454 ++numDirs;
    \n+
    455 }
    \n+
    456 }
    \n+
    457 if ( (numDirs != 1)
    \n+
    458 || (abs( abs( trafo.shift[ dir ] ) - abs( upper[ dir ] - lower[ dir ] ) ) >= 1e-10) )
    \n+
    459 {
    \n+
    460 std::cerr << "Transformation '" << trafo
    \n+
    461 << "' does not map boundaries on boundaries." << std::endl;
    \n+
    462 }
    \n+
    463 else
    \n+
    464 {
    \n+
    465 periodic[ dir ] = true;
    \n+
    466 }
    \n+
    467 }
    \n+
    468
    \n+
    469 // get grid parameters
    \n+
    470 dgf::YaspGridParameterBlock grdParam( gridin );
    \n+
    471
    \n+
    472 grid_ = new YaspGrid< dim, EquidistantOffsetCoordinates<ctype, dim> >
    \n+
    473 ( lower, upper, anz, periodic, grdParam.overlap(), comm );
    \n+
    474
    \n+
    475 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );
    \n+
    476 }
    \n+
    477
    \n+
    483 template< class ctype, int dim >
    \n+
    \n+
    484 class DGFGridFactory< Dune::YaspGrid<dim, Dune::TensorProductCoordinates<ctype, dim> > >
    \n+
    485 {
    \n+\n+
    487 public:
    \n+
    488 template< typename In >
    \n+
    489 DGFGridFactory ( const In & ) {}
    \n+
    \n+\n+
    491 {
    \n+
    492 throw std::invalid_argument( "Tensor product coordinates for YaspGrid are currently not supported via the DGFGridFactory" );
    \n+
    493 }
    \n+
    \n+
    494 };
    \n+
    \n+
    495
    \n+
    496 template <typename Coordinates, int dim>
    \n+
    \n+
    497 struct DGFGridInfo< YaspGrid<dim , Coordinates> > {
    \n+
    498 static int refineStepsForHalf() {return 1;}
    \n+
    499 static double refineWeight() {return std::pow(0.5,dim);}
    \n+
    500 };
    \n+
    \n+
    501
    \n+
    502}
    \n+
    503#endif // #ifndef DUNE_DGFPARSERYASP_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basicwriter.hh:35
    \n-
    void addCellData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:76
    \n-
    void addPointData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:80
    \n-
    Definition boundaryiterators.hh:159
    \n-
    Definition boundarywriter.hh:26
    \n-
    void addPointData(const std::shared_ptr< Func > &p, const std::string &name)
    Definition boundarywriter.hh:53
    \n-
    void addCellData(Func *p, const std::string &name)
    Definition boundarywriter.hh:46
    \n-
    void addPointData(Func *p, const std::string &name)
    Definition boundarywriter.hh:59
    \n-
    NonConformingBoundaryWriter(const GV &gv_)
    Definition boundarywriter.hh:33
    \n-
    void addCellData(const std::shared_ptr< Func > &p, const std::string &name)
    Definition boundarywriter.hh:40
    \n-
    function writer for skeleton functions
    Definition skeletonfunction.hh:83
    \n+
    void abs(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:328
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n+
    G Grid
    Definition dgfgridfactory.hh:39
    \n+
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n+
    bool haveBoundaryParameters() const
    Definition dgfgridfactory.hh:151
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    Geometry geometry() const
    geometrical information about the intersection in global coordinates.
    Definition common/intersection.hh:323
    \n+
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Wrapper class for geometries.
    Definition common/geometry.hh:71
    \n+
    FieldVector< ctype, cdim > GlobalCoordinate
    type of the global coordinates
    Definition common/geometry.hh:106
    \n+
    GlobalCoordinate corner(int i) const
    Obtain a corner of the geometry.
    Definition common/geometry.hh:219
    \n+
    int corners() const
    Return the number of corners of the reference element.
    Definition common/geometry.hh:205
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    bool findtoken(std ::string token)
    Definition basic.cc:122
    \n+
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n+
    Definition boundarydom.hh:23
    \n+
    int id() const
    Definition boundarydom.hh:42
    \n+
    const BoundaryParameter & parameter() const
    Definition boundarydom.hh:54
    \n+
    Definition boundarydom.hh:195
    \n+
    Common Grid parameters.
    Definition gridparameter.hh:35
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n+
    Grid parameters for YaspGrid.
    Definition dgfyasp.hh:40
    \n+
    int _overlap
    Definition dgfyasp.hh:42
    \n+
    YaspGridParameterBlock(std::istream &in)
    constructor taking istream
    Definition dgfyasp.hh:46
    \n+
    int overlap() const
    get dimension of world found in block
    Definition dgfyasp.hh:74
    \n+
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:98
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:104
    \n+
    bool wasInserted(const Intersection &intersection) const
    Definition dgfyasp.hh:124
    \n+\n+
    std::vector< double > & parameter(const Entity &)
    Definition dgfyasp.hh:177
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfyasp.hh:91
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfyasp.hh:160
    \n+\n+\n+\n+
    YaspGrid< dim, EquidistantCoordinates< ctype, dim > > Grid
    Definition dgfyasp.hh:89
    \n+
    int boundaryId(const Intersection &intersection) const
    Definition dgfyasp.hh:130
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfyasp.hh:356
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:302
    \n+\n+
    int boundaryId(const Intersection &intersection) const
    Definition dgfyasp.hh:326
    \n+
    YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > Grid
    Definition dgfyasp.hh:287
    \n+
    bool wasInserted(const Intersection &intersection) const
    Definition dgfyasp.hh:320
    \n+
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfyasp.hh:373
    \n+\n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfyasp.hh:289
    \n+
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:296
    \n+\n+\n+\n+\n+
    static double refineWeight()
    Definition dgfyasp.hh:499
    \n+
    static int refineStepsForHalf()
    Definition dgfyasp.hh:498
    \n+
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n+
    Container for equidistant coordinates in a YaspGrid.
    Definition coordinates.hh:29
    \n+
    Container for equidistant coordinates in a YaspGrid with non-trivial origin.
    Definition coordinates.hh:131
    \n+\n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,119 +2,739 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-boundarywriter.hh\n+ * dgfparser\n+dgfyasp.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH\n-8\n-9#include \n-10#include \n+5#ifndef DUNE_DGFPARSERYASP_HH\n+6#define DUNE_DGFPARSERYASP_HH\n+7\n+8#include \n+9#include \n+10#include \"dgfparser.hh\"\n 11\n-12#include \n-13#include \n-14#include \n-15\n-16namespace Dune {\n-19\n-20 namespace VTK {\n+12namespace Dune\n+13{\n+14\n+15 // External Forward Declarations\n+16 // -----------------------------\n+17\n+18 template< class GridImp, class IntersectionImp >\n+19 class Intersection;\n+20\n 21\n-22 template\n-23 class NonConformingBoundaryWriter\n-24 : public NonConformingBoundaryIteratorFactory,\n-25 public BasicWriter >\n-26 {\n-27 typedef NonConformingBoundaryIteratorFactory Factory;\n-28 typedef BasicWriter Base;\n-29\n-30 const GV& gv;\n-31\n-32 public:\n-33 NonConformingBoundaryWriter(const GV& gv_)\n-34 : Factory(gv_), Base(static_cast(*this)), gv(gv_)\n-35 { }\n-36\n-37 using Base::addCellData;\n-38\n-39 template\n-40 void addCellData(const std::shared_ptr& p, const std::string& name) {\n-41 addCellData(std::shared_ptr\n-42 (new SkeletonFunctionWriter(p, name)));\n-43 }\n-44\n-45 template\n-46 void addCellData(Func* p, const std::string& name) {\n-47 addCellData(std::shared_ptr(p), name);\n-48 }\n-49\n-50 using Base::addPointData;\n-51\n-52 template\n-53 void addPointData(const std::shared_ptr& p, const std::string& name) {\n-54 addPointData(std::shared_ptr\n-55 (new SkeletonFunctionWriter(p, name)));\n-56 }\n-57\n-58 template\n-59 void addPointData(Func* p, const std::string& name) {\n-60 addPointData(std::shared_ptr(p), name);\n-61 }\n-62\n-63 };\n-64\n-65 } // namespace VTK\n-66\n-68\n-69} // namespace Dune\n+22 namespace dgf\n+23 {\n+24\n+38 class YaspGridParameterBlock\n+39 : public GridParameterBlock\n+40 {\n+41 protected:\n+42 int _overlap; // overlap for YaspGrid\n+43\n+44 public:\n+46 YaspGridParameterBlock( std::istream &in )\n+47 : GridParameterBlock( in ),\n+48 _overlap( 0 ) // default value\n+49 {\n+50 // check overlap\n+51 if( findtoken( \"overlap\" ) )\n+52 {\n+53 int x;\n+54 if( getnextentry(x) ) _overlap = x;\n+55 else\n+56 {\n+57 dwarn << \"GridParameterBlock: found keyword `overlap' but no value,\n+defaulting to `\" << _overlap <<\"' !\\n\";\n+58 }\n+59\n+60 if (_overlap < 0)\n+61 {\n+62 DUNE_THROW(DGFException,\"Negative overlap specified!\");\n+63 }\n+64 }\n+65 else\n+66 {\n+67 dwarn << \"YaspGridParameterBlock: Parameter 'overlap' not specified, \"\n+68 << \"defaulting to '\" << _overlap << \"'.\" << std::endl;\n+69 }\n 70\n-71#endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH\n-boundaryiterators.hh\n-Functions for VTK output on the skeleton.\n-basicwriter.hh\n-skeletonfunction.hh\n-Functions for VTK output on the skeleton.\n+71 }\n+72\n+74 int overlap () const\n+75 {\n+76 return _overlap;\n+77 }\n+78\n+79 };\n+80\n+81 }\n+82\n+86 template \n+87 struct DGFGridFactory< YaspGrid > >\n+88 {\n+89 typedef YaspGrid > Grid;\n+90 const static int dimension = Grid::dimension;\n+91 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n+92\n+93 private:\n+94 typedef FieldVector< ctype, dimension > Point;\n+95 typedef dgf::BoundaryDomBlock BoundaryDomainBlock;\n+96\n+97 public:\n+98 explicit DGFGridFactory ( std::istream &input,\n+99 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+100 {\n+101 generate( input, comm );\n+102 }\n+103\n+104 explicit DGFGridFactory ( const std::string &filename,\n+105 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+106 {\n+107 std::ifstream input( filename.c_str() );\n+108 if( !input )\n+109 DUNE_THROW( DGFException, \"Error: Macrofile '\" << filename << \"' not found\"\n+);\n+110 generate( input, comm );\n+111 }\n+112\n+113 ~DGFGridFactory ()\n+114 {\n+115 delete boundaryDomainBlock_;\n+116 }\n+117\n+118 Grid *grid() const\n+119 {\n+120 return grid_;\n+121 }\n+122\n+123 template \n+124 bool wasInserted(const Intersection &intersection) const\n+125 {\n+126 return false;\n+127 }\n+128\n+129 template \n+130 int boundaryId(const Intersection &intersection) const\n+131 {\n+132 if( boundaryDomainBlock_->isactive() )\n+133 {\n+134 std::vector< Point > corners;\n+135 getCorners( intersection.geometry(), corners );\n+136 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n+137 if( data )\n+138 return data->id();\n+139 else\n+140 return intersection.indexInInside();\n+141 }\n+142 else\n+143 return intersection.indexInInside();\n+144 }\n+145\n+146 template< int codim >\n+147 int numParameters () const\n+148 {\n+149 return 0;\n+150 }\n+151\n+152 // return true if boundary parameters found\n+153 bool haveBoundaryParameters () const\n+154 {\n+155 return boundaryDomainBlock_->hasParameter();\n+156 }\n+157\n+158 template< class GG, class II >\n+159 const typename DGFBoundaryParameter::type &\n+160 boundaryParameter ( const Intersection<_GG,_II_> & intersection ) const\n+161 {\n+162 if( haveBoundaryParameters() )\n+163 {\n+164 std::vector< Point > corners;\n+165 getCorners( intersection.geometry(), corners );\n+166 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n+167 if( data )\n+168 return data->parameter();\n+169 else\n+170 return DGFBoundaryParameter::defaultValue();\n+171 }\n+172 else\n+173 return DGFBoundaryParameter::defaultValue();\n+174 }\n+175\n+176 template< class Entity >\n+177 std::vector ¶meter ( const Entity & )\n+178 {\n+179 return emptyParam;\n+180 }\n+181\n+182 private:\n+183 void generate( std::istream &gridin, MPICommunicatorType comm );\n+184\n+185 template< class Geometry >\n+186 static void getCorners ( const Geometry &geometry, std::vector< Point >\n+&corners )\n+187 {\n+188 corners.resize( geometry.corners() );\n+189 for( int i = 0; i < geometry.corners(); ++i )\n+190 {\n+191 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );\n+192 for( int j = 0; j < dimension; ++j )\n+193 corners[ i ][ j ] = corner[ j ];\n+194 }\n+195 }\n+196\n+197 Grid *grid_;\n+198 dgf::BoundaryDomBlock *boundaryDomainBlock_;\n+199 std::vector emptyParam;\n+200 };\n+201\n+202 // generate YaspGrid from the provided DGF\n+203 template< typename ctype, int dim >\n+204 inline void DGFGridFactory< YaspGrid< dim , EquidistantCoordinates > >\n+205 ::generate ( std::istream &gridin, MPICommunicatorType comm )\n+206 {\n+207 using std::abs;\n+208 dgf::IntervalBlock intervalBlock( gridin );\n+209\n+210 if( !intervalBlock.isactive() )\n+211 DUNE_THROW( DGFException, \"YaspGrid can only be created from an interval\n+block.\" );\n+212\n+213 if( intervalBlock.numIntervals() != 1 )\n+214 DUNE_THROW( DGFException, \"YaspGrid can only handle 1 interval block.\" );\n+215\n+216 if( intervalBlock.dimw() != dim )\n+217 {\n+218 DUNE_THROW( DGFException,\n+219 \"Cannot read an interval of dimension \" << intervalBlock.dimw()\n+220 << \" into a YaspGrid< \" << dim << \" >.\" );\n+221 }\n+222\n+223 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );\n+224\n+225 FieldVector lang;\n+226 std::array anz;\n+227 for( int i = 0; i < dim; ++i )\n+228 {\n+229 // check that start point is 0.0\n+230 if( abs( interval.p[ 0 ][ i ] ) > 1e-10 )\n+231 {\n+232 DUNE_THROW( DGFException,\n+233 \"YaspGrid cannot handle grids with non-zero left lower corner.\" );\n+234 }\n+235\n+236 lang[ i ] = interval.p[ 1 ][ i ] - interval.p[ 0 ][ i ];\n+237 anz[ i ] = interval.n[ i ];\n+238 }\n+239\n+240 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation\n+Transformation;\n+241 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );\n+242 std::bitset< dim > per;\n+243 const int numTrafos = trafoBlock.numTransformations();\n+244 for( int k = 0; k < numTrafos; ++k )\n+245 {\n+246 const Transformation &trafo = trafoBlock.transformation( k );\n+247\n+248 bool identity = true;\n+249 for( int i = 0; i < dim; ++i )\n+250 for( int j = 0; j < dim; ++j )\n+251 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);\n+252 if( !identity )\n+253 DUNE_THROW( DGFException, \"YaspGrid can only handle shifts as periodic face\n+transformations.\" );\n+254\n+255 int numDirs = 0;\n+256 int dir = -1;\n+257 for( int i = 0; i < dim; ++i )\n+258 {\n+259 if( abs( trafo.shift[ i ] ) < 1e-10 )\n+260 continue;\n+261 dir = i;\n+262 ++numDirs;\n+263 }\n+264 if( (numDirs != 1) || (abs( abs( trafo.shift[ dir ] ) - lang[ dir ] ) >=\n+1e-10) )\n+265 {\n+266 std::cerr << \"Transformation '\" << trafo\n+267 << \"' does not map boundaries on boundaries.\" << std::endl;\n+268 }\n+269 else\n+270 per[ dir ] = true;\n+271 }\n+272\n+273 // get grid parameters\n+274 dgf::YaspGridParameterBlock grdParam( gridin );\n+275\n+276 grid_ = new YaspGrid< dim , EquidistantCoordinates >( lang,\n+anz, per, grdParam.overlap(), comm );\n+277\n+278 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );\n+279 }\n+280\n+284 template \n+285 struct DGFGridFactory< YaspGrid > >\n+286 {\n+287 typedef YaspGrid > Grid;\n+288 const static int dimension = Grid::dimension;\n+289 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n+290\n+291 private:\n+292 typedef FieldVector< ctype, dimension > Point;\n+293 typedef dgf::BoundaryDomBlock BoundaryDomainBlock;\n+294\n+295 public:\n+296 explicit DGFGridFactory ( std::istream &input,\n+297 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+298 {\n+299 generate( input, comm );\n+300 }\n+301\n+302 explicit DGFGridFactory ( const std::string &filename,\n+303 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+304 {\n+305 std::ifstream input( filename.c_str() );\n+306 generate( input, comm );\n+307 }\n+308\n+309 ~DGFGridFactory ()\n+310 {\n+311 delete boundaryDomainBlock_;\n+312 }\n+313\n+314 Grid *grid() const\n+315 {\n+316 return grid_;\n+317 }\n+318\n+319 template \n+320 bool wasInserted(const Intersection &intersection) const\n+321 {\n+322 return false;\n+323 }\n+324\n+325 template \n+326 int boundaryId(const Intersection &intersection) const\n+327 {\n+328 if( boundaryDomainBlock_->isactive() )\n+329 {\n+330 std::vector< Point > corners;\n+331 getCorners( intersection.geometry(), corners );\n+332 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n+333 if( data )\n+334 return data->id();\n+335 else\n+336 return intersection.indexInInside();\n+337 }\n+338 else\n+339 return intersection.indexInInside();\n+340 }\n+341\n+342 template< int codim >\n+343 int numParameters () const\n+344 {\n+345 return 0;\n+346 }\n+347\n+348 // return true if boundary parameters found\n+349 bool haveBoundaryParameters () const\n+350 {\n+351 return boundaryDomainBlock_->hasParameter();\n+352 }\n+353\n+354 template< class GG, class II >\n+355 const typename DGFBoundaryParameter::type &\n+356 boundaryParameter ( const Intersection<_GG,_II_> & intersection ) const\n+357 {\n+358 if( haveBoundaryParameters() )\n+359 {\n+360 std::vector< Point > corners;\n+361 getCorners( intersection.geometry(), corners );\n+362 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n+363 if( data )\n+364 return data->parameter();\n+365 else\n+366 return DGFBoundaryParameter::defaultValue();\n+367 }\n+368 else\n+369 return DGFBoundaryParameter::defaultValue();\n+370 }\n+371\n+372 template< class Entity >\n+373 std::vector ¶meter ( [[maybe_unused]] const Entity &entity )\n+374 {\n+375 return emptyParam;\n+376 }\n+377\n+378 private:\n+379 void generate( std::istream &gridin, MPICommunicatorType comm );\n+380\n+381 template< class Geometry >\n+382 static void getCorners ( const Geometry &geometry, std::vector< Point >\n+&corners )\n+383 {\n+384 corners.resize( geometry.corners() );\n+385 for( int i = 0; i < geometry.corners(); ++i )\n+386 {\n+387 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );\n+388 for( int j = 0; j < dimension; ++j )\n+389 corners[ i ][ j ] = corner[ j ];\n+390 }\n+391 }\n+392\n+393 Grid *grid_;\n+394 dgf::BoundaryDomBlock *boundaryDomainBlock_;\n+395 std::vector emptyParam;\n+396 };\n+397\n+398 // generate YaspGrid from the provided DGF\n+399 template< typename ctype, int dim >\n+400 inline void DGFGridFactory< YaspGrid > >\n+401 ::generate ( std::istream &gridin, MPICommunicatorType comm )\n+402 {\n+403 using std::abs;\n+404 dgf::IntervalBlock intervalBlock( gridin );\n+405\n+406 if( !intervalBlock.isactive() )\n+407 DUNE_THROW( DGFException, \"YaspGrid can only be created from an interval\n+block.\" );\n+408\n+409 if( intervalBlock.numIntervals() != 1 )\n+410 DUNE_THROW( DGFException, \"YaspGrid can only handle 1 interval block.\" );\n+411\n+412 if( intervalBlock.dimw() != dim )\n+413 {\n+414 DUNE_THROW( DGFException,\n+415 \"Cannot read an interval of dimension \"\n+416 << intervalBlock.dimw()\n+417 << \" into a YaspGrid< \" << dim << \" >.\" );\n+418 }\n+419\n+420 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );\n+421\n+422 FieldVector lower;\n+423 FieldVector upper;\n+424 std::array anz;\n+425 for( int i = 0; i < dim; ++i )\n+426 {\n+427 lower[ i ] = interval.p[ 0 ][ i ];\n+428 upper[ i ] = interval.p[ 1 ][ i ];\n+429 anz[ i ] = interval.n[ i ];\n+430 }\n+431\n+432 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation\n+Transformation;\n+433 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );\n+434 std::bitset< dim > periodic;\n+435 const int numTrafos = trafoBlock.numTransformations();\n+436 for( int k = 0; k < numTrafos; ++k )\n+437 {\n+438 const Transformation &trafo = trafoBlock.transformation( k );\n+439\n+440 bool identity = true;\n+441 for( int i = 0; i < dim; ++i )\n+442 for( int j = 0; j < dim; ++j )\n+443 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);\n+444 if( !identity )\n+445 DUNE_THROW( DGFException, \"YaspGrid can only handle shifts as periodic face\n+transformations.\" );\n+446\n+447 int numDirs = 0;\n+448 int dir = -1;\n+449 for( int currentDir = 0; currentDir < dim; ++currentDir )\n+450 {\n+451 if( abs( trafo.shift[ currentDir ] ) > 1e-10 )\n+452 {\n+453 dir = currentDir;\n+454 ++numDirs;\n+455 }\n+456 }\n+457 if ( (numDirs != 1)\n+458 || (abs( abs( trafo.shift[ dir ] ) - abs( upper[ dir ] - lower[ dir ] ) )\n+>= 1e-10) )\n+459 {\n+460 std::cerr << \"Transformation '\" << trafo\n+461 << \"' does not map boundaries on boundaries.\" << std::endl;\n+462 }\n+463 else\n+464 {\n+465 periodic[ dir ] = true;\n+466 }\n+467 }\n+468\n+469 // get grid parameters\n+470 dgf::YaspGridParameterBlock grdParam( gridin );\n+471\n+472 grid_ = new YaspGrid< dim, EquidistantOffsetCoordinates >\n+473 ( lower, upper, anz, periodic, grdParam.overlap(), comm );\n+474\n+475 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );\n+476 }\n+477\n+483 template< class ctype, int dim >\n+484 class DGFGridFactory< Dune::YaspGrid > >\n+485 {\n+486 using Grid = Dune::YaspGrid\n+>;\n+487 public:\n+488 template< typename In >\n+489 DGFGridFactory ( const In & ) {}\n+490 Grid *grid()\n+491 {\n+492 throw std::invalid_argument( \"Tensor product coordinates for YaspGrid are\n+currently not supported via the DGFGridFactory\" );\n+493 }\n+494 };\n+495\n+496 template \n+497 struct DGFGridInfo< YaspGrid > {\n+498 static int refineStepsForHalf() {return 1;}\n+499 static double refineWeight() {return std::pow(0.5,dim);}\n+500 };\n+501\n+502}\n+503#endif // #ifndef DUNE_DGFPARSERYASP_HH\n+yaspgrid.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::BasicWriter\n-Definition basicwriter.hh:35\n-Dune::VTK::BasicWriter::addCellData\n-void addCellData(const std::shared_ptr< FunctionWriter > &writer)\n-Definition basicwriter.hh:76\n-Dune::VTK::BasicWriter::addPointData\n-void addPointData(const std::shared_ptr< FunctionWriter > &writer)\n-Definition basicwriter.hh:80\n-Dune::VTK::NonConformingBoundaryIteratorFactory\n-Definition boundaryiterators.hh:159\n-Dune::VTK::NonConformingBoundaryWriter\n-Definition boundarywriter.hh:26\n-Dune::VTK::NonConformingBoundaryWriter::addPointData\n-void addPointData(const std::shared_ptr< Func > &p, const std::string &name)\n-Definition boundarywriter.hh:53\n-Dune::VTK::NonConformingBoundaryWriter::addCellData\n-void addCellData(Func *p, const std::string &name)\n-Definition boundarywriter.hh:46\n-Dune::VTK::NonConformingBoundaryWriter::addPointData\n-void addPointData(Func *p, const std::string &name)\n-Definition boundarywriter.hh:59\n-Dune::VTK::NonConformingBoundaryWriter::NonConformingBoundaryWriter\n-NonConformingBoundaryWriter(const GV &gv_)\n-Definition boundarywriter.hh:33\n-Dune::VTK::NonConformingBoundaryWriter::addCellData\n-void addCellData(const std::shared_ptr< Func > &p, const std::string &name)\n-Definition boundarywriter.hh:40\n-Dune::VTK::SkeletonFunctionWriter\n-function writer for skeleton functions\n-Definition skeletonfunction.hh:83\n+Dune::Alberta::abs\n+void abs(const DofVectorPointer< int > &dofVector)\n+Definition dofvector.hh:328\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition dgfgridfactory.hh:41\n+Dune::DGFGridFactory::Grid\n+G Grid\n+Definition dgfgridfactory.hh:39\n+Dune::DGFGridFactory::dimension\n+static const int dimension\n+Definition dgfgridfactory.hh:40\n+Dune::DGFGridFactory::haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+Definition dgfgridfactory.hh:151\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::geometry\n+Geometry geometry() const\n+geometrical information about the intersection in global coordinates.\n+Definition common/intersection.hh:323\n+Dune::Intersection::indexInInside\n+int indexInInside() const\n+Local index of codim 1 entity in the inside() entity where intersection is\n+contained in.\n+Definition common/intersection.hh:346\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Geometry\n+Wrapper class for geometries.\n+Definition common/geometry.hh:71\n+Dune::Geometry::GlobalCoordinate\n+FieldVector< ctype, cdim > GlobalCoordinate\n+type of the global coordinates\n+Definition common/geometry.hh:106\n+Dune::Geometry::corner\n+GlobalCoordinate corner(int i) const\n+Obtain a corner of the geometry.\n+Definition common/geometry.hh:219\n+Dune::Geometry::corners\n+int corners() const\n+Return the number of corners of the reference element.\n+Definition common/geometry.hh:205\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::dgf::BasicBlock::findtoken\n+bool findtoken(std ::string token)\n+Definition basic.cc:122\n+Dune::dgf::BasicBlock::getnextentry\n+bool getnextentry(ENTRY &entry)\n+Definition basic.hh:63\n+Dune::dgf::DomainData\n+Definition boundarydom.hh:23\n+Dune::dgf::DomainData::id\n+int id() const\n+Definition boundarydom.hh:42\n+Dune::dgf::DomainData::parameter\n+const BoundaryParameter & parameter() const\n+Definition boundarydom.hh:54\n+Dune::dgf::BoundaryDomBlock\n+Definition boundarydom.hh:195\n+Dune::dgf::GridParameterBlock\n+Common Grid parameters.\n+Definition gridparameter.hh:35\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n+Dune::DGFGridInfo\n+Some simple static information for a given GridType.\n+Definition io/file/dgfparser/dgfparser.hh:56\n+Dune::dgf::YaspGridParameterBlock\n+Grid parameters for YaspGrid.\n+Definition dgfyasp.hh:40\n+Dune::dgf::YaspGridParameterBlock::_overlap\n+int _overlap\n+Definition dgfyasp.hh:42\n+Dune::dgf::YaspGridParameterBlock::YaspGridParameterBlock\n+YaspGridParameterBlock(std::istream &in)\n+constructor taking istream\n+Definition dgfyasp.hh:46\n+Dune::dgf::YaspGridParameterBlock::overlap\n+int overlap() const\n+get dimension of world found in block\n+Definition dgfyasp.hh:74\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+DGFGridFactory\n+DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n+getCommunicator())\n+Definition dgfyasp.hh:98\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicatorType\n+comm=MPIHelper::getCommunicator())\n+Definition dgfyasp.hh:104\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+wasInserted\n+bool wasInserted(const Intersection &intersection) const\n+Definition dgfyasp.hh:124\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+numParameters\n+int numParameters() const\n+Definition dgfyasp.hh:147\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+parameter\n+std::vector< double > & parameter(const Entity &)\n+Definition dgfyasp.hh:177\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition dgfyasp.hh:91\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n+> &intersection) const\n+Definition dgfyasp.hh:160\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+~DGFGridFactory\n+~DGFGridFactory()\n+Definition dgfyasp.hh:113\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+Definition dgfyasp.hh:153\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+grid\n+Grid * grid() const\n+Definition dgfyasp.hh:118\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+Grid\n+YaspGrid< dim, EquidistantCoordinates< ctype, dim > > Grid\n+Definition dgfyasp.hh:89\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n+boundaryId\n+int boundaryId(const Intersection &intersection) const\n+Definition dgfyasp.hh:130\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n+> &intersection) const\n+Definition dgfyasp.hh:356\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicatorType\n+comm=MPIHelper::getCommunicator())\n+Definition dgfyasp.hh:302\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::grid\n+Grid * grid() const\n+Definition dgfyasp.hh:314\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::boundaryId\n+int boundaryId(const Intersection &intersection) const\n+Definition dgfyasp.hh:326\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::Grid\n+YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > Grid\n+Definition dgfyasp.hh:287\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::wasInserted\n+bool wasInserted(const Intersection &intersection) const\n+Definition dgfyasp.hh:320\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::parameter\n+std::vector< double > & parameter(const Entity &entity)\n+Definition dgfyasp.hh:373\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+Definition dgfyasp.hh:349\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition dgfyasp.hh:289\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::DGFGridFactory\n+DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n+getCommunicator())\n+Definition dgfyasp.hh:296\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::~DGFGridFactory\n+~DGFGridFactory()\n+Definition dgfyasp.hh:309\n+Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n+>_>::numParameters\n+int numParameters() const\n+Definition dgfyasp.hh:343\n+Dune::DGFGridFactory<_Dune::YaspGrid<_dim,_Dune::TensorProductCoordinates<\n+ctype,_dim_>_>_>::grid\n+Grid * grid()\n+Definition dgfyasp.hh:490\n+Dune::DGFGridFactory<_Dune::YaspGrid<_dim,_Dune::TensorProductCoordinates<\n+ctype,_dim_>_>_>::DGFGridFactory\n+DGFGridFactory(const In &)\n+Definition dgfyasp.hh:489\n+Dune::DGFGridInfo<_YaspGrid<_dim,_Coordinates_>_>::refineWeight\n+static double refineWeight()\n+Definition dgfyasp.hh:499\n+Dune::DGFGridInfo<_YaspGrid<_dim,_Coordinates_>_>::refineStepsForHalf\n+static int refineStepsForHalf()\n+Definition dgfyasp.hh:498\n+Dune::DGFBoundaryParameter::defaultValue\n+static const type & defaultValue()\n+default constructor\n+Definition parser.hh:28\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+Dune::YaspGrid\n+[ provides Dune::Grid ]\n+Definition yaspgrid.hh:166\n+Dune::EquidistantCoordinates\n+Container for equidistant coordinates in a YaspGrid.\n+Definition coordinates.hh:29\n+Dune::EquidistantOffsetCoordinates\n+Container for equidistant coordinates in a YaspGrid with non-trivial origin.\n+Definition coordinates.hh:131\n+dgfparser.hh\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00968.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00968.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: skeletonfunction.hh File Reference\n+dune-grid: dgfgeogrid.hh File Reference\n \n \n \n \n \n \n \n@@ -65,59 +65,55 @@\n \n \n \n \n \n \n \n
    \n \n-
    skeletonfunction.hh File Reference
    \n+
    dgfgeogrid.hh File Reference
    \n
    \n
    \n-\n-

    Functions for VTK output on the skeleton. \n-More...

    \n-
    #include <memory>
    \n-#include <string>
    \n-#include <vector>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/grid/io/file/vtk/functionwriter.hh>
    \n-#include <dune/grid/io/file/vtk/pvtuwriter.hh>
    \n-#include <dune/grid/io/file/vtk/vtuwriter.hh>
    \n+\n

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::VTK::SkeletonFunctionTraits< GV, RF >
    class  Dune::DGFCoordFunction< dimD, dimR >
     
    struct  Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, false >
     
    struct  Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, true >
     
    class  Dune::VTK::SkeletonFunctionInterface< GV, RF >
     A prototype for VTKFunctions on the skeleton. More...
    struct  Dune::DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >, false >
     
    class  Dune::VTK::SkeletonFunctionWriter< Func >
     function writer for skeleton functions More...
    struct  Dune::DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > >
     
    struct  Dune::DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > >
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n-

    Detailed Description

    \n-

    Functions for VTK output on the skeleton.

    \n-
    Author
    J\u00f6 Fahlke
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-utf-8\n+us-ascii\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,41 +2,40 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n+ * dgfparser\n Classes | Namespaces\n-skeletonfunction.hh File Reference\n-dune-grid \u00bb I/O \u00bb Visualization_ToolKit_(VTK)\n-Functions for VTK output on the skeleton. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+dgfgeogrid.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::VTK::SkeletonFunctionTraits<_GV,_RF_>\n+ class \u00a0 Dune::DGFCoordFunction<_dimD,_dimR_>\n \u00a0\n- class \u00a0 Dune::VTK::SkeletonFunctionInterface<_GV,_RF_>\n-\u00a0 A prototype for VTKFunctions on the skeleton. More...\n+struct \u00a0 Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_false_>\n \u00a0\n- class \u00a0 Dune::VTK::SkeletonFunctionWriter<_Func_>\n-\u00a0 function writer for skeleton functions More...\n+struct \u00a0 Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_true_>\n+\u00a0\n+struct \u00a0 Dune::DGFCoordFunctionFactory<_HostGrid,_DGFCoordFunction<_dimD,_dimR\n+ >,_false_>\n+\u00a0\n+struct \u00a0 Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator\n+ >_>\n+\u00a0\n+struct \u00a0 Dune::DGFGridInfo<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>\n+ >\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n-***** Detailed Description *****\n-Functions for VTK output on the skeleton.\n- Author\n- J\u00c3\u00b6 Fahlke\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00968_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00968_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: skeletonfunction.hh Source File\n+dune-grid: dgfgeogrid.hh Source File\n \n \n \n \n \n \n \n@@ -70,189 +70,348 @@\n \n \n \n \n \n \n \n
    \n-
    skeletonfunction.hh
    \n+
    dgfgeogrid.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH
    \n-
    8
    \n-
    9#include <memory>
    \n-
    10#include <string>
    \n-
    11#include <vector>
    \n-
    12
    \n-
    13#include <dune/common/fvector.hh>
    \n-
    14
    \n-\n-\n-\n+
    5#ifndef DUNE_DGFGEOGRID_HH
    \n+
    6#define DUNE_DGFGEOGRID_HH
    \n+
    7
    \n+
    8#include <dune/common/typetraits.hh>
    \n+
    9
    \n+\n+\n+\n+\n+\n+
    15
    \n+\n+
    17
    \n
    18
    \n-
    19namespace Dune {
    \n-
    20
    \n-
    23
    \n-
    29 namespace VTK {
    \n+
    19namespace Dune
    \n+
    20{
    \n+
    21
    \n+
    22 /************************************************************************
    \n+
    23 * Warning:
    \n+
    24 * Reading DGF files directly into a GeometryGrid is a dirty hack for
    \n+
    25 * two reasons:
    \n+
    26 * 1) The host grid and coordinate function are never deleted (dangling
    \n+
    27 * pointers).
    \n+
    28 * 2) The coordinate function has to provide a default constructor
    \n+
    29 ************************************************************************/
    \n
    30
    \n-
    32 //
    \n-
    33 // Prototype for VTKFunktions on the skeleton
    \n-
    34 //
    \n-
    35
    \n-
    36 template<typename GV, typename RF>
    \n-
    \n-\n-
    38 typedef GV GridView;
    \n-
    39 typedef typename GV::Intersection Cell;
    \n-
    40
    \n-
    41 typedef typename GV::ctype DomainField;
    \n-
    42 static const unsigned dimDomain = GV::dimension-1;
    \n-
    43 typedef FieldVector<DomainField, dimDomain> Domain;
    \n-
    44
    \n-
    45 typedef RF RangeField;
    \n-
    46 typedef std::vector<RangeField> Range;
    \n-
    47 };
    \n-
    \n+
    31 // External Forward Declarations
    \n+
    32 // -----------------------------
    \n+
    33
    \n+
    34 template< class GridImp, class IntersectionImp >
    \n+
    35 class Intersection;
    \n+
    36
    \n+
    37
    \n+
    38
    \n+
    39 // DGFCoordFunction
    \n+
    40 // ----------------
    \n+
    41
    \n+
    42 template< int dimD, int dimR >
    \n+
    \n+\n+
    44 : public AnalyticalCoordFunction< double, dimD, dimR, DGFCoordFunction< dimD, dimR > >
    \n+
    45 {
    \n+\n+\n
    48
    \n-
    50 template <typename GV, typename RF>
    \n-
    \n-\n-
    52 public:
    \n-\n+
    49 public:
    \n+\n+\n+
    52
    \n+\n
    54
    \n-
    56 unsigned dimRange() const;
    \n-
    57
    \n-
    59
    \n-
    65 void evaluate(const typename Traits::Cell& c,
    \n-
    66 const typename Traits::Domain& xl,
    \n-
    67 typename Traits::Range& result) const;
    \n-
    68 };
    \n-
    \n-
    69
    \n-
    71 //
    \n-
    72 // Class for writing SkeletonFunctions
    \n-
    73 //
    \n+
    \n+
    55 DGFCoordFunction ( const Expression *expression )
    \n+
    56 : expression_( expression )
    \n+
    57 {}
    \n+
    \n+
    58
    \n+
    \n+
    59 void evaluate ( const DomainVector &x, RangeVector &y ) const
    \n+
    60 {
    \n+
    61 std::vector< double > vx( dimD );
    \n+
    62 std::vector< double > vy;
    \n+
    63 for( int i = 0; i < dimD; ++i )
    \n+
    64 vx[ i ] = x[ i ];
    \n+
    65 expression_->evaluate( vx, vy );
    \n+
    66 assert( vy.size() == size_t( dimR ) );
    \n+
    67 for( int i = 0; i < dimR; ++i )
    \n+
    68 y[ i ] = vy[ i ];
    \n+
    69 }
    \n+
    \n+
    70
    \n+
    71 private:
    \n+
    72 const Expression *expression_;
    \n+
    73 };
    \n+
    \n
    74
    \n+
    75
    \n
    76
    \n-
    80 template<typename Func>
    \n-
    \n-\n-
    82 : public FunctionWriterBase<typename Func::Traits::Cell>
    \n-
    83 {
    \n-
    84 typedef typename Func::Traits::RangeField RF;
    \n-
    85
    \n-
    86 std::shared_ptr<const Func> func;
    \n-
    87 std::string name_;
    \n-
    88 unsigned dimR;
    \n-
    89 VTK::Precision precision_;
    \n-
    90 std::shared_ptr<DataArrayWriter> arraywriter;
    \n-
    91
    \n-
    92 public:
    \n-
    \n-
    93 SkeletonFunctionWriter(const std::shared_ptr<const Func>& func_,
    \n-
    94 const std::string& name, unsigned dimR_,
    \n-\n-
    96 : func(func_), name_(name), dimR(dimR_), precision_(prec)
    \n-
    97 { }
    \n-
    \n-
    98
    \n-
    \n-
    99 SkeletonFunctionWriter(const std::shared_ptr<const Func>& func_,
    \n-
    100 const std::string& name,
    \n-\n-
    102 : func(func_), name_(name), dimR(func->dimRange()), precision_(prec)
    \n-
    103 { }
    \n+
    77 // DGFCoordFunctionFactory
    \n+
    78 // -----------------------
    \n+
    79
    \n+
    80 template< class HostGrid, class CoordFunction,
    \n+
    81 bool discrete = GeoGrid::isDiscreteCoordFunctionInterface< typename CoordFunction::Interface >::value >
    \n+\n+
    83
    \n+
    84
    \n+
    85 template< class HostGrid, class CoordFunction >
    \n+
    \n+
    86 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, false >
    \n+
    87 {
    \n+
    \n+
    88 static CoordFunction *create ( std::istream &, const HostGrid & )
    \n+
    89 {
    \n+
    90 return new CoordFunction;
    \n+
    91 }
    \n+
    \n+
    92 };
    \n+
    \n+
    93
    \n+
    94
    \n+
    95 template< class HostGrid, class CoordFunction >
    \n+
    \n+
    96 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, true >
    \n+
    97 {
    \n+
    \n+
    98 static CoordFunction *create ( std::istream &, const HostGrid &hostGrid )
    \n+
    99 {
    \n+
    100 return new CoordFunction( hostGrid );
    \n+
    101 }
    \n+
    \n+
    102 };
    \n
    \n+
    103
    \n
    104
    \n-
    106 virtual std::string name() const { return name_; }
    \n-
    107
    \n-
    109 virtual unsigned ncomps() const { return dimR; }
    \n-
    110
    \n-
    \n-
    112 virtual void addArray(PVTUWriter& writer) {
    \n-
    113 writer.addArray(name(), ncomps(), precision_);
    \n-
    114 }
    \n-
    \n-
    115
    \n-
    \n-
    117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {
    \n-
    118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),
    \n-
    119 nitems, precision_));
    \n-
    120 return !arraywriter->writeIsNoop();
    \n-
    121 }
    \n-
    \n-
    122
    \n-
    \n-
    124 virtual void write(const typename Func::Traits::Cell& cell,
    \n-
    125 const typename Func::Traits::Domain& xl) {
    \n-
    126 typename Func::Traits::Range result;
    \n-
    127 func->evaluate(cell, xl, result);
    \n-
    128 for(unsigned d = 0; d < result.size() && d < dimR; ++d)
    \n-
    129 arraywriter->write(result[d]);
    \n-
    130 for(unsigned d = result.size(); d < dimR; ++d)
    \n-
    131 arraywriter->write(0);
    \n-
    132 }
    \n-
    \n-
    133
    \n-
    \n-
    135 virtual void endWrite() {
    \n-
    136 arraywriter.reset();
    \n-
    137 }
    \n-
    \n-
    138 };
    \n-
    \n-
    139
    \n-
    140 } // namespace VTK
    \n-
    141
    \n-
    143
    \n-
    144} // namespace Dune
    \n-
    145
    \n-
    146#endif // DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH
    \n-\n-\n-\n+
    105 template< class HostGrid, int dimD, int dimR >
    \n+
    \n+
    106 struct DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >, false >
    \n+
    107 {
    \n+\n+
    109
    \n+
    \n+
    110 static CoordFunction *create ( std::istream &input, const HostGrid &hostGrid )
    \n+
    111 {
    \n+
    112 dgf::ProjectionBlock projectionBlock( input, dimR );
    \n+
    113 const typename CoordFunction::Expression *expression = projectionBlock.function( "coordfunction" );
    \n+
    114 if( expression == 0 )
    \n+
    115 DUNE_THROW( DGFException, "no coordfunction specified in DGF file." );
    \n+
    116 return new CoordFunction( expression );
    \n+
    117 }
    \n+
    \n+
    118 };
    \n+
    \n+
    119
    \n+
    120
    \n+
    121
    \n+
    122 // DGFGridFactory for GeometryGrid
    \n+
    123 // -------------------------------
    \n+
    124
    \n+
    125 template< class HostGrid, class CoordFunction, class Allocator >
    \n+
    \n+
    126 struct DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > >
    \n+
    127 {
    \n+\n+
    129
    \n+
    130 const static int dimension = Grid::dimension;
    \n+
    131 typedef MPIHelper::MPICommunicator MPICommunicator;
    \n+
    132 typedef typename Grid::template Codim<0>::Entity Element;
    \n+
    133 typedef typename Grid::template Codim<dimension>::Entity Vertex;
    \n+
    134
    \n+\n+
    136
    \n+
    \n+
    137 explicit DGFGridFactory ( std::istream &input,
    \n+
    138 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n+
    139 : dgfHostFactory_( input, comm ),
    \n+
    140 grid_( 0 )
    \n+
    141 {
    \n+
    142 auto hostGrid = std::shared_ptr<HostGrid>(dgfHostFactory_.grid());
    \n+
    143 assert( hostGrid != 0 );
    \n+
    144 auto coordFunction = std::shared_ptr<CoordFunction>(CoordFunctionFactory::create( input, *hostGrid ));
    \n+
    145 grid_ = new Grid( hostGrid, coordFunction );
    \n+
    146 }
    \n+
    \n+
    147
    \n+
    \n+
    148 explicit DGFGridFactory ( const std::string &filename,
    \n+
    149 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n+
    150 : dgfHostFactory_( filename, comm ),
    \n+
    151 grid_( 0 )
    \n+
    152 {
    \n+
    153 auto hostGrid = std::shared_ptr<HostGrid>(dgfHostFactory_.grid());
    \n+
    154 assert( hostGrid != 0 );
    \n+
    155 std::ifstream input( filename.c_str() );
    \n+
    156 auto coordFunction = std::shared_ptr<CoordFunction>(CoordFunctionFactory::create( input, *hostGrid ));
    \n+
    157 grid_ = new Grid( hostGrid, coordFunction );
    \n+
    158 }
    \n+
    \n+
    159
    \n+
    \n+
    160 Grid *grid () const
    \n+
    161 {
    \n+
    162 return grid_;
    \n+
    163 }
    \n+
    \n+
    164
    \n+
    165 template< class Intersection >
    \n+
    \n+
    166 bool wasInserted ( const Intersection &intersection ) const
    \n+
    167 {
    \n+
    168 return dgfHostFactory_.wasInserted( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n+
    169 }
    \n+
    \n+
    170
    \n+
    171 template< class Intersection >
    \n+
    \n+
    172 int boundaryId ( const Intersection &intersection ) const
    \n+
    173 {
    \n+
    174 return dgfHostFactory_.boundaryId( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n+
    175 }
    \n+
    \n+
    176
    \n+
    177 template< int codim >
    \n+
    \n+
    178 int numParameters () const
    \n+
    179 {
    \n+
    180 return dgfHostFactory_.template numParameters< codim >();
    \n+
    181 }
    \n+
    \n+
    182
    \n+
    183 // return true if boundary parameters found
    \n+
    \n+\n+
    185 {
    \n+
    186 return dgfHostFactory_.haveBoundaryParameters();
    \n+
    187 }
    \n+
    \n+
    188
    \n+
    189 template< class GG, class II >
    \n+
    190 const typename DGFBoundaryParameter::type &
    \n+
    \n+
    191 boundaryParameter ( const Dune::Intersection< GG, II > & intersection ) const
    \n+
    192 {
    \n+
    193 return dgfHostFactory_.boundaryParameter( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n+
    194 }
    \n+
    \n+
    195
    \n+
    196 template< class Entity >
    \n+
    \n+
    197 std::vector< double > &parameter ( const Entity &entity )
    \n+
    198 {
    \n+
    199 return dgfHostFactory_.parameter( HostGridAccess< Grid >::hostEntity( entity ) );
    \n+
    200 }
    \n+
    \n+
    201
    \n+
    202 private:
    \n+
    203 DGFGridFactory< HostGrid > dgfHostFactory_;
    \n+
    204 Grid *grid_;
    \n+
    205 };
    \n+
    \n+
    206
    \n+
    207
    \n+
    208
    \n+
    209 // DGFGridInfo for GeometryGrid
    \n+
    210 // ----------------------------
    \n+
    211
    \n+
    212 template< class HostGrid, class CoordFunction, class Allocator >
    \n+
    \n+
    213 struct DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > >
    \n+
    214 {
    \n+
    \n+
    215 static int refineStepsForHalf ()
    \n+
    216 {
    \n+\n+
    218 }
    \n+
    \n+
    219
    \n+
    \n+
    220 static double refineWeight ()
    \n+
    221 {
    \n+
    222 return -1.0;
    \n+
    223 }
    \n+
    \n+
    224 };
    \n+
    \n+
    225
    \n+
    226}
    \n+
    227
    \n+
    228#endif // #ifndef DUNE_DGFGEOGRID_HH
    \n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-\n-
    Base class for function writers.
    Definition functionwriter.hh:34
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n-
    void addArray(const std::string &name, unsigned ncomps, Precision prec)
    Add an array to the output file.
    Definition pvtuwriter.hh:207
    \n-
    Definition skeletonfunction.hh:37
    \n-
    RF RangeField
    Definition skeletonfunction.hh:45
    \n-
    FieldVector< DomainField, dimDomain > Domain
    Definition skeletonfunction.hh:43
    \n-
    GV GridView
    Definition skeletonfunction.hh:38
    \n-
    std::vector< RangeField > Range
    Definition skeletonfunction.hh:46
    \n-
    GV::Intersection Cell
    Definition skeletonfunction.hh:39
    \n-
    GV::ctype DomainField
    Definition skeletonfunction.hh:41
    \n-
    static const unsigned dimDomain
    Definition skeletonfunction.hh:42
    \n-
    A prototype for VTKFunctions on the skeleton.
    Definition skeletonfunction.hh:51
    \n-
    unsigned dimRange() const
    get dimension of the Range
    \n-
    SkeletonFunctionTraits< GV, RF > Traits
    Definition skeletonfunction.hh:53
    \n-
    void evaluate(const typename Traits::Cell &c, const typename Traits::Domain &xl, typename Traits::Range &result) const
    evaluate at local point xl in Cell c, store in result
    \n-
    function writer for skeleton functions
    Definition skeletonfunction.hh:83
    \n-
    virtual std::string name() const
    return name
    Definition skeletonfunction.hh:106
    \n-
    SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::string &name, VTK::Precision prec=VTK::Precision::float32)
    Definition skeletonfunction.hh:99
    \n-
    virtual void addArray(PVTUWriter &writer)
    add this field to the given parallel writer
    Definition skeletonfunction.hh:112
    \n-
    virtual void write(const typename Func::Traits::Cell &cell, const typename Func::Traits::Domain &xl)
    write at the given position
    Definition skeletonfunction.hh:124
    \n-
    virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)
    start writing with the given writer
    Definition skeletonfunction.hh:117
    \n-
    SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::string &name, unsigned dimR_, VTK::Precision prec=VTK::Precision::float32)
    Definition skeletonfunction.hh:93
    \n-
    virtual void endWrite()
    signal end of writing
    Definition skeletonfunction.hh:135
    \n-
    virtual unsigned ncomps() const
    return number of components of the vector
    Definition skeletonfunction.hh:109
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n-
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n+
    Definition dgfgridfactory.hh:38
    \n+
    G Grid
    Definition dgfgridfactory.hh:39
    \n+
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    Derive an implementation of an analytical coordinate function from this class.
    Definition coordfunction.hh:134
    \n+
    Base::DomainVector DomainVector
    Definition coordfunction.hh:139
    \n+
    Base::RangeVector RangeVector
    Definition coordfunction.hh:140
    \n+
    grid wrapper replacing the geometries
    Definition geometrygrid/grid.hh:86
    \n+
    traits structure containing types for a codimension
    Definition geometrygrid/grid.hh:606
    \n+
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n+
    Definition io/file/dgfparser/blocks/projection.hh:24
    \n+
    ExpressionPointer function(const std::string &name) const
    Definition io/file/dgfparser/blocks/projection.hh:100
    \n+
    Definition io/file/dgfparser/blocks/projection.hh:160
    \n+
    virtual void evaluate(const Vector &argument, Vector &result) const =0
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Definition dgfgeogrid.hh:45
    \n+
    Base::DomainVector DomainVector
    Definition dgfgeogrid.hh:50
    \n+
    void evaluate(const DomainVector &x, RangeVector &y) const
    Definition dgfgeogrid.hh:59
    \n+
    dgf::ProjectionBlock::Expression Expression
    Definition dgfgeogrid.hh:53
    \n+
    DGFCoordFunction(const Expression *expression)
    Definition dgfgeogrid.hh:55
    \n+
    Base::RangeVector RangeVector
    Definition dgfgeogrid.hh:51
    \n+
    Definition dgfgeogrid.hh:82
    \n+
    static CoordFunction * create(std::istream &, const HostGrid &)
    Definition dgfgeogrid.hh:88
    \n+
    static CoordFunction * create(std::istream &, const HostGrid &hostGrid)
    Definition dgfgeogrid.hh:98
    \n+
    static CoordFunction * create(std::istream &input, const HostGrid &hostGrid)
    Definition dgfgeogrid.hh:110
    \n+
    DGFCoordFunction< dimD, dimR > CoordFunction
    Definition dgfgeogrid.hh:108
    \n+
    Grid::template Codim< dimension >::Entity Vertex
    Definition dgfgeogrid.hh:133
    \n+
    int boundaryId(const Intersection &intersection) const
    Definition dgfgeogrid.hh:172
    \n+
    MPIHelper::MPICommunicator MPICommunicator
    Definition dgfgeogrid.hh:131
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
    Definition dgfgeogrid.hh:191
    \n+
    DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfgeogrid.hh:137
    \n+
    Grid::template Codim< 0 >::Entity Element
    Definition dgfgeogrid.hh:132
    \n+\n+
    DGFCoordFunctionFactory< HostGrid, CoordFunction > CoordFunctionFactory
    Definition dgfgeogrid.hh:135
    \n+
    GeometryGrid< HostGrid, CoordFunction, Allocator > Grid
    Definition dgfgeogrid.hh:128
    \n+\n+
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfgeogrid.hh:197
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfgeogrid.hh:148
    \n+
    bool wasInserted(const Intersection &intersection) const
    Definition dgfgeogrid.hh:166
    \n+\n+\n+\n+
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n+
    static int refineStepsForHalf()
    number of globalRefine steps needed to refuce h by 0.5
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+\n+\n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,233 +2,425 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-skeletonfunction.hh\n+ * dgfparser\n+dgfgeogrid.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH\n-7#define DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH\n-8\n-9#include \n-10#include \n-11#include \n-12\n-13#include \n-14\n-15#include \n-16#include \n-17#include \n+5#ifndef DUNE_DGFGEOGRID_HH\n+6#define DUNE_DGFGEOGRID_HH\n+7\n+8#include \n+9\n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15\n+16#include \n+17\n 18\n-19namespace Dune {\n-20\n-23\n-29 namespace VTK {\n+19namespace Dune\n+20{\n+21\n+22 /************************************************************************\n+23 * Warning:\n+24 * Reading DGF files directly into a GeometryGrid is a dirty hack for\n+25 * two reasons:\n+26 * 1) The host grid and coordinate function are never deleted (dangling\n+27 * pointers).\n+28 * 2) The coordinate function has to provide a default constructor\n+29 ************************************************************************/\n 30\n-32 //\n-33 // Prototype for VTKFunktions on the skeleton\n-34 //\n-35\n-36 template\n-37 struct SkeletonFunctionTraits {\n-38 typedef GV GridView;\n-39 typedef typename GV::Intersection Cell;\n-40\n-41 typedef typename GV::ctype DomainField;\n-42 static const unsigned dimDomain = GV::dimension-1;\n-43 typedef FieldVector Domain;\n-44\n-45 typedef RF RangeField;\n-46 typedef std::vector Range;\n-47 };\n+31 // External Forward Declarations\n+32 // -----------------------------\n+33\n+34 template< class GridImp, class IntersectionImp >\n+35 class Intersection;\n+36\n+37\n+38\n+39 // DGFCoordFunction\n+40 // ----------------\n+41\n+42 template< int dimD, int dimR >\n+43 class DGFCoordFunction\n+44 : public AnalyticalCoordFunction< double, dimD, dimR, DGFCoordFunction<\n+dimD, dimR > >\n+45 {\n+46 typedef DGFCoordFunction<_dimD,_dimR_> This;\n+47 typedef AnalyticalCoordFunction<_double,_dimD,_dimR,_This_> Base;\n 48\n-50 template \n-51 class SkeletonFunctionInterface {\n-52 public:\n-53 typedef SkeletonFunctionTraits Traits;\n+49 public:\n+50 typedef typename Base::DomainVector DomainVector;\n+51 typedef typename Base::RangeVector RangeVector;\n+52\n+53 typedef dgf::ProjectionBlock::Expression Expression;\n 54\n-56 unsigned dimRange() const;\n-57\n-59\n-65 void evaluate(const typename Traits::Cell& c,\n-66 const typename Traits::Domain& xl,\n-67 typename Traits::Range& result) const;\n-68 };\n-69\n-71 //\n-72 // Class for writing SkeletonFunctions\n-73 //\n+55 DGFCoordFunction ( const Expression *expression )\n+56 : expression_( expression )\n+57 {}\n+58\n+59 void evaluate ( const DomainVector &x, RangeVector &y ) const\n+60 {\n+61 std::vector< double > vx( dimD );\n+62 std::vector< double > vy;\n+63 for( int i = 0; i < dimD; ++i )\n+64 vx[ i ] = x[ i ];\n+65 expression_->evaluate( vx, vy );\n+66 assert( vy.size() == size_t( dimR ) );\n+67 for( int i = 0; i < dimR; ++i )\n+68 y[ i ] = vy[ i ];\n+69 }\n+70\n+71 private:\n+72 const Expression *expression_;\n+73 };\n 74\n+75\n 76\n-80 template\n-81 class SkeletonFunctionWriter\n-82 : public FunctionWriterBase\n-83 {\n-84 typedef typename Func::Traits::RangeField RF;\n-85\n-86 std::shared_ptr func;\n-87 std::string name_;\n-88 unsigned dimR;\n-89 VTK::Precision precision_;\n-90 std::shared_ptr arraywriter;\n-91\n-92 public:\n-93 SkeletonFunctionWriter(const std::shared_ptr& func_,\n-94 const std::string& name, unsigned dimR_,\n-95 VTK::Precision prec = VTK::Precision::float32)\n-96 : func(func_), name_(name), dimR(dimR_), precision_(prec)\n-97 { }\n-98\n-99 SkeletonFunctionWriter(const std::shared_ptr& func_,\n-100 const std::string& name,\n-101 VTK::Precision prec = VTK::Precision::float32)\n-102 : func(func_), name_(name), dimR(func->dimRange()), precision_(prec)\n-103 { }\n+77 // DGFCoordFunctionFactory\n+78 // -----------------------\n+79\n+80 template< class HostGrid, class CoordFunction,\n+81 bool discrete = GeoGrid::isDiscreteCoordFunctionInterface< typename\n+CoordFunction::Interface >::value >\n+82 struct DGFCoordFunctionFactory;\n+83\n+84\n+85 template< class HostGrid, class CoordFunction >\n+86 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, false >\n+87 {\n+88 static CoordFunction *create ( std::istream &, const HostGrid & )\n+89 {\n+90 return new CoordFunction;\n+91 }\n+92 };\n+93\n+94\n+95 template< class HostGrid, class CoordFunction >\n+96 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, true >\n+97 {\n+98 static CoordFunction *create ( std::istream &, const HostGrid &hostGrid )\n+99 {\n+100 return new CoordFunction( hostGrid );\n+101 }\n+102 };\n+103\n 104\n-106 virtual std::string name() const { return name_; }\n-107\n-109 virtual unsigned ncomps() const { return dimR; }\n-110\n-112 virtual void addArray(PVTUWriter& writer) {\n-113 writer.addArray(name(), ncomps(), precision_);\n-114 }\n-115\n-117 virtual bool beginWrite(VTUWriter& writer, std::size_t nitems) {\n-118 arraywriter.reset(writer.makeArrayWriter(name(), ncomps(),\n-119 nitems, precision_));\n-120 return !arraywriter->writeIsNoop();\n-121 }\n-122\n-124 virtual void write(const typename Func::Traits::Cell& cell,\n-125 const typename Func::Traits::Domain& xl) {\n-126 typename Func::Traits::Range result;\n-127 func->evaluate(cell, xl, result);\n-128 for(unsigned d = 0; d < result.size() && d < dimR; ++d)\n-129 arraywriter->write(result[d]);\n-130 for(unsigned d = result.size(); d < dimR; ++d)\n-131 arraywriter->write(0);\n-132 }\n-133\n-135 virtual void endWrite() {\n-136 arraywriter.reset();\n-137 }\n-138 };\n-139\n-140 } // namespace VTK\n-141\n-143\n-144} // namespace Dune\n-145\n-146#endif // DUNE_GRID_IO_FILE_VTK_SKELETONFUNCTION_HH\n-functionwriter.hh\n-vtuwriter.hh\n-pvtuwriter.hh\n+105 template< class HostGrid, int dimD, int dimR >\n+106 struct DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >,\n+false >\n+107 {\n+108 typedef DGFCoordFunction<_dimD,_dimR_> CoordFunction;\n+109\n+110 static CoordFunction *create ( std::istream &input, const HostGrid\n+&hostGrid )\n+111 {\n+112 dgf::ProjectionBlock projectionBlock( input, dimR );\n+113 const typename CoordFunction::Expression *expression =\n+projectionBlock.function( \"coordfunction\" );\n+114 if( expression == 0 )\n+115 DUNE_THROW( DGFException, \"no coordfunction specified in DGF file.\" );\n+116 return new CoordFunction( expression );\n+117 }\n+118 };\n+119\n+120\n+121\n+122 // DGFGridFactory for GeometryGrid\n+123 // -------------------------------\n+124\n+125 template< class HostGrid, class CoordFunction, class Allocator >\n+126 struct DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n+127 {\n+128 typedef GeometryGrid<_HostGrid,_CoordFunction,_Allocator_> Grid;\n+129\n+130 const static int dimension = Grid::dimension;\n+131 typedef MPIHelper::MPICommunicator MPICommunicator;\n+132 typedef typename Grid::template Codim<0>::Entity Element;\n+133 typedef typename Grid::template Codim::Entity Vertex;\n+134\n+135 typedef DGFCoordFunctionFactory<_HostGrid,_CoordFunction_>\n+CoordFunctionFactory;\n+136\n+137 explicit DGFGridFactory ( std::istream &input,\n+138 MPICommunicator comm = MPIHelper::getCommunicator() )\n+139 : dgfHostFactory_( input, comm ),\n+140 grid_( 0 )\n+141 {\n+142 auto hostGrid = std::shared_ptr(dgfHostFactory_.grid());\n+143 assert( hostGrid != 0 );\n+144 auto coordFunction = std::shared_ptr(CoordFunctionFactory::\n+create( input, *hostGrid ));\n+145 grid_ = new Grid( hostGrid, coordFunction );\n+146 }\n+147\n+148 explicit DGFGridFactory ( const std::string &filename,\n+149 MPICommunicator comm = MPIHelper::getCommunicator() )\n+150 : dgfHostFactory_( filename, comm ),\n+151 grid_( 0 )\n+152 {\n+153 auto hostGrid = std::shared_ptr(dgfHostFactory_.grid());\n+154 assert( hostGrid != 0 );\n+155 std::ifstream input( filename.c_str() );\n+156 auto coordFunction = std::shared_ptr(CoordFunctionFactory::\n+create( input, *hostGrid ));\n+157 grid_ = new Grid( hostGrid, coordFunction );\n+158 }\n+159\n+160 Grid *grid () const\n+161 {\n+162 return grid_;\n+163 }\n+164\n+165 template< class Intersection >\n+166 bool wasInserted ( const Intersection &intersection ) const\n+167 {\n+168 return dgfHostFactory_.wasInserted( HostGridAccess<_Grid_>::\n+hostIntersection( intersection ) );\n+169 }\n+170\n+171 template< class Intersection >\n+172 int boundaryId ( const Intersection &intersection ) const\n+173 {\n+174 return dgfHostFactory_.boundaryId( HostGridAccess<_Grid_>::hostIntersection\n+( intersection ) );\n+175 }\n+176\n+177 template< int codim >\n+178 int numParameters () const\n+179 {\n+180 return dgfHostFactory_.template numParameters< codim >();\n+181 }\n+182\n+183 // return true if boundary parameters found\n+184 bool haveBoundaryParameters () const\n+185 {\n+186 return dgfHostFactory_.haveBoundaryParameters();\n+187 }\n+188\n+189 template< class GG, class II >\n+190 const typename DGFBoundaryParameter::type &\n+191 boundaryParameter ( const Dune::Intersection<_GG,_II_> & intersection )\n+const\n+192 {\n+193 return dgfHostFactory_.boundaryParameter( HostGridAccess<_Grid_>::\n+hostIntersection( intersection ) );\n+194 }\n+195\n+196 template< class Entity >\n+197 std::vector< double > ¶meter ( const Entity &entity )\n+198 {\n+199 return dgfHostFactory_.parameter( HostGridAccess<_Grid_>::hostEntity\n+( entity ) );\n+200 }\n+201\n+202 private:\n+203 DGFGridFactory<_HostGrid_> dgfHostFactory_;\n+204 Grid *grid_;\n+205 };\n+206\n+207\n+208\n+209 // DGFGridInfo for GeometryGrid\n+210 // ----------------------------\n+211\n+212 template< class HostGrid, class CoordFunction, class Allocator >\n+213 struct DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n+214 {\n+215 static int refineStepsForHalf ()\n+216 {\n+217 return DGFGridInfo<_HostGrid_>::refineStepsForHalf();\n+218 }\n+219\n+220 static double refineWeight ()\n+221 {\n+222 return -1.0;\n+223 }\n+224 };\n+225\n+226}\n+227\n+228#endif // #ifndef DUNE_DGFGEOGRID_HH\n+geometrygrid.hh\n+parser.hh\n+hostgridaccess.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::Precision::float32\n-@ float32\n-Dune::VTK::FunctionWriterBase\n-Base class for function writers.\n-Definition functionwriter.hh:34\n-Dune::VTK::PVTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition pvtuwriter.hh:62\n-Dune::VTK::PVTUWriter::addArray\n-void addArray(const std::string &name, unsigned ncomps, Precision prec)\n-Add an array to the output file.\n-Definition pvtuwriter.hh:207\n-Dune::VTK::SkeletonFunctionTraits\n-Definition skeletonfunction.hh:37\n-Dune::VTK::SkeletonFunctionTraits::RangeField\n-RF RangeField\n-Definition skeletonfunction.hh:45\n-Dune::VTK::SkeletonFunctionTraits::Domain\n-FieldVector< DomainField, dimDomain > Domain\n-Definition skeletonfunction.hh:43\n-Dune::VTK::SkeletonFunctionTraits::GridView\n-GV GridView\n-Definition skeletonfunction.hh:38\n-Dune::VTK::SkeletonFunctionTraits::Range\n-std::vector< RangeField > Range\n-Definition skeletonfunction.hh:46\n-Dune::VTK::SkeletonFunctionTraits::Cell\n-GV::Intersection Cell\n-Definition skeletonfunction.hh:39\n-Dune::VTK::SkeletonFunctionTraits::DomainField\n-GV::ctype DomainField\n-Definition skeletonfunction.hh:41\n-Dune::VTK::SkeletonFunctionTraits::dimDomain\n-static const unsigned dimDomain\n-Definition skeletonfunction.hh:42\n-Dune::VTK::SkeletonFunctionInterface\n-A prototype for VTKFunctions on the skeleton.\n-Definition skeletonfunction.hh:51\n-Dune::VTK::SkeletonFunctionInterface::dimRange\n-unsigned dimRange() const\n-get dimension of the Range\n-Dune::VTK::SkeletonFunctionInterface::Traits\n-SkeletonFunctionTraits< GV, RF > Traits\n-Definition skeletonfunction.hh:53\n-Dune::VTK::SkeletonFunctionInterface::evaluate\n-void evaluate(const typename Traits::Cell &c, const typename Traits::Domain\n-&xl, typename Traits::Range &result) const\n-evaluate at local point xl in Cell c, store in result\n-Dune::VTK::SkeletonFunctionWriter\n-function writer for skeleton functions\n-Definition skeletonfunction.hh:83\n-Dune::VTK::SkeletonFunctionWriter::name\n-virtual std::string name() const\n-return name\n-Definition skeletonfunction.hh:106\n-Dune::VTK::SkeletonFunctionWriter::SkeletonFunctionWriter\n-SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::\n-string &name, VTK::Precision prec=VTK::Precision::float32)\n-Definition skeletonfunction.hh:99\n-Dune::VTK::SkeletonFunctionWriter::addArray\n-virtual void addArray(PVTUWriter &writer)\n-add this field to the given parallel writer\n-Definition skeletonfunction.hh:112\n-Dune::VTK::SkeletonFunctionWriter::write\n-virtual void write(const typename Func::Traits::Cell &cell, const typename\n-Func::Traits::Domain &xl)\n-write at the given position\n-Definition skeletonfunction.hh:124\n-Dune::VTK::SkeletonFunctionWriter::beginWrite\n-virtual bool beginWrite(VTUWriter &writer, std::size_t nitems)\n-start writing with the given writer\n-Definition skeletonfunction.hh:117\n-Dune::VTK::SkeletonFunctionWriter::SkeletonFunctionWriter\n-SkeletonFunctionWriter(const std::shared_ptr< const Func > &func_, const std::\n-string &name, unsigned dimR_, VTK::Precision prec=VTK::Precision::float32)\n-Definition skeletonfunction.hh:93\n-Dune::VTK::SkeletonFunctionWriter::endWrite\n-virtual void endWrite()\n-signal end of writing\n-Definition skeletonfunction.hh:135\n-Dune::VTK::SkeletonFunctionWriter::ncomps\n-virtual unsigned ncomps() const\n-return number of components of the vector\n-Definition skeletonfunction.hh:109\n-Dune::VTK::VTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition vtuwriter.hh:98\n-Dune::VTK::VTUWriter::makeArrayWriter\n-DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n-unsigned nitems, Precision prec)\n-acquire a DataArrayWriter\n-Definition vtuwriter.hh:380\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::Grid\n+G Grid\n+Definition dgfgridfactory.hh:39\n+Dune::DGFGridFactory::dimension\n+static const int dimension\n+Definition dgfgridfactory.hh:40\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::AnalyticalCoordFunction\n+Derive an implementation of an analytical coordinate function from this class.\n+Definition coordfunction.hh:134\n+Dune::AnalyticalCoordFunction::DomainVector\n+Base::DomainVector DomainVector\n+Definition coordfunction.hh:139\n+Dune::AnalyticalCoordFunction::RangeVector\n+Base::RangeVector RangeVector\n+Definition coordfunction.hh:140\n+Dune::GeometryGrid\n+grid wrapper replacing the geometries\n+Definition geometrygrid/grid.hh:86\n+Dune::GeometryGrid::Codim\n+traits structure containing types for a codimension\n+Definition geometrygrid/grid.hh:606\n+Dune::HostGridAccess\n+provides access to host grid objects from GeometryGrid\n+Definition identitygrid.hh:37\n+Dune::dgf::ProjectionBlock\n+Definition io/file/dgfparser/blocks/projection.hh:24\n+Dune::dgf::ProjectionBlock::function\n+ExpressionPointer function(const std::string &name) const\n+Definition io/file/dgfparser/blocks/projection.hh:100\n+Dune::dgf::ProjectionBlock::Expression\n+Definition io/file/dgfparser/blocks/projection.hh:160\n+Dune::dgf::ProjectionBlock::Expression::evaluate\n+virtual void evaluate(const Vector &argument, Vector &result) const =0\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n+Dune::DGFCoordFunction\n+Definition dgfgeogrid.hh:45\n+Dune::DGFCoordFunction::DomainVector\n+Base::DomainVector DomainVector\n+Definition dgfgeogrid.hh:50\n+Dune::DGFCoordFunction::evaluate\n+void evaluate(const DomainVector &x, RangeVector &y) const\n+Definition dgfgeogrid.hh:59\n+Dune::DGFCoordFunction::Expression\n+dgf::ProjectionBlock::Expression Expression\n+Definition dgfgeogrid.hh:53\n+Dune::DGFCoordFunction::DGFCoordFunction\n+DGFCoordFunction(const Expression *expression)\n+Definition dgfgeogrid.hh:55\n+Dune::DGFCoordFunction::RangeVector\n+Base::RangeVector RangeVector\n+Definition dgfgeogrid.hh:51\n+Dune::DGFCoordFunctionFactory\n+Definition dgfgeogrid.hh:82\n+Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_false_>::create\n+static CoordFunction * create(std::istream &, const HostGrid &)\n+Definition dgfgeogrid.hh:88\n+Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_true_>::create\n+static CoordFunction * create(std::istream &, const HostGrid &hostGrid)\n+Definition dgfgeogrid.hh:98\n+Dune::DGFCoordFunctionFactory<_HostGrid,_DGFCoordFunction<_dimD,_dimR_>,_false\n+>::create\n+static CoordFunction * create(std::istream &input, const HostGrid &hostGrid)\n+Definition dgfgeogrid.hh:110\n+Dune::DGFCoordFunctionFactory<_HostGrid,_DGFCoordFunction<_dimD,_dimR_>,_false\n+>::CoordFunction\n+DGFCoordFunction< dimD, dimR > CoordFunction\n+Definition dgfgeogrid.hh:108\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+Vertex\n+Grid::template Codim< dimension >::Entity Vertex\n+Definition dgfgeogrid.hh:133\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+boundaryId\n+int boundaryId(const Intersection &intersection) const\n+Definition dgfgeogrid.hh:172\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+MPICommunicator\n+MPIHelper::MPICommunicator MPICommunicator\n+Definition dgfgeogrid.hh:131\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection<\n+GG, II > &intersection) const\n+Definition dgfgeogrid.hh:191\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+DGFGridFactory\n+DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::\n+getCommunicator())\n+Definition dgfgeogrid.hh:137\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+Element\n+Grid::template Codim< 0 >::Entity Element\n+Definition dgfgeogrid.hh:132\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+grid\n+Grid * grid() const\n+Definition dgfgeogrid.hh:160\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+CoordFunctionFactory\n+DGFCoordFunctionFactory< HostGrid, CoordFunction > CoordFunctionFactory\n+Definition dgfgeogrid.hh:135\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+Grid\n+GeometryGrid< HostGrid, CoordFunction, Allocator > Grid\n+Definition dgfgeogrid.hh:128\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+numParameters\n+int numParameters() const\n+Definition dgfgeogrid.hh:178\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+parameter\n+std::vector< double > & parameter(const Entity &entity)\n+Definition dgfgeogrid.hh:197\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::\n+getCommunicator())\n+Definition dgfgeogrid.hh:148\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+wasInserted\n+bool wasInserted(const Intersection &intersection) const\n+Definition dgfgeogrid.hh:166\n+Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+Definition dgfgeogrid.hh:184\n+Dune::DGFGridInfo<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+refineWeight\n+static double refineWeight()\n+Definition dgfgeogrid.hh:220\n+Dune::DGFGridInfo<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n+refineStepsForHalf\n+static int refineStepsForHalf()\n+Definition dgfgeogrid.hh:215\n+Dune::DGFGridInfo\n+Some simple static information for a given GridType.\n+Definition io/file/dgfparser/dgfparser.hh:56\n+Dune::DGFGridInfo::refineStepsForHalf\n+static int refineStepsForHalf()\n+number of globalRefine steps needed to refuce h by 0.5\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+dgfparser.hh\n+intersection.hh\n+projection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00971.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00971.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: pvtuwriter.hh File Reference\n+dune-grid: gnuplot.hh File Reference\n \n \n \n \n \n \n \n@@ -65,46 +65,58 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    pvtuwriter.hh File Reference
    \n+
    gnuplot.hh File Reference
    \n
    \n
    \n-
    #include <ostream>
    \n+\n+

    Provides gnuplot output for 1D Grids. \n+More...

    \n+
    #include <vector>
    \n #include <string>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/indent.hh>
    \n-#include <dune/grid/io/file/vtk/common.hh>
    \n+#include <iostream>
    \n+#include <fstream>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/grid/common/grid.hh>
    \n+#include "gnuplot/gnuplot.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 Classes

    class  Dune::VTK::PVTUWriter
     Dump a .vtu/.vtp files contents to a stream. More...
    class  Dune::GnuplotWriter< GridView >
     Writer for 1D grids in gnuplot format. More...
     
    class  Dune::LeafGnuplotWriter< G >
     GnuplotWriter on the leaf grid. More...
     
    class  Dune::LevelGnuplotWriter< G >
     GnuplotWriter on a given level grid. More...
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::VTK
     
    \n-
    \n+

    Detailed Description

    \n+

    Provides gnuplot output for 1D Grids.

    \n+
    Author
    Christian Engwer
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,28 +2,38 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n Classes | Namespaces\n-pvtuwriter.hh File Reference\n-#include \n+gnuplot.hh File Reference\n+Provides gnuplot output for 1D Grids. More...\n+#include \n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \"gnuplot/gnuplot.cc\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::VTK::PVTUWriter\n-\u00a0 Dump a .vtu/.vtp files contents to a stream. More...\n+class \u00a0 Dune::GnuplotWriter<_GridView_>\n+\u00a0 Writer for 1D grids in gnuplot format. More...\n+\u00a0\n+class \u00a0 Dune::LeafGnuplotWriter<_G_>\n+\u00a0 GnuplotWriter on the leaf grid. More...\n+\u00a0\n+class \u00a0 Dune::LevelGnuplotWriter<_G_>\n+\u00a0 GnuplotWriter on a given level grid. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::VTK\n-\u00a0\n+***** Detailed Description *****\n+Provides gnuplot output for 1D Grids.\n+ Author\n+ Christian Engwer\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00971_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00971_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: pvtuwriter.hh Source File\n+dune-grid: gnuplot.hh Source File\n \n \n \n \n \n \n \n@@ -70,197 +70,141 @@\n \n \n \n \n \n \n \n
    \n-
    pvtuwriter.hh
    \n+
    gnuplot.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH
    \n-
    8
    \n-
    9#include <ostream>
    \n-
    10#include <string>
    \n-
    11
    \n-
    12#include <dune/common/exceptions.hh>
    \n-
    13#include <dune/common/indent.hh>
    \n-
    14
    \n-\n-
    16
    \n-
    17namespace Dune {
    \n-
    18
    \n+
    5#ifndef DUNE_IO_GNUPLOT_HH
    \n+
    6#define DUNE_IO_GNUPLOT_HH
    \n+
    7
    \n+
    13#include <vector>
    \n+
    14#include <string>
    \n+
    15#include <iostream>
    \n+
    16#include <fstream>
    \n+
    17
    \n+
    18#include <dune/common/fvector.hh>
    \n+
    19
    \n+\n
    21
    \n-
    22 namespace VTK {
    \n+
    22namespace Dune {
    \n
    23
    \n-
    25
    \n-
    \n-
    62 class PVTUWriter {
    \n-
    63 std::ostream& stream;
    \n-
    64
    \n-
    65 std::string fileType;
    \n-
    66
    \n-
    67 Indent indent;
    \n-
    68
    \n-
    69 public:
    \n-
    71
    \n-
    \n-
    78 inline PVTUWriter(std::ostream& stream_, FileType fileType_)
    \n-
    79 : stream(stream_)
    \n-
    80 {
    \n-
    81 switch(fileType_) {
    \n-
    82 case polyData :
    \n-
    83 fileType = "PPolyData";
    \n-
    84 break;
    \n-
    85 case unstructuredGrid :
    \n-
    86 fileType = "PUnstructuredGrid";
    \n-
    87 break;
    \n-
    88 default :
    \n-
    89 DUNE_THROW(IOError, "PVTUWriter: Unknown fileType: " << fileType_);
    \n-
    90 }
    \n-
    91 const std::string& byteOrder = getEndiannessString();
    \n-
    92
    \n-
    93 stream << indent << "<?xml version=\\"1.0\\"?>\\n";
    \n-
    94 stream << indent << "<VTKFile"
    \n-
    95 << " type=\\"" << fileType << "\\""
    \n-
    96 << " version=\\"0.1\\""
    \n-
    97 << " byte_order=\\"" << byteOrder << "\\">\\n";
    \n-
    98 ++indent;
    \n-
    99 }
    \n-
    \n-
    100
    \n-
    \n-
    102 inline ~PVTUWriter() {
    \n-
    103 --indent;
    \n-
    104 stream << indent << "</VTKFile>\\n"
    \n-
    105 << std::flush;
    \n-
    106 }
    \n-
    \n-
    107
    \n-
    109
    \n-
    \n-
    120 inline void beginPointData(const std::string& scalars = "",
    \n-
    121 const std::string& vectors = "") {
    \n-
    122 stream << indent << "<PPointData";
    \n-
    123 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n-
    124 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n-
    125 stream << ">\\n";
    \n-
    126 ++indent;
    \n-
    127 }
    \n-
    \n-
    \n-
    129 inline void endPointData() {
    \n-
    130 --indent;
    \n-
    131 stream << indent << "</PPointData>\\n";
    \n-
    132 }
    \n-
    \n-
    133
    \n-
    135
    \n-
    \n-
    146 inline void beginCellData(const std::string& scalars = "",
    \n-
    147 const std::string& vectors = "") {
    \n-
    148 stream << indent << "<PCellData";
    \n-
    149 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n-
    150 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n-
    151 stream << ">\\n";
    \n-
    152 ++indent;
    \n-
    153 }
    \n-
    \n-
    \n-
    155 inline void endCellData() {
    \n-
    156 --indent;
    \n-
    157 stream << indent << "</PCellData>\\n";
    \n-
    158 }
    \n-
    \n-
    159
    \n-
    161
    \n-
    \n-
    166 inline void beginPoints() {
    \n-
    167 stream << indent << "<PPoints>\\n";
    \n-
    168 ++indent;
    \n-
    169 }
    \n-
    \n-
    \n-
    171 inline void endPoints() {
    \n-
    172 --indent;
    \n-
    173 stream << indent << "</PPoints>\\n";
    \n-
    174 }
    \n-
    \n-
    175
    \n-
    177
    \n-
    \n-
    189 inline void beginMain(unsigned ghostLevel = 0) {
    \n-
    190 stream << indent << "<" << fileType
    \n-
    191 << " GhostLevel=\\"" << ghostLevel << "\\">\\n";
    \n-
    192 ++indent;
    \n-
    193 }
    \n-
    \n-
    \n-
    195 inline void endMain() {
    \n-
    196 --indent;
    \n-
    197 stream << indent << "</" << fileType << ">\\n";
    \n-
    198 }
    \n-
    \n-
    199
    \n-
    201
    \n-
    \n-
    207 void addArray(const std::string& name, unsigned ncomps, Precision prec) {
    \n-
    208 stream << indent << "<PDataArray"
    \n-
    209 << " type=\\"" << toString(prec) << "\\""
    \n-
    210 << " Name=\\"" << name << "\\""
    \n-
    211 << " NumberOfComponents=\\"" << ncomps << "\\"/>\\n";
    \n-
    212 }
    \n-
    \n-
    213
    \n-
    \n-
    215 inline void addPiece(const std::string& filename) {
    \n-
    216 stream << indent << "<Piece "
    \n-
    217 << " Source=\\"" << filename << "\\"/>\\n";
    \n-
    218 }
    \n-
    \n-
    219 };
    \n-
    \n-
    220
    \n-
    221 } // namespace VTK
    \n-
    222
    \n-
    224
    \n-
    225} // namespace Dune
    \n-
    226
    \n-
    227#endif // DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH
    \n-
    Common stuff for the VTKWriter.
    \n+
    29 template<class GridView>
    \n+
    \n+\n+
    31
    \n+
    32 typedef typename GridView::Grid::ctype ctype;
    \n+
    33
    \n+
    34 constexpr static int dimworld = GridView::dimensionworld;
    \n+
    35
    \n+
    36 public:
    \n+
    \n+
    37 GnuplotWriter (const GridView & gv) : _is(gv.indexSet()), _gv(gv)
    \n+
    38 {
    \n+
    39 static_assert(dimworld==1 || dimworld==2, "GnuPlot export only works for worlddim==1 and worlddim==2");
    \n+
    40 // allocate _data buffer
    \n+
    41 _data.resize(_is.size(0)*2);
    \n+
    42 }
    \n+
    \n+
    43
    \n+
    48 template <class DataContainer>
    \n+
    \n+
    49 void addCellData(const DataContainer& data, const std::string & name)
    \n+
    50 {
    \n+
    51 if (dimworld!=1)
    \n+
    52 DUNE_THROW(IOError, "Gnuplot cell data writing is only supported for grids in a 1d world!");
    \n+
    53 addData(cellData, data, name);
    \n+
    54 }
    \n+
    \n+
    55
    \n+
    60 template <class DataContainer>
    \n+
    \n+
    61 void addVertexData(const DataContainer& data, const std::string & name)
    \n+
    62 {
    \n+
    63 addData(vertexData, data, name);
    \n+
    64 }
    \n+
    \n+
    65
    \n+
    69 void write(const std::string& filename) const;
    \n+
    70
    \n+
    71 private:
    \n+
    72 enum DataType { vertexData, cellData };
    \n+
    73 const typename GridView::IndexSet & _is;
    \n+
    74 const GridView _gv;
    \n+
    75 std::vector< std::vector< float > > _data;
    \n+
    76 std::vector< std::string > _names;
    \n+
    77
    \n+
    78 template <class DataContainer>
    \n+
    79 void addData(DataType t, const DataContainer& data, const std::string & name);
    \n+
    80
    \n+
    81 void writeRow(std::ostream & file,
    \n+
    82 const FieldVector<ctype, dimworld>& position,
    \n+
    83 const std::vector<float> & data) const;
    \n+
    84 };
    \n+
    \n+
    85
    \n+
    89 template<class G>
    \n+
    \n+
    90 class LeafGnuplotWriter : public GnuplotWriter<typename G::LeafGridView>
    \n+
    91 {
    \n+
    92 public:
    \n+
    \n+
    94 LeafGnuplotWriter (const G& grid)
    \n+
    95 : GnuplotWriter<typename G::LeafGridView>(grid.leafGridView())
    \n+
    96 {}
    \n+
    \n+
    97 };
    \n+
    \n+
    98
    \n+
    102 template<class G>
    \n+
    \n+
    103 class LevelGnuplotWriter : public GnuplotWriter<typename G::LevelGridView>
    \n+
    104 {
    \n+
    105 public:
    \n+
    \n+
    107 LevelGnuplotWriter (const G& grid, int level)
    \n+
    108 : GnuplotWriter<typename G::LevelGridView>(grid.levelGridView(level))
    \n+
    109 {}
    \n+
    \n+
    110 };
    \n+
    \n+
    111
    \n+
    112}
    \n+
    113
    \n+
    114#include "gnuplot/gnuplot.cc"
    \n+
    115
    \n+
    116#endif // DUNE_IO_GNUPLOT_HH
    \n+
    Implementation of gnuplot output for 1D and 2D grids.
    \n+
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n+
    Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
    leaf grid view for the given grid
    Definition common/grid.hh:805
    \n+
    Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
    level grid view for the given grid and level.
    Definition common/grid.hh:788
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/gridview.hh:137
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n-
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n-
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n-
    std::string toString(Precision p)
    map precision to VTK type name
    Definition common.hh:280
    \n-
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n-
    ~PVTUWriter()
    write footer
    Definition pvtuwriter.hh:102
    \n-
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition pvtuwriter.hh:195
    \n-
    void endCellData()
    finish CellData section
    Definition pvtuwriter.hh:155
    \n-
    void addArray(const std::string &name, unsigned ncomps, Precision prec)
    Add an array to the output file.
    Definition pvtuwriter.hh:207
    \n-
    void beginMain(unsigned ghostLevel=0)
    start the main PPolyData/PUnstructuredGrid section
    Definition pvtuwriter.hh:189
    \n-
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition pvtuwriter.hh:146
    \n-
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition pvtuwriter.hh:120
    \n-
    void addPiece(const std::string &filename)
    Add a serial piece to the output file.
    Definition pvtuwriter.hh:215
    \n-
    PVTUWriter(std::ostream &stream_, FileType fileType_)
    create a PVTUWriter object
    Definition pvtuwriter.hh:78
    \n-
    void endPointData()
    finish PointData section
    Definition pvtuwriter.hh:129
    \n-
    void endPoints()
    finish section for the point coordinates
    Definition pvtuwriter.hh:171
    \n-
    void beginPoints()
    start section for the point coordinates
    Definition pvtuwriter.hh:166
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    Writer for 1D grids in gnuplot format.
    Definition gnuplot.hh:30
    \n+
    void addVertexData(const DataContainer &data, const std::string &name)
    Add vertex data.
    Definition gnuplot.hh:61
    \n+
    void addCellData(const DataContainer &data, const std::string &name)
    Add cell data.
    Definition gnuplot.hh:49
    \n+
    void write(const std::string &filename) const
    Write Gnuplot file to disk.
    Definition gnuplot.cc:19
    \n+
    GnuplotWriter(const GridView &gv)
    Definition gnuplot.hh:37
    \n+
    GnuplotWriter on the leaf grid.
    Definition gnuplot.hh:91
    \n+
    LeafGnuplotWriter(const G &grid)
    Construct a Gnuplot writer for the leaf level of a given grid.
    Definition gnuplot.hh:94
    \n+
    GnuplotWriter on a given level grid.
    Definition gnuplot.hh:104
    \n+
    LevelGnuplotWriter(const G &grid, int level)
    Construct a Gnuplot writer for a certain level of a given grid.
    Definition gnuplot.hh:107
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,224 +2,162 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * vtk\n-pvtuwriter.hh\n+gnuplot.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH\n-8\n-9#include \n-10#include \n-11\n-12#include \n-13#include \n-14\n-15#include \n-16\n-17namespace Dune {\n-18\n+5#ifndef DUNE_IO_GNUPLOT_HH\n+6#define DUNE_IO_GNUPLOT_HH\n+7\n+13#include \n+14#include \n+15#include \n+16#include \n+17\n+18#include \n+19\n+20#include \n 21\n-22 namespace VTK {\n+22namespace Dune {\n 23\n-25\n-62 class PVTUWriter {\n-63 std::ostream& stream;\n-64\n-65 std::string fileType;\n-66\n-67 Indent indent;\n-68\n-69 public:\n-71\n-78 inline PVTUWriter(std::ostream& stream_, FileType fileType_)\n-79 : stream(stream_)\n-80 {\n-81 switch(fileType_) {\n-82 case polyData :\n-83 fileType = \"PPolyData\";\n-84 break;\n-85 case unstructuredGrid :\n-86 fileType = \"PUnstructuredGrid\";\n-87 break;\n-88 default :\n-89 DUNE_THROW(IOError, \"PVTUWriter: Unknown fileType: \" << fileType_);\n-90 }\n-91 const std::string& byteOrder = getEndiannessString();\n-92\n-93 stream << indent << \"\\n\";\n-94 stream << indent << \"\\n\";\n-98 ++indent;\n-99 }\n-100\n-102 inline ~PVTUWriter() {\n-103 --indent;\n-104 stream << indent << \"\\n\"\n-105 << std::flush;\n-106 }\n-107\n-109\n-120 inline void beginPointData(const std::string& scalars = \"\",\n-121 const std::string& vectors = \"\") {\n-122 stream << indent << \"\\n\";\n-126 ++indent;\n-127 }\n-129 inline void endPointData() {\n-130 --indent;\n-131 stream << indent << \"\\n\";\n-132 }\n-133\n-135\n-146 inline void beginCellData(const std::string& scalars = \"\",\n-147 const std::string& vectors = \"\") {\n-148 stream << indent << \"\\n\";\n-152 ++indent;\n-153 }\n-155 inline void endCellData() {\n-156 --indent;\n-157 stream << indent << \"\\n\";\n-158 }\n-159\n-161\n-166 inline void beginPoints() {\n-167 stream << indent << \"\\n\";\n-168 ++indent;\n-169 }\n-171 inline void endPoints() {\n-172 --indent;\n-173 stream << indent << \"\\n\";\n-174 }\n-175\n-177\n-189 inline void beginMain(unsigned ghostLevel = 0) {\n-190 stream << indent << \"<\" << fileType\n-191 << \" GhostLevel=\\\"\" << ghostLevel << \"\\\">\\n\";\n-192 ++indent;\n-193 }\n-195 inline void endMain() {\n-196 --indent;\n-197 stream << indent << \"\\n\";\n-198 }\n-199\n-201\n-207 void addArray(const std::string& name, unsigned ncomps, Precision prec) {\n-208 stream << indent << \"\\n\";\n-212 }\n-213\n-215 inline void addPiece(const std::string& filename) {\n-216 stream << indent << \"\\n\";\n-218 }\n-219 };\n-220\n-221 } // namespace VTK\n-222\n-224\n-225} // namespace Dune\n-226\n-227#endif // DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH\n-common.hh\n-Common stuff for the VTKWriter.\n+29 template\n+30 class GnuplotWriter {\n+31\n+32 typedef typename GridView::Grid::ctype ctype;\n+33\n+34 constexpr static int dimworld = GridView::dimensionworld;\n+35\n+36 public:\n+37 GnuplotWriter (const GridView & gv) : _is(gv.indexSet()), _gv(gv)\n+38 {\n+39 static_assert(dimworld==1 || dimworld==2, \"GnuPlot export only works for\n+worlddim==1 and worlddim==2\");\n+40 // allocate _data buffer\n+41 _data.resize(_is.size(0)*2);\n+42 }\n+43\n+48 template \n+49 void addCellData(const DataContainer& data, const std::string & name)\n+50 {\n+51 if (dimworld!=1)\n+52 DUNE_THROW(IOError, \"Gnuplot cell data writing is only supported for grids\n+in a 1d world!\");\n+53 addData(cellData, data, name);\n+54 }\n+55\n+60 template \n+61 void addVertexData(const DataContainer& data, const std::string & name)\n+62 {\n+63 addData(vertexData, data, name);\n+64 }\n+65\n+69 void write(const std::string& filename) const;\n+70\n+71 private:\n+72 enum DataType { vertexData, cellData };\n+73 const typename GridView::IndexSet & _is;\n+74 const GridView _gv;\n+75 std::vector< std::vector< float > > _data;\n+76 std::vector< std::string > _names;\n+77\n+78 template \n+79 void addData(DataType t, const DataContainer& data, const std::string &\n+name);\n+80\n+81 void writeRow(std::ostream & file,\n+82 const FieldVector& position,\n+83 const std::vector & data) const;\n+84 };\n+85\n+89 template\n+90 class LeafGnuplotWriter : public GnuplotWriter\n+91 {\n+92 public:\n+94 LeafGnuplotWriter (const G& grid)\n+95 : GnuplotWriter(grid.leafGridView())\n+96 {}\n+97 };\n+98\n+102 template\n+103 class LevelGnuplotWriter : public GnuplotWriter\n+104 {\n+105 public:\n+107 LevelGnuplotWriter (const G& grid, int level)\n+108 : GnuplotWriter(grid.levelGridView(level))\n+109 {}\n+110 };\n+111\n+112}\n+113\n+114#include \"gnuplot/gnuplot.cc\"\n+115\n+116#endif // DUNE_IO_GNUPLOT_HH\n+gnuplot.cc\n+Implementation of gnuplot output for 1D and 2D grids.\n+Dune::GridView::IndexSet\n+Traits::IndexSet IndexSet\n+type of the index set\n+Definition common/gridview.hh:86\n+Dune::leafGridView\n+Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid<\n+dim, dimworld, ct, GridFamily > &grid)\n+leaf grid view for the given grid\n+Definition common/grid.hh:805\n+Dune::levelGridView\n+Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid<\n+dim, dimworld, ct, GridFamily > &grid, int level)\n+level grid view for the given grid and level.\n+Definition common/grid.hh:788\n+Dune::GridView::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/gridview.hh:137\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::FileType\n-FileType\n-which type of VTK file to write\n-Definition common.hh:252\n-Dune::VTK::polyData\n-@ polyData\n-for .vtp files (PolyData)\n-Definition common.hh:254\n-Dune::VTK::unstructuredGrid\n-@ unstructuredGrid\n-for .vtu files (UnstructuredGrid)\n-Definition common.hh:256\n-Dune::VTK::toString\n-std::string toString(Precision p)\n-map precision to VTK type name\n-Definition common.hh:280\n-Dune::VTK::getEndiannessString\n-std::string getEndiannessString()\n-determine endianness of this C++ implementation\n-Definition common.hh:232\n-Dune::VTK::PVTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition pvtuwriter.hh:62\n-Dune::VTK::PVTUWriter::~PVTUWriter\n-~PVTUWriter()\n-write footer\n-Definition pvtuwriter.hh:102\n-Dune::VTK::PVTUWriter::endMain\n-void endMain()\n-finish the main PolyData/UnstructuredGrid section\n-Definition pvtuwriter.hh:195\n-Dune::VTK::PVTUWriter::endCellData\n-void endCellData()\n-finish CellData section\n-Definition pvtuwriter.hh:155\n-Dune::VTK::PVTUWriter::addArray\n-void addArray(const std::string &name, unsigned ncomps, Precision prec)\n-Add an array to the output file.\n-Definition pvtuwriter.hh:207\n-Dune::VTK::PVTUWriter::beginMain\n-void beginMain(unsigned ghostLevel=0)\n-start the main PPolyData/PUnstructuredGrid section\n-Definition pvtuwriter.hh:189\n-Dune::VTK::PVTUWriter::beginCellData\n-void beginCellData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start CellData section\n-Definition pvtuwriter.hh:146\n-Dune::VTK::PVTUWriter::beginPointData\n-void beginPointData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start PointData section\n-Definition pvtuwriter.hh:120\n-Dune::VTK::PVTUWriter::addPiece\n-void addPiece(const std::string &filename)\n-Add a serial piece to the output file.\n-Definition pvtuwriter.hh:215\n-Dune::VTK::PVTUWriter::PVTUWriter\n-PVTUWriter(std::ostream &stream_, FileType fileType_)\n-create a PVTUWriter object\n-Definition pvtuwriter.hh:78\n-Dune::VTK::PVTUWriter::endPointData\n-void endPointData()\n-finish PointData section\n-Definition pvtuwriter.hh:129\n-Dune::VTK::PVTUWriter::endPoints\n-void endPoints()\n-finish section for the point coordinates\n-Definition pvtuwriter.hh:171\n-Dune::VTK::PVTUWriter::beginPoints\n-void beginPoints()\n-start section for the point coordinates\n-Definition pvtuwriter.hh:166\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::GnuplotWriter\n+Writer for 1D grids in gnuplot format.\n+Definition gnuplot.hh:30\n+Dune::GnuplotWriter::addVertexData\n+void addVertexData(const DataContainer &data, const std::string &name)\n+Add vertex data.\n+Definition gnuplot.hh:61\n+Dune::GnuplotWriter::addCellData\n+void addCellData(const DataContainer &data, const std::string &name)\n+Add cell data.\n+Definition gnuplot.hh:49\n+Dune::GnuplotWriter::write\n+void write(const std::string &filename) const\n+Write Gnuplot file to disk.\n+Definition gnuplot.cc:19\n+Dune::GnuplotWriter::GnuplotWriter\n+GnuplotWriter(const GridView &gv)\n+Definition gnuplot.hh:37\n+Dune::LeafGnuplotWriter\n+GnuplotWriter on the leaf grid.\n+Definition gnuplot.hh:91\n+Dune::LeafGnuplotWriter::LeafGnuplotWriter\n+LeafGnuplotWriter(const G &grid)\n+Construct a Gnuplot writer for the leaf level of a given grid.\n+Definition gnuplot.hh:94\n+Dune::LevelGnuplotWriter\n+GnuplotWriter on a given level grid.\n+Definition gnuplot.hh:104\n+Dune::LevelGnuplotWriter::LevelGnuplotWriter\n+LevelGnuplotWriter(const G &grid, int level)\n+Construct a Gnuplot writer for a certain level of a given grid.\n+Definition gnuplot.hh:107\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00977.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00977.html", "unified_diff": "@@ -86,15 +86,15 @@\n More...

    \n
    #include <memory>
    \n #include <dune/common/classname.hh>
    \n #include <dune/common/parallel/communication.hh>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/common/parallel/mpihelper.hh>
    \n #include <dune-grid-config.hh>
    \n-#include <dune/grid/common/boundarysegment.hh>
    \n+#include <dune/grid/common/boundarysegment.hh>
    \n #include <dune/grid/common/capabilities.hh>
    \n #include <dune/grid/common/grid.hh>
    \n #include "uggrid/ugincludes.hh"
    \n #include "uggrid/ugwrapper.hh"
    \n #include "uggrid/ug_undefs.hh"
    \n #include "uggrid/uggridgeometry.hh"
    \n #include "uggrid/uggridlocalgeometry.hh"
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00977_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00977_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    14
    \n
    15#include <dune/common/classname.hh>
    \n
    16#include <dune/common/parallel/communication.hh>
    \n
    17#include <dune/common/exceptions.hh>
    \n
    18#include <dune/common/parallel/mpihelper.hh>
    \n
    19
    \n
    20#include <dune-grid-config.hh> // HAVE_DUNE_UGGRID
    \n-\n+\n \n \n
    24
    \n
    25#if HAVE_DUNE_UGGRID || DOXYGEN
    \n
    26
    \n
    27#ifdef ModelP
    \n
    28#include <dune/common/parallel/mpicommunication.hh>
    \n@@ -668,15 +668,15 @@\n
    820
    \n
    821 }
    \n
    822
    \n
    823} // namespace Dune
    \n
    824
    \n
    825#endif // HAVE_DUNE_UGGRID || DOXYGEN
    \n
    826#endif // DUNE_UGGRID_HH
    \n-
    Base class for grid boundary segments of arbitrary geometry.
    \n+
    Base class for grid boundary segments of arbitrary geometry.
    \n
    The specialization of the generic GridFactory for UGGrid.
    \n
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    @ ForwardCommunication
    communicate as given in InterfaceType
    Definition gridenums.hh:171
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Communication< No_Comm > UGCommunication
    Definition uggrid.hh:138
    \n
    Specialize with 'true' for all codims that a grid implements entities for. (default=false)
    Definition common/capabilities.hh:58
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00980.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00980.html", "unified_diff": "@@ -82,15 +82,15 @@\n \n

    The specialization of the generic GridFactory for UGGrid. \n More...

    \n
    #include <array>
    \n #include <memory>
    \n #include <vector>
    \n #include <dune/common/fvector.hh>
    \n-#include <dune/grid/common/boundarysegment.hh>
    \n+#include <dune/grid/common/boundarysegment.hh>
    \n #include <dune/grid/common/gridfactory.hh>
    \n #include <dune/grid/uggrid.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00980_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00980_source.html", "unified_diff": "@@ -91,15 +91,15 @@\n
    8
    \n
    14#include <array>
    \n
    15#include <memory>
    \n
    16#include <vector>
    \n
    17
    \n
    18#include <dune/common/fvector.hh>
    \n
    19
    \n-\n+\n \n
    22#include <dune/grid/uggrid.hh>
    \n
    23
    \n
    24namespace Dune {
    \n
    25
    \n
    26
    \n
    162 template <int dimworld>
    \n@@ -205,15 +205,15 @@\n
    303
    \n
    304 };
    \n \n
    305
    \n
    306}
    \n
    307
    \n
    308#endif
    \n-
    Base class for grid boundary segments of arbitrary geometry.
    \n+
    Base class for grid boundary segments of arbitrary geometry.
    \n
    The UGGrid class.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Base class for classes implementing geometries of boundary segments.
    Definition boundarysegment.hh:94
    \n
    GridFamily::Traits::LeafIntersection LeafIntersection
    A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
    Definition common/grid.hh:456
    \n
    typename GridFamily::Traits::Communication Communication
    A type that is a model of Dune::Communication. It provides a portable way for communication on the se...
    Definition common/grid.hh:515
    \n
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:70
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00983.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00983.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hostgridaccess.hh File Reference\n+dune-grid: persistentcontainerinterface.hh File Reference\n \n \n \n \n \n \n \n@@ -72,33 +72,24 @@\n
  • dune
  • grid
  • utility
  • \n \n \n
    \n \n-
    hostgridaccess.hh File Reference
    \n+
    persistentcontainerinterface.hh File Reference
    \n
    \n

    \n Classes

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

    \n Classes

    struct  Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
     
    struct  Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >::Codim< codim >
     A Traits struct that collects return types of class member methods. More...
     
    struct  Dune::HostGridAccess< IdentityGrid< HG > >
     
    struct  Dune::HostGridAccess< IdentityGrid< HG > >::Codim< codim >
     A Traits struct that collects return types of class member methods. More...
    class  Dune::PersistentContainerInterface< G, T >
     Persistent storage of data on all entities of a grid. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,31 +2,19 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-hostgridaccess.hh File Reference\n-#include \n-#include \n+persistentcontainerinterface.hh File Reference\n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>\n-\u00a0\n-struct \u00a0 Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n- Codim<_codim_>\n-\u00a0 A Traits struct that collects return types of class member methods.\n- More...\n-\u00a0\n-struct \u00a0 Dune::HostGridAccess<_IdentityGrid<_HG_>_>\n-\u00a0\n-struct \u00a0 Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Codim<_codim_>\n-\u00a0 A Traits struct that collects return types of class member methods.\n- More...\n+class \u00a0 Dune::PersistentContainerInterface<_G,_T_>\n+\u00a0 Persistent storage of data on all entities of a grid. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00983_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00983_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hostgridaccess.hh Source File\n+dune-grid: persistentcontainerinterface.hh Source File\n \n \n \n \n \n \n \n@@ -74,219 +74,124 @@\n \n
    \n \n
    \n \n
    \n-
    hostgridaccess.hh
    \n+
    persistentcontainerinterface.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_HOSTGRIDACCESS_HH
    \n-
    6#define DUNE_GRID_HOSTGRIDACCESS_HH
    \n+
    5#ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH
    \n+
    6#define DUNE_PERSISTENTCONTAINERINTERFACE_HH
    \n
    7
    \n-
    8#include <string>
    \n-
    9
    \n-\n+
    8#ifndef HEADERCHECK
    \n+
    9#error "This header exists for documentation purposes only and should never be included directly."
    \n+
    10#endif
    \n
    11
    \n
    12namespace Dune
    \n
    13{
    \n
    14
    \n-
    15 // External Forward Declarations
    \n-
    16 // -----------------------------
    \n-
    17
    \n-
    18 template< class HostGrid, class CoordFunction, class Allocator >
    \n-
    19 class GeometryGrid;
    \n-
    20
    \n-
    21 template< class >
    \n-
    22 class IdentityGrid;
    \n-
    23
    \n-
    24
    \n-
    25 // HostGridAccess
    \n-
    26 // --------------
    \n-
    27
    \n-
    28 template< class Grid >
    \n-
    29 struct HostGridAccess;
    \n-
    30
    \n-
    31
    \n-
    32
    \n-
    40 template< class HG, class CoordFunction, class Allocator >
    \n-
    \n-
    41 struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
    \n-
    42 {
    \n-\n-
    47
    \n-
    49 typedef typename Grid::HostGrid HostGrid;
    \n-
    50
    \n-
    57 template< int codim >
    \n-
    \n-
    58 struct Codim
    \n-
    59 {
    \n-\n+
    53 template< class G, class T >
    \n+
    \n+\n+
    55 {
    \n+\n+
    57
    \n+
    58 struct ImplementationDefined;
    \n+
    59
    \n+
    60 public:
    \n+
    61 typedef G Grid;
    \n
    62
    \n-
    64 typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
    \n-
    65 };
    \n-
    \n-
    66
    \n-
    68 typedef typename Grid::Traits::LeafIntersection LeafIntersection;
    \n-
    70 typedef typename Grid::Traits::LevelIntersection LevelIntersection;
    \n-
    71
    \n-
    73 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
    \n-
    75 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
    \n-
    76
    \n-
    \n-
    81 static const HostGrid &hostGrid ( const Grid &grid )
    \n-
    82 {
    \n-
    83 return grid.hostGrid();
    \n-
    84 }
    \n-
    \n-
    85
    \n-
    86 template< class Entity >
    \n-
    87 static const typename Codim< Entity::codimension >::HostEntity &
    \n-
    \n-
    88 hostEntity ( const Entity &entity )
    \n-
    89 {
    \n-
    90 return hostEntity< Entity::codimension >( entity );
    \n-
    91 }
    \n-
    \n-
    92
    \n-
    93 template< int codim >
    \n-
    94 static const typename Codim< codim >::HostEntity &
    \n-
    \n-
    95 hostEntity ( const typename Codim< codim >::Entity &entity )
    \n-
    96 {
    \n-
    97 return entity.impl().hostEntity();
    \n-
    98 }
    \n-
    \n-
    99
    \n-
    100 template< class HostIntersection >
    \n-
    101 static const HostIntersection &
    \n-
    \n-\n-
    103 {
    \n-
    104 return intersection.impl().hostIntersection();
    \n-
    105 }
    \n-
    \n-
    106 };
    \n-
    \n-
    107
    \n-
    108
    \n-
    116 template< class HG >
    \n-
    \n-\n-
    118 {
    \n-\n-
    123
    \n-
    125 typedef HG HostGrid;
    \n-
    126
    \n-
    133 template< int codim >
    \n-
    \n-
    134 struct Codim
    \n-
    135 {
    \n-\n-
    138
    \n-
    140 typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
    \n-
    141 };
    \n-
    \n+
    63 typedef T Value;
    \n+
    64
    \n+
    65 typedef ImplementationDefined Size;
    \n+
    66 typedef ImplementationDefined ConstIterator;
    \n+
    67 typedef ImplementationDefined Iterator;
    \n+
    68
    \n+
    69 // construction
    \n+
    70
    \n+
    79 PersistentContainerInterface ( Grid &grid, int codim, const Value &value = Value() );
    \n+
    80
    \n+\n+
    83
    \n+
    85 const This &operator= ( const This &other );
    \n+
    86
    \n+
    87 // element access
    \n+
    88
    \n+
    93 template< class Entity >
    \n+
    94 const Value &operator[] ( const Entity &entity ) const;
    \n+
    95
    \n+
    100 template< class Entity >
    \n+
    101 Value &operator[] ( const Entity &entity );
    \n+
    102
    \n+
    108 template< class Entity >
    \n+
    109 const Value &operator() ( const Entity &entity, int subEntity ) const;
    \n+
    110
    \n+
    116 template< class Entity >
    \n+
    117 Value &operator() ( const Entity &entity, int subEntity );
    \n+
    118
    \n+
    119 // capacity
    \n+
    120
    \n+
    126 Size size () const;
    \n+
    127
    \n+
    141 void resize ( const Value &value = Value() );
    \n
    142
    \n-\n-\n-
    147
    \n-
    149 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
    \n-
    151 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
    \n-
    152
    \n-
    \n-
    157 static const HostGrid &hostGrid ( const Grid &grid )
    \n-
    158 {
    \n-
    159 return grid.getHostGrid();
    \n-
    160 }
    \n-
    \n-
    161
    \n-
    162 template< class Entity >
    \n-
    163 static const typename Codim< Entity::codimension >::HostEntity &
    \n-
    \n-
    164 hostEntity ( const Entity &entity )
    \n-
    165 {
    \n-
    166 return hostEntity< Entity::codimension >( entity );
    \n-
    167 }
    \n-
    \n-
    168
    \n-
    169 template< int codim >
    \n-
    170 static const typename Codim< codim >::HostEntity &
    \n-
    \n-
    171 hostEntity ( const typename Codim< codim >::Entity &entity )
    \n-
    172 {
    \n-
    173 return *entity.impl().hostEntity_;
    \n-
    174 }
    \n-
    \n-
    175
    \n-
    176 static const HostLeafIntersection &
    \n-
    \n-
    177 hostIntersection ( const LeafIntersection &intersection )
    \n-
    178 {
    \n-
    179 return *intersection.impl().hostIterator_;
    \n-
    180 }
    \n-
    \n-
    181
    \n-
    182 static const HostLevelIntersection &
    \n-
    \n-
    183 hostIntersection ( const LevelIntersection &intersection )
    \n-
    184 {
    \n-
    185 return *intersection.impl().hostIterator_;
    \n-
    186 }
    \n-
    \n-
    187 };
    \n-
    \n-
    188
    \n-
    189} // namespace Dune
    \n-
    190
    \n-
    191#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
    \n+
    156 void shrinkToFit ();
    \n+
    157
    \n+
    158 // modifiers
    \n+
    159
    \n+
    165 void fill ( const Value &value );
    \n+
    166
    \n+
    171 void swap ( This &other );
    \n+
    172
    \n+
    173 // iterators
    \n+
    174
    \n+\n+\n+
    187
    \n+\n+\n+
    200
    \n+
    201 // information
    \n+
    202
    \n+
    204 int codimension () const;
    \n+
    205 };
    \n+
    \n+
    206
    \n+
    207} // namespace Dune
    \n+
    208
    \n+
    209#endif // #ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    GridFamily::Traits::LeafIntersection LeafIntersection
    A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
    Definition common/grid.hh:456
    \n-
    GridFamily::Traits::LevelIntersection LevelIntersection
    A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
    Definition common/grid.hh:461
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-
    grid wrapper replacing the geometries
    Definition geometrygrid/grid.hh:86
    \n-
    const HostGrid & hostGrid() const
    obtain constant reference to the host grid
    Definition geometrygrid/grid.hh:533
    \n-
    traits structure containing types for a codimension
    Definition geometrygrid/grid.hh:606
    \n-
    Definition geometrygrid/intersection.hh:22
    \n-
    Provides a meta grid that is identical to its host.
    Definition identitygrid.hh:93
    \n-
    HostGridType & getHostGrid() const
    Returns the hostgrid this IdentityGrid lives in.
    Definition identitygrid.hh:415
    \n-
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n-
    Grid::HostGrid HostGrid
    type of HostGrid
    Definition hostgridaccess.hh:49
    \n-
    HostGrid::Traits::LevelIntersection HostLevelIntersection
    type of the host level intersection
    Definition hostgridaccess.hh:75
    \n-
    static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity &entity)
    Definition hostgridaccess.hh:88
    \n-
    static const Codim< codim >::HostEntity & hostEntity(const typename Codim< codim >::Entity &entity)
    Definition hostgridaccess.hh:95
    \n-
    static const HostIntersection & hostIntersection(const Intersection< const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection)
    Definition hostgridaccess.hh:102
    \n-
    GeometryGrid< HG, CoordFunction, Allocator > Grid
    Definition hostgridaccess.hh:46
    \n-
    Grid::Traits::LeafIntersection LeafIntersection
    type of the GeometryGrid leaf intersection
    Definition hostgridaccess.hh:68
    \n-
    HostGrid::Traits::LeafIntersection HostLeafIntersection
    type of the host leaf intersection
    Definition hostgridaccess.hh:73
    \n-
    static const HostGrid & hostGrid(const Grid &grid)
    Get underlying HostGrid.
    Definition hostgridaccess.hh:81
    \n-
    Grid::Traits::LevelIntersection LevelIntersection
    type of the GeometryGrid level intersection
    Definition hostgridaccess.hh:70
    \n-
    HostGrid::template Codim< codim >::Entity HostEntity
    type of the host entity
    Definition hostgridaccess.hh:64
    \n-
    Grid::template Codim< codim >::Entity Entity
    type of the GeometryGrid entity
    Definition hostgridaccess.hh:61
    \n-
    Grid::Traits::LeafIntersection LeafIntersection
    type of the IdGrid leaf intersection
    Definition hostgridaccess.hh:144
    \n-
    HG HostGrid
    type of HostGrid
    Definition hostgridaccess.hh:125
    \n-
    IdentityGrid< HG > Grid
    Definition hostgridaccess.hh:122
    \n-
    static const Codim< codim >::HostEntity & hostEntity(const typename Codim< codim >::Entity &entity)
    Definition hostgridaccess.hh:171
    \n-
    HostGrid::Traits::LevelIntersection HostLevelIntersection
    type of the host level intersection
    Definition hostgridaccess.hh:151
    \n-
    Grid::Traits::LevelIntersection LevelIntersection
    type of the IdGrid level intersection
    Definition hostgridaccess.hh:146
    \n-
    static const HostLeafIntersection & hostIntersection(const LeafIntersection &intersection)
    Definition hostgridaccess.hh:177
    \n-
    HostGrid::Traits::LeafIntersection HostLeafIntersection
    type of the host leaf intersection
    Definition hostgridaccess.hh:149
    \n-
    static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity &entity)
    Definition hostgridaccess.hh:164
    \n-
    static const HostLevelIntersection & hostIntersection(const LevelIntersection &intersection)
    Definition hostgridaccess.hh:183
    \n-
    static const HostGrid & hostGrid(const Grid &grid)
    Get underlying HostGrid.
    Definition hostgridaccess.hh:157
    \n-
    Grid::template Codim< codim >::Entity Entity
    type of the IdGrid entity
    Definition hostgridaccess.hh:137
    \n-
    HostGrid::template Codim< codim >::Entity HostEntity
    type of the host entity
    Definition hostgridaccess.hh:140
    \n-\n+
    Persistent storage of data on all entities of a grid.
    Definition persistentcontainerinterface.hh:55
    \n+
    ImplementationDefined Size
    Definition persistentcontainerinterface.hh:65
    \n+
    PersistentContainerInterface(Grid &grid, int codim, const Value &value=Value())
    constructor
    \n+
    const Value & operator[](const Entity &entity) const
    access the data associated with an entity
    \n+
    T Value
    Definition persistentcontainerinterface.hh:63
    \n+
    Size size() const
    number of entries in the container
    \n+
    ImplementationDefined Iterator
    Definition persistentcontainerinterface.hh:67
    \n+
    PersistentContainerInterface(const This &other)
    copy constructor
    \n+
    ImplementationDefined ConstIterator
    Definition persistentcontainerinterface.hh:66
    \n+
    ConstIterator end() const
    returns an iterator pointing to the last element of the container
    \n+
    ConstIterator begin() const
    returns an iterator pointing to the first element of the container
    \n+
    Iterator begin()
    returns an iterator pointing to the first element of the container
    \n+
    Iterator end()
    returns an iterator pointing to the last element of the container
    \n+
    void shrinkToFit()
    remove unnecessary entries from container
    \n+
    int codimension() const
    return the codimension, the container attaches data to
    \n+
    G Grid
    Definition persistentcontainerinterface.hh:61
    \n+
    void swap(This &other)
    exchange the content of the container with another one
    \n+
    void resize(const Value &value=Value())
    reserve memory for all entities in the grid
    \n+
    void fill(const Value &value)
    set all accessible entries to a given value
    \n+
    const Value & operator()(const Entity &entity, int subEntity) const
    access the data associated with a subentity
    \n+
    const This & operator=(const This &other)
    assignment operator
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,303 +1,165 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-hostgridaccess.hh\n+persistentcontainerinterface.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_HOSTGRIDACCESS_HH\n-6#define DUNE_GRID_HOSTGRIDACCESS_HH\n+5#ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH\n+6#define DUNE_PERSISTENTCONTAINERINTERFACE_HH\n 7\n-8#include \n-9\n-10#include \n+8#ifndef HEADERCHECK\n+9#error \"This header exists for documentation purposes only and should never be\n+included directly.\"\n+10#endif\n 11\n 12namespace Dune\n 13{\n 14\n-15 // External Forward Declarations\n-16 // -----------------------------\n-17\n-18 template< class HostGrid, class CoordFunction, class Allocator >\n-19 class GeometryGrid;\n-20\n-21 template< class >\n-22 class IdentityGrid;\n-23\n-24\n-25 // HostGridAccess\n-26 // --------------\n-27\n-28 template< class Grid >\n-29 struct HostGridAccess;\n-30\n-31\n-32\n-40 template< class HG, class CoordFunction, class Allocator >\n-41 struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >\n-42 {\n-46 typedef GeometryGrid<_HG,_CoordFunction,_Allocator_> Grid;\n-47\n-49 typedef typename Grid::HostGrid HostGrid;\n-50\n-57 template< int codim >\n-58 struct Codim\n-59 {\n-61 typedef typename Grid::template Codim<_codim_>::Entity Entity;\n+53 template< class G, class T >\n+54 class PersistentContainerInterface\n+55 {\n+56 typedef PersistentContainerInterface<_G,_T_> This;\n+57\n+58 struct ImplementationDefined;\n+59\n+60 public:\n+61 typedef G Grid;\n 62\n-64 typedef typename HostGrid::template Codim<_codim_>::Entity HostEntity;\n-65 };\n-66\n-68 typedef typename Grid::Traits::LeafIntersection LeafIntersection;\n-70 typedef typename Grid::Traits::LevelIntersection LevelIntersection;\n-71\n-73 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;\n-75 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;\n-76\n-81 static const HostGrid &hostGrid ( const Grid &grid )\n-82 {\n-83 return grid.hostGrid();\n-84 }\n-85\n-86 template< class Entity >\n-87 static const typename Codim< Entity::codimension >::HostEntity &\n-88 hostEntity ( const Entity &entity )\n-89 {\n-90 return hostEntity< Entity::codimension >( entity );\n-91 }\n-92\n-93 template< int codim >\n-94 static const typename Codim< codim >::HostEntity &\n-95 hostEntity ( const typename Codim<_codim_>::Entity &entity )\n-96 {\n-97 return entity.impl().hostEntity();\n-98 }\n-99\n-100 template< class HostIntersection >\n-101 static const HostIntersection &\n-102 hostIntersection ( const Intersection< const Grid, GeoGrid::Intersection<\n-const_Grid,_HostIntersection_> > &intersection )\n-103 {\n-104 return intersection.impl().hostIntersection();\n-105 }\n-106 };\n-107\n-108\n-116 template< class HG >\n-117 struct HostGridAccess< IdentityGrid< HG > >\n-118 {\n-122 typedef IdentityGrid<_HG_> Grid;\n-123\n-125 typedef HG HostGrid;\n-126\n-133 template< int codim >\n-134 struct Codim\n-135 {\n-137 typedef typename Grid::template Codim<_codim_>::Entity Entity;\n-138\n-140 typedef typename HostGrid::template Codim<_codim_>::Entity HostEntity;\n-141 };\n+63 typedef T Value;\n+64\n+65 typedef ImplementationDefined Size;\n+66 typedef ImplementationDefined ConstIterator;\n+67 typedef ImplementationDefined Iterator;\n+68\n+69 // construction\n+70\n+79 PersistentContainerInterface ( Grid &grid, int codim, const Value &value =\n+Value() );\n+80\n+82 PersistentContainerInterface ( const This &other );\n+83\n+85 const This &operator=_( const This &other );\n+86\n+87 // element access\n+88\n+93 template< class Entity >\n+94 const Value &operator[]_( const Entity &entity ) const;\n+95\n+100 template< class Entity >\n+101 Value &operator[]_( const Entity &entity );\n+102\n+108 template< class Entity >\n+109 const Value &operator()_( const Entity &entity, int subEntity ) const;\n+110\n+116 template< class Entity >\n+117 Value &operator()_( const Entity &entity, int subEntity );\n+118\n+119 // capacity\n+120\n+126 Size size () const;\n+127\n+141 void resize ( const Value &value = Value() );\n 142\n-144 typedef typename Grid::Traits::LeafIntersection LeafIntersection;\n-146 typedef typename Grid::Traits::LevelIntersection LevelIntersection;\n-147\n-149 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;\n-151 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;\n-152\n-157 static const HostGrid &hostGrid ( const Grid &grid )\n-158 {\n-159 return grid.getHostGrid();\n-160 }\n-161\n-162 template< class Entity >\n-163 static const typename Codim< Entity::codimension >::HostEntity &\n-164 hostEntity ( const Entity &entity )\n-165 {\n-166 return hostEntity< Entity::codimension >( entity );\n-167 }\n-168\n-169 template< int codim >\n-170 static const typename Codim< codim >::HostEntity &\n-171 hostEntity ( const typename Codim<_codim_>::Entity &entity )\n-172 {\n-173 return *entity.impl().hostEntity_;\n-174 }\n-175\n-176 static const HostLeafIntersection &\n-177 hostIntersection ( const LeafIntersection &intersection )\n-178 {\n-179 return *intersection.impl().hostIterator_;\n-180 }\n-181\n-182 static const HostLevelIntersection &\n-183 hostIntersection ( const LevelIntersection &intersection )\n-184 {\n-185 return *intersection.impl().hostIterator_;\n-186 }\n-187 };\n-188\n-189} // namespace Dune\n-190\n-191#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH\n+156 void shrinkToFit ();\n+157\n+158 // modifiers\n+159\n+165 void fill ( const Value &value );\n+166\n+171 void swap ( This &other );\n+172\n+173 // iterators\n+174\n+180 ConstIterator begin () const;\n+186 Iterator begin ();\n+187\n+193 ConstIterator end () const;\n+199 Iterator end ();\n+200\n+201 // information\n+202\n+204 int codimension () const;\n+205 };\n+206\n+207} // namespace Dune\n+208\n+209#endif // #ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n Dune::Entity\n Wrapper class for entities.\n Definition common/entity.hh:66\n-Dune::Grid::LeafIntersection\n-GridFamily::Traits::LeafIntersection LeafIntersection\n-A type that is a model of Dune::Intersection, an intersections of two\n-codimension 1 of two codimensio...\n-Definition common/grid.hh:456\n-Dune::Grid::LevelIntersection\n-GridFamily::Traits::LevelIntersection LevelIntersection\n-A type that is a model of Dune::Intersection, an intersections of two\n-codimension 1 of two codimensio...\n-Definition common/grid.hh:461\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-Dune::GeometryGrid\n-grid wrapper replacing the geometries\n-Definition geometrygrid/grid.hh:86\n-Dune::GeometryGrid::hostGrid\n-const HostGrid & hostGrid() const\n-obtain constant reference to the host grid\n-Definition geometrygrid/grid.hh:533\n-Dune::GeometryGrid::Codim\n-traits structure containing types for a codimension\n-Definition geometrygrid/grid.hh:606\n-Dune::GeoGrid::Intersection\n-Definition geometrygrid/intersection.hh:22\n-Dune::IdentityGrid\n-Provides a meta grid that is identical to its host.\n-Definition identitygrid.hh:93\n-Dune::IdentityGrid::getHostGrid\n-HostGridType & getHostGrid() const\n-Returns the hostgrid this IdentityGrid lives in.\n-Definition identitygrid.hh:415\n-Dune::HostGridAccess\n-provides access to host grid objects from GeometryGrid\n-Definition identitygrid.hh:37\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::HostGrid\n-Grid::HostGrid HostGrid\n-type of HostGrid\n-Definition hostgridaccess.hh:49\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-HostLevelIntersection\n-HostGrid::Traits::LevelIntersection HostLevelIntersection\n-type of the host level intersection\n-Definition hostgridaccess.hh:75\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-hostEntity\n-static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity\n-&entity)\n-Definition hostgridaccess.hh:88\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-hostEntity\n-static const Codim< codim >::HostEntity & hostEntity(const typename Codim<\n-codim >::Entity &entity)\n-Definition hostgridaccess.hh:95\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-hostIntersection\n-static const HostIntersection & hostIntersection(const Intersection< const\n-Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection)\n-Definition hostgridaccess.hh:102\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::Grid\n-GeometryGrid< HG, CoordFunction, Allocator > Grid\n-Definition hostgridaccess.hh:46\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-LeafIntersection\n-Grid::Traits::LeafIntersection LeafIntersection\n-type of the GeometryGrid leaf intersection\n-Definition hostgridaccess.hh:68\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-HostLeafIntersection\n-HostGrid::Traits::LeafIntersection HostLeafIntersection\n-type of the host leaf intersection\n-Definition hostgridaccess.hh:73\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::hostGrid\n-static const HostGrid & hostGrid(const Grid &grid)\n-Get underlying HostGrid.\n-Definition hostgridaccess.hh:81\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n-LevelIntersection\n-Grid::Traits::LevelIntersection LevelIntersection\n-type of the GeometryGrid level intersection\n-Definition hostgridaccess.hh:70\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::Codim::\n-HostEntity\n-HostGrid::template Codim< codim >::Entity HostEntity\n-type of the host entity\n-Definition hostgridaccess.hh:64\n-Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::Codim::\n-Entity\n-Grid::template Codim< codim >::Entity Entity\n-type of the GeometryGrid entity\n-Definition hostgridaccess.hh:61\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::LeafIntersection\n-Grid::Traits::LeafIntersection LeafIntersection\n-type of the IdGrid leaf intersection\n-Definition hostgridaccess.hh:144\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::HostGrid\n-HG HostGrid\n-type of HostGrid\n-Definition hostgridaccess.hh:125\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Grid\n-IdentityGrid< HG > Grid\n-Definition hostgridaccess.hh:122\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostEntity\n-static const Codim< codim >::HostEntity & hostEntity(const typename Codim<\n-codim >::Entity &entity)\n-Definition hostgridaccess.hh:171\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::HostLevelIntersection\n-HostGrid::Traits::LevelIntersection HostLevelIntersection\n-type of the host level intersection\n-Definition hostgridaccess.hh:151\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::LevelIntersection\n-Grid::Traits::LevelIntersection LevelIntersection\n-type of the IdGrid level intersection\n-Definition hostgridaccess.hh:146\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostIntersection\n-static const HostLeafIntersection & hostIntersection(const LeafIntersection\n-&intersection)\n-Definition hostgridaccess.hh:177\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::HostLeafIntersection\n-HostGrid::Traits::LeafIntersection HostLeafIntersection\n-type of the host leaf intersection\n-Definition hostgridaccess.hh:149\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostEntity\n-static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity\n-&entity)\n-Definition hostgridaccess.hh:164\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostIntersection\n-static const HostLevelIntersection & hostIntersection(const LevelIntersection\n-&intersection)\n-Definition hostgridaccess.hh:183\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostGrid\n-static const HostGrid & hostGrid(const Grid &grid)\n-Get underlying HostGrid.\n-Definition hostgridaccess.hh:157\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Codim::Entity\n-Grid::template Codim< codim >::Entity Entity\n-type of the IdGrid entity\n-Definition hostgridaccess.hh:137\n-Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Codim::HostEntity\n-HostGrid::template Codim< codim >::Entity HostEntity\n-type of the host entity\n-Definition hostgridaccess.hh:140\n-intersection.hh\n+Dune::PersistentContainerInterface\n+Persistent storage of data on all entities of a grid.\n+Definition persistentcontainerinterface.hh:55\n+Dune::PersistentContainerInterface::Size\n+ImplementationDefined Size\n+Definition persistentcontainerinterface.hh:65\n+Dune::PersistentContainerInterface::PersistentContainerInterface\n+PersistentContainerInterface(Grid &grid, int codim, const Value &value=Value())\n+constructor\n+Dune::PersistentContainerInterface::operator[]\n+const Value & operator[](const Entity &entity) const\n+access the data associated with an entity\n+Dune::PersistentContainerInterface::Value\n+T Value\n+Definition persistentcontainerinterface.hh:63\n+Dune::PersistentContainerInterface::size\n+Size size() const\n+number of entries in the container\n+Dune::PersistentContainerInterface::Iterator\n+ImplementationDefined Iterator\n+Definition persistentcontainerinterface.hh:67\n+Dune::PersistentContainerInterface::PersistentContainerInterface\n+PersistentContainerInterface(const This &other)\n+copy constructor\n+Dune::PersistentContainerInterface::ConstIterator\n+ImplementationDefined ConstIterator\n+Definition persistentcontainerinterface.hh:66\n+Dune::PersistentContainerInterface::end\n+ConstIterator end() const\n+returns an iterator pointing to the last element of the container\n+Dune::PersistentContainerInterface::begin\n+ConstIterator begin() const\n+returns an iterator pointing to the first element of the container\n+Dune::PersistentContainerInterface::begin\n+Iterator begin()\n+returns an iterator pointing to the first element of the container\n+Dune::PersistentContainerInterface::end\n+Iterator end()\n+returns an iterator pointing to the last element of the container\n+Dune::PersistentContainerInterface::shrinkToFit\n+void shrinkToFit()\n+remove unnecessary entries from container\n+Dune::PersistentContainerInterface::codimension\n+int codimension() const\n+return the codimension, the container attaches data to\n+Dune::PersistentContainerInterface::Grid\n+G Grid\n+Definition persistentcontainerinterface.hh:61\n+Dune::PersistentContainerInterface::swap\n+void swap(This &other)\n+exchange the content of the container with another one\n+Dune::PersistentContainerInterface::resize\n+void resize(const Value &value=Value())\n+reserve memory for all entities in the grid\n+Dune::PersistentContainerInterface::fill\n+void fill(const Value &value)\n+set all accessible entries to a given value\n+Dune::PersistentContainerInterface::operator()\n+const Value & operator()(const Entity &entity, int subEntity) const\n+access the data associated with a subentity\n+Dune::PersistentContainerInterface::operator=\n+const This & operator=(const This &other)\n+assignment operator\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00986.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00986.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainervector.hh File Reference\n+dune-grid: gridinfo-gmsh-main.hh File Reference\n \n \n \n \n \n \n \n@@ -69,37 +69,51 @@\n \n
    \n \n
    \n \n
    \n- \n-
    persistentcontainervector.hh File Reference
    \n+
    gridinfo-gmsh-main.hh File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <cassert>
    \n+\n+

    Generic main() function for printing information about a mesh read from a .msh-file. \n+More...

    \n+
    #include <cstddef>
    \n+#include <cstdlib>
    \n+#include <exception>
    \n+#include <iostream>
    \n+#include <memory>
    \n+#include <ostream>
    \n+#include <sstream>
    \n+#include <stdexcept>
    \n+#include <string>
    \n+#include <vector>
    \n+#include <dune/common/classname.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/grid/io/file/gmshreader.hh>
    \n+#include <dune/grid/utility/gridinfo.hh>
    \n
    \n

    Go to the source code of this file.

    \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n-\n-

    \n-Classes

    class  Dune::PersistentContainerVector< G, IndexSet, Vector >
     vector-based implementation of the PersistentContainer More...
     
    \n-\n-\n-\n-\n-

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    Generic main() function for printing information about a mesh read from a .msh-file.

    \n+
    Author
    J\u00f6 Fahlke jorri.nosp@m.t@jo.nosp@m.rrit..nosp@m.de
    \n+
    Date
    2011
    \n+

    This header contains a generic main() function. To use it for your grid, write a .cc file like this:

    #include <string>
    \n+
    \n+
    #include <dune/grid/mygrid.hh>
    \n+
    \n+
    const std::string programName = "dune-gridinfo-gmsh-mygrid-3d";
    \n+
    typedef Dune::MyGrid<3> Grid;
    \n+
    \n+\n+
    Generic main() function for printing information about a mesh read from a .msh-file.
    \n+

    Write an automake target for your program as usual. No special libraries are needed for you program, beyond what is needed for the grid in question.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,22 +1,47 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-Classes | Namespaces\n-persistentcontainervector.hh File Reference\n-#include \n-#include \n+gridinfo-gmsh-main.hh File Reference\n+Generic main() function for printing information about a mesh read from a .msh-\n+file. 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 Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::PersistentContainerVector<_G,_IndexSet,_Vector_>\n-\u00a0 vector-based implementation of the PersistentContainer More...\n-\u00a0\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n+***** Detailed Description *****\n+Generic main() function for printing information about a mesh read from a .msh-\n+file.\n+ Author\n+ J\u00c3\u00b6 Fahlke jorri.nosp@m.t@jo.nosp@m.rrit..nosp@m.de\n+ Date\n+ 2011\n+This header contains a generic main() function. To use it for your grid, write\n+a .cc file like this:\n+#include \n+#include \n+const std::string programName = \"dune-gridinfo-gmsh-mygrid-3d\";\n+typedef Dune::MyGrid<3> Grid;\n+#include \n+gridinfo-gmsh-main.hh\n+Generic main() function for printing information about a mesh read from a .msh-\n+file.\n+Write an automake target for your program as usual. No special libraries are\n+needed for you program, beyond what is needed for the grid in question.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00986_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00986_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainervector.hh Source File\n+dune-grid: gridinfo-gmsh-main.hh Source File\n \n \n \n \n \n \n \n@@ -74,175 +74,223 @@\n \n
    \n \n
    \n \n
    \n-
    persistentcontainervector.hh
    \n+
    gridinfo-gmsh-main.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH
    \n-
    6#define DUNE_PERSISTENTCONTAINERVECTOR_HH
    \n-
    7
    \n-
    8#include <algorithm>
    \n-
    9#include <cassert>
    \n-
    10
    \n-
    11namespace Dune
    \n-
    12{
    \n-
    13
    \n-
    14 // PersistentContainerVector
    \n-
    15 // -------------------------
    \n-
    16
    \n-
    49 template< class G, class IndexSet, class Vector >
    \n-
    \n-\n-
    51 {
    \n-\n-
    53
    \n-
    54 public:
    \n-
    55 typedef G Grid;
    \n-
    56
    \n-
    57 typedef typename Vector::value_type Value;
    \n-
    58 typedef typename Vector::size_type Size;
    \n-
    59 typedef typename Vector::const_iterator ConstIterator;
    \n-
    60 typedef typename Vector::iterator Iterator;
    \n-
    61
    \n-
    62 typedef typename Vector::allocator_type Allocator;
    \n-
    63
    \n-
    \n-
    64 PersistentContainerVector ( const IndexSet &indexSet, int codim, const Value &value,
    \n-
    65 const Allocator &allocator = Allocator() )
    \n-
    66 : codim_( codim ),
    \n-\n-
    68 data_( indexSet.size( codim ), value, allocator )
    \n-
    69 {}
    \n-
    \n-
    70
    \n-
    71 template< class Entity >
    \n-
    \n-
    72 const Value &operator[] ( const Entity &entity ) const
    \n-
    73 {
    \n-
    74 assert( Entity::codimension == codimension() );
    \n-
    75 const Size index = indexSet().index( entity );
    \n-
    76 assert( index < data_.size() );
    \n-
    77 return data_[ index ];
    \n-
    78 }
    \n-
    \n-
    79
    \n-
    80 template< class Entity >
    \n-
    \n-
    81 Value &operator[] ( const Entity &entity )
    \n-
    82 {
    \n-
    83 assert( Entity::codimension == codimension() );
    \n-
    84 const Size index = indexSet().index( entity );
    \n-
    85 assert( index < data_.size() );
    \n-
    86 return data_[ index ];
    \n-
    87 }
    \n-
    \n-
    88
    \n-
    89 template< class Entity >
    \n-
    \n-
    90 const Value &operator() ( const Entity &entity, int subEntity ) const
    \n-
    91 {
    \n-
    92 const Size index = indexSet().subIndex( entity, subEntity, codimension() );
    \n-
    93 assert( index < data_.size() );
    \n-
    94 return data_[ index ];
    \n-
    95 }
    \n-
    \n-
    96
    \n-
    97 template< class Entity >
    \n-
    \n-
    98 Value &operator() ( const Entity &entity, int subEntity )
    \n-
    99 {
    \n-
    100 const Size index = indexSet().subIndex( entity, subEntity, codimension() );
    \n-
    101 assert( index < data_.size() );
    \n-
    102 return data_[ index ];
    \n-
    103 }
    \n-
    \n-
    104
    \n-
    105 Size size () const { return data_.size(); }
    \n-
    106
    \n-
    \n-
    107 void resize ( const Value &value = Value() )
    \n-
    108 {
    \n-
    109 const Size indexSetSize = indexSet().size( codimension() );
    \n-
    110 data_.resize( indexSetSize, value );
    \n-
    111 }
    \n-
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH
    \n+
    7#define DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH
    \n+
    8
    \n+
    9#include <cstddef>
    \n+
    10#include <cstdlib>
    \n+
    11#include <exception>
    \n+
    12#include <iostream>
    \n+
    13#include <memory>
    \n+
    14#include <ostream>
    \n+
    15#include <sstream>
    \n+
    16#include <stdexcept>
    \n+
    17#include <string>
    \n+
    18#include <vector>
    \n+
    19
    \n+
    20#include <dune/common/classname.hh>
    \n+
    21#include <dune/common/exceptions.hh>
    \n+
    22#include <dune/common/parallel/mpihelper.hh>
    \n+
    23
    \n+\n+\n+
    26
    \n+
    50#ifdef HEADERCHECK
    \n+
    51// define so headercheck will run
    \n+
    52const std::string programName = "headercheck";
    \n+
    53#endif // HEADERCHECK
    \n+
    54
    \n+
    55#ifndef DOXYGEN
    \n+
    56namespace {
    \n+
    57 // anonymous namespace so we don't freakishly conflict with another usage()
    \n+
    58 // function that may be linked in from another compilation unit.
    \n+
    59 void usage(std::ostream &stream) {
    \n+
    60 stream << "USAGE:\\n"
    \n+
    61 << " " << programName << " [-R REFINES] GRIDFILE\\n"
    \n+
    62 << "\\n"
    \n+
    63 << "PARAMETERS:\\n"
    \n+
    64 << " -R REFINES How many global refines to do after reading\\n"
    \n+
    65 << " (default: 0)\\n"
    \n+
    66 << " GRIDFILE Name of the .msh file to read the grid from.\\n"
    \n+
    67 << std::flush;
    \n+
    68 }
    \n+
    69
    \n+
    70 bool prefix_match(const std::string &prefix, const std::string &str)
    \n+
    71 {
    \n+
    72 return str.compare(0,prefix.size(), prefix) == 0;
    \n+
    73 }
    \n+
    74
    \n+
    75 void error_argument_required(const std::string &opt) {
    \n+
    76 std::cerr << "Error: option " << opt << " requires argument\\n";
    \n+
    77 usage(std::cerr);
    \n+
    78 std::exit(1);
    \n+
    79 }
    \n+
    80
    \n+
    81 void error_unknown_option(const std::string &opt) {
    \n+
    82 std::cerr << "Error: unknown option: " << opt << "\\n";
    \n+
    83 usage(std::cerr);
    \n+
    84 std::exit(1);
    \n+
    85 }
    \n+
    86
    \n+
    87 void error_parsing_optarg(const std::string &opt, const std::string &error) {
    \n+
    88 std::cerr << "Error: option " << opt << ": " << error << "\\n";
    \n+
    89 usage(std::cerr);
    \n+
    90 std::exit(1);
    \n+
    91 }
    \n+
    92
    \n+
    93 template<class T>
    \n+
    94 void parse(const std::string &arg, T &val) {
    \n+
    95 std::istringstream s(arg);
    \n+
    96 s >> val;
    \n+
    97 bool good = !s.fail();
    \n+
    98 if(good) {
    \n+
    99 char dummy;
    \n+
    100 s >> dummy;
    \n+
    101 good = s.fail() && s.eof();
    \n+
    102 }
    \n+
    103 if(!good) {
    \n+
    104 std::ostringstream s;
    \n+
    105 s << "Can't parse \\"" << arg << "\\" as a " << Dune::className(val);
    \n+
    106 throw std::runtime_error(s.str());
    \n+
    107 }
    \n+
    108 }
    \n+
    109
    \n+
    110 std::size_t refines = 0;
    \n+
    111 std::string gridFileName = "";
    \n
    112
    \n-
    113 void shrinkToFit () {}
    \n-
    114
    \n-
    115 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }
    \n-
    116
    \n-
    \n-
    117 void swap ( This &other )
    \n-
    118 {
    \n-
    119 std::swap( codim_, other.codim_ );
    \n-
    120 std::swap( indexSet_, other.indexSet_ );
    \n-
    121 std::swap( data_, other.data_ );
    \n-
    122 }
    \n-
    \n-
    123
    \n-
    124 ConstIterator begin () const { return data_.begin(); }
    \n-
    125 Iterator begin () { return data_.begin(); }
    \n-
    126
    \n-
    127 ConstIterator end () const { return data_.end(); }
    \n-
    128 Iterator end () { return data_.end(); }
    \n-
    129
    \n-
    130 int codimension () const { return codim_; }
    \n-
    131
    \n-
    132 protected:
    \n-
    133 const IndexSet &indexSet () const { return *indexSet_; }
    \n-
    134
    \n-\n-\n-
    137 Vector data_;
    \n-
    138 };
    \n-
    \n-
    139
    \n-
    140} // namespace Dune
    \n-
    141
    \n-
    142#endif // #ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH
    \n-
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n-
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n-
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n-
    auto size(GeometryType type) const
    Return total number of entities of given geometry type in entity set .
    Definition common/indexidset.hh:223
    \n-
    IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition common/indexidset.hh:153
    \n-
    IndexType index(const typename Traits::template Codim< cc >::Entity &e) const
    Map entity to index. The result of calling this method with an entity that is not in the index set is...
    Definition common/indexidset.hh:113
    \n-
    vector-based implementation of the PersistentContainer
    Definition persistentcontainervector.hh:51
    \n-
    PersistentContainerVector(const IndexSet &indexSet, int codim, const Value &value, const Allocator &allocator=Allocator())
    Definition persistentcontainervector.hh:64
    \n-
    Iterator begin()
    Definition persistentcontainervector.hh:125
    \n-
    Vector::size_type Size
    Definition persistentcontainervector.hh:58
    \n-
    Vector::value_type Value
    Definition persistentcontainervector.hh:57
    \n-
    Vector::allocator_type Allocator
    Definition persistentcontainervector.hh:62
    \n-
    void fill(const Value &value)
    Definition persistentcontainervector.hh:115
    \n-
    G Grid
    Definition persistentcontainervector.hh:55
    \n-
    const Value & operator()(const Entity &entity, int subEntity) const
    Definition persistentcontainervector.hh:90
    \n-
    const IndexSet * indexSet_
    Definition persistentcontainervector.hh:136
    \n-
    Vector::iterator Iterator
    Definition persistentcontainervector.hh:60
    \n-
    ConstIterator begin() const
    Definition persistentcontainervector.hh:124
    \n-
    ConstIterator end() const
    Definition persistentcontainervector.hh:127
    \n-
    int codim_
    Definition persistentcontainervector.hh:135
    \n-
    void shrinkToFit()
    Definition persistentcontainervector.hh:113
    \n-
    Vector::const_iterator ConstIterator
    Definition persistentcontainervector.hh:59
    \n-
    Vector data_
    Definition persistentcontainervector.hh:137
    \n-
    Iterator end()
    Definition persistentcontainervector.hh:128
    \n-
    const IndexSet & indexSet() const
    Definition persistentcontainervector.hh:133
    \n-
    int codimension() const
    Definition persistentcontainervector.hh:130
    \n-
    Size size() const
    Definition persistentcontainervector.hh:105
    \n-
    void swap(This &other)
    Definition persistentcontainervector.hh:117
    \n-
    const Value & operator[](const Entity &entity) const
    Definition persistentcontainervector.hh:72
    \n-
    void resize(const Value &value=Value())
    Definition persistentcontainervector.hh:107
    \n+
    113 void parseOptions(int argc, char **argv) {
    \n+
    114 std::vector<std::string> params;
    \n+
    115 for(++argv; *argv; ++argv) {
    \n+
    116 std::string arg = *argv;
    \n+
    117 if(prefix_match("-", arg)) {
    \n+
    118 std::string opt = arg;
    \n+
    119 if(opt == "--") {
    \n+
    120 for(++argv; *argv; ++argv)
    \n+
    121 params.push_back(*argv);
    \n+
    122 break;
    \n+
    123 }
    \n+
    124 else if(prefix_match("-h", opt) || prefix_match("-?", opt) ||
    \n+
    125 opt == "--help")
    \n+
    126 {
    \n+
    127 usage(std::cout);
    \n+
    128 std::exit(0);
    \n+
    129 }
    \n+
    130 else if(opt == "-R" || opt == "--global-refines") {
    \n+
    131 ++argv;
    \n+
    132 if(!*argv) error_argument_required(opt);
    \n+
    133 try { parse(*argv, refines); }
    \n+
    134 catch(const std::runtime_error &e)
    \n+
    135 { error_parsing_optarg(opt, e.what()); }
    \n+
    136 }
    \n+
    137 else if(prefix_match("-R", opt)) {
    \n+
    138 try { parse(*argv+std::strlen("-R"), refines); }
    \n+
    139 catch(const std::runtime_error &e)
    \n+
    140 { error_parsing_optarg(opt, e.what()); }
    \n+
    141 }
    \n+
    142 else if(prefix_match("--global-refines=", opt)) {
    \n+
    143 try { parse(*argv+std::strlen("--global-refines="), refines); }
    \n+
    144 catch(const std::runtime_error &e)
    \n+
    145 { error_parsing_optarg(opt, e.what()); }
    \n+
    146 }
    \n+
    147 else
    \n+
    148 error_unknown_option(opt);
    \n+
    149 }
    \n+
    150 else
    \n+
    151 params.push_back(arg);
    \n+
    152 }
    \n+
    153 // check command line arguments
    \n+
    154 if(params.size() < 1) {
    \n+
    155 std::cerr << "Need name of a .msh file to read.\\n"
    \n+
    156 << std::endl;
    \n+
    157 usage(std::cerr);
    \n+
    158 std::exit(1);
    \n+
    159 }
    \n+
    160 if(params.size() > 1) {
    \n+
    161 std::cerr << "Too many arguments.\\n"
    \n+
    162 << std::endl;
    \n+
    163 usage(std::cerr);
    \n+
    164 std::exit(1);
    \n+
    165 }
    \n+
    166 gridFileName = params[0];
    \n+
    167 }
    \n+
    168}
    \n+
    169
    \n+
    170#ifndef HEADERCHECK
    \n+
    171int main(int argc, char **argv) {
    \n+
    172 try {
    \n+
    173 const Dune::MPIHelper &mpiHelper = Dune::MPIHelper::instance(argc, argv);
    \n+
    174
    \n+
    175 // check that we are not run through mpirun
    \n+
    176 if(mpiHelper.size() > 1) {
    \n+
    177 if(mpiHelper.rank() == 0)
    \n+
    178 std::cerr << programName << ": Sorry, this program works only in "
    \n+
    179 << "serial." << std::endl;
    \n+
    180 return 1;
    \n+
    181 }
    \n+
    182
    \n+
    183 parseOptions(argc, argv);
    \n+
    184
    \n+
    185 // read grid
    \n+
    186 typedef Dune::GmshReader<Grid> Reader;
    \n+
    187 std::shared_ptr<Grid> gridp(Reader::read(gridFileName));
    \n+
    188 gridp->globalRefine(refines);
    \n+
    189
    \n+
    190 // collect information
    \n+\n+
    192 Dune::fillGridViewInfoSerial(gridp->leafGridView(), gridViewInfo);
    \n+
    193
    \n+
    194 // print it
    \n+
    195 std::cout << gridViewInfo << std::flush;
    \n+
    196 }
    \n+
    197 catch(const std::exception &e) {
    \n+
    198 std::cerr << "Caught exception of type " << Dune::className(e)
    \n+
    199 << std::endl
    \n+
    200 << "e.what(): " << e.what() << std::endl;
    \n+
    201 throw;
    \n+
    202 }
    \n+
    203 catch(const Dune::Exception &e) {
    \n+
    204 std::cerr << "Caught exception of type " << Dune::className(e)
    \n+
    205 << std::endl
    \n+
    206 << "Exception message: " << e << std::endl;
    \n+
    207 throw;
    \n+
    208 }
    \n+
    209 catch(const std::string &s) {
    \n+
    210 std::cerr << "Caught exception of type " << Dune::className(s)
    \n+
    211 << std::endl
    \n+
    212 << "Exception message: " << s << std::endl;
    \n+
    213 throw;
    \n+
    214 }
    \n+
    215 catch(...) {
    \n+
    216 std::cerr << "Caught exception of unknown type" << std::endl;
    \n+
    217 throw;
    \n+
    218 }
    \n+
    219}
    \n+
    220#endif // !HEADERCHECK
    \n+
    221#endif // !DOXYGEN
    \n+
    222
    \n+
    223#endif // DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH
    \n+
    int main(int argc, char **argv)
    Definition recipe-integration.cc:65
    \n+\n+
    void fillGridViewInfoSerial(const GV &gv, GridViewInfo< typename GV::ctype > &gridViewInfo)
    fill a GridViewInfo structure from a serial grid
    Definition utility/gridinfo.hh:214
    \n+
    Read Gmsh mesh file.
    Definition gmshreader.hh:840
    \n+
    structure to hold information about a certain GridView.
    Definition utility/gridinfo.hh:100
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,227 +1,229 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-persistentcontainervector.hh\n+gridinfo-gmsh-main.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH\n-6#define DUNE_PERSISTENTCONTAINERVECTOR_HH\n-7\n-8#include \n-9#include \n-10\n-11namespace Dune\n-12{\n-13\n-14 // PersistentContainerVector\n-15 // -------------------------\n-16\n-49 template< class G, class IndexSet, class Vector >\n-50 class PersistentContainerVector\n-51 {\n-52 typedef PersistentContainerVector<_G,_IndexSet,_Vector_> This;\n-53\n-54 public:\n-55 typedef G Grid;\n-56\n-57 typedef typename Vector::value_type Value;\n-58 typedef typename Vector::size_type Size;\n-59 typedef typename Vector::const_iterator ConstIterator;\n-60 typedef typename Vector::iterator Iterator;\n-61\n-62 typedef typename Vector::allocator_type Allocator;\n-63\n-64 PersistentContainerVector ( const IndexSet &indexSet, int codim, const Value\n-&value,\n-65 const Allocator &allocator = Allocator() )\n-66 : codim_( codim ),\n-67 indexSet_( &indexSet ),\n-68 data_( indexSet.size( codim ), value, allocator )\n-69 {}\n-70\n-71 template< class Entity >\n-72 const Value &operator[]_( const Entity &entity ) const\n-73 {\n-74 assert( Entity::codimension == codimension() );\n-75 const Size index = indexSet().index( entity );\n-76 assert( index < data_.size() );\n-77 return data_[ index ];\n-78 }\n-79\n-80 template< class Entity >\n-81 Value &operator[]_( const Entity &entity )\n-82 {\n-83 assert( Entity::codimension == codimension() );\n-84 const Size index = indexSet().index( entity );\n-85 assert( index < data_.size() );\n-86 return data_[ index ];\n-87 }\n-88\n-89 template< class Entity >\n-90 const Value &operator()_( const Entity &entity, int subEntity ) const\n-91 {\n-92 const Size index = indexSet().subIndex( entity, subEntity, codimension() );\n-93 assert( index < data_.size() );\n-94 return data_[ index ];\n-95 }\n-96\n-97 template< class Entity >\n-98 Value &operator()_( const Entity &entity, int subEntity )\n-99 {\n-100 const Size index = indexSet().subIndex( entity, subEntity, codimension() );\n-101 assert( index < data_.size() );\n-102 return data_[ index ];\n-103 }\n-104\n-105 Size size () const { return data_.size(); }\n-106\n-107 void resize ( const Value &value = Value() )\n-108 {\n-109 const Size indexSetSize = indexSet().size( codimension() );\n-110 data_.resize( indexSetSize, value );\n-111 }\n+5\n+6#ifndef DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH\n+7#define DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15#include \n+16#include \n+17#include \n+18#include \n+19\n+20#include \n+21#include \n+22#include \n+23\n+24#include \n+25#include \n+26\n+50#ifdef HEADERCHECK\n+51// define so headercheck will run\n+52const std::string programName = \"headercheck\";\n+53#endif // HEADERCHECK\n+54\n+55#ifndef DOXYGEN\n+56namespace {\n+57 // anonymous namespace so we don't freakishly conflict with another usage()\n+58 // function that may be linked in from another compilation unit.\n+59 void usage(std::ostream &stream) {\n+60 stream << \"USAGE:\\n\"\n+61 << \" \" << programName << \" [-R REFINES] GRIDFILE\\n\"\n+62 << \"\\n\"\n+63 << \"PARAMETERS:\\n\"\n+64 << \" -R REFINES How many global refines to do after reading\\n\"\n+65 << \" (default: 0)\\n\"\n+66 << \" GRIDFILE Name of the .msh file to read the grid from.\\n\"\n+67 << std::flush;\n+68 }\n+69\n+70 bool prefix_match(const std::string &prefix, const std::string &str)\n+71 {\n+72 return str.compare(0,prefix.size(), prefix) == 0;\n+73 }\n+74\n+75 void error_argument_required(const std::string &opt) {\n+76 std::cerr << \"Error: option \" << opt << \" requires argument\\n\";\n+77 usage(std::cerr);\n+78 std::exit(1);\n+79 }\n+80\n+81 void error_unknown_option(const std::string &opt) {\n+82 std::cerr << \"Error: unknown option: \" << opt << \"\\n\";\n+83 usage(std::cerr);\n+84 std::exit(1);\n+85 }\n+86\n+87 void error_parsing_optarg(const std::string &opt, const std::string &error)\n+{\n+88 std::cerr << \"Error: option \" << opt << \": \" << error << \"\\n\";\n+89 usage(std::cerr);\n+90 std::exit(1);\n+91 }\n+92\n+93 template\n+94 void parse(const std::string &arg, T &val) {\n+95 std::istringstream s(arg);\n+96 s >> val;\n+97 bool good = !s.fail();\n+98 if(good) {\n+99 char dummy;\n+100 s >> dummy;\n+101 good = s.fail() && s.eof();\n+102 }\n+103 if(!good) {\n+104 std::ostringstream s;\n+105 s << \"Can't parse \\\"\" << arg << \"\\\" as a \" << Dune::className(val);\n+106 throw std::runtime_error(s.str());\n+107 }\n+108 }\n+109\n+110 std::size_t refines = 0;\n+111 std::string gridFileName = \"\";\n 112\n-113 void shrinkToFit () {}\n-114\n-115 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }\n-116\n-117 void swap ( This &other )\n-118 {\n-119 std::swap( codim_, other.codim_ );\n-120 std::swap( indexSet_, other.indexSet_ );\n-121 std::swap( data_, other.data_ );\n-122 }\n-123\n-124 ConstIterator begin () const { return data_.begin(); }\n-125 Iterator begin () { return data_.begin(); }\n-126\n-127 ConstIterator end () const { return data_.end(); }\n-128 Iterator end () { return data_.end(); }\n-129\n-130 int codimension () const { return codim_; }\n-131\n-132 protected:\n-133 const IndexSet &indexSet () const { return *indexSet_; }\n-134\n-135 int codim_;\n-136 const IndexSet *indexSet_;\n-137 Vector data_;\n-138 };\n-139\n-140} // namespace Dune\n-141\n-142#endif // #ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH\n-std::swap\n-void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n-> &b)\n-Definition utility/persistentcontainer.hh:83\n-Dune\n-Include standard header files.\n-Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Entity::codimension\n-static constexpr int codimension\n-Know your own codimension.\n-Definition common/entity.hh:106\n-Dune::IndexSet\n-Index Set Interface base class.\n-Definition common/indexidset.hh:78\n-Dune::IndexSet::size\n-auto size(GeometryType type) const\n-Return total number of entities of given geometry type in entity set .\n-Definition common/indexidset.hh:223\n-Dune::IndexSet::subIndex\n-IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int\n-i, unsigned int codim) const\n-Map a subentity to an index.\n-Definition common/indexidset.hh:153\n-Dune::IndexSet::index\n-IndexType index(const typename Traits::template Codim< cc >::Entity &e) const\n-Map entity to index. The result of calling this method with an entity that is\n-not in the index set is...\n-Definition common/indexidset.hh:113\n-Dune::PersistentContainerVector\n-vector-based implementation of the PersistentContainer\n-Definition persistentcontainervector.hh:51\n-Dune::PersistentContainerVector::PersistentContainerVector\n-PersistentContainerVector(const IndexSet &indexSet, int codim, const Value\n-&value, const Allocator &allocator=Allocator())\n-Definition persistentcontainervector.hh:64\n-Dune::PersistentContainerVector::begin\n-Iterator begin()\n-Definition persistentcontainervector.hh:125\n-Dune::PersistentContainerVector::Size\n-Vector::size_type Size\n-Definition persistentcontainervector.hh:58\n-Dune::PersistentContainerVector::Value\n-Vector::value_type Value\n-Definition persistentcontainervector.hh:57\n-Dune::PersistentContainerVector::Allocator\n-Vector::allocator_type Allocator\n-Definition persistentcontainervector.hh:62\n-Dune::PersistentContainerVector::fill\n-void fill(const Value &value)\n-Definition persistentcontainervector.hh:115\n-Dune::PersistentContainerVector::Grid\n-G Grid\n-Definition persistentcontainervector.hh:55\n-Dune::PersistentContainerVector::operator()\n-const Value & operator()(const Entity &entity, int subEntity) const\n-Definition persistentcontainervector.hh:90\n-Dune::PersistentContainerVector::indexSet_\n-const IndexSet * indexSet_\n-Definition persistentcontainervector.hh:136\n-Dune::PersistentContainerVector::Iterator\n-Vector::iterator Iterator\n-Definition persistentcontainervector.hh:60\n-Dune::PersistentContainerVector::begin\n-ConstIterator begin() const\n-Definition persistentcontainervector.hh:124\n-Dune::PersistentContainerVector::end\n-ConstIterator end() const\n-Definition persistentcontainervector.hh:127\n-Dune::PersistentContainerVector::codim_\n-int codim_\n-Definition persistentcontainervector.hh:135\n-Dune::PersistentContainerVector::shrinkToFit\n-void shrinkToFit()\n-Definition persistentcontainervector.hh:113\n-Dune::PersistentContainerVector::ConstIterator\n-Vector::const_iterator ConstIterator\n-Definition persistentcontainervector.hh:59\n-Dune::PersistentContainerVector::data_\n-Vector data_\n-Definition persistentcontainervector.hh:137\n-Dune::PersistentContainerVector::end\n-Iterator end()\n-Definition persistentcontainervector.hh:128\n-Dune::PersistentContainerVector::indexSet\n-const IndexSet & indexSet() const\n-Definition persistentcontainervector.hh:133\n-Dune::PersistentContainerVector::codimension\n-int codimension() const\n-Definition persistentcontainervector.hh:130\n-Dune::PersistentContainerVector::size\n-Size size() const\n-Definition persistentcontainervector.hh:105\n-Dune::PersistentContainerVector::swap\n-void swap(This &other)\n-Definition persistentcontainervector.hh:117\n-Dune::PersistentContainerVector::operator[]\n-const Value & operator[](const Entity &entity) const\n-Definition persistentcontainervector.hh:72\n-Dune::PersistentContainerVector::resize\n-void resize(const Value &value=Value())\n-Definition persistentcontainervector.hh:107\n+113 void parseOptions(int argc, char **argv) {\n+114 std::vector params;\n+115 for(++argv; *argv; ++argv) {\n+116 std::string arg = *argv;\n+117 if(prefix_match(\"-\", arg)) {\n+118 std::string opt = arg;\n+119 if(opt == \"--\") {\n+120 for(++argv; *argv; ++argv)\n+121 params.push_back(*argv);\n+122 break;\n+123 }\n+124 else if(prefix_match(\"-h\", opt) || prefix_match(\"-?\", opt) ||\n+125 opt == \"--help\")\n+126 {\n+127 usage(std::cout);\n+128 std::exit(0);\n+129 }\n+130 else if(opt == \"-R\" || opt == \"--global-refines\") {\n+131 ++argv;\n+132 if(!*argv) error_argument_required(opt);\n+133 try { parse(*argv, refines); }\n+134 catch(const std::runtime_error &e)\n+135 { error_parsing_optarg(opt, e.what()); }\n+136 }\n+137 else if(prefix_match(\"-R\", opt)) {\n+138 try { parse(*argv+std::strlen(\"-R\"), refines); }\n+139 catch(const std::runtime_error &e)\n+140 { error_parsing_optarg(opt, e.what()); }\n+141 }\n+142 else if(prefix_match(\"--global-refines=\", opt)) {\n+143 try { parse(*argv+std::strlen(\"--global-refines=\"), refines); }\n+144 catch(const std::runtime_error &e)\n+145 { error_parsing_optarg(opt, e.what()); }\n+146 }\n+147 else\n+148 error_unknown_option(opt);\n+149 }\n+150 else\n+151 params.push_back(arg);\n+152 }\n+153 // check command line arguments\n+154 if(params.size() < 1) {\n+155 std::cerr << \"Need name of a .msh file to read.\\n\"\n+156 << std::endl;\n+157 usage(std::cerr);\n+158 std::exit(1);\n+159 }\n+160 if(params.size() > 1) {\n+161 std::cerr << \"Too many arguments.\\n\"\n+162 << std::endl;\n+163 usage(std::cerr);\n+164 std::exit(1);\n+165 }\n+166 gridFileName = params[0];\n+167 }\n+168}\n+169\n+170#ifndef HEADERCHECK\n+171int main(int argc, char **argv) {\n+172 try {\n+173 const Dune::MPIHelper &mpiHelper = Dune::MPIHelper::instance(argc, argv);\n+174\n+175 // check that we are not run through mpirun\n+176 if(mpiHelper.size() > 1) {\n+177 if(mpiHelper.rank() == 0)\n+178 std::cerr << programName << \": Sorry, this program works only in \"\n+179 << \"serial.\" << std::endl;\n+180 return 1;\n+181 }\n+182\n+183 parseOptions(argc, argv);\n+184\n+185 // read grid\n+186 typedef Dune::GmshReader Reader;\n+187 std::shared_ptr gridp(Reader::read(gridFileName));\n+188 gridp->globalRefine(refines);\n+189\n+190 // collect information\n+191 Dune::GridViewInfo gridViewInfo;\n+192 Dune::fillGridViewInfoSerial(gridp->leafGridView(), gridViewInfo);\n+193\n+194 // print it\n+195 std::cout << gridViewInfo << std::flush;\n+196 }\n+197 catch(const std::exception &e) {\n+198 std::cerr << \"Caught exception of type \" << Dune::className(e)\n+199 << std::endl\n+200 << \"e.what(): \" << e.what() << std::endl;\n+201 throw;\n+202 }\n+203 catch(const Dune::Exception &e) {\n+204 std::cerr << \"Caught exception of type \" << Dune::className(e)\n+205 << std::endl\n+206 << \"Exception message: \" << e << std::endl;\n+207 throw;\n+208 }\n+209 catch(const std::string &s) {\n+210 std::cerr << \"Caught exception of type \" << Dune::className(s)\n+211 << std::endl\n+212 << \"Exception message: \" << s << std::endl;\n+213 throw;\n+214 }\n+215 catch(...) {\n+216 std::cerr << \"Caught exception of unknown type\" << std::endl;\n+217 throw;\n+218 }\n+219}\n+220#endif // !HEADERCHECK\n+221#endif // !DOXYGEN\n+222\n+223#endif // DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH\n+main\n+int main(int argc, char **argv)\n+Definition recipe-integration.cc:65\n+gmshreader.hh\n+Dune::fillGridViewInfoSerial\n+void fillGridViewInfoSerial(const GV &gv, GridViewInfo< typename GV::ctype >\n+&gridViewInfo)\n+fill a GridViewInfo structure from a serial grid\n+Definition utility/gridinfo.hh:214\n+Dune::GmshReader\n+Read Gmsh mesh file.\n+Definition gmshreader.hh:840\n+Dune::GridViewInfo\n+structure to hold information about a certain GridView.\n+Definition utility/gridinfo.hh:100\n+gridinfo.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00989.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00989.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: tensorgridfactory.hh File Reference\n+dune-grid: persistentcontainerwrapper.hh File Reference\n \n \n \n \n \n \n \n@@ -72,50 +72,33 @@\n
  • dune
  • grid
  • utility
  • \n \n \n
    \n \n-
    tensorgridfactory.hh File Reference
    \n+
    persistentcontainerwrapper.hh File Reference
    \n
    \n
    \n-\n-

    This file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series. \n-More...

    \n-
    #include <array>
    \n-#include <memory>
    \n-#include <vector>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/grid/common/gridfactory.hh>
    \n-#include <dune/grid/yaspgrid.hh>
    \n-#include <dune/grid/utility/multiindex.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::TensorGridFactory< Grid >
     A factory class for conveniently creating tensorproduct grids. More...
     
    class  Dune::TensorGridFactoryCreator< Grid >
     
    class  Dune::TensorGridFactoryCreator< YaspGrid< dim, TensorProductCoordinates< ctype, dim > > >
    class  Dune::PersistentContainerWrapper< G, T >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-

    Detailed Description

    \n-

    This file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series.

    \n-

    The grid generation process is implemented for unstructured grids and for YaspGrid.

    \n-
    Author
    Dominic Kempf
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,46 +2,20 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-tensorgridfactory.hh File Reference\n-This file provides a factory class for tensorproduct grids. This is a\n-collection of methods to generate monotonous sequences as needed for a\n-tensorproduct grid. Apart from easy ones for locally equidistant grids, there\n-are also more involved methods like splitting a range according to a geometric\n-series. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+persistentcontainerwrapper.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::TensorGridFactory<_Grid_>\n-\u00a0 A factory class for conveniently creating tensorproduct grids. More...\n-\u00a0\n-class \u00a0 Dune::TensorGridFactoryCreator<_Grid_>\n-\u00a0\n-class \u00a0 Dune::TensorGridFactoryCreator<_YaspGrid<_dim,\n- TensorProductCoordinates<_ctype,_dim_>_>_>\n+class \u00a0 Dune::PersistentContainerWrapper<_G,_T_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-This file provides a factory class for tensorproduct grids. This is a\n-collection of methods to generate monotonous sequences as needed for a\n-tensorproduct grid. Apart from easy ones for locally equidistant grids, there\n-are also more involved methods like splitting a range according to a geometric\n-series.\n-The grid generation process is implemented for unstructured grids and for\n-YaspGrid.\n- Author\n- Dominic Kempf\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00989_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00989_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: tensorgridfactory.hh Source File\n+dune-grid: persistentcontainerwrapper.hh Source File\n \n \n \n \n \n \n \n@@ -74,403 +74,150 @@\n \n
    \n \n
    \n \n
    \n-
    tensorgridfactory.hh
    \n+
    persistentcontainerwrapper.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3#ifndef DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH
    \n-
    4#define DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH
    \n-
    5
    \n-
    20#include<array>
    \n-
    21#include<memory>
    \n-
    22#include<vector>
    \n+
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=4 sw=2 sts=2:
    \n+
    5#ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
    \n+
    6#define DUNE_PERSISTENTCONTAINERWRAPPER_HH
    \n+
    7
    \n+\n+\n+
    10
    \n+
    11namespace Dune
    \n+
    12{
    \n+
    13
    \n+
    14 // PersistentContainerWrapper
    \n+
    15 // --------------------------
    \n+
    16
    \n+
    17 template< class G, class T >
    \n+
    \n+\n+
    19 {
    \n+\n+
    21
    \n+\n
    23
    \n-
    24#include <dune/common/fvector.hh>
    \n-\n-
    26#include <dune/grid/yaspgrid.hh>
    \n-\n-
    28
    \n-
    29namespace Dune
    \n-
    30{
    \n-
    31 // forward declaration of TensorGridFactoryCreator, which is the real factory
    \n-
    32 // that should be specialized for each grid.
    \n-
    33 template<typename Grid>
    \n-
    34 class TensorGridFactoryCreator;
    \n+
    24 typedef typename HostGridAccess::HostGrid HostGrid;
    \n+\n+
    26
    \n+
    27 public:
    \n+
    28 typedef G Grid;
    \n+
    29
    \n+\n+\n+
    32
    \n+\n+\n
    35
    \n-
    40 template<typename Grid>
    \n-
    \n-\n-
    42 {
    \n-
    43 public:
    \n-
    44 typedef typename Grid::Traits::Communication Comm;
    \n-
    45 typedef typename Grid::ctype ctype;
    \n-
    46 static const int dim = Grid::dimension;
    \n-
    47
    \n-
    \n-
    48 std::unique_ptr<Grid> createGrid(Comm comm = Comm())
    \n-
    49 {
    \n-
    50 TensorGridFactoryCreator<Grid> creator(*this);
    \n-
    51 return creator.createGrid(comm);
    \n-
    52 }
    \n-
    \n-
    53
    \n-
    \n-
    54 std::array<std::vector<ctype> , dim> coords() const
    \n-
    55 {
    \n-
    56 return _coords;
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    \n-
    60 std::vector<ctype>& operator[](std::size_t d)
    \n-
    61 {
    \n-
    62 return _coords[d];
    \n-
    63 }
    \n-
    \n-
    64
    \n-
    \n-
    66 const std::vector<ctype>& operator[](std::size_t d) const
    \n-
    67 {
    \n-
    68 return _coords[d];
    \n-
    69 }
    \n-
    \n+
    \n+
    36 PersistentContainerWrapper ( const Grid &grid, int codim, const Value &value = Value() )
    \n+
    37 : hostContainer_( HostGridAccess::hostGrid( grid ), codim, value )
    \n+
    38 {}
    \n+
    \n+
    39
    \n+
    40 template< class Entity >
    \n+
    \n+
    41 const Value &operator[] ( const Entity &entity ) const
    \n+
    42 {
    \n+
    43 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
    \n+
    44 }
    \n+
    \n+
    45
    \n+
    46 template< class Entity >
    \n+
    \n+
    47 Value &operator[] ( const Entity &entity )
    \n+
    48 {
    \n+
    49 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
    \n+
    50 }
    \n+
    \n+
    51
    \n+
    52 template< class Entity >
    \n+
    \n+
    53 const Value &operator() ( const Entity &entity, int subEntity ) const
    \n+
    54 {
    \n+
    55 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
    \n+
    56 }
    \n+
    \n+
    57
    \n+
    58 template< class Entity >
    \n+
    \n+
    59 Value &operator() ( const Entity &entity, int subEntity )
    \n+
    60 {
    \n+
    61 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
    \n+
    62 }
    \n+
    \n+
    63
    \n+
    64 Size size () const { return hostContainer_.size(); }
    \n+
    65
    \n+
    66 void resize ( const Value &value = Value() ) { hostContainer_.resize( value ); }
    \n+\n+
    68
    \n+
    69 void fill ( const Value &value = Value() ) { hostContainer_.fill( value ); }
    \n
    70
    \n-
    \n-
    79 void setStart (int d, ctype value)
    \n-
    80 {
    \n-
    81 _coords[d].resize(1);
    \n-
    82 _coords[d][0] = value;
    \n-
    83 }
    \n+
    71 void swap ( This &other ) { hostContainer_.swap( other.hostContainer_ ); }
    \n+
    72
    \n+
    73 ConstIterator begin () const { return hostContainer_.begin(); }
    \n+\n+
    75
    \n+
    76 ConstIterator end () const { return hostContainer_.end(); }
    \n+
    77 Iterator end () { return hostContainer_.end(); }
    \n+
    78
    \n+
    79 int codimension () const { return hostContainer_.codimension(); }
    \n+
    80
    \n+
    81 protected:
    \n+\n+
    83 };
    \n
    \n
    84
    \n-
    \n-
    93 void fillIntervals (int d, int n, ctype h)
    \n-
    94 {
    \n-
    95 emptyCheck (d);
    \n-
    96 for (int i = 0; i < n; i++)
    \n-
    97 _coords[d].push_back (_coords[d].back () + h);
    \n-
    98 }
    \n-
    \n-
    99
    \n-
    \n-
    108 void fillRange (int d, int n, ctype end)
    \n-
    109 {
    \n-
    110 emptyCheck (d);
    \n-
    111 const ctype h = (end - _coords[d].back ()) / n;
    \n-
    112 for (int i = 0; i < n - 1; i++)
    \n-
    113 _coords[d].push_back (_coords[d].back () + h);
    \n-
    114 _coords[d].push_back (end);
    \n-
    115 }
    \n-
    \n-
    116
    \n-
    \n-
    125 void fillUntil (int d, ctype h, ctype end)
    \n-
    126 {
    \n-
    127 emptyCheck (d);
    \n-
    128 while (_coords[d].back () < end)
    \n-
    129 _coords[d].push_back (_coords[d].back () + h);
    \n-
    130 }
    \n-
    \n-
    131
    \n-
    \n-
    144 void geometricFillIntervals (int d, int n, ctype ratio, ctype h0 =
    \n-
    145 static_cast<ctype> (0))
    \n-
    146 {
    \n-
    147 emptyCheck (d);
    \n-
    148 ctype h = h0;
    \n-
    149 if (h0 == static_cast<ctype>(0))
    \n-
    150 h = lastInterval (d) * ratio;
    \n-
    151 for (int i = 0; i < n; i++)
    \n-
    152 {
    \n-
    153 _coords[d].push_back (_coords[d].back () + h);
    \n-
    154 h *= ratio;
    \n-
    155 }
    \n-
    156 }
    \n-
    \n-
    157
    \n-
    \n-
    170 void geometricFillUntil (int d, ctype ratio, ctype end, ctype h0 = static_cast<ctype> (0))
    \n-
    171 {
    \n-
    172 emptyCheck (d);
    \n-
    173 ctype h = h0;
    \n-
    174 if (h0 == static_cast<ctype>(0))
    \n-
    175 h = lastInterval (d) * ratio;
    \n-
    176 while (_coords[d].back () < end)
    \n-
    177 {
    \n-
    178 _coords[d].push_back (_coords[d].back () + h);
    \n-
    179 h *= ratio;
    \n-
    180 }
    \n-
    181 }
    \n-
    \n-
    182
    \n-
    \n-
    197 void geometricFillRange (int d, int n, ctype end, ctype h =
    \n-
    198 static_cast<ctype> (0),
    \n-
    199 bool first = true)
    \n-
    200 {
    \n-
    201 emptyCheck (d);
    \n-
    202 if (h < 1e-8)
    \n-
    203 h = lastInterval (d);
    \n-
    204 ctype ratio = newton (n, _coords[d].back (), end, h);
    \n-
    205 if (!first)
    \n-
    206 {
    \n-
    207 h = h * pow (ratio, n - 1);
    \n-
    208 ratio = 1 / ratio;
    \n-
    209 }
    \n-
    210 for (int i = 0; i < n - 1; i++)
    \n-
    211 {
    \n-
    212 _coords[d].push_back (_coords[d].back () + h);
    \n-
    213 h *= ratio;
    \n-
    214 }
    \n-
    215 _coords[d].push_back (end);
    \n-
    216 }
    \n-
    \n-
    217
    \n-
    \n-
    219 void print()
    \n-
    220 {
    \n-
    221 for (int i=0; i<dim; i++)
    \n-
    222 {
    \n-
    223 std::cout << "Container in direction " << i << ":" << std::endl << "Coordinates: ";
    \n-
    224 for (auto it = _coords[i].begin(); it != _coords[i].end(); ++it)
    \n-
    225 std::cout << *it << " ";
    \n-
    226 std::cout << std::endl << "Interval lengths: ";
    \n-
    227
    \n-
    228 std::vector<ctype> meshsize;
    \n-
    229 for (auto it = _coords[i].begin(); it != _coords[i].end()-1;)
    \n-
    230 {
    \n-
    231 meshsize.push_back(-1.*(*it));
    \n-
    232 ++it;
    \n-
    233 meshsize.back() += *it;
    \n-
    234 }
    \n-
    235
    \n-
    236 for (auto it = meshsize.begin(); it != meshsize.end(); ++it)
    \n-
    237 std::cout << *it << " ";
    \n-
    238 std::cout << std::endl << "Ratios between interval lengths: ";
    \n-
    239
    \n-
    240 std::vector<ctype> ratios;
    \n-
    241 for (auto it = meshsize.begin(); it != meshsize.end() - 1 ;)
    \n-
    242 ratios.push_back((1./(*it)) * *(++it));
    \n-
    243
    \n-
    244 for (auto it = ratios.begin(); it != ratios.end(); ++it)
    \n-
    245 std::cout << *it << " ";
    \n-
    246 std::cout << std::endl << std::endl << std::endl;
    \n-
    247 }
    \n-
    248 }
    \n-
    \n-
    249
    \n-
    250 private:
    \n-
    251 // check whether the ith component is empty and add a 0.0 entry if so
    \n-
    252 void emptyCheck (int i)
    \n-
    253 {
    \n-
    254 if (_coords[i].empty ())
    \n-
    255 _coords[i].push_back (static_cast<ctype> (0));
    \n-
    256 }
    \n-
    257
    \n-
    258 // returns the last interval length in direction d
    \n-
    259 ctype lastInterval (int d)
    \n-
    260 {
    \n-
    261 if (_coords[d].size () < 2)
    \n-
    262 DUNE_THROW(
    \n-
    263 GridError,
    \n-
    264 "Not enough elements in coordinate container to deduce interval length in TensorYaspFactory");
    \n-
    265 else
    \n-
    266 return _coords[d].back () - _coords[d][_coords[d].size () - 2];
    \n-
    267 }
    \n-
    268
    \n-
    272 ctype newton (int n, ctype x_s, ctype x_e, ctype h)
    \n-
    273 {
    \n-
    274 ctype m = (x_e - x_s) / h;
    \n-
    275 ctype xold = 0.0;
    \n-
    276 ctype xnew = x_e - x_s;
    \n-
    277 while (std::abs (xnew - xold) > 1E-8)
    \n-
    278 {
    \n-
    279 xold = xnew;
    \n-
    280 xnew = xold
    \n-
    281 - (-pow (xold, n) + m * xold - m + 1)
    \n-
    282 / (-n * pow (xold, n - 1) + m);
    \n-
    283 }
    \n-
    284 if (std::abs (xnew - 1) < 1E-6)
    \n-
    285 {
    \n-
    286 xold = x_e - x_s;
    \n-
    287 xnew = 0.0;
    \n-
    288 while (std::abs (xnew - xold) > 1E-8)
    \n-
    289 {
    \n-
    290 xold = xnew;
    \n-
    291 xnew = xold
    \n-
    292 - (-pow (xold, n) + m * xold - m + 1)
    \n-
    293 / (-n * pow (xold, n - 1) + m);
    \n-
    294 }
    \n-
    295 }
    \n-
    296 return xnew;
    \n-
    297 }
    \n-
    298
    \n-
    299 std::array<std::vector<ctype>, dim> _coords;
    \n-
    300 };
    \n-
    \n-
    301
    \n-
    302 // class that implements the actual grid creation process. The default is implementing
    \n-
    303 // standard creation for unstructured grids. Provide a specialization for other grids.
    \n-
    304 template<typename Grid>
    \n-
    \n-\n-
    306 {
    \n-
    307 public:
    \n-
    308 typedef typename Grid::Traits::Communication Comm;
    \n-
    309 typedef typename Grid::ctype ctype;
    \n-
    310 static const int dim = Grid::dimension;
    \n-
    311
    \n-
    312 TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
    \n-
    313
    \n-
    \n-
    314 std::unique_ptr<Grid> createGrid(Comm comm)
    \n-
    315 {
    \n-
    316 // The grid factory
    \n-\n-
    318
    \n-
    319 if (comm.rank() == 0)
    \n-
    320 {
    \n-
    321 // determine the size of the grid
    \n-
    322 std::array<unsigned int, dim> vsizes, esizes;
    \n-
    323 std::size_t size = 1;
    \n-
    324 for (std::size_t i = 0; i<dim; ++i)
    \n-
    325 {
    \n-
    326 vsizes[i] = _factory[i].size();
    \n-
    327 esizes[i] = vsizes[i] - 1;
    \n-
    328 size *= vsizes[i];
    \n-
    329 }
    \n-
    330
    \n-
    331 // insert all vertices
    \n-\n-
    333 for (std::size_t i=0; i<size; ++i, ++index)
    \n-
    334 {
    \n-
    335 Dune::FieldVector<ctype, dim> position;
    \n-
    336 for (std::size_t j = 0; j<dim; ++j)
    \n-
    337 position[j] = _factory[j][index[j]];
    \n-
    338 fac.insertVertex(position);
    \n-
    339 }
    \n-
    340
    \n-
    341 // compute the offsets
    \n-
    342 std::array<std::size_t, dim> offsets;
    \n-
    343 offsets[0] = 1;
    \n-
    344 for (std::size_t i=1; i<dim; i++)
    \n-
    345 offsets[i] = offsets[i-1] * vsizes[i-1];
    \n-
    346
    \n-
    347 // Compute an element template (the cube at (0,...,0). All
    \n-
    348 // other cubes are constructed by moving this template around
    \n-
    349 unsigned int nCorners = 1<<dim;
    \n-
    350
    \n-
    351 std::vector<unsigned int> cornersTemplate(nCorners,0);
    \n-
    352
    \n-
    353 for (size_t i=0; i<nCorners; i++)
    \n-
    354 for (int j=0; j<dim; j++)
    \n-
    355 if ( i & (1<<j) )
    \n-
    356 cornersTemplate[i] += offsets[j];
    \n-
    357
    \n-
    358 // Insert elements
    \n-\n-
    360
    \n-
    361 // Compute the total number of elements to be created
    \n-
    362 int numElements = eindex.cycle();
    \n-
    363
    \n-
    364 for (int i=0; i<numElements; i++, ++eindex)
    \n-
    365 {
    \n-
    366 // 'base' is the index of the lower left element corner
    \n-
    367 unsigned int base = 0;
    \n-
    368 for (int j=0; j<dim; j++)
    \n-
    369 base += eindex[j] * offsets[j];
    \n-
    370
    \n-
    371 // insert new element
    \n-
    372 std::vector<unsigned int> corners = cornersTemplate;
    \n-
    373 for (size_t j=0; j<corners.size(); j++)
    \n-
    374 corners[j] += base;
    \n-
    375
    \n-
    376 fac.insertElement(GeometryTypes::cube(dim), corners);
    \n-
    377 }
    \n-
    378 }
    \n-
    379
    \n-
    380 return std::unique_ptr<Grid>(fac.createGrid());
    \n-
    381 }
    \n-
    \n-
    382
    \n-
    383 private:
    \n-
    384 const TensorGridFactory<Grid>& _factory;
    \n-
    385 };
    \n-
    \n-
    386
    \n-
    387 template<typename ctype, int dim>
    \n-
    \n-\n-
    389 {
    \n-
    390 public:
    \n-\n-
    392 typedef typename Grid::Communication Comm;
    \n-
    393
    \n-
    394 TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
    \n-
    395
    \n-
    \n-
    396 std::unique_ptr<Grid> createGrid(Comm comm)
    \n-
    397 {
    \n-
    398 return std::make_unique<Grid>(_factory.coords(), std::bitset<dim>(0ULL), 1, comm);
    \n-
    399 }
    \n-
    \n-
    400 private:
    \n-
    401 const TensorGridFactory<Grid>& _factory;
    \n-
    402 };
    \n-
    \n-
    403}
    \n-
    404
    \n-
    405#endif
    \n-
    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various facto...
    \n-\n+
    85} // namespace Dune
    \n+
    86
    \n+
    87#endif // #ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    ct ctype
    Define type used for coordinates in grid module.
    Definition common/grid.hh:518
    \n-
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n-
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
    Insert an element into the coarse grid.
    Definition common/gridfactory.hh:307
    \n-
    virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
    Insert a vertex into the coarse grid.
    Definition common/gridfactory.hh:296
    \n-
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n-
    Definition multiindex.hh:19
    \n-
    size_t cycle() const
    Compute how many times you can call operator++ before getting to (0,...,0) again.
    Definition multiindex.hh:48
    \n-
    Definition tensorgridfactory.hh:306
    \n-
    Grid::ctype ctype
    Definition tensorgridfactory.hh:309
    \n-
    Grid::Traits::Communication Comm
    Definition tensorgridfactory.hh:308
    \n-
    TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)
    Definition tensorgridfactory.hh:312
    \n-
    std::unique_ptr< Grid > createGrid(Comm comm)
    Definition tensorgridfactory.hh:314
    \n-
    static const int dim
    Definition tensorgridfactory.hh:310
    \n-
    A factory class for conveniently creating tensorproduct grids.
    Definition tensorgridfactory.hh:42
    \n-
    void fillRange(int d, int n, ctype end)
    fills the range to end with n intervals in direction d
    Definition tensorgridfactory.hh:108
    \n-
    void geometricFillRange(int d, int n, ctype end, ctype h=static_cast< ctype >(0), bool first=true)
    fills a coordinate range in direction d with n intervals according to a geometric series
    Definition tensorgridfactory.hh:197
    \n-
    Grid::ctype ctype
    Definition tensorgridfactory.hh:45
    \n-
    void fillUntil(int d, ctype h, ctype end)
    adds intervals in direction d until a given coordinate is reached
    Definition tensorgridfactory.hh:125
    \n-
    void geometricFillUntil(int d, ctype ratio, ctype end, ctype h0=static_cast< ctype >(0))
    adds intervals in direction d according with a given length ratio until a given coordinate is reached
    Definition tensorgridfactory.hh:170
    \n-
    static const int dim
    Definition tensorgridfactory.hh:46
    \n-
    void print()
    print the coordinate information given to the factory so far
    Definition tensorgridfactory.hh:219
    \n-
    void fillIntervals(int d, int n, ctype h)
    pushs n intervals of length h in direction d
    Definition tensorgridfactory.hh:93
    \n-
    void setStart(int d, ctype value)
    set a starting value in a given direction d
    Definition tensorgridfactory.hh:79
    \n-
    void geometricFillIntervals(int d, int n, ctype ratio, ctype h0=static_cast< ctype >(0))
    adds n intervals in direction d with a given length ratio and a given starting interval length.
    Definition tensorgridfactory.hh:144
    \n-
    std::vector< ctype > & operator[](std::size_t d)
    allow to manually tune the factory by overloading operator[] to export the coordinate vectors in the ...
    Definition tensorgridfactory.hh:60
    \n-
    const std::vector< ctype > & operator[](std::size_t d) const
    allow to manually tune the factory by overloading operator[] to export the coordinate vectors in the ...
    Definition tensorgridfactory.hh:66
    \n-
    std::unique_ptr< Grid > createGrid(Comm comm=Comm())
    Definition tensorgridfactory.hh:48
    \n-
    Grid::Traits::Communication Comm
    Definition tensorgridfactory.hh:44
    \n-
    std::array< std::vector< ctype >, dim > coords() const
    Definition tensorgridfactory.hh:54
    \n-
    std::unique_ptr< Grid > createGrid(Comm comm)
    Definition tensorgridfactory.hh:396
    \n-
    TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)
    Definition tensorgridfactory.hh:394
    \n-\n-
    YaspGrid< dim, TensorProductCoordinates< ctype, dim > > Grid
    Definition tensorgridfactory.hh:391
    \n-
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n-
    typename Base::Communication Communication
    Definition yaspgrid.hh:181
    \n-
    Coordinate container for a tensor product YaspGrid.
    Definition coordinates.hh:245
    \n-
    Provide a generic factory class for unstructured grids.
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n+\n+
    void swap(This &other)
    Definition persistentcontainermap.hh:97
    \n+
    void fill(const Value &value)
    Definition persistentcontainermap.hh:95
    \n+
    int codimension() const
    Definition persistentcontainermap.hh:111
    \n+
    void resize(const Value &value=Value())
    Definition persistentcontainermap.hh:87
    \n+
    ConstIterator begin() const
    Definition persistentcontainermap.hh:175
    \n+
    ConstIterator end() const
    Definition persistentcontainermap.hh:190
    \n+
    Size size() const
    Definition persistentcontainermap.hh:85
    \n+
    void shrinkToFit()
    Definition persistentcontainermap.hh:93
    \n+
    Definition persistentcontainerwrapper.hh:19
    \n+
    void fill(const Value &value=Value())
    Definition persistentcontainerwrapper.hh:69
    \n+
    PersistentContainer< HostGrid, T >::ConstIterator ConstIterator
    Definition persistentcontainerwrapper.hh:34
    \n+
    Size size() const
    Definition persistentcontainerwrapper.hh:64
    \n+
    ConstIterator begin() const
    Definition persistentcontainerwrapper.hh:73
    \n+
    const Value & operator()(const Entity &entity, int subEntity) const
    Definition persistentcontainerwrapper.hh:53
    \n+
    G Grid
    Definition persistentcontainerwrapper.hh:28
    \n+
    const Value & operator[](const Entity &entity) const
    Definition persistentcontainerwrapper.hh:41
    \n+
    void resize(const Value &value=Value())
    Definition persistentcontainerwrapper.hh:66
    \n+
    PersistentContainer< HostGrid, T >::Size Size
    Definition persistentcontainerwrapper.hh:31
    \n+
    int codimension() const
    Definition persistentcontainerwrapper.hh:79
    \n+
    PersistentContainer< HostGrid, T >::Value Value
    Definition persistentcontainerwrapper.hh:30
    \n+
    void swap(This &other)
    Definition persistentcontainerwrapper.hh:71
    \n+
    ConstIterator end() const
    Definition persistentcontainerwrapper.hh:76
    \n+
    PersistentContainerWrapper(const Grid &grid, int codim, const Value &value=Value())
    Definition persistentcontainerwrapper.hh:36
    \n+
    PersistentContainer< HostGrid, T >::Iterator Iterator
    Definition persistentcontainerwrapper.hh:33
    \n+
    void shrinkToFit()
    Definition persistentcontainerwrapper.hh:67
    \n+
    Iterator begin()
    Definition persistentcontainerwrapper.hh:74
    \n+
    PersistentContainer< HostGrid, T > hostContainer_
    Definition persistentcontainerwrapper.hh:82
    \n+
    Iterator end()
    Definition persistentcontainerwrapper.hh:77
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,481 +1,198 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-tensorgridfactory.hh\n+persistentcontainerwrapper.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3#ifndef DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH\n-4#define DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH\n-5\n-20#include\n-21#include\n-22#include\n+3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=4 sw=2 sts=2:\n+5#ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH\n+6#define DUNE_PERSISTENTCONTAINERWRAPPER_HH\n+7\n+8#include \n+9#include \n+10\n+11namespace Dune\n+12{\n+13\n+14 // PersistentContainerWrapper\n+15 // --------------------------\n+16\n+17 template< class G, class T >\n+18 class PersistentContainerWrapper\n+19 {\n+20 typedef PersistentContainerWrapper<_G,_T_> This;\n+21\n+22 typedef Dune::HostGridAccess<_G_> HostGridAccess;\n 23\n-24#include \n-25#include \n-26#include \n-27#include\n-28\n-29namespace Dune\n-30{\n-31 // forward declaration of TensorGridFactoryCreator, which is the real\n-factory\n-32 // that should be specialized for each grid.\n-33 template\n-34 class TensorGridFactoryCreator;\n+24 typedef typename HostGridAccess::HostGrid HostGrid;\n+25 typedef PersistentContainer<_HostGrid,_T_> PersistentContainerHostGrid;\n+26\n+27 public:\n+28 typedef G Grid;\n+29\n+30 typedef typename PersistentContainer<_HostGrid,_T_>::Value Value;\n+31 typedef typename PersistentContainer<_HostGrid,_T_>::Size Size;\n+32\n+33 typedef typename PersistentContainer<_HostGrid,_T_>::Iterator Iterator;\n+34 typedef typename PersistentContainer<_HostGrid,_T_>::ConstIterator\n+ConstIterator;\n 35\n-40 template\n-41 class TensorGridFactory\n+36 PersistentContainerWrapper ( const Grid &grid, int codim, const Value &value\n+= Value() )\n+37 : hostContainer_( HostGridAccess::hostGrid( grid ), codim, value )\n+38 {}\n+39\n+40 template< class Entity >\n+41 const Value &operator[]_( const Entity &entity ) const\n 42 {\n-43 public:\n-44 typedef typename Grid::Traits::Communication Comm;\n-45 typedef typename Grid::ctype ctype;\n-46 static const int dim = Grid::dimension;\n-47\n-48 std::unique_ptr createGrid(Comm comm = Comm())\n-49 {\n-50 TensorGridFactoryCreator creator(*this);\n-51 return creator.createGrid(comm);\n-52 }\n-53\n-54 std::array , dim> coords() const\n-55 {\n-56 return _coords;\n-57 }\n-58\n-60 std::vector& operator[](std::size_t d)\n-61 {\n-62 return _coords[d];\n-63 }\n-64\n-66 const std::vector& operator[](std::size_t d) const\n-67 {\n-68 return _coords[d];\n-69 }\n+43 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];\n+44 }\n+45\n+46 template< class Entity >\n+47 Value &operator[]_( const Entity &entity )\n+48 {\n+49 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];\n+50 }\n+51\n+52 template< class Entity >\n+53 const Value &operator()_( const Entity &entity, int subEntity ) const\n+54 {\n+55 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );\n+56 }\n+57\n+58 template< class Entity >\n+59 Value &operator()_( const Entity &entity, int subEntity )\n+60 {\n+61 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );\n+62 }\n+63\n+64 Size size () const { return hostContainer_.size(); }\n+65\n+66 void resize ( const Value &value = Value() ) { hostContainer_.resize( value\n+); }\n+67 void shrinkToFit () { return hostContainer_.shrinkToFit(); }\n+68\n+69 void fill ( const Value &value = Value() ) { hostContainer_.fill( value ); }\n 70\n-79 void setStart (int d, ctype value)\n-80 {\n-81 _coords[d].resize(1);\n-82 _coords[d][0] = value;\n-83 }\n+71 void swap ( This &other ) { hostContainer_.swap( other.hostContainer_ ); }\n+72\n+73 ConstIterator begin () const { return hostContainer_.begin(); }\n+74 Iterator begin () { return hostContainer_.begin(); }\n+75\n+76 ConstIterator end () const { return hostContainer_.end(); }\n+77 Iterator end () { return hostContainer_.end(); }\n+78\n+79 int codimension () const { return hostContainer_.codimension(); }\n+80\n+81 protected:\n+82 PersistentContainer<_HostGrid,_T_> hostContainer_;\n+83 };\n 84\n-93 void fillIntervals (int d, int n, ctype h)\n-94 {\n-95 emptyCheck (d);\n-96 for (int i = 0; i < n; i++)\n-97 _coords[d].push_back (_coords[d].back () + h);\n-98 }\n-99\n-108 void fillRange (int d, int n, ctype end)\n-109 {\n-110 emptyCheck (d);\n-111 const ctype h = (end - _coords[d].back ()) / n;\n-112 for (int i = 0; i < n - 1; i++)\n-113 _coords[d].push_back (_coords[d].back () + h);\n-114 _coords[d].push_back (end);\n-115 }\n-116\n-125 void fillUntil (int d, ctype h, ctype end)\n-126 {\n-127 emptyCheck (d);\n-128 while (_coords[d].back () < end)\n-129 _coords[d].push_back (_coords[d].back () + h);\n-130 }\n-131\n-144 void geometricFillIntervals (int d, int n, ctype ratio, ctype h0 =\n-145 static_cast (0))\n-146 {\n-147 emptyCheck (d);\n-148 ctype h = h0;\n-149 if (h0 == static_cast(0))\n-150 h = lastInterval (d) * ratio;\n-151 for (int i = 0; i < n; i++)\n-152 {\n-153 _coords[d].push_back (_coords[d].back () + h);\n-154 h *= ratio;\n-155 }\n-156 }\n-157\n-170 void geometricFillUntil (int d, ctype ratio, ctype end, ctype h0 = static_\n-cast (0))\n-171 {\n-172 emptyCheck (d);\n-173 ctype h = h0;\n-174 if (h0 == static_cast(0))\n-175 h = lastInterval (d) * ratio;\n-176 while (_coords[d].back () < end)\n-177 {\n-178 _coords[d].push_back (_coords[d].back () + h);\n-179 h *= ratio;\n-180 }\n-181 }\n-182\n-197 void geometricFillRange (int d, int n, ctype end, ctype h =\n-198 static_cast (0),\n-199 bool first = true)\n-200 {\n-201 emptyCheck (d);\n-202 if (h < 1e-8)\n-203 h = lastInterval (d);\n-204 ctype ratio = newton (n, _coords[d].back (), end, h);\n-205 if (!first)\n-206 {\n-207 h = h * pow (ratio, n - 1);\n-208 ratio = 1 / ratio;\n-209 }\n-210 for (int i = 0; i < n - 1; i++)\n-211 {\n-212 _coords[d].push_back (_coords[d].back () + h);\n-213 h *= ratio;\n-214 }\n-215 _coords[d].push_back (end);\n-216 }\n-217\n-219 void print()\n-220 {\n-221 for (int i=0; i meshsize;\n-229 for (auto it = _coords[i].begin(); it != _coords[i].end()-1;)\n-230 {\n-231 meshsize.push_back(-1.*(*it));\n-232 ++it;\n-233 meshsize.back() += *it;\n-234 }\n-235\n-236 for (auto it = meshsize.begin(); it != meshsize.end(); ++it)\n-237 std::cout << *it << \" \";\n-238 std::cout << std::endl << \"Ratios between interval lengths: \";\n-239\n-240 std::vector ratios;\n-241 for (auto it = meshsize.begin(); it != meshsize.end() - 1 ;)\n-242 ratios.push_back((1./(*it)) * *(++it));\n-243\n-244 for (auto it = ratios.begin(); it != ratios.end(); ++it)\n-245 std::cout << *it << \" \";\n-246 std::cout << std::endl << std::endl << std::endl;\n-247 }\n-248 }\n-249\n-250 private:\n-251 // check whether the ith component is empty and add a 0.0 entry if so\n-252 void emptyCheck (int i)\n-253 {\n-254 if (_coords[i].empty ())\n-255 _coords[i].push_back (static_cast (0));\n-256 }\n-257\n-258 // returns the last interval length in direction d\n-259 ctype lastInterval (int d)\n-260 {\n-261 if (_coords[d].size () < 2)\n-262 DUNE_THROW(\n-263 GridError,\n-264 \"Not enough elements in coordinate container to deduce interval length in\n-TensorYaspFactory\");\n-265 else\n-266 return _coords[d].back () - _coords[d][_coords[d].size () - 2];\n-267 }\n-268\n-272 ctype newton (int n, ctype x_s, ctype x_e, ctype h)\n-273 {\n-274 ctype m = (x_e - x_s) / h;\n-275 ctype xold = 0.0;\n-276 ctype xnew = x_e - x_s;\n-277 while (std::abs (xnew - xold) > 1E-8)\n-278 {\n-279 xold = xnew;\n-280 xnew = xold\n-281 - (-pow (xold, n) + m * xold - m + 1)\n-282 / (-n * pow (xold, n - 1) + m);\n-283 }\n-284 if (std::abs (xnew - 1) < 1E-6)\n-285 {\n-286 xold = x_e - x_s;\n-287 xnew = 0.0;\n-288 while (std::abs (xnew - xold) > 1E-8)\n-289 {\n-290 xold = xnew;\n-291 xnew = xold\n-292 - (-pow (xold, n) + m * xold - m + 1)\n-293 / (-n * pow (xold, n - 1) + m);\n-294 }\n-295 }\n-296 return xnew;\n-297 }\n-298\n-299 std::array, dim> _coords;\n-300 };\n-301\n-302 // class that implements the actual grid creation process. The default is\n-implementing\n-303 // standard creation for unstructured grids. Provide a specialization for\n-other grids.\n-304 template\n-305 class TensorGridFactoryCreator\n-306 {\n-307 public:\n-308 typedef typename Grid::Traits::Communication Comm;\n-309 typedef typename Grid::ctype ctype;\n-310 static const int dim = Grid::dimension;\n-311\n-312 TensorGridFactoryCreator(const TensorGridFactory& factory) : _factory\n-(factory) {}\n-313\n-314 std::unique_ptr createGrid(Comm comm)\n-315 {\n-316 // The grid factory\n-317 GridFactory fac;\n-318\n-319 if (comm.rank() == 0)\n-320 {\n-321 // determine the size of the grid\n-322 std::array vsizes, esizes;\n-323 std::size_t size = 1;\n-324 for (std::size_t i = 0; i index(vsizes);\n-333 for (std::size_t i=0; i position;\n-336 for (std::size_t j = 0; j offsets;\n-343 offsets[0] = 1;\n-344 for (std::size_t i=1; i cornersTemplate(nCorners,0);\n-352\n-353 for (size_t i=0; i eindex(esizes);\n-360\n-361 // Compute the total number of elements to be created\n-362 int numElements = eindex.cycle();\n-363\n-364 for (int i=0; i corners = cornersTemplate;\n-373 for (size_t j=0; j(fac.createGrid());\n-381 }\n-382\n-383 private:\n-384 const TensorGridFactory& _factory;\n-385 };\n-386\n-387 template\n-388 class TensorGridFactoryCreator > >\n-389 {\n-390 public:\n-391 typedef YaspGrid > Grid;\n-392 typedef typename Grid::Communication Comm;\n-393\n-394 TensorGridFactoryCreator(const TensorGridFactory& factory) : _factory\n-(factory) {}\n-395\n-396 std::unique_ptr createGrid(Comm comm)\n-397 {\n-398 return std::make_unique(_factory.coords(), std::bitset(0ULL), 1,\n-comm);\n-399 }\n-400 private:\n-401 const TensorGridFactory& _factory;\n-402 };\n-403}\n-404\n-405#endif\n-multiindex.hh\n-Implements a multiindex with arbitrary dimension and fixed index ranges This is\n-used by various facto...\n-yaspgrid.hh\n+85} // namespace Dune\n+86\n+87#endif // #ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH\n+hostgridaccess.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::ctype\n-ct ctype\n-Define type used for coordinates in grid module.\n-Definition common/grid.hh:518\n-Dune::GridFactory\n-Provide a generic factory class for unstructured grids.\n-Definition common/gridfactory.hh:275\n-Dune::GridFactory::insertElement\n-virtual void insertElement(const GeometryType &type, const std::vector<\n-unsigned int > &vertices)\n-Insert an element into the coarse grid.\n-Definition common/gridfactory.hh:307\n-Dune::GridFactory::insertVertex\n-virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)\n-Insert a vertex into the coarse grid.\n-Definition common/gridfactory.hh:296\n-Dune::GridFactory::createGrid\n-virtual std::unique_ptr< GridType > createGrid()\n-Finalize grid creation and hand over the grid.\n-Definition common/gridfactory.hh:333\n-Dune::FactoryUtilities::MultiIndex\n-Definition multiindex.hh:19\n-Dune::FactoryUtilities::MultiIndex::cycle\n-size_t cycle() const\n-Compute how many times you can call operator++ before getting to (0,...,0)\n-again.\n-Definition multiindex.hh:48\n-Dune::TensorGridFactoryCreator\n-Definition tensorgridfactory.hh:306\n-Dune::TensorGridFactoryCreator::ctype\n-Grid::ctype ctype\n-Definition tensorgridfactory.hh:309\n-Dune::TensorGridFactoryCreator::Comm\n-Grid::Traits::Communication Comm\n-Definition tensorgridfactory.hh:308\n-Dune::TensorGridFactoryCreator::TensorGridFactoryCreator\n-TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)\n-Definition tensorgridfactory.hh:312\n-Dune::TensorGridFactoryCreator::createGrid\n-std::unique_ptr< Grid > createGrid(Comm comm)\n-Definition tensorgridfactory.hh:314\n-Dune::TensorGridFactoryCreator::dim\n-static const int dim\n-Definition tensorgridfactory.hh:310\n-Dune::TensorGridFactory\n-A factory class for conveniently creating tensorproduct grids.\n-Definition tensorgridfactory.hh:42\n-Dune::TensorGridFactory::fillRange\n-void fillRange(int d, int n, ctype end)\n-fills the range to end with n intervals in direction d\n-Definition tensorgridfactory.hh:108\n-Dune::TensorGridFactory::geometricFillRange\n-void geometricFillRange(int d, int n, ctype end, ctype h=static_cast< ctype >\n-(0), bool first=true)\n-fills a coordinate range in direction d with n intervals according to a\n-geometric series\n-Definition tensorgridfactory.hh:197\n-Dune::TensorGridFactory::ctype\n-Grid::ctype ctype\n-Definition tensorgridfactory.hh:45\n-Dune::TensorGridFactory::fillUntil\n-void fillUntil(int d, ctype h, ctype end)\n-adds intervals in direction d until a given coordinate is reached\n-Definition tensorgridfactory.hh:125\n-Dune::TensorGridFactory::geometricFillUntil\n-void geometricFillUntil(int d, ctype ratio, ctype end, ctype h0=static_cast<\n-ctype >(0))\n-adds intervals in direction d according with a given length ratio until a given\n-coordinate is reached\n-Definition tensorgridfactory.hh:170\n-Dune::TensorGridFactory::dim\n-static const int dim\n-Definition tensorgridfactory.hh:46\n-Dune::TensorGridFactory::print\n-void print()\n-print the coordinate information given to the factory so far\n-Definition tensorgridfactory.hh:219\n-Dune::TensorGridFactory::fillIntervals\n-void fillIntervals(int d, int n, ctype h)\n-pushs n intervals of length h in direction d\n-Definition tensorgridfactory.hh:93\n-Dune::TensorGridFactory::setStart\n-void setStart(int d, ctype value)\n-set a starting value in a given direction d\n-Definition tensorgridfactory.hh:79\n-Dune::TensorGridFactory::geometricFillIntervals\n-void geometricFillIntervals(int d, int n, ctype ratio, ctype h0=static_cast<\n-ctype >(0))\n-adds n intervals in direction d with a given length ratio and a given starting\n-interval length.\n-Definition tensorgridfactory.hh:144\n-Dune::TensorGridFactory::operator[]\n-std::vector< ctype > & operator[](std::size_t d)\n-allow to manually tune the factory by overloading operator[] to export the\n-coordinate vectors in the ...\n-Definition tensorgridfactory.hh:60\n-Dune::TensorGridFactory::operator[]\n-const std::vector< ctype > & operator[](std::size_t d) const\n-allow to manually tune the factory by overloading operator[] to export the\n-coordinate vectors in the ...\n-Definition tensorgridfactory.hh:66\n-Dune::TensorGridFactory::createGrid\n-std::unique_ptr< Grid > createGrid(Comm comm=Comm())\n-Definition tensorgridfactory.hh:48\n-Dune::TensorGridFactory::Comm\n-Grid::Traits::Communication Comm\n-Definition tensorgridfactory.hh:44\n-Dune::TensorGridFactory::coords\n-std::array< std::vector< ctype >, dim > coords() const\n-Definition tensorgridfactory.hh:54\n-Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n-dim_>_>_>::createGrid\n-std::unique_ptr< Grid > createGrid(Comm comm)\n-Definition tensorgridfactory.hh:396\n-Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n-dim_>_>_>::TensorGridFactoryCreator\n-TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)\n-Definition tensorgridfactory.hh:394\n-Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n-dim_>_>_>::Comm\n-Grid::Communication Comm\n-Definition tensorgridfactory.hh:392\n-Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n-dim_>_>_>::Grid\n-YaspGrid< dim, TensorProductCoordinates< ctype, dim > > Grid\n-Definition tensorgridfactory.hh:391\n-Dune::YaspGrid\n-[ provides Dune::Grid ]\n-Definition yaspgrid.hh:166\n-Dune::YaspGrid::Communication\n-typename Base::Communication Communication\n-Definition yaspgrid.hh:181\n-Dune::TensorProductCoordinates\n-Coordinate container for a tensor product YaspGrid.\n-Definition coordinates.hh:245\n-gridfactory.hh\n-Provide a generic factory class for unstructured grids.\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::HostGridAccess\n+provides access to host grid objects from GeometryGrid\n+Definition identitygrid.hh:37\n+Dune::PersistentContainer<_HostGrid,_T_>\n+Dune::PersistentContainerMap::swap\n+void swap(This &other)\n+Definition persistentcontainermap.hh:97\n+Dune::PersistentContainerMap::fill\n+void fill(const Value &value)\n+Definition persistentcontainermap.hh:95\n+Dune::PersistentContainerMap::codimension\n+int codimension() const\n+Definition persistentcontainermap.hh:111\n+Dune::PersistentContainerMap::resize\n+void resize(const Value &value=Value())\n+Definition persistentcontainermap.hh:87\n+Dune::PersistentContainerMap::begin\n+ConstIterator begin() const\n+Definition persistentcontainermap.hh:175\n+Dune::PersistentContainerMap::end\n+ConstIterator end() const\n+Definition persistentcontainermap.hh:190\n+Dune::PersistentContainerMap::size\n+Size size() const\n+Definition persistentcontainermap.hh:85\n+Dune::PersistentContainerMap::shrinkToFit\n+void shrinkToFit()\n+Definition persistentcontainermap.hh:93\n+Dune::PersistentContainerWrapper\n+Definition persistentcontainerwrapper.hh:19\n+Dune::PersistentContainerWrapper::fill\n+void fill(const Value &value=Value())\n+Definition persistentcontainerwrapper.hh:69\n+Dune::PersistentContainerWrapper::ConstIterator\n+PersistentContainer< HostGrid, T >::ConstIterator ConstIterator\n+Definition persistentcontainerwrapper.hh:34\n+Dune::PersistentContainerWrapper::size\n+Size size() const\n+Definition persistentcontainerwrapper.hh:64\n+Dune::PersistentContainerWrapper::begin\n+ConstIterator begin() const\n+Definition persistentcontainerwrapper.hh:73\n+Dune::PersistentContainerWrapper::operator()\n+const Value & operator()(const Entity &entity, int subEntity) const\n+Definition persistentcontainerwrapper.hh:53\n+Dune::PersistentContainerWrapper::Grid\n+G Grid\n+Definition persistentcontainerwrapper.hh:28\n+Dune::PersistentContainerWrapper::operator[]\n+const Value & operator[](const Entity &entity) const\n+Definition persistentcontainerwrapper.hh:41\n+Dune::PersistentContainerWrapper::resize\n+void resize(const Value &value=Value())\n+Definition persistentcontainerwrapper.hh:66\n+Dune::PersistentContainerWrapper::Size\n+PersistentContainer< HostGrid, T >::Size Size\n+Definition persistentcontainerwrapper.hh:31\n+Dune::PersistentContainerWrapper::codimension\n+int codimension() const\n+Definition persistentcontainerwrapper.hh:79\n+Dune::PersistentContainerWrapper::Value\n+PersistentContainer< HostGrid, T >::Value Value\n+Definition persistentcontainerwrapper.hh:30\n+Dune::PersistentContainerWrapper::swap\n+void swap(This &other)\n+Definition persistentcontainerwrapper.hh:71\n+Dune::PersistentContainerWrapper::end\n+ConstIterator end() const\n+Definition persistentcontainerwrapper.hh:76\n+Dune::PersistentContainerWrapper::PersistentContainerWrapper\n+PersistentContainerWrapper(const Grid &grid, int codim, const Value\n+&value=Value())\n+Definition persistentcontainerwrapper.hh:36\n+Dune::PersistentContainerWrapper::Iterator\n+PersistentContainer< HostGrid, T >::Iterator Iterator\n+Definition persistentcontainerwrapper.hh:33\n+Dune::PersistentContainerWrapper::shrinkToFit\n+void shrinkToFit()\n+Definition persistentcontainerwrapper.hh:67\n+Dune::PersistentContainerWrapper::begin\n+Iterator begin()\n+Definition persistentcontainerwrapper.hh:74\n+Dune::PersistentContainerWrapper::hostContainer_\n+PersistentContainer< HostGrid, T > hostContainer_\n+Definition persistentcontainerwrapper.hh:82\n+Dune::PersistentContainerWrapper::end\n+Iterator end()\n+Definition persistentcontainerwrapper.hh:77\n+persistentcontainer.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00992.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00992.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: multiindex.hh File Reference\n+dune-grid: persistentcontainermap.hh File Reference\n \n \n \n \n \n \n \n@@ -72,39 +72,41 @@\n
  • dune
  • grid
  • utility
  • \n
    \n \n
    \n \n-
    multiindex.hh File Reference
    \n+
    persistentcontainermap.hh File Reference
    \n
    \n
    \n-\n-

    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes. \n-More...

    \n-
    #include <array>
    \n+
    #include <algorithm>
    \n+#include <cassert>
    \n+#include <type_traits>
    \n+#include <utility>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/grid/common/capabilities.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::FactoryUtilities::MultiIndex< dim >
    class  Dune::PersistentContainerMap< G, IdSet, Map >
     map-based implementation of the PersistentContainer More...
     
    class  Dune::PersistentContainerMap< G, IdSet, Map >::IteratorWrapper< value, iterator >
     
    \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::FactoryUtilities
     
    \n-

    Detailed Description

    \n-

    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes.

    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,26 +2,29 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-multiindex.hh File Reference\n-Implements a multiindex with arbitrary dimension and fixed index ranges This is\n-used by various factory classes. More...\n-#include \n+persistentcontainermap.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::FactoryUtilities::MultiIndex<_dim_>\n+class \u00a0 Dune::PersistentContainerMap<_G,_IdSet,_Map_>\n+\u00a0 map-based implementation of the PersistentContainer More...\n+\u00a0\n+class \u00a0 Dune::PersistentContainerMap<_G,_IdSet,_Map_>::IteratorWrapper<_value,\n+ iterator_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::FactoryUtilities\n-\u00a0\n-***** Detailed Description *****\n-Implements a multiindex with arbitrary dimension and fixed index ranges This is\n-used by various factory classes.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00992_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00992_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: multiindex.hh Source File\n+dune-grid: persistentcontainermap.hh Source File\n \n \n \n \n \n \n \n@@ -74,83 +74,387 @@\n \n
    \n \n
    \n \n
    \n-
    multiindex.hh
    \n+
    persistentcontainermap.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3#ifndef DUNE_GRID_UTILITY_MULTIINDEX_HH
    \n-
    4#define DUNE_GRID_UTILITY_MULTIINDEX_HH
    \n-
    5
    \n-
    11#include<array>
    \n+
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=4 sw=2 sts=2:
    \n+
    5#ifndef DUNE_PERSISTENTCONTAINERMAP_HH
    \n+
    6#define DUNE_PERSISTENTCONTAINERMAP_HH
    \n+
    7
    \n+
    8#include <algorithm>
    \n+
    9#include <cassert>
    \n+
    10#include <type_traits>
    \n+
    11#include <utility>
    \n
    12
    \n-
    13namespace Dune
    \n-
    14{
    \n-
    \n-
    15 namespace FactoryUtilities
    \n-
    16 {
    \n-
    17 template<std::size_t dim>
    \n-
    \n-
    18 class MultiIndex : public std::array<unsigned int,dim>
    \n-
    19 {
    \n-
    20 // The range of each component
    \n-
    21 std::array<unsigned int,dim> limits_;
    \n+
    13#include <dune/common/hybridutilities.hh>
    \n+
    14#include <dune/common/typetraits.hh>
    \n+\n+
    16
    \n+
    17namespace Dune
    \n+
    18{
    \n+
    19
    \n+
    20 // PersistentContainerMap
    \n+
    21 // ----------------------
    \n
    22
    \n-
    23 public:
    \n-
    \n-
    25 MultiIndex(const std::array<unsigned int,dim>& limits) : limits_(limits)
    \n-
    26 {
    \n-
    27 std::fill(this->begin(), this->end(), 0);
    \n-
    28 }
    \n-
    \n-
    29
    \n-
    \n-\n-
    32 {
    \n-
    33 for (std::size_t i=0; i<dim; i++)
    \n-
    34 {
    \n-
    35 // Augment digit
    \n-
    36 (*this)[i]++;
    \n-
    37
    \n-
    38 // If there is no carry-over we can stop here
    \n-
    39 if ((*this)[i]<limits_[i])
    \n-
    40 break;
    \n+
    24 template< class G, class IdSet, class Map >
    \n+
    \n+\n+
    26 {
    \n+\n+
    28
    \n+
    29 protected:
    \n+
    30 template< class reference, class iterator >
    \n+
    31 class IteratorWrapper;
    \n+
    32
    \n+
    33 public:
    \n+
    34 typedef G Grid;
    \n+
    35
    \n+
    36 typedef typename Map::mapped_type Value;
    \n+
    37 typedef typename Map::size_type Size;
    \n+
    38
    \n+\n+\n
    41
    \n-
    42 (*this)[i] = 0;
    \n-
    43 }
    \n-
    44 return *this;
    \n-
    45 }
    \n-
    \n-
    46
    \n-
    \n-
    48 size_t cycle() const
    \n-
    49 {
    \n-
    50 size_t result = 1;
    \n-
    51 for (std::size_t i=0; i<dim; i++)
    \n-
    52 result *= limits_[i];
    \n-
    53 return result;
    \n-
    54 }
    \n-
    \n-
    55 };
    \n-
    \n-
    56 }
    \n-
    \n-
    57}
    \n-
    58
    \n-
    59#endif
    \n+
    \n+
    42 PersistentContainerMap ( const Grid &grid, int codim, const IdSet &idSet, const Value &value )
    \n+
    43 : grid_( &grid ),
    \n+
    44 codim_( codim ),
    \n+
    45 idSet_( &idSet ),
    \n+
    46 data_()
    \n+
    47 {
    \n+
    48 resize( value );
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    51 template< class Entity >
    \n+
    \n+
    52 const Value &operator[] ( const Entity &entity ) const
    \n+
    53 {
    \n+
    54 assert( Entity::codimension == codimension() );
    \n+
    55 typename Map::const_iterator pos = data_.find( idSet().id( entity ) );
    \n+
    56 assert( pos != data_.end() );
    \n+
    57 return pos->second;
    \n+
    58 }
    \n+
    \n+
    59
    \n+
    60 template< class Entity >
    \n+
    \n+
    61 Value &operator[] ( const Entity &entity )
    \n+
    62 {
    \n+
    63 assert( Entity::codimension == codimension() );
    \n+
    64 typename Map::iterator pos = data_.find( idSet().id( entity ) );
    \n+
    65 assert( pos != data_.end() );
    \n+
    66 return pos->second;
    \n+
    67 }
    \n+
    \n+
    68
    \n+
    69 template< class Entity >
    \n+
    \n+
    70 const Value &operator() ( const Entity &entity, int subEntity ) const
    \n+
    71 {
    \n+
    72 typename Map::const_iterator pos = data_.find( idSet().subId( entity, subEntity, codimension() ) );
    \n+
    73 assert( pos != data_.end() );
    \n+
    74 return pos->second;
    \n+
    75 }
    \n+
    \n+
    76
    \n+
    77 template< class Entity >
    \n+
    \n+
    78 Value &operator() ( const Entity &entity, int subEntity )
    \n+
    79 {
    \n+
    80 typename Map::iterator pos = data_.find( idSet().subId( entity, subEntity, codimension() ) );
    \n+
    81 assert( pos != data_.end() );
    \n+
    82 return pos->second;
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    85 Size size () const { return data_.size(); }
    \n+
    86
    \n+
    \n+
    87 void resize ( const Value &value = Value() )
    \n+
    88 {
    \n+
    89 Hybrid::forEach( std::make_index_sequence< Grid::dimension+1 >{},
    \n+
    90 [ & ]( auto i ){ if( int(i) == this->codimension() ) this->template resize< i >( value ); } );
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    93 void shrinkToFit () {}
    \n+
    94
    \n+
    95 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }
    \n+
    96
    \n+
    \n+
    97 void swap ( This &other )
    \n+
    98 {
    \n+
    99 std::swap( grid_, other.grid_ );
    \n+
    100 std::swap( codim_, other.codim_ );
    \n+
    101 std::swap( idSet_, other.idSet_ );
    \n+
    102 std::swap( data_, other.data_ );
    \n+
    103 }
    \n+
    \n+
    104
    \n+
    \n+\n+
    \n+\n+
    107
    \n+
    \n+\n+
    \n+\n+
    110
    \n+
    111 int codimension () const { return codim_; }
    \n+
    112
    \n+
    113 protected:
    \n+
    114 const Grid &grid () const { return *grid_; }
    \n+
    115
    \n+
    116 template< int codim >
    \n+
    \n+
    117 void resize ( const Value &value );
    \n+
    118
    \n+
    119 template< int codim >
    \n+
    \n+
    120 void migrateLevel ( int level, const Value &value, Map &data,
    \n+
    121 std::integral_constant< bool, true > );
    \n+
    122
    \n+
    123 template< int codim >
    \n+
    \n+
    124 void migrateLevel ( int level, const Value &value, Map &data,
    \n+
    125 std::integral_constant< bool, false > );
    \n+
    126
    \n+
    \n+
    127 static void migrateEntry ( const typename IdSet::IdType &id, const Value &value,
    \n+
    128 Map &oldData, Map &newData );
    \n+
    129
    \n+
    130 const IdSet &idSet () const { return *idSet_; }
    \n+
    131
    \n+
    132 const Grid *grid_;
    \n+\n+
    134 const IdSet *idSet_;
    \n+
    135 Map data_;
    \n+
    136 };
    \n+
    137
    \n+
    138
    \n+
    139
    \n+
    140 // PersistentContainerMap::IteratorWrapper
    \n+
    141 // ---------------------------------------
    \n+
    142
    \n+
    143 template< class G, class IdSet, class Map >
    \n+
    144 template< class value, class iterator >
    \n+
    \n+\n+
    146 : public iterator
    \n+
    147 {
    \n+\n+
    149
    \n+
    150 public:
    \n+
    151 IteratorWrapper ( const iterator &it ) : it_( it ) {}
    \n+
    152
    \n+
    153 operator ConstWrapper () const { return ConstWrapper( it_ ); }
    \n+
    154
    \n+
    155 value &operator* () { return it_->second; }
    \n+
    156 value *operator-> () { return &(it_->second); }
    \n+
    157
    \n+
    158 bool operator== ( const IteratorWrapper &other ) const { return (it_ == other.it_); }
    \n+
    159 bool operator!= ( const IteratorWrapper &other ) const { return (it_ != other.it_); }
    \n+
    160
    \n+
    161 IteratorWrapper &operator++ () { ++it_; return *this; }
    \n+
    162
    \n+
    163 private:
    \n+
    164 iterator it_;
    \n+
    165 };
    \n+
    \n+
    166
    \n+
    167
    \n+
    168
    \n+
    169
    \n+
    170 // Implementation of PersistentContainerMap
    \n+
    171 // ----------------------------------------
    \n+
    172
    \n+
    173 template< class G, class IdSet, class Map >
    \n+\n+
    \n+\n+
    176 {
    \n+
    177 return ConstIterator( data_.begin() );
    \n+
    178 }
    \n+
    \n+
    179
    \n+
    180 template< class G, class IdSet, class Map >
    \n+\n+
    \n+\n+
    183 {
    \n+
    184 return Iterator( data_.begin() );
    \n+
    185 }
    \n+
    \n+
    186
    \n+
    187
    \n+
    188 template< class G, class IdSet, class Map >
    \n+\n+
    \n+\n+
    191 {
    \n+
    192 return ConstIterator( data_.end() );
    \n+
    193 }
    \n+
    \n+
    194
    \n+
    195 template< class G, class IdSet, class Map >
    \n+\n+
    \n+\n+
    198 {
    \n+
    199 return Iterator( data_.end() );
    \n+
    200 }
    \n+
    \n+
    201
    \n+
    202
    \n+
    203 template< class G, class IdSet, class Map >
    \n+
    204 template< int codim >
    \n+
    \n+\n+
    206 {
    \n+
    207 std::integral_constant< bool, Capabilities::hasEntityIterator< Grid, codim >::v > hasEntityIterator;
    \n+
    208 assert( codim == codimension() );
    \n+
    209
    \n+
    210 // create empty map and swap it with current map (no need to copy twice)
    \n+
    211 Map data;
    \n+
    212 std::swap( data, data_ );
    \n+
    213
    \n+
    214 // copy all data from old map into new one (adding new entries, if necessary)
    \n+
    215 const int maxLevel = grid().maxLevel();
    \n+
    216 for ( int level = 0; level <= maxLevel; ++level )
    \n+
    217 migrateLevel< codim >( level, value, data, hasEntityIterator );
    \n+
    218 }
    \n+
    \n+
    219
    \n+
    220
    \n+
    221 template< class G, class IdSet, class Map >
    \n+
    222 template< int codim >
    \n+\n+
    \n+
    224 ::migrateLevel ( int level, const Value &value, Map &data,
    \n+
    225 std::integral_constant< bool, true > )
    \n+
    226 {
    \n+
    227 typedef typename Grid::LevelGridView LevelView;
    \n+
    228 typedef typename LevelView::template Codim< codim >::Iterator LevelIterator;
    \n+
    229
    \n+
    230 const LevelView levelView = grid().levelGridView( level );
    \n+
    231 const LevelIterator end = levelView.template end< codim >();
    \n+
    232 for( LevelIterator it = levelView.template begin< codim >(); it != end; ++it )
    \n+
    233 migrateEntry( idSet().id( *it ), value, data, data_ );
    \n+
    234 }
    \n+
    \n+
    235
    \n+
    236
    \n+
    237 template< class G, class IdSet, class Map >
    \n+
    238 template< int codim >
    \n+\n+
    \n+
    240 ::migrateLevel ( int level, const Value &value, Map &data,
    \n+
    241 std::integral_constant< bool, false > )
    \n+
    242 {
    \n+
    243 typedef typename Grid::LevelGridView LevelView;
    \n+
    244 typedef typename LevelView::template Codim< 0 >::Iterator LevelIterator;
    \n+
    245
    \n+
    246 const LevelView levelView = grid().levelGridView( level );
    \n+
    247 const LevelIterator end = levelView.template end< 0 >();
    \n+
    248 for( LevelIterator it = levelView.template begin< 0 >(); it != end; ++it )
    \n+
    249 {
    \n+
    250 const typename LevelIterator::Entity &entity = *it;
    \n+
    251 const int subEntities = entity.subEntities( codim );
    \n+
    252 for( int i = 0; i < subEntities; ++i )
    \n+
    253 migrateEntry( idSet().subId( entity, i, codim ), value, data, data_ );
    \n+
    254 }
    \n+
    255 }
    \n+
    \n+
    256
    \n+
    257
    \n+
    258 template< class G, class IdSet, class Map >
    \n+\n+
    \n+
    260 ::migrateEntry ( const typename IdSet::IdType &id, const Value &value,
    \n+
    261 Map &oldData, Map &newData )
    \n+
    262 {
    \n+
    263 // insert entry for id
    \n+
    264 const std::pair< typename Map::iterator, bool > inserted
    \n+
    265 = newData.insert( std::make_pair( id, value ) );
    \n+
    266
    \n+
    267 // if entry did not exist previously, copy data
    \n+
    268 if( inserted.second )
    \n+
    269 {
    \n+
    270 const typename Map::iterator pos = oldData.find( id );
    \n+
    271 if( pos != oldData.end() )
    \n+
    272 {
    \n+
    273 inserted.first->second = pos->second;
    \n+
    274 oldData.erase( pos );
    \n+
    275 }
    \n+
    276 }
    \n+
    277 }
    \n+
    \n+
    \n+
    278
    \n+
    279} // namespace Dune
    \n+
    280
    \n+
    281#endif // #ifndef DUNE_PERSISTENTCONTAINERMAP_HH
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition multiindex.hh:19
    \n-
    MultiIndex(const std::array< unsigned int, dim > &limits)
    Constructor with a given range for each digit.
    Definition multiindex.hh:25
    \n-
    MultiIndex< dim > & operator++()
    Increment the MultiIndex.
    Definition multiindex.hh:31
    \n-
    size_t cycle() const
    Compute how many times you can call operator++ before getting to (0,...,0) again.
    Definition multiindex.hh:48
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n+
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n+
    IdTypeImp IdType
    Type used to represent an id.
    Definition common/indexidset.hh:453
    \n+
    GridFamily::Traits::LevelGridView LevelGridView
    type of view for level grid
    Definition common/grid.hh:402
    \n+
    Export the type of the entity used as parameter in the id(...) method.
    Definition common/indexidset.hh:457
    \n+
    map-based implementation of the PersistentContainer
    Definition persistentcontainermap.hh:26
    \n+
    void migrateLevel(int level, const Value &value, Map &data, std::integral_constant< bool, false >)
    Definition persistentcontainermap.hh:240
    \n+
    void swap(This &other)
    Definition persistentcontainermap.hh:97
    \n+
    void fill(const Value &value)
    Definition persistentcontainermap.hh:95
    \n+
    G Grid
    Definition persistentcontainermap.hh:34
    \n+
    void resize(const Value &value)
    Definition persistentcontainermap.hh:205
    \n+
    IteratorWrapper< const Value, typename Map::const_iterator > ConstIterator
    Definition persistentcontainermap.hh:39
    \n+
    int codim_
    Definition persistentcontainermap.hh:133
    \n+
    const Grid * grid_
    Definition persistentcontainermap.hh:132
    \n+
    const Value & operator[](const Entity &entity) const
    Definition persistentcontainermap.hh:52
    \n+
    int codimension() const
    Definition persistentcontainermap.hh:111
    \n+
    void resize(const Value &value=Value())
    Definition persistentcontainermap.hh:87
    \n+
    const IdSet & idSet() const
    Definition persistentcontainermap.hh:130
    \n+
    ConstIterator begin() const
    Definition persistentcontainermap.hh:175
    \n+
    static void migrateEntry(const typename IdSet::IdType &id, const Value &value, Map &oldData, Map &newData)
    Definition persistentcontainermap.hh:260
    \n+
    Map::mapped_type Value
    Definition persistentcontainermap.hh:36
    \n+
    Iterator end()
    Definition persistentcontainermap.hh:197
    \n+
    const Grid & grid() const
    Definition persistentcontainermap.hh:114
    \n+
    const Value & operator()(const Entity &entity, int subEntity) const
    Definition persistentcontainermap.hh:70
    \n+
    PersistentContainerMap(const Grid &grid, int codim, const IdSet &idSet, const Value &value)
    Definition persistentcontainermap.hh:42
    \n+
    Iterator begin()
    Definition persistentcontainermap.hh:182
    \n+
    Map::size_type Size
    Definition persistentcontainermap.hh:37
    \n+
    ConstIterator end() const
    Definition persistentcontainermap.hh:190
    \n+
    Map data_
    Definition persistentcontainermap.hh:135
    \n+
    Size size() const
    Definition persistentcontainermap.hh:85
    \n+
    IteratorWrapper< Value, typename Map::iterator > Iterator
    Definition persistentcontainermap.hh:40
    \n+
    const IdSet * idSet_
    Definition persistentcontainermap.hh:134
    \n+
    void migrateLevel(int level, const Value &value, Map &data, std::integral_constant< bool, true >)
    Definition persistentcontainermap.hh:224
    \n+
    void shrinkToFit()
    Definition persistentcontainermap.hh:93
    \n+
    Definition persistentcontainermap.hh:147
    \n+
    IteratorWrapper(const iterator &it)
    Definition persistentcontainermap.hh:151
    \n+
    A set of traits classes to store static information about grid implementation.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,81 +1,432 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-multiindex.hh\n+persistentcontainermap.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3#ifndef DUNE_GRID_UTILITY_MULTIINDEX_HH\n-4#define DUNE_GRID_UTILITY_MULTIINDEX_HH\n-5\n-11#include\n+3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=4 sw=2 sts=2:\n+5#ifndef DUNE_PERSISTENTCONTAINERMAP_HH\n+6#define DUNE_PERSISTENTCONTAINERMAP_HH\n+7\n+8#include \n+9#include \n+10#include \n+11#include \n 12\n-13namespace Dune\n-14{\n-15 namespace FactoryUtilities\n-16 {\n-17 template\n-18 class MultiIndex : public std::array\n-19 {\n-20 // The range of each component\n-21 std::array limits_;\n+13#include \n+14#include \n+15#include \n+16\n+17namespace Dune\n+18{\n+19\n+20 // PersistentContainerMap\n+21 // ----------------------\n 22\n-23 public:\n-25 MultiIndex(const std::array& limits) : limits_(limits)\n+24 template< class G, class IdSet, class Map >\n+25 class PersistentContainerMap\n 26 {\n-27 std::fill(this->begin(), this->end(), 0);\n-28 }\n-29\n-31 MultiIndex& operator++()\n-32 {\n-33 for (std::size_t i=0; i This;\n+28\n+29 protected:\n+30 template< class reference, class iterator >\n+31 class IteratorWrapper;\n+32\n+33 public:\n+34 typedef G Grid;\n+35\n+36 typedef typename Map::mapped_type Value;\n+37 typedef typename Map::size_type Size;\n+38\n+39 typedef IteratorWrapper<_const_Value,_typename_Map::const_iterator_>\n+ConstIterator;\n+40 typedef IteratorWrapper<_Value,_typename_Map::iterator_> Iterator;\n 41\n-42 (*this)[i] = 0;\n-43 }\n-44 return *this;\n-45 }\n-46\n-48 size_t cycle() const\n-49 {\n-50 size_t result = 1;\n-51 for (std::size_t i=0; i\n+52 const Value &operator[]_( const Entity &entity ) const\n+53 {\n+54 assert( Entity::codimension == codimension() );\n+55 typename Map::const_iterator pos = data_.find( idSet().id( entity ) );\n+56 assert( pos != data_.end() );\n+57 return pos->second;\n+58 }\n+59\n+60 template< class Entity >\n+61 Value &operator[]_( const Entity &entity )\n+62 {\n+63 assert( Entity::codimension == codimension() );\n+64 typename Map::iterator pos = data_.find( idSet().id( entity ) );\n+65 assert( pos != data_.end() );\n+66 return pos->second;\n+67 }\n+68\n+69 template< class Entity >\n+70 const Value &operator()_( const Entity &entity, int subEntity ) const\n+71 {\n+72 typename Map::const_iterator pos = data_.find( idSet().subId( entity,\n+subEntity, codimension() ) );\n+73 assert( pos != data_.end() );\n+74 return pos->second;\n+75 }\n+76\n+77 template< class Entity >\n+78 Value &operator()_( const Entity &entity, int subEntity )\n+79 {\n+80 typename Map::iterator pos = data_.find( idSet().subId( entity, subEntity,\n+codimension() ) );\n+81 assert( pos != data_.end() );\n+82 return pos->second;\n+83 }\n+84\n+85 Size size () const { return data_.size(); }\n+86\n+87 void resize ( const Value &value = Value() )\n+88 {\n+89 Hybrid::forEach( std::make_index_sequence< Grid::dimension+1 >{},\n+90 [ & ]( auto i ){ if( int(i) == this->codimension() ) this->template resize<\n+i >( value ); } );\n+91 }\n+92\n+93 void shrinkToFit () {}\n+94\n+95 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }\n+96\n+97 void swap ( This &other )\n+98 {\n+99 std::swap( grid_, other.grid_ );\n+100 std::swap( codim_, other.codim_ );\n+101 std::swap( idSet_, other.idSet_ );\n+102 std::swap( data_, other.data_ );\n+103 }\n+104\n+105 ConstIterator begin () const;\n+106 Iterator begin ();\n+107\n+108 ConstIterator end () const;\n+109 Iterator end ();\n+110\n+111 int codimension () const { return codim_; }\n+112\n+113 protected:\n+114 const Grid &grid () const { return *grid_; }\n+115\n+116 template< int codim >\n+117 void resize ( const Value &value );\n+118\n+119 template< int codim >\n+120 void migrateLevel ( int level, const Value &value, Map &data,\n+121 std::integral_constant< bool, true > );\n+122\n+123 template< int codim >\n+124 void migrateLevel ( int level, const Value &value, Map &data,\n+125 std::integral_constant< bool, false > );\n+126\n+127 static void migrateEntry ( const typename IdSet::IdType &id, const Value\n+&value,\n+128 Map &oldData, Map &newData );\n+129\n+130 const IdSet &idSet () const { return *idSet_; }\n+131\n+132 const Grid *grid_;\n+133 int codim_;\n+134 const IdSet *idSet_;\n+135 Map data_;\n+136 };\n+137\n+138\n+139\n+140 // PersistentContainerMap::IteratorWrapper\n+141 // ---------------------------------------\n+142\n+143 template< class G, class IdSet, class Map >\n+144 template< class value, class iterator >\n+145 class PersistentContainerMap<_G,_IdSet,_Map_>::IteratorWrapper\n+146 : public iterator\n+147 {\n+148 typedef IteratorWrapper<_const_value,_typename_Map::const_iterator_>\n+ConstWrapper;\n+149\n+150 public:\n+151 IteratorWrapper ( const iterator &it ) : it_( it ) {}\n+152\n+153 operator ConstWrapper () const { return ConstWrapper( it_ ); }\n+154\n+155 value &operator* () { return it_->second; }\n+156 value *operator-> () { return &(it_->second); }\n+157\n+158 bool operator== ( const IteratorWrapper &other ) const { return (it_ ==\n+other.it_); }\n+159 bool operator!= ( const IteratorWrapper &other ) const { return (it_ !=\n+other.it_); }\n+160\n+161 IteratorWrapper &operator++ () { ++it_; return *this; }\n+162\n+163 private:\n+164 iterator it_;\n+165 };\n+166\n+167\n+168\n+169\n+170 // Implementation of PersistentContainerMap\n+171 // ----------------------------------------\n+172\n+173 template< class G, class IdSet, class Map >\n+174 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::ConstIterator\n+175 PersistentContainerMap<_G,_IdSet,_Map_>::begin () const\n+176 {\n+177 return ConstIterator( data_.begin() );\n+178 }\n+179\n+180 template< class G, class IdSet, class Map >\n+181 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::Iterator\n+182 PersistentContainerMap<_G,_IdSet,_Map_>::begin ()\n+183 {\n+184 return Iterator( data_.begin() );\n+185 }\n+186\n+187\n+188 template< class G, class IdSet, class Map >\n+189 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::ConstIterator\n+190 PersistentContainerMap<_G,_IdSet,_Map_>::end () const\n+191 {\n+192 return ConstIterator( data_.end() );\n+193 }\n+194\n+195 template< class G, class IdSet, class Map >\n+196 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::Iterator\n+197 PersistentContainerMap<_G,_IdSet,_Map_>::end ()\n+198 {\n+199 return Iterator( data_.end() );\n+200 }\n+201\n+202\n+203 template< class G, class IdSet, class Map >\n+204 template< int codim >\n+205 inline void PersistentContainerMap<_G,_IdSet,_Map_>::resize ( const Value\n+&value )\n+206 {\n+207 std::integral_constant< bool, Capabilities::hasEntityIterator< Grid, codim\n+>::v > hasEntityIterator;\n+208 assert( codim == codimension() );\n+209\n+210 // create empty map and swap it with current map (no need to copy twice)\n+211 Map data;\n+212 std::swap( data, data_ );\n+213\n+214 // copy all data from old map into new one (adding new entries, if\n+necessary)\n+215 const int maxLevel = grid().maxLevel();\n+216 for ( int level = 0; level <= maxLevel; ++level )\n+217 migrateLevel< codim >( level, value, data, hasEntityIterator );\n+218 }\n+219\n+220\n+221 template< class G, class IdSet, class Map >\n+222 template< int codim >\n+223 inline void PersistentContainerMap<_G,_IdSet,_Map_>\n+224_::migrateLevel ( int level, const Value &value, Map &data,\n+225 std::integral_constant< bool, true > )\n+226 {\n+227 typedef typename Grid::LevelGridView LevelView;\n+228 typedef typename LevelView::template Codim< codim >::Iterator\n+LevelIterator;\n+229\n+230 const LevelView levelView = grid().levelGridView( level );\n+231 const LevelIterator end = levelView.template end< codim >();\n+232 for( LevelIterator it = levelView.template begin< codim >(); it != end;\n+++it )\n+233 migrateEntry( idSet().id( *it ), value, data, data_ );\n+234 }\n+235\n+236\n+237 template< class G, class IdSet, class Map >\n+238 template< int codim >\n+239 inline void PersistentContainerMap<_G,_IdSet,_Map_>\n+240_::migrateLevel ( int level, const Value &value, Map &data,\n+241 std::integral_constant< bool, false > )\n+242 {\n+243 typedef typename Grid::LevelGridView LevelView;\n+244 typedef typename LevelView::template Codim< 0 >::Iterator LevelIterator;\n+245\n+246 const LevelView levelView = grid().levelGridView( level );\n+247 const LevelIterator end = levelView.template end< 0 >();\n+248 for( LevelIterator it = levelView.template begin< 0 >(); it != end; ++it )\n+249 {\n+250 const typename LevelIterator::Entity &entity = *it;\n+251 const int subEntities = entity.subEntities( codim );\n+252 for( int i = 0; i < subEntities; ++i )\n+253 migrateEntry( idSet().subId( entity, i, codim ), value, data, data_ );\n+254 }\n+255 }\n+256\n+257\n+258 template< class G, class IdSet, class Map >\n+259 inline void PersistentContainerMap<_G,_IdSet,_Map_>\n+260_::migrateEntry ( const typename IdSet::IdType &id, const Value &value,\n+261 Map &oldData, Map &newData )\n+262 {\n+263 // insert entry for id\n+264 const std::pair< typename Map::iterator, bool > inserted\n+265 = newData.insert( std::make_pair( id, value ) );\n+266\n+267 // if entry did not exist previously, copy data\n+268 if( inserted.second )\n+269 {\n+270 const typename Map::iterator pos = oldData.find( id );\n+271 if( pos != oldData.end() )\n+272 {\n+273 inserted.first->second = pos->second;\n+274 oldData.erase( pos );\n+275 }\n+276 }\n+277 }\n+278\n+279} // namespace Dune\n+280\n+281#endif // #ifndef DUNE_PERSISTENTCONTAINERMAP_HH\n+std::swap\n+void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n+> &b)\n+Definition utility/persistentcontainer.hh:83\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::FactoryUtilities::MultiIndex\n-Definition multiindex.hh:19\n-Dune::FactoryUtilities::MultiIndex::MultiIndex\n-MultiIndex(const std::array< unsigned int, dim > &limits)\n-Constructor with a given range for each digit.\n-Definition multiindex.hh:25\n-Dune::FactoryUtilities::MultiIndex::operator++\n-MultiIndex< dim > & operator++()\n-Increment the MultiIndex.\n-Definition multiindex.hh:31\n-Dune::FactoryUtilities::MultiIndex::cycle\n-size_t cycle() const\n-Compute how many times you can call operator++ before getting to (0,...,0)\n-again.\n-Definition multiindex.hh:48\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::codimension\n+static constexpr int codimension\n+Know your own codimension.\n+Definition common/entity.hh:106\n+Dune::IdSet\n+Id Set Interface.\n+Definition common/indexidset.hh:447\n+Dune::IdSet::IdType\n+IdTypeImp IdType\n+Type used to represent an id.\n+Definition common/indexidset.hh:453\n+Dune::Grid::LevelGridView\n+GridFamily::Traits::LevelGridView LevelGridView\n+type of view for level grid\n+Definition common/grid.hh:402\n+Dune::IdSet::Codim\n+Export the type of the entity used as parameter in the id(...) method.\n+Definition common/indexidset.hh:457\n+Dune::PersistentContainerMap\n+map-based implementation of the PersistentContainer\n+Definition persistentcontainermap.hh:26\n+Dune::PersistentContainerMap::migrateLevel\n+void migrateLevel(int level, const Value &value, Map &data, std::integral_\n+constant< bool, false >)\n+Definition persistentcontainermap.hh:240\n+Dune::PersistentContainerMap::swap\n+void swap(This &other)\n+Definition persistentcontainermap.hh:97\n+Dune::PersistentContainerMap::fill\n+void fill(const Value &value)\n+Definition persistentcontainermap.hh:95\n+Dune::PersistentContainerMap::Grid\n+G Grid\n+Definition persistentcontainermap.hh:34\n+Dune::PersistentContainerMap::resize\n+void resize(const Value &value)\n+Definition persistentcontainermap.hh:205\n+Dune::PersistentContainerMap::ConstIterator\n+IteratorWrapper< const Value, typename Map::const_iterator > ConstIterator\n+Definition persistentcontainermap.hh:39\n+Dune::PersistentContainerMap::codim_\n+int codim_\n+Definition persistentcontainermap.hh:133\n+Dune::PersistentContainerMap::grid_\n+const Grid * grid_\n+Definition persistentcontainermap.hh:132\n+Dune::PersistentContainerMap::operator[]\n+const Value & operator[](const Entity &entity) const\n+Definition persistentcontainermap.hh:52\n+Dune::PersistentContainerMap::codimension\n+int codimension() const\n+Definition persistentcontainermap.hh:111\n+Dune::PersistentContainerMap::resize\n+void resize(const Value &value=Value())\n+Definition persistentcontainermap.hh:87\n+Dune::PersistentContainerMap::idSet\n+const IdSet & idSet() const\n+Definition persistentcontainermap.hh:130\n+Dune::PersistentContainerMap::begin\n+ConstIterator begin() const\n+Definition persistentcontainermap.hh:175\n+Dune::PersistentContainerMap::migrateEntry\n+static void migrateEntry(const typename IdSet::IdType &id, const Value &value,\n+Map &oldData, Map &newData)\n+Definition persistentcontainermap.hh:260\n+Dune::PersistentContainerMap::Value\n+Map::mapped_type Value\n+Definition persistentcontainermap.hh:36\n+Dune::PersistentContainerMap::end\n+Iterator end()\n+Definition persistentcontainermap.hh:197\n+Dune::PersistentContainerMap::grid\n+const Grid & grid() const\n+Definition persistentcontainermap.hh:114\n+Dune::PersistentContainerMap::operator()\n+const Value & operator()(const Entity &entity, int subEntity) const\n+Definition persistentcontainermap.hh:70\n+Dune::PersistentContainerMap::PersistentContainerMap\n+PersistentContainerMap(const Grid &grid, int codim, const IdSet &idSet, const\n+Value &value)\n+Definition persistentcontainermap.hh:42\n+Dune::PersistentContainerMap::begin\n+Iterator begin()\n+Definition persistentcontainermap.hh:182\n+Dune::PersistentContainerMap::Size\n+Map::size_type Size\n+Definition persistentcontainermap.hh:37\n+Dune::PersistentContainerMap::end\n+ConstIterator end() const\n+Definition persistentcontainermap.hh:190\n+Dune::PersistentContainerMap::data_\n+Map data_\n+Definition persistentcontainermap.hh:135\n+Dune::PersistentContainerMap::size\n+Size size() const\n+Definition persistentcontainermap.hh:85\n+Dune::PersistentContainerMap::Iterator\n+IteratorWrapper< Value, typename Map::iterator > Iterator\n+Definition persistentcontainermap.hh:40\n+Dune::PersistentContainerMap::idSet_\n+const IdSet * idSet_\n+Definition persistentcontainermap.hh:134\n+Dune::PersistentContainerMap::migrateLevel\n+void migrateLevel(int level, const Value &value, Map &data, std::integral_\n+constant< bool, true >)\n+Definition persistentcontainermap.hh:224\n+Dune::PersistentContainerMap::shrinkToFit\n+void shrinkToFit()\n+Definition persistentcontainermap.hh:93\n+Dune::PersistentContainerMap::IteratorWrapper\n+Definition persistentcontainermap.hh:147\n+Dune::PersistentContainerMap::IteratorWrapper::IteratorWrapper\n+IteratorWrapper(const iterator &it)\n+Definition persistentcontainermap.hh:151\n+capabilities.hh\n+A set of traits classes to store static information about grid implementation.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00995.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00995.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: globalindexset.hh File Reference\n+dune-grid: hierarchicsearch.hh File Reference\n \n \n \n \n \n \n \n@@ -72,66 +72,46 @@\n
  • dune
  • grid
  • utility
  • \n \n \n
    \n \n-
    globalindexset.hh File Reference
    \n+
    hierarchicsearch.hh File Reference
    \n
    \n
    \n \n-

    Provides a globally unique index for all entities of a distributed Dune grid. \n+

    Utility class for hierarchically searching for an Entity containing a given point. \n More...

    \n-
    #include <vector>
    \n-#include <iostream>
    \n-#include <fstream>
    \n-#include <memory>
    \n-#include <map>
    \n+
    #include <cstddef>
    \n+#include <sstream>
    \n+#include <string>
    \n #include <utility>
    \n-#include <algorithm>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/common/datahandleif.hh>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/common/classname.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/grid/common/grid.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 Classes

    class  Dune::GlobalIndexSet< GridView >
     Calculate globally unique index over all processes in a Dune grid. More...
     
    struct  Dune::GlobalIndexSet< GridView >::SubPartitionTypeProvider< Entity, Codim >
     Helper class to provide access to subentity PartitionTypes with a run-time codimension. More...
     
    struct  Dune::GlobalIndexSet< GridView >::SubPartitionTypeProvider< Entity, 0 >
    class  Dune::HierarchicSearch< Grid, IS >
     Search an IndexSet for an Entity containing a given point. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    Provides a globally unique index for all entities of a distributed Dune grid.

    \n-

    Such functionality is relevant for a number of applications:

      \n-
    • Map a degree of freedom associated with an entity to its location in a global matrix or global vector
    • \n-
    • Such indices for elements are needed as input to external mesh partitioners
    • \n-
    • Using matrix and vector routines from the PETSc or trilinos parallel linear algebra packages for distributed memory parallel computers.
    • \n-
    \n-

    Method: (1) The UniqueEntityPartition class assigns an owner process to each entity

        (2) Compute the number of entities that are owned by each process\n-\n-    (3) we communicate the index of entities that are owned by the process to processes\n-        that also contain these entities but do not own them, so that on a non-owner process\n-        we have information on the index of the entity that it got from the owner-process;\n-
    Author
    Benedikt Oswald, Patrick Leidenberger, Oliver Sander
    \n-
    Attention
    globally unique indices are ONLY provided for entities of the InteriorBorder_Partition type, NOT for the Ghost_Partition type !!!
    \n-
    Bug:
    This code will most likely not work on grids with more than one element type. Please ask on the mailing list if you need this feature.
    \n-
    Note
    The interface in this file is experimental, and may change without prior notice.
    \n+

    Utility class for hierarchically searching for an Entity containing a given point.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,70 +2,33 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-globalindexset.hh File Reference\n-Provides a globally unique index for all entities of a distributed Dune grid.\n-More...\n-#include \n-#include \n-#include \n-#include \n-#include \n+hierarchicsearch.hh File Reference\n+Utility class for hierarchically searching for an Entity containing a given\n+point. 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- class \u00a0 Dune::GlobalIndexSet<_GridView_>\n-\u00a0 Calculate globally unique index over all processes in a Dune grid.\n- More...\n-\u00a0\n-struct \u00a0 Dune::GlobalIndexSet<_GridView_>::SubPartitionTypeProvider<_Entity,\n- Codim_>\n-\u00a0 Helper class to provide access to subentity PartitionTypes with a run-\n- time codimension. More...\n-\u00a0\n-struct \u00a0 Dune::GlobalIndexSet<_GridView_>::SubPartitionTypeProvider<_Entity,_0\n- >\n+class \u00a0 Dune::HierarchicSearch<_Grid,_IS_>\n+\u00a0 Search an IndexSet for an Entity containing a given point. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-Provides a globally unique index for all entities of a distributed Dune grid.\n-Such functionality is relevant for a number of applications:\n- * Map a degree of freedom associated with an entity to its location in a\n- global matrix or global vector\n- * Such indices for elements are needed as input to external mesh\n- partitioners\n- * Using matrix and vector routines from the PETSc or trilinos parallel\n- linear algebra packages for distributed memory parallel computers.\n-Method: (1) The UniqueEntityPartition class assigns an owner process to each\n-entity\n- (2) Compute the number of entities that are owned by each process\n-\n- (3) we communicate the index of entities that are owned by the process to\n-processes\n- that also contain these entities but do not own them, so that on a non-\n-owner process\n- we have information on the index of the entity that it got from the\n-owner-process;\n- Author\n- Benedikt Oswald, Patrick Leidenberger, Oliver Sander\n- Attention\n- globally unique indices are ONLY provided for entities of the\n- InteriorBorder_Partition type, NOT for the Ghost_Partition type !!!\n- Bug:\n- This code will most likely not work on grids with more than one element\n- type. Please ask on the mailing list if you need this feature.\n- Note\n- The interface in this file is experimental, and may change without prior\n- notice.\n+Utility class for hierarchically searching for an Entity containing a given\n+point.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00995_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00995_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: globalindexset.hh Source File\n+dune-grid: hierarchicsearch.hh Source File\n \n \n \n \n \n \n \n@@ -74,480 +74,184 @@\n \n
    \n \n
    \n
    \n
    \n-
    globalindexset.hh
    \n+
    hierarchicsearch.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5
    \n-
    35#ifndef DUNE_GRID_UTILITY_GLOBALINDEXSET_HH
    \n-
    36#define DUNE_GRID_UTILITY_GLOBALINDEXSET_HH
    \n-
    37
    \n-
    39#include <vector>
    \n-
    40#include <iostream>
    \n-
    41#include <fstream>
    \n-
    42#include <memory>
    \n-
    43#include <map>
    \n-
    44#include <utility>
    \n-
    45#include <algorithm>
    \n-
    46
    \n-\n-\n+
    6#ifndef DUNE_GRID_HIERARCHICSEARCH_HH
    \n+
    7#define DUNE_GRID_HIERARCHICSEARCH_HH
    \n+
    8
    \n+
    15#include <cstddef>
    \n+
    16#include <sstream>
    \n+
    17#include <string>
    \n+
    18#include <utility>
    \n+
    19
    \n+
    20#include <dune/common/classname.hh>
    \n+
    21#include <dune/common/exceptions.hh>
    \n+
    22#include <dune/common/fvector.hh>
    \n+
    23
    \n+\n+\n+
    26
    \n+
    27namespace Dune
    \n+
    28{
    \n+
    29
    \n+
    33 template<class Grid, class IS>
    \n+
    \n+\n+
    35 {
    \n+
    37 constexpr static int dim = Grid::dimension;
    \n+
    38
    \n+
    40 constexpr static int dimw = Grid::dimensionworld;
    \n+
    41
    \n+
    43 typedef typename Grid::ctype ct;
    \n+
    44
    \n+
    46 typedef typename Grid::template Codim<0>::Entity Entity;
    \n+
    47
    \n+
    49 typedef typename Grid::HierarchicIterator HierarchicIterator;
    \n
    50
    \n-
    52#if HAVE_MPI
    \n-
    53 #include <dune/common/parallel/mpihelper.hh>
    \n-
    54#endif
    \n-
    55
    \n-
    56namespace Dune
    \n-
    57{
    \n-
    58
    \n-
    61 template<class GridView>
    \n-
    \n-\n-
    63 {
    \n-
    64 public:
    \n-
    66 typedef int Index;
    \n-
    67
    \n-
    73 template <class Entity, int Codim>
    \n-
    \n-\n-
    75 {
    \n-
    \n-
    78 static PartitionType get(const Entity& entity, int codim, int i)
    \n-
    79 {
    \n-
    80 if (codim==Codim)
    \n-
    81 return entity.template subEntity<Codim>(i).partitionType();
    \n-
    82 else
    \n-
    83 return SubPartitionTypeProvider<Entity,Codim-1>::get(entity, codim, i);
    \n-
    84 }
    \n-
    \n-
    85 };
    \n-
    \n-
    86
    \n-
    87 template <class Entity>
    \n-
    \n-\n-
    89 {
    \n-
    \n-
    90 static PartitionType get(const Entity& entity, int /*codim*/, int i)
    \n-
    91 {
    \n-
    92 return entity.template subEntity<0>(i).partitionType();
    \n-
    93 }
    \n-
    \n-
    94 };
    \n-
    \n-
    95
    \n-
    96 private:
    \n-
    98 typedef typename GridView::Grid Grid;
    \n-
    99
    \n-
    100 typedef typename GridView::Grid::GlobalIdSet GlobalIdSet;
    \n-
    101 typedef typename GridView::Grid::GlobalIdSet::IdType IdType;
    \n-
    102 typedef typename GridView::Traits::template Codim<0>::Iterator Iterator;
    \n-
    103
    \n-
    104 typedef typename Grid::Communication Communication;
    \n-
    105
    \n-
    106 typedef std::map<IdType,Index> MapId2Index;
    \n-
    107 typedef std::map<Index,Index> IndexMap;
    \n-
    108
    \n-
    109 /*********************************************************************************************/
    \n-
    110 /* calculate unique partitioning for all entities of a given codim in a given GridView, */
    \n-
    111 /* assuming they all have the same geometry, i.e. codim, type */
    \n-
    112 /*********************************************************************************************/
    \n-
    113 class UniqueEntityPartition
    \n-
    114 {
    \n-
    115 private:
    \n-
    116 /* A DataHandle class to calculate the minimum of a std::vector which is accompanied by an index set */
    \n-
    117 template<class IS, class V> // mapper type and vector type
    \n-
    118 class MinimumExchange
    \n-
    119 : public Dune::CommDataHandleIF<MinimumExchange<IS,V>,typename V::value_type>
    \n-
    120 {
    \n-
    121 public:
    \n-
    123 typedef typename V::value_type DataType;
    \n-
    124
    \n-
    126 bool contains (int /*dim*/, unsigned int codim) const
    \n-
    127 {
    \n-
    128 return codim==indexSetCodim_;
    \n-
    129 }
    \n-
    130
    \n-
    132 bool fixedSize (int /*dim*/, int /*codim*/) const
    \n-
    133 {
    \n-
    134 return true ;
    \n-
    135 }
    \n-
    136
    \n-
    140 template<class EntityType>
    \n-
    141 std::size_t size (EntityType&) const
    \n-
    142 {
    \n-
    143 return 1 ;
    \n-
    144 }
    \n+
    51 static std::string formatEntityInformation ( const Entity &e ) {
    \n+
    52 const typename Entity::Geometry &geo = e.geometry();
    \n+
    53 std::ostringstream info;
    \n+
    54 info << "level=" << e.level() << " "
    \n+
    55 << "partition=" << e.partitionType() << " "
    \n+
    56 << "center=(" << geo.center() << ") "
    \n+
    57 << "corners=[(" << geo.corner(0) << ")";
    \n+
    58 for(int i = 1; i < geo.corners(); ++i)
    \n+
    59 info << " (" << e.geometry().corner(i) << ")";
    \n+
    60 info << "]";
    \n+
    61 return info.str();
    \n+
    62 }
    \n+
    63
    \n+
    74 Entity hFindEntity ( const Entity &entity,
    \n+
    75 const FieldVector<ct,dimw>& global) const
    \n+
    76 {
    \n+
    77 // type of element geometry
    \n+
    78 typedef typename Entity::Geometry Geometry;
    \n+
    79 // type of local coordinate
    \n+
    80 typedef typename Geometry::LocalCoordinate LocalCoordinate;
    \n+
    81
    \n+
    82 const int childLevel = entity.level()+1 ;
    \n+
    83 // loop over all child Entities
    \n+
    84 const HierarchicIterator end = entity.hend( childLevel );
    \n+
    85 for( HierarchicIterator it = entity.hbegin( childLevel ); it != end; ++it )
    \n+
    86 {
    \n+
    87 Entity child = *it;
    \n+
    88 Geometry geo = child.geometry();
    \n+
    89
    \n+
    90 LocalCoordinate local = geo.local(global);
    \n+
    91 if (referenceElement( geo ).checkInside(local))
    \n+
    92 {
    \n+
    93 // return if we found the leaf, else search through the child entities
    \n+
    94 if( indexSet_.contains( child ) )
    \n+
    95 return child;
    \n+
    96 else
    \n+
    97 return hFindEntity( child, global );
    \n+
    98 }
    \n+
    99 }
    \n+
    100 std::ostringstream children;
    \n+
    101 HierarchicIterator it = entity.hbegin( childLevel );
    \n+
    102 if(it != end) {
    \n+
    103 children << "{" << formatEntityInformation(*it) << "}";
    \n+
    104 for( ++it; it != end; ++it )
    \n+
    105 children << " {" << formatEntityInformation(*it) << "}";
    \n+
    106 }
    \n+
    107 DUNE_THROW(Exception, "{" << className(*this) << "} Unexpected "
    \n+
    108 "internal Error: none of the children of the entity "
    \n+
    109 "{" << formatEntityInformation(entity) << "} contains "
    \n+
    110 "coordinate (" << global << "). Children are: "
    \n+
    111 "[" << children.str() << "].");
    \n+
    112 }
    \n+
    113
    \n+
    114 public:
    \n+
    118 HierarchicSearch(const Grid & g, const IS & is) : grid_(g), indexSet_(is) {}
    \n+
    119
    \n+
    \n+
    127 Entity findEntity(const FieldVector<ct,dimw>& global) const
    \n+
    128 { return findEntity<All_Partition>(global); }
    \n+
    \n+
    129
    \n+
    137 template<PartitionIteratorType partition>
    \n+
    \n+
    138 Entity findEntity(const FieldVector<ct,dimw>& global) const
    \n+
    139 {
    \n+
    140 typedef typename Grid::LevelGridView LevelGV;
    \n+
    141 const LevelGV &gv = grid_.levelGridView(0);
    \n+
    142
    \n+
    144 typedef typename LevelGV::template Codim<0>::template Partition<partition>::Iterator LevelIterator;
    \n
    145
    \n-
    147 template<class MessageBuffer, class EntityType>
    \n-
    148 void gather (MessageBuffer& buff, const EntityType& e) const
    \n-
    149 {
    \n-
    150 buff.write(v_[indexset_.index(e)]);
    \n-
    151 }
    \n-
    152
    \n-
    157 template<class MessageBuffer, class EntityType>
    \n-
    158 void scatter (MessageBuffer& buff, const EntityType& e, std::size_t)
    \n-
    159 {
    \n-
    160 DataType x;
    \n-
    161 buff.read(x);
    \n-
    162 if (x>=0) // other is -1 means, he does not want it
    \n-
    163 v_[indexset_.index(e)] = std::min(x,v_[indexset_.index(e)]);
    \n-
    164 }
    \n-
    165
    \n-
    167 MinimumExchange (const IS& indexset, V& v, unsigned int indexSetCodim)
    \n-
    168 : indexset_(indexset),
    \n-
    169 v_(v),
    \n-
    170 indexSetCodim_(indexSetCodim)
    \n-
    171 {}
    \n-
    172
    \n-
    173 private:
    \n-
    174 const IS& indexset_;
    \n-
    175 V& v_;
    \n-
    176 unsigned int indexSetCodim_;
    \n-
    177 };
    \n-
    178
    \n-
    179 public:
    \n-
    182 UniqueEntityPartition (const GridView& gridview, unsigned int codim)
    \n-
    183 : assignment_(gridview.size(codim))
    \n-
    184 {
    \n-
    186 typedef typename GridView::IndexSet IndexSet;
    \n-
    187
    \n-
    188 // assign own rank to entities that I might have
    \n-
    189 for (auto it = gridview.template begin<0>(); it!=gridview.template end<0>(); ++it)
    \n-
    190 for (unsigned int i=0; i<it->subEntities(codim); i++)
    \n-
    191 {
    \n-
    192 // Evil hack: I need to call subEntity, which needs the entity codimension as a static parameter.
    \n-
    193 // However, we only have it as a run-time parameter.
    \n-
    194 PartitionType subPartitionType = SubPartitionTypeProvider<typename GridView::template Codim<0>::Entity, GridView::dimension>::get(*it,codim,i);
    \n-
    195
    \n-
    196 assignment_[gridview.indexSet().subIndex(*it,i,codim)]
    \n-
    197 = ( subPartitionType==Dune::InteriorEntity or subPartitionType==Dune::BorderEntity )
    \n-
    198 ? gridview.comm().rank() // set to own rank
    \n-
    199 : - 1; // it is a ghost entity, I will not possibly own it.
    \n-
    200 }
    \n-
    201
    \n-
    203 MinimumExchange<IndexSet,std::vector<Index> > dh(gridview.indexSet(),assignment_,codim);
    \n-
    204
    \n-\n-
    206 }
    \n-
    207
    \n-
    209 int owner(std::size_t i)
    \n-
    210 {
    \n-
    211 return assignment_[i];
    \n-
    212 }
    \n-
    213
    \n-
    215 std::size_t numOwners(int rank) const
    \n-
    216 {
    \n-
    217 return std::count(assignment_.begin(), assignment_.end(), rank);
    \n-
    218 }
    \n-
    219
    \n-
    220 private:
    \n-
    221 std::vector<int> assignment_;
    \n-
    222 };
    \n-
    223
    \n-
    224 private:
    \n-
    225 /* A DataHandle class to communicate the global index from the
    \n-
    226 * owning to the non-owning entity; the class is based on the MinimumExchange
    \n-
    227 * class in the parallelsolver.hh header file.
    \n-
    228 */
    \n-
    229 class IndexExchange
    \n-
    230 : public Dune::CommDataHandleIF<IndexExchange,Index>
    \n-
    231 {
    \n-
    232 public:
    \n-
    234 bool contains (int /*dim*/, unsigned int codim) const
    \n-
    235 {
    \n-
    236 return codim==indexSetCodim_;
    \n-
    237 }
    \n-
    238
    \n-
    240 bool fixedSize (int /*dim*/, int /*codim*/) const
    \n-
    241 {
    \n-
    242 return true;
    \n-
    243 }
    \n-
    244
    \n-
    249 template<class EntityType>
    \n-
    250 std::size_t size (EntityType&) const
    \n-
    251 {
    \n-
    252 return 1;
    \n-
    253 }
    \n-
    254
    \n-
    256 template<class MessageBuffer, class EntityType>
    \n-
    257 void gather (MessageBuffer& buff, const EntityType& e) const
    \n-
    258 {
    \n-
    259 IdType id=globalidset_.id(e);
    \n-
    260
    \n-
    261 if (indexSetCodim_==0)
    \n-
    262 buff.write(mapid2entity_[id]);
    \n-
    263 else
    \n-
    264 buff.write((*mapid2entity_.find(id)).second);
    \n-
    265 }
    \n-
    266
    \n-
    271 template<class MessageBuffer, class EntityType>
    \n-
    272 void scatter (MessageBuffer& buff, const EntityType& entity, std::size_t)
    \n-
    273 {
    \n-
    274 Index x;
    \n-
    275 buff.read(x);
    \n-
    276
    \n-
    284 if(x >= 0) {
    \n-
    285 const IdType id = globalidset_.id(entity);
    \n-
    286
    \n-
    287 if (indexSetCodim_==0)
    \n-
    288 mapid2entity_[id] = x;
    \n-
    289 else
    \n-
    290 {
    \n-
    291 mapid2entity_.erase(id);
    \n-
    292 mapid2entity_.insert(std::make_pair(id,x));
    \n-
    293
    \n-
    294 const Index lindex = indexSet_.index(entity);
    \n-
    295 localGlobalMap_[lindex] = x;
    \n-
    296 }
    \n-
    297 }
    \n-
    298 }
    \n-
    299
    \n-
    301 IndexExchange (const GlobalIdSet& globalidset, MapId2Index& mapid2entity,
    \n-
    302 const typename GridView::IndexSet& localIndexSet, IndexMap& localGlobal,
    \n-
    303 unsigned int indexSetCodim)
    \n-
    304 : globalidset_(globalidset),
    \n-
    305 mapid2entity_(mapid2entity),
    \n-
    306 indexSet_(localIndexSet),
    \n-
    307 localGlobalMap_(localGlobal),
    \n-
    308 indexSetCodim_(indexSetCodim)
    \n-
    309 {}
    \n-
    310
    \n-
    311 private:
    \n-
    312 const GlobalIdSet& globalidset_;
    \n-
    313 MapId2Index& mapid2entity_;
    \n-
    314
    \n-
    315 const typename GridView::IndexSet& indexSet_;
    \n-
    316 IndexMap& localGlobalMap_;
    \n-
    317 unsigned int indexSetCodim_;
    \n-
    318 };
    \n-
    319
    \n-
    320 public:
    \n-
    \n-
    326 GlobalIndexSet(const GridView& gridview, int codim)
    \n-
    327 : gridview_(gridview),
    \n-
    328 codim_(codim)
    \n-
    329 {
    \n-
    330 int rank = gridview.comm().rank();
    \n-
    331 int size = gridview.comm().size();
    \n-
    332
    \n-
    333 const typename GridView::IndexSet& indexSet = gridview.indexSet();
    \n-
    334
    \n-
    335 std::unique_ptr<UniqueEntityPartition> uniqueEntityPartition;
    \n-
    336 if (codim_!=0)
    \n-
    337 uniqueEntityPartition = std::make_unique<UniqueEntityPartition>(gridview,codim_);
    \n-
    338
    \n-
    339 int nLocalEntity = (codim_==0)
    \n-
    340 ? std::distance(gridview.template begin<0, Dune::Interior_Partition>(), gridview.template end<0, Dune::Interior_Partition>())
    \n-
    341 : uniqueEntityPartition->numOwners(rank);
    \n-
    342
    \n-
    343 // Compute the global, non-redundant number of entities, i.e. the number of entities in the set
    \n-
    344 // without double, aka. redundant entities, on the interprocessor boundary via global reduce. */
    \n-
    345 nGlobalEntity_ = gridview.comm().template sum<int>(nLocalEntity);
    \n-
    346
    \n-
    347 /* communicate the number of locally owned entities to all other processes so that the respective offset
    \n-
    348 * can be calculated on the respective processor; we use the Dune mpi communication facility
    \n-
    349 * for this; first, we gather the number of locally owned entities on the root process and, second, we
    \n-
    350 * broadcast the array to all processes where the respective offset can be calculated. */
    \n-
    351
    \n-
    352 std::vector<int> offset(size);
    \n-
    353 std::fill(offset.begin(), offset.end(), 0);
    \n-
    354
    \n-
    356 gridview_.comm().template allgather<int>(&nLocalEntity, 1, offset.data());
    \n-
    357
    \n-
    358 int myoffset = 0;
    \n-
    359 for (int i=1; i<rank+1; i++)
    \n-
    360 myoffset += offset[i-1];
    \n-
    361
    \n-
    362 /* compute globally unique index over all processes; the idea of the algorithm is as follows: if
    \n-
    363 * an entity is owned by the process, it is assigned an index that is the addition of the offset
    \n-
    364 * specific for this process and a consecutively incremented counter; if the entity is not owned
    \n-
    365 * by the process, it is assigned -1, which signals that this specific entity will get its global
    \n-
    366 * unique index through communication afterwards;
    \n-
    367 *
    \n-
    368 * thus, the calculation of the globally unique index is divided into 2 stages:
    \n-
    369 *
    \n-
    370 * (1) we calculate the global index independently;
    \n-
    371 *
    \n-
    372 * (2) we achieve parallel adjustment by communicating the index
    \n-
    373 * from the owning entity to the non-owning entity.
    \n-
    374 *
    \n-
    375 */
    \n-
    376
    \n-
    377 // 1st stage of global index calculation: calculate global index for owned entities
    \n-
    378 // initialize map that stores an entity's global index via it's globally unique id as key
    \n-
    379 globalIndex_.clear();
    \n-
    380
    \n-
    381 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();
    \n-
    383 Index globalcontrib = 0;
    \n-
    385 if (codim_==0) // This case is simpler
    \n-
    386 {
    \n-
    387 for (Iterator iter = gridview_.template begin<0>(); iter!=gridview_.template end<0>(); ++iter)
    \n-
    388 {
    \n-
    389 const IdType id = globalIdSet.id(*iter);
    \n-
    392 if (iter->partitionType() == Dune::InteriorEntity)
    \n-
    393 {
    \n-
    394 const Index gindex = myoffset + globalcontrib;
    \n-
    396 globalIndex_[id] = gindex;
    \n-
    397 globalcontrib++;
    \n-
    398 }
    \n-
    399
    \n-
    401 else
    \n-
    402 {
    \n-
    403 globalIndex_[id] = -1;
    \n-
    404 }
    \n-
    405 }
    \n-
    406 }
    \n-
    407 else // if (codim==0) else
    \n-
    408 {
    \n-
    409 std::vector<bool> firstTime(gridview_.size(codim_));
    \n-
    410 std::fill(firstTime.begin(), firstTime.end(), true);
    \n-
    411
    \n-
    412 for(Iterator iter = gridview_.template begin<0>();iter!=gridview_.template end<0>(); ++iter)
    \n-
    413 {
    \n-
    414 for (std::size_t i=0; i<iter->subEntities(codim_); i++)
    \n-
    415 {
    \n-
    416 IdType id=globalIdSet.subId(*iter,i,codim_);
    \n-
    417
    \n-
    418 Index idx = gridview_.indexSet().subIndex(*iter,i,codim_);
    \n-
    419
    \n-
    420 if (!firstTime[idx] )
    \n-
    421 continue;
    \n-
    422
    \n-
    423 firstTime[idx] = false;
    \n-
    424
    \n-
    425 if (uniqueEntityPartition->owner(idx) == rank)
    \n-
    426 {
    \n-
    427 const Index gindex = myoffset + globalcontrib;
    \n-
    428 globalIndex_.insert(std::make_pair(id,gindex));
    \n-
    430 const Index lindex = idx;
    \n-
    431 localGlobalMap_[lindex] = gindex;
    \n-
    432
    \n-
    433 globalcontrib++;
    \n-
    434 }
    \n-
    435 else
    \n-
    436 {
    \n-
    437 globalIndex_.insert(std::make_pair(id,-1));
    \n-
    438 }
    \n-
    439 }
    \n-
    440
    \n-
    441 }
    \n-
    442 }
    \n-
    443
    \n-
    444 // 2nd stage of global index calculation: communicate global index for non-owned entities
    \n-
    445
    \n-
    446 // Create the data handle and communicate.
    \n-
    447 IndexExchange dataHandle(globalIdSet,globalIndex_,indexSet,localGlobalMap_,codim_);
    \n-\n-
    449 }
    \n+
    146 // type of element geometry
    \n+
    147 typedef typename Entity::Geometry Geometry;
    \n+
    148 // type of local coordinate
    \n+
    149 typedef typename Geometry::LocalCoordinate LocalCoordinate;
    \n+
    150
    \n+
    151 // loop over macro level
    \n+
    152 const LevelIterator end = gv.template end<0, partition>();
    \n+
    153 for (LevelIterator it = gv.template begin<0, partition>(); it != end; ++it)
    \n+
    154 {
    \n+
    155 Entity entity = *it;
    \n+
    156 Geometry geo = entity.geometry();
    \n+
    157
    \n+
    158 LocalCoordinate local = geo.local( global );
    \n+
    159 if( !referenceElement( geo ).checkInside( local ) )
    \n+
    160 continue;
    \n+
    161
    \n+
    162 if( (int(dim) != int(dimw)) && ((geo.global( local ) - global).two_norm() > 1e-8) )
    \n+
    163 continue;
    \n+
    164
    \n+
    165 // return if we found the leaf, else search through the child entities
    \n+
    166 if( indexSet_.contains( entity ) )
    \n+
    167 return entity;
    \n+
    168 else
    \n+
    169 return hFindEntity( entity, global );
    \n+
    170 }
    \n+
    171 DUNE_THROW( GridError, "Coordinate " << global << " is outside the grid." );
    \n+
    172 }
    \n+
    \n+
    173
    \n+
    174 private:
    \n+
    175 const Grid& grid_;
    \n+
    176 const IS& indexSet_;
    \n+
    177 };
    \n
    \n-
    450
    \n-
    452 template <class Entity>
    \n-
    \n-
    453 Index index(const Entity& entity) const
    \n-
    454 {
    \n-
    455 if (codim_==0)
    \n-
    456 {
    \n-
    458 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();
    \n-
    459 const IdType id = globalIdSet.id(entity);
    \n-
    460 const Index gindex = globalIndex_.find(id)->second;
    \n-
    462 return gindex;
    \n-
    463 }
    \n-
    464 else
    \n-
    465 return localGlobalMap_.find(gridview_.indexSet().index(entity))->second;
    \n-
    466 }
    \n-
    \n-
    467
    \n-
    473 template <class Entity>
    \n-
    \n-
    474 Index subIndex(const Entity& entity, unsigned int i, unsigned int codim) const
    \n-
    475 {
    \n-
    476 if (codim_==0)
    \n-
    477 {
    \n-
    479 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();
    \n-
    480 const IdType id = globalIdSet.subId(entity,i,codim);
    \n-
    481 const Index gindex = globalIndex_.find(id)->second;
    \n-
    483 return gindex;
    \n-
    484 }
    \n-
    485 else
    \n-
    486 return localGlobalMap_.find(gridview_.indexSet().subIndex(entity,i,codim))->second;
    \n-
    487 }
    \n-
    \n-
    488
    \n-
    \n-
    494 unsigned int size(unsigned int codim) const
    \n-
    495 {
    \n-
    496 return (codim_==codim) ? nGlobalEntity_ : 0;
    \n-
    497 }
    \n-
    \n-
    498
    \n-
    499 protected:
    \n-\n-
    501
    \n-
    503 unsigned int codim_;
    \n-
    504
    \n-\n-
    507
    \n-\n-
    509
    \n-
    512 MapId2Index globalIndex_;
    \n-
    513 };
    \n-
    \n-
    514
    \n-
    515} // namespace Dune
    \n-
    516
    \n-
    517#endif /* DUNE_GRID_UTILITY_GLOBALINDEXSET_HH */
    \n-\n-
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n-
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n-
    @ ForwardCommunication
    communicate as given in InterfaceType
    Definition gridenums.hh:171
    \n-
    @ All_All_Interface
    send all and receive all entities
    Definition gridenums.hh:91
    \n-
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n-
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n-
    const Grid & grid() const
    obtain a const reference to the underlying hierarchic grid
    Definition common/gridview.hh:166
    \n-
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n-
    int size(int codim) const
    obtain number of entities in a given codimension
    Definition common/gridview.hh:183
    \n-
    auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
    Communicate data on this view.
    Definition common/gridview.hh:292
    \n-
    const Communication & comm() const
    obtain communication object
    Definition common/gridview.hh:273
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    178
    \n+
    179} // end namespace Dune
    \n+
    180
    \n+
    181#endif // DUNE_GRID_HIERARCHICSEARCH_HH
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
    Definition datahandleif.hh:78
    \n-
    void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
    unpack data from message buffer to user.
    Definition datahandleif.hh:143
    \n-
    bool contains(int dim, int codim) const
    returns true if data for given valid codim should be communicated
    Definition datahandleif.hh:94
    \n-
    size_t size(const EntityType &e) const
    how many objects of type DataType have to be sent for a given entity
    Definition datahandleif.hh:118
    \n-
    void gather(MessageBufferImp &buff, const EntityType &e) const
    pack data from user to message buffer
    Definition datahandleif.hh:129
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    PartitionType partitionType() const
    Partition type of this entity.
    Definition common/entity.hh:127
    \n+
    auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
    Definition common/geometry.hh:558
    \n+
    GridImp::template Codim< cd >::Geometry Geometry
    The corresponding geometry type.
    Definition common/entity.hh:100
    \n+
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n+
    Wrapper class for geometries.
    Definition common/geometry.hh:71
    \n+
    GlobalCoordinate global(const LocalCoordinate &local) const
    Evaluate the map .
    Definition common/geometry.hh:228
    \n+
    FieldVector< ctype, mydim > LocalCoordinate
    type of local coordinates
    Definition common/geometry.hh:103
    \n+
    LocalCoordinate local(const GlobalCoordinate &global) const
    Evaluate the inverse map .
    Definition common/geometry.hh:237
    \n
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    typename GridFamily::Traits::Communication Communication
    A type that is a model of Dune::Communication. It provides a portable way for communication on the se...
    Definition common/grid.hh:515
    \n-
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n-
    Calculate globally unique index over all processes in a Dune grid.
    Definition globalindexset.hh:63
    \n-
    Index subIndex(const Entity &entity, unsigned int i, unsigned int codim) const
    Return the global index of a subentity of a given entity.
    Definition globalindexset.hh:474
    \n-
    MapId2Index globalIndex_
    Stores global index of entities with entity's globally unique id as key.
    Definition globalindexset.hh:512
    \n-
    int Index
    The number type used for global indices
    Definition globalindexset.hh:66
    \n-
    int nGlobalEntity_
    Global number of entities, i.e. number of entities without rendundant entities on interprocessor boun...
    Definition globalindexset.hh:506
    \n-
    Index index(const Entity &entity) const
    Return the global index of a given entity.
    Definition globalindexset.hh:453
    \n-
    unsigned int codim_
    Codimension of the entities that we hold indices for.
    Definition globalindexset.hh:503
    \n-
    IndexMap localGlobalMap_
    Definition globalindexset.hh:508
    \n-
    unsigned int size(unsigned int codim) const
    Return the total number of entities over all processes that we have indices for.
    Definition globalindexset.hh:494
    \n-
    GlobalIndexSet(const GridView &gridview, int codim)
    Constructor for a given GridView.
    Definition globalindexset.hh:326
    \n-
    const GridView gridview_
    Definition globalindexset.hh:500
    \n-
    Helper class to provide access to subentity PartitionTypes with a run-time codimension.
    Definition globalindexset.hh:75
    \n-
    static PartitionType get(const Entity &entity, int codim, int i)
    Get PartitionType of the i-th subentity of codimension 'codim' of entity 'entity'.
    Definition globalindexset.hh:78
    \n-
    static PartitionType get(const Entity &entity, int, int i)
    Definition globalindexset.hh:90
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    GridFamily::Traits::HierarchicIterator HierarchicIterator
    A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
    Definition common/grid.hh:482
    \n+
    GridFamily::Traits::LevelGridView LevelGridView
    type of view for level grid
    Definition common/grid.hh:402
    \n+
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n+
    LevelGridView levelGridView(int level) const
    View for a grid level for All_Partition.
    Definition common/grid.hh:584
    \n+
    ct ctype
    Define type used for coordinates in grid module.
    Definition common/grid.hh:518
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    Search an IndexSet for an Entity containing a given point.
    Definition hierarchicsearch.hh:35
    \n+
    Entity findEntity(const FieldVector< ct, dimw > &global) const
    Search the IndexSet of this HierarchicSearch for an Entity containing point global.
    Definition hierarchicsearch.hh:127
    \n+
    Entity findEntity(const FieldVector< ct, dimw > &global) const
    Search the IndexSet of this HierarchicSearch for an Entity containing point global.
    Definition hierarchicsearch.hh:138
    \n+
    HierarchicSearch(const Grid &g, const IS &is)
    Construct a HierarchicSearch object from a Grid and an IndexSet.
    Definition hierarchicsearch.hh:118
    \n+
    Different resources needed by all grid implementations.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,604 +1,235 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-globalindexset.hh\n+hierarchicsearch.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n 5\n-35#ifndef DUNE_GRID_UTILITY_GLOBALINDEXSET_HH\n-36#define DUNE_GRID_UTILITY_GLOBALINDEXSET_HH\n-37\n-39#include \n-40#include \n-41#include \n-42#include \n-43#include \n-44#include \n-45#include \n-46\n-48#include \n-49#include \n+6#ifndef DUNE_GRID_HIERARCHICSEARCH_HH\n+7#define DUNE_GRID_HIERARCHICSEARCH_HH\n+8\n+15#include \n+16#include \n+17#include \n+18#include \n+19\n+20#include \n+21#include \n+22#include \n+23\n+24#include \n+25#include \n+26\n+27namespace Dune\n+28{\n+29\n+33 template\n+34 class HierarchicSearch\n+35 {\n+37 constexpr static int dim = Grid::dimension;\n+38\n+40 constexpr static int dimw = Grid::dimensionworld;\n+41\n+43 typedef typename Grid::ctype ct;\n+44\n+46 typedef typename Grid::template Codim<0>::Entity Entity;\n+47\n+49 typedef typename Grid::HierarchicIterator HierarchicIterator;\n 50\n-52#if HAVE_MPI\n-53 #include \n-54#endif\n-55\n-56namespace Dune\n-57{\n-58\n-61 template\n-62 class GlobalIndexSet\n-63 {\n-64 public:\n-66 typedef int Index;\n-67\n-73 template \n-74 struct SubPartitionTypeProvider\n-75 {\n-78 static PartitionType get(const Entity& entity, int codim, int i)\n-79 {\n-80 if (codim==Codim)\n-81 return entity.template subEntity(i).partitionType();\n-82 else\n-83 return SubPartitionTypeProvider::get(entity, codim, i);\n-84 }\n-85 };\n-86\n-87 template \n-88 struct SubPartitionTypeProvider\n-89 {\n-90 static PartitionType get(const Entity& entity, int /*codim*/, int i)\n-91 {\n-92 return entity.template subEntity<0>(i).partitionType();\n-93 }\n-94 };\n-95\n-96 private:\n-98 typedef typename GridView::Grid Grid;\n-99\n-100 typedef typename GridView::Grid::GlobalIdSet GlobalIdSet;\n-101 typedef typename GridView::Grid::GlobalIdSet::IdType IdType;\n-102 typedef typename GridView::Traits::template Codim<0>::Iterator Iterator;\n-103\n-104 typedef typename Grid::Communication Communication;\n-105\n-106 typedef std::map MapId2Index;\n-107 typedef std::map IndexMap;\n-108\n-109 /\n-*********************************************************************************************/\n-110 /* calculate unique partitioning for all entities of a given codim in a\n-given GridView, */\n-111 /* assuming they all have the same geometry, i.e. codim, type */\n-112 /\n-*********************************************************************************************/\n-113 class UniqueEntityPartition\n-114 {\n-115 private:\n-116 /* A DataHandle class to calculate the minimum of a std::vector which is\n-accompanied by an index set */\n-117 template // mapper type and vector type\n-118 class MinimumExchange\n-119 : public Dune::CommDataHandleIF,typename V::value_\n-type>\n-120 {\n-121 public:\n-123 typedef typename V::value_type DataType;\n-124\n-126 bool contains (int /*dim*/, unsigned int codim) const\n-127 {\n-128 return codim==indexSetCodim_;\n-129 }\n-130\n-132 bool fixedSize (int /*dim*/, int /*codim*/) const\n-133 {\n-134 return true ;\n-135 }\n-136\n-140 template\n-141 std::size_t size (EntityType&) const\n-142 {\n-143 return 1 ;\n-144 }\n+51 static std::string formatEntityInformation ( const Entity &e ) {\n+52 const typename Entity::Geometry &geo = e.geometry();\n+53 std::ostringstream info;\n+54 info << \"level=\" << e.level() << \" \"\n+55 << \"partition=\" << e.partitionType() << \" \"\n+56 << \"center=(\" << geo.center() << \") \"\n+57 << \"corners=[(\" << geo.corner(0) << \")\";\n+58 for(int i = 1; i < geo.corners(); ++i)\n+59 info << \" (\" << e.geometry().corner(i) << \")\";\n+60 info << \"]\";\n+61 return info.str();\n+62 }\n+63\n+74 Entity hFindEntity ( const Entity &entity,\n+75 const FieldVector& global) const\n+76 {\n+77 // type of element geometry\n+78 typedef typename Entity::Geometry Geometry;\n+79 // type of local coordinate\n+80 typedef typename Geometry::LocalCoordinate LocalCoordinate;\n+81\n+82 const int childLevel = entity.level()+1 ;\n+83 // loop over all child Entities\n+84 const HierarchicIterator end = entity.hend( childLevel );\n+85 for( HierarchicIterator it = entity.hbegin( childLevel ); it != end; ++it )\n+86 {\n+87 Entity child = *it;\n+88 Geometry geo = child.geometry();\n+89\n+90 LocalCoordinate local = geo.local(global);\n+91 if (referenceElement( geo ).checkInside(local))\n+92 {\n+93 // return if we found the leaf, else search through the child entities\n+94 if( indexSet_.contains( child ) )\n+95 return child;\n+96 else\n+97 return hFindEntity( child, global );\n+98 }\n+99 }\n+100 std::ostringstream children;\n+101 HierarchicIterator it = entity.hbegin( childLevel );\n+102 if(it != end) {\n+103 children << \"{\" << formatEntityInformation(*it) << \"}\";\n+104 for( ++it; it != end; ++it )\n+105 children << \" {\" << formatEntityInformation(*it) << \"}\";\n+106 }\n+107 DUNE_THROW(Exception, \"{\" << className(*this) << \"} Unexpected \"\n+108 \"internal Error: none of the children of the entity \"\n+109 \"{\" << formatEntityInformation(entity) << \"} contains \"\n+110 \"coordinate (\" << global << \"). Children are: \"\n+111 \"[\" << children.str() << \"].\");\n+112 }\n+113\n+114 public:\n+118 HierarchicSearch(const Grid & g, const IS & is) : grid_(g), indexSet_(is)\n+{}\n+119\n+127 Entity findEntity(const FieldVector& global) const\n+128 { return findEntity(global); }\n+129\n+137 template\n+138 Entity findEntity(const FieldVector& global) const\n+139 {\n+140 typedef typename Grid::LevelGridView LevelGV;\n+141 const LevelGV &gv = grid_.levelGridView(0);\n+142\n+144 typedef typename LevelGV::template Codim<0>::template\n+Partition::Iterator LevelIterator;\n 145\n-147 template\n-148 void gather (MessageBuffer& buff, const EntityType& e) const\n-149 {\n-150 buff.write(v_[indexset_.index(e)]);\n-151 }\n-152\n-157 template\n-158 void scatter (MessageBuffer& buff, const EntityType& e, std::size_t)\n-159 {\n-160 DataType x;\n-161 buff.read(x);\n-162 if (x>=0) // other is -1 means, he does not want it\n-163 v_[indexset_.index(e)] = std::min(x,v_[indexset_.index(e)]);\n-164 }\n-165\n-167 MinimumExchange (const IS& indexset, V& v, unsigned int indexSetCodim)\n-168 : indexset_(indexset),\n-169 v_(v),\n-170 indexSetCodim_(indexSetCodim)\n-171 {}\n-172\n-173 private:\n-174 const IS& indexset_;\n-175 V& v_;\n-176 unsigned int indexSetCodim_;\n+146 // type of element geometry\n+147 typedef typename Entity::Geometry Geometry;\n+148 // type of local coordinate\n+149 typedef typename Geometry::LocalCoordinate LocalCoordinate;\n+150\n+151 // loop over macro level\n+152 const LevelIterator end = gv.template end<0, partition>();\n+153 for (LevelIterator it = gv.template begin<0, partition>(); it != end; ++it)\n+154 {\n+155 Entity entity = *it;\n+156 Geometry geo = entity.geometry();\n+157\n+158 LocalCoordinate local = geo.local( global );\n+159 if( !referenceElement( geo ).checkInside( local ) )\n+160 continue;\n+161\n+162 if( (int(dim) != int(dimw)) && ((geo.global( local ) - global).two_norm() >\n+1e-8) )\n+163 continue;\n+164\n+165 // return if we found the leaf, else search through the child entities\n+166 if( indexSet_.contains( entity ) )\n+167 return entity;\n+168 else\n+169 return hFindEntity( entity, global );\n+170 }\n+171 DUNE_THROW( GridError, \"Coordinate \" << global << \" is outside the grid.\"\n+);\n+172 }\n+173\n+174 private:\n+175 const Grid& grid_;\n+176 const IS& indexSet_;\n 177 };\n 178\n-179 public:\n-182 UniqueEntityPartition (const GridView& gridview, unsigned int codim)\n-183 : assignment_(gridview.size(codim))\n-184 {\n-186 typedef typename GridView::IndexSet IndexSet;\n-187\n-188 // assign own rank to entities that I might have\n-189 for (auto it = gridview.template begin<0>(); it!=gridview.template end<0>\n-(); ++it)\n-190 for (unsigned int i=0; isubEntities(codim); i++)\n-191 {\n-192 // Evil hack: I need to call subEntity, which needs the entity codimension\n-as a static parameter.\n-193 // However, we only have it as a run-time parameter.\n-194 PartitionType subPartitionType = SubPartitionTypeProvider::Entity, GridView::dimension>::get(*it,codim,i);\n-195\n-196 assignment_[gridview.indexSet().subIndex(*it,i,codim)]\n-197 = ( subPartitionType==Dune::InteriorEntity or subPartitionType==Dune::\n-BorderEntity )\n-198 ? gridview.comm().rank() // set to own rank\n-199 : - 1; // it is a ghost entity, I will not possibly own it.\n-200 }\n-201\n-203 MinimumExchange > dh(gridview.indexSet\n-(),assignment_,codim);\n-204\n-205 gridview.communicate(dh,Dune::All_All_Interface,Dune::\n-ForwardCommunication);\n-206 }\n-207\n-209 int owner(std::size_t i)\n-210 {\n-211 return assignment_[i];\n-212 }\n-213\n-215 std::size_t numOwners(int rank) const\n-216 {\n-217 return std::count(assignment_.begin(), assignment_.end(), rank);\n-218 }\n-219\n-220 private:\n-221 std::vector assignment_;\n-222 };\n-223\n-224 private:\n-225 /* A DataHandle class to communicate the global index from the\n-226 * owning to the non-owning entity; the class is based on the\n-MinimumExchange\n-227 * class in the parallelsolver.hh header file.\n-228 */\n-229 class IndexExchange\n-230 : public Dune::CommDataHandleIF\n-231 {\n-232 public:\n-234 bool contains (int /*dim*/, unsigned int codim) const\n-235 {\n-236 return codim==indexSetCodim_;\n-237 }\n-238\n-240 bool fixedSize (int /*dim*/, int /*codim*/) const\n-241 {\n-242 return true;\n-243 }\n-244\n-249 template\n-250 std::size_t size (EntityType&) const\n-251 {\n-252 return 1;\n-253 }\n-254\n-256 template\n-257 void gather (MessageBuffer& buff, const EntityType& e) const\n-258 {\n-259 IdType id=globalidset_.id(e);\n-260\n-261 if (indexSetCodim_==0)\n-262 buff.write(mapid2entity_[id]);\n-263 else\n-264 buff.write((*mapid2entity_.find(id)).second);\n-265 }\n-266\n-271 template\n-272 void scatter (MessageBuffer& buff, const EntityType& entity, std::size_t)\n-273 {\n-274 Index x;\n-275 buff.read(x);\n-276\n-284 if(x >= 0) {\n-285 const IdType id = globalidset_.id(entity);\n-286\n-287 if (indexSetCodim_==0)\n-288 mapid2entity_[id] = x;\n-289 else\n-290 {\n-291 mapid2entity_.erase(id);\n-292 mapid2entity_.insert(std::make_pair(id,x));\n-293\n-294 const Index lindex = indexSet_.index(entity);\n-295 localGlobalMap_[lindex] = x;\n-296 }\n-297 }\n-298 }\n-299\n-301 IndexExchange (const GlobalIdSet& globalidset, MapId2Index& mapid2entity,\n-302 const typename GridView::IndexSet& localIndexSet, IndexMap& localGlobal,\n-303 unsigned int indexSetCodim)\n-304 : globalidset_(globalidset),\n-305 mapid2entity_(mapid2entity),\n-306 indexSet_(localIndexSet),\n-307 localGlobalMap_(localGlobal),\n-308 indexSetCodim_(indexSetCodim)\n-309 {}\n-310\n-311 private:\n-312 const GlobalIdSet& globalidset_;\n-313 MapId2Index& mapid2entity_;\n-314\n-315 const typename GridView::IndexSet& indexSet_;\n-316 IndexMap& localGlobalMap_;\n-317 unsigned int indexSetCodim_;\n-318 };\n-319\n-320 public:\n-326 GlobalIndexSet(const GridView& gridview, int codim)\n-327 : gridview_(gridview),\n-328 codim_(codim)\n-329 {\n-330 int rank = gridview.comm().rank();\n-331 int size = gridview.comm().size();\n-332\n-333 const typename GridView::IndexSet& indexSet = gridview.indexSet();\n-334\n-335 std::unique_ptr uniqueEntityPartition;\n-336 if (codim_!=0)\n-337 uniqueEntityPartition = std::make_unique\n-(gridview,codim_);\n-338\n-339 int nLocalEntity = (codim_==0)\n-340 ? std::distance(gridview.template begin<0, Dune::Interior_Partition>(),\n-gridview.template end<0, Dune::Interior_Partition>())\n-341 : uniqueEntityPartition->numOwners(rank);\n-342\n-343 // Compute the global, non-redundant number of entities, i.e. the number of\n-entities in the set\n-344 // without double, aka. redundant entities, on the interprocessor boundary\n-via global reduce. */\n-345 nGlobalEntity_ = gridview.comm().template sum(nLocalEntity);\n-346\n-347 /* communicate the number of locally owned entities to all other processes\n-so that the respective offset\n-348 * can be calculated on the respective processor; we use the Dune mpi\n-communication facility\n-349 * for this; first, we gather the number of locally owned entities on the\n-root process and, second, we\n-350 * broadcast the array to all processes where the respective offset can be\n-calculated. */\n-351\n-352 std::vector offset(size);\n-353 std::fill(offset.begin(), offset.end(), 0);\n-354\n-356 gridview_.comm().template allgather(&nLocalEntity, 1, offset.data());\n-357\n-358 int myoffset = 0;\n-359 for (int i=1; i();\n-iter!=gridview_.template end<0>(); ++iter)\n-388 {\n-389 const IdType id = globalIdSet.id(*iter);\n-392 if (iter->partitionType() == Dune::InteriorEntity)\n-393 {\n-394 const Index gindex = myoffset + globalcontrib;\n-396 globalIndex_[id] = gindex;\n-397 globalcontrib++;\n-398 }\n-399\n-401 else\n-402 {\n-403 globalIndex_[id] = -1;\n-404 }\n-405 }\n-406 }\n-407 else // if (codim==0) else\n-408 {\n-409 std::vector firstTime(gridview_.size(codim_));\n-410 std::fill(firstTime.begin(), firstTime.end(), true);\n-411\n-412 for(Iterator iter = gridview_.template begin<0>();iter!=gridview_.template\n-end<0>(); ++iter)\n-413 {\n-414 for (std::size_t i=0; isubEntities(codim_); i++)\n-415 {\n-416 IdType id=globalIdSet.subId(*iter,i,codim_);\n-417\n-418 Index idx = gridview_.indexSet().subIndex(*iter,i,codim_);\n-419\n-420 if (!firstTime[idx] )\n-421 continue;\n-422\n-423 firstTime[idx] = false;\n-424\n-425 if (uniqueEntityPartition->owner(idx) == rank)\n-426 {\n-427 const Index gindex = myoffset + globalcontrib;\n-428 globalIndex_.insert(std::make_pair(id,gindex));\n-430 const Index lindex = idx;\n-431 localGlobalMap_[lindex] = gindex;\n-432\n-433 globalcontrib++;\n-434 }\n-435 else\n-436 {\n-437 globalIndex_.insert(std::make_pair(id,-1));\n-438 }\n-439 }\n-440\n-441 }\n-442 }\n-443\n-444 // 2nd stage of global index calculation: communicate global index for non-\n-owned entities\n-445\n-446 // Create the data handle and communicate.\n-447 IndexExchange dataHandle\n-(globalIdSet,globalIndex_,indexSet,localGlobalMap_,codim_);\n-448 gridview_.communicate(dataHandle, Dune::All_All_Interface, Dune::\n-ForwardCommunication);\n-449 }\n-450\n-452 template \n-453 Index index(const Entity& entity) const\n-454 {\n-455 if (codim_==0)\n-456 {\n-458 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();\n-459 const IdType id = globalIdSet.id(entity);\n-460 const Index gindex = globalIndex_.find(id)->second;\n-462 return gindex;\n-463 }\n-464 else\n-465 return localGlobalMap_.find(gridview_.indexSet().index(entity))->second;\n-466 }\n-467\n-473 template \n-474 Index subIndex(const Entity& entity, unsigned int i, unsigned int codim)\n-const\n-475 {\n-476 if (codim_==0)\n-477 {\n-479 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();\n-480 const IdType id = globalIdSet.subId(entity,i,codim);\n-481 const Index gindex = globalIndex_.find(id)->second;\n-483 return gindex;\n-484 }\n-485 else\n-486 return localGlobalMap_.find(gridview_.indexSet().subIndex(entity,i,codim))-\n->second;\n-487 }\n-488\n-494 unsigned int size(unsigned int codim) const\n-495 {\n-496 return (codim_==codim) ? nGlobalEntity_ : 0;\n-497 }\n-498\n-499 protected:\n-500 const GridView gridview_;\n-501\n-503 unsigned int codim_;\n-504\n-506 int nGlobalEntity_;\n-507\n-508 IndexMap localGlobalMap_;\n-509\n-512 MapId2Index globalIndex_;\n-513 };\n-514\n-515} // namespace Dune\n-516\n-517#endif /* DUNE_GRID_UTILITY_GLOBALINDEXSET_HH */\n+179} // end namespace Dune\n+180\n+181#endif // DUNE_GRID_HIERARCHICSEARCH_HH\n gridenums.hh\n-datahandleif.hh\n-Describes the parallel communication interface class for MessageBuffers and\n-DataHandles.\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-Dune::InteriorEntity\n-@ InteriorEntity\n-all interior entities\n-Definition gridenums.hh:31\n-Dune::BorderEntity\n-@ BorderEntity\n-on boundary between interior and overlap\n-Definition gridenums.hh:32\n-Dune::ForwardCommunication\n-@ ForwardCommunication\n-communicate as given in InterfaceType\n-Definition gridenums.hh:171\n-Dune::All_All_Interface\n-@ All_All_Interface\n-send all and receive all entities\n-Definition gridenums.hh:91\n-Dune::GridView::indexSet\n-const IndexSet & indexSet() const\n-obtain the index set\n-Definition common/gridview.hh:177\n-Dune::GridView::Grid\n-Traits::Grid Grid\n-type of the grid\n-Definition common/gridview.hh:83\n-Dune::GridView::grid\n-const Grid & grid() const\n-obtain a const reference to the underlying hierarchic grid\n-Definition common/gridview.hh:166\n-Dune::GridView::IndexSet\n-Traits::IndexSet IndexSet\n-type of the index set\n-Definition common/gridview.hh:86\n-Dune::GridView::size\n-int size(int codim) const\n-obtain number of entities in a given codimension\n-Definition common/gridview.hh:183\n-Dune::GridView::communicate\n-auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data,\n-InterfaceType iftype, CommunicationDirection dir) const\n-Communicate data on this view.\n-Definition common/gridview.hh:292\n-Dune::GridView::comm\n-const Communication & comm() const\n-obtain communication object\n-Definition common/gridview.hh:273\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::CommDataHandleIF\n-CommDataHandleIF describes the features of a data handle for communication in\n-parallel runs using the...\n-Definition datahandleif.hh:78\n-Dune::CommDataHandleIF<_MinimumExchange<_IS,_V_>,_V::value_type_>::scatter\n-void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)\n-unpack data from message buffer to user.\n-Definition datahandleif.hh:143\n-Dune::CommDataHandleIF<_IndexExchange,_Index_>::contains\n-bool contains(int dim, int codim) const\n-returns true if data for given valid codim should be communicated\n-Definition datahandleif.hh:94\n-Dune::CommDataHandleIF<_MinimumExchange<_IS,_V_>,_V::value_type_>::size\n-size_t size(const EntityType &e) const\n-how many objects of type DataType have to be sent for a given entity\n-Definition datahandleif.hh:118\n-Dune::CommDataHandleIF<_MinimumExchange<_IS,_V_>,_V::value_type_>::gather\n-void gather(MessageBufferImp &buff, const EntityType &e) const\n-pack data from user to message buffer\n-Definition datahandleif.hh:129\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Entity::partitionType\n-PartitionType partitionType() const\n-Partition type of this entity.\n-Definition common/entity.hh:127\n+Dune::referenceElement\n+auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo)\n+-> decltype(referenceElement(geo, geo.impl()))\n+Definition common/geometry.hh:558\n+Dune::Entity::Geometry\n+GridImp::template Codim< cd >::Geometry Geometry\n+The corresponding geometry type.\n+Definition common/entity.hh:100\n+Dune::GridError\n+Base class for exceptions in Dune grid modules.\n+Definition exceptions.hh:20\n+Dune::Geometry\n+Wrapper class for geometries.\n+Definition common/geometry.hh:71\n+Dune::Geometry::global\n+GlobalCoordinate global(const LocalCoordinate &local) const\n+Evaluate the map .\n+Definition common/geometry.hh:228\n+Dune::Geometry::LocalCoordinate\n+FieldVector< ctype, mydim > LocalCoordinate\n+type of local coordinates\n+Definition common/geometry.hh:103\n+Dune::Geometry::local\n+LocalCoordinate local(const GlobalCoordinate &global) const\n+Evaluate the inverse map .\n+Definition common/geometry.hh:237\n Dune::Grid\n Grid abstract base class.\n Definition common/grid.hh:375\n-Dune::Grid::Communication\n-typename GridFamily::Traits::Communication Communication\n-A type that is a model of Dune::Communication. It provides a portable way for\n-communication on the se...\n-Definition common/grid.hh:515\n-Dune::GridView\n-Grid view abstract base class.\n-Definition common/gridview.hh:66\n-Dune::GlobalIndexSet\n-Calculate globally unique index over all processes in a Dune grid.\n-Definition globalindexset.hh:63\n-Dune::GlobalIndexSet::subIndex\n-Index subIndex(const Entity &entity, unsigned int i, unsigned int codim) const\n-Return the global index of a subentity of a given entity.\n-Definition globalindexset.hh:474\n-Dune::GlobalIndexSet::globalIndex_\n-MapId2Index globalIndex_\n-Stores global index of entities with entity's globally unique id as key.\n-Definition globalindexset.hh:512\n-Dune::GlobalIndexSet::Index\n-int Index\n-The number type used for global indices\n-Definition globalindexset.hh:66\n-Dune::GlobalIndexSet::nGlobalEntity_\n-int nGlobalEntity_\n-Global number of entities, i.e. number of entities without rendundant entities\n-on interprocessor boun...\n-Definition globalindexset.hh:506\n-Dune::GlobalIndexSet::index\n-Index index(const Entity &entity) const\n-Return the global index of a given entity.\n-Definition globalindexset.hh:453\n-Dune::GlobalIndexSet::codim_\n-unsigned int codim_\n-Codimension of the entities that we hold indices for.\n-Definition globalindexset.hh:503\n-Dune::GlobalIndexSet::localGlobalMap_\n-IndexMap localGlobalMap_\n-Definition globalindexset.hh:508\n-Dune::GlobalIndexSet::size\n-unsigned int size(unsigned int codim) const\n-Return the total number of entities over all processes that we have indices\n-for.\n-Definition globalindexset.hh:494\n-Dune::GlobalIndexSet::GlobalIndexSet\n-GlobalIndexSet(const GridView &gridview, int codim)\n-Constructor for a given GridView.\n-Definition globalindexset.hh:326\n-Dune::GlobalIndexSet::gridview_\n-const GridView gridview_\n-Definition globalindexset.hh:500\n-Dune::GlobalIndexSet::SubPartitionTypeProvider\n-Helper class to provide access to subentity PartitionTypes with a run-time\n-codimension.\n-Definition globalindexset.hh:75\n-Dune::GlobalIndexSet::SubPartitionTypeProvider::get\n-static PartitionType get(const Entity &entity, int codim, int i)\n-Get PartitionType of the i-th subentity of codimension 'codim' of entity\n-'entity'.\n-Definition globalindexset.hh:78\n-Dune::GlobalIndexSet::SubPartitionTypeProvider<_Entity,_0_>::get\n-static PartitionType get(const Entity &entity, int, int i)\n-Definition globalindexset.hh:90\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::HierarchicIterator\n+GridFamily::Traits::HierarchicIterator HierarchicIterator\n+A type that is a model of Dune::HierarchicIterator A type of iterator that\n+allows to examine,...\n+Definition common/grid.hh:482\n+Dune::Grid::LevelGridView\n+GridFamily::Traits::LevelGridView LevelGridView\n+type of view for level grid\n+Definition common/grid.hh:402\n+Dune::Grid::dimensionworld\n+static constexpr int dimensionworld\n+The dimension of the world the grid lives in.\n+Definition common/grid.hh:390\n+Dune::Grid::levelGridView\n+LevelGridView levelGridView(int level) const\n+View for a grid level for All_Partition.\n+Definition common/grid.hh:584\n+Dune::Grid::ctype\n+ct ctype\n+Define type used for coordinates in grid module.\n+Definition common/grid.hh:518\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+Dune::HierarchicSearch\n+Search an IndexSet for an Entity containing a given point.\n+Definition hierarchicsearch.hh:35\n+Dune::HierarchicSearch::findEntity\n+Entity findEntity(const FieldVector< ct, dimw > &global) const\n+Search the IndexSet of this HierarchicSearch for an Entity containing point\n+global.\n+Definition hierarchicsearch.hh:127\n+Dune::HierarchicSearch::findEntity\n+Entity findEntity(const FieldVector< ct, dimw > &global) const\n+Search the IndexSet of this HierarchicSearch for an Entity containing point\n+global.\n+Definition hierarchicsearch.hh:138\n+Dune::HierarchicSearch::HierarchicSearch\n+HierarchicSearch(const Grid &g, const IS &is)\n+Construct a HierarchicSearch object from a Grid and an IndexSet.\n+Definition hierarchicsearch.hh:118\n+grid.hh\n+Different resources needed by all grid implementations.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00998.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00998.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hierarchicsearch.hh File Reference\n+dune-grid: entitycommhelper.hh File Reference\n \n \n \n \n \n \n \n@@ -72,46 +72,40 @@\n
  • dune
  • grid
  • utility
  • \n
    \n
    \n
    \n \n-
    hierarchicsearch.hh File Reference
    \n+
    entitycommhelper.hh File Reference
    \n
    \n
    \n-\n-

    Utility class for hierarchically searching for an Entity containing a given point. \n-More...

    \n-
    #include <cstddef>
    \n-#include <sstream>
    \n-#include <string>
    \n-#include <utility>
    \n-#include <dune/common/classname.hh>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/grid/common/grid.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 Classes

    class  Dune::HierarchicSearch< Grid, IS >
     Search an IndexSet for an Entity containing a given point. More...
    struct  Dune::EntityCommHelper< InteriorBorder_InteriorBorder_Interface >
     
    struct  Dune::EntityCommHelper< InteriorBorder_All_Interface >
     
    struct  Dune::EntityCommHelper< Overlap_OverlapFront_Interface >
     
    struct  Dune::EntityCommHelper< Overlap_All_Interface >
     
    struct  Dune::EntityCommHelper< All_All_Interface >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-

    Detailed Description

    \n-

    Utility class for hierarchically searching for an Entity containing a given point.

    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,33 +2,27 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-hierarchicsearch.hh File Reference\n-Utility class for hierarchically searching for an Entity containing a given\n-point. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+entitycommhelper.hh File Reference\n #include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::HierarchicSearch<_Grid,_IS_>\n-\u00a0 Search an IndexSet for an Entity containing a given point. More...\n+struct \u00a0 Dune::EntityCommHelper<_InteriorBorder_InteriorBorder_Interface_>\n+\u00a0\n+struct \u00a0 Dune::EntityCommHelper<_InteriorBorder_All_Interface_>\n+\u00a0\n+struct \u00a0 Dune::EntityCommHelper<_Overlap_OverlapFront_Interface_>\n+\u00a0\n+struct \u00a0 Dune::EntityCommHelper<_Overlap_All_Interface_>\n+\u00a0\n+struct \u00a0 Dune::EntityCommHelper<_All_All_Interface_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Utility class for hierarchically searching for an Entity containing a given\n-point.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00998_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00998_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: hierarchicsearch.hh Source File\n+dune-grid: entitycommhelper.hh Source File\n \n \n \n \n \n \n \n@@ -74,184 +74,169 @@\n \n
    \n \n
    \n \n
    \n-
    hierarchicsearch.hh
    \n+
    entitycommhelper.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_HIERARCHICSEARCH_HH
    \n-
    7#define DUNE_GRID_HIERARCHICSEARCH_HH
    \n-
    8
    \n-
    15#include <cstddef>
    \n-
    16#include <sstream>
    \n-
    17#include <string>
    \n-
    18#include <utility>
    \n-
    19
    \n-
    20#include <dune/common/classname.hh>
    \n-
    21#include <dune/common/exceptions.hh>
    \n-
    22#include <dune/common/fvector.hh>
    \n-
    23
    \n-\n-\n-
    26
    \n-
    27namespace Dune
    \n-
    28{
    \n-
    29
    \n-
    33 template<class Grid, class IS>
    \n-
    \n-\n-
    35 {
    \n-
    37 constexpr static int dim = Grid::dimension;
    \n-
    38
    \n-
    40 constexpr static int dimw = Grid::dimensionworld;
    \n+
    5#ifndef DUNE_ENTITYCOMMHELPER_HH
    \n+
    6#define DUNE_ENTITYCOMMHELPER_HH
    \n+
    7
    \n+\n+
    9
    \n+
    10namespace Dune
    \n+
    11{
    \n+
    12
    \n+
    13 template< InterfaceType iftype >
    \n+\n+
    15
    \n+
    16
    \n+
    17 template<>
    \n+
    \n+\n+
    19 {
    \n+
    \n+
    20 static bool send ( const PartitionType p )
    \n+
    21 {
    \n+
    22 //return (p == InteriorEntity) || (p == BorderEntity);
    \n+
    23 return (p == BorderEntity);
    \n+
    24 }
    \n+
    \n+
    25
    \n+
    \n+
    26 static bool receive ( const PartitionType p )
    \n+
    27 {
    \n+
    28 //return (p == InteriorEntity) || (p == BorderEntity);
    \n+
    29 return (p == BorderEntity);
    \n+
    30 }
    \n+
    \n+
    31 };
    \n+
    \n+
    32
    \n+
    33
    \n+
    34 template<>
    \n+
    \n+\n+
    36 {
    \n+
    \n+
    37 static bool send ( const PartitionType p )
    \n+
    38 {
    \n+
    39 return (p == InteriorEntity) || (p == BorderEntity);
    \n+
    40 }
    \n+
    \n
    41
    \n-
    43 typedef typename Grid::ctype ct;
    \n-
    44
    \n-
    46 typedef typename Grid::template Codim<0>::Entity Entity;
    \n-
    47
    \n-
    49 typedef typename Grid::HierarchicIterator HierarchicIterator;
    \n-
    50
    \n-
    51 static std::string formatEntityInformation ( const Entity &e ) {
    \n-
    52 const typename Entity::Geometry &geo = e.geometry();
    \n-
    53 std::ostringstream info;
    \n-
    54 info << "level=" << e.level() << " "
    \n-
    55 << "partition=" << e.partitionType() << " "
    \n-
    56 << "center=(" << geo.center() << ") "
    \n-
    57 << "corners=[(" << geo.corner(0) << ")";
    \n-
    58 for(int i = 1; i < geo.corners(); ++i)
    \n-
    59 info << " (" << e.geometry().corner(i) << ")";
    \n-
    60 info << "]";
    \n-
    61 return info.str();
    \n-
    62 }
    \n-
    63
    \n-
    74 Entity hFindEntity ( const Entity &entity,
    \n-
    75 const FieldVector<ct,dimw>& global) const
    \n-
    76 {
    \n-
    77 // type of element geometry
    \n-
    78 typedef typename Entity::Geometry Geometry;
    \n-
    79 // type of local coordinate
    \n-
    80 typedef typename Geometry::LocalCoordinate LocalCoordinate;
    \n+
    \n+
    42 static bool receive ( const PartitionType p )
    \n+
    43 {
    \n+
    44 //return true;
    \n+
    45 return (p != InteriorEntity);
    \n+
    46 }
    \n+
    \n+
    47 };
    \n+
    \n+
    48
    \n+
    49
    \n+
    50 template<>
    \n+
    \n+\n+
    52 {
    \n+
    \n+
    53 static bool send ( const PartitionType p )
    \n+
    54 {
    \n+
    55 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
    \n+
    56 return (p != FrontEntity) && (p != GhostEntity);
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    \n+
    59 static bool receive ( const PartitionType p )
    \n+
    60 {
    \n+
    61 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity) || (p == FrontEntity);
    \n+
    62 return (p != GhostEntity);
    \n+
    63 }
    \n+
    \n+
    64 };
    \n+
    \n+
    65
    \n+
    66
    \n+
    67 template<>
    \n+
    \n+\n+
    69 {
    \n+
    \n+
    70 static bool send ( const PartitionType p )
    \n+
    71 {
    \n+
    72 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
    \n+
    73 return (p != FrontEntity) && (p != GhostEntity);
    \n+
    74 }
    \n+
    \n+
    75
    \n+
    \n+
    76 static bool receive ([[maybe_unused]] const PartitionType p)
    \n+
    77 {
    \n+
    78 return true;
    \n+
    79 }
    \n+
    \n+
    80 };
    \n+
    \n
    81
    \n-
    82 const int childLevel = entity.level()+1 ;
    \n-
    83 // loop over all child Entities
    \n-
    84 const HierarchicIterator end = entity.hend( childLevel );
    \n-
    85 for( HierarchicIterator it = entity.hbegin( childLevel ); it != end; ++it )
    \n-
    86 {
    \n-
    87 Entity child = *it;
    \n-
    88 Geometry geo = child.geometry();
    \n-
    89
    \n-
    90 LocalCoordinate local = geo.local(global);
    \n-
    91 if (referenceElement( geo ).checkInside(local))
    \n-
    92 {
    \n-
    93 // return if we found the leaf, else search through the child entities
    \n-
    94 if( indexSet_.contains( child ) )
    \n-
    95 return child;
    \n-
    96 else
    \n-
    97 return hFindEntity( child, global );
    \n-
    98 }
    \n-
    99 }
    \n-
    100 std::ostringstream children;
    \n-
    101 HierarchicIterator it = entity.hbegin( childLevel );
    \n-
    102 if(it != end) {
    \n-
    103 children << "{" << formatEntityInformation(*it) << "}";
    \n-
    104 for( ++it; it != end; ++it )
    \n-
    105 children << " {" << formatEntityInformation(*it) << "}";
    \n-
    106 }
    \n-
    107 DUNE_THROW(Exception, "{" << className(*this) << "} Unexpected "
    \n-
    108 "internal Error: none of the children of the entity "
    \n-
    109 "{" << formatEntityInformation(entity) << "} contains "
    \n-
    110 "coordinate (" << global << "). Children are: "
    \n-
    111 "[" << children.str() << "].");
    \n-
    112 }
    \n-
    113
    \n-
    114 public:
    \n-
    118 HierarchicSearch(const Grid & g, const IS & is) : grid_(g), indexSet_(is) {}
    \n-
    119
    \n-
    \n-
    127 Entity findEntity(const FieldVector<ct,dimw>& global) const
    \n-
    128 { return findEntity<All_Partition>(global); }
    \n-
    \n-
    129
    \n-
    137 template<PartitionIteratorType partition>
    \n-
    \n-
    138 Entity findEntity(const FieldVector<ct,dimw>& global) const
    \n-
    139 {
    \n-
    140 typedef typename Grid::LevelGridView LevelGV;
    \n-
    141 const LevelGV &gv = grid_.levelGridView(0);
    \n-
    142
    \n-
    144 typedef typename LevelGV::template Codim<0>::template Partition<partition>::Iterator LevelIterator;
    \n-
    145
    \n-
    146 // type of element geometry
    \n-
    147 typedef typename Entity::Geometry Geometry;
    \n-
    148 // type of local coordinate
    \n-
    149 typedef typename Geometry::LocalCoordinate LocalCoordinate;
    \n-
    150
    \n-
    151 // loop over macro level
    \n-
    152 const LevelIterator end = gv.template end<0, partition>();
    \n-
    153 for (LevelIterator it = gv.template begin<0, partition>(); it != end; ++it)
    \n-
    154 {
    \n-
    155 Entity entity = *it;
    \n-
    156 Geometry geo = entity.geometry();
    \n-
    157
    \n-
    158 LocalCoordinate local = geo.local( global );
    \n-
    159 if( !referenceElement( geo ).checkInside( local ) )
    \n-
    160 continue;
    \n-
    161
    \n-
    162 if( (int(dim) != int(dimw)) && ((geo.global( local ) - global).two_norm() > 1e-8) )
    \n-
    163 continue;
    \n-
    164
    \n-
    165 // return if we found the leaf, else search through the child entities
    \n-
    166 if( indexSet_.contains( entity ) )
    \n-
    167 return entity;
    \n-
    168 else
    \n-
    169 return hFindEntity( entity, global );
    \n-
    170 }
    \n-
    171 DUNE_THROW( GridError, "Coordinate " << global << " is outside the grid." );
    \n-
    172 }
    \n-
    \n-
    173
    \n-
    174 private:
    \n-
    175 const Grid& grid_;
    \n-
    176 const IS& indexSet_;
    \n-
    177 };
    \n-
    \n-
    178
    \n-
    179} // end namespace Dune
    \n-
    180
    \n-
    181#endif // DUNE_GRID_HIERARCHICSEARCH_HH
    \n-\n+
    82
    \n+
    83 template<>
    \n+
    \n+\n+
    85 {
    \n+
    \n+
    86 static bool send ([[maybe_unused]] const PartitionType p)
    \n+
    87 {
    \n+
    88 return true;
    \n+
    89 }
    \n+
    \n+
    90
    \n+
    \n+
    91 static bool receive ([[maybe_unused]] const PartitionType p)
    \n+
    92 {
    \n+
    93 return true;
    \n+
    94 }
    \n+
    \n+
    95 };
    \n+
    \n+
    96
    \n+
    97} // namespace Dune
    \n+
    98
    \n+
    99#endif // #ifndef DUNE_ENTITYCOMMHELPER_HH
    \n+\n+
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n+
    @ FrontEntity
    on boundary between overlap and ghost
    Definition gridenums.hh:34
    \n+
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n+
    @ GhostEntity
    ghost entities
    Definition gridenums.hh:35
    \n+
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n+
    @ InteriorBorder_All_Interface
    send interior and border, receive all entities
    Definition gridenums.hh:88
    \n+
    @ All_All_Interface
    send all and receive all entities
    Definition gridenums.hh:91
    \n+
    @ Overlap_All_Interface
    send overlap, receive all entities
    Definition gridenums.hh:90
    \n+
    @ Overlap_OverlapFront_Interface
    send overlap, receive overlap and front entities
    Definition gridenums.hh:89
    \n+
    @ InteriorBorder_InteriorBorder_Interface
    send/receive interior and border entities
    Definition gridenums.hh:87
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
    Definition common/geometry.hh:558
    \n-
    GridImp::template Codim< cd >::Geometry Geometry
    The corresponding geometry type.
    Definition common/entity.hh:100
    \n-
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n-
    Wrapper class for geometries.
    Definition common/geometry.hh:71
    \n-
    GlobalCoordinate global(const LocalCoordinate &local) const
    Evaluate the map .
    Definition common/geometry.hh:228
    \n-
    FieldVector< ctype, mydim > LocalCoordinate
    type of local coordinates
    Definition common/geometry.hh:103
    \n-
    LocalCoordinate local(const GlobalCoordinate &global) const
    Evaluate the inverse map .
    Definition common/geometry.hh:237
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    GridFamily::Traits::HierarchicIterator HierarchicIterator
    A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
    Definition common/grid.hh:482
    \n-
    GridFamily::Traits::LevelGridView LevelGridView
    type of view for level grid
    Definition common/grid.hh:402
    \n-
    static constexpr int dimensionworld
    The dimension of the world the grid lives in.
    Definition common/grid.hh:390
    \n-
    LevelGridView levelGridView(int level) const
    View for a grid level for All_Partition.
    Definition common/grid.hh:584
    \n-
    ct ctype
    Define type used for coordinates in grid module.
    Definition common/grid.hh:518
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-
    Search an IndexSet for an Entity containing a given point.
    Definition hierarchicsearch.hh:35
    \n-
    Entity findEntity(const FieldVector< ct, dimw > &global) const
    Search the IndexSet of this HierarchicSearch for an Entity containing point global.
    Definition hierarchicsearch.hh:127
    \n-
    Entity findEntity(const FieldVector< ct, dimw > &global) const
    Search the IndexSet of this HierarchicSearch for an Entity containing point global.
    Definition hierarchicsearch.hh:138
    \n-
    HierarchicSearch(const Grid &g, const IS &is)
    Construct a HierarchicSearch object from a Grid and an IndexSet.
    Definition hierarchicsearch.hh:118
    \n-
    Different resources needed by all grid implementations.
    \n+
    Definition entitycommhelper.hh:14
    \n+
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:26
    \n+
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:20
    \n+
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:42
    \n+
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:37
    \n+
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:53
    \n+
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:59
    \n+
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:76
    \n+
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:70
    \n+
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:86
    \n+
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:91
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,235 +1,190 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-hierarchicsearch.hh\n+entitycommhelper.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_HIERARCHICSEARCH_HH\n-7#define DUNE_GRID_HIERARCHICSEARCH_HH\n-8\n-15#include \n-16#include \n-17#include \n-18#include \n-19\n-20#include \n-21#include \n-22#include \n-23\n-24#include \n-25#include \n-26\n-27namespace Dune\n-28{\n-29\n-33 template\n-34 class HierarchicSearch\n-35 {\n-37 constexpr static int dim = Grid::dimension;\n-38\n-40 constexpr static int dimw = Grid::dimensionworld;\n+5#ifndef DUNE_ENTITYCOMMHELPER_HH\n+6#define DUNE_ENTITYCOMMHELPER_HH\n+7\n+8#include \n+9\n+10namespace Dune\n+11{\n+12\n+13 template< InterfaceType iftype >\n+14 struct EntityCommHelper;\n+15\n+16\n+17 template<>\n+18 struct EntityCommHelper< InteriorBorder_InteriorBorder_Interface >\n+19 {\n+20 static bool send ( const PartitionType p )\n+21 {\n+22 //return (p == InteriorEntity) || (p == BorderEntity);\n+23 return (p == BorderEntity);\n+24 }\n+25\n+26 static bool receive ( const PartitionType p )\n+27 {\n+28 //return (p == InteriorEntity) || (p == BorderEntity);\n+29 return (p == BorderEntity);\n+30 }\n+31 };\n+32\n+33\n+34 template<>\n+35 struct EntityCommHelper< InteriorBorder_All_Interface >\n+36 {\n+37 static bool send ( const PartitionType p )\n+38 {\n+39 return (p == InteriorEntity) || (p == BorderEntity);\n+40 }\n 41\n-43 typedef typename Grid::ctype ct;\n-44\n-46 typedef typename Grid::template Codim<0>::Entity Entity;\n-47\n-49 typedef typename Grid::HierarchicIterator HierarchicIterator;\n-50\n-51 static std::string formatEntityInformation ( const Entity &e ) {\n-52 const typename Entity::Geometry &geo = e.geometry();\n-53 std::ostringstream info;\n-54 info << \"level=\" << e.level() << \" \"\n-55 << \"partition=\" << e.partitionType() << \" \"\n-56 << \"center=(\" << geo.center() << \") \"\n-57 << \"corners=[(\" << geo.corner(0) << \")\";\n-58 for(int i = 1; i < geo.corners(); ++i)\n-59 info << \" (\" << e.geometry().corner(i) << \")\";\n-60 info << \"]\";\n-61 return info.str();\n-62 }\n-63\n-74 Entity hFindEntity ( const Entity &entity,\n-75 const FieldVector& global) const\n-76 {\n-77 // type of element geometry\n-78 typedef typename Entity::Geometry Geometry;\n-79 // type of local coordinate\n-80 typedef typename Geometry::LocalCoordinate LocalCoordinate;\n+42 static bool receive ( const PartitionType p )\n+43 {\n+44 //return true;\n+45 return (p != InteriorEntity);\n+46 }\n+47 };\n+48\n+49\n+50 template<>\n+51 struct EntityCommHelper< Overlap_OverlapFront_Interface >\n+52 {\n+53 static bool send ( const PartitionType p )\n+54 {\n+55 //return (p == InteriorEntity) || (p == BorderEntity) || (p ==\n+OverlapEntity);\n+56 return (p != FrontEntity) && (p != GhostEntity);\n+57 }\n+58\n+59 static bool receive ( const PartitionType p )\n+60 {\n+61 //return (p == InteriorEntity) || (p == BorderEntity) || (p ==\n+OverlapEntity) || (p == FrontEntity);\n+62 return (p != GhostEntity);\n+63 }\n+64 };\n+65\n+66\n+67 template<>\n+68 struct EntityCommHelper< Overlap_All_Interface >\n+69 {\n+70 static bool send ( const PartitionType p )\n+71 {\n+72 //return (p == InteriorEntity) || (p == BorderEntity) || (p ==\n+OverlapEntity);\n+73 return (p != FrontEntity) && (p != GhostEntity);\n+74 }\n+75\n+76 static bool receive ([[maybe_unused]] const PartitionType p)\n+77 {\n+78 return true;\n+79 }\n+80 };\n 81\n-82 const int childLevel = entity.level()+1 ;\n-83 // loop over all child Entities\n-84 const HierarchicIterator end = entity.hend( childLevel );\n-85 for( HierarchicIterator it = entity.hbegin( childLevel ); it != end; ++it )\n-86 {\n-87 Entity child = *it;\n-88 Geometry geo = child.geometry();\n-89\n-90 LocalCoordinate local = geo.local(global);\n-91 if (referenceElement( geo ).checkInside(local))\n+82\n+83 template<>\n+84 struct EntityCommHelper< All_All_Interface >\n+85 {\n+86 static bool send ([[maybe_unused]] const PartitionType p)\n+87 {\n+88 return true;\n+89 }\n+90\n+91 static bool receive ([[maybe_unused]] const PartitionType p)\n 92 {\n-93 // return if we found the leaf, else search through the child entities\n-94 if( indexSet_.contains( child ) )\n-95 return child;\n-96 else\n-97 return hFindEntity( child, global );\n-98 }\n-99 }\n-100 std::ostringstream children;\n-101 HierarchicIterator it = entity.hbegin( childLevel );\n-102 if(it != end) {\n-103 children << \"{\" << formatEntityInformation(*it) << \"}\";\n-104 for( ++it; it != end; ++it )\n-105 children << \" {\" << formatEntityInformation(*it) << \"}\";\n-106 }\n-107 DUNE_THROW(Exception, \"{\" << className(*this) << \"} Unexpected \"\n-108 \"internal Error: none of the children of the entity \"\n-109 \"{\" << formatEntityInformation(entity) << \"} contains \"\n-110 \"coordinate (\" << global << \"). Children are: \"\n-111 \"[\" << children.str() << \"].\");\n-112 }\n-113\n-114 public:\n-118 HierarchicSearch(const Grid & g, const IS & is) : grid_(g), indexSet_(is)\n-{}\n-119\n-127 Entity findEntity(const FieldVector& global) const\n-128 { return findEntity(global); }\n-129\n-137 template\n-138 Entity findEntity(const FieldVector& global) const\n-139 {\n-140 typedef typename Grid::LevelGridView LevelGV;\n-141 const LevelGV &gv = grid_.levelGridView(0);\n-142\n-144 typedef typename LevelGV::template Codim<0>::template\n-Partition::Iterator LevelIterator;\n-145\n-146 // type of element geometry\n-147 typedef typename Entity::Geometry Geometry;\n-148 // type of local coordinate\n-149 typedef typename Geometry::LocalCoordinate LocalCoordinate;\n-150\n-151 // loop over macro level\n-152 const LevelIterator end = gv.template end<0, partition>();\n-153 for (LevelIterator it = gv.template begin<0, partition>(); it != end; ++it)\n-154 {\n-155 Entity entity = *it;\n-156 Geometry geo = entity.geometry();\n-157\n-158 LocalCoordinate local = geo.local( global );\n-159 if( !referenceElement( geo ).checkInside( local ) )\n-160 continue;\n-161\n-162 if( (int(dim) != int(dimw)) && ((geo.global( local ) - global).two_norm() >\n-1e-8) )\n-163 continue;\n-164\n-165 // return if we found the leaf, else search through the child entities\n-166 if( indexSet_.contains( entity ) )\n-167 return entity;\n-168 else\n-169 return hFindEntity( entity, global );\n-170 }\n-171 DUNE_THROW( GridError, \"Coordinate \" << global << \" is outside the grid.\"\n-);\n-172 }\n-173\n-174 private:\n-175 const Grid& grid_;\n-176 const IS& indexSet_;\n-177 };\n-178\n-179} // end namespace Dune\n-180\n-181#endif // DUNE_GRID_HIERARCHICSEARCH_HH\n+93 return true;\n+94 }\n+95 };\n+96\n+97} // namespace Dune\n+98\n+99#endif // #ifndef DUNE_ENTITYCOMMHELPER_HH\n gridenums.hh\n+Dune::PartitionType\n+PartitionType\n+Attributes used in the generic overlap model.\n+Definition gridenums.hh:30\n+Dune::FrontEntity\n+@ FrontEntity\n+on boundary between overlap and ghost\n+Definition gridenums.hh:34\n+Dune::InteriorEntity\n+@ InteriorEntity\n+all interior entities\n+Definition gridenums.hh:31\n+Dune::GhostEntity\n+@ GhostEntity\n+ghost entities\n+Definition gridenums.hh:35\n+Dune::BorderEntity\n+@ BorderEntity\n+on boundary between interior and overlap\n+Definition gridenums.hh:32\n+Dune::InteriorBorder_All_Interface\n+@ InteriorBorder_All_Interface\n+send interior and border, receive all entities\n+Definition gridenums.hh:88\n+Dune::All_All_Interface\n+@ All_All_Interface\n+send all and receive all entities\n+Definition gridenums.hh:91\n+Dune::Overlap_All_Interface\n+@ Overlap_All_Interface\n+send overlap, receive all entities\n+Definition gridenums.hh:90\n+Dune::Overlap_OverlapFront_Interface\n+@ Overlap_OverlapFront_Interface\n+send overlap, receive overlap and front entities\n+Definition gridenums.hh:89\n+Dune::InteriorBorder_InteriorBorder_Interface\n+@ InteriorBorder_InteriorBorder_Interface\n+send/receive interior and border entities\n+Definition gridenums.hh:87\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::referenceElement\n-auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo)\n--> decltype(referenceElement(geo, geo.impl()))\n-Definition common/geometry.hh:558\n-Dune::Entity::Geometry\n-GridImp::template Codim< cd >::Geometry Geometry\n-The corresponding geometry type.\n-Definition common/entity.hh:100\n-Dune::GridError\n-Base class for exceptions in Dune grid modules.\n-Definition exceptions.hh:20\n-Dune::Geometry\n-Wrapper class for geometries.\n-Definition common/geometry.hh:71\n-Dune::Geometry::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-Evaluate the map .\n-Definition common/geometry.hh:228\n-Dune::Geometry::LocalCoordinate\n-FieldVector< ctype, mydim > LocalCoordinate\n-type of local coordinates\n-Definition common/geometry.hh:103\n-Dune::Geometry::local\n-LocalCoordinate local(const GlobalCoordinate &global) const\n-Evaluate the inverse map .\n-Definition common/geometry.hh:237\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::HierarchicIterator\n-GridFamily::Traits::HierarchicIterator HierarchicIterator\n-A type that is a model of Dune::HierarchicIterator A type of iterator that\n-allows to examine,...\n-Definition common/grid.hh:482\n-Dune::Grid::LevelGridView\n-GridFamily::Traits::LevelGridView LevelGridView\n-type of view for level grid\n-Definition common/grid.hh:402\n-Dune::Grid::dimensionworld\n-static constexpr int dimensionworld\n-The dimension of the world the grid lives in.\n-Definition common/grid.hh:390\n-Dune::Grid::levelGridView\n-LevelGridView levelGridView(int level) const\n-View for a grid level for All_Partition.\n-Definition common/grid.hh:584\n-Dune::Grid::ctype\n-ct ctype\n-Define type used for coordinates in grid module.\n-Definition common/grid.hh:518\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-Dune::HierarchicSearch\n-Search an IndexSet for an Entity containing a given point.\n-Definition hierarchicsearch.hh:35\n-Dune::HierarchicSearch::findEntity\n-Entity findEntity(const FieldVector< ct, dimw > &global) const\n-Search the IndexSet of this HierarchicSearch for an Entity containing point\n-global.\n-Definition hierarchicsearch.hh:127\n-Dune::HierarchicSearch::findEntity\n-Entity findEntity(const FieldVector< ct, dimw > &global) const\n-Search the IndexSet of this HierarchicSearch for an Entity containing point\n-global.\n-Definition hierarchicsearch.hh:138\n-Dune::HierarchicSearch::HierarchicSearch\n-HierarchicSearch(const Grid &g, const IS &is)\n-Construct a HierarchicSearch object from a Grid and an IndexSet.\n-Definition hierarchicsearch.hh:118\n-grid.hh\n-Different resources needed by all grid implementations.\n+Dune::EntityCommHelper\n+Definition entitycommhelper.hh:14\n+Dune::EntityCommHelper<_InteriorBorder_InteriorBorder_Interface_>::receive\n+static bool receive(const PartitionType p)\n+Definition entitycommhelper.hh:26\n+Dune::EntityCommHelper<_InteriorBorder_InteriorBorder_Interface_>::send\n+static bool send(const PartitionType p)\n+Definition entitycommhelper.hh:20\n+Dune::EntityCommHelper<_InteriorBorder_All_Interface_>::receive\n+static bool receive(const PartitionType p)\n+Definition entitycommhelper.hh:42\n+Dune::EntityCommHelper<_InteriorBorder_All_Interface_>::send\n+static bool send(const PartitionType p)\n+Definition entitycommhelper.hh:37\n+Dune::EntityCommHelper<_Overlap_OverlapFront_Interface_>::send\n+static bool send(const PartitionType p)\n+Definition entitycommhelper.hh:53\n+Dune::EntityCommHelper<_Overlap_OverlapFront_Interface_>::receive\n+static bool receive(const PartitionType p)\n+Definition entitycommhelper.hh:59\n+Dune::EntityCommHelper<_Overlap_All_Interface_>::receive\n+static bool receive(const PartitionType p)\n+Definition entitycommhelper.hh:76\n+Dune::EntityCommHelper<_Overlap_All_Interface_>::send\n+static bool send(const PartitionType p)\n+Definition entitycommhelper.hh:70\n+Dune::EntityCommHelper<_All_All_Interface_>::send\n+static bool send(const PartitionType p)\n+Definition entitycommhelper.hh:86\n+Dune::EntityCommHelper<_All_All_Interface_>::receive\n+static bool receive(const PartitionType p)\n+Definition entitycommhelper.hh:91\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01001.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01001.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridinfo-gmsh-main.hh File Reference\n+dune-grid: multiindex.hh File Reference\n \n \n \n \n \n \n \n@@ -69,51 +69,42 @@\n \n
    \n \n
    \n \n
    \n-
    gridinfo-gmsh-main.hh File Reference
    \n+ \n+
    multiindex.hh File Reference
    \n
    \n
    \n \n-

    Generic main() function for printing information about a mesh read from a .msh-file. \n+

    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes. \n More...

    \n-
    #include <cstddef>
    \n-#include <cstdlib>
    \n-#include <exception>
    \n-#include <iostream>
    \n-#include <memory>
    \n-#include <ostream>
    \n-#include <sstream>
    \n-#include <stdexcept>
    \n-#include <string>
    \n-#include <vector>
    \n-#include <dune/common/classname.hh>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/grid/io/file/gmshreader.hh>
    \n-#include <dune/grid/utility/gridinfo.hh>
    \n+
    #include <array>
    \n
    \n

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::FactoryUtilities::MultiIndex< dim >
     
    \n+\n+\n+\n+\n+\n+\n+

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::FactoryUtilities
     
    \n

    Detailed Description

    \n-

    Generic main() function for printing information about a mesh read from a .msh-file.

    \n-
    Author
    J\u00f6 Fahlke jorri.nosp@m.t@jo.nosp@m.rrit..nosp@m.de
    \n-
    Date
    2011
    \n-

    This header contains a generic main() function. To use it for your grid, write a .cc file like this:

    #include <string>
    \n-
    \n-
    #include <dune/grid/mygrid.hh>
    \n-
    \n-
    const std::string programName = "dune-gridinfo-gmsh-mygrid-3d";
    \n-
    typedef Dune::MyGrid<3> Grid;
    \n-
    \n-\n-
    Generic main() function for printing information about a mesh read from a .msh-file.
    \n-

    Write an automake target for your program as usual. No special libraries are needed for you program, beyond what is needed for the grid in question.

    \n+

    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-utf-8\n+us-ascii\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,47 +1,27 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-gridinfo-gmsh-main.hh File Reference\n-Generic main() function for printing information about a mesh read from a .msh-\n-file. 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+Classes | Namespaces\n+multiindex.hh File Reference\n+Implements a multiindex with arbitrary dimension and fixed index ranges This is\n+used by various factory classes. More...\n+#include \n Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::FactoryUtilities::MultiIndex<_dim_>\n+\u00a0\n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n+namespace \u00a0 Dune::FactoryUtilities\n+\u00a0\n ***** Detailed Description *****\n-Generic main() function for printing information about a mesh read from a .msh-\n-file.\n- Author\n- J\u00c3\u00b6 Fahlke jorri.nosp@m.t@jo.nosp@m.rrit..nosp@m.de\n- Date\n- 2011\n-This header contains a generic main() function. To use it for your grid, write\n-a .cc file like this:\n-#include \n-#include \n-const std::string programName = \"dune-gridinfo-gmsh-mygrid-3d\";\n-typedef Dune::MyGrid<3> Grid;\n-#include \n-gridinfo-gmsh-main.hh\n-Generic main() function for printing information about a mesh read from a .msh-\n-file.\n-Write an automake target for your program as usual. No special libraries are\n-needed for you program, beyond what is needed for the grid in question.\n+Implements a multiindex with arbitrary dimension and fixed index ranges This is\n+used by various factory classes.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01001_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01001_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridinfo-gmsh-main.hh Source File\n+dune-grid: multiindex.hh Source File\n \n \n \n \n \n \n \n@@ -74,223 +74,83 @@\n \n
    \n \n
    \n
    \n
    \n-
    gridinfo-gmsh-main.hh
    \n+
    multiindex.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=4 sw=2 sts=2:
    \n+
    3#ifndef DUNE_GRID_UTILITY_MULTIINDEX_HH
    \n+
    4#define DUNE_GRID_UTILITY_MULTIINDEX_HH
    \n
    5
    \n-
    6#ifndef DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH
    \n-
    7#define DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH
    \n-
    8
    \n-
    9#include <cstddef>
    \n-
    10#include <cstdlib>
    \n-
    11#include <exception>
    \n-
    12#include <iostream>
    \n-
    13#include <memory>
    \n-
    14#include <ostream>
    \n-
    15#include <sstream>
    \n-
    16#include <stdexcept>
    \n-
    17#include <string>
    \n-
    18#include <vector>
    \n-
    19
    \n-
    20#include <dune/common/classname.hh>
    \n-
    21#include <dune/common/exceptions.hh>
    \n-
    22#include <dune/common/parallel/mpihelper.hh>
    \n-
    23
    \n-\n-\n-
    26
    \n-
    50#ifdef HEADERCHECK
    \n-
    51// define so headercheck will run
    \n-
    52const std::string programName = "headercheck";
    \n-
    53#endif // HEADERCHECK
    \n-
    54
    \n-
    55#ifndef DOXYGEN
    \n-
    56namespace {
    \n-
    57 // anonymous namespace so we don't freakishly conflict with another usage()
    \n-
    58 // function that may be linked in from another compilation unit.
    \n-
    59 void usage(std::ostream &stream) {
    \n-
    60 stream << "USAGE:\\n"
    \n-
    61 << " " << programName << " [-R REFINES] GRIDFILE\\n"
    \n-
    62 << "\\n"
    \n-
    63 << "PARAMETERS:\\n"
    \n-
    64 << " -R REFINES How many global refines to do after reading\\n"
    \n-
    65 << " (default: 0)\\n"
    \n-
    66 << " GRIDFILE Name of the .msh file to read the grid from.\\n"
    \n-
    67 << std::flush;
    \n-
    68 }
    \n-
    69
    \n-
    70 bool prefix_match(const std::string &prefix, const std::string &str)
    \n-
    71 {
    \n-
    72 return str.compare(0,prefix.size(), prefix) == 0;
    \n-
    73 }
    \n-
    74
    \n-
    75 void error_argument_required(const std::string &opt) {
    \n-
    76 std::cerr << "Error: option " << opt << " requires argument\\n";
    \n-
    77 usage(std::cerr);
    \n-
    78 std::exit(1);
    \n-
    79 }
    \n-
    80
    \n-
    81 void error_unknown_option(const std::string &opt) {
    \n-
    82 std::cerr << "Error: unknown option: " << opt << "\\n";
    \n-
    83 usage(std::cerr);
    \n-
    84 std::exit(1);
    \n-
    85 }
    \n-
    86
    \n-
    87 void error_parsing_optarg(const std::string &opt, const std::string &error) {
    \n-
    88 std::cerr << "Error: option " << opt << ": " << error << "\\n";
    \n-
    89 usage(std::cerr);
    \n-
    90 std::exit(1);
    \n-
    91 }
    \n-
    92
    \n-
    93 template<class T>
    \n-
    94 void parse(const std::string &arg, T &val) {
    \n-
    95 std::istringstream s(arg);
    \n-
    96 s >> val;
    \n-
    97 bool good = !s.fail();
    \n-
    98 if(good) {
    \n-
    99 char dummy;
    \n-
    100 s >> dummy;
    \n-
    101 good = s.fail() && s.eof();
    \n-
    102 }
    \n-
    103 if(!good) {
    \n-
    104 std::ostringstream s;
    \n-
    105 s << "Can't parse \\"" << arg << "\\" as a " << Dune::className(val);
    \n-
    106 throw std::runtime_error(s.str());
    \n-
    107 }
    \n-
    108 }
    \n-
    109
    \n-
    110 std::size_t refines = 0;
    \n-
    111 std::string gridFileName = "";
    \n-
    112
    \n-
    113 void parseOptions(int argc, char **argv) {
    \n-
    114 std::vector<std::string> params;
    \n-
    115 for(++argv; *argv; ++argv) {
    \n-
    116 std::string arg = *argv;
    \n-
    117 if(prefix_match("-", arg)) {
    \n-
    118 std::string opt = arg;
    \n-
    119 if(opt == "--") {
    \n-
    120 for(++argv; *argv; ++argv)
    \n-
    121 params.push_back(*argv);
    \n-
    122 break;
    \n-
    123 }
    \n-
    124 else if(prefix_match("-h", opt) || prefix_match("-?", opt) ||
    \n-
    125 opt == "--help")
    \n-
    126 {
    \n-
    127 usage(std::cout);
    \n-
    128 std::exit(0);
    \n-
    129 }
    \n-
    130 else if(opt == "-R" || opt == "--global-refines") {
    \n-
    131 ++argv;
    \n-
    132 if(!*argv) error_argument_required(opt);
    \n-
    133 try { parse(*argv, refines); }
    \n-
    134 catch(const std::runtime_error &e)
    \n-
    135 { error_parsing_optarg(opt, e.what()); }
    \n-
    136 }
    \n-
    137 else if(prefix_match("-R", opt)) {
    \n-
    138 try { parse(*argv+std::strlen("-R"), refines); }
    \n-
    139 catch(const std::runtime_error &e)
    \n-
    140 { error_parsing_optarg(opt, e.what()); }
    \n-
    141 }
    \n-
    142 else if(prefix_match("--global-refines=", opt)) {
    \n-
    143 try { parse(*argv+std::strlen("--global-refines="), refines); }
    \n-
    144 catch(const std::runtime_error &e)
    \n-
    145 { error_parsing_optarg(opt, e.what()); }
    \n-
    146 }
    \n-
    147 else
    \n-
    148 error_unknown_option(opt);
    \n-
    149 }
    \n-
    150 else
    \n-
    151 params.push_back(arg);
    \n-
    152 }
    \n-
    153 // check command line arguments
    \n-
    154 if(params.size() < 1) {
    \n-
    155 std::cerr << "Need name of a .msh file to read.\\n"
    \n-
    156 << std::endl;
    \n-
    157 usage(std::cerr);
    \n-
    158 std::exit(1);
    \n-
    159 }
    \n-
    160 if(params.size() > 1) {
    \n-
    161 std::cerr << "Too many arguments.\\n"
    \n-
    162 << std::endl;
    \n-
    163 usage(std::cerr);
    \n-
    164 std::exit(1);
    \n-
    165 }
    \n-
    166 gridFileName = params[0];
    \n-
    167 }
    \n-
    168}
    \n-
    169
    \n-
    170#ifndef HEADERCHECK
    \n-
    171int main(int argc, char **argv) {
    \n-
    172 try {
    \n-
    173 const Dune::MPIHelper &mpiHelper = Dune::MPIHelper::instance(argc, argv);
    \n-
    174
    \n-
    175 // check that we are not run through mpirun
    \n-
    176 if(mpiHelper.size() > 1) {
    \n-
    177 if(mpiHelper.rank() == 0)
    \n-
    178 std::cerr << programName << ": Sorry, this program works only in "
    \n-
    179 << "serial." << std::endl;
    \n-
    180 return 1;
    \n-
    181 }
    \n-
    182
    \n-
    183 parseOptions(argc, argv);
    \n-
    184
    \n-
    185 // read grid
    \n-
    186 typedef Dune::GmshReader<Grid> Reader;
    \n-
    187 std::shared_ptr<Grid> gridp(Reader::read(gridFileName));
    \n-
    188 gridp->globalRefine(refines);
    \n-
    189
    \n-
    190 // collect information
    \n-\n-
    192 Dune::fillGridViewInfoSerial(gridp->leafGridView(), gridViewInfo);
    \n-
    193
    \n-
    194 // print it
    \n-
    195 std::cout << gridViewInfo << std::flush;
    \n-
    196 }
    \n-
    197 catch(const std::exception &e) {
    \n-
    198 std::cerr << "Caught exception of type " << Dune::className(e)
    \n-
    199 << std::endl
    \n-
    200 << "e.what(): " << e.what() << std::endl;
    \n-
    201 throw;
    \n-
    202 }
    \n-
    203 catch(const Dune::Exception &e) {
    \n-
    204 std::cerr << "Caught exception of type " << Dune::className(e)
    \n-
    205 << std::endl
    \n-
    206 << "Exception message: " << e << std::endl;
    \n-
    207 throw;
    \n-
    208 }
    \n-
    209 catch(const std::string &s) {
    \n-
    210 std::cerr << "Caught exception of type " << Dune::className(s)
    \n-
    211 << std::endl
    \n-
    212 << "Exception message: " << s << std::endl;
    \n-
    213 throw;
    \n-
    214 }
    \n-
    215 catch(...) {
    \n-
    216 std::cerr << "Caught exception of unknown type" << std::endl;
    \n-
    217 throw;
    \n-
    218 }
    \n-
    219}
    \n-
    220#endif // !HEADERCHECK
    \n-
    221#endif // !DOXYGEN
    \n-
    222
    \n-
    223#endif // DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH
    \n-
    int main(int argc, char **argv)
    Definition recipe-integration.cc:65
    \n-\n-
    void fillGridViewInfoSerial(const GV &gv, GridViewInfo< typename GV::ctype > &gridViewInfo)
    fill a GridViewInfo structure from a serial grid
    Definition utility/gridinfo.hh:214
    \n-
    Read Gmsh mesh file.
    Definition gmshreader.hh:840
    \n-
    structure to hold information about a certain GridView.
    Definition utility/gridinfo.hh:100
    \n-\n+
    11#include<array>
    \n+
    12
    \n+
    13namespace Dune
    \n+
    14{
    \n+
    \n+
    15 namespace FactoryUtilities
    \n+
    16 {
    \n+
    17 template<std::size_t dim>
    \n+
    \n+
    18 class MultiIndex : public std::array<unsigned int,dim>
    \n+
    19 {
    \n+
    20 // The range of each component
    \n+
    21 std::array<unsigned int,dim> limits_;
    \n+
    22
    \n+
    23 public:
    \n+
    \n+
    25 MultiIndex(const std::array<unsigned int,dim>& limits) : limits_(limits)
    \n+
    26 {
    \n+
    27 std::fill(this->begin(), this->end(), 0);
    \n+
    28 }
    \n+
    \n+
    29
    \n+
    \n+\n+
    32 {
    \n+
    33 for (std::size_t i=0; i<dim; i++)
    \n+
    34 {
    \n+
    35 // Augment digit
    \n+
    36 (*this)[i]++;
    \n+
    37
    \n+
    38 // If there is no carry-over we can stop here
    \n+
    39 if ((*this)[i]<limits_[i])
    \n+
    40 break;
    \n+
    41
    \n+
    42 (*this)[i] = 0;
    \n+
    43 }
    \n+
    44 return *this;
    \n+
    45 }
    \n+
    \n+
    46
    \n+
    \n+
    48 size_t cycle() const
    \n+
    49 {
    \n+
    50 size_t result = 1;
    \n+
    51 for (std::size_t i=0; i<dim; i++)
    \n+
    52 result *= limits_[i];
    \n+
    53 return result;
    \n+
    54 }
    \n+
    \n+
    55 };
    \n+
    \n+
    56 }
    \n+
    \n+
    57}
    \n+
    58
    \n+
    59#endif
    \n+
    Include standard header files.
    Definition agrid.hh:60
    \n+
    Definition multiindex.hh:19
    \n+
    MultiIndex(const std::array< unsigned int, dim > &limits)
    Constructor with a given range for each digit.
    Definition multiindex.hh:25
    \n+
    MultiIndex< dim > & operator++()
    Increment the MultiIndex.
    Definition multiindex.hh:31
    \n+
    size_t cycle() const
    Compute how many times you can call operator++ before getting to (0,...,0) again.
    Definition multiindex.hh:48
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,229 +1,81 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-gridinfo-gmsh-main.hh\n+multiindex.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=4 sw=2 sts=2:\n+3#ifndef DUNE_GRID_UTILITY_MULTIINDEX_HH\n+4#define DUNE_GRID_UTILITY_MULTIINDEX_HH\n 5\n-6#ifndef DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH\n-7#define DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n-15#include \n-16#include \n-17#include \n-18#include \n-19\n-20#include \n-21#include \n-22#include \n-23\n-24#include \n-25#include \n-26\n-50#ifdef HEADERCHECK\n-51// define so headercheck will run\n-52const std::string programName = \"headercheck\";\n-53#endif // HEADERCHECK\n-54\n-55#ifndef DOXYGEN\n-56namespace {\n-57 // anonymous namespace so we don't freakishly conflict with another usage()\n-58 // function that may be linked in from another compilation unit.\n-59 void usage(std::ostream &stream) {\n-60 stream << \"USAGE:\\n\"\n-61 << \" \" << programName << \" [-R REFINES] GRIDFILE\\n\"\n-62 << \"\\n\"\n-63 << \"PARAMETERS:\\n\"\n-64 << \" -R REFINES How many global refines to do after reading\\n\"\n-65 << \" (default: 0)\\n\"\n-66 << \" GRIDFILE Name of the .msh file to read the grid from.\\n\"\n-67 << std::flush;\n-68 }\n-69\n-70 bool prefix_match(const std::string &prefix, const std::string &str)\n-71 {\n-72 return str.compare(0,prefix.size(), prefix) == 0;\n-73 }\n-74\n-75 void error_argument_required(const std::string &opt) {\n-76 std::cerr << \"Error: option \" << opt << \" requires argument\\n\";\n-77 usage(std::cerr);\n-78 std::exit(1);\n-79 }\n-80\n-81 void error_unknown_option(const std::string &opt) {\n-82 std::cerr << \"Error: unknown option: \" << opt << \"\\n\";\n-83 usage(std::cerr);\n-84 std::exit(1);\n-85 }\n-86\n-87 void error_parsing_optarg(const std::string &opt, const std::string &error)\n-{\n-88 std::cerr << \"Error: option \" << opt << \": \" << error << \"\\n\";\n-89 usage(std::cerr);\n-90 std::exit(1);\n-91 }\n-92\n-93 template\n-94 void parse(const std::string &arg, T &val) {\n-95 std::istringstream s(arg);\n-96 s >> val;\n-97 bool good = !s.fail();\n-98 if(good) {\n-99 char dummy;\n-100 s >> dummy;\n-101 good = s.fail() && s.eof();\n-102 }\n-103 if(!good) {\n-104 std::ostringstream s;\n-105 s << \"Can't parse \\\"\" << arg << \"\\\" as a \" << Dune::className(val);\n-106 throw std::runtime_error(s.str());\n-107 }\n-108 }\n-109\n-110 std::size_t refines = 0;\n-111 std::string gridFileName = \"\";\n-112\n-113 void parseOptions(int argc, char **argv) {\n-114 std::vector params;\n-115 for(++argv; *argv; ++argv) {\n-116 std::string arg = *argv;\n-117 if(prefix_match(\"-\", arg)) {\n-118 std::string opt = arg;\n-119 if(opt == \"--\") {\n-120 for(++argv; *argv; ++argv)\n-121 params.push_back(*argv);\n-122 break;\n-123 }\n-124 else if(prefix_match(\"-h\", opt) || prefix_match(\"-?\", opt) ||\n-125 opt == \"--help\")\n-126 {\n-127 usage(std::cout);\n-128 std::exit(0);\n-129 }\n-130 else if(opt == \"-R\" || opt == \"--global-refines\") {\n-131 ++argv;\n-132 if(!*argv) error_argument_required(opt);\n-133 try { parse(*argv, refines); }\n-134 catch(const std::runtime_error &e)\n-135 { error_parsing_optarg(opt, e.what()); }\n-136 }\n-137 else if(prefix_match(\"-R\", opt)) {\n-138 try { parse(*argv+std::strlen(\"-R\"), refines); }\n-139 catch(const std::runtime_error &e)\n-140 { error_parsing_optarg(opt, e.what()); }\n-141 }\n-142 else if(prefix_match(\"--global-refines=\", opt)) {\n-143 try { parse(*argv+std::strlen(\"--global-refines=\"), refines); }\n-144 catch(const std::runtime_error &e)\n-145 { error_parsing_optarg(opt, e.what()); }\n-146 }\n-147 else\n-148 error_unknown_option(opt);\n-149 }\n-150 else\n-151 params.push_back(arg);\n-152 }\n-153 // check command line arguments\n-154 if(params.size() < 1) {\n-155 std::cerr << \"Need name of a .msh file to read.\\n\"\n-156 << std::endl;\n-157 usage(std::cerr);\n-158 std::exit(1);\n-159 }\n-160 if(params.size() > 1) {\n-161 std::cerr << \"Too many arguments.\\n\"\n-162 << std::endl;\n-163 usage(std::cerr);\n-164 std::exit(1);\n-165 }\n-166 gridFileName = params[0];\n-167 }\n-168}\n-169\n-170#ifndef HEADERCHECK\n-171int main(int argc, char **argv) {\n-172 try {\n-173 const Dune::MPIHelper &mpiHelper = Dune::MPIHelper::instance(argc, argv);\n-174\n-175 // check that we are not run through mpirun\n-176 if(mpiHelper.size() > 1) {\n-177 if(mpiHelper.rank() == 0)\n-178 std::cerr << programName << \": Sorry, this program works only in \"\n-179 << \"serial.\" << std::endl;\n-180 return 1;\n-181 }\n-182\n-183 parseOptions(argc, argv);\n-184\n-185 // read grid\n-186 typedef Dune::GmshReader Reader;\n-187 std::shared_ptr gridp(Reader::read(gridFileName));\n-188 gridp->globalRefine(refines);\n-189\n-190 // collect information\n-191 Dune::GridViewInfo gridViewInfo;\n-192 Dune::fillGridViewInfoSerial(gridp->leafGridView(), gridViewInfo);\n-193\n-194 // print it\n-195 std::cout << gridViewInfo << std::flush;\n-196 }\n-197 catch(const std::exception &e) {\n-198 std::cerr << \"Caught exception of type \" << Dune::className(e)\n-199 << std::endl\n-200 << \"e.what(): \" << e.what() << std::endl;\n-201 throw;\n-202 }\n-203 catch(const Dune::Exception &e) {\n-204 std::cerr << \"Caught exception of type \" << Dune::className(e)\n-205 << std::endl\n-206 << \"Exception message: \" << e << std::endl;\n-207 throw;\n-208 }\n-209 catch(const std::string &s) {\n-210 std::cerr << \"Caught exception of type \" << Dune::className(s)\n-211 << std::endl\n-212 << \"Exception message: \" << s << std::endl;\n-213 throw;\n-214 }\n-215 catch(...) {\n-216 std::cerr << \"Caught exception of unknown type\" << std::endl;\n-217 throw;\n-218 }\n-219}\n-220#endif // !HEADERCHECK\n-221#endif // !DOXYGEN\n-222\n-223#endif // DUNE_GRID_UTILITY_GRIDINFO_GMSH_MAIN_HH\n-main\n-int main(int argc, char **argv)\n-Definition recipe-integration.cc:65\n-gmshreader.hh\n-Dune::fillGridViewInfoSerial\n-void fillGridViewInfoSerial(const GV &gv, GridViewInfo< typename GV::ctype >\n-&gridViewInfo)\n-fill a GridViewInfo structure from a serial grid\n-Definition utility/gridinfo.hh:214\n-Dune::GmshReader\n-Read Gmsh mesh file.\n-Definition gmshreader.hh:840\n-Dune::GridViewInfo\n-structure to hold information about a certain GridView.\n-Definition utility/gridinfo.hh:100\n-gridinfo.hh\n+11#include\n+12\n+13namespace Dune\n+14{\n+15 namespace FactoryUtilities\n+16 {\n+17 template\n+18 class MultiIndex : public std::array\n+19 {\n+20 // The range of each component\n+21 std::array limits_;\n+22\n+23 public:\n+25 MultiIndex(const std::array& limits) : limits_(limits)\n+26 {\n+27 std::fill(this->begin(), this->end(), 0);\n+28 }\n+29\n+31 MultiIndex& operator++()\n+32 {\n+33 for (std::size_t i=0; i &limits)\n+Constructor with a given range for each digit.\n+Definition multiindex.hh:25\n+Dune::FactoryUtilities::MultiIndex::operator++\n+MultiIndex< dim > & operator++()\n+Increment the MultiIndex.\n+Definition multiindex.hh:31\n+Dune::FactoryUtilities::MultiIndex::cycle\n+size_t cycle() const\n+Compute how many times you can call operator++ before getting to (0,...,0)\n+again.\n+Definition multiindex.hh:48\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01004.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01004.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entitycommhelper.hh File Reference\n+dune-grid: gridtype.hh File Reference\n \n \n \n \n \n \n \n@@ -69,43 +69,26 @@\n \n
    \n \n
    \n
    \n
    \n- \n-
    entitycommhelper.hh File Reference
    \n+
    gridtype.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/common/gridenums.hh>
    \n+\n+

    This file can be included directly following config.h to test if a grid type was correctly selected. \n+More...

    \n+
    #include <dune-grid-config.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

    struct  Dune::EntityCommHelper< InteriorBorder_InteriorBorder_Interface >
     
    struct  Dune::EntityCommHelper< InteriorBorder_All_Interface >
     
    struct  Dune::EntityCommHelper< Overlap_OverlapFront_Interface >
     
    struct  Dune::EntityCommHelper< Overlap_All_Interface >
     
    struct  Dune::EntityCommHelper< All_All_Interface >
     
    \n-\n-\n-\n-\n-

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    This file can be included directly following config.h to test if a grid type was correctly selected.

    \n+
    Author
    Andreas Dedner
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,28 +1,19 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-Classes | Namespaces\n-entitycommhelper.hh File Reference\n-#include \n+gridtype.hh File Reference\n+This file can be included directly following config.h to test if a grid type\n+was correctly selected. More...\n+#include \n Go_to_the_source_code_of_this_file.\n-Classes\n-struct \u00a0 Dune::EntityCommHelper<_InteriorBorder_InteriorBorder_Interface_>\n-\u00a0\n-struct \u00a0 Dune::EntityCommHelper<_InteriorBorder_All_Interface_>\n-\u00a0\n-struct \u00a0 Dune::EntityCommHelper<_Overlap_OverlapFront_Interface_>\n-\u00a0\n-struct \u00a0 Dune::EntityCommHelper<_Overlap_All_Interface_>\n-\u00a0\n-struct \u00a0 Dune::EntityCommHelper<_All_All_Interface_>\n-\u00a0\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n+***** Detailed Description *****\n+This file can be included directly following config.h to test if a grid type\n+was correctly selected.\n+ Author\n+ Andreas Dedner\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01004_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01004_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: entitycommhelper.hh Source File\n+dune-grid: gridtype.hh Source File\n \n \n \n \n \n \n \n@@ -74,169 +74,44 @@\n \n
    \n \n
    \n \n
    \n-
    entitycommhelper.hh
    \n+
    gridtype.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ENTITYCOMMHELPER_HH
    \n-
    6#define DUNE_ENTITYCOMMHELPER_HH
    \n+
    5#ifndef DUNE_GRIDTYPE_HH
    \n+
    6#define DUNE_GRIDTYPE_HH
    \n
    7
    \n-\n-
    9
    \n-
    10namespace Dune
    \n-
    11{
    \n-
    12
    \n-
    13 template< InterfaceType iftype >
    \n-\n-
    15
    \n-
    16
    \n-
    17 template<>
    \n-
    \n-\n-
    19 {
    \n-
    \n-
    20 static bool send ( const PartitionType p )
    \n-
    21 {
    \n-
    22 //return (p == InteriorEntity) || (p == BorderEntity);
    \n-
    23 return (p == BorderEntity);
    \n-
    24 }
    \n-
    \n-
    25
    \n-
    \n-
    26 static bool receive ( const PartitionType p )
    \n-
    27 {
    \n-
    28 //return (p == InteriorEntity) || (p == BorderEntity);
    \n-
    29 return (p == BorderEntity);
    \n-
    30 }
    \n-
    \n-
    31 };
    \n-
    \n-
    32
    \n+
    17#include <dune-grid-config.hh> // HAVE_GRIDTYPE
    \n+
    18
    \n+
    19#ifndef HEADERCHECK
    \n+
    20
    \n+
    21// NOGRID is used to specify that no default was set during configure
    \n+
    22// If NOGRID and HAVE_GRIDTYPE are both not set then no grid was selected
    \n+
    23// and an error is produced
    \n+
    24#if defined NOGRID
    \n+
    25 #if ! HAVE_GRIDTYPE
    \n+
    26 #error "No grid type selected, use GRIDTYPE=..."
    \n+
    27 #endif
    \n+
    28#else
    \n+
    29 #if ! HAVE_GRIDTYPE
    \n+
    30 #error "No grid type selected, typo in GRIDTYPE=...?"
    \n+
    31 #endif
    \n+
    32#endif
    \n
    33
    \n-
    34 template<>
    \n-
    \n-\n-
    36 {
    \n-
    \n-
    37 static bool send ( const PartitionType p )
    \n-
    38 {
    \n-
    39 return (p == InteriorEntity) || (p == BorderEntity);
    \n-
    40 }
    \n-
    \n-
    41
    \n-
    \n-
    42 static bool receive ( const PartitionType p )
    \n-
    43 {
    \n-
    44 //return true;
    \n-
    45 return (p != InteriorEntity);
    \n-
    46 }
    \n-
    \n-
    47 };
    \n-
    \n-
    48
    \n-
    49
    \n-
    50 template<>
    \n-
    \n-\n-
    52 {
    \n-
    \n-
    53 static bool send ( const PartitionType p )
    \n-
    54 {
    \n-
    55 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
    \n-
    56 return (p != FrontEntity) && (p != GhostEntity);
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    \n-
    59 static bool receive ( const PartitionType p )
    \n-
    60 {
    \n-
    61 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity) || (p == FrontEntity);
    \n-
    62 return (p != GhostEntity);
    \n-
    63 }
    \n-
    \n-
    64 };
    \n-
    \n-
    65
    \n-
    66
    \n-
    67 template<>
    \n-
    \n-\n-
    69 {
    \n-
    \n-
    70 static bool send ( const PartitionType p )
    \n-
    71 {
    \n-
    72 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
    \n-
    73 return (p != FrontEntity) && (p != GhostEntity);
    \n-
    74 }
    \n-
    \n-
    75
    \n-
    \n-
    76 static bool receive ([[maybe_unused]] const PartitionType p)
    \n-
    77 {
    \n-
    78 return true;
    \n-
    79 }
    \n-
    \n-
    80 };
    \n-
    \n-
    81
    \n-
    82
    \n-
    83 template<>
    \n-
    \n-\n-
    85 {
    \n-
    \n-
    86 static bool send ([[maybe_unused]] const PartitionType p)
    \n-
    87 {
    \n-
    88 return true;
    \n-
    89 }
    \n-
    \n-
    90
    \n-
    \n-
    91 static bool receive ([[maybe_unused]] const PartitionType p)
    \n-
    92 {
    \n-
    93 return true;
    \n-
    94 }
    \n-
    \n-
    95 };
    \n-
    \n-
    96
    \n-
    97} // namespace Dune
    \n-
    98
    \n-
    99#endif // #ifndef DUNE_ENTITYCOMMHELPER_HH
    \n-\n-
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n-
    @ FrontEntity
    on boundary between overlap and ghost
    Definition gridenums.hh:34
    \n-
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n-
    @ GhostEntity
    ghost entities
    Definition gridenums.hh:35
    \n-
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n-
    @ InteriorBorder_All_Interface
    send interior and border, receive all entities
    Definition gridenums.hh:88
    \n-
    @ All_All_Interface
    send all and receive all entities
    Definition gridenums.hh:91
    \n-
    @ Overlap_All_Interface
    send overlap, receive all entities
    Definition gridenums.hh:90
    \n-
    @ Overlap_OverlapFront_Interface
    send overlap, receive overlap and front entities
    Definition gridenums.hh:89
    \n-
    @ InteriorBorder_InteriorBorder_Interface
    send/receive interior and border entities
    Definition gridenums.hh:87
    \n-
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition entitycommhelper.hh:14
    \n-
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:26
    \n-
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:20
    \n-
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:42
    \n-
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:37
    \n-
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:53
    \n-
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:59
    \n-
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:76
    \n-
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:70
    \n-
    static bool send(const PartitionType p)
    Definition entitycommhelper.hh:86
    \n-
    static bool receive(const PartitionType p)
    Definition entitycommhelper.hh:91
    \n+
    34#endif // HEADERCHECK
    \n+
    35
    \n+
    36#endif // DUNE_GRIDTYPE_HH
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,190 +1,39 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-entitycommhelper.hh\n+gridtype.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ENTITYCOMMHELPER_HH\n-6#define DUNE_ENTITYCOMMHELPER_HH\n+5#ifndef DUNE_GRIDTYPE_HH\n+6#define DUNE_GRIDTYPE_HH\n 7\n-8#include \n-9\n-10namespace Dune\n-11{\n-12\n-13 template< InterfaceType iftype >\n-14 struct EntityCommHelper;\n-15\n-16\n-17 template<>\n-18 struct EntityCommHelper< InteriorBorder_InteriorBorder_Interface >\n-19 {\n-20 static bool send ( const PartitionType p )\n-21 {\n-22 //return (p == InteriorEntity) || (p == BorderEntity);\n-23 return (p == BorderEntity);\n-24 }\n-25\n-26 static bool receive ( const PartitionType p )\n-27 {\n-28 //return (p == InteriorEntity) || (p == BorderEntity);\n-29 return (p == BorderEntity);\n-30 }\n-31 };\n-32\n+17#include // HAVE_GRIDTYPE\n+18\n+19#ifndef HEADERCHECK\n+20\n+21// NOGRID is used to specify that no default was set during configure\n+22// If NOGRID and HAVE_GRIDTYPE are both not set then no grid was selected\n+23// and an error is produced\n+24#if defined NOGRID\n+25 #if ! HAVE_GRIDTYPE\n+26 #error \"No grid type selected, use GRIDTYPE=...\"\n+27 #endif\n+28#else\n+29 #if ! HAVE_GRIDTYPE\n+30 #error \"No grid type selected, typo in GRIDTYPE=...?\"\n+31 #endif\n+32#endif\n 33\n-34 template<>\n-35 struct EntityCommHelper< InteriorBorder_All_Interface >\n-36 {\n-37 static bool send ( const PartitionType p )\n-38 {\n-39 return (p == InteriorEntity) || (p == BorderEntity);\n-40 }\n-41\n-42 static bool receive ( const PartitionType p )\n-43 {\n-44 //return true;\n-45 return (p != InteriorEntity);\n-46 }\n-47 };\n-48\n-49\n-50 template<>\n-51 struct EntityCommHelper< Overlap_OverlapFront_Interface >\n-52 {\n-53 static bool send ( const PartitionType p )\n-54 {\n-55 //return (p == InteriorEntity) || (p == BorderEntity) || (p ==\n-OverlapEntity);\n-56 return (p != FrontEntity) && (p != GhostEntity);\n-57 }\n-58\n-59 static bool receive ( const PartitionType p )\n-60 {\n-61 //return (p == InteriorEntity) || (p == BorderEntity) || (p ==\n-OverlapEntity) || (p == FrontEntity);\n-62 return (p != GhostEntity);\n-63 }\n-64 };\n-65\n-66\n-67 template<>\n-68 struct EntityCommHelper< Overlap_All_Interface >\n-69 {\n-70 static bool send ( const PartitionType p )\n-71 {\n-72 //return (p == InteriorEntity) || (p == BorderEntity) || (p ==\n-OverlapEntity);\n-73 return (p != FrontEntity) && (p != GhostEntity);\n-74 }\n-75\n-76 static bool receive ([[maybe_unused]] const PartitionType p)\n-77 {\n-78 return true;\n-79 }\n-80 };\n-81\n-82\n-83 template<>\n-84 struct EntityCommHelper< All_All_Interface >\n-85 {\n-86 static bool send ([[maybe_unused]] const PartitionType p)\n-87 {\n-88 return true;\n-89 }\n-90\n-91 static bool receive ([[maybe_unused]] const PartitionType p)\n-92 {\n-93 return true;\n-94 }\n-95 };\n-96\n-97} // namespace Dune\n-98\n-99#endif // #ifndef DUNE_ENTITYCOMMHELPER_HH\n-gridenums.hh\n-Dune::PartitionType\n-PartitionType\n-Attributes used in the generic overlap model.\n-Definition gridenums.hh:30\n-Dune::FrontEntity\n-@ FrontEntity\n-on boundary between overlap and ghost\n-Definition gridenums.hh:34\n-Dune::InteriorEntity\n-@ InteriorEntity\n-all interior entities\n-Definition gridenums.hh:31\n-Dune::GhostEntity\n-@ GhostEntity\n-ghost entities\n-Definition gridenums.hh:35\n-Dune::BorderEntity\n-@ BorderEntity\n-on boundary between interior and overlap\n-Definition gridenums.hh:32\n-Dune::InteriorBorder_All_Interface\n-@ InteriorBorder_All_Interface\n-send interior and border, receive all entities\n-Definition gridenums.hh:88\n-Dune::All_All_Interface\n-@ All_All_Interface\n-send all and receive all entities\n-Definition gridenums.hh:91\n-Dune::Overlap_All_Interface\n-@ Overlap_All_Interface\n-send overlap, receive all entities\n-Definition gridenums.hh:90\n-Dune::Overlap_OverlapFront_Interface\n-@ Overlap_OverlapFront_Interface\n-send overlap, receive overlap and front entities\n-Definition gridenums.hh:89\n-Dune::InteriorBorder_InteriorBorder_Interface\n-@ InteriorBorder_InteriorBorder_Interface\n-send/receive interior and border entities\n-Definition gridenums.hh:87\n-Dune\n-Include standard header files.\n-Definition agrid.hh:60\n-Dune::EntityCommHelper\n-Definition entitycommhelper.hh:14\n-Dune::EntityCommHelper<_InteriorBorder_InteriorBorder_Interface_>::receive\n-static bool receive(const PartitionType p)\n-Definition entitycommhelper.hh:26\n-Dune::EntityCommHelper<_InteriorBorder_InteriorBorder_Interface_>::send\n-static bool send(const PartitionType p)\n-Definition entitycommhelper.hh:20\n-Dune::EntityCommHelper<_InteriorBorder_All_Interface_>::receive\n-static bool receive(const PartitionType p)\n-Definition entitycommhelper.hh:42\n-Dune::EntityCommHelper<_InteriorBorder_All_Interface_>::send\n-static bool send(const PartitionType p)\n-Definition entitycommhelper.hh:37\n-Dune::EntityCommHelper<_Overlap_OverlapFront_Interface_>::send\n-static bool send(const PartitionType p)\n-Definition entitycommhelper.hh:53\n-Dune::EntityCommHelper<_Overlap_OverlapFront_Interface_>::receive\n-static bool receive(const PartitionType p)\n-Definition entitycommhelper.hh:59\n-Dune::EntityCommHelper<_Overlap_All_Interface_>::receive\n-static bool receive(const PartitionType p)\n-Definition entitycommhelper.hh:76\n-Dune::EntityCommHelper<_Overlap_All_Interface_>::send\n-static bool send(const PartitionType p)\n-Definition entitycommhelper.hh:70\n-Dune::EntityCommHelper<_All_All_Interface_>::send\n-static bool send(const PartitionType p)\n-Definition entitycommhelper.hh:86\n-Dune::EntityCommHelper<_All_All_Interface_>::receive\n-static bool receive(const PartitionType p)\n-Definition entitycommhelper.hh:91\n+34#endif // HEADERCHECK\n+35\n+36#endif // DUNE_GRIDTYPE_HH\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01007.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01007.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainerinterface.hh File Reference\n+dune-grid: tensorgridfactory.hh File Reference\n \n \n \n \n \n \n \n@@ -72,32 +72,50 @@\n
  • dune
  • grid
  • utility
  • \n \n \n
    \n \n-
    persistentcontainerinterface.hh File Reference
    \n+
    tensorgridfactory.hh File Reference
    \n
    \n
    \n \n+

    This file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series. \n+More...

    \n+
    #include <array>
    \n+#include <memory>
    \n+#include <vector>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/grid/common/gridfactory.hh>
    \n+#include <dune/grid/yaspgrid.hh>
    \n+#include <dune/grid/utility/multiindex.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::PersistentContainerInterface< G, T >
     Persistent storage of data on all entities of a grid. More...
    class  Dune::TensorGridFactory< Grid >
     A factory class for conveniently creating tensorproduct grids. More...
     
    class  Dune::TensorGridFactoryCreator< Grid >
     
    class  Dune::TensorGridFactoryCreator< YaspGrid< dim, TensorProductCoordinates< ctype, dim > > >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    This file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series.

    \n+

    The grid generation process is implemented for unstructured grids and for YaspGrid.

    \n+
    Author
    Dominic Kempf
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,19 +2,46 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-persistentcontainerinterface.hh File Reference\n+tensorgridfactory.hh File Reference\n+This file provides a factory class for tensorproduct grids. This is a\n+collection of methods to generate monotonous sequences as needed for a\n+tensorproduct grid. Apart from easy ones for locally equidistant grids, there\n+are also more involved methods like splitting a range according to a geometric\n+series. More...\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 \u00a0 Dune::PersistentContainerInterface<_G,_T_>\n-\u00a0 Persistent storage of data on all entities of a grid. More...\n+class \u00a0 Dune::TensorGridFactory<_Grid_>\n+\u00a0 A factory class for conveniently creating tensorproduct grids. More...\n+\u00a0\n+class \u00a0 Dune::TensorGridFactoryCreator<_Grid_>\n+\u00a0\n+class \u00a0 Dune::TensorGridFactoryCreator<_YaspGrid<_dim,\n+ TensorProductCoordinates<_ctype,_dim_>_>_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+***** Detailed Description *****\n+This file provides a factory class for tensorproduct grids. This is a\n+collection of methods to generate monotonous sequences as needed for a\n+tensorproduct grid. Apart from easy ones for locally equidistant grids, there\n+are also more involved methods like splitting a range according to a geometric\n+series.\n+The grid generation process is implemented for unstructured grids and for\n+YaspGrid.\n+ Author\n+ Dominic Kempf\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01007_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01007_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainerinterface.hh Source File\n+dune-grid: tensorgridfactory.hh Source File\n \n \n \n \n \n \n \n@@ -74,124 +74,403 @@\n \n
    \n \n
    \n \n
    \n-
    persistentcontainerinterface.hh
    \n+
    tensorgridfactory.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH
    \n-
    6#define DUNE_PERSISTENTCONTAINERINTERFACE_HH
    \n-
    7
    \n-
    8#ifndef HEADERCHECK
    \n-
    9#error "This header exists for documentation purposes only and should never be included directly."
    \n-
    10#endif
    \n-
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    53 template< class G, class T >
    \n-
    \n-\n-
    55 {
    \n-\n-
    57
    \n-
    58 struct ImplementationDefined;
    \n-
    59
    \n-
    60 public:
    \n-
    61 typedef G Grid;
    \n-
    62
    \n-
    63 typedef T Value;
    \n+
    3#ifndef DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH
    \n+
    4#define DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH
    \n+
    5
    \n+
    20#include<array>
    \n+
    21#include<memory>
    \n+
    22#include<vector>
    \n+
    23
    \n+
    24#include <dune/common/fvector.hh>
    \n+\n+
    26#include <dune/grid/yaspgrid.hh>
    \n+\n+
    28
    \n+
    29namespace Dune
    \n+
    30{
    \n+
    31 // forward declaration of TensorGridFactoryCreator, which is the real factory
    \n+
    32 // that should be specialized for each grid.
    \n+
    33 template<typename Grid>
    \n+
    34 class TensorGridFactoryCreator;
    \n+
    35
    \n+
    40 template<typename Grid>
    \n+
    \n+\n+
    42 {
    \n+
    43 public:
    \n+
    44 typedef typename Grid::Traits::Communication Comm;
    \n+
    45 typedef typename Grid::ctype ctype;
    \n+
    46 static const int dim = Grid::dimension;
    \n+
    47
    \n+
    \n+
    48 std::unique_ptr<Grid> createGrid(Comm comm = Comm())
    \n+
    49 {
    \n+
    50 TensorGridFactoryCreator<Grid> creator(*this);
    \n+
    51 return creator.createGrid(comm);
    \n+
    52 }
    \n+
    \n+
    53
    \n+
    \n+
    54 std::array<std::vector<ctype> , dim> coords() const
    \n+
    55 {
    \n+
    56 return _coords;
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    \n+
    60 std::vector<ctype>& operator[](std::size_t d)
    \n+
    61 {
    \n+
    62 return _coords[d];
    \n+
    63 }
    \n+
    \n
    64
    \n-
    65 typedef ImplementationDefined Size;
    \n-
    66 typedef ImplementationDefined ConstIterator;
    \n-
    67 typedef ImplementationDefined Iterator;
    \n-
    68
    \n-
    69 // construction
    \n+
    \n+
    66 const std::vector<ctype>& operator[](std::size_t d) const
    \n+
    67 {
    \n+
    68 return _coords[d];
    \n+
    69 }
    \n+
    \n
    70
    \n-
    79 PersistentContainerInterface ( Grid &grid, int codim, const Value &value = Value() );
    \n-
    80
    \n-\n-
    83
    \n-
    85 const This &operator= ( const This &other );
    \n-
    86
    \n-
    87 // element access
    \n-
    88
    \n-
    93 template< class Entity >
    \n-
    94 const Value &operator[] ( const Entity &entity ) const;
    \n-
    95
    \n-
    100 template< class Entity >
    \n-
    101 Value &operator[] ( const Entity &entity );
    \n-
    102
    \n-
    108 template< class Entity >
    \n-
    109 const Value &operator() ( const Entity &entity, int subEntity ) const;
    \n-
    110
    \n-
    116 template< class Entity >
    \n-
    117 Value &operator() ( const Entity &entity, int subEntity );
    \n-
    118
    \n-
    119 // capacity
    \n-
    120
    \n-
    126 Size size () const;
    \n-
    127
    \n-
    141 void resize ( const Value &value = Value() );
    \n-
    142
    \n-
    156 void shrinkToFit ();
    \n+
    \n+
    79 void setStart (int d, ctype value)
    \n+
    80 {
    \n+
    81 _coords[d].resize(1);
    \n+
    82 _coords[d][0] = value;
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    \n+
    93 void fillIntervals (int d, int n, ctype h)
    \n+
    94 {
    \n+
    95 emptyCheck (d);
    \n+
    96 for (int i = 0; i < n; i++)
    \n+
    97 _coords[d].push_back (_coords[d].back () + h);
    \n+
    98 }
    \n+
    \n+
    99
    \n+
    \n+
    108 void fillRange (int d, int n, ctype end)
    \n+
    109 {
    \n+
    110 emptyCheck (d);
    \n+
    111 const ctype h = (end - _coords[d].back ()) / n;
    \n+
    112 for (int i = 0; i < n - 1; i++)
    \n+
    113 _coords[d].push_back (_coords[d].back () + h);
    \n+
    114 _coords[d].push_back (end);
    \n+
    115 }
    \n+
    \n+
    116
    \n+
    \n+
    125 void fillUntil (int d, ctype h, ctype end)
    \n+
    126 {
    \n+
    127 emptyCheck (d);
    \n+
    128 while (_coords[d].back () < end)
    \n+
    129 _coords[d].push_back (_coords[d].back () + h);
    \n+
    130 }
    \n+
    \n+
    131
    \n+
    \n+
    144 void geometricFillIntervals (int d, int n, ctype ratio, ctype h0 =
    \n+
    145 static_cast<ctype> (0))
    \n+
    146 {
    \n+
    147 emptyCheck (d);
    \n+
    148 ctype h = h0;
    \n+
    149 if (h0 == static_cast<ctype>(0))
    \n+
    150 h = lastInterval (d) * ratio;
    \n+
    151 for (int i = 0; i < n; i++)
    \n+
    152 {
    \n+
    153 _coords[d].push_back (_coords[d].back () + h);
    \n+
    154 h *= ratio;
    \n+
    155 }
    \n+
    156 }
    \n+
    \n
    157
    \n-
    158 // modifiers
    \n-
    159
    \n-
    165 void fill ( const Value &value );
    \n-
    166
    \n-
    171 void swap ( This &other );
    \n-
    172
    \n-
    173 // iterators
    \n-
    174
    \n-\n-\n-
    187
    \n-\n-\n-
    200
    \n-
    201 // information
    \n-
    202
    \n-
    204 int codimension () const;
    \n-
    205 };
    \n-
    \n-
    206
    \n-
    207} // namespace Dune
    \n-
    208
    \n-
    209#endif // #ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH
    \n+
    \n+
    170 void geometricFillUntil (int d, ctype ratio, ctype end, ctype h0 = static_cast<ctype> (0))
    \n+
    171 {
    \n+
    172 emptyCheck (d);
    \n+
    173 ctype h = h0;
    \n+
    174 if (h0 == static_cast<ctype>(0))
    \n+
    175 h = lastInterval (d) * ratio;
    \n+
    176 while (_coords[d].back () < end)
    \n+
    177 {
    \n+
    178 _coords[d].push_back (_coords[d].back () + h);
    \n+
    179 h *= ratio;
    \n+
    180 }
    \n+
    181 }
    \n+
    \n+
    182
    \n+
    \n+
    197 void geometricFillRange (int d, int n, ctype end, ctype h =
    \n+
    198 static_cast<ctype> (0),
    \n+
    199 bool first = true)
    \n+
    200 {
    \n+
    201 emptyCheck (d);
    \n+
    202 if (h < 1e-8)
    \n+
    203 h = lastInterval (d);
    \n+
    204 ctype ratio = newton (n, _coords[d].back (), end, h);
    \n+
    205 if (!first)
    \n+
    206 {
    \n+
    207 h = h * pow (ratio, n - 1);
    \n+
    208 ratio = 1 / ratio;
    \n+
    209 }
    \n+
    210 for (int i = 0; i < n - 1; i++)
    \n+
    211 {
    \n+
    212 _coords[d].push_back (_coords[d].back () + h);
    \n+
    213 h *= ratio;
    \n+
    214 }
    \n+
    215 _coords[d].push_back (end);
    \n+
    216 }
    \n+
    \n+
    217
    \n+
    \n+
    219 void print()
    \n+
    220 {
    \n+
    221 for (int i=0; i<dim; i++)
    \n+
    222 {
    \n+
    223 std::cout << "Container in direction " << i << ":" << std::endl << "Coordinates: ";
    \n+
    224 for (auto it = _coords[i].begin(); it != _coords[i].end(); ++it)
    \n+
    225 std::cout << *it << " ";
    \n+
    226 std::cout << std::endl << "Interval lengths: ";
    \n+
    227
    \n+
    228 std::vector<ctype> meshsize;
    \n+
    229 for (auto it = _coords[i].begin(); it != _coords[i].end()-1;)
    \n+
    230 {
    \n+
    231 meshsize.push_back(-1.*(*it));
    \n+
    232 ++it;
    \n+
    233 meshsize.back() += *it;
    \n+
    234 }
    \n+
    235
    \n+
    236 for (auto it = meshsize.begin(); it != meshsize.end(); ++it)
    \n+
    237 std::cout << *it << " ";
    \n+
    238 std::cout << std::endl << "Ratios between interval lengths: ";
    \n+
    239
    \n+
    240 std::vector<ctype> ratios;
    \n+
    241 for (auto it = meshsize.begin(); it != meshsize.end() - 1 ;)
    \n+
    242 ratios.push_back((1./(*it)) * *(++it));
    \n+
    243
    \n+
    244 for (auto it = ratios.begin(); it != ratios.end(); ++it)
    \n+
    245 std::cout << *it << " ";
    \n+
    246 std::cout << std::endl << std::endl << std::endl;
    \n+
    247 }
    \n+
    248 }
    \n+
    \n+
    249
    \n+
    250 private:
    \n+
    251 // check whether the ith component is empty and add a 0.0 entry if so
    \n+
    252 void emptyCheck (int i)
    \n+
    253 {
    \n+
    254 if (_coords[i].empty ())
    \n+
    255 _coords[i].push_back (static_cast<ctype> (0));
    \n+
    256 }
    \n+
    257
    \n+
    258 // returns the last interval length in direction d
    \n+
    259 ctype lastInterval (int d)
    \n+
    260 {
    \n+
    261 if (_coords[d].size () < 2)
    \n+
    262 DUNE_THROW(
    \n+
    263 GridError,
    \n+
    264 "Not enough elements in coordinate container to deduce interval length in TensorYaspFactory");
    \n+
    265 else
    \n+
    266 return _coords[d].back () - _coords[d][_coords[d].size () - 2];
    \n+
    267 }
    \n+
    268
    \n+
    272 ctype newton (int n, ctype x_s, ctype x_e, ctype h)
    \n+
    273 {
    \n+
    274 ctype m = (x_e - x_s) / h;
    \n+
    275 ctype xold = 0.0;
    \n+
    276 ctype xnew = x_e - x_s;
    \n+
    277 while (std::abs (xnew - xold) > 1E-8)
    \n+
    278 {
    \n+
    279 xold = xnew;
    \n+
    280 xnew = xold
    \n+
    281 - (-pow (xold, n) + m * xold - m + 1)
    \n+
    282 / (-n * pow (xold, n - 1) + m);
    \n+
    283 }
    \n+
    284 if (std::abs (xnew - 1) < 1E-6)
    \n+
    285 {
    \n+
    286 xold = x_e - x_s;
    \n+
    287 xnew = 0.0;
    \n+
    288 while (std::abs (xnew - xold) > 1E-8)
    \n+
    289 {
    \n+
    290 xold = xnew;
    \n+
    291 xnew = xold
    \n+
    292 - (-pow (xold, n) + m * xold - m + 1)
    \n+
    293 / (-n * pow (xold, n - 1) + m);
    \n+
    294 }
    \n+
    295 }
    \n+
    296 return xnew;
    \n+
    297 }
    \n+
    298
    \n+
    299 std::array<std::vector<ctype>, dim> _coords;
    \n+
    300 };
    \n+
    \n+
    301
    \n+
    302 // class that implements the actual grid creation process. The default is implementing
    \n+
    303 // standard creation for unstructured grids. Provide a specialization for other grids.
    \n+
    304 template<typename Grid>
    \n+
    \n+\n+
    306 {
    \n+
    307 public:
    \n+
    308 typedef typename Grid::Traits::Communication Comm;
    \n+
    309 typedef typename Grid::ctype ctype;
    \n+
    310 static const int dim = Grid::dimension;
    \n+
    311
    \n+
    312 TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
    \n+
    313
    \n+
    \n+
    314 std::unique_ptr<Grid> createGrid(Comm comm)
    \n+
    315 {
    \n+
    316 // The grid factory
    \n+\n+
    318
    \n+
    319 if (comm.rank() == 0)
    \n+
    320 {
    \n+
    321 // determine the size of the grid
    \n+
    322 std::array<unsigned int, dim> vsizes, esizes;
    \n+
    323 std::size_t size = 1;
    \n+
    324 for (std::size_t i = 0; i<dim; ++i)
    \n+
    325 {
    \n+
    326 vsizes[i] = _factory[i].size();
    \n+
    327 esizes[i] = vsizes[i] - 1;
    \n+
    328 size *= vsizes[i];
    \n+
    329 }
    \n+
    330
    \n+
    331 // insert all vertices
    \n+\n+
    333 for (std::size_t i=0; i<size; ++i, ++index)
    \n+
    334 {
    \n+
    335 Dune::FieldVector<ctype, dim> position;
    \n+
    336 for (std::size_t j = 0; j<dim; ++j)
    \n+
    337 position[j] = _factory[j][index[j]];
    \n+
    338 fac.insertVertex(position);
    \n+
    339 }
    \n+
    340
    \n+
    341 // compute the offsets
    \n+
    342 std::array<std::size_t, dim> offsets;
    \n+
    343 offsets[0] = 1;
    \n+
    344 for (std::size_t i=1; i<dim; i++)
    \n+
    345 offsets[i] = offsets[i-1] * vsizes[i-1];
    \n+
    346
    \n+
    347 // Compute an element template (the cube at (0,...,0). All
    \n+
    348 // other cubes are constructed by moving this template around
    \n+
    349 unsigned int nCorners = 1<<dim;
    \n+
    350
    \n+
    351 std::vector<unsigned int> cornersTemplate(nCorners,0);
    \n+
    352
    \n+
    353 for (size_t i=0; i<nCorners; i++)
    \n+
    354 for (int j=0; j<dim; j++)
    \n+
    355 if ( i & (1<<j) )
    \n+
    356 cornersTemplate[i] += offsets[j];
    \n+
    357
    \n+
    358 // Insert elements
    \n+\n+
    360
    \n+
    361 // Compute the total number of elements to be created
    \n+
    362 int numElements = eindex.cycle();
    \n+
    363
    \n+
    364 for (int i=0; i<numElements; i++, ++eindex)
    \n+
    365 {
    \n+
    366 // 'base' is the index of the lower left element corner
    \n+
    367 unsigned int base = 0;
    \n+
    368 for (int j=0; j<dim; j++)
    \n+
    369 base += eindex[j] * offsets[j];
    \n+
    370
    \n+
    371 // insert new element
    \n+
    372 std::vector<unsigned int> corners = cornersTemplate;
    \n+
    373 for (size_t j=0; j<corners.size(); j++)
    \n+
    374 corners[j] += base;
    \n+
    375
    \n+
    376 fac.insertElement(GeometryTypes::cube(dim), corners);
    \n+
    377 }
    \n+
    378 }
    \n+
    379
    \n+
    380 return std::unique_ptr<Grid>(fac.createGrid());
    \n+
    381 }
    \n+
    \n+
    382
    \n+
    383 private:
    \n+
    384 const TensorGridFactory<Grid>& _factory;
    \n+
    385 };
    \n+
    \n+
    386
    \n+
    387 template<typename ctype, int dim>
    \n+
    \n+\n+
    389 {
    \n+
    390 public:
    \n+\n+
    392 typedef typename Grid::Communication Comm;
    \n+
    393
    \n+
    394 TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
    \n+
    395
    \n+
    \n+
    396 std::unique_ptr<Grid> createGrid(Comm comm)
    \n+
    397 {
    \n+
    398 return std::make_unique<Grid>(_factory.coords(), std::bitset<dim>(0ULL), 1, comm);
    \n+
    399 }
    \n+
    \n+
    400 private:
    \n+
    401 const TensorGridFactory<Grid>& _factory;
    \n+
    402 };
    \n+
    \n+
    403}
    \n+
    404
    \n+
    405#endif
    \n+
    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various facto...
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Persistent storage of data on all entities of a grid.
    Definition persistentcontainerinterface.hh:55
    \n-
    ImplementationDefined Size
    Definition persistentcontainerinterface.hh:65
    \n-
    PersistentContainerInterface(Grid &grid, int codim, const Value &value=Value())
    constructor
    \n-
    const Value & operator[](const Entity &entity) const
    access the data associated with an entity
    \n-
    T Value
    Definition persistentcontainerinterface.hh:63
    \n-
    Size size() const
    number of entries in the container
    \n-
    ImplementationDefined Iterator
    Definition persistentcontainerinterface.hh:67
    \n-
    PersistentContainerInterface(const This &other)
    copy constructor
    \n-
    ImplementationDefined ConstIterator
    Definition persistentcontainerinterface.hh:66
    \n-
    ConstIterator end() const
    returns an iterator pointing to the last element of the container
    \n-
    ConstIterator begin() const
    returns an iterator pointing to the first element of the container
    \n-
    Iterator begin()
    returns an iterator pointing to the first element of the container
    \n-
    Iterator end()
    returns an iterator pointing to the last element of the container
    \n-
    void shrinkToFit()
    remove unnecessary entries from container
    \n-
    int codimension() const
    return the codimension, the container attaches data to
    \n-
    G Grid
    Definition persistentcontainerinterface.hh:61
    \n-
    void swap(This &other)
    exchange the content of the container with another one
    \n-
    void resize(const Value &value=Value())
    reserve memory for all entities in the grid
    \n-
    void fill(const Value &value)
    set all accessible entries to a given value
    \n-
    const Value & operator()(const Entity &entity, int subEntity) const
    access the data associated with a subentity
    \n-
    const This & operator=(const This &other)
    assignment operator
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    ct ctype
    Define type used for coordinates in grid module.
    Definition common/grid.hh:518
    \n+
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:275
    \n+
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
    Insert an element into the coarse grid.
    Definition common/gridfactory.hh:307
    \n+
    virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
    Insert a vertex into the coarse grid.
    Definition common/gridfactory.hh:296
    \n+
    virtual std::unique_ptr< GridType > createGrid()
    Finalize grid creation and hand over the grid.
    Definition common/gridfactory.hh:333
    \n+
    Definition multiindex.hh:19
    \n+
    size_t cycle() const
    Compute how many times you can call operator++ before getting to (0,...,0) again.
    Definition multiindex.hh:48
    \n+
    Definition tensorgridfactory.hh:306
    \n+
    Grid::ctype ctype
    Definition tensorgridfactory.hh:309
    \n+
    Grid::Traits::Communication Comm
    Definition tensorgridfactory.hh:308
    \n+
    TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)
    Definition tensorgridfactory.hh:312
    \n+
    std::unique_ptr< Grid > createGrid(Comm comm)
    Definition tensorgridfactory.hh:314
    \n+
    static const int dim
    Definition tensorgridfactory.hh:310
    \n+
    A factory class for conveniently creating tensorproduct grids.
    Definition tensorgridfactory.hh:42
    \n+
    void fillRange(int d, int n, ctype end)
    fills the range to end with n intervals in direction d
    Definition tensorgridfactory.hh:108
    \n+
    void geometricFillRange(int d, int n, ctype end, ctype h=static_cast< ctype >(0), bool first=true)
    fills a coordinate range in direction d with n intervals according to a geometric series
    Definition tensorgridfactory.hh:197
    \n+
    Grid::ctype ctype
    Definition tensorgridfactory.hh:45
    \n+
    void fillUntil(int d, ctype h, ctype end)
    adds intervals in direction d until a given coordinate is reached
    Definition tensorgridfactory.hh:125
    \n+
    void geometricFillUntil(int d, ctype ratio, ctype end, ctype h0=static_cast< ctype >(0))
    adds intervals in direction d according with a given length ratio until a given coordinate is reached
    Definition tensorgridfactory.hh:170
    \n+
    static const int dim
    Definition tensorgridfactory.hh:46
    \n+
    void print()
    print the coordinate information given to the factory so far
    Definition tensorgridfactory.hh:219
    \n+
    void fillIntervals(int d, int n, ctype h)
    pushs n intervals of length h in direction d
    Definition tensorgridfactory.hh:93
    \n+
    void setStart(int d, ctype value)
    set a starting value in a given direction d
    Definition tensorgridfactory.hh:79
    \n+
    void geometricFillIntervals(int d, int n, ctype ratio, ctype h0=static_cast< ctype >(0))
    adds n intervals in direction d with a given length ratio and a given starting interval length.
    Definition tensorgridfactory.hh:144
    \n+
    std::vector< ctype > & operator[](std::size_t d)
    allow to manually tune the factory by overloading operator[] to export the coordinate vectors in the ...
    Definition tensorgridfactory.hh:60
    \n+
    const std::vector< ctype > & operator[](std::size_t d) const
    allow to manually tune the factory by overloading operator[] to export the coordinate vectors in the ...
    Definition tensorgridfactory.hh:66
    \n+
    std::unique_ptr< Grid > createGrid(Comm comm=Comm())
    Definition tensorgridfactory.hh:48
    \n+
    Grid::Traits::Communication Comm
    Definition tensorgridfactory.hh:44
    \n+
    std::array< std::vector< ctype >, dim > coords() const
    Definition tensorgridfactory.hh:54
    \n+
    std::unique_ptr< Grid > createGrid(Comm comm)
    Definition tensorgridfactory.hh:396
    \n+
    TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)
    Definition tensorgridfactory.hh:394
    \n+\n+
    YaspGrid< dim, TensorProductCoordinates< ctype, dim > > Grid
    Definition tensorgridfactory.hh:391
    \n+
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n+
    typename Base::Communication Communication
    Definition yaspgrid.hh:181
    \n+
    Coordinate container for a tensor product YaspGrid.
    Definition coordinates.hh:245
    \n+
    Provide a generic factory class for unstructured grids.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,165 +1,481 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-persistentcontainerinterface.hh\n+tensorgridfactory.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH\n-6#define DUNE_PERSISTENTCONTAINERINTERFACE_HH\n-7\n-8#ifndef HEADERCHECK\n-9#error \"This header exists for documentation purposes only and should never be\n-included directly.\"\n-10#endif\n-11\n-12namespace Dune\n-13{\n-14\n-53 template< class G, class T >\n-54 class PersistentContainerInterface\n+3#ifndef DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH\n+4#define DUNE_GRID_UTILITY_TENSORGRIDFACTORY_HH\n+5\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+29namespace Dune\n+30{\n+31 // forward declaration of TensorGridFactoryCreator, which is the real\n+factory\n+32 // that should be specialized for each grid.\n+33 template\n+34 class TensorGridFactoryCreator;\n+35\n+40 template\n+41 class TensorGridFactory\n+42 {\n+43 public:\n+44 typedef typename Grid::Traits::Communication Comm;\n+45 typedef typename Grid::ctype ctype;\n+46 static const int dim = Grid::dimension;\n+47\n+48 std::unique_ptr createGrid(Comm comm = Comm())\n+49 {\n+50 TensorGridFactoryCreator creator(*this);\n+51 return creator.createGrid(comm);\n+52 }\n+53\n+54 std::array , dim> coords() const\n 55 {\n-56 typedef PersistentContainerInterface<_G,_T_> This;\n-57\n-58 struct ImplementationDefined;\n-59\n-60 public:\n-61 typedef G Grid;\n-62\n-63 typedef T Value;\n+56 return _coords;\n+57 }\n+58\n+60 std::vector& operator[](std::size_t d)\n+61 {\n+62 return _coords[d];\n+63 }\n 64\n-65 typedef ImplementationDefined Size;\n-66 typedef ImplementationDefined ConstIterator;\n-67 typedef ImplementationDefined Iterator;\n-68\n-69 // construction\n+66 const std::vector& operator[](std::size_t d) const\n+67 {\n+68 return _coords[d];\n+69 }\n 70\n-79 PersistentContainerInterface ( Grid &grid, int codim, const Value &value =\n-Value() );\n-80\n-82 PersistentContainerInterface ( const This &other );\n-83\n-85 const This &operator=_( const This &other );\n-86\n-87 // element access\n-88\n-93 template< class Entity >\n-94 const Value &operator[]_( const Entity &entity ) const;\n-95\n-100 template< class Entity >\n-101 Value &operator[]_( const Entity &entity );\n-102\n-108 template< class Entity >\n-109 const Value &operator()_( const Entity &entity, int subEntity ) const;\n-110\n-116 template< class Entity >\n-117 Value &operator()_( const Entity &entity, int subEntity );\n-118\n-119 // capacity\n-120\n-126 Size size () const;\n-127\n-141 void resize ( const Value &value = Value() );\n-142\n-156 void shrinkToFit ();\n+79 void setStart (int d, ctype value)\n+80 {\n+81 _coords[d].resize(1);\n+82 _coords[d][0] = value;\n+83 }\n+84\n+93 void fillIntervals (int d, int n, ctype h)\n+94 {\n+95 emptyCheck (d);\n+96 for (int i = 0; i < n; i++)\n+97 _coords[d].push_back (_coords[d].back () + h);\n+98 }\n+99\n+108 void fillRange (int d, int n, ctype end)\n+109 {\n+110 emptyCheck (d);\n+111 const ctype h = (end - _coords[d].back ()) / n;\n+112 for (int i = 0; i < n - 1; i++)\n+113 _coords[d].push_back (_coords[d].back () + h);\n+114 _coords[d].push_back (end);\n+115 }\n+116\n+125 void fillUntil (int d, ctype h, ctype end)\n+126 {\n+127 emptyCheck (d);\n+128 while (_coords[d].back () < end)\n+129 _coords[d].push_back (_coords[d].back () + h);\n+130 }\n+131\n+144 void geometricFillIntervals (int d, int n, ctype ratio, ctype h0 =\n+145 static_cast (0))\n+146 {\n+147 emptyCheck (d);\n+148 ctype h = h0;\n+149 if (h0 == static_cast(0))\n+150 h = lastInterval (d) * ratio;\n+151 for (int i = 0; i < n; i++)\n+152 {\n+153 _coords[d].push_back (_coords[d].back () + h);\n+154 h *= ratio;\n+155 }\n+156 }\n 157\n-158 // modifiers\n-159\n-165 void fill ( const Value &value );\n-166\n-171 void swap ( This &other );\n-172\n-173 // iterators\n-174\n-180 ConstIterator begin () const;\n-186 Iterator begin ();\n-187\n-193 ConstIterator end () const;\n-199 Iterator end ();\n-200\n-201 // information\n-202\n-204 int codimension () const;\n-205 };\n-206\n-207} // namespace Dune\n-208\n-209#endif // #ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH\n+170 void geometricFillUntil (int d, ctype ratio, ctype end, ctype h0 = static_\n+cast (0))\n+171 {\n+172 emptyCheck (d);\n+173 ctype h = h0;\n+174 if (h0 == static_cast(0))\n+175 h = lastInterval (d) * ratio;\n+176 while (_coords[d].back () < end)\n+177 {\n+178 _coords[d].push_back (_coords[d].back () + h);\n+179 h *= ratio;\n+180 }\n+181 }\n+182\n+197 void geometricFillRange (int d, int n, ctype end, ctype h =\n+198 static_cast (0),\n+199 bool first = true)\n+200 {\n+201 emptyCheck (d);\n+202 if (h < 1e-8)\n+203 h = lastInterval (d);\n+204 ctype ratio = newton (n, _coords[d].back (), end, h);\n+205 if (!first)\n+206 {\n+207 h = h * pow (ratio, n - 1);\n+208 ratio = 1 / ratio;\n+209 }\n+210 for (int i = 0; i < n - 1; i++)\n+211 {\n+212 _coords[d].push_back (_coords[d].back () + h);\n+213 h *= ratio;\n+214 }\n+215 _coords[d].push_back (end);\n+216 }\n+217\n+219 void print()\n+220 {\n+221 for (int i=0; i meshsize;\n+229 for (auto it = _coords[i].begin(); it != _coords[i].end()-1;)\n+230 {\n+231 meshsize.push_back(-1.*(*it));\n+232 ++it;\n+233 meshsize.back() += *it;\n+234 }\n+235\n+236 for (auto it = meshsize.begin(); it != meshsize.end(); ++it)\n+237 std::cout << *it << \" \";\n+238 std::cout << std::endl << \"Ratios between interval lengths: \";\n+239\n+240 std::vector ratios;\n+241 for (auto it = meshsize.begin(); it != meshsize.end() - 1 ;)\n+242 ratios.push_back((1./(*it)) * *(++it));\n+243\n+244 for (auto it = ratios.begin(); it != ratios.end(); ++it)\n+245 std::cout << *it << \" \";\n+246 std::cout << std::endl << std::endl << std::endl;\n+247 }\n+248 }\n+249\n+250 private:\n+251 // check whether the ith component is empty and add a 0.0 entry if so\n+252 void emptyCheck (int i)\n+253 {\n+254 if (_coords[i].empty ())\n+255 _coords[i].push_back (static_cast (0));\n+256 }\n+257\n+258 // returns the last interval length in direction d\n+259 ctype lastInterval (int d)\n+260 {\n+261 if (_coords[d].size () < 2)\n+262 DUNE_THROW(\n+263 GridError,\n+264 \"Not enough elements in coordinate container to deduce interval length in\n+TensorYaspFactory\");\n+265 else\n+266 return _coords[d].back () - _coords[d][_coords[d].size () - 2];\n+267 }\n+268\n+272 ctype newton (int n, ctype x_s, ctype x_e, ctype h)\n+273 {\n+274 ctype m = (x_e - x_s) / h;\n+275 ctype xold = 0.0;\n+276 ctype xnew = x_e - x_s;\n+277 while (std::abs (xnew - xold) > 1E-8)\n+278 {\n+279 xold = xnew;\n+280 xnew = xold\n+281 - (-pow (xold, n) + m * xold - m + 1)\n+282 / (-n * pow (xold, n - 1) + m);\n+283 }\n+284 if (std::abs (xnew - 1) < 1E-6)\n+285 {\n+286 xold = x_e - x_s;\n+287 xnew = 0.0;\n+288 while (std::abs (xnew - xold) > 1E-8)\n+289 {\n+290 xold = xnew;\n+291 xnew = xold\n+292 - (-pow (xold, n) + m * xold - m + 1)\n+293 / (-n * pow (xold, n - 1) + m);\n+294 }\n+295 }\n+296 return xnew;\n+297 }\n+298\n+299 std::array, dim> _coords;\n+300 };\n+301\n+302 // class that implements the actual grid creation process. The default is\n+implementing\n+303 // standard creation for unstructured grids. Provide a specialization for\n+other grids.\n+304 template\n+305 class TensorGridFactoryCreator\n+306 {\n+307 public:\n+308 typedef typename Grid::Traits::Communication Comm;\n+309 typedef typename Grid::ctype ctype;\n+310 static const int dim = Grid::dimension;\n+311\n+312 TensorGridFactoryCreator(const TensorGridFactory& factory) : _factory\n+(factory) {}\n+313\n+314 std::unique_ptr createGrid(Comm comm)\n+315 {\n+316 // The grid factory\n+317 GridFactory fac;\n+318\n+319 if (comm.rank() == 0)\n+320 {\n+321 // determine the size of the grid\n+322 std::array vsizes, esizes;\n+323 std::size_t size = 1;\n+324 for (std::size_t i = 0; i index(vsizes);\n+333 for (std::size_t i=0; i position;\n+336 for (std::size_t j = 0; j offsets;\n+343 offsets[0] = 1;\n+344 for (std::size_t i=1; i cornersTemplate(nCorners,0);\n+352\n+353 for (size_t i=0; i eindex(esizes);\n+360\n+361 // Compute the total number of elements to be created\n+362 int numElements = eindex.cycle();\n+363\n+364 for (int i=0; i corners = cornersTemplate;\n+373 for (size_t j=0; j(fac.createGrid());\n+381 }\n+382\n+383 private:\n+384 const TensorGridFactory& _factory;\n+385 };\n+386\n+387 template\n+388 class TensorGridFactoryCreator > >\n+389 {\n+390 public:\n+391 typedef YaspGrid > Grid;\n+392 typedef typename Grid::Communication Comm;\n+393\n+394 TensorGridFactoryCreator(const TensorGridFactory& factory) : _factory\n+(factory) {}\n+395\n+396 std::unique_ptr createGrid(Comm comm)\n+397 {\n+398 return std::make_unique(_factory.coords(), std::bitset(0ULL), 1,\n+comm);\n+399 }\n+400 private:\n+401 const TensorGridFactory& _factory;\n+402 };\n+403}\n+404\n+405#endif\n+multiindex.hh\n+Implements a multiindex with arbitrary dimension and fixed index ranges This is\n+used by various facto...\n+yaspgrid.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::PersistentContainerInterface\n-Persistent storage of data on all entities of a grid.\n-Definition persistentcontainerinterface.hh:55\n-Dune::PersistentContainerInterface::Size\n-ImplementationDefined Size\n-Definition persistentcontainerinterface.hh:65\n-Dune::PersistentContainerInterface::PersistentContainerInterface\n-PersistentContainerInterface(Grid &grid, int codim, const Value &value=Value())\n-constructor\n-Dune::PersistentContainerInterface::operator[]\n-const Value & operator[](const Entity &entity) const\n-access the data associated with an entity\n-Dune::PersistentContainerInterface::Value\n-T Value\n-Definition persistentcontainerinterface.hh:63\n-Dune::PersistentContainerInterface::size\n-Size size() const\n-number of entries in the container\n-Dune::PersistentContainerInterface::Iterator\n-ImplementationDefined Iterator\n-Definition persistentcontainerinterface.hh:67\n-Dune::PersistentContainerInterface::PersistentContainerInterface\n-PersistentContainerInterface(const This &other)\n-copy constructor\n-Dune::PersistentContainerInterface::ConstIterator\n-ImplementationDefined ConstIterator\n-Definition persistentcontainerinterface.hh:66\n-Dune::PersistentContainerInterface::end\n-ConstIterator end() const\n-returns an iterator pointing to the last element of the container\n-Dune::PersistentContainerInterface::begin\n-ConstIterator begin() const\n-returns an iterator pointing to the first element of the container\n-Dune::PersistentContainerInterface::begin\n-Iterator begin()\n-returns an iterator pointing to the first element of the container\n-Dune::PersistentContainerInterface::end\n-Iterator end()\n-returns an iterator pointing to the last element of the container\n-Dune::PersistentContainerInterface::shrinkToFit\n-void shrinkToFit()\n-remove unnecessary entries from container\n-Dune::PersistentContainerInterface::codimension\n-int codimension() const\n-return the codimension, the container attaches data to\n-Dune::PersistentContainerInterface::Grid\n-G Grid\n-Definition persistentcontainerinterface.hh:61\n-Dune::PersistentContainerInterface::swap\n-void swap(This &other)\n-exchange the content of the container with another one\n-Dune::PersistentContainerInterface::resize\n-void resize(const Value &value=Value())\n-reserve memory for all entities in the grid\n-Dune::PersistentContainerInterface::fill\n-void fill(const Value &value)\n-set all accessible entries to a given value\n-Dune::PersistentContainerInterface::operator()\n-const Value & operator()(const Entity &entity, int subEntity) const\n-access the data associated with a subentity\n-Dune::PersistentContainerInterface::operator=\n-const This & operator=(const This &other)\n-assignment operator\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::ctype\n+ct ctype\n+Define type used for coordinates in grid module.\n+Definition common/grid.hh:518\n+Dune::GridFactory\n+Provide a generic factory class for unstructured grids.\n+Definition common/gridfactory.hh:275\n+Dune::GridFactory::insertElement\n+virtual void insertElement(const GeometryType &type, const std::vector<\n+unsigned int > &vertices)\n+Insert an element into the coarse grid.\n+Definition common/gridfactory.hh:307\n+Dune::GridFactory::insertVertex\n+virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)\n+Insert a vertex into the coarse grid.\n+Definition common/gridfactory.hh:296\n+Dune::GridFactory::createGrid\n+virtual std::unique_ptr< GridType > createGrid()\n+Finalize grid creation and hand over the grid.\n+Definition common/gridfactory.hh:333\n+Dune::FactoryUtilities::MultiIndex\n+Definition multiindex.hh:19\n+Dune::FactoryUtilities::MultiIndex::cycle\n+size_t cycle() const\n+Compute how many times you can call operator++ before getting to (0,...,0)\n+again.\n+Definition multiindex.hh:48\n+Dune::TensorGridFactoryCreator\n+Definition tensorgridfactory.hh:306\n+Dune::TensorGridFactoryCreator::ctype\n+Grid::ctype ctype\n+Definition tensorgridfactory.hh:309\n+Dune::TensorGridFactoryCreator::Comm\n+Grid::Traits::Communication Comm\n+Definition tensorgridfactory.hh:308\n+Dune::TensorGridFactoryCreator::TensorGridFactoryCreator\n+TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)\n+Definition tensorgridfactory.hh:312\n+Dune::TensorGridFactoryCreator::createGrid\n+std::unique_ptr< Grid > createGrid(Comm comm)\n+Definition tensorgridfactory.hh:314\n+Dune::TensorGridFactoryCreator::dim\n+static const int dim\n+Definition tensorgridfactory.hh:310\n+Dune::TensorGridFactory\n+A factory class for conveniently creating tensorproduct grids.\n+Definition tensorgridfactory.hh:42\n+Dune::TensorGridFactory::fillRange\n+void fillRange(int d, int n, ctype end)\n+fills the range to end with n intervals in direction d\n+Definition tensorgridfactory.hh:108\n+Dune::TensorGridFactory::geometricFillRange\n+void geometricFillRange(int d, int n, ctype end, ctype h=static_cast< ctype >\n+(0), bool first=true)\n+fills a coordinate range in direction d with n intervals according to a\n+geometric series\n+Definition tensorgridfactory.hh:197\n+Dune::TensorGridFactory::ctype\n+Grid::ctype ctype\n+Definition tensorgridfactory.hh:45\n+Dune::TensorGridFactory::fillUntil\n+void fillUntil(int d, ctype h, ctype end)\n+adds intervals in direction d until a given coordinate is reached\n+Definition tensorgridfactory.hh:125\n+Dune::TensorGridFactory::geometricFillUntil\n+void geometricFillUntil(int d, ctype ratio, ctype end, ctype h0=static_cast<\n+ctype >(0))\n+adds intervals in direction d according with a given length ratio until a given\n+coordinate is reached\n+Definition tensorgridfactory.hh:170\n+Dune::TensorGridFactory::dim\n+static const int dim\n+Definition tensorgridfactory.hh:46\n+Dune::TensorGridFactory::print\n+void print()\n+print the coordinate information given to the factory so far\n+Definition tensorgridfactory.hh:219\n+Dune::TensorGridFactory::fillIntervals\n+void fillIntervals(int d, int n, ctype h)\n+pushs n intervals of length h in direction d\n+Definition tensorgridfactory.hh:93\n+Dune::TensorGridFactory::setStart\n+void setStart(int d, ctype value)\n+set a starting value in a given direction d\n+Definition tensorgridfactory.hh:79\n+Dune::TensorGridFactory::geometricFillIntervals\n+void geometricFillIntervals(int d, int n, ctype ratio, ctype h0=static_cast<\n+ctype >(0))\n+adds n intervals in direction d with a given length ratio and a given starting\n+interval length.\n+Definition tensorgridfactory.hh:144\n+Dune::TensorGridFactory::operator[]\n+std::vector< ctype > & operator[](std::size_t d)\n+allow to manually tune the factory by overloading operator[] to export the\n+coordinate vectors in the ...\n+Definition tensorgridfactory.hh:60\n+Dune::TensorGridFactory::operator[]\n+const std::vector< ctype > & operator[](std::size_t d) const\n+allow to manually tune the factory by overloading operator[] to export the\n+coordinate vectors in the ...\n+Definition tensorgridfactory.hh:66\n+Dune::TensorGridFactory::createGrid\n+std::unique_ptr< Grid > createGrid(Comm comm=Comm())\n+Definition tensorgridfactory.hh:48\n+Dune::TensorGridFactory::Comm\n+Grid::Traits::Communication Comm\n+Definition tensorgridfactory.hh:44\n+Dune::TensorGridFactory::coords\n+std::array< std::vector< ctype >, dim > coords() const\n+Definition tensorgridfactory.hh:54\n+Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n+dim_>_>_>::createGrid\n+std::unique_ptr< Grid > createGrid(Comm comm)\n+Definition tensorgridfactory.hh:396\n+Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n+dim_>_>_>::TensorGridFactoryCreator\n+TensorGridFactoryCreator(const TensorGridFactory< Grid > &factory)\n+Definition tensorgridfactory.hh:394\n+Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n+dim_>_>_>::Comm\n+Grid::Communication Comm\n+Definition tensorgridfactory.hh:392\n+Dune::TensorGridFactoryCreator<_YaspGrid<_dim,_TensorProductCoordinates<_ctype,\n+dim_>_>_>::Grid\n+YaspGrid< dim, TensorProductCoordinates< ctype, dim > > Grid\n+Definition tensorgridfactory.hh:391\n+Dune::YaspGrid\n+[ provides Dune::Grid ]\n+Definition yaspgrid.hh:166\n+Dune::YaspGrid::Communication\n+typename Base::Communication Communication\n+Definition yaspgrid.hh:181\n+Dune::TensorProductCoordinates\n+Coordinate container for a tensor product YaspGrid.\n+Definition coordinates.hh:245\n+gridfactory.hh\n+Provide a generic factory class for unstructured grids.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01010.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01010.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainermap.hh File Reference\n+dune-grid: hostgridaccess.hh File Reference\n \n \n \n \n \n \n \n@@ -72,33 +72,33 @@\n
  • dune
  • grid
  • utility
  • \n \n \n
    \n \n-
    persistentcontainermap.hh File Reference
    \n+
    hostgridaccess.hh File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <cassert>
    \n-#include <type_traits>
    \n-#include <utility>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/grid/common/capabilities.hh>
    \n+
    #include <string>
    \n+#include <dune/grid/geometrygrid/intersection.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 Classes

    class  Dune::PersistentContainerMap< G, IdSet, Map >
     map-based implementation of the PersistentContainer More...
    struct  Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
     
    class  Dune::PersistentContainerMap< G, IdSet, Map >::IteratorWrapper< value, iterator >
    struct  Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >::Codim< codim >
     A Traits struct that collects return types of class member methods. More...
     
    struct  Dune::HostGridAccess< IdentityGrid< HG > >
     
    struct  Dune::HostGridAccess< IdentityGrid< HG > >::Codim< codim >
     A Traits struct that collects return types of class member methods. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,31 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-persistentcontainermap.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+hostgridaccess.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::PersistentContainerMap<_G,_IdSet,_Map_>\n-\u00a0 map-based implementation of the PersistentContainer More...\n+struct \u00a0 Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>\n \u00a0\n-class \u00a0 Dune::PersistentContainerMap<_G,_IdSet,_Map_>::IteratorWrapper<_value,\n- iterator_>\n+struct \u00a0 Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+ Codim<_codim_>\n+\u00a0 A Traits struct that collects return types of class member methods.\n+ More...\n+\u00a0\n+struct \u00a0 Dune::HostGridAccess<_IdentityGrid<_HG_>_>\n+\u00a0\n+struct \u00a0 Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Codim<_codim_>\n+\u00a0 A Traits struct that collects return types of class member methods.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01010_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01010_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainermap.hh Source File\n+dune-grid: hostgridaccess.hh Source File\n \n \n \n \n \n \n \n@@ -74,387 +74,219 @@\n \n
    \n \n
    \n \n
    \n-
    persistentcontainermap.hh
    \n+
    hostgridaccess.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_PERSISTENTCONTAINERMAP_HH
    \n-
    6#define DUNE_PERSISTENTCONTAINERMAP_HH
    \n+
    5#ifndef DUNE_GRID_HOSTGRIDACCESS_HH
    \n+
    6#define DUNE_GRID_HOSTGRIDACCESS_HH
    \n
    7
    \n-
    8#include <algorithm>
    \n-
    9#include <cassert>
    \n-
    10#include <type_traits>
    \n-
    11#include <utility>
    \n-
    12
    \n-
    13#include <dune/common/hybridutilities.hh>
    \n-
    14#include <dune/common/typetraits.hh>
    \n-\n-
    16
    \n-
    17namespace Dune
    \n-
    18{
    \n-
    19
    \n-
    20 // PersistentContainerMap
    \n-
    21 // ----------------------
    \n-
    22
    \n-
    24 template< class G, class IdSet, class Map >
    \n-
    \n-\n-
    26 {
    \n-\n-
    28
    \n-
    29 protected:
    \n-
    30 template< class reference, class iterator >
    \n-
    31 class IteratorWrapper;
    \n+
    8#include <string>
    \n+
    9
    \n+\n+
    11
    \n+
    12namespace Dune
    \n+
    13{
    \n+
    14
    \n+
    15 // External Forward Declarations
    \n+
    16 // -----------------------------
    \n+
    17
    \n+
    18 template< class HostGrid, class CoordFunction, class Allocator >
    \n+
    19 class GeometryGrid;
    \n+
    20
    \n+
    21 template< class >
    \n+
    22 class IdentityGrid;
    \n+
    23
    \n+
    24
    \n+
    25 // HostGridAccess
    \n+
    26 // --------------
    \n+
    27
    \n+
    28 template< class Grid >
    \n+
    29 struct HostGridAccess;
    \n+
    30
    \n+
    31
    \n
    32
    \n-
    33 public:
    \n-
    34 typedef G Grid;
    \n-
    35
    \n-
    36 typedef typename Map::mapped_type Value;
    \n-
    37 typedef typename Map::size_type Size;
    \n-
    38
    \n-\n-\n-
    41
    \n-
    \n-
    42 PersistentContainerMap ( const Grid &grid, int codim, const IdSet &idSet, const Value &value )
    \n-
    43 : grid_( &grid ),
    \n-
    44 codim_( codim ),
    \n-
    45 idSet_( &idSet ),
    \n-
    46 data_()
    \n-
    47 {
    \n-
    48 resize( value );
    \n-
    49 }
    \n-
    \n+
    40 template< class HG, class CoordFunction, class Allocator >
    \n+
    \n+
    41 struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
    \n+
    42 {
    \n+\n+
    47
    \n+
    49 typedef typename Grid::HostGrid HostGrid;
    \n
    50
    \n-
    51 template< class Entity >
    \n-
    \n-
    52 const Value &operator[] ( const Entity &entity ) const
    \n-
    53 {
    \n-
    54 assert( Entity::codimension == codimension() );
    \n-
    55 typename Map::const_iterator pos = data_.find( idSet().id( entity ) );
    \n-
    56 assert( pos != data_.end() );
    \n-
    57 return pos->second;
    \n-
    58 }
    \n-
    \n-
    59
    \n-
    60 template< class Entity >
    \n-
    \n-
    61 Value &operator[] ( const Entity &entity )
    \n-
    62 {
    \n-
    63 assert( Entity::codimension == codimension() );
    \n-
    64 typename Map::iterator pos = data_.find( idSet().id( entity ) );
    \n-
    65 assert( pos != data_.end() );
    \n-
    66 return pos->second;
    \n-
    67 }
    \n-
    \n-
    68
    \n-
    69 template< class Entity >
    \n-
    \n-
    70 const Value &operator() ( const Entity &entity, int subEntity ) const
    \n-
    71 {
    \n-
    72 typename Map::const_iterator pos = data_.find( idSet().subId( entity, subEntity, codimension() ) );
    \n-
    73 assert( pos != data_.end() );
    \n-
    74 return pos->second;
    \n-
    75 }
    \n-
    \n+
    57 template< int codim >
    \n+
    \n+
    58 struct Codim
    \n+
    59 {
    \n+\n+
    62
    \n+
    64 typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
    \n+
    65 };
    \n+
    \n+
    66
    \n+
    68 typedef typename Grid::Traits::LeafIntersection LeafIntersection;
    \n+
    70 typedef typename Grid::Traits::LevelIntersection LevelIntersection;
    \n+
    71
    \n+
    73 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
    \n+
    75 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
    \n
    76
    \n-
    77 template< class Entity >
    \n-
    \n-
    78 Value &operator() ( const Entity &entity, int subEntity )
    \n-
    79 {
    \n-
    80 typename Map::iterator pos = data_.find( idSet().subId( entity, subEntity, codimension() ) );
    \n-
    81 assert( pos != data_.end() );
    \n-
    82 return pos->second;
    \n-
    83 }
    \n-
    \n-
    84
    \n-
    85 Size size () const { return data_.size(); }
    \n-
    86
    \n-
    \n-
    87 void resize ( const Value &value = Value() )
    \n-
    88 {
    \n-
    89 Hybrid::forEach( std::make_index_sequence< Grid::dimension+1 >{},
    \n-
    90 [ & ]( auto i ){ if( int(i) == this->codimension() ) this->template resize< i >( value ); } );
    \n+
    \n+
    81 static const HostGrid &hostGrid ( const Grid &grid )
    \n+
    82 {
    \n+
    83 return grid.hostGrid();
    \n+
    84 }
    \n+
    \n+
    85
    \n+
    86 template< class Entity >
    \n+
    87 static const typename Codim< Entity::codimension >::HostEntity &
    \n+
    \n+
    88 hostEntity ( const Entity &entity )
    \n+
    89 {
    \n+
    90 return hostEntity< Entity::codimension >( entity );
    \n
    91 }
    \n
    \n
    92
    \n-
    93 void shrinkToFit () {}
    \n-
    94
    \n-
    95 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }
    \n-
    96
    \n-
    \n-
    97 void swap ( This &other )
    \n-
    98 {
    \n-
    99 std::swap( grid_, other.grid_ );
    \n-
    100 std::swap( codim_, other.codim_ );
    \n-
    101 std::swap( idSet_, other.idSet_ );
    \n-
    102 std::swap( data_, other.data_ );
    \n-
    103 }
    \n-
    \n-
    104
    \n-
    \n-\n-
    \n-\n+
    93 template< int codim >
    \n+
    94 static const typename Codim< codim >::HostEntity &
    \n+
    \n+
    95 hostEntity ( const typename Codim< codim >::Entity &entity )
    \n+
    96 {
    \n+
    97 return entity.impl().hostEntity();
    \n+
    98 }
    \n+
    \n+
    99
    \n+
    100 template< class HostIntersection >
    \n+
    101 static const HostIntersection &
    \n+
    \n+\n+
    103 {
    \n+
    104 return intersection.impl().hostIntersection();
    \n+
    105 }
    \n+
    \n+
    106 };
    \n+
    \n
    107
    \n-
    \n-\n-
    \n-\n-
    110
    \n-
    111 int codimension () const { return codim_; }
    \n-
    112
    \n-
    113 protected:
    \n-
    114 const Grid &grid () const { return *grid_; }
    \n-
    115
    \n-
    116 template< int codim >
    \n-
    \n-
    117 void resize ( const Value &value );
    \n-
    118
    \n-
    119 template< int codim >
    \n-
    \n-
    120 void migrateLevel ( int level, const Value &value, Map &data,
    \n-
    121 std::integral_constant< bool, true > );
    \n-
    122
    \n-
    123 template< int codim >
    \n-
    \n-
    124 void migrateLevel ( int level, const Value &value, Map &data,
    \n-
    125 std::integral_constant< bool, false > );
    \n+
    108
    \n+
    116 template< class HG >
    \n+
    \n+\n+
    118 {
    \n+\n+
    123
    \n+
    125 typedef HG HostGrid;
    \n
    126
    \n-
    \n-
    127 static void migrateEntry ( const typename IdSet::IdType &id, const Value &value,
    \n-
    128 Map &oldData, Map &newData );
    \n-
    129
    \n-
    130 const IdSet &idSet () const { return *idSet_; }
    \n-
    131
    \n-
    132 const Grid *grid_;
    \n-\n-
    134 const IdSet *idSet_;
    \n-
    135 Map data_;
    \n-
    136 };
    \n-
    137
    \n+
    133 template< int codim >
    \n+
    \n+
    134 struct Codim
    \n+
    135 {
    \n+\n
    138
    \n-
    139
    \n-
    140 // PersistentContainerMap::IteratorWrapper
    \n-
    141 // ---------------------------------------
    \n+
    140 typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
    \n+
    141 };
    \n+
    \n
    142
    \n-
    143 template< class G, class IdSet, class Map >
    \n-
    144 template< class value, class iterator >
    \n-
    \n-\n-
    146 : public iterator
    \n-
    147 {
    \n-\n-
    149
    \n-
    150 public:
    \n-
    151 IteratorWrapper ( const iterator &it ) : it_( it ) {}
    \n+\n+\n+
    147
    \n+
    149 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
    \n+
    151 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
    \n
    152
    \n-
    153 operator ConstWrapper () const { return ConstWrapper( it_ ); }
    \n-
    154
    \n-
    155 value &operator* () { return it_->second; }
    \n-
    156 value *operator-> () { return &(it_->second); }
    \n-
    157
    \n-
    158 bool operator== ( const IteratorWrapper &other ) const { return (it_ == other.it_); }
    \n-
    159 bool operator!= ( const IteratorWrapper &other ) const { return (it_ != other.it_); }
    \n-
    160
    \n-
    161 IteratorWrapper &operator++ () { ++it_; return *this; }
    \n-
    162
    \n-
    163 private:
    \n-
    164 iterator it_;
    \n-
    165 };
    \n+
    \n+
    157 static const HostGrid &hostGrid ( const Grid &grid )
    \n+
    158 {
    \n+
    159 return grid.getHostGrid();
    \n+
    160 }
    \n+
    \n+
    161
    \n+
    162 template< class Entity >
    \n+
    163 static const typename Codim< Entity::codimension >::HostEntity &
    \n+
    \n+
    164 hostEntity ( const Entity &entity )
    \n+
    165 {
    \n+
    166 return hostEntity< Entity::codimension >( entity );
    \n+
    167 }
    \n
    \n-
    166
    \n-
    167
    \n
    168
    \n-
    169
    \n-
    170 // Implementation of PersistentContainerMap
    \n-
    171 // ----------------------------------------
    \n-
    172
    \n-
    173 template< class G, class IdSet, class Map >
    \n-\n-
    \n-\n-
    176 {
    \n-
    177 return ConstIterator( data_.begin() );
    \n-
    178 }
    \n-
    \n-
    179
    \n-
    180 template< class G, class IdSet, class Map >
    \n-\n-
    \n-\n-
    183 {
    \n-
    184 return Iterator( data_.begin() );
    \n-
    185 }
    \n-
    \n-
    186
    \n-
    187
    \n-
    188 template< class G, class IdSet, class Map >
    \n-\n-
    \n-\n-
    191 {
    \n-
    192 return ConstIterator( data_.end() );
    \n-
    193 }
    \n-
    \n-
    194
    \n-
    195 template< class G, class IdSet, class Map >
    \n-\n-
    \n-\n-
    198 {
    \n-
    199 return Iterator( data_.end() );
    \n-
    200 }
    \n-
    \n-
    201
    \n-
    202
    \n-
    203 template< class G, class IdSet, class Map >
    \n-
    204 template< int codim >
    \n-
    \n-\n-
    206 {
    \n-
    207 std::integral_constant< bool, Capabilities::hasEntityIterator< Grid, codim >::v > hasEntityIterator;
    \n-
    208 assert( codim == codimension() );
    \n-
    209
    \n-
    210 // create empty map and swap it with current map (no need to copy twice)
    \n-
    211 Map data;
    \n-
    212 std::swap( data, data_ );
    \n-
    213
    \n-
    214 // copy all data from old map into new one (adding new entries, if necessary)
    \n-
    215 const int maxLevel = grid().maxLevel();
    \n-
    216 for ( int level = 0; level <= maxLevel; ++level )
    \n-
    217 migrateLevel< codim >( level, value, data, hasEntityIterator );
    \n-
    218 }
    \n-
    \n-
    219
    \n-
    220
    \n-
    221 template< class G, class IdSet, class Map >
    \n-
    222 template< int codim >
    \n-\n-
    \n-
    224 ::migrateLevel ( int level, const Value &value, Map &data,
    \n-
    225 std::integral_constant< bool, true > )
    \n-
    226 {
    \n-
    227 typedef typename Grid::LevelGridView LevelView;
    \n-
    228 typedef typename LevelView::template Codim< codim >::Iterator LevelIterator;
    \n-
    229
    \n-
    230 const LevelView levelView = grid().levelGridView( level );
    \n-
    231 const LevelIterator end = levelView.template end< codim >();
    \n-
    232 for( LevelIterator it = levelView.template begin< codim >(); it != end; ++it )
    \n-
    233 migrateEntry( idSet().id( *it ), value, data, data_ );
    \n-
    234 }
    \n-
    \n-
    235
    \n-
    236
    \n-
    237 template< class G, class IdSet, class Map >
    \n-
    238 template< int codim >
    \n-\n-
    \n-
    240 ::migrateLevel ( int level, const Value &value, Map &data,
    \n-
    241 std::integral_constant< bool, false > )
    \n-
    242 {
    \n-
    243 typedef typename Grid::LevelGridView LevelView;
    \n-
    244 typedef typename LevelView::template Codim< 0 >::Iterator LevelIterator;
    \n-
    245
    \n-
    246 const LevelView levelView = grid().levelGridView( level );
    \n-
    247 const LevelIterator end = levelView.template end< 0 >();
    \n-
    248 for( LevelIterator it = levelView.template begin< 0 >(); it != end; ++it )
    \n-
    249 {
    \n-
    250 const typename LevelIterator::Entity &entity = *it;
    \n-
    251 const int subEntities = entity.subEntities( codim );
    \n-
    252 for( int i = 0; i < subEntities; ++i )
    \n-
    253 migrateEntry( idSet().subId( entity, i, codim ), value, data, data_ );
    \n-
    254 }
    \n-
    255 }
    \n-
    \n-
    256
    \n-
    257
    \n-
    258 template< class G, class IdSet, class Map >
    \n-\n-
    \n-
    260 ::migrateEntry ( const typename IdSet::IdType &id, const Value &value,
    \n-
    261 Map &oldData, Map &newData )
    \n-
    262 {
    \n-
    263 // insert entry for id
    \n-
    264 const std::pair< typename Map::iterator, bool > inserted
    \n-
    265 = newData.insert( std::make_pair( id, value ) );
    \n-
    266
    \n-
    267 // if entry did not exist previously, copy data
    \n-
    268 if( inserted.second )
    \n-
    269 {
    \n-
    270 const typename Map::iterator pos = oldData.find( id );
    \n-
    271 if( pos != oldData.end() )
    \n-
    272 {
    \n-
    273 inserted.first->second = pos->second;
    \n-
    274 oldData.erase( pos );
    \n-
    275 }
    \n-
    276 }
    \n-
    277 }
    \n-
    \n-
    \n-
    278
    \n-
    279} // namespace Dune
    \n-
    280
    \n-
    281#endif // #ifndef DUNE_PERSISTENTCONTAINERMAP_HH
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n+
    169 template< int codim >
    \n+
    170 static const typename Codim< codim >::HostEntity &
    \n+
    \n+
    171 hostEntity ( const typename Codim< codim >::Entity &entity )
    \n+
    172 {
    \n+
    173 return *entity.impl().hostEntity_;
    \n+
    174 }
    \n+
    \n+
    175
    \n+
    176 static const HostLeafIntersection &
    \n+
    \n+
    177 hostIntersection ( const LeafIntersection &intersection )
    \n+
    178 {
    \n+
    179 return *intersection.impl().hostIterator_;
    \n+
    180 }
    \n+
    \n+
    181
    \n+
    182 static const HostLevelIntersection &
    \n+
    \n+
    183 hostIntersection ( const LevelIntersection &intersection )
    \n+
    184 {
    \n+
    185 return *intersection.impl().hostIterator_;
    \n+
    186 }
    \n+
    \n+
    187 };
    \n+
    \n+
    188
    \n+
    189} // namespace Dune
    \n+
    190
    \n+
    191#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n-
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n-
    IdTypeImp IdType
    Type used to represent an id.
    Definition common/indexidset.hh:453
    \n-
    GridFamily::Traits::LevelGridView LevelGridView
    type of view for level grid
    Definition common/grid.hh:402
    \n-
    Export the type of the entity used as parameter in the id(...) method.
    Definition common/indexidset.hh:457
    \n-
    map-based implementation of the PersistentContainer
    Definition persistentcontainermap.hh:26
    \n-
    void migrateLevel(int level, const Value &value, Map &data, std::integral_constant< bool, false >)
    Definition persistentcontainermap.hh:240
    \n-
    void swap(This &other)
    Definition persistentcontainermap.hh:97
    \n-
    void fill(const Value &value)
    Definition persistentcontainermap.hh:95
    \n-
    G Grid
    Definition persistentcontainermap.hh:34
    \n-
    void resize(const Value &value)
    Definition persistentcontainermap.hh:205
    \n-
    IteratorWrapper< const Value, typename Map::const_iterator > ConstIterator
    Definition persistentcontainermap.hh:39
    \n-
    int codim_
    Definition persistentcontainermap.hh:133
    \n-
    const Grid * grid_
    Definition persistentcontainermap.hh:132
    \n-
    const Value & operator[](const Entity &entity) const
    Definition persistentcontainermap.hh:52
    \n-
    int codimension() const
    Definition persistentcontainermap.hh:111
    \n-
    void resize(const Value &value=Value())
    Definition persistentcontainermap.hh:87
    \n-
    const IdSet & idSet() const
    Definition persistentcontainermap.hh:130
    \n-
    ConstIterator begin() const
    Definition persistentcontainermap.hh:175
    \n-
    static void migrateEntry(const typename IdSet::IdType &id, const Value &value, Map &oldData, Map &newData)
    Definition persistentcontainermap.hh:260
    \n-
    Map::mapped_type Value
    Definition persistentcontainermap.hh:36
    \n-
    Iterator end()
    Definition persistentcontainermap.hh:197
    \n-
    const Grid & grid() const
    Definition persistentcontainermap.hh:114
    \n-
    const Value & operator()(const Entity &entity, int subEntity) const
    Definition persistentcontainermap.hh:70
    \n-
    PersistentContainerMap(const Grid &grid, int codim, const IdSet &idSet, const Value &value)
    Definition persistentcontainermap.hh:42
    \n-
    Iterator begin()
    Definition persistentcontainermap.hh:182
    \n-
    Map::size_type Size
    Definition persistentcontainermap.hh:37
    \n-
    ConstIterator end() const
    Definition persistentcontainermap.hh:190
    \n-
    Map data_
    Definition persistentcontainermap.hh:135
    \n-
    Size size() const
    Definition persistentcontainermap.hh:85
    \n-
    IteratorWrapper< Value, typename Map::iterator > Iterator
    Definition persistentcontainermap.hh:40
    \n-
    const IdSet * idSet_
    Definition persistentcontainermap.hh:134
    \n-
    void migrateLevel(int level, const Value &value, Map &data, std::integral_constant< bool, true >)
    Definition persistentcontainermap.hh:224
    \n-
    void shrinkToFit()
    Definition persistentcontainermap.hh:93
    \n-
    Definition persistentcontainermap.hh:147
    \n-
    IteratorWrapper(const iterator &it)
    Definition persistentcontainermap.hh:151
    \n-
    A set of traits classes to store static information about grid implementation.
    \n+
    GridFamily::Traits::LeafIntersection LeafIntersection
    A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
    Definition common/grid.hh:456
    \n+
    GridFamily::Traits::LevelIntersection LevelIntersection
    A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
    Definition common/grid.hh:461
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    grid wrapper replacing the geometries
    Definition geometrygrid/grid.hh:86
    \n+
    const HostGrid & hostGrid() const
    obtain constant reference to the host grid
    Definition geometrygrid/grid.hh:533
    \n+
    traits structure containing types for a codimension
    Definition geometrygrid/grid.hh:606
    \n+
    Definition geometrygrid/intersection.hh:22
    \n+
    Provides a meta grid that is identical to its host.
    Definition identitygrid.hh:93
    \n+
    HostGridType & getHostGrid() const
    Returns the hostgrid this IdentityGrid lives in.
    Definition identitygrid.hh:415
    \n+
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n+
    Grid::HostGrid HostGrid
    type of HostGrid
    Definition hostgridaccess.hh:49
    \n+
    HostGrid::Traits::LevelIntersection HostLevelIntersection
    type of the host level intersection
    Definition hostgridaccess.hh:75
    \n+
    static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity &entity)
    Definition hostgridaccess.hh:88
    \n+
    static const Codim< codim >::HostEntity & hostEntity(const typename Codim< codim >::Entity &entity)
    Definition hostgridaccess.hh:95
    \n+
    static const HostIntersection & hostIntersection(const Intersection< const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection)
    Definition hostgridaccess.hh:102
    \n+
    GeometryGrid< HG, CoordFunction, Allocator > Grid
    Definition hostgridaccess.hh:46
    \n+
    Grid::Traits::LeafIntersection LeafIntersection
    type of the GeometryGrid leaf intersection
    Definition hostgridaccess.hh:68
    \n+
    HostGrid::Traits::LeafIntersection HostLeafIntersection
    type of the host leaf intersection
    Definition hostgridaccess.hh:73
    \n+
    static const HostGrid & hostGrid(const Grid &grid)
    Get underlying HostGrid.
    Definition hostgridaccess.hh:81
    \n+
    Grid::Traits::LevelIntersection LevelIntersection
    type of the GeometryGrid level intersection
    Definition hostgridaccess.hh:70
    \n+
    HostGrid::template Codim< codim >::Entity HostEntity
    type of the host entity
    Definition hostgridaccess.hh:64
    \n+
    Grid::template Codim< codim >::Entity Entity
    type of the GeometryGrid entity
    Definition hostgridaccess.hh:61
    \n+
    Grid::Traits::LeafIntersection LeafIntersection
    type of the IdGrid leaf intersection
    Definition hostgridaccess.hh:144
    \n+
    HG HostGrid
    type of HostGrid
    Definition hostgridaccess.hh:125
    \n+
    IdentityGrid< HG > Grid
    Definition hostgridaccess.hh:122
    \n+
    static const Codim< codim >::HostEntity & hostEntity(const typename Codim< codim >::Entity &entity)
    Definition hostgridaccess.hh:171
    \n+
    HostGrid::Traits::LevelIntersection HostLevelIntersection
    type of the host level intersection
    Definition hostgridaccess.hh:151
    \n+
    Grid::Traits::LevelIntersection LevelIntersection
    type of the IdGrid level intersection
    Definition hostgridaccess.hh:146
    \n+
    static const HostLeafIntersection & hostIntersection(const LeafIntersection &intersection)
    Definition hostgridaccess.hh:177
    \n+
    HostGrid::Traits::LeafIntersection HostLeafIntersection
    type of the host leaf intersection
    Definition hostgridaccess.hh:149
    \n+
    static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity &entity)
    Definition hostgridaccess.hh:164
    \n+
    static const HostLevelIntersection & hostIntersection(const LevelIntersection &intersection)
    Definition hostgridaccess.hh:183
    \n+
    static const HostGrid & hostGrid(const Grid &grid)
    Get underlying HostGrid.
    Definition hostgridaccess.hh:157
    \n+
    Grid::template Codim< codim >::Entity Entity
    type of the IdGrid entity
    Definition hostgridaccess.hh:137
    \n+
    HostGrid::template Codim< codim >::Entity HostEntity
    type of the host entity
    Definition hostgridaccess.hh:140
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,432 +1,303 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-persistentcontainermap.hh\n+hostgridaccess.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_PERSISTENTCONTAINERMAP_HH\n-6#define DUNE_PERSISTENTCONTAINERMAP_HH\n+5#ifndef DUNE_GRID_HOSTGRIDACCESS_HH\n+6#define DUNE_GRID_HOSTGRIDACCESS_HH\n 7\n-8#include \n-9#include \n-10#include \n-11#include \n-12\n-13#include \n-14#include \n-15#include \n-16\n-17namespace Dune\n-18{\n-19\n-20 // PersistentContainerMap\n-21 // ----------------------\n-22\n-24 template< class G, class IdSet, class Map >\n-25 class PersistentContainerMap\n-26 {\n-27 typedef PersistentContainerMap<_G,_IdSet,_Map_> This;\n-28\n-29 protected:\n-30 template< class reference, class iterator >\n-31 class IteratorWrapper;\n+8#include \n+9\n+10#include \n+11\n+12namespace Dune\n+13{\n+14\n+15 // External Forward Declarations\n+16 // -----------------------------\n+17\n+18 template< class HostGrid, class CoordFunction, class Allocator >\n+19 class GeometryGrid;\n+20\n+21 template< class >\n+22 class IdentityGrid;\n+23\n+24\n+25 // HostGridAccess\n+26 // --------------\n+27\n+28 template< class Grid >\n+29 struct HostGridAccess;\n+30\n+31\n 32\n-33 public:\n-34 typedef G Grid;\n-35\n-36 typedef typename Map::mapped_type Value;\n-37 typedef typename Map::size_type Size;\n-38\n-39 typedef IteratorWrapper<_const_Value,_typename_Map::const_iterator_>\n-ConstIterator;\n-40 typedef IteratorWrapper<_Value,_typename_Map::iterator_> Iterator;\n-41\n-42 PersistentContainerMap ( const Grid &grid, int codim, const IdSet &idSet,\n-const Value &value )\n-43 : grid_( &grid ),\n-44 codim_( codim ),\n-45 idSet_( &idSet ),\n-46 data_()\n-47 {\n-48 resize( value );\n-49 }\n+40 template< class HG, class CoordFunction, class Allocator >\n+41 struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >\n+42 {\n+46 typedef GeometryGrid<_HG,_CoordFunction,_Allocator_> Grid;\n+47\n+49 typedef typename Grid::HostGrid HostGrid;\n 50\n-51 template< class Entity >\n-52 const Value &operator[]_( const Entity &entity ) const\n-53 {\n-54 assert( Entity::codimension == codimension() );\n-55 typename Map::const_iterator pos = data_.find( idSet().id( entity ) );\n-56 assert( pos != data_.end() );\n-57 return pos->second;\n-58 }\n-59\n-60 template< class Entity >\n-61 Value &operator[]_( const Entity &entity )\n-62 {\n-63 assert( Entity::codimension == codimension() );\n-64 typename Map::iterator pos = data_.find( idSet().id( entity ) );\n-65 assert( pos != data_.end() );\n-66 return pos->second;\n-67 }\n-68\n-69 template< class Entity >\n-70 const Value &operator()_( const Entity &entity, int subEntity ) const\n-71 {\n-72 typename Map::const_iterator pos = data_.find( idSet().subId( entity,\n-subEntity, codimension() ) );\n-73 assert( pos != data_.end() );\n-74 return pos->second;\n-75 }\n+57 template< int codim >\n+58 struct Codim\n+59 {\n+61 typedef typename Grid::template Codim<_codim_>::Entity Entity;\n+62\n+64 typedef typename HostGrid::template Codim<_codim_>::Entity HostEntity;\n+65 };\n+66\n+68 typedef typename Grid::Traits::LeafIntersection LeafIntersection;\n+70 typedef typename Grid::Traits::LevelIntersection LevelIntersection;\n+71\n+73 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;\n+75 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;\n 76\n-77 template< class Entity >\n-78 Value &operator()_( const Entity &entity, int subEntity )\n-79 {\n-80 typename Map::iterator pos = data_.find( idSet().subId( entity, subEntity,\n-codimension() ) );\n-81 assert( pos != data_.end() );\n-82 return pos->second;\n-83 }\n-84\n-85 Size size () const { return data_.size(); }\n-86\n-87 void resize ( const Value &value = Value() )\n-88 {\n-89 Hybrid::forEach( std::make_index_sequence< Grid::dimension+1 >{},\n-90 [ & ]( auto i ){ if( int(i) == this->codimension() ) this->template resize<\n-i >( value ); } );\n+81 static const HostGrid &hostGrid ( const Grid &grid )\n+82 {\n+83 return grid.hostGrid();\n+84 }\n+85\n+86 template< class Entity >\n+87 static const typename Codim< Entity::codimension >::HostEntity &\n+88 hostEntity ( const Entity &entity )\n+89 {\n+90 return hostEntity< Entity::codimension >( entity );\n 91 }\n 92\n-93 void shrinkToFit () {}\n-94\n-95 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }\n-96\n-97 void swap ( This &other )\n-98 {\n-99 std::swap( grid_, other.grid_ );\n-100 std::swap( codim_, other.codim_ );\n-101 std::swap( idSet_, other.idSet_ );\n-102 std::swap( data_, other.data_ );\n-103 }\n-104\n-105 ConstIterator begin () const;\n-106 Iterator begin ();\n+93 template< int codim >\n+94 static const typename Codim< codim >::HostEntity &\n+95 hostEntity ( const typename Codim<_codim_>::Entity &entity )\n+96 {\n+97 return entity.impl().hostEntity();\n+98 }\n+99\n+100 template< class HostIntersection >\n+101 static const HostIntersection &\n+102 hostIntersection ( const Intersection< const Grid, GeoGrid::Intersection<\n+const_Grid,_HostIntersection_> > &intersection )\n+103 {\n+104 return intersection.impl().hostIntersection();\n+105 }\n+106 };\n 107\n-108 ConstIterator end () const;\n-109 Iterator end ();\n-110\n-111 int codimension () const { return codim_; }\n-112\n-113 protected:\n-114 const Grid &grid () const { return *grid_; }\n-115\n-116 template< int codim >\n-117 void resize ( const Value &value );\n-118\n-119 template< int codim >\n-120 void migrateLevel ( int level, const Value &value, Map &data,\n-121 std::integral_constant< bool, true > );\n-122\n-123 template< int codim >\n-124 void migrateLevel ( int level, const Value &value, Map &data,\n-125 std::integral_constant< bool, false > );\n+108\n+116 template< class HG >\n+117 struct HostGridAccess< IdentityGrid< HG > >\n+118 {\n+122 typedef IdentityGrid<_HG_> Grid;\n+123\n+125 typedef HG HostGrid;\n 126\n-127 static void migrateEntry ( const typename IdSet::IdType &id, const Value\n-&value,\n-128 Map &oldData, Map &newData );\n-129\n-130 const IdSet &idSet () const { return *idSet_; }\n-131\n-132 const Grid *grid_;\n-133 int codim_;\n-134 const IdSet *idSet_;\n-135 Map data_;\n-136 };\n-137\n+133 template< int codim >\n+134 struct Codim\n+135 {\n+137 typedef typename Grid::template Codim<_codim_>::Entity Entity;\n 138\n-139\n-140 // PersistentContainerMap::IteratorWrapper\n-141 // ---------------------------------------\n+140 typedef typename HostGrid::template Codim<_codim_>::Entity HostEntity;\n+141 };\n 142\n-143 template< class G, class IdSet, class Map >\n-144 template< class value, class iterator >\n-145 class PersistentContainerMap<_G,_IdSet,_Map_>::IteratorWrapper\n-146 : public iterator\n-147 {\n-148 typedef IteratorWrapper<_const_value,_typename_Map::const_iterator_>\n-ConstWrapper;\n-149\n-150 public:\n-151 IteratorWrapper ( const iterator &it ) : it_( it ) {}\n+144 typedef typename Grid::Traits::LeafIntersection LeafIntersection;\n+146 typedef typename Grid::Traits::LevelIntersection LevelIntersection;\n+147\n+149 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;\n+151 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;\n 152\n-153 operator ConstWrapper () const { return ConstWrapper( it_ ); }\n-154\n-155 value &operator* () { return it_->second; }\n-156 value *operator-> () { return &(it_->second); }\n-157\n-158 bool operator== ( const IteratorWrapper &other ) const { return (it_ ==\n-other.it_); }\n-159 bool operator!= ( const IteratorWrapper &other ) const { return (it_ !=\n-other.it_); }\n-160\n-161 IteratorWrapper &operator++ () { ++it_; return *this; }\n-162\n-163 private:\n-164 iterator it_;\n-165 };\n-166\n-167\n+157 static const HostGrid &hostGrid ( const Grid &grid )\n+158 {\n+159 return grid.getHostGrid();\n+160 }\n+161\n+162 template< class Entity >\n+163 static const typename Codim< Entity::codimension >::HostEntity &\n+164 hostEntity ( const Entity &entity )\n+165 {\n+166 return hostEntity< Entity::codimension >( entity );\n+167 }\n 168\n-169\n-170 // Implementation of PersistentContainerMap\n-171 // ----------------------------------------\n-172\n-173 template< class G, class IdSet, class Map >\n-174 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::ConstIterator\n-175 PersistentContainerMap<_G,_IdSet,_Map_>::begin () const\n-176 {\n-177 return ConstIterator( data_.begin() );\n-178 }\n-179\n-180 template< class G, class IdSet, class Map >\n-181 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::Iterator\n-182 PersistentContainerMap<_G,_IdSet,_Map_>::begin ()\n-183 {\n-184 return Iterator( data_.begin() );\n-185 }\n-186\n-187\n-188 template< class G, class IdSet, class Map >\n-189 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::ConstIterator\n-190 PersistentContainerMap<_G,_IdSet,_Map_>::end () const\n-191 {\n-192 return ConstIterator( data_.end() );\n-193 }\n-194\n-195 template< class G, class IdSet, class Map >\n-196 inline typename PersistentContainerMap<_G,_IdSet,_Map_>::Iterator\n-197 PersistentContainerMap<_G,_IdSet,_Map_>::end ()\n-198 {\n-199 return Iterator( data_.end() );\n-200 }\n-201\n-202\n-203 template< class G, class IdSet, class Map >\n-204 template< int codim >\n-205 inline void PersistentContainerMap<_G,_IdSet,_Map_>::resize ( const Value\n-&value )\n-206 {\n-207 std::integral_constant< bool, Capabilities::hasEntityIterator< Grid, codim\n->::v > hasEntityIterator;\n-208 assert( codim == codimension() );\n-209\n-210 // create empty map and swap it with current map (no need to copy twice)\n-211 Map data;\n-212 std::swap( data, data_ );\n-213\n-214 // copy all data from old map into new one (adding new entries, if\n-necessary)\n-215 const int maxLevel = grid().maxLevel();\n-216 for ( int level = 0; level <= maxLevel; ++level )\n-217 migrateLevel< codim >( level, value, data, hasEntityIterator );\n-218 }\n-219\n-220\n-221 template< class G, class IdSet, class Map >\n-222 template< int codim >\n-223 inline void PersistentContainerMap<_G,_IdSet,_Map_>\n-224_::migrateLevel ( int level, const Value &value, Map &data,\n-225 std::integral_constant< bool, true > )\n-226 {\n-227 typedef typename Grid::LevelGridView LevelView;\n-228 typedef typename LevelView::template Codim< codim >::Iterator\n-LevelIterator;\n-229\n-230 const LevelView levelView = grid().levelGridView( level );\n-231 const LevelIterator end = levelView.template end< codim >();\n-232 for( LevelIterator it = levelView.template begin< codim >(); it != end;\n-++it )\n-233 migrateEntry( idSet().id( *it ), value, data, data_ );\n-234 }\n-235\n-236\n-237 template< class G, class IdSet, class Map >\n-238 template< int codim >\n-239 inline void PersistentContainerMap<_G,_IdSet,_Map_>\n-240_::migrateLevel ( int level, const Value &value, Map &data,\n-241 std::integral_constant< bool, false > )\n-242 {\n-243 typedef typename Grid::LevelGridView LevelView;\n-244 typedef typename LevelView::template Codim< 0 >::Iterator LevelIterator;\n-245\n-246 const LevelView levelView = grid().levelGridView( level );\n-247 const LevelIterator end = levelView.template end< 0 >();\n-248 for( LevelIterator it = levelView.template begin< 0 >(); it != end; ++it )\n-249 {\n-250 const typename LevelIterator::Entity &entity = *it;\n-251 const int subEntities = entity.subEntities( codim );\n-252 for( int i = 0; i < subEntities; ++i )\n-253 migrateEntry( idSet().subId( entity, i, codim ), value, data, data_ );\n-254 }\n-255 }\n-256\n-257\n-258 template< class G, class IdSet, class Map >\n-259 inline void PersistentContainerMap<_G,_IdSet,_Map_>\n-260_::migrateEntry ( const typename IdSet::IdType &id, const Value &value,\n-261 Map &oldData, Map &newData )\n-262 {\n-263 // insert entry for id\n-264 const std::pair< typename Map::iterator, bool > inserted\n-265 = newData.insert( std::make_pair( id, value ) );\n-266\n-267 // if entry did not exist previously, copy data\n-268 if( inserted.second )\n-269 {\n-270 const typename Map::iterator pos = oldData.find( id );\n-271 if( pos != oldData.end() )\n-272 {\n-273 inserted.first->second = pos->second;\n-274 oldData.erase( pos );\n-275 }\n-276 }\n-277 }\n-278\n-279} // namespace Dune\n-280\n-281#endif // #ifndef DUNE_PERSISTENTCONTAINERMAP_HH\n-std::swap\n-void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n-> &b)\n-Definition utility/persistentcontainer.hh:83\n+169 template< int codim >\n+170 static const typename Codim< codim >::HostEntity &\n+171 hostEntity ( const typename Codim<_codim_>::Entity &entity )\n+172 {\n+173 return *entity.impl().hostEntity_;\n+174 }\n+175\n+176 static const HostLeafIntersection &\n+177 hostIntersection ( const LeafIntersection &intersection )\n+178 {\n+179 return *intersection.impl().hostIterator_;\n+180 }\n+181\n+182 static const HostLevelIntersection &\n+183 hostIntersection ( const LevelIntersection &intersection )\n+184 {\n+185 return *intersection.impl().hostIterator_;\n+186 }\n+187 };\n+188\n+189} // namespace Dune\n+190\n+191#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n Dune::Entity\n Wrapper class for entities.\n Definition common/entity.hh:66\n-Dune::Entity::codimension\n-static constexpr int codimension\n-Know your own codimension.\n-Definition common/entity.hh:106\n-Dune::IdSet\n-Id Set Interface.\n-Definition common/indexidset.hh:447\n-Dune::IdSet::IdType\n-IdTypeImp IdType\n-Type used to represent an id.\n-Definition common/indexidset.hh:453\n-Dune::Grid::LevelGridView\n-GridFamily::Traits::LevelGridView LevelGridView\n-type of view for level grid\n-Definition common/grid.hh:402\n-Dune::IdSet::Codim\n-Export the type of the entity used as parameter in the id(...) method.\n-Definition common/indexidset.hh:457\n-Dune::PersistentContainerMap\n-map-based implementation of the PersistentContainer\n-Definition persistentcontainermap.hh:26\n-Dune::PersistentContainerMap::migrateLevel\n-void migrateLevel(int level, const Value &value, Map &data, std::integral_\n-constant< bool, false >)\n-Definition persistentcontainermap.hh:240\n-Dune::PersistentContainerMap::swap\n-void swap(This &other)\n-Definition persistentcontainermap.hh:97\n-Dune::PersistentContainerMap::fill\n-void fill(const Value &value)\n-Definition persistentcontainermap.hh:95\n-Dune::PersistentContainerMap::Grid\n-G Grid\n-Definition persistentcontainermap.hh:34\n-Dune::PersistentContainerMap::resize\n-void resize(const Value &value)\n-Definition persistentcontainermap.hh:205\n-Dune::PersistentContainerMap::ConstIterator\n-IteratorWrapper< const Value, typename Map::const_iterator > ConstIterator\n-Definition persistentcontainermap.hh:39\n-Dune::PersistentContainerMap::codim_\n-int codim_\n-Definition persistentcontainermap.hh:133\n-Dune::PersistentContainerMap::grid_\n-const Grid * grid_\n-Definition persistentcontainermap.hh:132\n-Dune::PersistentContainerMap::operator[]\n-const Value & operator[](const Entity &entity) const\n-Definition persistentcontainermap.hh:52\n-Dune::PersistentContainerMap::codimension\n-int codimension() const\n-Definition persistentcontainermap.hh:111\n-Dune::PersistentContainerMap::resize\n-void resize(const Value &value=Value())\n-Definition persistentcontainermap.hh:87\n-Dune::PersistentContainerMap::idSet\n-const IdSet & idSet() const\n-Definition persistentcontainermap.hh:130\n-Dune::PersistentContainerMap::begin\n-ConstIterator begin() const\n-Definition persistentcontainermap.hh:175\n-Dune::PersistentContainerMap::migrateEntry\n-static void migrateEntry(const typename IdSet::IdType &id, const Value &value,\n-Map &oldData, Map &newData)\n-Definition persistentcontainermap.hh:260\n-Dune::PersistentContainerMap::Value\n-Map::mapped_type Value\n-Definition persistentcontainermap.hh:36\n-Dune::PersistentContainerMap::end\n-Iterator end()\n-Definition persistentcontainermap.hh:197\n-Dune::PersistentContainerMap::grid\n-const Grid & grid() const\n-Definition persistentcontainermap.hh:114\n-Dune::PersistentContainerMap::operator()\n-const Value & operator()(const Entity &entity, int subEntity) const\n-Definition persistentcontainermap.hh:70\n-Dune::PersistentContainerMap::PersistentContainerMap\n-PersistentContainerMap(const Grid &grid, int codim, const IdSet &idSet, const\n-Value &value)\n-Definition persistentcontainermap.hh:42\n-Dune::PersistentContainerMap::begin\n-Iterator begin()\n-Definition persistentcontainermap.hh:182\n-Dune::PersistentContainerMap::Size\n-Map::size_type Size\n-Definition persistentcontainermap.hh:37\n-Dune::PersistentContainerMap::end\n-ConstIterator end() const\n-Definition persistentcontainermap.hh:190\n-Dune::PersistentContainerMap::data_\n-Map data_\n-Definition persistentcontainermap.hh:135\n-Dune::PersistentContainerMap::size\n-Size size() const\n-Definition persistentcontainermap.hh:85\n-Dune::PersistentContainerMap::Iterator\n-IteratorWrapper< Value, typename Map::iterator > Iterator\n-Definition persistentcontainermap.hh:40\n-Dune::PersistentContainerMap::idSet_\n-const IdSet * idSet_\n-Definition persistentcontainermap.hh:134\n-Dune::PersistentContainerMap::migrateLevel\n-void migrateLevel(int level, const Value &value, Map &data, std::integral_\n-constant< bool, true >)\n-Definition persistentcontainermap.hh:224\n-Dune::PersistentContainerMap::shrinkToFit\n-void shrinkToFit()\n-Definition persistentcontainermap.hh:93\n-Dune::PersistentContainerMap::IteratorWrapper\n-Definition persistentcontainermap.hh:147\n-Dune::PersistentContainerMap::IteratorWrapper::IteratorWrapper\n-IteratorWrapper(const iterator &it)\n-Definition persistentcontainermap.hh:151\n-capabilities.hh\n-A set of traits classes to store static information about grid implementation.\n+Dune::Grid::LeafIntersection\n+GridFamily::Traits::LeafIntersection LeafIntersection\n+A type that is a model of Dune::Intersection, an intersections of two\n+codimension 1 of two codimensio...\n+Definition common/grid.hh:456\n+Dune::Grid::LevelIntersection\n+GridFamily::Traits::LevelIntersection LevelIntersection\n+A type that is a model of Dune::Intersection, an intersections of two\n+codimension 1 of two codimensio...\n+Definition common/grid.hh:461\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+Dune::GeometryGrid\n+grid wrapper replacing the geometries\n+Definition geometrygrid/grid.hh:86\n+Dune::GeometryGrid::hostGrid\n+const HostGrid & hostGrid() const\n+obtain constant reference to the host grid\n+Definition geometrygrid/grid.hh:533\n+Dune::GeometryGrid::Codim\n+traits structure containing types for a codimension\n+Definition geometrygrid/grid.hh:606\n+Dune::GeoGrid::Intersection\n+Definition geometrygrid/intersection.hh:22\n+Dune::IdentityGrid\n+Provides a meta grid that is identical to its host.\n+Definition identitygrid.hh:93\n+Dune::IdentityGrid::getHostGrid\n+HostGridType & getHostGrid() const\n+Returns the hostgrid this IdentityGrid lives in.\n+Definition identitygrid.hh:415\n+Dune::HostGridAccess\n+provides access to host grid objects from GeometryGrid\n+Definition identitygrid.hh:37\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::HostGrid\n+Grid::HostGrid HostGrid\n+type of HostGrid\n+Definition hostgridaccess.hh:49\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+HostLevelIntersection\n+HostGrid::Traits::LevelIntersection HostLevelIntersection\n+type of the host level intersection\n+Definition hostgridaccess.hh:75\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+hostEntity\n+static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity\n+&entity)\n+Definition hostgridaccess.hh:88\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+hostEntity\n+static const Codim< codim >::HostEntity & hostEntity(const typename Codim<\n+codim >::Entity &entity)\n+Definition hostgridaccess.hh:95\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+hostIntersection\n+static const HostIntersection & hostIntersection(const Intersection< const\n+Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection)\n+Definition hostgridaccess.hh:102\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::Grid\n+GeometryGrid< HG, CoordFunction, Allocator > Grid\n+Definition hostgridaccess.hh:46\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+LeafIntersection\n+Grid::Traits::LeafIntersection LeafIntersection\n+type of the GeometryGrid leaf intersection\n+Definition hostgridaccess.hh:68\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+HostLeafIntersection\n+HostGrid::Traits::LeafIntersection HostLeafIntersection\n+type of the host leaf intersection\n+Definition hostgridaccess.hh:73\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::hostGrid\n+static const HostGrid & hostGrid(const Grid &grid)\n+Get underlying HostGrid.\n+Definition hostgridaccess.hh:81\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::\n+LevelIntersection\n+Grid::Traits::LevelIntersection LevelIntersection\n+type of the GeometryGrid level intersection\n+Definition hostgridaccess.hh:70\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::Codim::\n+HostEntity\n+HostGrid::template Codim< codim >::Entity HostEntity\n+type of the host entity\n+Definition hostgridaccess.hh:64\n+Dune::HostGridAccess<_GeometryGrid<_HG,_CoordFunction,_Allocator_>_>::Codim::\n+Entity\n+Grid::template Codim< codim >::Entity Entity\n+type of the GeometryGrid entity\n+Definition hostgridaccess.hh:61\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::LeafIntersection\n+Grid::Traits::LeafIntersection LeafIntersection\n+type of the IdGrid leaf intersection\n+Definition hostgridaccess.hh:144\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::HostGrid\n+HG HostGrid\n+type of HostGrid\n+Definition hostgridaccess.hh:125\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Grid\n+IdentityGrid< HG > Grid\n+Definition hostgridaccess.hh:122\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostEntity\n+static const Codim< codim >::HostEntity & hostEntity(const typename Codim<\n+codim >::Entity &entity)\n+Definition hostgridaccess.hh:171\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::HostLevelIntersection\n+HostGrid::Traits::LevelIntersection HostLevelIntersection\n+type of the host level intersection\n+Definition hostgridaccess.hh:151\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::LevelIntersection\n+Grid::Traits::LevelIntersection LevelIntersection\n+type of the IdGrid level intersection\n+Definition hostgridaccess.hh:146\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostIntersection\n+static const HostLeafIntersection & hostIntersection(const LeafIntersection\n+&intersection)\n+Definition hostgridaccess.hh:177\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::HostLeafIntersection\n+HostGrid::Traits::LeafIntersection HostLeafIntersection\n+type of the host leaf intersection\n+Definition hostgridaccess.hh:149\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostEntity\n+static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity\n+&entity)\n+Definition hostgridaccess.hh:164\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostIntersection\n+static const HostLevelIntersection & hostIntersection(const LevelIntersection\n+&intersection)\n+Definition hostgridaccess.hh:183\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::hostGrid\n+static const HostGrid & hostGrid(const Grid &grid)\n+Get underlying HostGrid.\n+Definition hostgridaccess.hh:157\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Codim::Entity\n+Grid::template Codim< codim >::Entity Entity\n+type of the IdGrid entity\n+Definition hostgridaccess.hh:137\n+Dune::HostGridAccess<_IdentityGrid<_HG_>_>::Codim::HostEntity\n+HostGrid::template Codim< codim >::Entity HostEntity\n+type of the host entity\n+Definition hostgridaccess.hh:140\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01013.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01013.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: parmetisgridpartitioner.hh File Reference\n+dune-grid: vertexorderfactory.hh File Reference\n \n \n \n \n \n \n \n@@ -69,32 +69,44 @@\n \n
    \n \n
    \n
    \n
    \n-
    parmetisgridpartitioner.hh File Reference
    \n+ \n+
    vertexorderfactory.hh File Reference
    \n
    \n
    \n-\n-

    Compute a repartitioning of a Dune grid using ParMetis. \n-More...

    \n
    #include <algorithm>
    \n+#include <cstddef>
    \n+#include <functional>
    \n #include <vector>
    \n-#include <dune/common/parallel/mpihelper.hh>
    \n-#include <dune/common/exceptions.hh>
    \n #include <dune/geometry/referenceelements.hh>
    \n-#include <dune/grid/utility/globalindexset.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n-#include <dune/grid/common/rangegenerators.hh>
    \n+#include <dune/geometry/generalvertexorder.hh>
    \n
    \n

    Go to the source code of this file.

    \n-

    Detailed Description

    \n-

    Compute a repartitioning of a Dune grid using ParMetis.

    \n-
    \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n+\n+\n+\n+\n+

    \n+Classes

    class  Dune::VertexOrderByIdFactory< IdSet, Index >
     Factory for GeneralVertexOrder objects using an IdSet. More...
     
    struct  Dune::VertexOrderByIdFactory< IdSet, Index >::VertexOrder< dim >
     type of vertex order object may depend on the dimension of the element More...
     
    \n+\n+\n+\n+\n+

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,22 +1,30 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-parmetisgridpartitioner.hh File Reference\n-Compute a repartitioning of a Dune grid using ParMetis. More...\n+Classes | Namespaces\n+vertexorderfactory.hh File Reference\n #include \n+#include \n+#include \n #include \n-#include \n-#include \n #include \n-#include \n-#include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n-***** Detailed Description *****\n-Compute a repartitioning of a Dune grid using ParMetis.\n+Classes\n+ class \u00a0 Dune::VertexOrderByIdFactory<_IdSet,_Index_>\n+\u00a0 Factory for GeneralVertexOrder objects using an IdSet. More...\n+\u00a0\n+struct \u00a0 Dune::VertexOrderByIdFactory<_IdSet,_Index_>::VertexOrder<_dim_>\n+\u00a0 type of vertex order object may depend on the dimension of the element\n+ More...\n+\u00a0\n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01013_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01013_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: parmetisgridpartitioner.hh Source File\n+dune-grid: vertexorderfactory.hh Source File\n \n \n \n \n \n \n \n@@ -74,218 +74,82 @@\n \n
    \n \n
    \n
    \n
    \n-
    parmetisgridpartitioner.hh
    \n+
    vertexorderfactory.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3#ifndef DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH
    \n-
    4#define DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH
    \n+
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5
    \n-
    10#include <algorithm>
    \n-
    11#include <vector>
    \n-
    12
    \n-
    13#include <dune/common/parallel/mpihelper.hh>
    \n-
    14#include <dune/common/exceptions.hh>
    \n-
    15
    \n-
    16#include <dune/geometry/referenceelements.hh>
    \n-
    17
    \n-\n-\n-\n-
    21
    \n-
    22#if HAVE_PARMETIS
    \n-
    23
    \n-
    24#include <parmetis.h>
    \n-
    25
    \n-
    26// only enable for ParMETIS because the implementation uses functions that
    \n-
    27// are not emulated by scotch
    \n-
    28#ifdef PARMETIS_MAJOR_VERSION
    \n-
    29
    \n-
    30namespace Dune
    \n-
    31{
    \n-
    32
    \n-
    37 template<class GridView>
    \n-
    38 struct ParMetisGridPartitioner {
    \n-
    39
    \n-
    40 // define index type as provided by ParMETIS
    \n-
    41#if PARMETIS_MAJOR_VERSION > 3
    \n-
    42 typedef idx_t idx_type;
    \n-
    43 typedef ::real_t real_type;
    \n-
    44#else
    \n-
    45 typedef int idx_type;
    \n-
    46 typedef float real_type;
    \n-
    47#endif // PARMETIS_MAJOR_VERSION > 3
    \n-
    48
    \n-
    49 constexpr static int dimension = GridView::dimension;
    \n-
    50
    \n-
    51
    \n-
    62 static std::vector<unsigned> partition(const GridView& gv, const Dune::MPIHelper& mpihelper) {
    \n-
    63 const unsigned numElements = gv.size(0);
    \n-
    64
    \n-
    65 std::vector<unsigned> part(numElements);
    \n-
    66
    \n-
    67 // Setup parameters for ParMETIS
    \n-
    68 idx_type wgtflag = 0; // we don't use weights
    \n-
    69 idx_type numflag = 0; // we are using C-style arrays
    \n-
    70 idx_type ncon = 1; // number of balance constraints
    \n-
    71 idx_type ncommonnodes = 2; // number of nodes elements must have in common to be considered adjacent to each other
    \n-
    72 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed, output and coupling
    \n-
    73 idx_type edgecut; // will store number of edges cut by partition
    \n-
    74 idx_type nparts = mpihelper.size(); // number of parts equals number of processes
    \n-
    75 std::vector<real_type> tpwgts(ncon*nparts, 1./nparts); // load per subdomain and weight (same load on every process)
    \n-
    76 std::vector<real_type> ubvec(ncon, 1.05); // weight tolerance (same weight tolerance for every weight there is)
    \n+
    6#ifndef DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
    \n+
    7#define DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
    \n+
    8
    \n+
    9#include <algorithm>
    \n+
    10#include <cstddef>
    \n+
    11#include <functional>
    \n+
    12#include <vector>
    \n+
    13
    \n+
    14#include <dune/geometry/referenceelements.hh>
    \n+
    15#include <dune/geometry/generalvertexorder.hh>
    \n+
    16
    \n+
    17namespace Dune {
    \n+
    18
    \n+
    20
    \n+
    31 template<class IdSet, class Index = std::size_t>
    \n+
    \n+\n+
    33 const IdSet& idset;
    \n+
    34
    \n+
    35 public:
    \n+
    37 template<std::size_t dim>
    \n+
    \n+
    38 struct VertexOrder {
    \n+
    40 typedef GeneralVertexOrder<dim, Index> type;
    \n+
    41 };
    \n+
    \n+
    42
    \n+
    44
    \n+
    53 VertexOrderByIdFactory(const IdSet &idset_) : idset(idset_) { }
    \n+
    54
    \n+
    56
    \n+
    62 template<typename Element>
    \n+\n+
    \n+
    64 make(const Element &e) const {
    \n+
    65
    \n+
    66 std::size_t size = referenceElement(e.geometry()).size(Element::mydimension);
    \n+
    67
    \n+
    68 std::vector<typename IdSet::IdType> ids(size);
    \n+
    69 for(std::size_t i = 0; i < size; ++i)
    \n+
    70 ids[i] = idset.subId(e, i, Element::mydimension);
    \n+
    71 return GeneralVertexOrder<Element::mydimension, Index>
    \n+
    72 (e.type(), ids.begin(), ids.end());
    \n+
    73 }
    \n+
    \n+
    74 };
    \n+
    \n+
    75
    \n+
    76} // namespace Dune
    \n
    77
    \n-
    78 // The difference elmdist[i+1] - elmdist[i] is the number of nodes that are on process i
    \n-
    79 std::vector<idx_type> elmdist(nparts+1);
    \n-
    80 elmdist[0] = 0;
    \n-
    81 std::fill(elmdist.begin()+1, elmdist.end(), gv.size(0)); // all elements are on process zero
    \n-
    82
    \n-
    83 // Create and fill arrays "eptr", where eptr[i] is the number of vertices that belong to the i-th element, and
    \n-
    84 // "eind" contains the vertex-numbers of the i-the element in eind[eptr[i]] to eind[eptr[i+1]-1]
    \n-
    85 std::vector<idx_type> eptr, eind;
    \n-
    86 int numVertices = 0;
    \n-
    87 eptr.push_back(numVertices);
    \n-
    88
    \n-
    89 for (const auto& element : elements(gv, Partitions::interior)) {
    \n-
    90 const size_t curNumVertices = referenceElement<double, dimension>(element.type()).size(dimension);
    \n-
    91
    \n-
    92 numVertices += curNumVertices;
    \n-
    93 eptr.push_back(numVertices);
    \n-
    94
    \n-
    95 for (size_t k = 0; k < curNumVertices; ++k)
    \n-
    96 eind.push_back(gv.indexSet().subIndex(element, k, dimension));
    \n-
    97 }
    \n-
    98
    \n-
    99 // Partition mesh using ParMETIS
    \n-
    100 if (0 == mpihelper.rank()) {
    \n-
    101 MPI_Comm comm = Dune::MPIHelper::getLocalCommunicator();
    \n-
    102
    \n-
    103#if PARMETIS_MAJOR_VERSION >= 4
    \n-
    104 const int OK =
    \n-
    105#endif
    \n-
    106 ParMETIS_V3_PartMeshKway(elmdist.data(), eptr.data(), eind.data(), NULL, &wgtflag, &numflag,
    \n-
    107 &ncon, &ncommonnodes, &nparts, tpwgts.data(), ubvec.data(),
    \n-
    108 options, &edgecut, reinterpret_cast<idx_type*>(part.data()), &comm);
    \n-
    109
    \n-
    110#if PARMETIS_MAJOR_VERSION >= 4
    \n-
    111 if (OK != METIS_OK)
    \n-
    112 DUNE_THROW(Dune::Exception, "ParMETIS returned an error code.");
    \n-
    113#endif
    \n-
    114 }
    \n-
    115
    \n-
    116 return part;
    \n-
    117 }
    \n-
    118
    \n-
    130 static std::vector<unsigned> repartition(const GridView& gv, const Dune::MPIHelper& mpihelper, real_type itr = 1000) {
    \n-
    131
    \n-
    132 // Create global index map
    \n-
    133 GlobalIndexSet<GridView> globalIndex(gv,0);
    \n-
    134
    \n-
    135 int numElements = std::distance(gv.template begin<0, Interior_Partition>(),
    \n-
    136 gv.template end<0, Interior_Partition>());
    \n-
    137
    \n-
    138 std::vector<unsigned> interiorPart(numElements);
    \n-
    139
    \n-
    140 // Setup parameters for ParMETIS
    \n-
    141 idx_type wgtflag = 0; // we don't use weights
    \n-
    142 idx_type numflag = 0; // we are using C-style arrays
    \n-
    143 idx_type ncon = 1; // number of balance constraints
    \n-
    144 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed, output and coupling
    \n-
    145 idx_type edgecut; // will store number of edges cut by partition
    \n-
    146 idx_type nparts = mpihelper.size(); // number of parts equals number of processes
    \n-
    147 std::vector<real_type> tpwgts(ncon*nparts, 1./nparts); // load per subdomain and weight (same load on every process)
    \n-
    148 std::vector<real_type> ubvec(ncon, 1.05); // weight tolerance (same weight tolerance for every weight there is)
    \n-
    149
    \n-
    150 MPI_Comm comm = Dune::MPIHelper::getCommunicator();
    \n-
    151
    \n-
    152 // Make the number of interior elements of each processor available to all processors
    \n-
    153 std::vector<int> offset(gv.comm().size());
    \n-
    154 std::fill(offset.begin(), offset.end(), 0);
    \n-
    155
    \n-
    156 gv.comm().template allgather<int>(&numElements, 1, offset.data());
    \n-
    157
    \n-
    158 // The difference vtxdist[i+1] - vtxdist[i] is the number of elements that are on process i
    \n-
    159 std::vector<idx_type> vtxdist(gv.comm().size()+1);
    \n-
    160 vtxdist[0] = 0;
    \n-
    161
    \n-
    162 for (unsigned int i=1; i<vtxdist.size(); ++i)
    \n-
    163 vtxdist[i] = vtxdist[i-1] + offset[i-1];
    \n-
    164
    \n-
    165 // Set up element adjacency lists
    \n-
    166 std::vector<idx_type> xadj, adjncy;
    \n-
    167 xadj.push_back(0);
    \n-
    168
    \n-
    169 for (const auto& element : elements(gv, Partitions::interior)) {
    \n-
    170 size_t numNeighbors = 0;
    \n-
    171
    \n-
    172 for (const auto& in : intersections(gv, element)) {
    \n-
    173 if (in.neighbor()) {
    \n-
    174 adjncy.push_back(globalIndex.index(in.outside()));
    \n-
    175
    \n-
    176 ++numNeighbors;
    \n-
    177 }
    \n-
    178 }
    \n-
    179
    \n-
    180 xadj.push_back(xadj.back() + numNeighbors);
    \n-
    181 }
    \n-
    182
    \n-
    183#if PARMETIS_MAJOR_VERSION >= 4
    \n-
    184 const int OK =
    \n-
    185#endif
    \n-
    186 ParMETIS_V3_AdaptiveRepart(vtxdist.data(), xadj.data(), adjncy.data(), NULL, NULL, NULL,
    \n-
    187 &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), ubvec.data(),
    \n-
    188 &itr, options, &edgecut, reinterpret_cast<idx_type*>(interiorPart.data()), &comm);
    \n-
    189
    \n-
    190#if PARMETIS_MAJOR_VERSION >= 4
    \n-
    191 if (OK != METIS_OK)
    \n-
    192 DUNE_THROW(Dune::Exception, "ParMETIS returned error code " << OK);
    \n-
    193#endif
    \n-
    194
    \n-
    195 // At this point, interiorPart contains a target rank for each interior element, and they are sorted
    \n-
    196 // by the order in which the grid view traverses them. Now we need to do two things:
    \n-
    197 // a) Add additional dummy entries for the ghost elements
    \n-
    198 // b) Use the element index for the actual ordering. Since there may be different types of elements,
    \n-
    199 // we cannot use the index set directly, but have to go through a Mapper.
    \n-
    200
    \n-
    201 typedef MultipleCodimMultipleGeomTypeMapper<GridView> ElementMapper;
    \n-
    202 ElementMapper elementMapper(gv, mcmgElementLayout());
    \n-
    203
    \n-
    204 std::vector<unsigned int> part(gv.size(0));
    \n-
    205 std::fill(part.begin(), part.end(), 0);
    \n-
    206 unsigned int c = 0;
    \n-
    207 for (const auto& element : elements(gv, Partitions::interior))
    \n-
    208 part[elementMapper.index(element)] = interiorPart[c++];
    \n-
    209
    \n-
    210 return part;
    \n-
    211 }
    \n-
    212 };
    \n-
    213
    \n-
    214} // namespace Dune
    \n-
    215
    \n-
    216#else // PARMETIS_MAJOR_VERSION
    \n-
    217#warning "You seem to be using the ParMETIS emulation layer of scotch, which does not work with this file."
    \n-
    218#endif
    \n-
    219
    \n-
    220#else // HAVE_PARMETIS
    \n-
    221#warning "PARMETIS was not found, please check your configuration"
    \n-
    222#endif
    \n-
    223
    \n-
    224#endif // DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH
    \n-\n-
    Mapper for multiple codim and multiple geometry types.
    \n-
    Provides a globally unique index for all entities of a distributed Dune grid.
    \n-
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n+
    78#endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    constexpr Interior interior
    PartitionSet for the interior partition.
    Definition partitionset.hh:271
    \n+
    auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
    Definition common/geometry.hh:558
    \n+
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n+
    IdType subId(const typename Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Get id of subentity i of co-dimension codim of a co-dimension 0 entity.
    Definition common/indexidset.hh:481
    \n+
    Factory for GeneralVertexOrder objects using an IdSet.
    Definition vertexorderfactory.hh:32
    \n+
    VertexOrderByIdFactory(const IdSet &idset_)
    construct a factory object
    Definition vertexorderfactory.hh:53
    \n+
    VertexOrder< Element::mydimension >::type make(const Element &e) const
    construct a vertex ordering object
    Definition vertexorderfactory.hh:64
    \n+
    type of vertex order object may depend on the dimension of the element
    Definition vertexorderfactory.hh:38
    \n+
    GeneralVertexOrder< dim, Index > type
    type of vertex order object
    Definition vertexorderfactory.hh:40
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,248 +1,96 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-parmetisgridpartitioner.hh\n+vertexorderfactory.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3#ifndef DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH\n-4#define DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH\n+3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+4// vi: set et ts=4 sw=2 sts=2:\n 5\n-10#include \n-11#include \n-12\n-13#include \n-14#include \n-15\n-16#include \n-17\n-18#include \n-19#include \n-20#include \n-21\n-22#if HAVE_PARMETIS\n-23\n-24#include \n-25\n-26// only enable for ParMETIS because the implementation uses functions that\n-27// are not emulated by scotch\n-28#ifdef PARMETIS_MAJOR_VERSION\n-29\n-30namespace Dune\n-31{\n-32\n-37 template\n-38 struct ParMetisGridPartitioner {\n-39\n-40 // define index type as provided by ParMETIS\n-41#if PARMETIS_MAJOR_VERSION > 3\n-42 typedef idx_t idx_type;\n-43 typedef ::real_t real_type;\n-44#else\n-45 typedef int idx_type;\n-46 typedef float real_type;\n-47#endif // PARMETIS_MAJOR_VERSION > 3\n-48\n-49 constexpr static int dimension = GridView::dimension;\n-50\n-51\n-62 static std::vector partition(const GridView& gv, const Dune::\n-MPIHelper& mpihelper) {\n-63 const unsigned numElements = gv.size(0);\n-64\n-65 std::vector part(numElements);\n-66\n-67 // Setup parameters for ParMETIS\n-68 idx_type wgtflag = 0; // we don't use weights\n-69 idx_type numflag = 0; // we are using C-style arrays\n-70 idx_type ncon = 1; // number of balance constraints\n-71 idx_type ncommonnodes = 2; // number of nodes elements must have in common\n-to be considered adjacent to each other\n-72 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed,\n-output and coupling\n-73 idx_type edgecut; // will store number of edges cut by partition\n-74 idx_type nparts = mpihelper.size(); // number of parts equals number of\n-processes\n-75 std::vector tpwgts(ncon*nparts, 1./nparts); // load per subdomain\n-and weight (same load on every process)\n-76 std::vector ubvec(ncon, 1.05); // weight tolerance (same weight\n-tolerance for every weight there is)\n+6#ifndef DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH\n+7#define DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16\n+17namespace Dune {\n+18\n+20\n+31 template\n+32 class VertexOrderByIdFactory {\n+33 const IdSet& idset;\n+34\n+35 public:\n+37 template\n+38 struct VertexOrder {\n+40 typedef GeneralVertexOrder type;\n+41 };\n+42\n+44\n+53 VertexOrderByIdFactory(const IdSet &idset_) : idset(idset_) { }\n+54\n+56\n+62 template\n+63 typename VertexOrder::type\n+64 make(const Element &e) const {\n+65\n+66 std::size_t size = referenceElement(e.geometry()).size(Element::\n+mydimension);\n+67\n+68 std::vector ids(size);\n+69 for(std::size_t i = 0; i < size; ++i)\n+70 ids[i] = idset.subId(e, i, Element::mydimension);\n+71 return GeneralVertexOrder\n+72 (e.type(), ids.begin(), ids.end());\n+73 }\n+74 };\n+75\n+76} // namespace Dune\n 77\n-78 // The difference elmdist[i+1] - elmdist[i] is the number of nodes that are\n-on process i\n-79 std::vector elmdist(nparts+1);\n-80 elmdist[0] = 0;\n-81 std::fill(elmdist.begin()+1, elmdist.end(), gv.size(0)); // all elements are\n-on process zero\n-82\n-83 // Create and fill arrays \"eptr\", where eptr[i] is the number of vertices\n-that belong to the i-th element, and\n-84 // \"eind\" contains the vertex-numbers of the i-the element in eind[eptr[i]]\n-to eind[eptr[i+1]-1]\n-85 std::vector eptr, eind;\n-86 int numVertices = 0;\n-87 eptr.push_back(numVertices);\n-88\n-89 for (const auto& element : elements(gv, Partitions::interior)) {\n-90 const size_t curNumVertices = referenceElement\n-(element.type()).size(dimension);\n-91\n-92 numVertices += curNumVertices;\n-93 eptr.push_back(numVertices);\n-94\n-95 for (size_t k = 0; k < curNumVertices; ++k)\n-96 eind.push_back(gv.indexSet().subIndex(element, k, dimension));\n-97 }\n-98\n-99 // Partition mesh using ParMETIS\n-100 if (0 == mpihelper.rank()) {\n-101 MPI_Comm comm = Dune::MPIHelper::getLocalCommunicator();\n-102\n-103#if PARMETIS_MAJOR_VERSION >= 4\n-104 const int OK =\n-105#endif\n-106 ParMETIS_V3_PartMeshKway(elmdist.data(), eptr.data(), eind.data(), NULL,\n-&wgtflag, &numflag,\n-107 &ncon, &ncommonnodes, &nparts, tpwgts.data(), ubvec.data(),\n-108 options, &edgecut, reinterpret_cast(part.data()), &comm);\n-109\n-110#if PARMETIS_MAJOR_VERSION >= 4\n-111 if (OK != METIS_OK)\n-112 DUNE_THROW(Dune::Exception, \"ParMETIS returned an error code.\");\n-113#endif\n-114 }\n-115\n-116 return part;\n-117 }\n-118\n-130 static std::vector repartition(const GridView& gv, const Dune::\n-MPIHelper& mpihelper, real_type itr = 1000) {\n-131\n-132 // Create global index map\n-133 GlobalIndexSet globalIndex(gv,0);\n-134\n-135 int numElements = std::distance(gv.template begin<0, Interior_Partition>(),\n-136 gv.template end<0, Interior_Partition>());\n-137\n-138 std::vector interiorPart(numElements);\n-139\n-140 // Setup parameters for ParMETIS\n-141 idx_type wgtflag = 0; // we don't use weights\n-142 idx_type numflag = 0; // we are using C-style arrays\n-143 idx_type ncon = 1; // number of balance constraints\n-144 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed,\n-output and coupling\n-145 idx_type edgecut; // will store number of edges cut by partition\n-146 idx_type nparts = mpihelper.size(); // number of parts equals number of\n-processes\n-147 std::vector tpwgts(ncon*nparts, 1./nparts); // load per\n-subdomain and weight (same load on every process)\n-148 std::vector ubvec(ncon, 1.05); // weight tolerance (same weight\n-tolerance for every weight there is)\n-149\n-150 MPI_Comm comm = Dune::MPIHelper::getCommunicator();\n-151\n-152 // Make the number of interior elements of each processor available to all\n-processors\n-153 std::vector offset(gv.comm().size());\n-154 std::fill(offset.begin(), offset.end(), 0);\n-155\n-156 gv.comm().template allgather(&numElements, 1, offset.data());\n-157\n-158 // The difference vtxdist[i+1] - vtxdist[i] is the number of elements that\n-are on process i\n-159 std::vector vtxdist(gv.comm().size()+1);\n-160 vtxdist[0] = 0;\n-161\n-162 for (unsigned int i=1; i xadj, adjncy;\n-167 xadj.push_back(0);\n-168\n-169 for (const auto& element : elements(gv, Partitions::interior)) {\n-170 size_t numNeighbors = 0;\n-171\n-172 for (const auto& in : intersections(gv, element)) {\n-173 if (in.neighbor()) {\n-174 adjncy.push_back(globalIndex.index(in.outside()));\n-175\n-176 ++numNeighbors;\n-177 }\n-178 }\n-179\n-180 xadj.push_back(xadj.back() + numNeighbors);\n-181 }\n-182\n-183#if PARMETIS_MAJOR_VERSION >= 4\n-184 const int OK =\n-185#endif\n-186 ParMETIS_V3_AdaptiveRepart(vtxdist.data(), xadj.data(), adjncy.data(),\n-NULL, NULL, NULL,\n-187 &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), ubvec.data(),\n-188 &itr, options, &edgecut, reinterpret_cast(interiorPart.data()),\n-&comm);\n-189\n-190#if PARMETIS_MAJOR_VERSION >= 4\n-191 if (OK != METIS_OK)\n-192 DUNE_THROW(Dune::Exception, \"ParMETIS returned error code \" << OK);\n-193#endif\n-194\n-195 // At this point, interiorPart contains a target rank for each interior\n-element, and they are sorted\n-196 // by the order in which the grid view traverses them. Now we need to do\n-two things:\n-197 // a) Add additional dummy entries for the ghost elements\n-198 // b) Use the element index for the actual ordering. Since there may be\n-different types of elements,\n-199 // we cannot use the index set directly, but have to go through a Mapper.\n-200\n-201 typedef MultipleCodimMultipleGeomTypeMapper ElementMapper;\n-202 ElementMapper elementMapper(gv, mcmgElementLayout());\n-203\n-204 std::vector part(gv.size(0));\n-205 std::fill(part.begin(), part.end(), 0);\n-206 unsigned int c = 0;\n-207 for (const auto& element : elements(gv, Partitions::interior))\n-208 part[elementMapper.index(element)] = interiorPart[c++];\n-209\n-210 return part;\n-211 }\n-212 };\n-213\n-214} // namespace Dune\n-215\n-216#else // PARMETIS_MAJOR_VERSION\n-217#warning \"You seem to be using the ParMETIS emulation layer of scotch, which\n-does not work with this file.\"\n-218#endif\n-219\n-220#else // HAVE_PARMETIS\n-221#warning \"PARMETIS was not found, please check your configuration\"\n-222#endif\n-223\n-224#endif // DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH\n-rangegenerators.hh\n-mcmgmapper.hh\n-Mapper for multiple codim and multiple geometry types.\n-globalindexset.hh\n-Provides a globally unique index for all entities of a distributed Dune grid.\n-Dune::mcmgElementLayout\n-MCMGLayout mcmgElementLayout()\n-layout for elements (codim-0 entities)\n-Definition mcmgmapper.hh:97\n+78#endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Partitions::interior\n-constexpr Interior interior\n-PartitionSet for the interior partition.\n-Definition partitionset.hh:271\n+Dune::referenceElement\n+auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo)\n+-> decltype(referenceElement(geo, geo.impl()))\n+Definition common/geometry.hh:558\n+Dune::IdSet\n+Id Set Interface.\n+Definition common/indexidset.hh:447\n+Dune::IdSet::subId\n+IdType subId(const typename Codim< 0 >::Entity &e, int i, unsigned int codim)\n+const\n+Get id of subentity i of co-dimension codim of a co-dimension 0 entity.\n+Definition common/indexidset.hh:481\n+Dune::VertexOrderByIdFactory\n+Factory for GeneralVertexOrder objects using an IdSet.\n+Definition vertexorderfactory.hh:32\n+Dune::VertexOrderByIdFactory::VertexOrderByIdFactory\n+VertexOrderByIdFactory(const IdSet &idset_)\n+construct a factory object\n+Definition vertexorderfactory.hh:53\n+Dune::VertexOrderByIdFactory::make\n+VertexOrder< Element::mydimension >::type make(const Element &e) const\n+construct a vertex ordering object\n+Definition vertexorderfactory.hh:64\n+Dune::VertexOrderByIdFactory::VertexOrder\n+type of vertex order object may depend on the dimension of the element\n+Definition vertexorderfactory.hh:38\n+Dune::VertexOrderByIdFactory::VertexOrder::type\n+GeneralVertexOrder< dim, Index > type\n+type of vertex order object\n+Definition vertexorderfactory.hh:40\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01016.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01016.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridtype.hh File Reference\n+dune-grid: globalindexset.hh File Reference\n \n \n \n \n \n \n \n@@ -69,26 +69,69 @@\n \n
    \n \n
    \n \n
    \n-
    gridtype.hh File Reference
    \n+ \n+
    globalindexset.hh File Reference
    \n
    \n
    \n \n-

    This file can be included directly following config.h to test if a grid type was correctly selected. \n+

    Provides a globally unique index for all entities of a distributed Dune grid. \n More...

    \n-
    #include <dune-grid-config.hh>
    \n+
    #include <vector>
    \n+#include <iostream>
    \n+#include <fstream>
    \n+#include <memory>
    \n+#include <map>
    \n+#include <utility>
    \n+#include <algorithm>
    \n+#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/datahandleif.hh>
    \n+#include <dune/common/parallel/mpihelper.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::GlobalIndexSet< GridView >
     Calculate globally unique index over all processes in a Dune grid. More...
     
    struct  Dune::GlobalIndexSet< GridView >::SubPartitionTypeProvider< Entity, Codim >
     Helper class to provide access to subentity PartitionTypes with a run-time codimension. More...
     
    struct  Dune::GlobalIndexSet< GridView >::SubPartitionTypeProvider< Entity, 0 >
     
    \n+\n+\n+\n+\n+

    \n+Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    This file can be included directly following config.h to test if a grid type was correctly selected.

    \n-
    Author
    Andreas Dedner
    \n+

    Provides a globally unique index for all entities of a distributed Dune grid.

    \n+

    Such functionality is relevant for a number of applications:

      \n+
    • Map a degree of freedom associated with an entity to its location in a global matrix or global vector
    • \n+
    • Such indices for elements are needed as input to external mesh partitioners
    • \n+
    • Using matrix and vector routines from the PETSc or trilinos parallel linear algebra packages for distributed memory parallel computers.
    • \n+
    \n+

    Method: (1) The UniqueEntityPartition class assigns an owner process to each entity

        (2) Compute the number of entities that are owned by each process\n+\n+    (3) we communicate the index of entities that are owned by the process to processes\n+        that also contain these entities but do not own them, so that on a non-owner process\n+        we have information on the index of the entity that it got from the owner-process;\n+
    Author
    Benedikt Oswald, Patrick Leidenberger, Oliver Sander
    \n+
    Attention
    globally unique indices are ONLY provided for entities of the InteriorBorder_Partition type, NOT for the Ghost_Partition type !!!
    \n+
    Bug:
    This code will most likely not work on grids with more than one element type. Please ask on the mailing list if you need this feature.
    \n+
    Note
    The interface in this file is experimental, and may change without prior notice.
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,19 +1,71 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-gridtype.hh File Reference\n-This file can be included directly following config.h to test if a grid type\n-was correctly selected. More...\n-#include \n+Classes | Namespaces\n+globalindexset.hh File Reference\n+Provides a globally unique index for all entities of a distributed Dune grid.\n+More...\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+Classes\n+ class \u00a0 Dune::GlobalIndexSet<_GridView_>\n+\u00a0 Calculate globally unique index over all processes in a Dune grid.\n+ More...\n+\u00a0\n+struct \u00a0 Dune::GlobalIndexSet<_GridView_>::SubPartitionTypeProvider<_Entity,\n+ Codim_>\n+\u00a0 Helper class to provide access to subentity PartitionTypes with a run-\n+ time codimension. More...\n+\u00a0\n+struct \u00a0 Dune::GlobalIndexSet<_GridView_>::SubPartitionTypeProvider<_Entity,_0\n+ >\n+\u00a0\n+Namespaces\n+namespace \u00a0 Dune\n+\u00a0 Include standard header files.\n+\u00a0\n ***** Detailed Description *****\n-This file can be included directly following config.h to test if a grid type\n-was correctly selected.\n+Provides a globally unique index for all entities of a distributed Dune grid.\n+Such functionality is relevant for a number of applications:\n+ * Map a degree of freedom associated with an entity to its location in a\n+ global matrix or global vector\n+ * Such indices for elements are needed as input to external mesh\n+ partitioners\n+ * Using matrix and vector routines from the PETSc or trilinos parallel\n+ linear algebra packages for distributed memory parallel computers.\n+Method: (1) The UniqueEntityPartition class assigns an owner process to each\n+entity\n+ (2) Compute the number of entities that are owned by each process\n+\n+ (3) we communicate the index of entities that are owned by the process to\n+processes\n+ that also contain these entities but do not own them, so that on a non-\n+owner process\n+ we have information on the index of the entity that it got from the\n+owner-process;\n Author\n- Andreas Dedner\n+ Benedikt Oswald, Patrick Leidenberger, Oliver Sander\n+ Attention\n+ globally unique indices are ONLY provided for entities of the\n+ InteriorBorder_Partition type, NOT for the Ghost_Partition type !!!\n+ Bug:\n+ This code will most likely not work on grids with more than one element\n+ type. Please ask on the mailing list if you need this feature.\n+ Note\n+ The interface in this file is experimental, and may change without prior\n+ notice.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01016_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01016_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: gridtype.hh Source File\n+dune-grid: globalindexset.hh Source File\n \n \n \n \n \n \n \n@@ -74,44 +74,480 @@\n \n
    \n \n
    \n
    \n
    \n-
    gridtype.hh
    \n+
    globalindexset.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRIDTYPE_HH
    \n-
    6#define DUNE_GRIDTYPE_HH
    \n-
    7
    \n-
    17#include <dune-grid-config.hh> // HAVE_GRIDTYPE
    \n-
    18
    \n-
    19#ifndef HEADERCHECK
    \n-
    20
    \n-
    21// NOGRID is used to specify that no default was set during configure
    \n-
    22// If NOGRID and HAVE_GRIDTYPE are both not set then no grid was selected
    \n-
    23// and an error is produced
    \n-
    24#if defined NOGRID
    \n-
    25 #if ! HAVE_GRIDTYPE
    \n-
    26 #error "No grid type selected, use GRIDTYPE=..."
    \n-
    27 #endif
    \n-
    28#else
    \n-
    29 #if ! HAVE_GRIDTYPE
    \n-
    30 #error "No grid type selected, typo in GRIDTYPE=...?"
    \n-
    31 #endif
    \n-
    32#endif
    \n-
    33
    \n-
    34#endif // HEADERCHECK
    \n-
    35
    \n-
    36#endif // DUNE_GRIDTYPE_HH
    \n+
    5
    \n+
    35#ifndef DUNE_GRID_UTILITY_GLOBALINDEXSET_HH
    \n+
    36#define DUNE_GRID_UTILITY_GLOBALINDEXSET_HH
    \n+
    37
    \n+
    39#include <vector>
    \n+
    40#include <iostream>
    \n+
    41#include <fstream>
    \n+
    42#include <memory>
    \n+
    43#include <map>
    \n+
    44#include <utility>
    \n+
    45#include <algorithm>
    \n+
    46
    \n+\n+\n+
    50
    \n+
    52#if HAVE_MPI
    \n+
    53 #include <dune/common/parallel/mpihelper.hh>
    \n+
    54#endif
    \n+
    55
    \n+
    56namespace Dune
    \n+
    57{
    \n+
    58
    \n+
    61 template<class GridView>
    \n+
    \n+\n+
    63 {
    \n+
    64 public:
    \n+
    66 typedef int Index;
    \n+
    67
    \n+
    73 template <class Entity, int Codim>
    \n+
    \n+\n+
    75 {
    \n+
    \n+
    78 static PartitionType get(const Entity& entity, int codim, int i)
    \n+
    79 {
    \n+
    80 if (codim==Codim)
    \n+
    81 return entity.template subEntity<Codim>(i).partitionType();
    \n+
    82 else
    \n+
    83 return SubPartitionTypeProvider<Entity,Codim-1>::get(entity, codim, i);
    \n+
    84 }
    \n+
    \n+
    85 };
    \n+
    \n+
    86
    \n+
    87 template <class Entity>
    \n+
    \n+\n+
    89 {
    \n+
    \n+
    90 static PartitionType get(const Entity& entity, int /*codim*/, int i)
    \n+
    91 {
    \n+
    92 return entity.template subEntity<0>(i).partitionType();
    \n+
    93 }
    \n+
    \n+
    94 };
    \n+
    \n+
    95
    \n+
    96 private:
    \n+
    98 typedef typename GridView::Grid Grid;
    \n+
    99
    \n+
    100 typedef typename GridView::Grid::GlobalIdSet GlobalIdSet;
    \n+
    101 typedef typename GridView::Grid::GlobalIdSet::IdType IdType;
    \n+
    102 typedef typename GridView::Traits::template Codim<0>::Iterator Iterator;
    \n+
    103
    \n+
    104 typedef typename Grid::Communication Communication;
    \n+
    105
    \n+
    106 typedef std::map<IdType,Index> MapId2Index;
    \n+
    107 typedef std::map<Index,Index> IndexMap;
    \n+
    108
    \n+
    109 /*********************************************************************************************/
    \n+
    110 /* calculate unique partitioning for all entities of a given codim in a given GridView, */
    \n+
    111 /* assuming they all have the same geometry, i.e. codim, type */
    \n+
    112 /*********************************************************************************************/
    \n+
    113 class UniqueEntityPartition
    \n+
    114 {
    \n+
    115 private:
    \n+
    116 /* A DataHandle class to calculate the minimum of a std::vector which is accompanied by an index set */
    \n+
    117 template<class IS, class V> // mapper type and vector type
    \n+
    118 class MinimumExchange
    \n+
    119 : public Dune::CommDataHandleIF<MinimumExchange<IS,V>,typename V::value_type>
    \n+
    120 {
    \n+
    121 public:
    \n+
    123 typedef typename V::value_type DataType;
    \n+
    124
    \n+
    126 bool contains (int /*dim*/, unsigned int codim) const
    \n+
    127 {
    \n+
    128 return codim==indexSetCodim_;
    \n+
    129 }
    \n+
    130
    \n+
    132 bool fixedSize (int /*dim*/, int /*codim*/) const
    \n+
    133 {
    \n+
    134 return true ;
    \n+
    135 }
    \n+
    136
    \n+
    140 template<class EntityType>
    \n+
    141 std::size_t size (EntityType&) const
    \n+
    142 {
    \n+
    143 return 1 ;
    \n+
    144 }
    \n+
    145
    \n+
    147 template<class MessageBuffer, class EntityType>
    \n+
    148 void gather (MessageBuffer& buff, const EntityType& e) const
    \n+
    149 {
    \n+
    150 buff.write(v_[indexset_.index(e)]);
    \n+
    151 }
    \n+
    152
    \n+
    157 template<class MessageBuffer, class EntityType>
    \n+
    158 void scatter (MessageBuffer& buff, const EntityType& e, std::size_t)
    \n+
    159 {
    \n+
    160 DataType x;
    \n+
    161 buff.read(x);
    \n+
    162 if (x>=0) // other is -1 means, he does not want it
    \n+
    163 v_[indexset_.index(e)] = std::min(x,v_[indexset_.index(e)]);
    \n+
    164 }
    \n+
    165
    \n+
    167 MinimumExchange (const IS& indexset, V& v, unsigned int indexSetCodim)
    \n+
    168 : indexset_(indexset),
    \n+
    169 v_(v),
    \n+
    170 indexSetCodim_(indexSetCodim)
    \n+
    171 {}
    \n+
    172
    \n+
    173 private:
    \n+
    174 const IS& indexset_;
    \n+
    175 V& v_;
    \n+
    176 unsigned int indexSetCodim_;
    \n+
    177 };
    \n+
    178
    \n+
    179 public:
    \n+
    182 UniqueEntityPartition (const GridView& gridview, unsigned int codim)
    \n+
    183 : assignment_(gridview.size(codim))
    \n+
    184 {
    \n+
    186 typedef typename GridView::IndexSet IndexSet;
    \n+
    187
    \n+
    188 // assign own rank to entities that I might have
    \n+
    189 for (auto it = gridview.template begin<0>(); it!=gridview.template end<0>(); ++it)
    \n+
    190 for (unsigned int i=0; i<it->subEntities(codim); i++)
    \n+
    191 {
    \n+
    192 // Evil hack: I need to call subEntity, which needs the entity codimension as a static parameter.
    \n+
    193 // However, we only have it as a run-time parameter.
    \n+
    194 PartitionType subPartitionType = SubPartitionTypeProvider<typename GridView::template Codim<0>::Entity, GridView::dimension>::get(*it,codim,i);
    \n+
    195
    \n+
    196 assignment_[gridview.indexSet().subIndex(*it,i,codim)]
    \n+
    197 = ( subPartitionType==Dune::InteriorEntity or subPartitionType==Dune::BorderEntity )
    \n+
    198 ? gridview.comm().rank() // set to own rank
    \n+
    199 : - 1; // it is a ghost entity, I will not possibly own it.
    \n+
    200 }
    \n+
    201
    \n+
    203 MinimumExchange<IndexSet,std::vector<Index> > dh(gridview.indexSet(),assignment_,codim);
    \n+
    204
    \n+\n+
    206 }
    \n+
    207
    \n+
    209 int owner(std::size_t i)
    \n+
    210 {
    \n+
    211 return assignment_[i];
    \n+
    212 }
    \n+
    213
    \n+
    215 std::size_t numOwners(int rank) const
    \n+
    216 {
    \n+
    217 return std::count(assignment_.begin(), assignment_.end(), rank);
    \n+
    218 }
    \n+
    219
    \n+
    220 private:
    \n+
    221 std::vector<int> assignment_;
    \n+
    222 };
    \n+
    223
    \n+
    224 private:
    \n+
    225 /* A DataHandle class to communicate the global index from the
    \n+
    226 * owning to the non-owning entity; the class is based on the MinimumExchange
    \n+
    227 * class in the parallelsolver.hh header file.
    \n+
    228 */
    \n+
    229 class IndexExchange
    \n+
    230 : public Dune::CommDataHandleIF<IndexExchange,Index>
    \n+
    231 {
    \n+
    232 public:
    \n+
    234 bool contains (int /*dim*/, unsigned int codim) const
    \n+
    235 {
    \n+
    236 return codim==indexSetCodim_;
    \n+
    237 }
    \n+
    238
    \n+
    240 bool fixedSize (int /*dim*/, int /*codim*/) const
    \n+
    241 {
    \n+
    242 return true;
    \n+
    243 }
    \n+
    244
    \n+
    249 template<class EntityType>
    \n+
    250 std::size_t size (EntityType&) const
    \n+
    251 {
    \n+
    252 return 1;
    \n+
    253 }
    \n+
    254
    \n+
    256 template<class MessageBuffer, class EntityType>
    \n+
    257 void gather (MessageBuffer& buff, const EntityType& e) const
    \n+
    258 {
    \n+
    259 IdType id=globalidset_.id(e);
    \n+
    260
    \n+
    261 if (indexSetCodim_==0)
    \n+
    262 buff.write(mapid2entity_[id]);
    \n+
    263 else
    \n+
    264 buff.write((*mapid2entity_.find(id)).second);
    \n+
    265 }
    \n+
    266
    \n+
    271 template<class MessageBuffer, class EntityType>
    \n+
    272 void scatter (MessageBuffer& buff, const EntityType& entity, std::size_t)
    \n+
    273 {
    \n+
    274 Index x;
    \n+
    275 buff.read(x);
    \n+
    276
    \n+
    284 if(x >= 0) {
    \n+
    285 const IdType id = globalidset_.id(entity);
    \n+
    286
    \n+
    287 if (indexSetCodim_==0)
    \n+
    288 mapid2entity_[id] = x;
    \n+
    289 else
    \n+
    290 {
    \n+
    291 mapid2entity_.erase(id);
    \n+
    292 mapid2entity_.insert(std::make_pair(id,x));
    \n+
    293
    \n+
    294 const Index lindex = indexSet_.index(entity);
    \n+
    295 localGlobalMap_[lindex] = x;
    \n+
    296 }
    \n+
    297 }
    \n+
    298 }
    \n+
    299
    \n+
    301 IndexExchange (const GlobalIdSet& globalidset, MapId2Index& mapid2entity,
    \n+
    302 const typename GridView::IndexSet& localIndexSet, IndexMap& localGlobal,
    \n+
    303 unsigned int indexSetCodim)
    \n+
    304 : globalidset_(globalidset),
    \n+
    305 mapid2entity_(mapid2entity),
    \n+
    306 indexSet_(localIndexSet),
    \n+
    307 localGlobalMap_(localGlobal),
    \n+
    308 indexSetCodim_(indexSetCodim)
    \n+
    309 {}
    \n+
    310
    \n+
    311 private:
    \n+
    312 const GlobalIdSet& globalidset_;
    \n+
    313 MapId2Index& mapid2entity_;
    \n+
    314
    \n+
    315 const typename GridView::IndexSet& indexSet_;
    \n+
    316 IndexMap& localGlobalMap_;
    \n+
    317 unsigned int indexSetCodim_;
    \n+
    318 };
    \n+
    319
    \n+
    320 public:
    \n+
    \n+
    326 GlobalIndexSet(const GridView& gridview, int codim)
    \n+
    327 : gridview_(gridview),
    \n+
    328 codim_(codim)
    \n+
    329 {
    \n+
    330 int rank = gridview.comm().rank();
    \n+
    331 int size = gridview.comm().size();
    \n+
    332
    \n+
    333 const typename GridView::IndexSet& indexSet = gridview.indexSet();
    \n+
    334
    \n+
    335 std::unique_ptr<UniqueEntityPartition> uniqueEntityPartition;
    \n+
    336 if (codim_!=0)
    \n+
    337 uniqueEntityPartition = std::make_unique<UniqueEntityPartition>(gridview,codim_);
    \n+
    338
    \n+
    339 int nLocalEntity = (codim_==0)
    \n+
    340 ? std::distance(gridview.template begin<0, Dune::Interior_Partition>(), gridview.template end<0, Dune::Interior_Partition>())
    \n+
    341 : uniqueEntityPartition->numOwners(rank);
    \n+
    342
    \n+
    343 // Compute the global, non-redundant number of entities, i.e. the number of entities in the set
    \n+
    344 // without double, aka. redundant entities, on the interprocessor boundary via global reduce. */
    \n+
    345 nGlobalEntity_ = gridview.comm().template sum<int>(nLocalEntity);
    \n+
    346
    \n+
    347 /* communicate the number of locally owned entities to all other processes so that the respective offset
    \n+
    348 * can be calculated on the respective processor; we use the Dune mpi communication facility
    \n+
    349 * for this; first, we gather the number of locally owned entities on the root process and, second, we
    \n+
    350 * broadcast the array to all processes where the respective offset can be calculated. */
    \n+
    351
    \n+
    352 std::vector<int> offset(size);
    \n+
    353 std::fill(offset.begin(), offset.end(), 0);
    \n+
    354
    \n+
    356 gridview_.comm().template allgather<int>(&nLocalEntity, 1, offset.data());
    \n+
    357
    \n+
    358 int myoffset = 0;
    \n+
    359 for (int i=1; i<rank+1; i++)
    \n+
    360 myoffset += offset[i-1];
    \n+
    361
    \n+
    362 /* compute globally unique index over all processes; the idea of the algorithm is as follows: if
    \n+
    363 * an entity is owned by the process, it is assigned an index that is the addition of the offset
    \n+
    364 * specific for this process and a consecutively incremented counter; if the entity is not owned
    \n+
    365 * by the process, it is assigned -1, which signals that this specific entity will get its global
    \n+
    366 * unique index through communication afterwards;
    \n+
    367 *
    \n+
    368 * thus, the calculation of the globally unique index is divided into 2 stages:
    \n+
    369 *
    \n+
    370 * (1) we calculate the global index independently;
    \n+
    371 *
    \n+
    372 * (2) we achieve parallel adjustment by communicating the index
    \n+
    373 * from the owning entity to the non-owning entity.
    \n+
    374 *
    \n+
    375 */
    \n+
    376
    \n+
    377 // 1st stage of global index calculation: calculate global index for owned entities
    \n+
    378 // initialize map that stores an entity's global index via it's globally unique id as key
    \n+
    379 globalIndex_.clear();
    \n+
    380
    \n+
    381 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();
    \n+
    383 Index globalcontrib = 0;
    \n+
    385 if (codim_==0) // This case is simpler
    \n+
    386 {
    \n+
    387 for (Iterator iter = gridview_.template begin<0>(); iter!=gridview_.template end<0>(); ++iter)
    \n+
    388 {
    \n+
    389 const IdType id = globalIdSet.id(*iter);
    \n+
    392 if (iter->partitionType() == Dune::InteriorEntity)
    \n+
    393 {
    \n+
    394 const Index gindex = myoffset + globalcontrib;
    \n+
    396 globalIndex_[id] = gindex;
    \n+
    397 globalcontrib++;
    \n+
    398 }
    \n+
    399
    \n+
    401 else
    \n+
    402 {
    \n+
    403 globalIndex_[id] = -1;
    \n+
    404 }
    \n+
    405 }
    \n+
    406 }
    \n+
    407 else // if (codim==0) else
    \n+
    408 {
    \n+
    409 std::vector<bool> firstTime(gridview_.size(codim_));
    \n+
    410 std::fill(firstTime.begin(), firstTime.end(), true);
    \n+
    411
    \n+
    412 for(Iterator iter = gridview_.template begin<0>();iter!=gridview_.template end<0>(); ++iter)
    \n+
    413 {
    \n+
    414 for (std::size_t i=0; i<iter->subEntities(codim_); i++)
    \n+
    415 {
    \n+
    416 IdType id=globalIdSet.subId(*iter,i,codim_);
    \n+
    417
    \n+
    418 Index idx = gridview_.indexSet().subIndex(*iter,i,codim_);
    \n+
    419
    \n+
    420 if (!firstTime[idx] )
    \n+
    421 continue;
    \n+
    422
    \n+
    423 firstTime[idx] = false;
    \n+
    424
    \n+
    425 if (uniqueEntityPartition->owner(idx) == rank)
    \n+
    426 {
    \n+
    427 const Index gindex = myoffset + globalcontrib;
    \n+
    428 globalIndex_.insert(std::make_pair(id,gindex));
    \n+
    430 const Index lindex = idx;
    \n+
    431 localGlobalMap_[lindex] = gindex;
    \n+
    432
    \n+
    433 globalcontrib++;
    \n+
    434 }
    \n+
    435 else
    \n+
    436 {
    \n+
    437 globalIndex_.insert(std::make_pair(id,-1));
    \n+
    438 }
    \n+
    439 }
    \n+
    440
    \n+
    441 }
    \n+
    442 }
    \n+
    443
    \n+
    444 // 2nd stage of global index calculation: communicate global index for non-owned entities
    \n+
    445
    \n+
    446 // Create the data handle and communicate.
    \n+
    447 IndexExchange dataHandle(globalIdSet,globalIndex_,indexSet,localGlobalMap_,codim_);
    \n+\n+
    449 }
    \n+
    \n+
    450
    \n+
    452 template <class Entity>
    \n+
    \n+
    453 Index index(const Entity& entity) const
    \n+
    454 {
    \n+
    455 if (codim_==0)
    \n+
    456 {
    \n+
    458 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();
    \n+
    459 const IdType id = globalIdSet.id(entity);
    \n+
    460 const Index gindex = globalIndex_.find(id)->second;
    \n+
    462 return gindex;
    \n+
    463 }
    \n+
    464 else
    \n+
    465 return localGlobalMap_.find(gridview_.indexSet().index(entity))->second;
    \n+
    466 }
    \n+
    \n+
    467
    \n+
    473 template <class Entity>
    \n+
    \n+
    474 Index subIndex(const Entity& entity, unsigned int i, unsigned int codim) const
    \n+
    475 {
    \n+
    476 if (codim_==0)
    \n+
    477 {
    \n+
    479 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();
    \n+
    480 const IdType id = globalIdSet.subId(entity,i,codim);
    \n+
    481 const Index gindex = globalIndex_.find(id)->second;
    \n+
    483 return gindex;
    \n+
    484 }
    \n+
    485 else
    \n+
    486 return localGlobalMap_.find(gridview_.indexSet().subIndex(entity,i,codim))->second;
    \n+
    487 }
    \n+
    \n+
    488
    \n+
    \n+
    494 unsigned int size(unsigned int codim) const
    \n+
    495 {
    \n+
    496 return (codim_==codim) ? nGlobalEntity_ : 0;
    \n+
    497 }
    \n+
    \n+
    498
    \n+
    499 protected:
    \n+\n+
    501
    \n+
    503 unsigned int codim_;
    \n+
    504
    \n+\n+
    507
    \n+\n+
    509
    \n+
    512 MapId2Index globalIndex_;
    \n+
    513 };
    \n+
    \n+
    514
    \n+
    515} // namespace Dune
    \n+
    516
    \n+
    517#endif /* DUNE_GRID_UTILITY_GLOBALINDEXSET_HH */
    \n+\n+
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n+
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n+
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n+
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n+
    @ ForwardCommunication
    communicate as given in InterfaceType
    Definition gridenums.hh:171
    \n+
    @ All_All_Interface
    send all and receive all entities
    Definition gridenums.hh:91
    \n+
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n+
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n+
    const Grid & grid() const
    obtain a const reference to the underlying hierarchic grid
    Definition common/gridview.hh:166
    \n+
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n+
    int size(int codim) const
    obtain number of entities in a given codimension
    Definition common/gridview.hh:183
    \n+
    auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
    Communicate data on this view.
    Definition common/gridview.hh:292
    \n+
    const Communication & comm() const
    obtain communication object
    Definition common/gridview.hh:273
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n+
    Include standard header files.
    Definition agrid.hh:60
    \n+
    CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
    Definition datahandleif.hh:78
    \n+
    void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
    unpack data from message buffer to user.
    Definition datahandleif.hh:143
    \n+
    bool contains(int dim, int codim) const
    returns true if data for given valid codim should be communicated
    Definition datahandleif.hh:94
    \n+
    size_t size(const EntityType &e) const
    how many objects of type DataType have to be sent for a given entity
    Definition datahandleif.hh:118
    \n+
    void gather(MessageBufferImp &buff, const EntityType &e) const
    pack data from user to message buffer
    Definition datahandleif.hh:129
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    PartitionType partitionType() const
    Partition type of this entity.
    Definition common/entity.hh:127
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    typename GridFamily::Traits::Communication Communication
    A type that is a model of Dune::Communication. It provides a portable way for communication on the se...
    Definition common/grid.hh:515
    \n+
    Grid view abstract base class.
    Definition common/gridview.hh:66
    \n+
    Calculate globally unique index over all processes in a Dune grid.
    Definition globalindexset.hh:63
    \n+
    Index subIndex(const Entity &entity, unsigned int i, unsigned int codim) const
    Return the global index of a subentity of a given entity.
    Definition globalindexset.hh:474
    \n+
    MapId2Index globalIndex_
    Stores global index of entities with entity's globally unique id as key.
    Definition globalindexset.hh:512
    \n+
    int Index
    The number type used for global indices
    Definition globalindexset.hh:66
    \n+
    int nGlobalEntity_
    Global number of entities, i.e. number of entities without rendundant entities on interprocessor boun...
    Definition globalindexset.hh:506
    \n+
    Index index(const Entity &entity) const
    Return the global index of a given entity.
    Definition globalindexset.hh:453
    \n+
    unsigned int codim_
    Codimension of the entities that we hold indices for.
    Definition globalindexset.hh:503
    \n+
    IndexMap localGlobalMap_
    Definition globalindexset.hh:508
    \n+
    unsigned int size(unsigned int codim) const
    Return the total number of entities over all processes that we have indices for.
    Definition globalindexset.hh:494
    \n+
    GlobalIndexSet(const GridView &gridview, int codim)
    Constructor for a given GridView.
    Definition globalindexset.hh:326
    \n+
    const GridView gridview_
    Definition globalindexset.hh:500
    \n+
    Helper class to provide access to subentity PartitionTypes with a run-time codimension.
    Definition globalindexset.hh:75
    \n+
    static PartitionType get(const Entity &entity, int codim, int i)
    Get PartitionType of the i-th subentity of codimension 'codim' of entity 'entity'.
    Definition globalindexset.hh:78
    \n+
    static PartitionType get(const Entity &entity, int, int i)
    Definition globalindexset.hh:90
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,39 +1,604 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-gridtype.hh\n+globalindexset.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRIDTYPE_HH\n-6#define DUNE_GRIDTYPE_HH\n-7\n-17#include // HAVE_GRIDTYPE\n-18\n-19#ifndef HEADERCHECK\n-20\n-21// NOGRID is used to specify that no default was set during configure\n-22// If NOGRID and HAVE_GRIDTYPE are both not set then no grid was selected\n-23// and an error is produced\n-24#if defined NOGRID\n-25 #if ! HAVE_GRIDTYPE\n-26 #error \"No grid type selected, use GRIDTYPE=...\"\n-27 #endif\n-28#else\n-29 #if ! HAVE_GRIDTYPE\n-30 #error \"No grid type selected, typo in GRIDTYPE=...?\"\n-31 #endif\n-32#endif\n-33\n-34#endif // HEADERCHECK\n-35\n-36#endif // DUNE_GRIDTYPE_HH\n+5\n+35#ifndef DUNE_GRID_UTILITY_GLOBALINDEXSET_HH\n+36#define DUNE_GRID_UTILITY_GLOBALINDEXSET_HH\n+37\n+39#include \n+40#include \n+41#include \n+42#include \n+43#include \n+44#include \n+45#include \n+46\n+48#include \n+49#include \n+50\n+52#if HAVE_MPI\n+53 #include \n+54#endif\n+55\n+56namespace Dune\n+57{\n+58\n+61 template\n+62 class GlobalIndexSet\n+63 {\n+64 public:\n+66 typedef int Index;\n+67\n+73 template \n+74 struct SubPartitionTypeProvider\n+75 {\n+78 static PartitionType get(const Entity& entity, int codim, int i)\n+79 {\n+80 if (codim==Codim)\n+81 return entity.template subEntity(i).partitionType();\n+82 else\n+83 return SubPartitionTypeProvider::get(entity, codim, i);\n+84 }\n+85 };\n+86\n+87 template \n+88 struct SubPartitionTypeProvider\n+89 {\n+90 static PartitionType get(const Entity& entity, int /*codim*/, int i)\n+91 {\n+92 return entity.template subEntity<0>(i).partitionType();\n+93 }\n+94 };\n+95\n+96 private:\n+98 typedef typename GridView::Grid Grid;\n+99\n+100 typedef typename GridView::Grid::GlobalIdSet GlobalIdSet;\n+101 typedef typename GridView::Grid::GlobalIdSet::IdType IdType;\n+102 typedef typename GridView::Traits::template Codim<0>::Iterator Iterator;\n+103\n+104 typedef typename Grid::Communication Communication;\n+105\n+106 typedef std::map MapId2Index;\n+107 typedef std::map IndexMap;\n+108\n+109 /\n+*********************************************************************************************/\n+110 /* calculate unique partitioning for all entities of a given codim in a\n+given GridView, */\n+111 /* assuming they all have the same geometry, i.e. codim, type */\n+112 /\n+*********************************************************************************************/\n+113 class UniqueEntityPartition\n+114 {\n+115 private:\n+116 /* A DataHandle class to calculate the minimum of a std::vector which is\n+accompanied by an index set */\n+117 template // mapper type and vector type\n+118 class MinimumExchange\n+119 : public Dune::CommDataHandleIF,typename V::value_\n+type>\n+120 {\n+121 public:\n+123 typedef typename V::value_type DataType;\n+124\n+126 bool contains (int /*dim*/, unsigned int codim) const\n+127 {\n+128 return codim==indexSetCodim_;\n+129 }\n+130\n+132 bool fixedSize (int /*dim*/, int /*codim*/) const\n+133 {\n+134 return true ;\n+135 }\n+136\n+140 template\n+141 std::size_t size (EntityType&) const\n+142 {\n+143 return 1 ;\n+144 }\n+145\n+147 template\n+148 void gather (MessageBuffer& buff, const EntityType& e) const\n+149 {\n+150 buff.write(v_[indexset_.index(e)]);\n+151 }\n+152\n+157 template\n+158 void scatter (MessageBuffer& buff, const EntityType& e, std::size_t)\n+159 {\n+160 DataType x;\n+161 buff.read(x);\n+162 if (x>=0) // other is -1 means, he does not want it\n+163 v_[indexset_.index(e)] = std::min(x,v_[indexset_.index(e)]);\n+164 }\n+165\n+167 MinimumExchange (const IS& indexset, V& v, unsigned int indexSetCodim)\n+168 : indexset_(indexset),\n+169 v_(v),\n+170 indexSetCodim_(indexSetCodim)\n+171 {}\n+172\n+173 private:\n+174 const IS& indexset_;\n+175 V& v_;\n+176 unsigned int indexSetCodim_;\n+177 };\n+178\n+179 public:\n+182 UniqueEntityPartition (const GridView& gridview, unsigned int codim)\n+183 : assignment_(gridview.size(codim))\n+184 {\n+186 typedef typename GridView::IndexSet IndexSet;\n+187\n+188 // assign own rank to entities that I might have\n+189 for (auto it = gridview.template begin<0>(); it!=gridview.template end<0>\n+(); ++it)\n+190 for (unsigned int i=0; isubEntities(codim); i++)\n+191 {\n+192 // Evil hack: I need to call subEntity, which needs the entity codimension\n+as a static parameter.\n+193 // However, we only have it as a run-time parameter.\n+194 PartitionType subPartitionType = SubPartitionTypeProvider::Entity, GridView::dimension>::get(*it,codim,i);\n+195\n+196 assignment_[gridview.indexSet().subIndex(*it,i,codim)]\n+197 = ( subPartitionType==Dune::InteriorEntity or subPartitionType==Dune::\n+BorderEntity )\n+198 ? gridview.comm().rank() // set to own rank\n+199 : - 1; // it is a ghost entity, I will not possibly own it.\n+200 }\n+201\n+203 MinimumExchange > dh(gridview.indexSet\n+(),assignment_,codim);\n+204\n+205 gridview.communicate(dh,Dune::All_All_Interface,Dune::\n+ForwardCommunication);\n+206 }\n+207\n+209 int owner(std::size_t i)\n+210 {\n+211 return assignment_[i];\n+212 }\n+213\n+215 std::size_t numOwners(int rank) const\n+216 {\n+217 return std::count(assignment_.begin(), assignment_.end(), rank);\n+218 }\n+219\n+220 private:\n+221 std::vector assignment_;\n+222 };\n+223\n+224 private:\n+225 /* A DataHandle class to communicate the global index from the\n+226 * owning to the non-owning entity; the class is based on the\n+MinimumExchange\n+227 * class in the parallelsolver.hh header file.\n+228 */\n+229 class IndexExchange\n+230 : public Dune::CommDataHandleIF\n+231 {\n+232 public:\n+234 bool contains (int /*dim*/, unsigned int codim) const\n+235 {\n+236 return codim==indexSetCodim_;\n+237 }\n+238\n+240 bool fixedSize (int /*dim*/, int /*codim*/) const\n+241 {\n+242 return true;\n+243 }\n+244\n+249 template\n+250 std::size_t size (EntityType&) const\n+251 {\n+252 return 1;\n+253 }\n+254\n+256 template\n+257 void gather (MessageBuffer& buff, const EntityType& e) const\n+258 {\n+259 IdType id=globalidset_.id(e);\n+260\n+261 if (indexSetCodim_==0)\n+262 buff.write(mapid2entity_[id]);\n+263 else\n+264 buff.write((*mapid2entity_.find(id)).second);\n+265 }\n+266\n+271 template\n+272 void scatter (MessageBuffer& buff, const EntityType& entity, std::size_t)\n+273 {\n+274 Index x;\n+275 buff.read(x);\n+276\n+284 if(x >= 0) {\n+285 const IdType id = globalidset_.id(entity);\n+286\n+287 if (indexSetCodim_==0)\n+288 mapid2entity_[id] = x;\n+289 else\n+290 {\n+291 mapid2entity_.erase(id);\n+292 mapid2entity_.insert(std::make_pair(id,x));\n+293\n+294 const Index lindex = indexSet_.index(entity);\n+295 localGlobalMap_[lindex] = x;\n+296 }\n+297 }\n+298 }\n+299\n+301 IndexExchange (const GlobalIdSet& globalidset, MapId2Index& mapid2entity,\n+302 const typename GridView::IndexSet& localIndexSet, IndexMap& localGlobal,\n+303 unsigned int indexSetCodim)\n+304 : globalidset_(globalidset),\n+305 mapid2entity_(mapid2entity),\n+306 indexSet_(localIndexSet),\n+307 localGlobalMap_(localGlobal),\n+308 indexSetCodim_(indexSetCodim)\n+309 {}\n+310\n+311 private:\n+312 const GlobalIdSet& globalidset_;\n+313 MapId2Index& mapid2entity_;\n+314\n+315 const typename GridView::IndexSet& indexSet_;\n+316 IndexMap& localGlobalMap_;\n+317 unsigned int indexSetCodim_;\n+318 };\n+319\n+320 public:\n+326 GlobalIndexSet(const GridView& gridview, int codim)\n+327 : gridview_(gridview),\n+328 codim_(codim)\n+329 {\n+330 int rank = gridview.comm().rank();\n+331 int size = gridview.comm().size();\n+332\n+333 const typename GridView::IndexSet& indexSet = gridview.indexSet();\n+334\n+335 std::unique_ptr uniqueEntityPartition;\n+336 if (codim_!=0)\n+337 uniqueEntityPartition = std::make_unique\n+(gridview,codim_);\n+338\n+339 int nLocalEntity = (codim_==0)\n+340 ? std::distance(gridview.template begin<0, Dune::Interior_Partition>(),\n+gridview.template end<0, Dune::Interior_Partition>())\n+341 : uniqueEntityPartition->numOwners(rank);\n+342\n+343 // Compute the global, non-redundant number of entities, i.e. the number of\n+entities in the set\n+344 // without double, aka. redundant entities, on the interprocessor boundary\n+via global reduce. */\n+345 nGlobalEntity_ = gridview.comm().template sum(nLocalEntity);\n+346\n+347 /* communicate the number of locally owned entities to all other processes\n+so that the respective offset\n+348 * can be calculated on the respective processor; we use the Dune mpi\n+communication facility\n+349 * for this; first, we gather the number of locally owned entities on the\n+root process and, second, we\n+350 * broadcast the array to all processes where the respective offset can be\n+calculated. */\n+351\n+352 std::vector offset(size);\n+353 std::fill(offset.begin(), offset.end(), 0);\n+354\n+356 gridview_.comm().template allgather(&nLocalEntity, 1, offset.data());\n+357\n+358 int myoffset = 0;\n+359 for (int i=1; i();\n+iter!=gridview_.template end<0>(); ++iter)\n+388 {\n+389 const IdType id = globalIdSet.id(*iter);\n+392 if (iter->partitionType() == Dune::InteriorEntity)\n+393 {\n+394 const Index gindex = myoffset + globalcontrib;\n+396 globalIndex_[id] = gindex;\n+397 globalcontrib++;\n+398 }\n+399\n+401 else\n+402 {\n+403 globalIndex_[id] = -1;\n+404 }\n+405 }\n+406 }\n+407 else // if (codim==0) else\n+408 {\n+409 std::vector firstTime(gridview_.size(codim_));\n+410 std::fill(firstTime.begin(), firstTime.end(), true);\n+411\n+412 for(Iterator iter = gridview_.template begin<0>();iter!=gridview_.template\n+end<0>(); ++iter)\n+413 {\n+414 for (std::size_t i=0; isubEntities(codim_); i++)\n+415 {\n+416 IdType id=globalIdSet.subId(*iter,i,codim_);\n+417\n+418 Index idx = gridview_.indexSet().subIndex(*iter,i,codim_);\n+419\n+420 if (!firstTime[idx] )\n+421 continue;\n+422\n+423 firstTime[idx] = false;\n+424\n+425 if (uniqueEntityPartition->owner(idx) == rank)\n+426 {\n+427 const Index gindex = myoffset + globalcontrib;\n+428 globalIndex_.insert(std::make_pair(id,gindex));\n+430 const Index lindex = idx;\n+431 localGlobalMap_[lindex] = gindex;\n+432\n+433 globalcontrib++;\n+434 }\n+435 else\n+436 {\n+437 globalIndex_.insert(std::make_pair(id,-1));\n+438 }\n+439 }\n+440\n+441 }\n+442 }\n+443\n+444 // 2nd stage of global index calculation: communicate global index for non-\n+owned entities\n+445\n+446 // Create the data handle and communicate.\n+447 IndexExchange dataHandle\n+(globalIdSet,globalIndex_,indexSet,localGlobalMap_,codim_);\n+448 gridview_.communicate(dataHandle, Dune::All_All_Interface, Dune::\n+ForwardCommunication);\n+449 }\n+450\n+452 template \n+453 Index index(const Entity& entity) const\n+454 {\n+455 if (codim_==0)\n+456 {\n+458 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();\n+459 const IdType id = globalIdSet.id(entity);\n+460 const Index gindex = globalIndex_.find(id)->second;\n+462 return gindex;\n+463 }\n+464 else\n+465 return localGlobalMap_.find(gridview_.indexSet().index(entity))->second;\n+466 }\n+467\n+473 template \n+474 Index subIndex(const Entity& entity, unsigned int i, unsigned int codim)\n+const\n+475 {\n+476 if (codim_==0)\n+477 {\n+479 const GlobalIdSet& globalIdSet = gridview_.grid().globalIdSet();\n+480 const IdType id = globalIdSet.subId(entity,i,codim);\n+481 const Index gindex = globalIndex_.find(id)->second;\n+483 return gindex;\n+484 }\n+485 else\n+486 return localGlobalMap_.find(gridview_.indexSet().subIndex(entity,i,codim))-\n+>second;\n+487 }\n+488\n+494 unsigned int size(unsigned int codim) const\n+495 {\n+496 return (codim_==codim) ? nGlobalEntity_ : 0;\n+497 }\n+498\n+499 protected:\n+500 const GridView gridview_;\n+501\n+503 unsigned int codim_;\n+504\n+506 int nGlobalEntity_;\n+507\n+508 IndexMap localGlobalMap_;\n+509\n+512 MapId2Index globalIndex_;\n+513 };\n+514\n+515} // namespace Dune\n+516\n+517#endif /* DUNE_GRID_UTILITY_GLOBALINDEXSET_HH */\n+gridenums.hh\n+datahandleif.hh\n+Describes the parallel communication interface class for MessageBuffers and\n+DataHandles.\n+Dune::PartitionType\n+PartitionType\n+Attributes used in the generic overlap model.\n+Definition gridenums.hh:30\n+Dune::InteriorEntity\n+@ InteriorEntity\n+all interior entities\n+Definition gridenums.hh:31\n+Dune::BorderEntity\n+@ BorderEntity\n+on boundary between interior and overlap\n+Definition gridenums.hh:32\n+Dune::ForwardCommunication\n+@ ForwardCommunication\n+communicate as given in InterfaceType\n+Definition gridenums.hh:171\n+Dune::All_All_Interface\n+@ All_All_Interface\n+send all and receive all entities\n+Definition gridenums.hh:91\n+Dune::GridView::indexSet\n+const IndexSet & indexSet() const\n+obtain the index set\n+Definition common/gridview.hh:177\n+Dune::GridView::Grid\n+Traits::Grid Grid\n+type of the grid\n+Definition common/gridview.hh:83\n+Dune::GridView::grid\n+const Grid & grid() const\n+obtain a const reference to the underlying hierarchic grid\n+Definition common/gridview.hh:166\n+Dune::GridView::IndexSet\n+Traits::IndexSet IndexSet\n+type of the index set\n+Definition common/gridview.hh:86\n+Dune::GridView::size\n+int size(int codim) const\n+obtain number of entities in a given codimension\n+Definition common/gridview.hh:183\n+Dune::GridView::communicate\n+auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data,\n+InterfaceType iftype, CommunicationDirection dir) const\n+Communicate data on this view.\n+Definition common/gridview.hh:292\n+Dune::GridView::comm\n+const Communication & comm() const\n+obtain communication object\n+Definition common/gridview.hh:273\n+Dune::GridView::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/gridview.hh:134\n+Dune\n+Include standard header files.\n+Definition agrid.hh:60\n+Dune::CommDataHandleIF\n+CommDataHandleIF describes the features of a data handle for communication in\n+parallel runs using the...\n+Definition datahandleif.hh:78\n+Dune::CommDataHandleIF<_MinimumExchange<_IS,_V_>,_V::value_type_>::scatter\n+void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)\n+unpack data from message buffer to user.\n+Definition datahandleif.hh:143\n+Dune::CommDataHandleIF<_IndexExchange,_Index_>::contains\n+bool contains(int dim, int codim) const\n+returns true if data for given valid codim should be communicated\n+Definition datahandleif.hh:94\n+Dune::CommDataHandleIF<_MinimumExchange<_IS,_V_>,_V::value_type_>::size\n+size_t size(const EntityType &e) const\n+how many objects of type DataType have to be sent for a given entity\n+Definition datahandleif.hh:118\n+Dune::CommDataHandleIF<_MinimumExchange<_IS,_V_>,_V::value_type_>::gather\n+void gather(MessageBufferImp &buff, const EntityType &e) const\n+pack data from user to message buffer\n+Definition datahandleif.hh:129\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::partitionType\n+PartitionType partitionType() const\n+Partition type of this entity.\n+Definition common/entity.hh:127\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::Communication\n+typename GridFamily::Traits::Communication Communication\n+A type that is a model of Dune::Communication. It provides a portable way for\n+communication on the se...\n+Definition common/grid.hh:515\n+Dune::GridView\n+Grid view abstract base class.\n+Definition common/gridview.hh:66\n+Dune::GlobalIndexSet\n+Calculate globally unique index over all processes in a Dune grid.\n+Definition globalindexset.hh:63\n+Dune::GlobalIndexSet::subIndex\n+Index subIndex(const Entity &entity, unsigned int i, unsigned int codim) const\n+Return the global index of a subentity of a given entity.\n+Definition globalindexset.hh:474\n+Dune::GlobalIndexSet::globalIndex_\n+MapId2Index globalIndex_\n+Stores global index of entities with entity's globally unique id as key.\n+Definition globalindexset.hh:512\n+Dune::GlobalIndexSet::Index\n+int Index\n+The number type used for global indices\n+Definition globalindexset.hh:66\n+Dune::GlobalIndexSet::nGlobalEntity_\n+int nGlobalEntity_\n+Global number of entities, i.e. number of entities without rendundant entities\n+on interprocessor boun...\n+Definition globalindexset.hh:506\n+Dune::GlobalIndexSet::index\n+Index index(const Entity &entity) const\n+Return the global index of a given entity.\n+Definition globalindexset.hh:453\n+Dune::GlobalIndexSet::codim_\n+unsigned int codim_\n+Codimension of the entities that we hold indices for.\n+Definition globalindexset.hh:503\n+Dune::GlobalIndexSet::localGlobalMap_\n+IndexMap localGlobalMap_\n+Definition globalindexset.hh:508\n+Dune::GlobalIndexSet::size\n+unsigned int size(unsigned int codim) const\n+Return the total number of entities over all processes that we have indices\n+for.\n+Definition globalindexset.hh:494\n+Dune::GlobalIndexSet::GlobalIndexSet\n+GlobalIndexSet(const GridView &gridview, int codim)\n+Constructor for a given GridView.\n+Definition globalindexset.hh:326\n+Dune::GlobalIndexSet::gridview_\n+const GridView gridview_\n+Definition globalindexset.hh:500\n+Dune::GlobalIndexSet::SubPartitionTypeProvider\n+Helper class to provide access to subentity PartitionTypes with a run-time\n+codimension.\n+Definition globalindexset.hh:75\n+Dune::GlobalIndexSet::SubPartitionTypeProvider::get\n+static PartitionType get(const Entity &entity, int codim, int i)\n+Get PartitionType of the i-th subentity of codimension 'codim' of entity\n+'entity'.\n+Definition globalindexset.hh:78\n+Dune::GlobalIndexSet::SubPartitionTypeProvider<_Entity,_0_>::get\n+static PartitionType get(const Entity &entity, int, int i)\n+Definition globalindexset.hh:90\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01019.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01019.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vertexorderfactory.hh File Reference\n+dune-grid: persistentcontainervector.hh File Reference\n \n \n \n \n \n \n \n@@ -72,33 +72,26 @@\n
  • dune
  • grid
  • utility
  • \n
    \n \n
    \n \n-
    vertexorderfactory.hh File Reference
    \n+
    persistentcontainervector.hh File Reference
    \n
    \n
    \n
    #include <algorithm>
    \n-#include <cstddef>
    \n-#include <functional>
    \n-#include <vector>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/generalvertexorder.hh>
    \n+#include <cassert>
    \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::VertexOrderByIdFactory< IdSet, Index >
     Factory for GeneralVertexOrder objects using an IdSet. More...
     
    struct  Dune::VertexOrderByIdFactory< IdSet, Index >::VertexOrder< dim >
     type of vertex order object may depend on the dimension of the element More...
    class  Dune::PersistentContainerVector< G, IndexSet, Vector >
     vector-based implementation of the PersistentContainer More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,21 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n Classes | Namespaces\n-vertexorderfactory.hh File Reference\n+persistentcontainervector.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::VertexOrderByIdFactory<_IdSet,_Index_>\n-\u00a0 Factory for GeneralVertexOrder objects using an IdSet. More...\n-\u00a0\n-struct \u00a0 Dune::VertexOrderByIdFactory<_IdSet,_Index_>::VertexOrder<_dim_>\n-\u00a0 type of vertex order object may depend on the dimension of the element\n- More...\n+class \u00a0 Dune::PersistentContainerVector<_G,_IndexSet,_Vector_>\n+\u00a0 vector-based implementation of the PersistentContainer More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01019_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01019_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vertexorderfactory.hh Source File\n+dune-grid: persistentcontainervector.hh Source File\n \n \n \n \n \n \n \n@@ -74,82 +74,175 @@\n \n
    \n \n
    \n \n
    \n-
    vertexorderfactory.hh
    \n+
    persistentcontainervector.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
    \n-
    7#define DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
    \n-
    8
    \n-
    9#include <algorithm>
    \n-
    10#include <cstddef>
    \n-
    11#include <functional>
    \n-
    12#include <vector>
    \n+
    5#ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH
    \n+
    6#define DUNE_PERSISTENTCONTAINERVECTOR_HH
    \n+
    7
    \n+
    8#include <algorithm>
    \n+
    9#include <cassert>
    \n+
    10
    \n+
    11namespace Dune
    \n+
    12{
    \n
    13
    \n-
    14#include <dune/geometry/referenceelements.hh>
    \n-
    15#include <dune/geometry/generalvertexorder.hh>
    \n+
    14 // PersistentContainerVector
    \n+
    15 // -------------------------
    \n
    16
    \n-
    17namespace Dune {
    \n-
    18
    \n-
    20
    \n-
    31 template<class IdSet, class Index = std::size_t>
    \n-
    \n-\n-
    33 const IdSet& idset;
    \n-
    34
    \n-
    35 public:
    \n-
    37 template<std::size_t dim>
    \n-
    \n-
    38 struct VertexOrder {
    \n-
    40 typedef GeneralVertexOrder<dim, Index> type;
    \n-
    41 };
    \n-
    \n-
    42
    \n-
    44
    \n-
    53 VertexOrderByIdFactory(const IdSet &idset_) : idset(idset_) { }
    \n-
    54
    \n+
    49 template< class G, class IndexSet, class Vector >
    \n+
    \n+\n+
    51 {
    \n+\n+
    53
    \n+
    54 public:
    \n+
    55 typedef G Grid;
    \n
    56
    \n-
    62 template<typename Element>
    \n-\n+
    57 typedef typename Vector::value_type Value;
    \n+
    58 typedef typename Vector::size_type Size;
    \n+
    59 typedef typename Vector::const_iterator ConstIterator;
    \n+
    60 typedef typename Vector::iterator Iterator;
    \n+
    61
    \n+
    62 typedef typename Vector::allocator_type Allocator;
    \n+
    63
    \n
    \n-
    64 make(const Element &e) const {
    \n-
    65
    \n-
    66 std::size_t size = referenceElement(e.geometry()).size(Element::mydimension);
    \n-
    67
    \n-
    68 std::vector<typename IdSet::IdType> ids(size);
    \n-
    69 for(std::size_t i = 0; i < size; ++i)
    \n-
    70 ids[i] = idset.subId(e, i, Element::mydimension);
    \n-
    71 return GeneralVertexOrder<Element::mydimension, Index>
    \n-
    72 (e.type(), ids.begin(), ids.end());
    \n-
    73 }
    \n-
    \n-
    74 };
    \n-
    \n-
    75
    \n-
    76} // namespace Dune
    \n-
    77
    \n-
    78#endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
    \n+
    64 PersistentContainerVector ( const IndexSet &indexSet, int codim, const Value &value,
    \n+
    65 const Allocator &allocator = Allocator() )
    \n+
    66 : codim_( codim ),
    \n+\n+
    68 data_( indexSet.size( codim ), value, allocator )
    \n+
    69 {}
    \n+
    \n+
    70
    \n+
    71 template< class Entity >
    \n+
    \n+
    72 const Value &operator[] ( const Entity &entity ) const
    \n+
    73 {
    \n+
    74 assert( Entity::codimension == codimension() );
    \n+
    75 const Size index = indexSet().index( entity );
    \n+
    76 assert( index < data_.size() );
    \n+
    77 return data_[ index ];
    \n+
    78 }
    \n+
    \n+
    79
    \n+
    80 template< class Entity >
    \n+
    \n+
    81 Value &operator[] ( const Entity &entity )
    \n+
    82 {
    \n+
    83 assert( Entity::codimension == codimension() );
    \n+
    84 const Size index = indexSet().index( entity );
    \n+
    85 assert( index < data_.size() );
    \n+
    86 return data_[ index ];
    \n+
    87 }
    \n+
    \n+
    88
    \n+
    89 template< class Entity >
    \n+
    \n+
    90 const Value &operator() ( const Entity &entity, int subEntity ) const
    \n+
    91 {
    \n+
    92 const Size index = indexSet().subIndex( entity, subEntity, codimension() );
    \n+
    93 assert( index < data_.size() );
    \n+
    94 return data_[ index ];
    \n+
    95 }
    \n+
    \n+
    96
    \n+
    97 template< class Entity >
    \n+
    \n+
    98 Value &operator() ( const Entity &entity, int subEntity )
    \n+
    99 {
    \n+
    100 const Size index = indexSet().subIndex( entity, subEntity, codimension() );
    \n+
    101 assert( index < data_.size() );
    \n+
    102 return data_[ index ];
    \n+
    103 }
    \n+
    \n+
    104
    \n+
    105 Size size () const { return data_.size(); }
    \n+
    106
    \n+
    \n+
    107 void resize ( const Value &value = Value() )
    \n+
    108 {
    \n+
    109 const Size indexSetSize = indexSet().size( codimension() );
    \n+
    110 data_.resize( indexSetSize, value );
    \n+
    111 }
    \n+
    \n+
    112
    \n+
    113 void shrinkToFit () {}
    \n+
    114
    \n+
    115 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }
    \n+
    116
    \n+
    \n+
    117 void swap ( This &other )
    \n+
    118 {
    \n+
    119 std::swap( codim_, other.codim_ );
    \n+
    120 std::swap( indexSet_, other.indexSet_ );
    \n+
    121 std::swap( data_, other.data_ );
    \n+
    122 }
    \n+
    \n+
    123
    \n+
    124 ConstIterator begin () const { return data_.begin(); }
    \n+
    125 Iterator begin () { return data_.begin(); }
    \n+
    126
    \n+
    127 ConstIterator end () const { return data_.end(); }
    \n+
    128 Iterator end () { return data_.end(); }
    \n+
    129
    \n+
    130 int codimension () const { return codim_; }
    \n+
    131
    \n+
    132 protected:
    \n+
    133 const IndexSet &indexSet () const { return *indexSet_; }
    \n+
    134
    \n+\n+\n+
    137 Vector data_;
    \n+
    138 };
    \n+
    \n+
    139
    \n+
    140} // namespace Dune
    \n+
    141
    \n+
    142#endif // #ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH
    \n+
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
    Definition common/geometry.hh:558
    \n-
    Id Set Interface.
    Definition common/indexidset.hh:447
    \n-
    IdType subId(const typename Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Get id of subentity i of co-dimension codim of a co-dimension 0 entity.
    Definition common/indexidset.hh:481
    \n-
    Factory for GeneralVertexOrder objects using an IdSet.
    Definition vertexorderfactory.hh:32
    \n-
    VertexOrderByIdFactory(const IdSet &idset_)
    construct a factory object
    Definition vertexorderfactory.hh:53
    \n-
    VertexOrder< Element::mydimension >::type make(const Element &e) const
    construct a vertex ordering object
    Definition vertexorderfactory.hh:64
    \n-
    type of vertex order object may depend on the dimension of the element
    Definition vertexorderfactory.hh:38
    \n-
    GeneralVertexOrder< dim, Index > type
    type of vertex order object
    Definition vertexorderfactory.hh:40
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    static constexpr int codimension
    Know your own codimension.
    Definition common/entity.hh:106
    \n+
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n+
    auto size(GeometryType type) const
    Return total number of entities of given geometry type in entity set .
    Definition common/indexidset.hh:223
    \n+
    IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition common/indexidset.hh:153
    \n+
    IndexType index(const typename Traits::template Codim< cc >::Entity &e) const
    Map entity to index. The result of calling this method with an entity that is not in the index set is...
    Definition common/indexidset.hh:113
    \n+
    vector-based implementation of the PersistentContainer
    Definition persistentcontainervector.hh:51
    \n+
    PersistentContainerVector(const IndexSet &indexSet, int codim, const Value &value, const Allocator &allocator=Allocator())
    Definition persistentcontainervector.hh:64
    \n+
    Iterator begin()
    Definition persistentcontainervector.hh:125
    \n+
    Vector::size_type Size
    Definition persistentcontainervector.hh:58
    \n+
    Vector::value_type Value
    Definition persistentcontainervector.hh:57
    \n+
    Vector::allocator_type Allocator
    Definition persistentcontainervector.hh:62
    \n+
    void fill(const Value &value)
    Definition persistentcontainervector.hh:115
    \n+
    G Grid
    Definition persistentcontainervector.hh:55
    \n+
    const Value & operator()(const Entity &entity, int subEntity) const
    Definition persistentcontainervector.hh:90
    \n+
    const IndexSet * indexSet_
    Definition persistentcontainervector.hh:136
    \n+
    Vector::iterator Iterator
    Definition persistentcontainervector.hh:60
    \n+
    ConstIterator begin() const
    Definition persistentcontainervector.hh:124
    \n+
    ConstIterator end() const
    Definition persistentcontainervector.hh:127
    \n+
    int codim_
    Definition persistentcontainervector.hh:135
    \n+
    void shrinkToFit()
    Definition persistentcontainervector.hh:113
    \n+
    Vector::const_iterator ConstIterator
    Definition persistentcontainervector.hh:59
    \n+
    Vector data_
    Definition persistentcontainervector.hh:137
    \n+
    Iterator end()
    Definition persistentcontainervector.hh:128
    \n+
    const IndexSet & indexSet() const
    Definition persistentcontainervector.hh:133
    \n+
    int codimension() const
    Definition persistentcontainervector.hh:130
    \n+
    Size size() const
    Definition persistentcontainervector.hh:105
    \n+
    void swap(This &other)
    Definition persistentcontainervector.hh:117
    \n+
    const Value & operator[](const Entity &entity) const
    Definition persistentcontainervector.hh:72
    \n+
    void resize(const Value &value=Value())
    Definition persistentcontainervector.hh:107
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,96 +1,227 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-vertexorderfactory.hh\n+persistentcontainervector.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH\n-7#define DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH\n-8\n-9#include \n-10#include \n-11#include \n-12#include \n+5#ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH\n+6#define DUNE_PERSISTENTCONTAINERVECTOR_HH\n+7\n+8#include \n+9#include \n+10\n+11namespace Dune\n+12{\n 13\n-14#include \n-15#include \n+14 // PersistentContainerVector\n+15 // -------------------------\n 16\n-17namespace Dune {\n-18\n-20\n-31 template\n-32 class VertexOrderByIdFactory {\n-33 const IdSet& idset;\n-34\n-35 public:\n-37 template\n-38 struct VertexOrder {\n-40 typedef GeneralVertexOrder type;\n-41 };\n-42\n-44\n-53 VertexOrderByIdFactory(const IdSet &idset_) : idset(idset_) { }\n-54\n+49 template< class G, class IndexSet, class Vector >\n+50 class PersistentContainerVector\n+51 {\n+52 typedef PersistentContainerVector<_G,_IndexSet,_Vector_> This;\n+53\n+54 public:\n+55 typedef G Grid;\n 56\n-62 template\n-63 typename VertexOrder::type\n-64 make(const Element &e) const {\n-65\n-66 std::size_t size = referenceElement(e.geometry()).size(Element::\n-mydimension);\n-67\n-68 std::vector ids(size);\n-69 for(std::size_t i = 0; i < size; ++i)\n-70 ids[i] = idset.subId(e, i, Element::mydimension);\n-71 return GeneralVertexOrder\n-72 (e.type(), ids.begin(), ids.end());\n-73 }\n-74 };\n-75\n-76} // namespace Dune\n-77\n-78#endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH\n+57 typedef typename Vector::value_type Value;\n+58 typedef typename Vector::size_type Size;\n+59 typedef typename Vector::const_iterator ConstIterator;\n+60 typedef typename Vector::iterator Iterator;\n+61\n+62 typedef typename Vector::allocator_type Allocator;\n+63\n+64 PersistentContainerVector ( const IndexSet &indexSet, int codim, const Value\n+&value,\n+65 const Allocator &allocator = Allocator() )\n+66 : codim_( codim ),\n+67 indexSet_( &indexSet ),\n+68 data_( indexSet.size( codim ), value, allocator )\n+69 {}\n+70\n+71 template< class Entity >\n+72 const Value &operator[]_( const Entity &entity ) const\n+73 {\n+74 assert( Entity::codimension == codimension() );\n+75 const Size index = indexSet().index( entity );\n+76 assert( index < data_.size() );\n+77 return data_[ index ];\n+78 }\n+79\n+80 template< class Entity >\n+81 Value &operator[]_( const Entity &entity )\n+82 {\n+83 assert( Entity::codimension == codimension() );\n+84 const Size index = indexSet().index( entity );\n+85 assert( index < data_.size() );\n+86 return data_[ index ];\n+87 }\n+88\n+89 template< class Entity >\n+90 const Value &operator()_( const Entity &entity, int subEntity ) const\n+91 {\n+92 const Size index = indexSet().subIndex( entity, subEntity, codimension() );\n+93 assert( index < data_.size() );\n+94 return data_[ index ];\n+95 }\n+96\n+97 template< class Entity >\n+98 Value &operator()_( const Entity &entity, int subEntity )\n+99 {\n+100 const Size index = indexSet().subIndex( entity, subEntity, codimension() );\n+101 assert( index < data_.size() );\n+102 return data_[ index ];\n+103 }\n+104\n+105 Size size () const { return data_.size(); }\n+106\n+107 void resize ( const Value &value = Value() )\n+108 {\n+109 const Size indexSetSize = indexSet().size( codimension() );\n+110 data_.resize( indexSetSize, value );\n+111 }\n+112\n+113 void shrinkToFit () {}\n+114\n+115 void fill ( const Value &value ) { std::fill( begin(), end(), value ); }\n+116\n+117 void swap ( This &other )\n+118 {\n+119 std::swap( codim_, other.codim_ );\n+120 std::swap( indexSet_, other.indexSet_ );\n+121 std::swap( data_, other.data_ );\n+122 }\n+123\n+124 ConstIterator begin () const { return data_.begin(); }\n+125 Iterator begin () { return data_.begin(); }\n+126\n+127 ConstIterator end () const { return data_.end(); }\n+128 Iterator end () { return data_.end(); }\n+129\n+130 int codimension () const { return codim_; }\n+131\n+132 protected:\n+133 const IndexSet &indexSet () const { return *indexSet_; }\n+134\n+135 int codim_;\n+136 const IndexSet *indexSet_;\n+137 Vector data_;\n+138 };\n+139\n+140} // namespace Dune\n+141\n+142#endif // #ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH\n+std::swap\n+void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n+> &b)\n+Definition utility/persistentcontainer.hh:83\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::referenceElement\n-auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo)\n--> decltype(referenceElement(geo, geo.impl()))\n-Definition common/geometry.hh:558\n-Dune::IdSet\n-Id Set Interface.\n-Definition common/indexidset.hh:447\n-Dune::IdSet::subId\n-IdType subId(const typename Codim< 0 >::Entity &e, int i, unsigned int codim)\n-const\n-Get id of subentity i of co-dimension codim of a co-dimension 0 entity.\n-Definition common/indexidset.hh:481\n-Dune::VertexOrderByIdFactory\n-Factory for GeneralVertexOrder objects using an IdSet.\n-Definition vertexorderfactory.hh:32\n-Dune::VertexOrderByIdFactory::VertexOrderByIdFactory\n-VertexOrderByIdFactory(const IdSet &idset_)\n-construct a factory object\n-Definition vertexorderfactory.hh:53\n-Dune::VertexOrderByIdFactory::make\n-VertexOrder< Element::mydimension >::type make(const Element &e) const\n-construct a vertex ordering object\n-Definition vertexorderfactory.hh:64\n-Dune::VertexOrderByIdFactory::VertexOrder\n-type of vertex order object may depend on the dimension of the element\n-Definition vertexorderfactory.hh:38\n-Dune::VertexOrderByIdFactory::VertexOrder::type\n-GeneralVertexOrder< dim, Index > type\n-type of vertex order object\n-Definition vertexorderfactory.hh:40\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Entity::codimension\n+static constexpr int codimension\n+Know your own codimension.\n+Definition common/entity.hh:106\n+Dune::IndexSet\n+Index Set Interface base class.\n+Definition common/indexidset.hh:78\n+Dune::IndexSet::size\n+auto size(GeometryType type) const\n+Return total number of entities of given geometry type in entity set .\n+Definition common/indexidset.hh:223\n+Dune::IndexSet::subIndex\n+IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int\n+i, unsigned int codim) const\n+Map a subentity to an index.\n+Definition common/indexidset.hh:153\n+Dune::IndexSet::index\n+IndexType index(const typename Traits::template Codim< cc >::Entity &e) const\n+Map entity to index. The result of calling this method with an entity that is\n+not in the index set is...\n+Definition common/indexidset.hh:113\n+Dune::PersistentContainerVector\n+vector-based implementation of the PersistentContainer\n+Definition persistentcontainervector.hh:51\n+Dune::PersistentContainerVector::PersistentContainerVector\n+PersistentContainerVector(const IndexSet &indexSet, int codim, const Value\n+&value, const Allocator &allocator=Allocator())\n+Definition persistentcontainervector.hh:64\n+Dune::PersistentContainerVector::begin\n+Iterator begin()\n+Definition persistentcontainervector.hh:125\n+Dune::PersistentContainerVector::Size\n+Vector::size_type Size\n+Definition persistentcontainervector.hh:58\n+Dune::PersistentContainerVector::Value\n+Vector::value_type Value\n+Definition persistentcontainervector.hh:57\n+Dune::PersistentContainerVector::Allocator\n+Vector::allocator_type Allocator\n+Definition persistentcontainervector.hh:62\n+Dune::PersistentContainerVector::fill\n+void fill(const Value &value)\n+Definition persistentcontainervector.hh:115\n+Dune::PersistentContainerVector::Grid\n+G Grid\n+Definition persistentcontainervector.hh:55\n+Dune::PersistentContainerVector::operator()\n+const Value & operator()(const Entity &entity, int subEntity) const\n+Definition persistentcontainervector.hh:90\n+Dune::PersistentContainerVector::indexSet_\n+const IndexSet * indexSet_\n+Definition persistentcontainervector.hh:136\n+Dune::PersistentContainerVector::Iterator\n+Vector::iterator Iterator\n+Definition persistentcontainervector.hh:60\n+Dune::PersistentContainerVector::begin\n+ConstIterator begin() const\n+Definition persistentcontainervector.hh:124\n+Dune::PersistentContainerVector::end\n+ConstIterator end() const\n+Definition persistentcontainervector.hh:127\n+Dune::PersistentContainerVector::codim_\n+int codim_\n+Definition persistentcontainervector.hh:135\n+Dune::PersistentContainerVector::shrinkToFit\n+void shrinkToFit()\n+Definition persistentcontainervector.hh:113\n+Dune::PersistentContainerVector::ConstIterator\n+Vector::const_iterator ConstIterator\n+Definition persistentcontainervector.hh:59\n+Dune::PersistentContainerVector::data_\n+Vector data_\n+Definition persistentcontainervector.hh:137\n+Dune::PersistentContainerVector::end\n+Iterator end()\n+Definition persistentcontainervector.hh:128\n+Dune::PersistentContainerVector::indexSet\n+const IndexSet & indexSet() const\n+Definition persistentcontainervector.hh:133\n+Dune::PersistentContainerVector::codimension\n+int codimension() const\n+Definition persistentcontainervector.hh:130\n+Dune::PersistentContainerVector::size\n+Size size() const\n+Definition persistentcontainervector.hh:105\n+Dune::PersistentContainerVector::swap\n+void swap(This &other)\n+Definition persistentcontainervector.hh:117\n+Dune::PersistentContainerVector::operator[]\n+const Value & operator[](const Entity &entity) const\n+Definition persistentcontainervector.hh:72\n+Dune::PersistentContainerVector::resize\n+void resize(const Value &value=Value())\n+Definition persistentcontainervector.hh:107\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01022.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01022.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainerwrapper.hh File Reference\n+dune-grid: parmetisgridpartitioner.hh File Reference\n \n \n \n \n \n \n \n@@ -69,36 +69,32 @@\n \n
    \n \n
    \n \n
    \n- \n-
    persistentcontainerwrapper.hh File Reference
    \n+
    parmetisgridpartitioner.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/utility/hostgridaccess.hh>
    \n-#include <dune/grid/utility/persistentcontainer.hh>
    \n+\n+

    Compute a repartitioning of a Dune grid using ParMetis. \n+More...

    \n+
    #include <algorithm>
    \n+#include <vector>
    \n+#include <dune/common/parallel/mpihelper.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/grid/utility/globalindexset.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/grid/common/rangegenerators.hh>
    \n
    \n

    Go to the source code of this file.

    \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n-

    \n-Classes

    class  Dune::PersistentContainerWrapper< G, T >
     
    \n-\n-\n-\n-\n-

    \n-Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-
    \n+

    Detailed Description

    \n+

    Compute a repartitioning of a Dune grid using ParMetis.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,21 +1,22 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-Classes | Namespaces\n-persistentcontainerwrapper.hh File Reference\n-#include \n-#include \n+parmetisgridpartitioner.hh File Reference\n+Compute a repartitioning of a Dune grid using ParMetis. 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 \u00a0 Dune::PersistentContainerWrapper<_G,_T_>\n-\u00a0\n-Namespaces\n-namespace \u00a0 Dune\n-\u00a0 Include standard header files.\n-\u00a0\n+***** Detailed Description *****\n+Compute a repartitioning of a Dune grid using ParMetis.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01022_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01022_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: persistentcontainerwrapper.hh Source File\n+dune-grid: parmetisgridpartitioner.hh Source File\n \n \n \n \n \n \n \n@@ -74,150 +74,218 @@\n \n
    \n \n
    \n \n
    \n-
    persistentcontainerwrapper.hh
    \n+
    parmetisgridpartitioner.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
    \n-
    6#define DUNE_PERSISTENTCONTAINERWRAPPER_HH
    \n-
    7
    \n-\n-\n-
    10
    \n-
    11namespace Dune
    \n-
    12{
    \n-
    13
    \n-
    14 // PersistentContainerWrapper
    \n-
    15 // --------------------------
    \n-
    16
    \n-
    17 template< class G, class T >
    \n-
    \n-\n-
    19 {
    \n-\n+
    3#ifndef DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH
    \n+
    4#define DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH
    \n+
    5
    \n+
    10#include <algorithm>
    \n+
    11#include <vector>
    \n+
    12
    \n+
    13#include <dune/common/parallel/mpihelper.hh>
    \n+
    14#include <dune/common/exceptions.hh>
    \n+
    15
    \n+
    16#include <dune/geometry/referenceelements.hh>
    \n+
    17
    \n+\n+\n+\n
    21
    \n-\n+
    22#if HAVE_PARMETIS
    \n
    23
    \n-
    24 typedef typename HostGridAccess::HostGrid HostGrid;
    \n-\n-
    26
    \n-
    27 public:
    \n-
    28 typedef G Grid;
    \n+
    24#include <parmetis.h>
    \n+
    25
    \n+
    26// only enable for ParMETIS because the implementation uses functions that
    \n+
    27// are not emulated by scotch
    \n+
    28#ifdef PARMETIS_MAJOR_VERSION
    \n
    29
    \n-\n-\n+
    30namespace Dune
    \n+
    31{
    \n
    32
    \n-\n-\n-
    35
    \n-
    \n-
    36 PersistentContainerWrapper ( const Grid &grid, int codim, const Value &value = Value() )
    \n-
    37 : hostContainer_( HostGridAccess::hostGrid( grid ), codim, value )
    \n-
    38 {}
    \n-
    \n+
    37 template<class GridView>
    \n+
    38 struct ParMetisGridPartitioner {
    \n
    39
    \n-
    40 template< class Entity >
    \n-
    \n-
    41 const Value &operator[] ( const Entity &entity ) const
    \n-
    42 {
    \n-
    43 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
    \n-
    44 }
    \n-
    \n-
    45
    \n-
    46 template< class Entity >
    \n-
    \n-
    47 Value &operator[] ( const Entity &entity )
    \n-
    48 {
    \n-
    49 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
    \n-
    50 }
    \n-
    \n+
    40 // define index type as provided by ParMETIS
    \n+
    41#if PARMETIS_MAJOR_VERSION > 3
    \n+
    42 typedef idx_t idx_type;
    \n+
    43 typedef ::real_t real_type;
    \n+
    44#else
    \n+
    45 typedef int idx_type;
    \n+
    46 typedef float real_type;
    \n+
    47#endif // PARMETIS_MAJOR_VERSION > 3
    \n+
    48
    \n+
    49 constexpr static int dimension = GridView::dimension;
    \n+
    50
    \n
    51
    \n-
    52 template< class Entity >
    \n-
    \n-
    53 const Value &operator() ( const Entity &entity, int subEntity ) const
    \n-
    54 {
    \n-
    55 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
    \n-
    56 }
    \n-
    \n-
    57
    \n-
    58 template< class Entity >
    \n-
    \n-
    59 Value &operator() ( const Entity &entity, int subEntity )
    \n-
    60 {
    \n-
    61 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
    \n-
    62 }
    \n-
    \n-
    63
    \n-
    64 Size size () const { return hostContainer_.size(); }
    \n-
    65
    \n-
    66 void resize ( const Value &value = Value() ) { hostContainer_.resize( value ); }
    \n-\n-
    68
    \n-
    69 void fill ( const Value &value = Value() ) { hostContainer_.fill( value ); }
    \n-
    70
    \n-
    71 void swap ( This &other ) { hostContainer_.swap( other.hostContainer_ ); }
    \n-
    72
    \n-
    73 ConstIterator begin () const { return hostContainer_.begin(); }
    \n-\n-
    75
    \n-
    76 ConstIterator end () const { return hostContainer_.end(); }
    \n-
    77 Iterator end () { return hostContainer_.end(); }
    \n-
    78
    \n-
    79 int codimension () const { return hostContainer_.codimension(); }
    \n-
    80
    \n-
    81 protected:
    \n-\n-
    83 };
    \n-
    \n-
    84
    \n-
    85} // namespace Dune
    \n-
    86
    \n-
    87#endif // #ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
    \n-\n+
    62 static std::vector<unsigned> partition(const GridView& gv, const Dune::MPIHelper& mpihelper) {
    \n+
    63 const unsigned numElements = gv.size(0);
    \n+
    64
    \n+
    65 std::vector<unsigned> part(numElements);
    \n+
    66
    \n+
    67 // Setup parameters for ParMETIS
    \n+
    68 idx_type wgtflag = 0; // we don't use weights
    \n+
    69 idx_type numflag = 0; // we are using C-style arrays
    \n+
    70 idx_type ncon = 1; // number of balance constraints
    \n+
    71 idx_type ncommonnodes = 2; // number of nodes elements must have in common to be considered adjacent to each other
    \n+
    72 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed, output and coupling
    \n+
    73 idx_type edgecut; // will store number of edges cut by partition
    \n+
    74 idx_type nparts = mpihelper.size(); // number of parts equals number of processes
    \n+
    75 std::vector<real_type> tpwgts(ncon*nparts, 1./nparts); // load per subdomain and weight (same load on every process)
    \n+
    76 std::vector<real_type> ubvec(ncon, 1.05); // weight tolerance (same weight tolerance for every weight there is)
    \n+
    77
    \n+
    78 // The difference elmdist[i+1] - elmdist[i] is the number of nodes that are on process i
    \n+
    79 std::vector<idx_type> elmdist(nparts+1);
    \n+
    80 elmdist[0] = 0;
    \n+
    81 std::fill(elmdist.begin()+1, elmdist.end(), gv.size(0)); // all elements are on process zero
    \n+
    82
    \n+
    83 // Create and fill arrays "eptr", where eptr[i] is the number of vertices that belong to the i-th element, and
    \n+
    84 // "eind" contains the vertex-numbers of the i-the element in eind[eptr[i]] to eind[eptr[i+1]-1]
    \n+
    85 std::vector<idx_type> eptr, eind;
    \n+
    86 int numVertices = 0;
    \n+
    87 eptr.push_back(numVertices);
    \n+
    88
    \n+
    89 for (const auto& element : elements(gv, Partitions::interior)) {
    \n+
    90 const size_t curNumVertices = referenceElement<double, dimension>(element.type()).size(dimension);
    \n+
    91
    \n+
    92 numVertices += curNumVertices;
    \n+
    93 eptr.push_back(numVertices);
    \n+
    94
    \n+
    95 for (size_t k = 0; k < curNumVertices; ++k)
    \n+
    96 eind.push_back(gv.indexSet().subIndex(element, k, dimension));
    \n+
    97 }
    \n+
    98
    \n+
    99 // Partition mesh using ParMETIS
    \n+
    100 if (0 == mpihelper.rank()) {
    \n+
    101 MPI_Comm comm = Dune::MPIHelper::getLocalCommunicator();
    \n+
    102
    \n+
    103#if PARMETIS_MAJOR_VERSION >= 4
    \n+
    104 const int OK =
    \n+
    105#endif
    \n+
    106 ParMETIS_V3_PartMeshKway(elmdist.data(), eptr.data(), eind.data(), NULL, &wgtflag, &numflag,
    \n+
    107 &ncon, &ncommonnodes, &nparts, tpwgts.data(), ubvec.data(),
    \n+
    108 options, &edgecut, reinterpret_cast<idx_type*>(part.data()), &comm);
    \n+
    109
    \n+
    110#if PARMETIS_MAJOR_VERSION >= 4
    \n+
    111 if (OK != METIS_OK)
    \n+
    112 DUNE_THROW(Dune::Exception, "ParMETIS returned an error code.");
    \n+
    113#endif
    \n+
    114 }
    \n+
    115
    \n+
    116 return part;
    \n+
    117 }
    \n+
    118
    \n+
    130 static std::vector<unsigned> repartition(const GridView& gv, const Dune::MPIHelper& mpihelper, real_type itr = 1000) {
    \n+
    131
    \n+
    132 // Create global index map
    \n+
    133 GlobalIndexSet<GridView> globalIndex(gv,0);
    \n+
    134
    \n+
    135 int numElements = std::distance(gv.template begin<0, Interior_Partition>(),
    \n+
    136 gv.template end<0, Interior_Partition>());
    \n+
    137
    \n+
    138 std::vector<unsigned> interiorPart(numElements);
    \n+
    139
    \n+
    140 // Setup parameters for ParMETIS
    \n+
    141 idx_type wgtflag = 0; // we don't use weights
    \n+
    142 idx_type numflag = 0; // we are using C-style arrays
    \n+
    143 idx_type ncon = 1; // number of balance constraints
    \n+
    144 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed, output and coupling
    \n+
    145 idx_type edgecut; // will store number of edges cut by partition
    \n+
    146 idx_type nparts = mpihelper.size(); // number of parts equals number of processes
    \n+
    147 std::vector<real_type> tpwgts(ncon*nparts, 1./nparts); // load per subdomain and weight (same load on every process)
    \n+
    148 std::vector<real_type> ubvec(ncon, 1.05); // weight tolerance (same weight tolerance for every weight there is)
    \n+
    149
    \n+
    150 MPI_Comm comm = Dune::MPIHelper::getCommunicator();
    \n+
    151
    \n+
    152 // Make the number of interior elements of each processor available to all processors
    \n+
    153 std::vector<int> offset(gv.comm().size());
    \n+
    154 std::fill(offset.begin(), offset.end(), 0);
    \n+
    155
    \n+
    156 gv.comm().template allgather<int>(&numElements, 1, offset.data());
    \n+
    157
    \n+
    158 // The difference vtxdist[i+1] - vtxdist[i] is the number of elements that are on process i
    \n+
    159 std::vector<idx_type> vtxdist(gv.comm().size()+1);
    \n+
    160 vtxdist[0] = 0;
    \n+
    161
    \n+
    162 for (unsigned int i=1; i<vtxdist.size(); ++i)
    \n+
    163 vtxdist[i] = vtxdist[i-1] + offset[i-1];
    \n+
    164
    \n+
    165 // Set up element adjacency lists
    \n+
    166 std::vector<idx_type> xadj, adjncy;
    \n+
    167 xadj.push_back(0);
    \n+
    168
    \n+
    169 for (const auto& element : elements(gv, Partitions::interior)) {
    \n+
    170 size_t numNeighbors = 0;
    \n+
    171
    \n+
    172 for (const auto& in : intersections(gv, element)) {
    \n+
    173 if (in.neighbor()) {
    \n+
    174 adjncy.push_back(globalIndex.index(in.outside()));
    \n+
    175
    \n+
    176 ++numNeighbors;
    \n+
    177 }
    \n+
    178 }
    \n+
    179
    \n+
    180 xadj.push_back(xadj.back() + numNeighbors);
    \n+
    181 }
    \n+
    182
    \n+
    183#if PARMETIS_MAJOR_VERSION >= 4
    \n+
    184 const int OK =
    \n+
    185#endif
    \n+
    186 ParMETIS_V3_AdaptiveRepart(vtxdist.data(), xadj.data(), adjncy.data(), NULL, NULL, NULL,
    \n+
    187 &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), ubvec.data(),
    \n+
    188 &itr, options, &edgecut, reinterpret_cast<idx_type*>(interiorPart.data()), &comm);
    \n+
    189
    \n+
    190#if PARMETIS_MAJOR_VERSION >= 4
    \n+
    191 if (OK != METIS_OK)
    \n+
    192 DUNE_THROW(Dune::Exception, "ParMETIS returned error code " << OK);
    \n+
    193#endif
    \n+
    194
    \n+
    195 // At this point, interiorPart contains a target rank for each interior element, and they are sorted
    \n+
    196 // by the order in which the grid view traverses them. Now we need to do two things:
    \n+
    197 // a) Add additional dummy entries for the ghost elements
    \n+
    198 // b) Use the element index for the actual ordering. Since there may be different types of elements,
    \n+
    199 // we cannot use the index set directly, but have to go through a Mapper.
    \n+
    200
    \n+
    201 typedef MultipleCodimMultipleGeomTypeMapper<GridView> ElementMapper;
    \n+
    202 ElementMapper elementMapper(gv, mcmgElementLayout());
    \n+
    203
    \n+
    204 std::vector<unsigned int> part(gv.size(0));
    \n+
    205 std::fill(part.begin(), part.end(), 0);
    \n+
    206 unsigned int c = 0;
    \n+
    207 for (const auto& element : elements(gv, Partitions::interior))
    \n+
    208 part[elementMapper.index(element)] = interiorPart[c++];
    \n+
    209
    \n+
    210 return part;
    \n+
    211 }
    \n+
    212 };
    \n+
    213
    \n+
    214} // namespace Dune
    \n+
    215
    \n+
    216#else // PARMETIS_MAJOR_VERSION
    \n+
    217#warning "You seem to be using the ParMETIS emulation layer of scotch, which does not work with this file."
    \n+
    218#endif
    \n+
    219
    \n+
    220#else // HAVE_PARMETIS
    \n+
    221#warning "PARMETIS was not found, please check your configuration"
    \n+
    222#endif
    \n+
    223
    \n+
    224#endif // DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH
    \n+
    Mapper for multiple codim and multiple geometry types.
    \n+\n+
    Provides a globally unique index for all entities of a distributed Dune grid.
    \n+
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n-\n-
    void swap(This &other)
    Definition persistentcontainermap.hh:97
    \n-
    void fill(const Value &value)
    Definition persistentcontainermap.hh:95
    \n-
    int codimension() const
    Definition persistentcontainermap.hh:111
    \n-
    void resize(const Value &value=Value())
    Definition persistentcontainermap.hh:87
    \n-
    ConstIterator begin() const
    Definition persistentcontainermap.hh:175
    \n-
    ConstIterator end() const
    Definition persistentcontainermap.hh:190
    \n-
    Size size() const
    Definition persistentcontainermap.hh:85
    \n-
    void shrinkToFit()
    Definition persistentcontainermap.hh:93
    \n-
    Definition persistentcontainerwrapper.hh:19
    \n-
    void fill(const Value &value=Value())
    Definition persistentcontainerwrapper.hh:69
    \n-
    PersistentContainer< HostGrid, T >::ConstIterator ConstIterator
    Definition persistentcontainerwrapper.hh:34
    \n-
    Size size() const
    Definition persistentcontainerwrapper.hh:64
    \n-
    ConstIterator begin() const
    Definition persistentcontainerwrapper.hh:73
    \n-
    const Value & operator()(const Entity &entity, int subEntity) const
    Definition persistentcontainerwrapper.hh:53
    \n-
    G Grid
    Definition persistentcontainerwrapper.hh:28
    \n-
    const Value & operator[](const Entity &entity) const
    Definition persistentcontainerwrapper.hh:41
    \n-
    void resize(const Value &value=Value())
    Definition persistentcontainerwrapper.hh:66
    \n-
    PersistentContainer< HostGrid, T >::Size Size
    Definition persistentcontainerwrapper.hh:31
    \n-
    int codimension() const
    Definition persistentcontainerwrapper.hh:79
    \n-
    PersistentContainer< HostGrid, T >::Value Value
    Definition persistentcontainerwrapper.hh:30
    \n-
    void swap(This &other)
    Definition persistentcontainerwrapper.hh:71
    \n-
    ConstIterator end() const
    Definition persistentcontainerwrapper.hh:76
    \n-
    PersistentContainerWrapper(const Grid &grid, int codim, const Value &value=Value())
    Definition persistentcontainerwrapper.hh:36
    \n-
    PersistentContainer< HostGrid, T >::Iterator Iterator
    Definition persistentcontainerwrapper.hh:33
    \n-
    void shrinkToFit()
    Definition persistentcontainerwrapper.hh:67
    \n-
    Iterator begin()
    Definition persistentcontainerwrapper.hh:74
    \n-
    PersistentContainer< HostGrid, T > hostContainer_
    Definition persistentcontainerwrapper.hh:82
    \n-
    Iterator end()
    Definition persistentcontainerwrapper.hh:77
    \n-\n+
    constexpr Interior interior
    PartitionSet for the interior partition.
    Definition partitionset.hh:271
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,198 +1,248 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * utility\n-persistentcontainerwrapper.hh\n+parmetisgridpartitioner.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n-3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n-4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH\n-6#define DUNE_PERSISTENTCONTAINERWRAPPER_HH\n-7\n-8#include \n-9#include \n-10\n-11namespace Dune\n-12{\n-13\n-14 // PersistentContainerWrapper\n-15 // --------------------------\n-16\n-17 template< class G, class T >\n-18 class PersistentContainerWrapper\n-19 {\n-20 typedef PersistentContainerWrapper<_G,_T_> This;\n+3#ifndef DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH\n+4#define DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH\n+5\n+10#include \n+11#include \n+12\n+13#include \n+14#include \n+15\n+16#include \n+17\n+18#include \n+19#include \n+20#include \n 21\n-22 typedef Dune::HostGridAccess<_G_> HostGridAccess;\n+22#if HAVE_PARMETIS\n 23\n-24 typedef typename HostGridAccess::HostGrid HostGrid;\n-25 typedef PersistentContainer<_HostGrid,_T_> PersistentContainerHostGrid;\n-26\n-27 public:\n-28 typedef G Grid;\n+24#include \n+25\n+26// only enable for ParMETIS because the implementation uses functions that\n+27// are not emulated by scotch\n+28#ifdef PARMETIS_MAJOR_VERSION\n 29\n-30 typedef typename PersistentContainer<_HostGrid,_T_>::Value Value;\n-31 typedef typename PersistentContainer<_HostGrid,_T_>::Size Size;\n+30namespace Dune\n+31{\n 32\n-33 typedef typename PersistentContainer<_HostGrid,_T_>::Iterator Iterator;\n-34 typedef typename PersistentContainer<_HostGrid,_T_>::ConstIterator\n-ConstIterator;\n-35\n-36 PersistentContainerWrapper ( const Grid &grid, int codim, const Value &value\n-= Value() )\n-37 : hostContainer_( HostGridAccess::hostGrid( grid ), codim, value )\n-38 {}\n+37 template\n+38 struct ParMetisGridPartitioner {\n 39\n-40 template< class Entity >\n-41 const Value &operator[]_( const Entity &entity ) const\n-42 {\n-43 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];\n-44 }\n-45\n-46 template< class Entity >\n-47 Value &operator[]_( const Entity &entity )\n-48 {\n-49 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];\n-50 }\n+40 // define index type as provided by ParMETIS\n+41#if PARMETIS_MAJOR_VERSION > 3\n+42 typedef idx_t idx_type;\n+43 typedef ::real_t real_type;\n+44#else\n+45 typedef int idx_type;\n+46 typedef float real_type;\n+47#endif // PARMETIS_MAJOR_VERSION > 3\n+48\n+49 constexpr static int dimension = GridView::dimension;\n+50\n 51\n-52 template< class Entity >\n-53 const Value &operator()_( const Entity &entity, int subEntity ) const\n-54 {\n-55 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );\n-56 }\n-57\n-58 template< class Entity >\n-59 Value &operator()_( const Entity &entity, int subEntity )\n-60 {\n-61 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );\n-62 }\n-63\n-64 Size size () const { return hostContainer_.size(); }\n-65\n-66 void resize ( const Value &value = Value() ) { hostContainer_.resize( value\n-); }\n-67 void shrinkToFit () { return hostContainer_.shrinkToFit(); }\n-68\n-69 void fill ( const Value &value = Value() ) { hostContainer_.fill( value ); }\n-70\n-71 void swap ( This &other ) { hostContainer_.swap( other.hostContainer_ ); }\n-72\n-73 ConstIterator begin () const { return hostContainer_.begin(); }\n-74 Iterator begin () { return hostContainer_.begin(); }\n-75\n-76 ConstIterator end () const { return hostContainer_.end(); }\n-77 Iterator end () { return hostContainer_.end(); }\n-78\n-79 int codimension () const { return hostContainer_.codimension(); }\n-80\n-81 protected:\n-82 PersistentContainer<_HostGrid,_T_> hostContainer_;\n-83 };\n-84\n-85} // namespace Dune\n-86\n-87#endif // #ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH\n-hostgridaccess.hh\n+62 static std::vector partition(const GridView& gv, const Dune::\n+MPIHelper& mpihelper) {\n+63 const unsigned numElements = gv.size(0);\n+64\n+65 std::vector part(numElements);\n+66\n+67 // Setup parameters for ParMETIS\n+68 idx_type wgtflag = 0; // we don't use weights\n+69 idx_type numflag = 0; // we are using C-style arrays\n+70 idx_type ncon = 1; // number of balance constraints\n+71 idx_type ncommonnodes = 2; // number of nodes elements must have in common\n+to be considered adjacent to each other\n+72 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed,\n+output and coupling\n+73 idx_type edgecut; // will store number of edges cut by partition\n+74 idx_type nparts = mpihelper.size(); // number of parts equals number of\n+processes\n+75 std::vector tpwgts(ncon*nparts, 1./nparts); // load per subdomain\n+and weight (same load on every process)\n+76 std::vector ubvec(ncon, 1.05); // weight tolerance (same weight\n+tolerance for every weight there is)\n+77\n+78 // The difference elmdist[i+1] - elmdist[i] is the number of nodes that are\n+on process i\n+79 std::vector elmdist(nparts+1);\n+80 elmdist[0] = 0;\n+81 std::fill(elmdist.begin()+1, elmdist.end(), gv.size(0)); // all elements are\n+on process zero\n+82\n+83 // Create and fill arrays \"eptr\", where eptr[i] is the number of vertices\n+that belong to the i-th element, and\n+84 // \"eind\" contains the vertex-numbers of the i-the element in eind[eptr[i]]\n+to eind[eptr[i+1]-1]\n+85 std::vector eptr, eind;\n+86 int numVertices = 0;\n+87 eptr.push_back(numVertices);\n+88\n+89 for (const auto& element : elements(gv, Partitions::interior)) {\n+90 const size_t curNumVertices = referenceElement\n+(element.type()).size(dimension);\n+91\n+92 numVertices += curNumVertices;\n+93 eptr.push_back(numVertices);\n+94\n+95 for (size_t k = 0; k < curNumVertices; ++k)\n+96 eind.push_back(gv.indexSet().subIndex(element, k, dimension));\n+97 }\n+98\n+99 // Partition mesh using ParMETIS\n+100 if (0 == mpihelper.rank()) {\n+101 MPI_Comm comm = Dune::MPIHelper::getLocalCommunicator();\n+102\n+103#if PARMETIS_MAJOR_VERSION >= 4\n+104 const int OK =\n+105#endif\n+106 ParMETIS_V3_PartMeshKway(elmdist.data(), eptr.data(), eind.data(), NULL,\n+&wgtflag, &numflag,\n+107 &ncon, &ncommonnodes, &nparts, tpwgts.data(), ubvec.data(),\n+108 options, &edgecut, reinterpret_cast(part.data()), &comm);\n+109\n+110#if PARMETIS_MAJOR_VERSION >= 4\n+111 if (OK != METIS_OK)\n+112 DUNE_THROW(Dune::Exception, \"ParMETIS returned an error code.\");\n+113#endif\n+114 }\n+115\n+116 return part;\n+117 }\n+118\n+130 static std::vector repartition(const GridView& gv, const Dune::\n+MPIHelper& mpihelper, real_type itr = 1000) {\n+131\n+132 // Create global index map\n+133 GlobalIndexSet globalIndex(gv,0);\n+134\n+135 int numElements = std::distance(gv.template begin<0, Interior_Partition>(),\n+136 gv.template end<0, Interior_Partition>());\n+137\n+138 std::vector interiorPart(numElements);\n+139\n+140 // Setup parameters for ParMETIS\n+141 idx_type wgtflag = 0; // we don't use weights\n+142 idx_type numflag = 0; // we are using C-style arrays\n+143 idx_type ncon = 1; // number of balance constraints\n+144 idx_type options[4] = {0, 0, 0, 0}; // use default values for random seed,\n+output and coupling\n+145 idx_type edgecut; // will store number of edges cut by partition\n+146 idx_type nparts = mpihelper.size(); // number of parts equals number of\n+processes\n+147 std::vector tpwgts(ncon*nparts, 1./nparts); // load per\n+subdomain and weight (same load on every process)\n+148 std::vector ubvec(ncon, 1.05); // weight tolerance (same weight\n+tolerance for every weight there is)\n+149\n+150 MPI_Comm comm = Dune::MPIHelper::getCommunicator();\n+151\n+152 // Make the number of interior elements of each processor available to all\n+processors\n+153 std::vector offset(gv.comm().size());\n+154 std::fill(offset.begin(), offset.end(), 0);\n+155\n+156 gv.comm().template allgather(&numElements, 1, offset.data());\n+157\n+158 // The difference vtxdist[i+1] - vtxdist[i] is the number of elements that\n+are on process i\n+159 std::vector vtxdist(gv.comm().size()+1);\n+160 vtxdist[0] = 0;\n+161\n+162 for (unsigned int i=1; i xadj, adjncy;\n+167 xadj.push_back(0);\n+168\n+169 for (const auto& element : elements(gv, Partitions::interior)) {\n+170 size_t numNeighbors = 0;\n+171\n+172 for (const auto& in : intersections(gv, element)) {\n+173 if (in.neighbor()) {\n+174 adjncy.push_back(globalIndex.index(in.outside()));\n+175\n+176 ++numNeighbors;\n+177 }\n+178 }\n+179\n+180 xadj.push_back(xadj.back() + numNeighbors);\n+181 }\n+182\n+183#if PARMETIS_MAJOR_VERSION >= 4\n+184 const int OK =\n+185#endif\n+186 ParMETIS_V3_AdaptiveRepart(vtxdist.data(), xadj.data(), adjncy.data(),\n+NULL, NULL, NULL,\n+187 &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), ubvec.data(),\n+188 &itr, options, &edgecut, reinterpret_cast(interiorPart.data()),\n+&comm);\n+189\n+190#if PARMETIS_MAJOR_VERSION >= 4\n+191 if (OK != METIS_OK)\n+192 DUNE_THROW(Dune::Exception, \"ParMETIS returned error code \" << OK);\n+193#endif\n+194\n+195 // At this point, interiorPart contains a target rank for each interior\n+element, and they are sorted\n+196 // by the order in which the grid view traverses them. Now we need to do\n+two things:\n+197 // a) Add additional dummy entries for the ghost elements\n+198 // b) Use the element index for the actual ordering. Since there may be\n+different types of elements,\n+199 // we cannot use the index set directly, but have to go through a Mapper.\n+200\n+201 typedef MultipleCodimMultipleGeomTypeMapper ElementMapper;\n+202 ElementMapper elementMapper(gv, mcmgElementLayout());\n+203\n+204 std::vector part(gv.size(0));\n+205 std::fill(part.begin(), part.end(), 0);\n+206 unsigned int c = 0;\n+207 for (const auto& element : elements(gv, Partitions::interior))\n+208 part[elementMapper.index(element)] = interiorPart[c++];\n+209\n+210 return part;\n+211 }\n+212 };\n+213\n+214} // namespace Dune\n+215\n+216#else // PARMETIS_MAJOR_VERSION\n+217#warning \"You seem to be using the ParMETIS emulation layer of scotch, which\n+does not work with this file.\"\n+218#endif\n+219\n+220#else // HAVE_PARMETIS\n+221#warning \"PARMETIS was not found, please check your configuration\"\n+222#endif\n+223\n+224#endif // DUNE_GRID_UTILITY_PARMETISGRIDPARTITIONER_HH\n+mcmgmapper.hh\n+Mapper for multiple codim and multiple geometry types.\n+rangegenerators.hh\n+globalindexset.hh\n+Provides a globally unique index for all entities of a distributed Dune grid.\n+Dune::mcmgElementLayout\n+MCMGLayout mcmgElementLayout()\n+layout for elements (codim-0 entities)\n+Definition mcmgmapper.hh:97\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::HostGridAccess\n-provides access to host grid objects from GeometryGrid\n-Definition identitygrid.hh:37\n-Dune::PersistentContainer<_HostGrid,_T_>\n-Dune::PersistentContainerMap::swap\n-void swap(This &other)\n-Definition persistentcontainermap.hh:97\n-Dune::PersistentContainerMap::fill\n-void fill(const Value &value)\n-Definition persistentcontainermap.hh:95\n-Dune::PersistentContainerMap::codimension\n-int codimension() const\n-Definition persistentcontainermap.hh:111\n-Dune::PersistentContainerMap::resize\n-void resize(const Value &value=Value())\n-Definition persistentcontainermap.hh:87\n-Dune::PersistentContainerMap::begin\n-ConstIterator begin() const\n-Definition persistentcontainermap.hh:175\n-Dune::PersistentContainerMap::end\n-ConstIterator end() const\n-Definition persistentcontainermap.hh:190\n-Dune::PersistentContainerMap::size\n-Size size() const\n-Definition persistentcontainermap.hh:85\n-Dune::PersistentContainerMap::shrinkToFit\n-void shrinkToFit()\n-Definition persistentcontainermap.hh:93\n-Dune::PersistentContainerWrapper\n-Definition persistentcontainerwrapper.hh:19\n-Dune::PersistentContainerWrapper::fill\n-void fill(const Value &value=Value())\n-Definition persistentcontainerwrapper.hh:69\n-Dune::PersistentContainerWrapper::ConstIterator\n-PersistentContainer< HostGrid, T >::ConstIterator ConstIterator\n-Definition persistentcontainerwrapper.hh:34\n-Dune::PersistentContainerWrapper::size\n-Size size() const\n-Definition persistentcontainerwrapper.hh:64\n-Dune::PersistentContainerWrapper::begin\n-ConstIterator begin() const\n-Definition persistentcontainerwrapper.hh:73\n-Dune::PersistentContainerWrapper::operator()\n-const Value & operator()(const Entity &entity, int subEntity) const\n-Definition persistentcontainerwrapper.hh:53\n-Dune::PersistentContainerWrapper::Grid\n-G Grid\n-Definition persistentcontainerwrapper.hh:28\n-Dune::PersistentContainerWrapper::operator[]\n-const Value & operator[](const Entity &entity) const\n-Definition persistentcontainerwrapper.hh:41\n-Dune::PersistentContainerWrapper::resize\n-void resize(const Value &value=Value())\n-Definition persistentcontainerwrapper.hh:66\n-Dune::PersistentContainerWrapper::Size\n-PersistentContainer< HostGrid, T >::Size Size\n-Definition persistentcontainerwrapper.hh:31\n-Dune::PersistentContainerWrapper::codimension\n-int codimension() const\n-Definition persistentcontainerwrapper.hh:79\n-Dune::PersistentContainerWrapper::Value\n-PersistentContainer< HostGrid, T >::Value Value\n-Definition persistentcontainerwrapper.hh:30\n-Dune::PersistentContainerWrapper::swap\n-void swap(This &other)\n-Definition persistentcontainerwrapper.hh:71\n-Dune::PersistentContainerWrapper::end\n-ConstIterator end() const\n-Definition persistentcontainerwrapper.hh:76\n-Dune::PersistentContainerWrapper::PersistentContainerWrapper\n-PersistentContainerWrapper(const Grid &grid, int codim, const Value\n-&value=Value())\n-Definition persistentcontainerwrapper.hh:36\n-Dune::PersistentContainerWrapper::Iterator\n-PersistentContainer< HostGrid, T >::Iterator Iterator\n-Definition persistentcontainerwrapper.hh:33\n-Dune::PersistentContainerWrapper::shrinkToFit\n-void shrinkToFit()\n-Definition persistentcontainerwrapper.hh:67\n-Dune::PersistentContainerWrapper::begin\n-Iterator begin()\n-Definition persistentcontainerwrapper.hh:74\n-Dune::PersistentContainerWrapper::hostContainer_\n-PersistentContainer< HostGrid, T > hostContainer_\n-Definition persistentcontainerwrapper.hh:82\n-Dune::PersistentContainerWrapper::end\n-Iterator end()\n-Definition persistentcontainerwrapper.hh:77\n-persistentcontainer.hh\n+Dune::Partitions::interior\n+constexpr Interior interior\n+PartitionSet for the interior partition.\n+Definition partitionset.hh:271\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01025.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01025.html", "unified_diff": "@@ -100,28 +100,28 @@\n #include <dune/common/parallel/communication.hh>
    \n #include <dune/common/parallel/mpihelper.hh>
    \n #include <dune/geometry/axisalignedcubegeometry.hh>
    \n #include <dune/geometry/type.hh>
    \n #include <dune/grid/common/indexidset.hh>
    \n #include <dune/grid/common/datahandleif.hh>
    \n #include <dune/common/parallel/mpicommunication.hh>
    \n-#include <dune/grid/yaspgrid/coordinates.hh>
    \n-#include <dune/grid/yaspgrid/torus.hh>
    \n+#include <dune/grid/yaspgrid/coordinates.hh>
    \n+#include <dune/grid/yaspgrid/torus.hh>
    \n #include <dune/grid/yaspgrid/ygrid.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridgeometry.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridentity.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridintersection.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridintersectioniterator.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridhierarchiciterator.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridentityseed.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridleveliterator.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridindexsets.hh>
    \n-#include <dune/grid/yaspgrid/yaspgrididset.hh>
    \n-#include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>
    \n-#include <dune/grid/yaspgrid/structuredyaspgridfactory.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridgeometry.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridentity.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridintersection.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridintersectioniterator.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridhierarchiciterator.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridentityseed.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridleveliterator.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridindexsets.hh>
    \n+#include <dune/grid/yaspgrid/yaspgrididset.hh>
    \n+#include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>
    \n+#include <dune/grid/yaspgrid/structuredyaspgridfactory.hh>
    \n #include <dune/grid/yaspgrid/backuprestore.hh>
    \n \n

    Go to the source code of this file.

    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01025_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01025_source.html", "unified_diff": "@@ -137,27 +137,27 @@\n
    61 template<class GridImp> class YaspHierarchicIterator;
    \n
    62 template<class GridImp, bool isLeafIndexSet> class YaspIndexSet;
    \n
    63 template<class GridImp> class YaspGlobalIdSet;
    \n
    64 template<class GridImp> class YaspPersistentContainerIndex;
    \n
    65
    \n
    66} // namespace Dune
    \n
    67
    \n-\n-\n+\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n
    81
    \n
    82namespace Dune {
    \n
    83
    \n
    84#if HAVE_MPI
    \n
    85 using YaspCommunication = Communication<MPI_Comm>;
    \n
    86#else
    \n
    87 using YaspCommunication = Communication<No_Comm>;
    \n@@ -2055,33 +2055,33 @@\n
    2061 };
    \n
    2062
    \n
    2063 }
    \n
    2064
    \n
    2065} // end namespace
    \n
    2066
    \n
    2067// Include the specialization of the StructuredGridFactory class for YaspGrid
    \n-\n+\n
    2069// Include the specialization of the BackupRestoreFacility class for YaspGrid
    \n \n
    2071
    \n
    2072#endif
    \n-
    The YaspIntersectionIterator class.
    \n-
    level-wise, non-persistent, consecutive indices for YaspGrid
    \n-
    The YaspLevelIterator class.
    \n-
    The YaspIntersection class.
    \n-
    The YaspEntitySeed class.
    \n-\n-
    The YaspGeometry class and its specializations.
    \n-
    the YaspEntity class and its specializations
    \n-
    Specialization of the PersistentContainer for YaspGrid.
    \n+
    level-wise, non-persistent, consecutive indices for YaspGrid
    \n+
    The YaspIntersection class.
    \n+
    the YaspEntity class and its specializations
    \n+
    The YaspIntersectionIterator class.
    \n+
    This provides container classes for the coordinates to be used in YaspGrid Upon implementation of the...
    \n+
    Specialization of the PersistentContainer for YaspGrid.
    \n+\n+\n+
    The YaspGeometry class and its specializations.
    \n+
    This file provides the infrastructure for toroidal communication in YaspGrid.
    \n
    This provides a YGrid, the elemental component of the yaspgrid implementation.
    \n-\n-
    Specialization of the StructuredGridFactory class for YaspGrid.
    \n-
    This provides container classes for the coordinates to be used in YaspGrid Upon implementation of the...
    \n-
    This file provides the infrastructure for toroidal communication in YaspGrid.
    \n+
    Specialization of the StructuredGridFactory class for YaspGrid.
    \n+
    The YaspEntitySeed class.
    \n+
    The YaspLevelIterator class.
    \n
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n
    std::ostream & operator<<(std::ostream &out, const PartitionType &type)
    write a PartitionType to a stream
    Definition gridenums.hh:72
    \n
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    @ All_Partition
    all entities
    Definition gridenums.hh:141
    \n
    @ Interior_Partition
    only interior entities
    Definition gridenums.hh:137
    \n
    @ InteriorBorder_Partition
    interior and border entities
    Definition gridenums.hh:138
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2084,41 +2084,41 @@\n YaspGrid\n 2068#include \n 2069// Include the specialization of the BackupRestoreFacility class for\n YaspGrid\n 2070#include \n 2071\n 2072#endif\n-yaspgridintersectioniterator.hh\n-The YaspIntersectionIterator class.\n yaspgridindexsets.hh\n level-wise, non-persistent, consecutive indices for YaspGrid\n-yaspgridleveliterator.hh\n-The YaspLevelIterator class.\n yaspgridintersection.hh\n The YaspIntersection class.\n-yaspgridentityseed.hh\n-The YaspEntitySeed class.\n-yaspgridhierarchiciterator.hh\n-yaspgridgeometry.hh\n-The YaspGeometry class and its specializations.\n yaspgridentity.hh\n the YaspEntity class and its specializations\n+yaspgridintersectioniterator.hh\n+The YaspIntersectionIterator class.\n+coordinates.hh\n+This provides container classes for the coordinates to be used in YaspGrid Upon\n+implementation of the...\n yaspgridpersistentcontainer.hh\n Specialization of the PersistentContainer for YaspGrid.\n+yaspgridhierarchiciterator.hh\n+yaspgrididset.hh\n+yaspgridgeometry.hh\n+The YaspGeometry class and its specializations.\n+torus.hh\n+This file provides the infrastructure for toroidal communication in YaspGrid.\n ygrid.hh\n This provides a YGrid, the elemental component of the yaspgrid implementation.\n-yaspgrididset.hh\n structuredyaspgridfactory.hh\n Specialization of the StructuredGridFactory class for YaspGrid.\n-coordinates.hh\n-This provides container classes for the coordinates to be used in YaspGrid Upon\n-implementation of the...\n-torus.hh\n-This file provides the infrastructure for toroidal communication in YaspGrid.\n+yaspgridentityseed.hh\n+The YaspEntitySeed class.\n+yaspgridleveliterator.hh\n+The YaspLevelIterator class.\n datahandleif.hh\n Describes the parallel communication interface class for MessageBuffers and\n DataHandles.\n Dune::operator<<\n std::ostream & operator<<(std::ostream &out, const PartitionType &type)\n write a PartitionType to a stream\n Definition gridenums.hh:72\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01030.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01030.html", "unified_diff": "@@ -71,15 +71,15 @@\n
    \n
    Bug List
    \n
    \n
    \n
    \n
    Member Dune::UGGrid< dim >::loadBalance (int minlevel=0)
    \n
    The return value is always 'true'
    \n-
    File globalindexset.hh
    \n+
    File globalindexset.hh
    \n
    This code will most likely not work on grids with more than one element type. Please ask on the mailing list if you need this feature.
    \n
    \n
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01034.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01034.html", "unified_diff": "@@ -171,16 +171,16 @@\n
    \n \n \n

    \n Classes

    struct  Dune::YaspGridFamily< dim, Coordinates >
    enum Dune::CommunicationDirection
    \n
    \n \n

    Define a type for communication direction parameter.

    \n-
    \n-\n+ \n \n \n
    Enumerator
    ForwardCommunication 

    communicate as given in InterfaceType

    \n
    BackwardCommunication 

    reverse communication direction

    \n
    \n \n@@ -195,15 +195,15 @@\n \n enum Dune::InterfaceType\n \n \n
    \n \n

    Parameter to be used for the communication functions.

    \n-
    \n+ \n \n \n \n@@ -224,15 +224,15 @@\n \n \n \n
    Enumerator
    InteriorBorder_InteriorBorder_Interface 

    send/receive interior and border entities

    \n
    InteriorBorder_All_Interface 

    send interior and border, receive all entities

    \n
    Overlap_OverlapFront_Interface 

    send overlap, receive overlap and front entities

    \n
    enum Dune::PartitionIteratorType
    \n
    \n \n

    Parameter to be used for the parallel level- and leaf iterators.

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

    only interior entities

    \n
    InteriorBorder_Partition 

    interior and border entities

    \n
    Overlap_Partition 

    interior, border, and overlap entities

    \n
    enum Dune::PartitionType
    \n
    \n \n

    Attributes used in the generic overlap model.

    \n-
    \n+

    The values are ordered intentionally in order to be able to define ranges of partition types.

    \n \n \n \n \n \n
    Enumerator
    InteriorEntity 

    all interior entities

    \n
    BorderEntity 

    on boundary between interior and overlap

    \n
    OverlapEntity 

    all entities lying in the overlap zone

    \n@@ -308,15 +308,15 @@\n
    \n inline
    \n
    \n \n

    write an InterfaceType to a stream

    \n-\n
    \n \n

    ◆ operator<<() [2/3]

    \n \n
    \n@@ -347,15 +347,15 @@\n \n inline \n \n \n
    \n \n

    write a PartitionIteratorType to a stream

    \n-\n
    \n \n

    ◆ operator<<() [3/3]

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

    write a PartitionType to a stream

    \n-\n
    \n \n

    ◆ PartitionName()

    \n \n
    \n@@ -415,15 +415,15 @@\n \n inline \n \n \n
    \n \n

    Provide names for the partition types.

    \n-\n
    \n \n

    ◆ partitionSet()

    \n \n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01058.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01058.html", "unified_diff": "@@ -84,19 +84,19 @@\n \"\"\n \"\"\n \n
    \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n

    \n Files

    file  boundaryiterators.hh
     Functions for VTK output on the skeleton.
    file  boundaryiterators.hh
     Functions for VTK output on the skeleton.
     
    file  skeletonfunction.hh
     Functions for VTK output on the skeleton.
    file  skeletonfunction.hh
     Functions for VTK output on the skeleton.
     
    \n \n \n \n

    \n Namespaces

    namespace  Dune::VTK
     
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01081.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01081.html", "unified_diff": "@@ -261,16 +261,16 @@\n \n \n \n
    enum Dune::VTK::DataMode
    \n
    \n \n

    Whether to produce conforming or non-conforming output.

    \n-
    \n-
    Common stuff for the VTKWriter.
    \n+
    \n+
    Common stuff for the VTKWriter.
    \n

    This applies to the conformity of the data; a non-conforming grid can still be written in conforming data mode, and it is quite possible for data to be non-conforming on a conforming grid.

    \n \n \n \n \n \n
    Enumerator
    conforming 

    Output conforming data.

    \n

    Neighboring elements share common vertices and thus have a common DoF on that vertex.

    \n
    nonconforming 

    Output non-conforming data.

    \n

    Each element has its own set of vertices. The position of a vertex of one element will coincide with the position of the corresponding vertex on another element. This allows for multiple DoFs (one per element) on the \"same\" vertex.

    \n@@ -288,15 +288,15 @@\n
    enum Dune::VTK::FileType
    \n
    \n \n

    which type of VTK file to write

    \n-
    \n+ \n \n \n
    Enumerator
    polyData 

    for .vtp files (PolyData)

    \n
    unstructuredGrid 

    for .vtu files (UnstructuredGrid)

    \n
    \n \n@@ -311,15 +311,15 @@\n \n enum Dune::VTK::GeometryType\n \n \n
    \n \n

    Type representing VTK's entity geometry types.

    \n-
    \n+

    Only the types which have a corresponding Dune::GeometryType have been included here. Dune-type names have been used, this mainly makes a difference for vtkPrism, which is known by VTK as VTK_WEDGE.

    \n \n \n \n \n \n \n@@ -341,15 +341,15 @@\n \n \n \n
    Enumerator
    vertex 
    line 
    triangle 
    polygon 
    quadrilateral 
    enum Dune::VTK::OutputType
    \n
    \n \n

    How the bulk data should be stored in the file.

    \n-
    \n+ \n \n \n \n@@ -376,15 +376,15 @@\n \n \n
    Enumerator
    ascii 

    Output to the file is in ascii.

    \n
    base64 

    Output to the file is inline base64 binary.

    \n
    appendedraw 

    Output is to the file is appended raw binary.

    \n
    \n strong
    \n
    \n \n

    which precision to use when writing out data to vtk files

    \n-
    \n+ \n \n \n \n \n \n
    Enumerator
    int32 
    uint8 
    uint32 
    float32 
    float64 
    \n@@ -413,15 +413,15 @@\n \n inline \n \n \n
    \n \n

    mapping from GeometryType to VTKGeometryType

    \n-\n
    \n \n

    ◆ getEndiannessString()

    \n \n
    \n@@ -480,15 +480,15 @@\n \n inline \n \n \n
    \n \n

    renumber VTK <-> Dune

    \n-
    \n+

    Since the renumbering never does anything more complex than exchanging two indices, this method works both ways.

    \n \n
    \n
    \n \n

    ◆ renumber() [2/2]

    \n \n@@ -514,15 +514,15 @@\n )\n \n \n \n
    \n \n

    renumber VTK <-> Dune

    \n-
    \n+

    This function is just a convenience shortcut function wrapping renumber(const GeometryType&, int).

    \n
    Parameters
    \n \n \n \n
    tEntity, Intersection or Geometry to do the renumbering in. Basically, anything with a method type() returning a GeometryType should work here.
    iIndex to of corner in either Dune or VTK numbering (the result will be in the other numbering)
    \n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01900.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01900.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members
    \n
    Dune::DGFGridFactory< G > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgridfactory.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgridfactory.hh>

    \n
    \n Inheritance diagram for Dune::DGFGridFactory< G >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -489,16 +489,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following files:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01904.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01904.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::AlbertaGrid< dim, dimworld > Class Template Reference
    \n
    \n
    \n \n

    [ provides Dune::Grid ] \n More...

    \n \n-

    #include <dune/grid/albertagrid/agrid.hh>

    \n+

    #include <dune/grid/albertagrid/agrid.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGrid< dim, dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -3103,16 +3103,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01916.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01916.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members
    \n
    Dune::AlbertaReader< Grid > Class Template Reference
    \n
    \n
    \n \n-

    #include <dune/grid/albertagrid/albertareader.hh>

    \n+

    #include <dune/grid/albertagrid/albertareader.hh>

    \n \n \n \n \n \n \n@@ -251,15 +251,15 @@\n \n

    \n Public Types

    typedef Dune::GridFactory< GridGridFactory
     
    typedef Grid::ctype ctype
     
    \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01956.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01956.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::CoordCache< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/coordcache.hh>

    \n+

    #include <dune/grid/albertagrid/coordcache.hh>

    \n \n \n \n \n \n \n@@ -320,15 +320,15 @@\n \n

    \n Classes

    struct  Interpolation
     
    class  LocalCaching
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01960.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01960.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::CoordCache< dim >::LocalCaching Class Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/coordcache.hh>

    \n+

    #include <dune/grid/albertagrid/coordcache.hh>

    \n \n \n \n \n \n \n@@ -144,15 +144,15 @@\n \n

    \n Public Member Functions

     LocalCaching (const CoordVectorPointer &coords)
     
    void operator() (const ElementInfo &elementInfo) const
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01964.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01964.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::CoordCache< dim >::Interpolation Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/coordcache.hh>

    \n+

    #include <dune/grid/albertagrid/coordcache.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Alberta::Patch< dimensionPatch
     
    \n \n

    \n@@ -177,15 +177,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01984.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01984.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Public Member Functions |\n List of all members \n
    Dune::Alberta::MeshPointer< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/meshpointer.hh>

    \n+

    #include <dune/grid/albertagrid/meshpointer.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::MeshPointer< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -778,16 +778,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01988.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01988.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::DofAccess< dim, codim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofadmin.hh>

    \n+

    #include <dune/grid/albertagrid/dofadmin.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::DofAccess< dim, codim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -435,15 +435,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a01992.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a01992.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::HierarchyDofNumbering< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofadmin.hh>

    \n+

    #include <dune/grid/albertagrid/dofadmin.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::HierarchyDofNumbering< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -523,15 +523,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02004.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02004.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::Alberta::DofVectorProvider< Dof > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02008.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02008.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::DofVectorProvider< int > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofvector.hh>

    \n+

    #include <dune/grid/albertagrid/dofvector.hh>

    \n \n \n \n \n

    \n Public Types

    typedef ALBERTA DOF_INT_VEC DofVector
     
    \n \n

    \n@@ -252,15 +252,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02012.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02012.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::DofVectorProvider< signed char > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofvector.hh>

    \n+

    #include <dune/grid/albertagrid/dofvector.hh>

    \n \n \n \n \n

    \n Public Types

    typedef ALBERTA DOF_SCHAR_VEC DofVector
     
    \n \n

    \n@@ -252,15 +252,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02016.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02016.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::DofVectorProvider< unsigned char > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofvector.hh>

    \n+

    #include <dune/grid/albertagrid/dofvector.hh>

    \n \n \n \n \n

    \n Public Types

    typedef ALBERTA DOF_UCHAR_VEC DofVector
     
    \n \n

    \n@@ -252,15 +252,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02020.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02020.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::DofVectorProvider< Real > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofvector.hh>

    \n+

    #include <dune/grid/albertagrid/dofvector.hh>

    \n \n \n \n \n

    \n Public Types

    typedef ALBERTA DOF_REAL_VEC DofVector
     
    \n \n

    \n@@ -252,15 +252,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02024.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02024.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::DofVectorProvider< GlobalVector > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofvector.hh>

    \n+

    #include <dune/grid/albertagrid/dofvector.hh>

    \n \n \n \n \n

    \n Public Types

    typedef ALBERTA DOF_REAL_D_VEC DofVector
     
    \n \n

    \n@@ -252,15 +252,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02028.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02028.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::DofVectorPointer< Dof > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/dofvector.hh>

    \n+

    #include <dune/grid/albertagrid/dofvector.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::DofVectorPointer< Dof >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -730,15 +730,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02032.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02032.html", "unified_diff": "@@ -80,15 +80,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::ElementInfo< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n+

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::ElementInfo< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1698,15 +1698,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02040.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02040.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::Alberta::ElementInfo< dim >::Instance Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n+

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n \n \n \n \n

    \n Public Member Functions

    InstancePtrparent ()
     
    \n \n

    \n@@ -171,15 +171,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02044.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02044.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ElementInfo< dim >::Stack Class Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n+

    #include <dune/grid/albertagrid/elementinfo.hh>

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

    \n Public Member Functions

     Stack ()
     
     ~Stack ()
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02048.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02048.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ElementInfo< dim >::Seed Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n+

    #include <dune/grid/albertagrid/elementinfo.hh>

    \n \n \n \n \n \n \n@@ -455,15 +455,15 @@\n \n

    \n Public Member Functions

     Seed ()
     
     Seed (const int macroIndex, const int level, const unsigned long path)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02052.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02052.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::AlbertaGridTreeIterator< codim, GridImp, leafIterator > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/treeiterator.hh>

    \n+

    #include <dune/grid/albertagrid/treeiterator.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGridTreeIterator< codim, GridImp, leafIterator >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -674,15 +674,15 @@\n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02056.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02056.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::AlbertaGridHierarchicIterator< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/hierarchiciterator.hh>

    \n+

    #include <dune/grid/albertagrid/hierarchiciterator.hh>

    \n \n \n \n \n \n \n@@ -541,15 +541,15 @@\n \n

    assignment operator

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02060.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02060.html", "unified_diff": "@@ -1491,15 +1491,15 @@\n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02068.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02068.html", "unified_diff": "@@ -867,15 +867,15 @@\n

    \n Public Types

    typedef GridImp::template Codim< 0 >::Entity Entity
     
    typedef GridImp::ctype ctype
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02076.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02076.html", "unified_diff": "@@ -1478,15 +1478,15 @@\n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02096.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02096.html", "unified_diff": "@@ -273,15 +273,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02100.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02100.html", "unified_diff": "@@ -273,15 +273,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02108.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02108.html", "unified_diff": "@@ -1036,15 +1036,15 @@\n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02120.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02120.html", "unified_diff": "@@ -427,15 +427,15 @@\n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02128.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02128.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::Alberta::GeometryCache< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/geometrycache.hh>

    \n+

    #include <dune/grid/albertagrid/geometrycache.hh>

    \n \n \n \n \n \n \n@@ -244,15 +244,15 @@\n \n

    \n Public Types

    typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed
     
    typedef FieldMatrix< Real, dim, dimWorldJacobianTransposed
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02132.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02132.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::Alberta::GeometryCacheProxy< dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/geometrycache.hh>

    \n+

    #include <dune/grid/albertagrid/geometrycache.hh>

    \n \n \n \n \n \n \n@@ -252,15 +252,15 @@\n \n

    \n Public Types

    typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed
     
    typedef FieldMatrix< Real, dim, dimWorldJacobianTransposed
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02136.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02136.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeometryReference< Implementation > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/geometryreference.hh>

    \n+

    #include <dune/grid/albertagrid/geometryreference.hh>

    \n
    \n Inheritance diagram for Dune::GeometryReference< Implementation >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -728,15 +728,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02140.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02140.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::LocalGeometryReference< mydim, cdim, Grid > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/geometryreference.hh>

    \n+

    #include <dune/grid/albertagrid/geometryreference.hh>

    \n
    \n Inheritance diagram for Dune::LocalGeometryReference< mydim, cdim, Grid >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -738,15 +738,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02160.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02160.html", "unified_diff": "@@ -886,15 +886,15 @@\n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02172.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02172.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::AlbertaGridLeafIterator< codim, pitype, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/leafiterator.hh>

    \n+

    #include <dune/grid/albertagrid/leafiterator.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGridLeafIterator< codim, pitype, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -613,15 +613,15 @@\n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02176.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02176.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::AlbertaGridLevelIterator< codim, pitype, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/leveliterator.hh>

    \n+

    #include <dune/grid/albertagrid/leveliterator.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGridLevelIterator< codim, pitype, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -613,15 +613,15 @@\n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02256.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02256.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Public Member Functions |\n List of all members \n
    Dune::IndexStack< T, length > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/indexstack.hh>

    \n+

    #include <dune/grid/albertagrid/indexstack.hh>

    \n \n \n \n \n \n \n@@ -439,15 +439,15 @@\n
    \n \n

    test stack functionality

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

    \n Public Member Functions

     IndexStack ()
     Constructor, create new IndexStack.
     
     ~IndexStack ()
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02268.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02268.html", "unified_diff": "@@ -450,15 +450,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02272.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02272.html", "unified_diff": "@@ -1018,15 +1018,15 @@\n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02284.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02284.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::AlbertaGridLeafIterator< codim, Ghost_Partition, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/leafiterator.hh>

    \n+

    #include <dune/grid/albertagrid/leafiterator.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGridLeafIterator< codim, Ghost_Partition, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -612,15 +612,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02288.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02288.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::AlbertaGridLevelProvider< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/level.hh>

    \n+

    #include <dune/grid/albertagrid/level.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGridLevelProvider< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -428,15 +428,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02296.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02296.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::AlbertaGridLevelProvider< dim >::SetLocal Class Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/level.hh>

    \n+

    #include <dune/grid/albertagrid/level.hh>

    \n \n \n \n \n \n \n@@ -144,15 +144,15 @@\n \n

    \n Public Member Functions

     SetLocal (const DofVectorPointer &level)
     
    void operator() (const Alberta::ElementInfo< dim > &elementInfo) const
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02300.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02300.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::AlbertaGridLevelProvider< dim >::CalcMaxLevel Class Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/level.hh>

    \n+

    #include <dune/grid/albertagrid/level.hh>

    \n \n \n \n \n \n \n@@ -202,15 +202,15 @@\n \n

    \n Public Member Functions

     CalcMaxLevel ()
     
    void operator() (const Level &dof)
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02304.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02304.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::AlbertaGridLevelProvider< dim >::Interpolation Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/level.hh>

    \n+

    #include <dune/grid/albertagrid/level.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Alberta::Patch< dimensionPatch
     
    \n \n

    \n@@ -177,15 +177,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02308.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02308.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/leveliterator.hh>

    \n+

    #include <dune/grid/albertagrid/leveliterator.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -612,15 +612,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02312.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02312.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::MacroData< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/macrodata.hh>

    \n+

    #include <dune/grid/albertagrid/macrodata.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::MacroData< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -904,15 +904,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02316.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02316.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::MacroData< dim >::Library< int > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/macrodata.hh>

    \n+

    #include <dune/grid/albertagrid/macrodata.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Alberta::MacroData< dim > MacroData
     
    \n \n

    \n@@ -308,16 +308,16 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02320.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02320.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::MacroElement< dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/macroelement.hh>

    \n+

    #include <dune/grid/albertagrid/macroelement.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::MacroElement< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -205,15 +205,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02328.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02328.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::Alberta::MeshPointer< dim >::MacroIterator Class Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/meshpointer.hh>

    \n+

    #include <dune/grid/albertagrid/meshpointer.hh>

    \n \n \n \n \n \n \n@@ -448,15 +448,15 @@\n \n

    \n Public Types

    typedef Alberta::MeshPointer< dim > MeshPointer
     
    typedef Alberta::ElementInfo< dim > ElementInfo
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02332.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02332.html", "unified_diff": "@@ -73,27 +73,27 @@\n \n \n
    \n
    Dune::AlbertaError Class Reference
    \n
    \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaError:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02336.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02336.html", "unified_diff": "@@ -73,27 +73,27 @@\n \n \n
    \n
    Dune::AlbertaIOError Class Reference
    \n
    \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaIOError:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02340.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02340.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::Alberta::GlobalSpace Class Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n \n \n@@ -174,15 +174,15 @@\n \n

    \n Public Types

    typedef GlobalMatrix Matrix
     
    typedef GlobalVector Vector
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02344.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02344.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::Alberta::NumSubEntities< dim, codim > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02348.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02348.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::NumSubEntities< dim, 0 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 1
     
    \n

    Member Data Documentation

    \n@@ -109,15 +109,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02352.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02352.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::NumSubEntities< dim, dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = dim+1
     
    \n

    Member Data Documentation

    \n@@ -109,15 +109,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02356.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02356.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::NumSubEntities< 0, 0 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 1
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02360.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02360.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::NumSubEntities< 2, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 3
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02364.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02364.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::NumSubEntities< 3, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 4
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02368.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02368.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::NumSubEntities< 3, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 6
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02372.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02372.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::Alberta::CodimType< dim, codim > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02376.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02376.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::CodimType< dim, 0 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = CENTER
     
    \n

    Member Data Documentation

    \n@@ -109,15 +109,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02380.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02380.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::CodimType< dim, dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = VERTEX
     
    \n

    Member Data Documentation

    \n@@ -109,15 +109,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02384.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02384.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::CodimType< 2, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = EDGE
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02388.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02388.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::CodimType< 3, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = FACE
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02392.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02392.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::CodimType< 3, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = EDGE
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02396.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02396.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::FillFlags< dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Public Types

    typedef ALBERTA FLAGS Flags
     
    \n \n

    \n@@ -401,15 +401,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02400.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02400.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::RefinementEdge< dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 0
     
    \n

    Member Data Documentation

    \n@@ -109,15 +109,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02404.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02404.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::RefinementEdge< 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const int value = 2
     
    \n

    Member Data Documentation

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02408.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02408.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::Dune2AlbertaNumbering< dim, codim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (const int i)
     
    \n

    Member Function Documentation

    \n@@ -113,15 +113,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02412.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02412.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Dune2AlbertaNumbering< 3, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (const int i)
     
    \n \n

    \n@@ -140,15 +140,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02416.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02416.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::Generic2AlbertaNumbering< dim, codim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (const int i)
     
    \n

    Member Function Documentation

    \n@@ -113,15 +113,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02420.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02420.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::Generic2AlbertaNumbering< dim, 1 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (const int i)
     
    \n

    Member Function Documentation

    \n@@ -113,15 +113,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02424.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02424.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::Generic2AlbertaNumbering< 1, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (const int i)
     
    \n

    Member Function Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02428.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02428.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Generic2AlbertaNumbering< 3, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (const int i)
     
    \n \n

    \n@@ -140,15 +140,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02432.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02432.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Public Member Functions |\n List of all members \n
    Dune::Alberta::NumberingMap< dim, Numbering > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n
    \n Inheritance diagram for Dune::Alberta::NumberingMap< dim, Numbering >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -267,15 +267,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02440.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02440.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::Alberta::MapVertices< dim, codim > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02444.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02444.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::MapVertices< dim, 0 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (int subEntity, int vertex)
     
    \n

    Member Function Documentation

    \n@@ -123,15 +123,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02448.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02448.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::MapVertices< 2, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (int subEntity, int vertex)
     
    \n

    Member Function Documentation

    \n@@ -121,15 +121,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02452.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02452.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::MapVertices< 3, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (int subEntity, int vertex)
     
    \n

    Member Function Documentation

    \n@@ -121,15 +121,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02456.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02456.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::MapVertices< 3, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (int subEntity, int vertex)
     
    \n

    Member Function Documentation

    \n@@ -121,15 +121,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02460.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02460.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::MapVertices< dim, dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int apply (int subEntity, int vertex)
     
    \n

    Member Function Documentation

    \n@@ -123,15 +123,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02464.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02464.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Twist< dim, subdim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int twist (const Element *element, int subEntity)
     
    \n \n

    \n@@ -206,15 +206,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02468.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02468.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Twist< dim, 1 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int twist (const Element *element, int subEntity)
     
    \n \n

    \n@@ -206,15 +206,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02472.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02472.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Twist< 1, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int twist (const Element *element, int subEntity)
     
    \n \n

    \n@@ -174,15 +174,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02476.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02476.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Twist< dim, 2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int twist (const Element *element, int subEntity)
     
    \n \n

    \n@@ -206,15 +206,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02480.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02480.html", "unified_diff": "@@ -77,15 +77,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Twist< 2, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/misc.hh>

    \n+

    #include <dune/grid/albertagrid/misc.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static int twist (const Element *element, int subEntity)
     
    \n \n

    \n@@ -174,15 +174,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02512.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02512.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::Alberta::ForEachInteriorSubChild< dim, codim > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02516.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02516.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::Patch< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

    \n \n \n \n \n \n \n@@ -512,15 +512,15 @@\n \n

    \n Public Types

    typedef Alberta::ElementInfo< dimensionElementInfo
     
    typedef ALBERTA RC_LIST_EL ElementList
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02520.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02520.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ForEachInteriorSubChild< dim, 0 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

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

    \n Static Public Member Functions

    template<class Functor >
    static void apply (Functor &functor, const Patch< dim > &patch)
     
    \n@@ -126,15 +126,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02524.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02524.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ForEachInteriorSubChild< dim, dim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

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

    \n Static Public Member Functions

    template<class Functor >
    static void apply (Functor &functor, const Patch< dim > &patch)
     
    \n@@ -126,15 +126,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02528.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02528.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ForEachInteriorSubChild< 2, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

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

    \n Static Public Member Functions

    template<class Functor >
    static void apply (Functor &functor, const Patch< 2 > &patch)
     
    \n@@ -124,15 +124,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02532.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02532.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ForEachInteriorSubChild< 3, 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

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

    \n Static Public Member Functions

    template<class Functor >
    static void apply (Functor &functor, const Patch< 3 > &patch)
     
    \n@@ -124,15 +124,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02536.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02536.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Alberta::ForEachInteriorSubChild< 3, 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

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

    \n Static Public Member Functions

    template<class Functor >
    static void apply (Functor &functor, const Patch< 3 > &patch)
     
    \n@@ -124,15 +124,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02540.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02540.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::Alberta::GeometryInFather< dim > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02544.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02544.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::GeometryInFather< 1 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Real LocalVector[dim]
     
    \n \n

    \n@@ -177,15 +177,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02548.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02548.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::GeometryInFather< 2 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Real LocalVector[dim]
     
    \n \n

    \n@@ -177,15 +177,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02552.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02552.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::Alberta::GeometryInFather< 3 > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/refinement.hh>

    \n+

    #include <dune/grid/albertagrid/refinement.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Real LocalVector[dim]
     
    \n \n

    \n@@ -177,15 +177,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02568.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02568.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::AlbertaMarkerVector< dim, dimworld > Class Template Reference
    \n \n
    \n \n

    marker assigning subentities to one element containing them \n More...

    \n \n-

    #include <dune/grid/albertagrid/treeiterator.hh>

    \n+

    #include <dune/grid/albertagrid/treeiterator.hh>

    \n
    \n Inheritance diagram for Dune::AlbertaMarkerVector< dim, dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -377,15 +377,15 @@\n
    \n \n

    return true if marking is up to date

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02580.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02580.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::AlbertaMarkerVector< dim, dimworld >::MarkSubEntities< bool >::Codim< codim > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/albertagrid/treeiterator.hh>

    \n+

    #include <dune/grid/albertagrid/treeiterator.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Alberta::ElementInfo< dimension > ElementInfo
     
    \n \n

    \n@@ -195,15 +195,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02584.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02584.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::AdaptDataHandle< Grid, Impl > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/adaptcallback.hh>

    \n+

    #include <dune/grid/common/adaptcallback.hh>

    \n
    \n Inheritance diagram for Dune::AdaptDataHandle< Grid, Impl >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -300,15 +300,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02588.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02588.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::AdaptDataHandleInterface< Grid, Impl > Class Template Reference
    \n \n
    \n \n

    Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface. \n More...

    \n \n-

    #include <dune/grid/common/adaptcallback.hh>

    \n+

    #include <dune/grid/common/adaptcallback.hh>

    \n
    \n Inheritance diagram for Dune::AdaptDataHandleInterface< Grid, Impl >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -354,15 +354,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02592.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02592.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::CombinedAdaptProlongRestrict< A, B > Class Template Reference
    \n \n
    \n \n

    class for combining 2 index sets together for adaptation process \n More...

    \n \n-

    #include <dune/grid/common/adaptcallback.hh>

    \n+

    #include <dune/grid/common/adaptcallback.hh>

    \n \n \n \n \n \n \n@@ -237,15 +237,15 @@\n
    \n \n

    restrict data to father

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02604.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02604.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::DuneBoundaryProjection< dimworld > Struct Template Referenceabstract
    \n \n
    \n \n

    Interface class for vertex projection at the boundary. \n More...

    \n \n-

    #include <dune/grid/common/boundaryprojection.hh>

    \n+

    #include <dune/grid/common/boundaryprojection.hh>

    \n
    \n Inheritance diagram for Dune::DuneBoundaryProjection< dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -559,15 +559,15 @@\n \n

    \n Public Member Functions

     CombinedAdaptProlongRestrict (A &a, B &b)
     constructor storing the two references
     
    template<class Entity >
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02608.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02608.html", "unified_diff": "@@ -81,15 +81,15 @@\n Static Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::BoundaryProjectionWrapper< dimworld > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/boundaryprojection.hh>

    \n+

    #include <dune/grid/common/boundaryprojection.hh>

    \n
    \n Inheritance diagram for Dune::BoundaryProjectionWrapper< dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -634,15 +634,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02612.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02612.html", "unified_diff": "@@ -81,15 +81,15 @@\n Protected Member Functions |\n Static Protected Member Functions |\n List of all members \n
    Dune::BoundarySegmentWrapper< dim, dimworld > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/boundaryprojection.hh>

    \n+

    #include <dune/grid/common/boundaryprojection.hh>

    \n
    \n Inheritance diagram for Dune::BoundarySegmentWrapper< dim, dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -665,15 +665,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02616.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02616.html", "unified_diff": "@@ -81,15 +81,15 @@\n Static Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::CircleBoundaryProjection< dimworld > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/boundaryprojection.hh>

    \n+

    #include <dune/grid/common/boundaryprojection.hh>

    \n
    \n Inheritance diagram for Dune::CircleBoundaryProjection< dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -640,15 +640,15 @@\n
    \n \n

    radius of circ

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02620.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02620.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::BoundarySegment< dim, dimworld, ctype > Struct Template Referenceabstract
    \n \n
    \n \n

    Base class for classes implementing geometries of boundary segments. \n More...

    \n \n-

    #include <dune/grid/common/boundarysegment.hh>

    \n+

    #include <dune/grid/common/boundarysegment.hh>

    \n
    \n Inheritance diagram for Dune::BoundarySegment< dim, dimworld, ctype >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -404,15 +404,15 @@\n \n \n
    Returns
    Object derived from BoundarySegment.
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02624.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02624.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Types |\n Static Protected Member Functions |\n List of all members \n
    Dune::BoundarySegmentBackupRestore< BndSeg > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/boundarysegment.hh>

    \n+

    #include <dune/grid/common/boundarysegment.hh>

    \n
    \n Inheritance diagram for Dune::BoundarySegmentBackupRestore< BndSeg >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -265,15 +265,15 @@\n \n \n
    Returns
    Object derived from BoundarySegment.
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02720.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02720.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::DefaultLevelGridView< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

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

    \n Classes

    struct  Codim
     Codim Structure. More...
     
    \n@@ -810,15 +810,15 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02724.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02724.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::DefaultLeafGridView< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

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

    \n Classes

    struct  Codim
     Codim Structure. More...
     
    \n@@ -800,15 +800,15 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02728.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02728.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Types |\n Static Public Attributes |\n List of all members \n
    Dune::DefaultLevelGridViewTraits< GridImp > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

    \n \n \n \n \n

    \n Classes

    struct  Codim
     
    \n \n

    \n@@ -243,15 +243,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02732.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02732.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Public Types |\n List of all members \n
    Dune::DefaultLevelGridViewTraits< GridImp >::Codim< cd > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

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

    \n Classes

    struct  Partition
     Define types needed to iterate over entities of a given partition type. More...
     
    \n@@ -170,15 +170,15 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02736.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02736.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::DefaultLevelGridViewTraits< GridImp >::Codim< cd >::Partition< pit > Struct Template Reference
    \n \n
    \n \n

    Define types needed to iterate over entities of a given partition type. \n More...

    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

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

    \n Public Types

    typedef Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
     iterator over a given codim and partition type
     
    \n@@ -116,15 +116,15 @@\n
    \n \n

    iterator over a given codim and partition type

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02740.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02740.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::DefaultLevelGridView< GridImp >::Codim< cd > Struct Template Reference
    \n \n
    \n \n

    Codim Structure. \n More...

    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

    \n
    \n Inheritance diagram for Dune::DefaultLevelGridView< GridImp >::Codim< cd >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -92,15 +92,15 @@\n \n
    \n

    Detailed Description

    \n
    template<class GridImp>
    \n template<int cd>
    \n struct Dune::DefaultLevelGridView< GridImp >::Codim< cd >

    Codim Structure.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02744.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02744.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Types |\n Static Public Attributes |\n List of all members \n
    Dune::DefaultLeafGridViewTraits< GridImp > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

    \n \n \n \n \n

    \n Classes

    struct  Codim
     
    \n \n

    \n@@ -243,15 +243,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02748.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02748.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Public Types |\n List of all members \n
    Dune::DefaultLeafGridViewTraits< GridImp >::Codim< cd > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

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

    \n Classes

    struct  Partition
     Define types needed to iterate over entities of a given partition type. More...
     
    \n@@ -170,15 +170,15 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02752.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02752.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::DefaultLeafGridViewTraits< GridImp >::Codim< cd >::Partition< pit > Struct Template Reference
    \n \n
    \n \n

    Define types needed to iterate over entities of a given partition type. \n More...

    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

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

    \n Public Types

    typedef Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
     iterator over a given codim and partition type
     
    \n@@ -116,15 +116,15 @@\n
    \n \n

    iterator over a given codim and partition type

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02756.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02756.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::DefaultLeafGridView< GridImp >::Codim< cd > Struct Template Reference
    \n \n
    \n \n

    Codim Structure. \n More...

    \n \n-

    #include <dune/grid/common/defaultgridview.hh>

    \n+

    #include <dune/grid/common/defaultgridview.hh>

    \n
    \n Inheritance diagram for Dune::DefaultLeafGridView< GridImp >::Codim< cd >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -92,15 +92,15 @@\n \n
    \n

    Detailed Description

    \n
    template<class GridImp>
    \n template<int cd>
    \n struct Dune::DefaultLeafGridView< GridImp >::Codim< cd >

    Codim Structure.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02760.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02760.html", "unified_diff": "@@ -945,15 +945,15 @@\n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02792.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02792.html", "unified_diff": "@@ -76,29 +76,29 @@\n
    Dune::GridError Class Reference
    \n \n
    \n \n

    Base class for exceptions in Dune grid modules. \n More...

    \n \n-

    #include <dune/grid/common/exceptions.hh>

    \n+

    #include <dune/grid/common/exceptions.hh>

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

    Detailed Description

    \n

    Base class for exceptions in Dune grid modules.

    \n

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

    Detailed Description

    \n
    template<class ViewTraits>
    \n class Dune::GridView< ViewTraits >

    Grid view abstract base class.

    \n

    Interface class for a view on grids. Grids return two types of view, a view of the leaf grid and of a level grid, which both satisfy the same interface. Through the view the user has access to the iterators, the intersections and the index set.

    \n

    The interface is implemented using the engine concept.

    \n

    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02912.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02912.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::Mapper< G, MapperImp, IndexType > Class Template Reference
    \n \n
    \n \n

    Mapper interface. \n More...

    \n \n-

    #include <dune/grid/common/mapper.hh>

    \n+

    #include <dune/grid/common/mapper.hh>

    \n
    \n Inheritance diagram for Dune::Mapper< G, MapperImp, IndexType >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -426,15 +426,15 @@\n
    \n \n

    Reinitialize mapper after grid has been modified.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02916.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02916.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::MultipleCodimMultipleGeomTypeMapper< GV > Class Template Reference
    \n \n
    \n \n

    Implementation class for a multiple codim and multiple geometry type mapper. \n More...

    \n \n-

    #include <dune/grid/common/mcmgmapper.hh>

    \n+

    #include <dune/grid/common/mcmgmapper.hh>

    \n
    \n Inheritance diagram for Dune::MultipleCodimMultipleGeomTypeMapper< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -929,15 +929,15 @@\n \n

    Recalculates indices after grid adaptation.

    \n

    After grid adaptation you need to call this to update the stored gridview and recalculate the indices.

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

    A set of PartitionType values. \n More...

    \n \n-

    #include <dune/grid/common/partitionset.hh>

    \n+

    #include <dune/grid/common/partitionset.hh>

    \n \n \n \n \n \n \n@@ -395,15 +395,15 @@\n
    \n \n

    creates a PartitionSet for the given PartitionIteratorType

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02980.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02980.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::SingleCodimSingleGeomTypeMapper< GV, c > Class Template Reference
    \n \n
    \n \n

    Implementation class for a single codim and single geometry type mapper. \n More...

    \n \n-

    #include <dune/grid/common/scsgmapper.hh>

    \n+

    #include <dune/grid/common/scsgmapper.hh>

    \n
    \n Inheritance diagram for Dune::SingleCodimSingleGeomTypeMapper< GV, c >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -664,15 +664,15 @@\n \n

    Recalculates indices after grid adaptation.

    \n

    After grid adaptation you need to call this to update the stored gridview and recalculate the indices.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a02984.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a02984.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::SizeCache< GridImp > Class Template Reference
    \n \n
    \n \n

    organizes the caching of sizes for one grid and one GeometryType \n More...

    \n \n-

    #include <dune/grid/common/sizecache.hh>

    \n+

    #include <dune/grid/common/sizecache.hh>

    \n
    \n Inheritance diagram for Dune::SizeCache< GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -320,15 +320,15 @@\n
    \n \n

    Return number of grid entities of a given codim on a given level in this process.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03024.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03024.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members\n
    Dune::CachedCoordFunction< HostGrid, CoordFunction > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/cachedcoordfunction.hh>

    \n+

    #include <dune/grid/geometrygrid/cachedcoordfunction.hh>

    \n
    \n Inheritance diagram for Dune::CachedCoordFunction< HostGrid, CoordFunction >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -469,15 +469,15 @@\n
    \n \n

    dimension of the range vector

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03028.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03028.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::GeoGrid::CoordCache< HostGrid, Coordinate > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/cachedcoordfunction.hh>

    \n+

    #include <dune/grid/geometrygrid/cachedcoordfunction.hh>

    \n
    \n Inheritance diagram for Dune::GeoGrid::CoordCache< HostGrid, Coordinate >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -319,15 +319,15 @@\n \n

    \n Public Member Functions

    template<unsigned int p>
    struct PartitionSet< partitions|p > constexpr operator+ (const PartitionSet< p > &) const
     Returns a new PartitionSet that also contains the partitions in set.
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03084.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03084.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::AnalyticalCoordFunction< ct, dimD, dimR, Impl > Class Template Reference
    \n \n
    \n \n

    Derive an implementation of an analytical coordinate function from this class. \n More...

    \n \n-

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n+

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n
    \n Inheritance diagram for Dune::AnalyticalCoordFunction< ct, dimD, dimR, Impl >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -583,15 +583,15 @@\n
    \n \n

    dimension of the range vector

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03088.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03088.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::DiscreteCoordFunction< ct, dimR, Impl > Class Template Reference
    \n \n
    \n \n

    Derive an implementation of a discrete coordinate function from this class. \n More...

    \n \n-

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n+

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n
    \n Inheritance diagram for Dune::DiscreteCoordFunction< ct, dimR, Impl >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -507,15 +507,15 @@\n
    \n \n

    dimension of the range vector

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

    Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid. An implementation should be derived from Dune::AnalyticalCoordFunction and the evaluate method mapping \"$ has to be supplied. \n More...

    \n \n-

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n+

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n
    \n Inheritance diagram for Dune::AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -396,15 +396,15 @@\n
    \n \n

    dimension of the range vector

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

    Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid. An implementation should be derived from Dune::DiscreteCoordinateFunction and the evaluate method taking an entity of the host grid together with the number of a vertex returns the coordinate in \"$ of that corner. The user must ensure continuity of this mapping. In addition an adapt method is provided which is called whenever adapt() is called on the Dune::GeometryGrid. \n More...

    \n \n-

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n+

    #include <dune/grid/geometrygrid/coordfunction.hh>

    \n
    \n Inheritance diagram for Dune::DiscreteCoordFunctionInterface< ct, dimR, Impl >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -386,15 +386,15 @@\n
    \n \n

    dimension of the range vector

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03128.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03128.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::GeoGrid::CoordFunctionCaller< HostEntity, CoordFunctionInterface > Class Template Reference
    \n
    \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03140.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03140.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::GeoGrid::CoordVector< mydim, Grid, fake > Class Template Reference
    \n
    \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03144.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03144.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::GeoGrid::CoordVector< mydim, Grid, false > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/cornerstorage.hh>

    \n+

    #include <dune/grid/geometrygrid/cornerstorage.hh>

    \n \n \n \n \n \n \n@@ -157,15 +157,15 @@\n \n

    \n Public Member Functions

     CoordVector (const HostEntity &hostEntity, const CoordFunction &coordFunction)
     
    template<std::size_t size>
    void calculate (std::array< Coordinate, size >(&corners)) const
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03148.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03148.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::GeoGrid::CoordVector< mydim, Grid, true > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/cornerstorage.hh>

    \n+

    #include <dune/grid/geometrygrid/cornerstorage.hh>

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

    \n Public Member Functions

     CoordVector (const HostElement &hostElement, const unsigned int subEntity, const CoordFunction &coordFunction)
     
    template<std::size_t size>
    void calculate (std::array< Coordinate, size >(&corners)) const
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03152.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03152.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::GeoGrid::IntersectionCoordVector< Grid > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/cornerstorage.hh>

    \n+

    #include <dune/grid/geometrygrid/cornerstorage.hh>

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

    \n Public Member Functions

     IntersectionCoordVector (const ElementGeometryImpl &elementGeometry, const HostLocalGeometry &hostLocalGeometry)
     
    template<std::size_t size>
    void calculate (std::array< Coordinate, size >(&corners)) const
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03156.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03156.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::GeoGrid::CornerStorage< mydim, cdim, Grid > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/cornerstorage.hh>

    \n+

    #include <dune/grid/geometrygrid/cornerstorage.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Coords::const_iterator const_iterator
     
    \n \n

    \n@@ -258,15 +258,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03164.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03164.html", "unified_diff": "@@ -1547,15 +1547,15 @@\n

    update grid caches

    \n

    This method has to be called whenever the underlying host grid changes.

    \n
    Note
    If you adapt the host grid through this geometry grid's adaptation or load balancing methods, update is automatically called.
    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03176.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03176.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::HierarchicIterator< G > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -372,15 +372,15 @@\n

    \n Public Types

    typedef Traits::Grid Grid
     
    typedef Traits::template Codim< codimension >::Entity Entity
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03292.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03292.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::GeoGrid::HostCorners< HostEntity > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/hostcorners.hh>

    \n+

    #include <dune/grid/geometrygrid/hostcorners.hh>

    \n \n \n \n \n

    \n Public Types

    typedef HostGeometry::GlobalCoordinate Coordinate
     
    \n \n

    \n@@ -225,15 +225,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03296.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03296.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::IdenticalCoordFunction< ctype, dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/identity.hh>

    \n+

    #include <dune/grid/geometrygrid/identity.hh>

    \n
    \n Inheritance diagram for Dune::IdenticalCoordFunction< ctype, dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -457,15 +457,15 @@\n
    \n \n

    dimension of the range vector

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03312.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03312.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::GeoGrid::Iterator< HostGridView, codim, pitype, Grid, fake > Class Template Reference
    \n
    \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03316.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03316.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, pitype, Grid > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03320.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03320.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, Interior_Partition, Grid > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -271,15 +271,15 @@\n \n

    \n Public Types

    typedef std::remove_const< Grid >::type::ctype ctype
     
    typedef std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03324.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03324.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, InteriorBorder_Partition, Grid > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -271,15 +271,15 @@\n \n

    \n Public Types

    typedef std::remove_const< Grid >::type::ctype ctype
     
    typedef std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03328.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03328.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, Overlap_Partition, Grid > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -271,15 +271,15 @@\n \n

    \n Public Types

    typedef std::remove_const< Grid >::type::ctype ctype
     
    typedef std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03332.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03332.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, OverlapFront_Partition, Grid > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -271,15 +271,15 @@\n \n

    \n Public Types

    typedef std::remove_const< Grid >::type::ctype ctype
     
    typedef std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03336.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03336.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, All_Partition, Grid > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -271,15 +271,15 @@\n \n

    \n Public Types

    typedef std::remove_const< Grid >::type::ctype ctype
     
    typedef std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03340.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03340.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::PartitionIteratorFilter< codim, Ghost_Partition, Grid > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -271,15 +271,15 @@\n \n

    \n Public Types

    typedef std::remove_const< Grid >::type::ctype ctype
     
    typedef std::remove_const< Grid >::type::Traits::template Codim< 0 >::Entity Element
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03344.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03344.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::Iterator< HostGridView, codim, pitype, G, false > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -481,15 +481,15 @@\n \n

    \n Public Types

    typedef Traits::Grid Grid
     
    typedef Traits::template Codim< codimension >::Entity Entity
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03348.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03348.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::GeoGrid::Iterator< HostGridView, codim, pitype, G, true > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/geometrygrid/iterator.hh>

    \n+

    #include <dune/grid/geometrygrid/iterator.hh>

    \n \n \n \n \n \n \n@@ -467,15 +467,15 @@\n \n

    \n Public Types

    typedef Traits::Grid Grid
     
    typedef Traits::template Codim< codimension >::Entity Entity
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03360.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03360.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::HostGridAccess< Grid > Class Template Reference
    \n \n
    \n \n

    provides access to host grid objects from GeometryGrid \n More...

    \n \n-

    #include <dune/grid/utility/hostgridaccess.hh>

    \n+

    #include <dune/grid/utility/hostgridaccess.hh>

    \n

    Detailed Description

    \n
    template<class Grid>
    \n class Dune::HostGridAccess< Grid >

    provides access to host grid objects from GeometryGrid

    \n

    provides access to host grid objects from IdentityGrid

    \n
    Template Parameters
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03388.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03388.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::IdentityGridEntity< codim, dim, GridImp > Class Template Reference
    \n \n
    \n \n

    The implementation of entities in a IdentityGrid. \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridentity.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridentity.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridEntity< codim, dim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -740,15 +740,15 @@\n
    \n \n

    Know dimension of the 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03392.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03392.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::IdentityGridLevelIterator< codim, pitype, GridImp > Class Template Reference
    \n \n
    \n \n

    Iterator over all entities of a given codimension and level of a grid. \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridleveliterator.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridleveliterator.hh>

    \n
    GeometryGrid
    \n \n \n \n

    \n Public Types

    typedef GridImp::template Codim< codim >::Entity Entity
     
    \n \n

    \n@@ -341,16 +341,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03396.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03396.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::IdentityGridLevelIntersectionIterator< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/identitygrid/identitygridintersectioniterator.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridintersectioniterator.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Dune::Intersection< const GridImp, Dune::IdentityGridLevelIntersection< GridImp > > Intersection
     
    \n \n

    \n@@ -276,16 +276,16 @@\n
    \n \n

    prefix increment

    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03400.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03400.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::IdentityGridLeafIntersectionIterator< GridImp > Class Template Reference
    \n \n
    \n \n

    Iterator over all element neighborsMesh entities of codimension 0 (\"elements\") allow to visit all neighbors, where a neighbor is an entity of codimension 0 which has a common entity of codimension 1 These neighbors are accessed via a IntersectionIterator. This allows the implement non-matching meshes. The number of neighbors may be different from the number of an element! \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridintersectioniterator.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridintersectioniterator.hh>

    \n \n \n \n \n

    \n Public Types

    typedef Dune::Intersection< const GridImp, Dune::IdentityGridLeafIntersection< GridImp > > Intersection
     
    \n \n

    \n@@ -280,16 +280,16 @@\n
    \n \n

    prefix increment

    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03404.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03404.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::IdentityGridHierarchicIterator< GridImp > Class Template Reference
    \n \n
    \n \n

    Iterator over the descendants of an entity.Mesh entities of codimension 0 (\"elements\") allow to visit all entities of codimension 0 obtained through nested, hierarchic refinement of the entity. Iteration over this set of entities is provided by the HierarchicIterator, starting from a given entity. \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridhierarchiciterator.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridhierarchiciterator.hh>

    \n \n \n \n \n

    \n Public Types

    typedef GridImp::template Codim< 0 >::Entity Entity
     
    \n \n

    \n@@ -342,16 +342,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03408.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03408.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::IdentityGridEntity< 0, dim, GridImp > Class Template Reference
    \n \n
    \n \n

    Specialization for codim-0-entities. \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridentity.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridentity.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridEntity< 0, dim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1267,15 +1267,15 @@\n
    \n \n

    Know dimension of the 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03412.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03412.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::IdentityGridEntitySeed< codim, GridImp > Class Template Reference
    \n \n
    \n \n

    The EntitySeed class provides the minimal information needed to restore an Entity using the grid. \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridentityseed.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridentityseed.hh>

    \n \n \n \n \n \n \n@@ -308,15 +308,15 @@\n \n

    \n Public Member Functions

     IdentityGridEntitySeed ()
     Construct an empty (i.e. isValid() == false) seed.
     
     IdentityGridEntitySeed (const HostEntity &hostEntity)
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03416.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03416.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Attributes |\n Static Public Attributes |\n List of all members \n
    Dune::IdentityGridGeometry< mydim, coorddim, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/identitygrid/identitygridgeometry.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridgeometry.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridGeometry< mydim, coorddim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -926,15 +926,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03420.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03420.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Attributes |\n Static Public Attributes |\n List of all members \n
    Dune::IdentityGridLevelIndexSet< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridLevelIndexSet< GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -771,15 +771,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03424.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03424.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Attributes |\n Static Public Attributes |\n List of all members \n
    Dune::IdentityGridLeafIndexSet< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridLeafIndexSet< GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -754,15 +754,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03428.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03428.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Attributes |\n Static Public Attributes |\n List of all members \n
    Dune::IdentityGridGlobalIdSet< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridGlobalIdSet< GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -435,15 +435,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03432.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03432.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Attributes |\n Static Public Attributes |\n List of all members \n
    Dune::IdentityGridLocalIdSet< GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridindexsets.hh>

    \n
    \n Inheritance diagram for Dune::IdentityGridLocalIdSet< GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -435,15 +435,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03436.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03436.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::IdentityGridLeafIntersection< GridImp > Class Template Reference
    \n \n
    \n \n

    An intersection with a leaf neighbor elementMesh entities of codimension 0 (\"elements\") allow to visit all neighbors, where a neighbor is an entity of codimension 0 which has a common entity of codimension 1 These neighbors are accessed via a IntersectionIterator. This allows the implement non-matching meshes. The number of neighbors may be different from the number of an element! \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridintersections.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridintersections.hh>

    \n \n \n \n \n \n \n@@ -813,15 +813,15 @@\n
    \n \n

    return unit outer normal

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03440.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03440.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members\n
    Dune::IdentityGridLevelIntersection< GridImp > Class Template Reference
    \n \n

    \n Public Types

    typedef GridImp::template Codim< 1 >::Geometry Geometry
     
    typedef GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
     
    \n \n \n \n \n \n@@ -809,15 +809,15 @@\n
    \n \n

    return unit outer normal

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03444.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03444.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::IdentityGridLeafIterator< codim, pitype, GridImp > Class Template Reference
    \n \n
    \n \n

    Iterator over all entities of a given codimension and level of a grid. \n More...

    \n \n-

    #include <dune/grid/identitygrid/identitygridleafiterator.hh>

    \n+

    #include <dune/grid/identitygrid/identitygridleafiterator.hh>

    \n

    \n Public Types

    typedef GridImp::template Codim< 1 >::Geometry Geometry
     
    typedef GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
     
    \n \n \n \n

    \n Public Types

    typedef GridImp::template Codim< codim >::Entity Entity
     
    \n \n

    \n@@ -322,15 +322,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03448.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03448.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::BasicBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/basic.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/basic.hh>

    \n
    \n Inheritance diagram for Dune::dgf::BasicBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -473,16 +473,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03452.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03452.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::dgf::DomainData Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>

    \n \n \n \n \n

    \n Public Types

    typedef DGFBoundaryParameter::type BoundaryParameter
     
    \n \n

    \n@@ -355,15 +355,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03456.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03456.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::dgf::Domain Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>

    \n \n \n \n \n

    \n Public Types

    typedef DGFBoundaryParameter::type BoundaryParameter
     
    \n \n

    \n@@ -334,15 +334,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03460.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03460.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::BoundaryDomBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>

    \n
    \n Inheritance diagram for Dune::dgf::BoundaryDomBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -655,16 +655,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03464.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03464.html", "unified_diff": "@@ -79,15 +79,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::BoundarySegBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/boundaryseg.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/boundaryseg.hh>

    \n
    \n Inheritance diagram for Dune::dgf::BoundarySegBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -582,16 +582,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03468.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03468.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::CubeBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/cube.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/cube.hh>

    \n
    \n Inheritance diagram for Dune::dgf::CubeBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -545,16 +545,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03472.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03472.html", "unified_diff": "@@ -79,15 +79,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::DimBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/dim.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/dim.hh>

    \n
    \n Inheritance diagram for Dune::dgf::DimBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -542,16 +542,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03476.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03476.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::GeneralBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/general.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/general.hh>

    \n
    \n Inheritance diagram for Dune::dgf::GeneralBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -545,16 +545,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03480.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03480.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::dgf::GridParameterBlock Class Reference
    \n \n
    \n \n

    Common Grid parameters. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/gridparameter.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/gridparameter.hh>

    \n
    \n Inheritance diagram for Dune::dgf::GridParameterBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -839,15 +839,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03484.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03484.html", "unified_diff": "@@ -79,15 +79,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::IntervalBlock Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/interval.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/interval.hh>

    \n
    \n Inheritance diagram for Dune::dgf::IntervalBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -739,16 +739,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03488.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03488.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::dgf::IntervalBlock::Interval Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/interval.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/interval.hh>

    \n \n \n \n \n \n \n@@ -240,15 +240,15 @@\n \n

    \n Public Member Functions

     Interval ()
     
     Interval (const Interval &interval, const std::vector< int > &map)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03492.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03492.html", "unified_diff": "@@ -79,15 +79,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::PeriodicFaceTransformationBlock Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>

    \n
    \n Inheritance diagram for Dune::dgf::PeriodicFaceTransformationBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -506,16 +506,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03496.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03496.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::dgf::PeriodicFaceTransformationBlock::Matrix< T > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>

    \n
    \n Inheritance diagram for Dune::dgf::PeriodicFaceTransformationBlock::Matrix< T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -272,15 +272,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03500.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03500.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>

    \n \n \n \n \n

    \n Public Member Functions

     AffineTransformation (int dimworld)
     
    \n \n

    \n@@ -148,15 +148,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03504.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03504.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::PolygonBlock Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/polygon.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/polygon.hh>

    \n
    \n Inheritance diagram for Dune::dgf::PolygonBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -533,15 +533,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03508.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03508.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::PolyhedronBlock Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/polyhedron.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/polyhedron.hh>

    \n
    \n Inheritance diagram for Dune::dgf::PolyhedronBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -503,15 +503,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03512.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03512.html", "unified_diff": "@@ -217,15 +217,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03516.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03516.html", "unified_diff": "@@ -160,15 +160,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03520.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03520.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03524.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03524.html", "unified_diff": "@@ -189,15 +189,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03528.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03528.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03532.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03532.html", "unified_diff": "@@ -189,15 +189,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03536.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03536.html", "unified_diff": "@@ -189,15 +189,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03540.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03540.html", "unified_diff": "@@ -189,15 +189,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03544.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03544.html", "unified_diff": "@@ -189,15 +189,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03548.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03548.html", "unified_diff": "@@ -189,15 +189,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03552.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03552.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03556.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03556.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03560.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03560.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03564.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03564.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03568.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03568.html", "unified_diff": "@@ -199,15 +199,15 @@\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03572.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03572.html", "unified_diff": "@@ -848,15 +848,15 @@\n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03588.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03588.html", "unified_diff": "@@ -79,15 +79,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::SimplexBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/simplex.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/simplex.hh>

    \n
    \n Inheritance diagram for Dune::dgf::SimplexBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -593,16 +593,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03592.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03592.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::SimplexGenerationBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh>

    \n
    \n Inheritance diagram for Dune::dgf::SimplexGenerationBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -730,16 +730,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03596.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03596.html", "unified_diff": "@@ -78,15 +78,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::dgf::VertexBlock Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/blocks/vertex.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/blocks/vertex.hh>

    \n
    \n Inheritance diagram for Dune::dgf::VertexBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -533,16 +533,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03600.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03600.html", "unified_diff": "@@ -76,29 +76,29 @@\n
    Dune::DGFException Class Reference
    \n \n
    \n \n

    exception class for IO errors in the DGF parser \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfexception.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfexception.hh>

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

    Detailed Description

    \n

    exception class for IO errors in the DGF parser

    \n

    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03604.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03604.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Member Functions |\n List of all members \n
    Dune::DGFCoordFunction< dimD, dimR > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n
    \n Inheritance diagram for Dune::DGFCoordFunction< dimD, dimR >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -478,15 +478,15 @@\n
    \n \n

    dimension of the range vector

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03608.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03608.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, discrete > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03612.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03612.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, false > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static CoordFunction * create (std::istream &, const HostGrid &)
     
    \n

    Member Function Documentation

    \n@@ -123,15 +123,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03616.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03616.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, true > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static CoordFunction * create (std::istream &, const HostGrid &hostGrid)
     
    \n

    Member Function Documentation

    \n@@ -123,15 +123,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03620.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03620.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members \n
    Dune::DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >, false > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n \n \n \n \n

    \n Public Types

    typedef DGFCoordFunction< dimD, dimR > CoordFunction
     
    \n \n

    \n@@ -146,15 +146,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03624.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03624.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n \n \n \n \n \n \n@@ -512,15 +512,15 @@\n \n

    \n Public Types

    typedef GeometryGrid< HostGrid, CoordFunction, Allocator > Grid
     
    typedef MPIHelper::MPICommunicator MPICommunicator
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03628.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03628.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfgeogrid.hh>

    \n \n \n \n \n \n \n@@ -141,15 +141,15 @@\n \n

    \n Static Public Member Functions

    static int refineStepsForHalf ()
     
    static double refineWeight ()
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03636.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03636.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::DGFGridFactory< IdentityGrid< HostGrid > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfidentitygrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfidentitygrid.hh>

    \n \n \n \n \n \n \n@@ -432,15 +432,15 @@\n \n

    \n Public Types

    typedef IdentityGrid< HostGrid > Grid
     
    typedef MPIHelper::MPICommunicator MPICommunicator
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03640.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03640.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFGridInfo< IdentityGrid< HostGrid > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfidentitygrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfidentitygrid.hh>

    \n \n \n \n \n \n \n@@ -141,15 +141,15 @@\n \n

    \n Static Public Member Functions

    static int refineStepsForHalf ()
     
    static double refineWeight ()
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03644.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03644.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFGridInfo< OneDGrid > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfoned.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfoned.hh>

    \n \n \n \n \n \n \n@@ -137,15 +137,15 @@\n \n

    \n Static Public Member Functions

    static int refineStepsForHalf ()
     
    static double refineWeight ()
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03648.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03648.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::DGFGridFactory< OneDGrid > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfoned.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfoned.hh>

    \n \n \n \n \n \n \n@@ -532,15 +532,15 @@\n
    \n \n

    grid dimension

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03660.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03660.html", "unified_diff": "@@ -80,15 +80,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members\n
    Dune::dgf::UGGridParameterBlock Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfug.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfug.hh>

    \n
    \n Inheritance diagram for Dune::dgf::UGGridParameterBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1002,16 +1002,16 @@\n \n

    \n Public Types

    typedef OneDGrid Grid
     grid type
     
    typedef MPIHelper::MPICommunicator MPICommunicatorType
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03664.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03664.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFGridInfo< UGGrid< dim > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfug.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfug.hh>

    \n \n \n \n \n \n \n@@ -141,15 +141,15 @@\n \n

    \n Static Public Member Functions

    static int refineStepsForHalf ()
     
    static double refineWeight ()
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03668.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03668.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::DGFGridFactory< UGGrid< dim > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfug.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfug.hh>

    \n \n \n \n \n \n \n@@ -560,16 +560,16 @@\n
    \n \n

    grid dimension

    \n \n
    \n \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03672.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03672.html", "unified_diff": "@@ -84,15 +84,15 @@\n
    Dune::DGFWriter< GV > Class Template Reference
    \n \n
    \n \n

    write a GridView to a DGF file \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfwriter.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfwriter.hh>

    \n

    \n Public Types

    typedef UGGrid< dim > Grid
     grid type
     
    typedef MPIHelper::MPICommunicator MPICommunicatorType
    \n \n \n \n \n \n@@ -1055,15 +1055,15 @@\n \n

    \n Public Types

    typedef GV GridView
     type of grid view
     
    typedef GridView::Grid Grid
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03676.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03676.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::dgf::YaspGridParameterBlock Class Reference
    \n \n
    \n \n

    Grid parameters for YaspGrid. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n
    \n Inheritance diagram for Dune::dgf::YaspGridParameterBlock:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -904,15 +904,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03680.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03680.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::DGFGridFactory< YaspGrid< dim, EquidistantCoordinates< ctype, dim > > > Struct Template Reference
    \n \n
    \n \n

    Grid factory for YaspGrid with equidistant coordinates. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n \n \n \n \n \n \n@@ -493,15 +493,15 @@\n \n

    \n Public Types

    typedef YaspGrid< dim, EquidistantCoordinates< ctype, dim > > Grid
     
    typedef MPIHelper::MPICommunicator MPICommunicatorType
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03684.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03684.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::DGFGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > > Struct Template Reference
    \n \n
    \n \n

    Grid factory for YaspGrid with equidistant coordinates. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n \n \n \n \n \n \n@@ -493,15 +493,15 @@\n \n

    \n Public Types

    typedef YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > Grid
     
    typedef MPIHelper::MPICommunicator MPICommunicatorType
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03688.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03688.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::DGFGridFactory< Dune::YaspGrid< dim, Dune::TensorProductCoordinates< ctype, dim > > > Class Template Reference
    \n \n
    \n \n

    Placeholder for grid factory for YaspGrid with tensor product coordinates. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n \n \n \n \n \n \n@@ -153,15 +153,15 @@\n \n

    \n Public Member Functions

    template<typename In >
     DGFGridFactory (const In &)
     
    Gridgrid ()
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03692.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03692.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFGridInfo< YaspGrid< dim, Coordinates > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/dgfyasp.hh>

    \n \n \n \n \n \n \n@@ -141,15 +141,15 @@\n \n

    \n Static Public Member Functions

    static int refineStepsForHalf ()
     
    static double refineWeight ()
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03696.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03696.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::DGFEntityKey< A > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/entitykey.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/entitykey.hh>

    \n
    \n Inheritance diagram for Dune::DGFEntityKey< A >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -456,16 +456,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03700.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03700.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Static Public Member Functions |\n List of all members \n
    Dune::ElementFaceUtil Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/entitykey.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/entitykey.hh>

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

    \n Public Member Functions

    template<int dim>
    DGFEntityKey< unsigned int > generateSimplexFace (const std ::vector< unsigned int > &element, int f)
     
    \n@@ -248,16 +248,16 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03704.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03704.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    Dune::GridPtr< GridType > Struct Template Reference
    \n \n
    \n \n

    Class for constructing grids from DGF files. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/gridptr.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/gridptr.hh>

    \n \n \n \n \n \n \n@@ -1338,15 +1338,15 @@\n \n

    \n Classes

    struct  DataHandle
     
    class  mygrid_ptr
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03708.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03708.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::GridPtr< GridType >::mygrid_ptr Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/gridptr.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/gridptr.hh>

    \n
    \n Inheritance diagram for Dune::GridPtr< GridType >::mygrid_ptr:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -330,15 +330,15 @@\n
    \n \n

    STL member.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03712.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03712.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::GridPtr< GridType >::DataHandle Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/gridptr.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/gridptr.hh>

    \n
    \n Inheritance diagram for Dune::GridPtr< GridType >::DataHandle:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -622,15 +622,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03716.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03716.html", "unified_diff": "@@ -81,15 +81,15 @@\n Static Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::MacroGrid Class Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/dgfparser/macrogrid.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/macrogrid.hh>

    \n
    \n Inheritance diagram for Dune::MacroGrid:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1441,15 +1441,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03724.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03724.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::DGFBoundaryParameter Struct Reference
    \n \n
    \n \n

    Contains types for additional features. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/parser.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/parser.hh>

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

    \n Public Types

    typedef std::string type
     type of additional boundary parameters
     
    \n@@ -205,15 +205,15 @@\n
    \n \n

    delimiter

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03728.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03728.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    Dune::DuneGridFormatParser Class Reference
    \n \n
    \n \n

    The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures used by the MacroGrid class. \n More...

    \n \n-

    #include <dune/grid/io/file/dgfparser/parser.hh>

    \n+

    #include <dune/grid/io/file/dgfparser/parser.hh>

    \n
    \n Inheritance diagram for Dune::DuneGridFormatParser:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1325,15 +1325,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.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03732.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03732.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::GmshReaderOptions Struct Reference
    \n \n
    \n \n

    Options for read operation. \n More...

    \n \n-

    #include <dune/grid/io/file/gmshreader.hh>

    \n+

    #include <dune/grid/io/file/gmshreader.hh>

    \n \n \n \n \n@@ -112,15 +112,15 @@\n \n

    \n Public Types

    enum  GeometryOrder { firstOrder\n , secondOrder\n }
     
    secondOrder 

    quadratic boundary approximation.

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03748.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03748.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::GmshReaderParser< GridType > Class Template Reference
    \n \n
    \n \n

    dimension independent parts for GmshReaderParser \n More...

    \n \n-

    #include <dune/grid/io/file/gmshreader.hh>

    \n+

    #include <dune/grid/io/file/gmshreader.hh>

    \n \n \n \n \n \n \n@@ -939,15 +939,15 @@\n \n

    \n Public Member Functions

     GmshReaderParser (Dune::GridFactory< GridType > &_factory, bool v, bool i)
     
    std::vector< int > & boundaryIdMap ()
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03752.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03752.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::GmshReader< GridType > Class Template Reference
    \n \n
    \n \n

    Read Gmsh mesh file. \n More...

    \n \n-

    #include <dune/grid/io/file/gmshreader.hh>

    \n+

    #include <dune/grid/io/file/gmshreader.hh>

    \n \n \n \n \n \n \n@@ -855,15 +855,15 @@\n
    \n Initial value:
    =
    \n
    Opts::verbose | Opts::insertBoundarySegments | Opts::readElementData | Opts::readBoundaryData
    \n
    \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03764.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03764.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::GmshWriter< GridView > Class Template Reference
    \n \n
    \n \n

    Write Gmsh mesh file. \n More...

    \n \n-

    #include <dune/grid/io/file/gmshwriter.hh>

    \n+

    #include <dune/grid/io/file/gmshwriter.hh>

    \n

    \n Public Types

    typedef GridType Grid
     
    using Opts = Gmsh::ReaderOptions
     Dynamic Gmsh reader interface.
    \n \n \n \n \n \n@@ -239,15 +239,15 @@\n

    If the optional parameter physicalBoundaries is provided, also the boundaries are written on file with the corresponding physical value.

    \n

    The physicalBoundaries vector need to be sorted according to the intersection boundary segment index.

    \n

    Throws an IOError if file could not be opened or an unsupported element type is encountered.

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

    Writer for 1D grids in gnuplot format. \n More...

    \n \n-

    #include <dune/grid/io/file/gnuplot.hh>

    \n+

    #include <dune/grid/io/file/gnuplot.hh>

    \n
    \n Inheritance diagram for Dune::GnuplotWriter< GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -280,16 +280,16 @@\n

    \n Public Member Functions

     GmshWriter (const GridView &gridView, int numDigits=6)
     Constructor expecting GridView of Grid to be written.
     
    void setPrecision (int numDigits)
    \n \n \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03772.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03772.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::LeafGnuplotWriter< G > Class Template Reference
    \n \n
    \n \n

    GnuplotWriter on the leaf grid. \n More...

    \n \n-

    #include <dune/grid/io/file/gnuplot.hh>

    \n+

    #include <dune/grid/io/file/gnuplot.hh>

    \n
    \n Inheritance diagram for Dune::LeafGnuplotWriter< G >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -268,15 +268,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03776.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03776.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::LevelGnuplotWriter< G > Class Template Reference
    \n \n
    \n \n

    GnuplotWriter on a given level grid. \n More...

    \n \n-

    #include <dune/grid/io/file/gnuplot.hh>

    \n+

    #include <dune/grid/io/file/gnuplot.hh>

    \n
    \n Inheritance diagram for Dune::LevelGnuplotWriter< G >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -278,15 +278,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03788.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03788.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::StarCDReader< GridType > Class Template Reference
    \n \n
    \n \n

    File reader for the Star-CD format. \n More...

    \n \n-

    #include <dune/grid/io/file/starcdreader.hh>

    \n+

    #include <dune/grid/io/file/starcdreader.hh>

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

    \n Static Public Member Functions

    static std::unique_ptr< GridType > read (const std::string &fileName, bool verbose=true)
     Read grid from a Star-CD file.
     
    \n@@ -153,15 +153,15 @@\n \n \n
    Returns
    The return type is a special pointer type that casts into std::unique_ptr<GridType>, and std::shared_ptr<GridType>. It is scheduled to be replaced by std::unique_ptr<GridType> eventually.
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03792.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03792.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::b64chunk Struct Reference
    \n \n
    \n \n

    struct representing the three byte text as well as the four 6 bit chunks \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/b64enc.hh>

    \n+

    #include <dune/grid/io/file/vtk/b64enc.hh>

    \n \n \n \n \n

    \n Public Types

    using size_type = unsigned char
     
    \n \n

    \n@@ -267,15 +267,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03796.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03796.html", "unified_diff": "@@ -79,15 +79,15 @@\n Protected Member Functions |\n Static Protected Member Functions |\n List of all members \n
    Dune::VTK::BasicWriter< IteratorFactory > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/basicwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/basicwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::BasicWriter< IteratorFactory >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1012,15 +1012,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03800.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03800.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::BoundaryIterator< GV > Class Template Reference
    \n \n
    \n \n

    iterate over the GridViews boundary intersections \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/boundaryiterators.hh>

    \n+

    #include <dune/grid/io/file/vtk/boundaryiterators.hh>

    \n
    \n Inheritance diagram for Dune::VTK::BoundaryIterator< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -440,15 +440,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03804.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03804.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::VTK::IntersectionIndexSet< ElementIndexSet > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/boundaryiterators.hh>

    \n+

    #include <dune/grid/io/file/vtk/boundaryiterators.hh>

    \n \n \n \n \n

    \n Public Member Functions

     IntersectionIndexSet (const ElementIndexSet &eis_)
     
    \n

    Constructor & Destructor Documentation

    \n@@ -113,15 +113,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03808.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03808.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::VTK::NonConformingBoundaryIteratorFactory< GV > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/boundaryiterators.hh>

    \n+

    #include <dune/grid/io/file/vtk/boundaryiterators.hh>

    \n
    \n Inheritance diagram for Dune::VTK::NonConformingBoundaryIteratorFactory< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -536,15 +536,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03812.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03812.html", "unified_diff": "@@ -80,15 +80,15 @@\n Protected Member Functions |\n Static Protected Member Functions |\n List of all members \n
    Dune::VTK::NonConformingBoundaryWriter< GV > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/boundarywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/boundarywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::NonConformingBoundaryWriter< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1625,15 +1625,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03816.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03816.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::PrintType< T > Struct Template Reference
    \n \n
    \n \n

    determine a type to safely put another type into a stream \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/common.hh>

    \n+

    #include <dune/grid/io/file/vtk/common.hh>

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

    \n Public Types

    typedef T Type
     type to convert T to before putting it into a stream with <<
     
    \n@@ -111,15 +111,15 @@\n
    \n \n

    type to convert T to before putting it into a stream with <<

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03820.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03820.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::VTK::PrintType< unsigned char > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/common.hh>

    \n+

    #include <dune/grid/io/file/vtk/common.hh>

    \n \n \n \n \n

    \n Public Types

    typedef unsigned Type
     
    \n

    Member Typedef Documentation

    \n@@ -99,15 +99,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03824.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03824.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::VTK::PrintType< signed char > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/common.hh>

    \n+

    #include <dune/grid/io/file/vtk/common.hh>

    \n \n \n \n \n

    \n Public Types

    typedef int Type
     
    \n

    Member Typedef Documentation

    \n@@ -99,15 +99,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03828.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03828.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::VTK::PrintType< char > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/common.hh>

    \n+

    #include <dune/grid/io/file/vtk/common.hh>

    \n \n \n \n \n

    \n Public Types

    typedef std::conditional< std::numeric_limits< char >::is_signed, int, unsigned >::type Type
     
    \n

    Member Typedef Documentation

    \n@@ -99,15 +99,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03832.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03832.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::FieldInfo Class Reference
    \n \n
    \n \n

    Descriptor struct for VTK fields. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/common.hh>

    \n+

    #include <dune/grid/io/file/vtk/common.hh>

    \n \n \n \n@@ -307,15 +307,15 @@\n
    \n \n

    The type of the data field.

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

    simple class representing a corner of a cell \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/corner.hh>

    \n+

    #include <dune/grid/io/file/vtk/corner.hh>

    \n
    \n Inheritance diagram for Dune::VTK::Corner< Cell >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -386,15 +386,15 @@\n \n

    set the index of the corner within the cell in VTK-numbering

    \n

    This requires that the cell is valid

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03840.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03840.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::VTK::CornerIterator< CellIterator > Class Template Reference
    \n \n
    \n \n

    iterate over the corners of some cell range \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/corneriterator.hh>

    \n+

    #include <dune/grid/io/file/vtk/corneriterator.hh>

    \n
    \n Inheritance diagram for Dune::VTK::CornerIterator< CellIterator >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -473,15 +473,15 @@\n
    \n Initial value:
    = std::iterator_traits<CellIterator>::
    \n
    value_type::mydimension
    \n
    \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03844.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03844.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::DataArrayWriter Class Referenceabstract
    \n \n
    \n \n

    base class for data array writers \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::DataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -245,15 +245,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented in Dune::VTK::AppendedRawDataArrayWriter, and Dune::VTK::AppendedBase64DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03848.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03848.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::AsciiDataArrayWriter Class Reference
    \n \n
    \n \n

    a streaming writer for data array tags, uses ASCII inline format \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::AsciiDataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -263,15 +263,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented in Dune::VTK::AppendedRawDataArrayWriter, and Dune::VTK::AppendedBase64DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03852.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03852.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::BinaryDataArrayWriter Class Reference
    \n \n
    \n \n

    a streaming writer for data array tags, uses binary inline format \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::BinaryDataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -270,15 +270,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented in Dune::VTK::AppendedRawDataArrayWriter, and Dune::VTK::AppendedBase64DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03856.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03856.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::AppendedRawDataArrayWriter Class Reference
    \n \n
    \n \n

    a streaming writer for data array tags, uses appended raw format \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::AppendedRawDataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -247,15 +247,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented from Dune::VTK::DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03860.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03860.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::AppendedBase64DataArrayWriter Class Reference
    \n \n
    \n \n

    a streaming writer for data array tags, uses appended base64 format \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::AppendedBase64DataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -247,15 +247,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented from Dune::VTK::DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03864.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03864.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::NakedBase64DataArrayWriter Class Reference
    \n \n
    \n \n

    a streaming writer for appended data array tags, uses base64 format \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::NakedBase64DataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -226,15 +226,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented in Dune::VTK::AppendedRawDataArrayWriter, and Dune::VTK::AppendedBase64DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03868.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03868.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::NakedRawDataArrayWriter Class Reference
    \n \n
    \n \n

    a streaming writer for appended data arrays, uses raw format \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::NakedRawDataArrayWriter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -226,15 +226,15 @@\n

    whether calls to write may be skipped

    \n \n

    Reimplemented in Dune::VTK::AppendedRawDataArrayWriter, and Dune::VTK::AppendedBase64DataArrayWriter.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03872.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03872.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::DataArrayWriterFactory Class Reference
    \n \n
    \n \n

    a factory for DataArrayWriters \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/dataarraywriter.hh>

    \n

    \n Public Types

    enum class  Type { scalar\n , vector\n , tensor\n }
    \n \n \n \n \n \n@@ -276,15 +276,15 @@\n \n \n

    The should never be more than one DataArrayWriter on the same stream around. The returned object should be freed with delete.

    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03876.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03876.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::VTKFunction< GridView > Class Template Referenceabstract
    \n \n
    \n \n

    A base class for grid functions with any return type and dimension. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/function.hh>

    \n+

    #include <dune/grid/io/file/vtk/function.hh>

    \n
    \n Inheritance diagram for Dune::VTKFunction< GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -369,15 +369,15 @@\n \n

    \n Public Member Functions

     DataArrayWriterFactory (OutputType type_, std::ostream &stream_)
     create a DataArrayWriterFactory
     
    bool beginAppended ()
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03880.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03880.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::P0VTKFunction< GV, V > Class Template Reference
    \n \n
    \n \n

    Take a vector and interpret it as cell data for the VTKWriter. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/function.hh>

    \n+

    #include <dune/grid/io/file/vtk/function.hh>

    \n
    \n Inheritance diagram for Dune::P0VTKFunction< GV, V >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -444,15 +444,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03884.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03884.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::P1VTKFunction< GV, V > Class Template Reference
    \n \n
    \n \n

    Take a vector and interpret it as point data for the VTKWriter. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/function.hh>

    \n+

    #include <dune/grid/io/file/vtk/function.hh>

    \n
    \n Inheritance diagram for Dune::P1VTKFunction< GV, V >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -444,15 +444,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03888.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03888.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::FunctionWriterBase< Cell_ > Class Template Referenceabstract
    \n \n
    \n \n

    Base class for function writers. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::FunctionWriterBase< Cell_ >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -466,15 +466,15 @@\n Domain&).

    \n \n

    Reimplemented in Dune::VTK::NonConformingConnectivityWriter< Cell >.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03892.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03892.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::VTKFunctionWriter< Func > Class Template Reference
    \n \n
    \n \n

    Base class for function writers. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::VTKFunctionWriter< Func >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -505,15 +505,15 @@\n
    \n \n

    write at the given position

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03896.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03896.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::CoordinatesWriter< Cell > Class Template Reference
    \n \n
    \n \n

    writer for the Coordinates array \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::CoordinatesWriter< Cell >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -497,15 +497,15 @@\n
    \n \n

    write at the given position

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03900.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03900.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::ConformingConnectivityWriter< IteratorFactory > Class Template Reference
    \n \n
    \n \n

    writer for the connectivity array in conforming mode \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::ConformingConnectivityWriter< IteratorFactory >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -499,15 +499,15 @@\n
    \n \n

    write at the given corner

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03904.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03904.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::NonConformingConnectivityWriter< Cell > Class Template Reference
    \n \n
    \n \n

    writer for the connectivity array in nonconforming mode \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::NonConformingConnectivityWriter< Cell >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -423,15 +423,15 @@\n

    write at the given corner

    \n \n

    Reimplemented from Dune::VTK::FunctionWriterBase< Cell >.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03908.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03908.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::OffsetsWriter< Cell > Class Template Reference
    \n \n
    \n \n

    writer for the offsets array \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::OffsetsWriter< Cell >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -466,15 +466,15 @@\n Domain&).

    \n \n

    Reimplemented in Dune::VTK::NonConformingConnectivityWriter< Cell >.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03912.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03912.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::TypesWriter< Cell > Class Template Reference
    \n \n
    \n \n

    writer for the types array \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/functionwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::TypesWriter< Cell >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -466,15 +466,15 @@\n Domain&).

    \n \n

    Reimplemented in Dune::VTK::NonConformingConnectivityWriter< Cell >.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03916.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03916.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::VTK::PointIterator< CellIterator, IS > Class Template Reference
    \n \n
    \n \n

    iterate over the points of some corner range \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/pointiterator.hh>

    \n+

    #include <dune/grid/io/file/vtk/pointiterator.hh>

    \n
    \n Inheritance diagram for Dune::VTK::PointIterator< CellIterator, IS >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -453,15 +453,15 @@\n
    \n Initial value:
    = std::iterator_traits<CellIterator>::
    \n
    value_type::mydimension
    \n
    \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03920.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03920.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTK::PVTUWriter Class Reference
    \n \n
    \n \n

    Dump a .vtu/.vtp files contents to a stream. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/pvtuwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/pvtuwriter.hh>

    \n \n \n \n \n \n \n@@ -590,15 +590,15 @@\n
    \n \n

    finish section for the point coordinates

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03924.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03924.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Attributes |\n List of all members\n
    Dune::VTK::SkeletonFunctionTraits< GV, RF > Struct Template Reference
    \n \n

    \n Public Member Functions

     PVTUWriter (std::ostream &stream_, FileType fileType_)
     create a PVTUWriter object
     
     ~PVTUWriter ()
    \n \n \n \n \n \n@@ -222,15 +222,15 @@\n \n

    \n Public Types

    typedef GV GridView
     
    typedef GV::Intersection Cell
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03928.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03928.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::SkeletonFunctionInterface< GV, RF > Class Template Reference
    \n \n
    \n \n

    A prototype for VTKFunctions on the skeleton. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/skeletonfunction.hh>

    \n+

    #include <dune/grid/io/file/vtk/skeletonfunction.hh>

    \n \n \n \n \n

    \n Public Types

    typedef SkeletonFunctionTraits< GV, RF > Traits
     
    \n

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

    \n \n \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03932.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03932.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTK::SkeletonFunctionWriter< Func > Class Template Reference
    \n \n
    \n \n

    function writer for skeleton functions \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/skeletonfunction.hh>

    \n+

    #include <dune/grid/io/file/vtk/skeletonfunction.hh>

    \n
    \n Inheritance diagram for Dune::VTK::SkeletonFunctionWriter< Func >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -569,15 +569,15 @@\n
    \n \n

    write at the given position

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03936.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03936.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::Base64Stream Class Reference
    \n \n
    \n \n

    class to base64 encode a stream of data \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/streams.hh>

    \n+

    #include <dune/grid/io/file/vtk/streams.hh>

    \n \n \n \n \n \n \n@@ -224,15 +224,15 @@\n \n

    encode a data item

    \n

    The result will be written to the stream, eventually. This method may be called multiple times in a row. After this method has been called, no one else may write to the underlying stream until flush() has been called or this writer object has been destroyed.

    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03940.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03940.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::RawStream Class Reference
    \n \n
    \n \n

    write out data in binary \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/streams.hh>

    \n+

    #include <dune/grid/io/file/vtk/streams.hh>

    \n

    \n Public Member Functions

     Base64Stream (std::ostream &s_)
     Construct a Base64Stream.
     
    template<class X >
    \n \n \n \n \n \n@@ -154,15 +154,15 @@\n
    \n \n

    write data to stream

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03944.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03944.html", "unified_diff": "@@ -84,15 +84,15 @@\n
    Dune::SubsamplingVTKWriter< GridView > Class Template Reference
    \n \n
    \n \n

    Writer for the output of subsampled grid functions in the vtk format. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::SubsamplingVTKWriter< GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1670,15 +1670,15 @@\n \n

    \n Public Member Functions

     RawStream (std::ostream &theStream)
     make a new stream
     
    template<class T >
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03952.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03952.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::VTK::ConformingVolumeIteratorFactory< GV > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/volumeiterators.hh>

    \n+

    #include <dune/grid/io/file/vtk/volumeiterators.hh>

    \n
    \n Inheritance diagram for Dune::VTK::ConformingVolumeIteratorFactory< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -536,15 +536,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03956.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03956.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::VTK::NonConformingVolumeIteratorFactory< GV > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/volumeiterators.hh>

    \n+

    #include <dune/grid/io/file/vtk/volumeiterators.hh>

    \n \n \n \n \n \n \n@@ -526,15 +526,15 @@\n \n

    \n Public Types

    typedef GV::template Codim< 0 >::Entity Cell
     
    typedef GV::template Codim< 0 >::template Partition< InteriorBorder_Partition >::Iterator CellIterator
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03960.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03960.html", "unified_diff": "@@ -80,15 +80,15 @@\n Protected Member Functions |\n Static Protected Member Functions |\n List of all members \n
    Dune::VTK::ConformingVolumeWriter< GV > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/io/file/vtk/volumewriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/volumewriter.hh>

    \n
    \n Inheritance diagram for Dune::VTK::ConformingVolumeWriter< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1705,15 +1705,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03964.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03964.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTKSequenceWriter< GridView > Class Template Reference
    \n \n
    \n \n

    Writer for the output of grid functions in the vtk format. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtksequencewriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtksequencewriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKSequenceWriter< GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -641,15 +641,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03968.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03968.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTKSequenceWriterBase< GridView > Class Template Reference
    \n \n
    \n \n

    Base class to write pvd-files which contains a list of all collected vtk-files. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtksequencewriterbase.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtksequencewriterbase.hh>

    \n
    \n Inheritance diagram for Dune::VTKSequenceWriterBase< GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -546,15 +546,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03988.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03988.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    Dune::VTKWriter< GridView > Class Template Reference
    \n \n
    \n \n

    Writer for the output of grid functions in the vtk format. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -2005,15 +2005,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03992.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03992.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::VTKWriter< GridView >::VTKLocalFunction Class Reference
    \n \n
    \n \n

    Type erasure wrapper for VTK data sets. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n \n \n \n \n \n \n@@ -514,15 +514,15 @@\n \n

    \n Classes

    struct  FunctionWrapper
     Type erasure implementation for functions conforming to the dune-functions LocalFunction interface. More...
     
    struct  FunctionWrapperBase
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a03996.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a03996.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase Struct Referenceabstract
    \n \n
    \n \n

    Base class for polymorphic container of underlying data set. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase:
    \n \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04000.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04000.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapper< F > Struct Template Reference
    \n \n
    \n \n

    Type erasure implementation for functions conforming to the dune-functions LocalFunction interface. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapper< F >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -288,15 +288,15 @@\n

    The function must write count scalar values as determined by the VTK::FieldInfo.

    \n \n

    Implements Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04004.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04004.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTKWriter< GridView >::VTKLocalFunction::GlobalFunctionWrapper< F > Struct Template Reference
    \n \n
    \n \n

    Type erasure implementation for C++ functions, i.e., functions that can be evaluated in global coordinates. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::VTKLocalFunction::GlobalFunctionWrapper< F >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -288,15 +288,15 @@\n

    The function must write count scalar values as determined by the VTK::FieldInfo.

    \n \n

    Implements Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04008.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04008.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTKWriter< GridView >::VTKLocalFunction::VTKFunctionWrapper Struct Reference
    \n \n
    \n \n

    Type erasure implementation for legacy VTKFunctions. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::VTKLocalFunction::VTKFunctionWrapper:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -251,15 +251,15 @@\n

    The function must write count scalar values as determined by the VTK::FieldInfo.

    \n \n

    Implements Dune::VTKWriter< GridView >::VTKLocalFunction::FunctionWrapperBase.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04012.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04012.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTKWriter< GridView >::CellIterator Class Reference
    \n \n
    \n \n

    Iterator over the grids elements. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::CellIterator:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -164,15 +164,15 @@\n \n
    \n

    get the position of the center of the element, in element-local coordinates

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04016.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04016.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VTKWriter< GridView >::VertexIterator Class Reference
    \n \n
    \n \n

    Iterate over the grid's vertices. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::VertexIterator:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -339,15 +339,15 @@\n
    \n \n

    position of vertex inside the 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04020.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04020.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::VTKWriter< GridView >::CornerIterator Class Reference
    \n \n
    \n \n

    Iterate over the elements' corners. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtkwriter.hh>

    \n
    \n Inheritance diagram for Dune::VTKWriter< GridView >::CornerIterator:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -281,15 +281,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04024.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04024.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::VTK::VTUWriter Class Reference
    \n \n
    \n \n

    Dump a .vtu/.vtp files contents to a stream. \n More...

    \n \n-

    #include <dune/grid/io/file/vtk/vtuwriter.hh>

    \n+

    #include <dune/grid/io/file/vtk/vtuwriter.hh>

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

    \n Public Types

    enum  Phase { main\n , appended\n }
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04104.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04104.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::EntityCommHelper< iftype > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04108.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04108.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::EntityCommHelper< InteriorBorder_InteriorBorder_Interface > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/entitycommhelper.hh>

    \n+

    #include <dune/grid/utility/entitycommhelper.hh>

    \n \n \n \n \n \n \n@@ -139,15 +139,15 @@\n \n

    \n Static Public Member Functions

    static bool send (const PartitionType p)
     
    static bool receive (const PartitionType p)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04112.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04112.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::EntityCommHelper< InteriorBorder_All_Interface > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/entitycommhelper.hh>

    \n+

    #include <dune/grid/utility/entitycommhelper.hh>

    \n \n \n \n \n \n \n@@ -139,15 +139,15 @@\n \n

    \n Static Public Member Functions

    static bool send (const PartitionType p)
     
    static bool receive (const PartitionType p)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04116.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04116.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::EntityCommHelper< Overlap_OverlapFront_Interface > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/entitycommhelper.hh>

    \n+

    #include <dune/grid/utility/entitycommhelper.hh>

    \n \n \n \n \n \n \n@@ -139,15 +139,15 @@\n \n

    \n Static Public Member Functions

    static bool send (const PartitionType p)
     
    static bool receive (const PartitionType p)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04120.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04120.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::EntityCommHelper< Overlap_All_Interface > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/entitycommhelper.hh>

    \n+

    #include <dune/grid/utility/entitycommhelper.hh>

    \n \n \n \n \n \n \n@@ -139,15 +139,15 @@\n \n

    \n Static Public Member Functions

    static bool send (const PartitionType p)
     
    static bool receive (const PartitionType p)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04124.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04124.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::EntityCommHelper< All_All_Interface > Struct Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/entitycommhelper.hh>

    \n+

    #include <dune/grid/utility/entitycommhelper.hh>

    \n \n \n \n \n \n \n@@ -139,15 +139,15 @@\n \n

    \n Static Public Member Functions

    static bool send (const PartitionType p)
     
    static bool receive (const PartitionType p)
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04128.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04128.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::GlobalIndexSet< GridView > Class Template Reference
    \n \n
    \n \n

    Calculate globally unique index over all processes in a Dune grid. \n More...

    \n \n-

    #include <dune/grid/utility/globalindexset.hh>

    \n+

    #include <dune/grid/utility/globalindexset.hh>

    \n \n \n \n \n \n \n@@ -472,15 +472,15 @@\n
    \n \n

    Global number of entities, i.e. number of entities without rendundant entities on interprocessor boundaries.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04132.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04132.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::GlobalIndexSet< GridView >::SubPartitionTypeProvider< Entity, Codim > Struct Template Reference
    \n \n
    \n \n

    Helper class to provide access to subentity PartitionTypes with a run-time codimension. \n More...

    \n \n-

    #include <dune/grid/utility/globalindexset.hh>

    \n+

    #include <dune/grid/utility/globalindexset.hh>

    \n

    \n Classes

    struct  SubPartitionTypeProvider
     Helper class to provide access to subentity PartitionTypes with a run-time codimension. More...
     
    struct  SubPartitionTypeProvider< Entity, 0 >
    \n \n \n \n \n

    \n Static Public Member Functions

    static PartitionType get (const Entity &entity, int codim, int i)
     Get PartitionType of the i-th subentity of codimension 'codim' of entity 'entity'.
     
    \n@@ -142,15 +142,15 @@\n
    \n \n

    Get PartitionType of the i-th subentity of codimension 'codim' of entity 'entity'.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04136.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04136.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::GlobalIndexSet< GridView >::SubPartitionTypeProvider< Entity, 0 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/globalindexset.hh>

    \n+

    #include <dune/grid/utility/globalindexset.hh>

    \n \n \n \n \n

    \n Static Public Member Functions

    static PartitionType get (const Entity &entity, int, int i)
     
    \n

    Member Function Documentation

    \n@@ -131,15 +131,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04164.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04164.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::HierarchicSearch< Grid, IS > Class Template Reference
    \n \n
    \n \n

    Search an IndexSet for an Entity containing a given point. \n More...

    \n \n-

    #include <dune/grid/utility/hierarchicsearch.hh>

    \n+

    #include <dune/grid/utility/hierarchicsearch.hh>

    \n \n \n \n \n \n \n@@ -215,15 +215,15 @@\n \n \n

    type of LevelIterator

    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04168.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04168.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members\n
    Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > > Struct Template Reference
    \n \n

    \n Public Member Functions

     HierarchicSearch (const Grid &g, const IS &is)
     Construct a HierarchicSearch object from a Grid and an IndexSet.
     
    Entity findEntity (const FieldVector< ct, dimw > &global) const
    \n \n \n \n \n

    \n Classes

    struct  Codim
     A Traits struct that collects return types of class member methods. More...
     
    \n@@ -358,15 +358,15 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04172.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04172.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >::Codim< codim > Struct Template Reference
    \n \n
    \n \n

    A Traits struct that collects return types of class member methods. \n More...

    \n \n-

    #include <dune/grid/utility/hostgridaccess.hh>

    \n+

    #include <dune/grid/utility/hostgridaccess.hh>

    \n \n \n \n \n \n \n@@ -142,15 +142,15 @@\n
    \n \n

    type of the host entity

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04176.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04176.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Types |\n Static Public Member Functions |\n List of all members\n
    Dune::HostGridAccess< IdentityGrid< HG > > Struct Template Reference
    \n \n

    \n Public Types

    typedef Grid::template Codim< codim >::Entity Entity
     type of the GeometryGrid entity
     
    typedef HostGrid::template Codim< codim >::Entity HostEntity
    \n \n \n \n \n

    \n Classes

    struct  Codim
     A Traits struct that collects return types of class member methods. More...
     
    \n@@ -385,15 +385,15 @@\n \n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04180.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04180.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::HostGridAccess< IdentityGrid< HG > >::Codim< codim > Struct Template Reference
    \n \n
    \n \n

    A Traits struct that collects return types of class member methods. \n More...

    \n \n-

    #include <dune/grid/utility/hostgridaccess.hh>

    \n+

    #include <dune/grid/utility/hostgridaccess.hh>

    \n \n \n \n \n \n \n@@ -142,15 +142,15 @@\n
    \n \n

    type of the host entity

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04184.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04184.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members\n
    Dune::FactoryUtilities::MultiIndex< dim > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/multiindex.hh>

    \n+

    #include <dune/grid/utility/multiindex.hh>

    \n
    \n Inheritance diagram for Dune::FactoryUtilities::MultiIndex< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -223,15 +223,15 @@\n
    \n \n

    STL member.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04196.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04196.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::PersistentContainerInterface< G, T > Class Template Reference
    \n \n
    \n \n

    Persistent storage of data on all entities of a grid. \n More...

    \n \n-

    #include <dune/grid/utility/persistentcontainerinterface.hh>

    \n+

    #include <dune/grid/utility/persistentcontainerinterface.hh>

    \n

    \n Public Types

    typedef Grid::template Codim< codim >::Entity Entity
     type of the IdGrid entity
     
    typedef HostGrid::template Codim< codim >::Entity HostEntity
    \n \n \n \n \n \n@@ -689,15 +689,15 @@\n \n

    exchange the content of the container with another one

    \n
    Note
    std::swap is overloaded to refor to this method
    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04200.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04200.html", "unified_diff": "@@ -84,15 +84,15 @@\n
    Dune::PersistentContainerMap< G, IdSet, Map > Class Template Reference
    \n \n
    \n \n

    map-based implementation of the PersistentContainer \n More...

    \n \n-

    #include <dune/grid/utility/persistentcontainermap.hh>

    \n+

    #include <dune/grid/utility/persistentcontainermap.hh>

    \n
    \n Inheritance diagram for Dune::PersistentContainerMap< G, IdSet, Map >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1092,15 +1092,15 @@\n \n

    \n Public Types

    typedef G Grid
     
    typedef T Value
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04204.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04204.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::PersistentContainerMap< G, IdSet, Map >::IteratorWrapper< value, iterator > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/persistentcontainermap.hh>

    \n+

    #include <dune/grid/utility/persistentcontainermap.hh>

    \n
    \n Inheritance diagram for Dune::PersistentContainerMap< G, IdSet, Map >::IteratorWrapper< value, iterator >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -314,15 +314,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04208.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04208.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::PersistentContainerVector< G, IndexSet, Vector > Class Template Reference
    \n \n
    \n \n

    vector-based implementation of the PersistentContainer \n More...

    \n \n-

    #include <dune/grid/utility/persistentcontainervector.hh>

    \n+

    #include <dune/grid/utility/persistentcontainervector.hh>

    \n
    \n Inheritance diagram for Dune::PersistentContainerVector< G, IndexSet, Vector >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -851,15 +851,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04212.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04212.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::PersistentContainerWrapper< G, T > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/persistentcontainerwrapper.hh>

    \n+

    #include <dune/grid/utility/persistentcontainerwrapper.hh>

    \n
    \n Inheritance diagram for Dune::PersistentContainerWrapper< G, T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -713,15 +713,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04216.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04216.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TensorGridFactoryCreator< Grid > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/tensorgridfactory.hh>

    \n+

    #include <dune/grid/utility/tensorgridfactory.hh>

    \n \n \n \n \n \n \n@@ -216,15 +216,15 @@\n \n

    \n Public Types

    typedef Grid::Traits::Communication Comm
     
    typedef Grid::ctype ctype
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04220.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04220.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::TensorGridFactory< Grid > Class Template Reference
    \n \n
    \n \n

    A factory class for conveniently creating tensorproduct grids. \n More...

    \n \n-

    #include <dune/grid/utility/tensorgridfactory.hh>

    \n+

    #include <dune/grid/utility/tensorgridfactory.hh>

    \n
    \n Inheritance diagram for Dune::TensorGridFactory< Grid >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -763,15 +763,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04224.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04224.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::TensorGridFactoryCreator< YaspGrid< dim, TensorProductCoordinates< ctype, dim > > > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/utility/tensorgridfactory.hh>

    \n+

    #include <dune/grid/utility/tensorgridfactory.hh>

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

    \n Public Types

    typedef YaspGrid< dim, TensorProductCoordinates< ctype, dim > > Grid
     
    typedef Grid::Communication Comm
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04228.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04228.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::VertexOrderByIdFactory< IdSet, Index > Class Template Reference
    \n \n
    \n \n

    Factory for GeneralVertexOrder objects using an IdSet. \n More...

    \n \n-

    #include <dune/grid/utility/vertexorderfactory.hh>

    \n+

    #include <dune/grid/utility/vertexorderfactory.hh>

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

    \n Classes

    struct  VertexOrder
     type of vertex order object may depend on the dimension of the element More...
     
    \n@@ -189,15 +189,15 @@\n \n \n

    The returned object will remain valid even after the factory has become singular or has been destroyed.

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

    type of vertex order object may depend on the dimension of the element \n More...

    \n \n-

    #include <dune/grid/utility/vertexorderfactory.hh>

    \n+

    #include <dune/grid/utility/vertexorderfactory.hh>

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

    \n Public Types

    typedef GeneralVertexOrder< dim, Index > type
     type of vertex order object
     
    \n@@ -113,15 +113,15 @@\n
    \n \n

    type of vertex order object

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04240.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04240.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::YaspGeometry< mydim, cdim, GridImp > Class Template Reference
    \n \n
    \n \n

    The general version that handles all codimensions but 0 and dim. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridgeometry.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridgeometry.hh>

    \n
    \n Inheritance diagram for Dune::YaspGeometry< mydim, cdim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -182,15 +182,15 @@\n \n

    constructor from midpoint and extension and a bitset defining which unit vectors span the entity

    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04244.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04244.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Attributes |\n List of all members \n
    Dune::YaspEntity< codim, dim, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/yaspgrid/yaspgridentity.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridentity.hh>

    \n
    \n Inheritance diagram for Dune::YaspEntity< codim, dim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -958,15 +958,15 @@\n \n

    Know dimension of the entity.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04248.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04248.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::YaspEntitySeed< codim, GridImp > Class Template Reference
    \n \n
    \n \n

    Describes the minimal information necessary to create a fully functional YaspEntity. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridentityseed.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridentityseed.hh>

    \n \n \n \n \n \n \n@@ -407,15 +407,15 @@\n \n

    codimension of entity

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04252.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04252.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::YaspLevelIterator< codim, pitype, GridImp > Class Template Reference
    \n \n
    \n \n

    Iterates over entities of one grid level. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridleveliterator.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridleveliterator.hh>

    \n

    \n Public Member Functions

     YaspEntitySeed ()
     default construct an invalid entity seed
     
     YaspEntitySeed (int level, std::array< int, dim > coord, int o=0)
    \n \n \n \n \n \n@@ -356,15 +356,15 @@\n \n

    entity

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04256.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04256.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::YaspIntersectionIterator< GridImp > Class Template Reference
    \n \n
    \n \n

    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridintersectioniterator.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridintersectioniterator.hh>

    \n

    \n Public Types

    typedef GridImp::template Codim< codim >::Entity Entity
     
    typedef GridImp::YGridLevelIterator YGLI
     
    \n \n \n \n \n \n@@ -367,15 +367,15 @@\n \n

    assignment

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04260.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04260.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::YaspIntersection< GridImp > Class Template Reference
    \n \n
    \n \n

    YaspIntersection provides data about intersection with neighboring codim 0 entities. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridintersection.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridintersection.hh>

    \n

    \n Public Types

    typedef Dune::YaspIntersection< GridImp > IntersectionImp
     
    typedef Dune::Intersection< GridImp, IntersectionImpIntersection
     
    \n \n \n \n \n \n@@ -852,15 +852,15 @@\n

    \n Public Types

    typedef GridImp::YGridLevelIterator YGLI
     
    typedef GridImp::YGrid::Iterator I
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04264.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04264.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::YaspHierarchicIterator< GridImp > Class Template Reference
    \n \n
    \n \n

    YaspHierarchicIterator enables iteration over son entities of codim 0. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridhierarchiciterator.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridhierarchiciterator.hh>

    \n \n \n \n \n \n \n@@ -359,15 +359,15 @@\n

    \n Public Types

    typedef GridImp::YGridLevelIterator YGLI
     
    typedef GridImp::YGrid::Iterator I
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04268.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04268.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::YaspIndexSet< GridImp, isLeafIndexSet > Class Template Reference
    \n \n
    \n \n

    Implementation of Level- and LeafIndexSets for YaspGrid. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridindexsets.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridindexsets.hh>

    \n
    \n Inheritance diagram for Dune::YaspIndexSet< GridImp, isLeafIndexSet >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -791,15 +791,15 @@\n \n

    dimension of the grid (maximum allowed codimension)

    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04272.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04272.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::YaspGlobalIdSet< GridImp > Class Template Reference
    \n \n
    \n \n

    persistent, globally unique Ids \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgrididset.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgrididset.hh>

    \n
    \n Inheritance diagram for Dune::YaspGlobalIdSet< GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -391,15 +391,15 @@\n \n

    dimension of the grid (maximum allowed codimension)

    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04276.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04276.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::YaspPersistentContainerIndex< Grid > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>

    \n
    \n Inheritance diagram for Dune::YaspPersistentContainerIndex< Grid >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -315,15 +315,15 @@\n
    Note
    The parameter codim denotes the codimension with respect to the grid, i.e., it must satisfy cc <= codim <= dimension.
    \n
    Returns
    An index in the range 0 ... Max number of entities in set - 1.
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04340.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04340.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::EquidistantCoordinates< ct, dim > Class Template Reference
    \n \n
    \n \n

    Container for equidistant coordinates in a YaspGrid. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/coordinates.hh>

    \n+

    #include <dune/grid/yaspgrid/coordinates.hh>

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

    \n Public Types

    typedef ct ctype
     export the coordinate type
     
    \n@@ -467,15 +467,15 @@\n
    \n \n

    export dimension

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

    Container for equidistant coordinates in a YaspGrid with non-trivial origin. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/coordinates.hh>

    \n+

    #include <dune/grid/yaspgrid/coordinates.hh>

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

    \n Public Types

    typedef ct ctype
     export the coordinate type
     
    \n@@ -512,15 +512,15 @@\n
    \n \n

    export dimension

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

    Coordinate container for a tensor product YaspGrid. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/coordinates.hh>

    \n+

    #include <dune/grid/yaspgrid/coordinates.hh>

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

    \n Public Types

    typedef ct ctype
     export the coordinate type
     
    \n@@ -467,15 +467,15 @@\n
    \n \n

    export dimension

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04352.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04352.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::Yasp::Partitioning< d > Class Template Referenceabstract
    \n \n
    \n \n

    a base class for the yaspgrid partitioning strategy \n More...

    \n \n-

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n+

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n
    \n Inheritance diagram for Dune::Yasp::Partitioning< d >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -210,15 +210,15 @@\n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04356.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04356.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Public Member Functions |\n List of all members\n
    Dune::Yasp::DefaultPartitioning< d > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n+

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n
    \n Inheritance diagram for Dune::Yasp::DefaultPartitioning< d >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -180,15 +180,15 @@\n \n \n

    Implements Dune::Yasp::Partitioning< d >.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04360.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04360.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::Yasp::PowerDPartitioning< d > Class Template Reference
    \n \n
    \n \n

    Implement yaspgrid load balance strategy for P=x^{dim} processors. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n+

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n
    \n Inheritance diagram for Dune::Yasp::PowerDPartitioning< d >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -206,15 +206,15 @@\n
    \n \n

    Implements Dune::Yasp::Partitioning< d >.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04364.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04364.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::Yasp::FixedSizePartitioning< d > Class Template Reference
    \n \n
    \n \n

    Implement partitioner that gets a fixed partitioning from an array If the given partitioning doesn't match the number of processors, the grid should be distributed to, an exception is thrown. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n+

    #include <dune/grid/yaspgrid/partitioning.hh>

    \n
    \n Inheritance diagram for Dune::Yasp::FixedSizePartitioning< d >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -244,15 +244,15 @@\n
    \n \n

    Implements Dune::Yasp::Partitioning< d >.

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

    Create a structured simplex grid.

    \n
    Note
    Simplices are not supported in YaspGrid, so this functions unconditionally throws a GridError.
    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04372.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04372.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::StructuredGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > > Class Template Reference
    \n \n
    \n \n

    Specialization of the StructuredGridFactory for YaspGrid<EquidistantOffsetCoordinates> \n More...

    \n \n-

    #include <dune/grid/yaspgrid/structuredyaspgridfactory.hh>

    \n+

    #include <dune/grid/yaspgrid/structuredyaspgridfactory.hh>

    \n

    \n Static Public Member Functions

    static std::unique_ptr< GridTypecreateCubeGrid (const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
     Create a structured cube grid.
     
    static std::unique_ptr< GridTypecreateSimplexGrid (const FieldVector< ctype, dimworld > &, const FieldVector< ctype, dimworld > &, const std::array< unsigned int, dim > &)
    \n \n \n \n \n \n@@ -199,15 +199,15 @@\n \n

    Create a structured simplex grid.

    \n
    Note
    Simplices are not supported in YaspGrid, so this functions unconditionally throws a GridError.
    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04376.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04376.html", "unified_diff": "@@ -78,15 +78,15 @@\n Public Types |\n Public Member Functions |\n List of all members\n
    Dune::Torus< Communication, d > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/yaspgrid/torus.hh>

    \n+

    #include <dune/grid/yaspgrid/torus.hh>

    \n
    \n Inheritance diagram for Dune::Torus< Communication, d >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1136,15 +1136,15 @@\n
    \n \n

    return tag used by torus

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04388.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04388.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::Torus< Communication, d >::ProcListIterator Class Reference
    \n \n

    \n Static Public Member Functions

    static std::unique_ptr< GridTypecreateCubeGrid (const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
     Create a structured cube grid.
     
    static std::unique_ptr< GridTypecreateSimplexGrid (const FieldVector< ctype, dimworld > &, const FieldVector< ctype, dimworld > &, const std::array< unsigned int, dim > &)
    \n \n \n \n \n \n@@ -346,15 +346,15 @@\n
    \n \n

    return rank of neighboring process

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04392.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04392.html", "unified_diff": "@@ -79,15 +79,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members\n
    Dune::YaspEntity< 0, dim, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/yaspgrid/yaspgridentity.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridentity.hh>

    \n
    \n Inheritance diagram for Dune::YaspEntity< 0, dim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1463,15 +1463,15 @@\n
    \n \n

    Know dimension of the 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04396.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04396.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::YaspEntity< 0, dim, GridImp >::Codim< cd > Struct Template Reference
    \n \n

    \n Public Member Functions

     ProcListIterator (typename std::deque< CommPartner >::const_iterator iter)
     make an iterator
     
    int rank () const
    \n \n \n \n

    \n Public Types

    typedef GridImp::template Codim< cd >::Entity Entity
     
    \n

    Member Typedef Documentation

    \n@@ -103,15 +103,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04400.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04400.html", "unified_diff": "@@ -79,15 +79,15 @@\n Static Public Attributes |\n Protected Attributes |\n List of all members \n
    Dune::YaspEntity< dim, dim, GridImp > Class Template Reference
    \n \n
    \n \n-

    #include <dune/grid/yaspgrid/yaspgridentity.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridentity.hh>

    \n
    \n Inheritance diagram for Dune::YaspEntity< dim, dim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -897,15 +897,15 @@\n
    \n \n

    Know dimension of the 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04404.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04404.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::YaspGeometry< mydim, mydim, GridImp > Class Template Reference
    \n \n
    \n \n

    specialize for dim=dimworld, i.e. a volume element \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridgeometry.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridgeometry.hh>

    \n
    \n Inheritance diagram for Dune::YaspGeometry< mydim, mydim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -198,15 +198,15 @@\n
    \n \n

    copy constructor (skipping temporary variables)

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04408.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04408.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::YaspGeometry< 0, cdim, GridImp > Class Template Reference
    \n \n
    \n \n

    specialization for dim=0, this is a vertex \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridgeometry.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridgeometry.hh>

    \n
    \n Inheritance diagram for Dune::YaspGeometry< 0, cdim, GridImp >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -201,15 +201,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04416.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04416.html", "unified_diff": "@@ -83,15 +83,15 @@\n
    Dune::PersistentContainer< YaspGrid< dim, CoordCont >, T > Class Template Reference
    \n \n
    \n \n

    Specialization of the PersistentContainer for YaspGrid. \n More...

    \n \n-

    #include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>

    \n+

    #include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>

    \n
    \n Inheritance diagram for Dune::PersistentContainer< YaspGrid< dim, CoordCont >, T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -816,15 +816,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04420.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04420.html", "unified_diff": "@@ -195,15 +195,15 @@\n

    \n

    together with an affine mapping.

    \n

    A YGrid is characterized by the following quantities:

    \n
      \n
    • The origin \"$,
    • \n
    • the size \"$,
    • \n
    • The shift \"$.
    • \n-
    • a coordinate container, that gives the mapping of the index to global coordinates (see coordinates.hh)
    • \n+
    • a coordinate container, that gives the mapping of the index to global coordinates (see coordinates.hh)
    • \n
    \n

    The shift can be used to interpret the points of a grid as midpoints of cells, faces, edges, etc.

    \n

    Here is a graphical illustration of a grid:

    \n
    \n \"\"/\n
    \n A YGrid.
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04473.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04473.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    // dune-geometry includes
    \n
    #include<dune/geometry/referenceelements.hh>
    \n
    #include<dune/geometry/quadraturerules.hh>
    \n
    // dune-grid includes
    \n \n
    \n
    \n-
    int main(int argc, char** argv)
    \n+
    int main(int argc, char** argv)
    \n
    {
    \n
    // Maybe initialize Mpi
    \n
    [[maybe_unused]] Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
    \n
    \n
    // [set up grid]
    \n
    const int dim = 4;
    \n
    using Grid = Dune::YaspGrid<dim>;
    \n@@ -143,15 +143,15 @@\n
    {
    \n
    auto geoI = I.geometry();
    \n
    divergence += f(geoI.center())*I.centerUnitOuterNormal()*geoI.volume();
    \n
    }
    \n
    }
    \n
    std::cout << "divergence = " << divergence << std::endl;
    \n
    }
    \n-
    int main(int argc, char **argv)
    Definition recipe-integration.cc:65
    \n+
    int main(int argc, char **argv)
    Definition recipe-integration.cc:65
    \n \n
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a04474.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a04474.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    #include<dune/common/parallel/mpihelper.hh>
    \n
    #include<dune/common/parametertreeparser.hh>
    \n
    #include<dune/common/timer.hh>
    \n
    // dune-grid includes
    \n \n
    \n
    \n-
    int main(int argc, char** argv)
    \n+
    int main(int argc, char** argv)
    \n
    {
    \n
    // Maybe initialize Mpi
    \n
    [[maybe_unused]] Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
    \n
    \n
    // [set up grid]
    \n
    const int dim = 4;
    \n
    using Grid = Dune::YaspGrid<dim>;
    \n@@ -118,15 +118,15 @@\n
    \n
    // [access to subentities]
    \n
    const int mycodim = 2;
    \n
    for (const auto& e : elements(gv))
    \n
    for (unsigned int i=0; i<e.subEntities(mycodim); ++i)
    \n
    [[maybe_unused]] auto v = e.template subEntity<codim>(i);
    \n
    }
    \n-
    int main(int argc, char **argv)
    Definition recipe-integration.cc:65
    \n+
    int main(int argc, char **argv)
    Definition recipe-integration.cc:65
    \n \n
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07097.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07097.html", "unified_diff": "@@ -78,15 +78,15 @@\n Namespaces \n
    backuprestore.hh File Reference
    \n \n
    \n
    #include <type_traits>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/grid/common/backuprestore.hh>
    \n-#include <dune/grid/geometrygrid/declaration.hh>
    \n+#include <dune/grid/geometrygrid/declaration.hh>
    \n #include <dune/grid/geometrygrid/capabilities.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07097_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07097_source.html", "unified_diff": "@@ -89,15 +89,15 @@\n
    6#define DUNE_GEOGRID_BACKUPRESTORE_HH
    \n
    7
    \n
    8#include <type_traits>
    \n
    9
    \n
    10#include <dune/common/exceptions.hh>
    \n \n
    12
    \n-\n+\n \n
    15
    \n
    16namespace Dune
    \n
    17{
    \n
    18
    \n
    \n
    19 namespace GeoGrid
    \n@@ -197,15 +197,15 @@\n
    99 }
    \n
    100 };
    \n
    \n
    101
    \n
    102} // namespace Dune
    \n
    103
    \n
    104#endif // #ifndef DUNE_GEOGRID_BACKUPRESTORE_HH
    \n-\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    facility for writing and reading grids
    Definition common/backuprestore.hh:43
    \n
    Grid abstract base class.
    Definition common/grid.hh:375
    \n
    Definition geometrygrid/backuprestore.hh:27
    \n
    Definition geometrygrid/backuprestore.hh:31
    \n
    const Grid & asImp() const
    Definition geometrygrid/backuprestore.hh:43
    \n
    BackupRestoreFacilities()
    Definition geometrygrid/backuprestore.hh:35
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07109.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07109.html", "unified_diff": "@@ -80,15 +80,15 @@\n \n
    \n
    #include <cassert>
    \n #include <type_traits>
    \n #include <utility>
    \n #include <dune/common/hybridutilities.hh>
    \n #include <dune/grid/common/capabilities.hh>
    \n-#include <dune/grid/geometrygrid/declaration.hh>
    \n+#include <dune/grid/geometrygrid/declaration.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GeoGrid::BackupRestoreFacilities< Grid, hasBackupRestoreFacilities >
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07109_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07109_source.html", "unified_diff": "@@ -91,15 +91,15 @@\n
    8#include <cassert>
    \n
    9#include <type_traits>
    \n
    10#include <utility>
    \n
    11
    \n
    12#include <dune/common/hybridutilities.hh>
    \n
    13
    \n \n-\n+\n
    16
    \n
    17namespace Dune
    \n
    18{
    \n
    19
    \n
    20 // Capabilities
    \n
    21 // ------------
    \n
    22
    \n@@ -248,15 +248,15 @@\n \n
    140
    \n
    141 } // namespace Capabilities
    \n
    142
    \n
    143} // namespace Dune
    \n
    144
    \n
    145#endif // #ifndef DUNE_GEOGRID_CAPABILITIES_HH
    \n-\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Specialize with 'true' for if the codimension 0 entity of the grid has only one possible geometry typ...
    Definition common/capabilities.hh:27
    \n
    static const bool v
    Definition common/capabilities.hh:28
    \n
    static const unsigned int topologyId
    Definition common/capabilities.hh:31
    \n
    Specialize with 'true' for all codims that a grid implements entities for. (default=false)
    Definition common/capabilities.hh:58
    \n
    static const bool v
    Definition common/capabilities.hh:59
    \n
    specialize with 'true' for all codims that a grid provides an iterator for (default=hasEntity<codim>:...
    Definition common/capabilities.hh:74
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07112.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07112.html", "unified_diff": "@@ -77,18 +77,18 @@\n Classes |\n Namespaces\n
    datahandle.hh File Reference
    \n \n

    \n Classes

    struct  Dune::Capabilities::hasSingleGeometryType< GeometryGrid< HostGrid, CoordFunction, Allocator > >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07112_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07112_source.html", "unified_diff": "@@ -88,18 +88,18 @@\n
    5#ifndef DUNE_ALBERTAGRIDDATAHANDLE_HH
    \n
    6#define DUNE_ALBERTAGRIDDATAHANDLE_HH
    \n
    7
    \n
    8#include <iostream>
    \n
    9
    \n \n
    11
    \n-\n+\n \n-\n-\n+\n+\n
    16
    \n
    17#if HAVE_ALBERTA
    \n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n
    22 namespace Alberta
    \n@@ -154,17 +154,17 @@\n
    63 }
    \n
    64
    \n
    65}
    \n
    66
    \n
    67#endif // #if HAVE_ALBERTA
    \n
    68
    \n
    69#endif
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n-
    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
    \n+
    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n+\n \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Definition albertagrid/datahandle.hh:27
    \n
    AdaptRestrictProlongHandler(Grid &grid, RestrictProlongOperator &rpOp)
    Definition albertagrid/datahandle.hh:42
    \n
    void restrictLocal(const Patch &patch, int i)
    Definition albertagrid/datahandle.hh:48
    \n
    void prolongLocal(const Patch &patch, int i)
    Definition albertagrid/datahandle.hh:55
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -73,20 +73,20 @@\n 63 }\n 64\n 65}\n 66\n 67#endif // #if HAVE_ALBERTA\n 68\n 69#endif\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n-misc.hh\n refinement.hh\n provides a wrapper for ALBERTA's refinement patches and the corners for\n geometryInFather\n+elementinfo.hh\n+provides a wrapper for ALBERTA's el_info structure\n+misc.hh\n albertaheader.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::Alberta::AdaptRestrictProlongHandler\n Definition albertagrid/datahandle.hh:27\n Dune::Alberta::AdaptRestrictProlongHandler::AdaptRestrictProlongHandler\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07127.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07127.html", "unified_diff": "@@ -81,15 +81,15 @@\n \n
    \n
    #include <dune-grid-config.hh>
    \n #include <cstdio>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/geometry/referenceelements.hh>
    \n #include <dune/grid/io/file/dgfparser/dgfparser.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>
    \n

    \n Classes

    class  Dune::Alberta::AdaptRestrictProlongHandler< Grid, RestrictProlongOperator >
     
    \n \n \n \n

    \n Classes

    class  Dune::DGFPrintInfo
     
    \n \n \n \n \n

    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07130.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07130.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    \n \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07130_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07130_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n \n \n
    12
    \n \n \n
    15
    \n \n-\n+\n
    18
    \n
    19#if HAVE_ALBERTA
    \n
    20
    \n
    21namespace Dune
    \n
    22{
    \n
    23
    \n
    24 // External Forward Declarations
    \n@@ -297,15 +297,15 @@\n
    186
    \n
    187}
    \n
    188
    \n
    189#endif // #if HAVE_ALBERTA
    \n
    190
    \n
    191#endif // #ifndef DUNE_ALBERTA_DGFPARSER_HH
    \n \n-\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Definition dgfgridfactory.hh:38
    \n
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n
    Entity inside() const
    return Entity on the inside of this intersection. That is the Entity where we started this.
    Definition common/intersection.hh:250
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07133.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07133.html", "unified_diff": "@@ -74,19 +74,19 @@\n \n
    \n
    dgfparser.hh File Reference
    \n
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07133_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07133_source.html", "unified_diff": "@@ -87,25 +87,25 @@\n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_DGFPARSER_HH
    \n
    6#define DUNE_DGFPARSER_HH
    \n
    7// include dgf parser
    \n \n
    9/* include the implementations */
    \n \n-
    11#include "dgfparser/dgfug.hh"
    \n-
    12#include "dgfparser/dgfoned.hh"
    \n-
    13#include "dgfparser/dgfyasp.hh"
    \n-\n-\n+
    11#include "dgfparser/dgfug.hh"
    \n+
    12#include "dgfparser/dgfoned.hh"
    \n+
    13#include "dgfparser/dgfyasp.hh"
    \n+\n+\n
    16#endif
    \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n \n \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -21,16 +21,16 @@\n 10#include \n 11#include \"dgfparser/dgfug.hh\"\n 12#include \"dgfparser/dgfoned.hh\"\n 13#include \"dgfparser/dgfyasp.hh\"\n 14#include \"dgfparser/dgfgeogrid.hh\"\n 15#include \"dgfparser/dgfidentitygrid.hh\"\n 16#endif\n-dgfidentitygrid.hh\n-dgfgeogrid.hh\n-dgfyasp.hh\n dgfug.hh\n dgfoned.hh\n+dgfidentitygrid.hh\n+dgfyasp.hh\n+dgfgeogrid.hh\n dgfparser.hh\n dgfparser.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07136.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07136.html", "unified_diff": "@@ -87,37 +87,37 @@\n #include <vector>
    \n #include <memory>
    \n #include <map>
    \n #include <assert.h>
    \n #include <cmath>
    \n #include <dune/common/parallel/mpihelper.hh>
    \n #include <dune/common/stdstreams.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n #include <dune/grid/common/datahandleif.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n-#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n-#include <dune/grid/io/file/dgfparser/parser.hh>
    \n-#include <dune/grid/io/file/dgfparser/gridptr.hh>
    \n-#include <dune/grid/io/file/dgfparser/macrogrid.hh>
    \n-#include <dune/grid/io/file/dgfparser/dgfgridfactory.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/boundaryseg.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/cube.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/dim.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/general.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/gridparameter.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/interval.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/polygon.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/polyhedron.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
    \n+#include <dune/grid/io/file/dgfparser/entitykey.hh>
    \n+#include <dune/grid/io/file/dgfparser/parser.hh>
    \n+#include <dune/grid/io/file/dgfparser/gridptr.hh>
    \n+#include <dune/grid/io/file/dgfparser/macrogrid.hh>
    \n+#include <dune/grid/io/file/dgfparser/dgfgridfactory.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/boundarydom.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/boundaryseg.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/cube.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/dim.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/general.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/gridparameter.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/interval.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/polygon.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/polyhedron.hh>
    \n #include <dune/grid/io/file/dgfparser/blocks/projection.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/simplex.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh>
    \n-#include <dune/grid/io/file/dgfparser/blocks/vertex.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/simplex.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh>
    \n+#include <dune/grid/io/file/dgfparser/blocks/vertex.hh>
    \n \n

    Go to the source code of this file.

    \n

    \n Classes

    struct  Dune::DGFGridFactory< AlbertaGrid< dim, dimworld > >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07136_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07136_source.html", "unified_diff": "@@ -99,40 +99,40 @@\n
    16#include <map>
    \n
    17#include <assert.h>
    \n
    18#include <cmath>
    \n
    19
    \n
    20//- Dune includes
    \n
    21#include <dune/common/parallel/mpihelper.hh>
    \n
    22#include <dune/common/stdstreams.hh>
    \n-\n+\n \n
    25
    \n-\n-\n+\n+\n
    28
    \n-\n-\n-\n-\n+\n+\n+\n+\n
    33
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n
    49
    \n
    50namespace Dune {
    \n
    51
    \n
    54 template <class GridType>
    \n
    \n \n
    56 {
    \n@@ -147,36 +147,36 @@\n
    742 tetrahedral grid for Dune::Alberta then the bisection routine does
    \n
    743 not necessarily terminate. This problem does not occur
    \n
    744 if the grid is constructed using the \\b Interval block.
    \n
    745 */
    \n
    746
    \n
    747} // end namespace Dune
    \n
    748#endif
    \n-\n+\n
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n
    static double refineWeight()
    \n
    static int refineStepsForHalf()
    number of globalRefine steps needed to refuce h by 0.5
    \n \n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -78,34 +78,34 @@\n 746\n 747} // end namespace Dune\n 748#endif\n gridenums.hh\n datahandleif.hh\n Describes the parallel communication interface class for MessageBuffers and\n DataHandles.\n-gridptr.hh\n-entitykey.hh\n-parser.hh\n-polygon.hh\n-interval.hh\n-polyhedron.hh\n-periodicfacetrans.hh\n-dim.hh\n+dgfgridfactory.hh\n simplex.hh\n+basic.hh\n vertex.hh\n gridparameter.hh\n-boundarydom.hh\n-general.hh\n+dim.hh\n simplexgeneration.hh\n-cube.hh\n+general.hh\n+interval.hh\n boundaryseg.hh\n-basic.hh\n-dgfgridfactory.hh\n-macrogrid.hh\n+cube.hh\n+periodicfacetrans.hh\n+polyhedron.hh\n+polygon.hh\n+boundarydom.hh\n+gridptr.hh\n dgfexception.hh\n+parser.hh\n+entitykey.hh\n+macrogrid.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::DGFGridInfo\n Some simple static information for a given GridType.\n Definition io/file/dgfparser/dgfparser.hh:56\n Dune::DGFGridInfo::refineWeight\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07139.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07139.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    entity.hh File Reference
    \n \n

    \n Classes

    struct  Dune::DGFGridInfo< GridType >
     Some simple static information for a given GridType. More...
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07139_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07139_source.html", "unified_diff": "@@ -86,15 +86,15 @@\n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_ENTITY_HH
    \n
    6#define DUNE_ALBERTA_ENTITY_HH
    \n
    7
    \n \n
    9
    \n-\n+\n \n \n
    13
    \n
    14#if HAVE_ALBERTA
    \n
    15
    \n
    16namespace Dune
    \n
    17{
    \n@@ -426,15 +426,15 @@\n \n
    401
    \n
    402} // namespace Dune
    \n
    403
    \n
    404#endif // #if HAVE_ALBERTA
    \n
    405
    \n
    406#endif // #ifndef DUNE_ALBERTA_ENTITY_HH
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n \n
    Definition treeiterator.hh:189
    \n
    Definition hierarchiciterator.hh:29
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07142.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07142.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    \n
    #include <type_traits>
    \n #include <dune/common/iteratorrange.hh>
    \n #include <dune/common/typetraits.hh>
    \n #include <dune/geometry/dimension.hh>
    \n #include <dune/geometry/referenceelements.hh>
    \n #include "grid.hh"
    \n-#include "rangegenerators.hh"
    \n+#include "rangegenerators.hh"
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07142_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07142_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    10#include <dune/common/iteratorrange.hh>
    \n
    11#include <dune/common/typetraits.hh>
    \n
    12
    \n
    13#include <dune/geometry/dimension.hh>
    \n
    14#include <dune/geometry/referenceelements.hh>
    \n
    15
    \n
    16#include "grid.hh"
    \n-
    17#include "rangegenerators.hh"
    \n+
    17#include "rangegenerators.hh"
    \n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n
    64 template<int cd, int dim, class GridImp, template<int,int,class> class EntityImp>
    \n
    \n
    65 class Entity
    \n@@ -484,15 +484,15 @@\n
    690 typedef typename GridImp::template Codim<cd>::Geometry Geo;
    \n
    691 return referenceElement< typename Geo::ctype, Geo::mydimension >(entity.type());
    \n
    692 }
    \n
    \n
    693}
    \n
    694
    \n
    695#endif // DUNE_GRID_COMMON_ENTITY_HH
    \n-\n+\n
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n
    const Implementation & impl() const
    access to the underlying implementation
    Definition common/entity.hh:86
    \n
    bool operator!=(const Entity &other) const
    Compares two entities for inequality.
    Definition common/entity.hh:176
    \n
    unsigned int subEntities(unsigned int codim) const
    Number of subentities for a given codimension.
    Definition common/entity.hh:159
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07145.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07145.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    entity.hh File Reference
    \n \n
    \n
    #include <concepts>
    \n #include <utility>
    \n #include <dune/common/rangeutilities.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n #include <dune/grid/concepts/geometry.hh>
    \n #include <dune/grid/concepts/archetypes/entity.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::Entity< cd, dim, GridImp, EntityImp >
     Wrapper class for entities. More...
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07145_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07145_source.html", "unified_diff": "@@ -89,15 +89,15 @@\n
    6#define DUNE_GRID_CONCEPT_ENTITY_HH
    \n
    7
    \n
    8#include <concepts>
    \n
    9#include <utility>
    \n
    10
    \n
    11#include <dune/common/rangeutilities.hh>
    \n
    12#include <dune/geometry/type.hh>
    \n-\n+\n \n \n
    16
    \n
    17namespace Dune::Concept {
    \n
    18
    \n
    24template<class S>
    \n
    \n@@ -174,15 +174,15 @@\n
    106template<class E>
    \n
    107concept Entity = EntityGeneral<E> && ((E::codimension != 0) || EntityExtended<E>);
    \n
    108
    \n
    109} // end namespace Dune::Concept
    \n
    110
    \n
    111
    \n
    112#endif // DUNE_GRID_CONCEPT_ENTITY_HH
    \n-\n+\n
    Definition concepts/datahandle.hh:14
    \n
    Model of an entity seed.
    Definition concepts/entity.hh:25
    \n
    Model of a grid entity for any codimension.
    Definition concepts/entity.hh:40
    \n
    Model of a grid entity with extended requirements for codimension 0.
    Definition concepts/entity.hh:77
    \n
    Model of a grid entity.
    Definition concepts/entity.hh:107
    \n
    Model of a geometry object.
    Definition concepts/geometry.hh:29
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07148.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07148.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    \n \n
    \n
    entity.hh File Reference
    \n
    \n \n \n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07148_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07148_source.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_CONCEPT_ARCHETYPES_ENTITY_HH
    \n
    6#define DUNE_GRID_CONCEPT_ARCHETYPES_ENTITY_HH
    \n
    7
    \n
    8#include <dune/geometry/type.hh>
    \n-\n+\n \n \n
    12
    \n
    13#ifndef DOXYGEN
    \n
    14namespace Dune::Concept::Archetypes {
    \n
    15
    \n
    16template <int codim>
    \n@@ -128,15 +128,15 @@\n
    45 bool operator!= (Entity const& entity) const;
    \n
    46};
    \n
    47
    \n
    48} // end namespace Dune::Concept::Archetypes
    \n
    49#endif // DOXYGEN
    \n
    50
    \n
    51#endif // DUNE_GRID_CONCEPT_ARCHETYPES_ENTITY_HH
    \n-\n+\n
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n \n \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07151.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07151.html", "unified_diff": "@@ -78,15 +78,15 @@\n Namespaces \n
    entity.hh File Reference
    \n \n

    \n Namespaces

    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07151_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07151_source.html", "unified_diff": "@@ -88,15 +88,15 @@\n
    5#ifndef DUNE_GEOGRID_ENTITY_HH
    \n
    6#define DUNE_GEOGRID_ENTITY_HH
    \n
    7
    \n
    8#include <dune/geometry/referenceelements.hh>
    \n
    9
    \n \n \n-\n+\n
    13
    \n
    14namespace Dune
    \n
    15{
    \n
    16
    \n
    17 namespace GeoGrid
    \n
    18 {
    \n
    19
    \n@@ -823,15 +823,15 @@\n \n
    869
    \n
    870 } // namespace GeoGrid
    \n
    871
    \n
    872} // namespace Dune
    \n
    873
    \n
    874#endif // #ifndef DUNE_GEOGRID_ENTITY_HH
    \n-\n+\n
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n
    @ FrontEntity
    on boundary between overlap and ghost
    Definition gridenums.hh:34
    \n
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n
    @ OverlapEntity
    all entities lying in the overlap zone
    Definition gridenums.hh:33
    \n
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07154.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07154.html", "unified_diff": "@@ -75,16 +75,16 @@\n
    \n \n
    entityseed.hh File Reference
    \n
    \n

    \n Classes

    class  Dune::GeoGrid::EntityBase< codim, Grid, false >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07154_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07154_source.html", "unified_diff": "@@ -84,16 +84,16 @@\n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_ENTITYSEED_HH
    \n
    6#define DUNE_ALBERTA_ENTITYSEED_HH
    \n
    7
    \n-\n-\n+\n+\n
    10
    \n
    11namespace Dune
    \n
    12{
    \n
    13
    \n
    14 // Internal Forward Declarations
    \n
    15 // -----------------------------
    \n
    16
    \n@@ -211,16 +211,16 @@\n
    \n
    113
    \n
    114#endif // #if HAVE_ALBERTA
    \n
    115
    \n
    116} // end namespace Dune
    \n
    117
    \n
    118#endif // #ifndef DUNE_ALBERTA_ENTITYSEED_HH
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-
    provides a wrapper for ALBERTA's mesh structure
    \n+
    provides a wrapper for ALBERTA's mesh structure
    \n+
    provides a wrapper for ALBERTA's el_info structure
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n \n \n
    Definition albertagrid/entityseed.hh:18
    \n
    ElementInfo elementInfo(const MeshPointer &mesh) const
    Definition albertagrid/entityseed.hh:65
    \n
    AlbertaGridEntitySeed(const ElementInfo &elementInfo, int subEntity)
    Definition albertagrid/entityseed.hh:55
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -124,18 +124,18 @@\n 112 };\n 113\n 114#endif // #if HAVE_ALBERTA\n 115\n 116} // end namespace Dune\n 117\n 118#endif // #ifndef DUNE_ALBERTA_ENTITYSEED_HH\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n meshpointer.hh\n provides a wrapper for ALBERTA's mesh structure\n+elementinfo.hh\n+provides a wrapper for ALBERTA's el_info structure\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::AlbertaGrid\n [ provides Dune::Grid ]\n Definition agrid.hh:109\n Dune::Alberta::MeshPointer<_dimension_>\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07163.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07163.html", "unified_diff": "@@ -76,16 +76,16 @@\n \n
    geometry.hh File Reference
    \n \n

    \n Classes

    class  Dune::AlbertaGridEntitySeed< codim, const AlbertaGrid< dim, dimworld > >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07163_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07163_source.html", "unified_diff": "@@ -85,16 +85,16 @@\n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_GEOMETRY_HH
    \n
    6#define DUNE_ALBERTA_GEOMETRY_HH
    \n
    7
    \n \n-\n-\n+\n+\n
    11
    \n
    12#if HAVE_ALBERTA
    \n
    13
    \n
    14namespace Dune
    \n
    15{
    \n
    16
    \n
    17 // Forward Declarations
    \n@@ -690,16 +690,16 @@\n \n
    589
    \n
    590} // namespace Dune
    \n
    591
    \n
    592#endif // #if HAVE_ALBERTA
    \n
    593
    \n
    594#endif // #ifndef DUNE_ALBERTA_GEOMETRY_HH
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n+
    provides a wrapper for ALBERTA's el_info structure
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n
    static K determinant(const FieldMatrix< K, 0, m > &matrix)
    Definition algebra.hh:30
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07175.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07175.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    \n
    #include <utility>
    \n #include <dune/common/typetraits.hh>
    \n #include <dune/geometry/multilineargeometry.hh>
    \n #include <dune/geometry/referenceelements.hh>
    \n #include <dune/geometry/type.hh>
    \n #include <dune/grid/common/capabilities.hh>
    \n-#include <dune/grid/geometrygrid/cornerstorage.hh>
    \n+#include <dune/grid/geometrygrid/cornerstorage.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    struct  Dune::AlbertaGridCoordinateReader< codim, GridImp >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07175_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07175_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    10#include <dune/common/typetraits.hh>
    \n
    11
    \n
    12#include <dune/geometry/multilineargeometry.hh>
    \n
    13#include <dune/geometry/referenceelements.hh>
    \n
    14#include <dune/geometry/type.hh>
    \n
    15
    \n \n-\n+\n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n
    22 namespace GeoGrid
    \n
    23 {
    \n
    24
    \n@@ -333,15 +333,15 @@\n \n
    221
    \n
    222 } // namespace GeoGrid
    \n
    223
    \n
    224} // namespace Dune
    \n
    225
    \n
    226#endif // #ifndef DUNE_GEOGRID_GEOMETRY_HH
    \n-\n+\n
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Grid abstract base class.
    Definition common/grid.hh:375
    \n
    Definition cornerstorage.hh:22
    \n
    Definition cornerstorage.hh:174
    \n
    Definition geometrygrid/geometry.hh:30
    \n
    static const unsigned int topologyId
    Definition geometrygrid/geometry.hh:37
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07178.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07178.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    #include <algorithm>
    \n #include <array>
    \n #include <limits>
    \n #include <map>
    \n #include <memory>
    \n #include <dune/geometry/referenceelements.hh>
    \n #include <dune/grid/common/gridfactory.hh>
    \n-#include <dune/grid/albertagrid/agrid.hh>
    \n+#include <dune/grid/albertagrid/agrid.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    struct  Dune::GeoGrid::InferHasSingleGeometryType< hasSingleGeometryType, dim, mydim >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07178_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07178_source.html", "unified_diff": "@@ -95,15 +95,15 @@\n
    17#include <map>
    \n
    18#include <memory>
    \n
    19
    \n
    20#include <dune/geometry/referenceelements.hh>
    \n
    21
    \n \n
    23
    \n-\n+\n
    25
    \n
    26#if HAVE_ALBERTA
    \n
    27
    \n
    28namespace Dune
    \n
    29{
    \n
    30
    \n
    48 template< int dim, int dimworld >
    \n@@ -557,15 +557,15 @@\n \n
    542
    \n
    543}
    \n
    544
    \n
    545#endif // #if HAVE_ALBERTA
    \n
    546
    \n
    547#endif // #ifndef DUNE_ALBERTA_GRIDFACTORY_HH
    \n-
    provides the AlbertaGrid class
    \n+
    provides the AlbertaGrid class
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    ALBERTA REAL_DD GlobalMatrix
    Definition misc.hh:51
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n
    int generic2alberta(int codim, int i) const
    Definition agrid.hh:487
    \n
    GridFamily::ctype ctype
    Definition agrid.hh:143
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07181.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07181.html", "unified_diff": "@@ -83,15 +83,15 @@\n

    Provide a generic factory class for unstructured grids. \n More...

    \n
    #include <memory>
    \n #include <vector>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/common/parallel/mpihelper.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/boundarysegment.hh>
    \n+#include <dune/grid/common/boundarysegment.hh>
    \n #include <dune/grid/common/grid.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GridFactory< AlbertaGrid< dim, dimworld > >
     specialization of the generic GridFactory for AlbertaGrid More...
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07181_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07181_source.html", "unified_diff": "@@ -92,15 +92,15 @@\n
    13#include <vector>
    \n
    14
    \n
    15#include <dune/common/fvector.hh>
    \n
    16#include <dune/common/parallel/mpihelper.hh>
    \n
    17
    \n
    18#include <dune/geometry/type.hh>
    \n
    19
    \n-\n+\n \n
    22
    \n
    23namespace Dune
    \n
    24{
    \n
    25
    \n
    68 template <class GridType>
    \n
    \n@@ -255,15 +255,15 @@\n
    336
    \n
    337 };
    \n
    \n
    338
    \n
    339}
    \n
    340
    \n
    341#endif
    \n-
    Base class for grid boundary segments of arbitrary geometry.
    \n+
    Base class for grid boundary segments of arbitrary geometry.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n
    Provide a generic factory class for unstructured grids.
    Definition common/gridfactory.hh:70
    \n
    virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices, const std::shared_ptr< BoundarySegment< dimension, dimworld > > &boundarySegment)
    insert an arbitrarily shaped boundary segment
    Definition common/gridfactory.hh:153
    \n
    virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
    obtain an element's insertion index
    Definition common/gridfactory.hh:181
    \n
    virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)=0
    Insert an element into the coarse grid.
    \n
    virtual std::unique_ptr< GridType > createGrid()=0
    Finalize grid creation and hand over the grid.
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07184.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07184.html", "unified_diff": "@@ -84,17 +84,17 @@\n More...

    \n \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GridFactoryInterface< GridType >
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07184_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07184_source.html", "unified_diff": "@@ -92,17 +92,17 @@\n
    14
    \n \n \n \n \n \n
    20
    \n-\n+\n \n-\n+\n
    24
    \n
    25#if HAVE_ALBERTA
    \n
    26
    \n
    27namespace Dune
    \n
    28{
    \n
    29
    \n
    30 // External Forward Declarations
    \n@@ -236,16 +236,16 @@\n \n
    151
    \n
    152}
    \n
    153
    \n
    154#endif // #if HAVE_ALBERTA
    \n
    155
    \n
    156#endif // #ifndef DUNE_ALBERTAGRID_GRIDFAMILTY_HH
    \n-\n-
    Wrapper and interface classes for element geometries.
    \n+
    Wrapper and interface classes for element geometries.
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    ALBERTA REAL Real
    Definition misc.hh:48
    \n \n
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    Definition hierarchiciterator.hh:29
    \n
    Definition albertagrid/intersection.hh:105
    \n
    Definition albertagrid/intersectioniterator.hh:27
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -170,17 +170,17 @@\n 150 };\n 151\n 152}\n 153\n 154#endif // #if HAVE_ALBERTA\n 155\n 156#endif // #ifndef DUNE_ALBERTAGRID_GRIDFAMILTY_HH\n-misc.hh\n geometryreference.hh\n Wrapper and interface classes for element geometries.\n+misc.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::Alberta::Real\n ALBERTA REAL Real\n Definition misc.hh:48\n Dune::AlbertaGrid<_dim,_dimworld_>\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07187.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07187.html", "unified_diff": "@@ -77,22 +77,22 @@\n Classes |\n Namespaces \n
    gridfamily.hh File Reference
    \n \n

    \n Classes

    struct  Dune::AlbertaGridFamily< dim, dimworld >
     
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07187_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07187_source.html", "unified_diff": "@@ -86,22 +86,22 @@\n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GEOGRID_GRIDFAMILY_HH
    \n
    6#define DUNE_GEOGRID_GRIDFAMILY_HH
    \n
    7
    \n \n \n-\n+\n \n \n \n \n \n \n-\n+\n \n \n
    20
    \n
    21namespace Dune
    \n
    22{
    \n
    23
    \n
    27 namespace GeoGrid
    \n@@ -206,17 +206,17 @@\n \n
    117
    \n
    118 } // namespace GeoGrid
    \n
    119
    \n
    120} // namespace Dune
    \n
    121
    \n
    122#endif // #ifndef DUNE_GEOGRID_GRIDFAMILY_HH
    \n-\n+\n+\n \n-\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n
    interface class for an iterator over grid entities
    Definition common/entityiterator.hh:32
    \n
    Store a reference to an entity with a minimal memory footprint.
    Definition common/entityseed.hh:26
    \n
    Wrapper class for geometries.
    Definition common/geometry.hh:71
    \n
    Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
    Definition common/intersectioniterator.hh:83
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -146,16 +146,16 @@\n 117\n 118 } // namespace GeoGrid\n 119\n 120} // namespace Dune\n 121\n 122#endif // #ifndef DUNE_GEOGRID_GRIDFAMILY_HH\n declaration.hh\n-idset.hh\n iterator.hh\n+idset.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::Intersection\n Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n element or with the d...\n Definition common/intersection.hh:164\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07193.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07193.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    \n
    #include <typeinfo>
    \n #include <dune/common/std/type_traits.hh>
    \n #include <dune/common/iteratorrange.hh>
    \n #include <dune/common/parallel/future.hh>
    \n #include <dune/geometry/type.hh>
    \n #include <dune/grid/common/datahandleif.hh>
    \n-#include <dune/grid/common/rangegenerators.hh>
    \n+#include <dune/grid/common/rangegenerators.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07193_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07193_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    10#include <dune/common/std/type_traits.hh>
    \n
    11#include <dune/common/iteratorrange.hh>
    \n
    12#include <dune/common/parallel/future.hh>
    \n
    13
    \n
    14#include <dune/geometry/type.hh>
    \n
    15
    \n \n-\n+\n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n
    22 template< int, int, class, class >
    \n
    23 class GridDefaultImplementation;
    \n
    24
    \n@@ -379,15 +379,15 @@\n
    352 };
    \n \n
    353
    \n
    354} // namespace Dune
    \n
    355
    \n
    356#endif // #ifndef DUNE_GRID_COMMON_GRIDVIEW_HH
    \n
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n-\n+\n
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    const IndexSet & indexSet() const
    obtain the index set
    Definition common/gridview.hh:177
    \n
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n
    ThisType & operator=(const ThisType &other)
    assignment operator
    Definition common/gridview.hh:158
    \n
    Codim< cd >::Iterator begin() const
    obtain begin iterator for this view
    Definition common/gridview.hh:230
    \n
    const Grid & grid() const
    obtain a const reference to the underlying hierarchic grid
    Definition common/gridview.hh:166
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07196.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07196.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    gridview.hh File Reference
    \n \n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07196_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07196_source.html", "unified_diff": "@@ -89,15 +89,15 @@\n
    6#define DUNE_GRID_CONCEPTS_GRIDVIEW_HH
    \n
    7
    \n
    8#include <concepts>
    \n
    9#include <cstddef>
    \n
    10#include <utility>
    \n
    11
    \n \n-\n+\n \n \n \n \n \n \n
    20
    \n@@ -187,15 +187,15 @@\n
    108 Impl::gridViewAllCodims<GV>(range(from, to).to_integer_sequence());
    \n
    109};
    \n
    \n
    110
    \n
    111} // end namespace Dune::Concept
    \n
    112
    \n
    113#endif // DUNE_GRID_CONCEPTS_GRIDVIEW_HH
    \n-\n+\n
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    Definition concepts/datahandle.hh:14
    \n
    specialize with 'true' for all codims that a grid provides an iterator for (default=hasEntity<codim>:...
    Definition common/capabilities.hh:74
    \n
    Model of a grid view.
    Definition concepts/gridview.hh:81
    \n
    Model of an index set.
    Definition concepts/indexidset.hh:44
    \n
    Model of an intersection.
    Definition concepts/intersection.hh:23
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07199.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07199.html", "unified_diff": "@@ -83,15 +83,15 @@\n #include <dune/common/exceptions.hh>
    \n #include <dune/grid/common/capabilities.hh>
    \n #include <dune/grid/common/gridview.hh>
    \n #include <dune/grid/geometrygrid/datahandle.hh>
    \n #include <dune/grid/geometrygrid/indexsets.hh>
    \n #include <dune/grid/geometrygrid/intersection.hh>
    \n #include <dune/grid/geometrygrid/intersectioniterator.hh>
    \n-#include <dune/grid/geometrygrid/iterator.hh>
    \n+#include <dune/grid/geometrygrid/iterator.hh>
    \n \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GridView< ViewTraits >
     Grid view abstract base class. More...
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07199_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07199_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    10
    \n \n \n \n \n \n \n-\n+\n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n
    22 namespace GeoGrid
    \n
    23 {
    \n
    24
    \n@@ -370,15 +370,15 @@\n \n
    240
    \n
    241 } // namespace GeoGrid
    \n
    242
    \n
    243} // namespace Dune
    \n
    244
    \n
    245#endif // #ifndef DUNE_GEOGRID_GRIDVIEW_HH
    \n-\n+\n
    CommunicationDirection
    Define a type for communication direction parameter.
    Definition gridenums.hh:170
    \n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    interface class for an iterator over grid entities
    Definition common/entityiterator.hh:32
    \n
    Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
    Definition common/intersectioniterator.hh:83
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07202.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07202.html", "unified_diff": "@@ -82,19 +82,19 @@\n
    \n
    #include <array>
    \n #include <utility>
    \n #include <dune/common/hybridutilities.hh>
    \n #include <dune/common/stdstreams.hh>
    \n #include <dune/grid/common/grid.hh>
    \n #include <dune/grid/common/indexidset.hh>
    \n-#include <dune/grid/albertagrid/indexstack.hh>
    \n-#include <dune/grid/albertagrid/misc.hh>
    \n-#include <dune/grid/albertagrid/dofadmin.hh>
    \n-#include <dune/grid/albertagrid/dofvector.hh>
    \n-#include <dune/grid/albertagrid/elementinfo.hh>
    \n+#include <dune/grid/albertagrid/indexstack.hh>
    \n+#include <dune/grid/albertagrid/misc.hh>
    \n+#include <dune/grid/albertagrid/dofadmin.hh>
    \n+#include <dune/grid/albertagrid/dofvector.hh>
    \n+#include <dune/grid/albertagrid/elementinfo.hh>
    \n #include <dune/grid/albertagrid/gridfamily.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GeoGrid::GridViewTraits< HGV, CoordFunction, Allocator >
     
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07202_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07202_source.html", "unified_diff": "@@ -93,19 +93,19 @@\n
    10
    \n
    11#include <dune/common/hybridutilities.hh>
    \n
    12#include <dune/common/stdstreams.hh>
    \n
    13
    \n \n \n
    16
    \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n \n
    23
    \n
    24#if HAVE_ALBERTA
    \n
    25
    \n
    26namespace Dune
    \n
    27{
    \n
    28
    \n@@ -705,19 +705,19 @@\n \n
    586
    \n
    587} // namespace Dune
    \n
    588
    \n
    589#endif // #if HAVE_ALBERTA
    \n
    590
    \n
    591#endif // #ifndef DUNE_ALBERTAGRIDINDEXSETS_HH
    \n-\n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n-
    Provides an index stack that supplies indices for element numbering for a grid (i....
    \n-\n+\n+
    provides a wrapper for ALBERTA's el_info structure
    \n+
    Provides an index stack that supplies indices for element numbering for a grid (i....
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Dune::IndexStack< int, 100000 > IndexStack
    Definition albertagrid/indexsets.hh:31
    \n
    ALBERTA EL Element
    Definition misc.hh:54
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n
    static const int dimension
    Definition agrid.hh:145
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -596,18 +596,18 @@\n 588\n 589#endif // #if HAVE_ALBERTA\n 590\n 591#endif // #ifndef DUNE_ALBERTAGRIDINDEXSETS_HH\n dofadmin.hh\n elementinfo.hh\n provides a wrapper for ALBERTA's el_info structure\n-misc.hh\n indexstack.hh\n Provides an index stack that supplies indices for element numbering for a grid\n (i....\n+misc.hh\n dofvector.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::Alberta::IndexStack\n Dune::IndexStack< int, 100000 > IndexStack\n Definition albertagrid/indexsets.hh:31\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07205.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07205.html", "unified_diff": "@@ -77,17 +77,17 @@\n Classes |\n Namespaces \n
    indexsets.hh File Reference
    \n \n
    \n
    #include <vector>
    \n #include <dune/common/typetraits.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n #include <dune/grid/common/indexidset.hh>
    \n-#include <dune/grid/geometrygrid/declaration.hh>
    \n+#include <dune/grid/geometrygrid/declaration.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07205_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07205_source.html", "unified_diff": "@@ -88,18 +88,18 @@\n
    5#ifndef DUNE_GEOGRID_INDEXSETS_HH
    \n
    6#define DUNE_GEOGRID_INDEXSETS_HH
    \n
    7
    \n
    8#include <vector>
    \n
    9
    \n
    10#include <dune/common/typetraits.hh>
    \n
    11
    \n-\n+\n \n
    14
    \n-\n+\n
    16
    \n
    17namespace Dune
    \n
    18{
    \n
    19
    \n
    20 namespace GeoGrid
    \n
    21 {
    \n
    22
    \n@@ -200,16 +200,16 @@\n \n
    104
    \n
    105 } // namespace GeoGrid
    \n
    106
    \n
    107} // namespace Dune
    \n
    108
    \n
    109#endif // #ifndef DUNE_GEOGRID_INDEXSETS_HH
    \n-\n-\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n
    IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
    Map a subentity to an index.
    Definition common/indexidset.hh:153
    \n
    IndexType index(const typename Traits::template Codim< cc >::Entity &e) const
    Map entity to index. The result of calling this method with an entity that is not in the index set is...
    Definition common/indexidset.hh:113
    \n
    Export the type of the entity used as parameter in the index(...) method.
    Definition common/indexidset.hh:87
    \n
    DUNE-conform implementation of the entity.
    Definition geometrygrid/entity.hh:694
    \n
    Definition geometrygrid/indexsets.hh:29
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07208.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07208.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Namespaces \n
    intersection.hh File Reference
    \n \n

    \n Classes

    class  Dune::GeoGrid::IndexSet< Grid, HostIndexSet >
     
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07208_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07208_source.html", "unified_diff": "@@ -87,15 +87,15 @@\n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_INTERSECTION_HH
    \n
    6#define DUNE_ALBERTA_INTERSECTION_HH
    \n
    7
    \n \n
    9
    \n \n-\n+\n \n
    13
    \n
    14#if HAVE_ALBERTA
    \n
    15
    \n
    16namespace Dune
    \n
    17{
    \n
    18
    \n@@ -273,16 +273,16 @@\n \n
    185
    \n
    186} // namespace Dune
    \n
    187
    \n
    188#endif // #if HAVE_ALBERTA
    \n
    189
    \n
    190#endif // #ifndef DUNE_ALBERTA_INTERSECTION_HH
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n \n+
    provides a wrapper for ALBERTA's el_info structure
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n \n
    int twistInNeighbor(int face) const
    Definition elementinfo.hh:612
    \n
    Definition albertagrid/intersection.hh:105
    \n
    LocalGeometry geometryInOutside() const
    Definition intersection.cc:402
    \n
    GridImp::template Codim< 0 >::Entity outside() const
    Definition intersection.cc:365
    \n
    AlbertaGridLeafIntersection(const This &other)
    Definition albertagrid/intersection.hh:146
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -206,17 +206,17 @@\n 184 };\n 185\n 186} // namespace Dune\n 187\n 188#endif // #if HAVE_ALBERTA\n 189\n 190#endif // #ifndef DUNE_ALBERTA_INTERSECTION_HH\n+transformation.hh\n elementinfo.hh\n provides a wrapper for ALBERTA's el_info structure\n-transformation.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::Alberta::ElementInfo<_dimension_>\n Dune::Alberta::ElementInfo::twistInNeighbor\n int twistInNeighbor(int face) const\n Definition elementinfo.hh:612\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07217.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07217.html", "unified_diff": "@@ -75,16 +75,16 @@\n
    \n \n
    intersection.hh File Reference
    \n
    \n

    \n Classes

    class  Dune::AlbertaGridIntersectionBase< Grid >
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07217_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07217_source.html", "unified_diff": "@@ -84,16 +84,16 @@\n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GEOGRID_INTERSECTION_HH
    \n
    6#define DUNE_GEOGRID_INTERSECTION_HH
    \n
    7
    \n-\n-\n+\n+\n
    10
    \n
    11namespace Dune
    \n
    12{
    \n
    13
    \n
    14 namespace GeoGrid
    \n
    15 {
    \n
    16
    \n@@ -304,16 +304,16 @@\n
    \n
    186
    \n
    187 } // namespace GeoGrid
    \n
    188
    \n
    189} // namespace Dune
    \n
    190
    \n
    191#endif // #ifndef DUNE_GEOGRID_INTERSECTION_HH
    \n-\n-\n+\n+\n
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
    Definition common/geometry.hh:558
    \n
    Grid abstract base class.
    Definition common/grid.hh:375
    \n
    Definition cornerstorage.hh:123
    \n
    Definition geometrygrid/intersection.hh:22
    \n
    FieldVector< ctype, dimensionworld > integrationOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
    Definition geometrygrid/intersection.hh:126
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -206,16 +206,16 @@\n 185 };\n 186\n 187 } // namespace GeoGrid\n 188\n 189} // namespace Dune\n 190\n 191#endif // #ifndef DUNE_GEOGRID_INTERSECTION_HH\n-cornerstorage.hh\n declaration.hh\n+cornerstorage.hh\n std\n STL namespace.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::referenceElement\n auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo)\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07232.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07232.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    persistentcontainer.hh File Reference
    \n \n

    \n Classes

    class  Dune::GeoGrid::Intersection< Grid, HostIntersection >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07232_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07232_source.html", "unified_diff": "@@ -87,15 +87,15 @@\n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_PERSISTENTCONTAINER_HH
    \n
    6#define DUNE_ALBERTA_PERSISTENTCONTAINER_HH
    \n
    7
    \n \n
    9
    \n
    10#if HAVE_ALBERTA
    \n-\n+\n
    12
    \n
    13namespace Dune
    \n
    14{
    \n
    15
    \n
    16 // PersistentContainer for AlbertaGrid
    \n
    17 // -----------------------------------
    \n
    18
    \n@@ -119,15 +119,15 @@\n \n
    33
    \n
    34} // end namespace Dune
    \n
    35
    \n
    36#endif // #if HAVE_ALBERTA
    \n
    37
    \n
    38#endif // #ifndef DUNE_ALU_PERSISTENTCONTAINER_HH
    \n-\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n
    PersistentContainer(const Grid &grid, int codim, const Value &value=Value())
    Definition albertagrid/persistentcontainer.hh:29
    \n
    Base::Grid Grid
    Definition albertagrid/persistentcontainer.hh:26
    \n
    Base::Value Value
    Definition albertagrid/persistentcontainer.hh:27
    \n
    A class for storing data during an adaptation cycle.
    Definition utility/persistentcontainer.hh:22
    \n
    Base::Value Value
    Definition utility/persistentcontainer.hh:27
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07235.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07235.html", "unified_diff": "@@ -75,17 +75,17 @@\n
    \n \n
    persistentcontainer.hh File Reference
    \n
    \n

    \n Classes

    class  Dune::PersistentContainer< AlbertaGrid< dim, dimworld >, T >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07235_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07235_source.html", "unified_diff": "@@ -84,17 +84,17 @@\n Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GEOGRID_PERSISTENTCONTAINER_HH
    \n
    6#define DUNE_GEOGRID_PERSISTENTCONTAINER_HH
    \n
    7
    \n-\n+\n \n-\n+\n
    11
    \n
    12namespace Dune
    \n
    13{
    \n
    14
    \n
    15 // PersistentContainer for GeometryGrid
    \n
    16 // ------------------------------------
    \n
    17
    \n@@ -116,16 +116,16 @@\n
    \n
    31 };
    \n \n
    32
    \n
    33} // namespace Dune
    \n
    34
    \n
    35#endif // #ifndef DUNE_GEOGRID_PERSISTENTCONTAINER_HH
    \n-\n-\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    grid wrapper replacing the geometries
    Definition geometrygrid/grid.hh:86
    \n
    Base::Value Value
    Definition geometrygrid/persistentcontainer.hh:26
    \n
    Base::Grid Grid
    Definition geometrygrid/persistentcontainer.hh:25
    \n
    PersistentContainer(const Grid &grid, int codim, const Value &value=Value())
    Definition geometrygrid/persistentcontainer.hh:28
    \n
    A class for storing data during an adaptation cycle.
    Definition utility/persistentcontainer.hh:22
    \n
    Base::Value Value
    Definition utility/persistentcontainer.hh:27
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07238.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07238.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Namespaces |\n Functions \n
    persistentcontainer.hh File Reference
    \n \n

    \n Classes

    class  Dune::PersistentContainer< GeometryGrid< HostGrid, CoordFunction, Allocator >, T >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07238_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07238_source.html", "unified_diff": "@@ -86,15 +86,15 @@\n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_PERSISTENTCONTAINER_HH
    \n
    6#define DUNE_PERSISTENTCONTAINER_HH
    \n
    7
    \n
    8#include <map>
    \n
    9
    \n-\n+\n
    11
    \n
    12namespace Dune
    \n
    13{
    \n
    14
    \n
    19 template< class G, class T >
    \n
    \n \n@@ -172,15 +172,15 @@\n
    85 a.swap( b );
    \n
    86 }
    \n
    \n
    87
    \n
    88} // namespace std
    \n
    89
    \n
    90#endif // #ifndef DUNE_PERSISTENTCONTAINER_HH
    \n-\n+\n
    STL namespace.
    \n
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    A class for storing data during an adaptation cycle.
    Definition utility/persistentcontainer.hh:22
    \n
    Base::Value Value
    Definition utility/persistentcontainer.hh:27
    \n
    Base::Grid Grid
    Definition utility/persistentcontainer.hh:26
    \n
    PersistentContainer(const Grid &grid, int codim, const Value &value=Value())
    Definition utility/persistentcontainer.hh:29
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07241.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07241.html", "unified_diff": "@@ -76,17 +76,17 @@\n \n
    projection.hh File Reference
    \n \n

    \n Classes

    class  Dune::PersistentContainer< G, T >
     A class for storing data during an adaptation cycle. More...
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07241_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07241_source.html", "unified_diff": "@@ -86,18 +86,18 @@\n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_NODEPROJECTION_HH
    \n
    6#define DUNE_ALBERTA_NODEPROJECTION_HH
    \n
    7
    \n
    8#include <memory>
    \n
    9
    \n-\n+\n
    11
    \n-\n-\n+\n+\n
    14
    \n
    15#if HAVE_ALBERTA
    \n
    16
    \n
    17namespace Dune
    \n
    18{
    \n
    19
    \n
    20 namespace Alberta
    \n@@ -401,17 +401,17 @@\n
    270 }
    \n
    271
    \n
    272}
    \n
    273
    \n
    274#endif // #if HAVE_ALBERTA
    \n
    275
    \n
    276#endif // #ifndef DUNE_ALBERTA_NODEPROJECTION_HH
    \n-\n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n+\n+
    provides a wrapper for ALBERTA's el_info structure
    \n+\n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    ALBERTA REAL_B LocalVector
    Definition misc.hh:49
    \n
    static const int dimWorld
    Definition misc.hh:46
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n \n
    static ElementInfo createFake(const MeshPointer &mesh, const Element *element, int level, int type=0)
    Definition elementinfo.hh:752
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07244.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07244.html", "unified_diff": "@@ -77,16 +77,16 @@\n Classes |\n Namespaces |\n Functions \n
    projection.hh File Reference
    \n \n

    \n Classes

    class  Dune::Alberta::DuneBoundaryProjection< dim >
     
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07244_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07244_source.html", "unified_diff": "@@ -86,16 +86,16 @@\n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_DGF_PROJECTIONBLOCK_HH
    \n
    6#define DUNE_DGF_PROJECTIONBLOCK_HH
    \n
    7
    \n
    8#include <map>
    \n
    9
    \n-\n-\n+\n+\n
    12
    \n
    13namespace Dune
    \n
    14{
    \n
    15
    \n
    16 namespace dgf
    \n
    17 {
    \n
    18
    \n@@ -353,16 +353,16 @@\n
    250 }
    \n
    251
    \n
    252 }
    \n
    253
    \n
    254}
    \n
    255
    \n
    256#endif // #ifndef DUNE_DGF_PROJECTIONBLOCK_HH
    \n-\n-\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval &interval)
    Definition interval.hh:123
    \n
    Interface class for vertex projection at the boundary.
    Definition boundaryprojection.hh:33
    \n
    FieldVector< double, dimworld > CoordinateType
    type of coordinate vector
    Definition boundaryprojection.hh:42
    \n
    Definition basic.hh:31
    \n
    std::stringstream line
    Definition basic.hh:47
    \n
    Definition io/file/dgfparser/blocks/projection.hh:24
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07247.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07247.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    #include <array>
    \n #include <memory>
    \n #include <vector>
    \n #include <tuple>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/grid/common/gridfactory.hh>
    \n-#include <dune/grid/utility/multiindex.hh>
    \n+#include <dune/grid/utility/multiindex.hh>
    \n #include <dune/grid/utility/structuredgridfactory.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::dgf::ProjectionBlock
     
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07247_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07247_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    15#include <memory>
    \n
    16#include <vector>
    \n
    17#include <tuple>
    \n
    18
    \n
    19#include <dune/common/exceptions.hh>
    \n
    20#include <dune/common/fvector.hh>
    \n \n-\n+\n \n
    24
    \n
    25#if HAVE_ALBERTA
    \n
    26
    \n
    27namespace Dune
    \n
    28{
    \n
    29 // Forward Declarations
    \n@@ -289,15 +289,15 @@\n \n
    228
    \n
    229} // end namespace Dune
    \n
    230
    \n
    231#endif // HAVE_ALBERTA
    \n
    232
    \n
    233#endif // DUNE_ALBERTA_STRUCTUREDGRIDFACTORY_HH
    \n-
    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various facto...
    \n+
    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various facto...
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n
    GridFamily::ctype ctype
    Definition agrid.hh:143
    \n
    Construct structured cube and simplex grids in unstructured grid managers.
    Definition utility/structuredgridfactory.hh:31
    \n
    static void createSimplexGrid(GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
    insert structured simplex grid into grid factory
    Definition utility/structuredgridfactory.hh:181
    \n
    static std::array< unsigned int, dim > computeUnitOffsets(const std::array< unsigned int, dim > &vertices)
    Definition albertagrid/structuredgridfactory.hh:113
    \n
    static void createCubeGrid(GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
    Definition albertagrid/structuredgridfactory.hh:209
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07250.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07250.html", "unified_diff": "@@ -87,15 +87,15 @@\n #include <cstddef>
    \n #include <cstdlib>
    \n #include <memory>
    \n #include <dune/common/classname.hh>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/grid/common/gridfactory.hh>
    \n-#include <dune/grid/utility/multiindex.hh>
    \n+#include <dune/grid/utility/multiindex.hh>
    \n \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07250_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07250_source.html", "unified_diff": "@@ -95,15 +95,15 @@\n
    16#include <memory>
    \n
    17
    \n
    18#include <dune/common/classname.hh>
    \n
    19#include <dune/common/exceptions.hh>
    \n
    20#include <dune/common/fvector.hh>
    \n
    21
    \n \n-\n+\n
    24
    \n
    25namespace Dune {
    \n
    26
    \n
    29 template <class GridType>
    \n
    \n \n
    31 {
    \n@@ -299,15 +299,15 @@\n
    260
    \n
    261 };
    \n
    \n
    262
    \n
    263} // namespace Dune
    \n
    264
    \n
    265#endif
    \n-
    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various facto...
    \n+
    Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various facto...
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Construct structured cube and simplex grids in unstructured grid managers.
    Definition utility/structuredgridfactory.hh:31
    \n
    static std::unique_ptr< GridType > createCubeGrid(const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
    Create a structured cube grid.
    Definition utility/structuredgridfactory.hh:157
    \n
    static void createSimplexGrid(GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
    insert structured simplex grid into grid factory
    Definition utility/structuredgridfactory.hh:181
    \n
    static std::unique_ptr< GridType > createSimplexGrid(const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
    Create a structured simplex grid.
    Definition utility/structuredgridfactory.hh:251
    \n
    static void createCubeGrid(GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
    insert structured cube grid into grid factory
    Definition utility/structuredgridfactory.hh:91
    \n
    Communication comm() const
    Return the Communication used by the grid factory.
    Definition common/gridfactory.hh:258
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07259.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07259.html", "unified_diff": "@@ -86,20 +86,20 @@\n
    #include <iostream>
    \n #include <string>
    \n #include <vector>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/common/typetraits.hh>
    \n #include <dune/common/typeutilities.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/common/exceptions.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/exceptions.hh>
    \n #include <dune/grid/common/capabilities.hh>
    \n #include <dune/grid/common/datahandleif.hh>
    \n #include <dune/grid/common/gridview.hh>
    \n-#include <dune/grid/common/defaultgridview.hh>
    \n+#include <dune/grid/common/defaultgridview.hh>
    \n #include <dune/grid/common/entityseed.hh>
    \n #include <dune/common/bartonnackmanifcheck.hh>
    \n #include "geometry.hh"
    \n #include "entity.hh"
    \n #include "intersection.hh"
    \n #include "intersectioniterator.hh"
    \n #include "entityiterator.hh"
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07259_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07259_source.html", "unified_diff": "@@ -98,20 +98,20 @@\n
    18#include <dune/common/typetraits.hh>
    \n
    19#include <dune/common/typeutilities.hh>
    \n
    20
    \n
    21// dune-geometry includes
    \n
    22#include <dune/geometry/type.hh>
    \n
    23
    \n
    24// local includes
    \n-\n-\n+\n+\n \n \n \n-\n+\n \n
    32
    \n
    33// include this file after all other, because other files might undef the
    \n
    34// macros that are defined in that file
    \n
    35#include <dune/common/bartonnackmanifcheck.hh>
    \n
    36
    \n
    37namespace Dune {
    \n@@ -654,18 +654,18 @@\n
    1131#include "entity.hh"
    \n
    1132#include "intersection.hh"
    \n
    1133#include "intersectioniterator.hh"
    \n
    1134#include "entityiterator.hh"
    \n
    1135#include "indexidset.hh"
    \n
    1136
    \n
    1137#endif // #ifndef DUNE_GRID_COMMON_GRID_HH
    \n-\n+\n+\n
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n-\n-\n+\n
    InterfaceType
    Parameter to be used for the communication functions.
    Definition gridenums.hh:86
    \n
    Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
    leaf grid view for the given grid
    Definition common/grid.hh:805
    \n
    Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
    level grid view for the given grid and level.
    Definition common/grid.hh:788
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n
    Definition geometryreference.hh:139
    \n
    Specialize with 'true' for all codims that a grid implements entities for. (default=false)
    Definition common/capabilities.hh:58
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -533,18 +533,18 @@\n 1132#include \"intersection.hh\"\n 1133#include \"intersectioniterator.hh\"\n 1134#include \"entityiterator.hh\"\n 1135#include \"indexidset.hh\"\n 1136\n 1137#endif // #ifndef DUNE_GRID_COMMON_GRID_HH\n gridenums.hh\n+defaultgridview.hh\n datahandleif.hh\n Describes the parallel communication interface class for MessageBuffers and\n DataHandles.\n-defaultgridview.hh\n exceptions.hh\n Dune::InterfaceType\n InterfaceType\n Parameter to be used for the communication functions.\n Definition gridenums.hh:86\n Dune::leafGridView\n Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid<\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07262.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07262.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    \n
    #include <concepts>
    \n #include <cstddef>
    \n #include <type_traits>
    \n #include <utility>
    \n #include <dune/common/indices.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n #include <dune/grid/common/capabilities.hh>
    \n #include <dune/grid/concepts/entity.hh>
    \n #include <dune/grid/concepts/entityiterator.hh>
    \n #include <dune/grid/concepts/geometry.hh>
    \n #include <dune/grid/concepts/gridview.hh>
    \n #include <dune/grid/concepts/indexidset.hh>
    \n #include <dune/grid/concepts/intersection.hh>
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07262_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07262_source.html", "unified_diff": "@@ -91,15 +91,15 @@\n
    8#include <concepts>
    \n
    9#include <cstddef>
    \n
    10#include <type_traits>
    \n
    11#include <utility>
    \n
    12
    \n
    13#include <dune/common/indices.hh>
    \n
    14#include <dune/geometry/type.hh>
    \n-\n+\n \n \n \n \n \n \n \n@@ -205,15 +205,15 @@\n
    150 Impl::gridAllCodims<G>(range(from, to).to_integer_sequence());
    \n
    151};
    \n
    \n
    152
    \n
    153} // end namespace Dune::Concept
    \n
    154
    \n
    155#endif // DUNE_GRID_CONCEPTS_GRID_HH
    \n-\n+\n
    Definition concepts/datahandle.hh:14
    \n
    specialize with 'true' for all codims that a grid can communicate data on (default=false)
    Definition common/capabilities.hh:97
    \n
    Requirements for implementations of the Dune::Grid interface.
    Definition concepts/grid.hh:98
    \n
    Model of a grid view.
    Definition concepts/gridview.hh:81
    \n
    Model of an index set.
    Definition concepts/indexidset.hh:44
    \n
    Model of an id set.
    Definition concepts/indexidset.hh:83
    \n
    Model of an intersection.
    Definition concepts/intersection.hh:23
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07265.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07265.html", "unified_diff": "@@ -82,15 +82,15 @@\n \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::StructuredGridFactory< GridType >
     Construct structured cube and simplex grids in unstructured grid managers. More...
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07265_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07265_source.html", "unified_diff": "@@ -94,15 +94,15 @@\n
    11
    \n \n
    13
    \n \n \n \n \n-\n+\n \n
    20
    \n
    21namespace Dune
    \n
    22{
    \n
    23
    \n
    24 // DefaultCoordFunction
    \n
    25 // --------------------
    \n@@ -495,15 +495,15 @@\n
    674
    \n
    676 };
    \n \n
    677
    \n
    678} // namespace Dune
    \n
    679
    \n
    680#endif // #ifndef DUNE_GEOGRID_GRID_HH
    \n-\n+\n
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Store a reference to an entity with a minimal memory footprint.
    Definition common/entityseed.hh:26
    \n
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n
    Definition common/grid.hh:848
    \n
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n
    Definition geometrygrid/backuprestore.hh:27
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07271.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07271.html", "unified_diff": "@@ -91,15 +91,15 @@\n #include <dune/common/classname.hh>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/common/hybridutilities.hh>
    \n #include <dune/geometry/multilineargeometry.hh>
    \n #include <dune/geometry/referenceelements.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::DefaultCoordFunction< HostGrid >
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a07271_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a07271_source.html", "unified_diff": "@@ -103,15 +103,15 @@\n
    20#include <dune/common/fvector.hh>
    \n
    21#include <dune/common/hybridutilities.hh>
    \n
    22
    \n
    23#include <dune/geometry/multilineargeometry.hh>
    \n
    24#include <dune/geometry/referenceelements.hh>
    \n
    25#include <dune/geometry/type.hh>
    \n
    26
    \n-\n+\n
    28
    \n
    29namespace Dune {
    \n
    30
    \n
    32 template<class ctype>
    \n
    \n
    33 struct EntityInfo {
    \n
    35 std::size_t count;
    \n@@ -313,15 +313,15 @@\n
    277 }
    \n
    \n
    278
    \n
    279} // namespace Dune
    \n
    280
    \n
    281
    \n
    282#endif // DUNE_GRID_UTILITY_GRIDINFO_HH
    \n-
    Mapper for multiple codim and multiple geometry types.
    \n+
    Mapper for multiple codim and multiple geometry types.
    \n
    STL namespace.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    void fillGridViewInfoSerial(const GV &gv, GridViewInfo< typename GV::ctype > &gridViewInfo)
    fill a GridViewInfo structure from a serial grid
    Definition utility/gridinfo.hh:214
    \n
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n
    GridImp::template Codim< cd >::Geometry Geometry
    The corresponding geometry type.
    Definition common/entity.hh:100
    \n
    Index Set Interface base class.
    Definition common/indexidset.hh:78
    \n
    auto size(GeometryType type) const
    Return total number of entities of given geometry type in entity set .
    Definition common/indexidset.hh:223
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000000_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000000_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n
    \n-

    albertagrid → common Relation

    \n Classes

    struct  Dune::EntityInfo< ctype >
     Structure to hold statistical information about one type of entity. More...
    File in dune/grid/albertagridIncludes file in dune/grid/common
    agrid.hhadaptcallback.hh
    agrid.hhcommon/grid.hh
    agrid.hhcommon/gridfactory.hh
    agrid.hhsizecache.hh
    albertagrid/backuprestore.hhcommon/backuprestore.hh
    albertagrid/capabilities.hhcommon/capabilities.hh
    albertagrid/datahandle.hhcommon/grid.hh
    albertagrid/dgfparser.hhcommon/intersection.hh
    albertagrid/entity.hhcommon/entity.hh
    albertagrid/geometry.hhcommon/geometry.hh
    albertagrid/gridfactory.hhcommon/gridfactory.hh
    albertagrid/gridfamily.hhcommon/entity.hh
    albertagrid/gridfamily.hhcommon/entityiterator.hh
    albertagrid/gridfamily.hhcommon/geometry.hh
    albertagrid/gridfamily.hhcommon/intersection.hh
    albertagrid/gridfamily.hhcommon/intersectioniterator.hh
    albertagrid/gridview.hhcommon/capabilities.hh
    albertagrid/gridview.hhcommon/gridview.hh
    albertagrid/indexsets.hhcommon/grid.hh
    albertagrid/indexsets.hhcommon/indexidset.hh
    albertagrid/intersection.hhcommon/intersection.hh
    albertagrid/intersectioniterator.hhcommon/intersectioniterator.hh
    albertagrid/projection.hhboundaryprojection.hh
    albertagrid/structuredgridfactory.hhcommon/gridfactory.hh
    albertareader.hhcommon/grid.hh
    albertareader.hhcommon/gridfactory.hh
    geometryreference.hhcommon/geometry.hh
    hierarchiciterator.hhcommon/entityiterator.hh
    leafiterator.hhcommon/entityiterator.hh
    leveliterator.hhcommon/entityiterator.hh
    macrodata.ccexceptions.hh
    \n+

    albertagrid → common Relation

    File in dune/grid/albertagridIncludes file in dune/grid/common
    agrid.hhadaptcallback.hh
    agrid.hhcommon/grid.hh
    agrid.hhcommon/gridfactory.hh
    agrid.hhsizecache.hh
    albertagrid/backuprestore.hhcommon/backuprestore.hh
    albertagrid/capabilities.hhcommon/capabilities.hh
    albertagrid/datahandle.hhcommon/grid.hh
    albertagrid/dgfparser.hhcommon/intersection.hh
    albertagrid/entity.hhcommon/entity.hh
    albertagrid/geometry.hhcommon/geometry.hh
    albertagrid/gridfactory.hhcommon/gridfactory.hh
    albertagrid/gridfamily.hhcommon/entity.hh
    albertagrid/gridfamily.hhcommon/entityiterator.hh
    albertagrid/gridfamily.hhcommon/geometry.hh
    albertagrid/gridfamily.hhcommon/intersection.hh
    albertagrid/gridfamily.hhcommon/intersectioniterator.hh
    albertagrid/gridview.hhcommon/capabilities.hh
    albertagrid/gridview.hhcommon/gridview.hh
    albertagrid/indexsets.hhcommon/grid.hh
    albertagrid/indexsets.hhcommon/indexidset.hh
    albertagrid/intersection.hhcommon/intersection.hh
    albertagrid/intersectioniterator.hhcommon/intersectioniterator.hh
    albertagrid/projection.hhboundaryprojection.hh
    albertagrid/structuredgridfactory.hhcommon/gridfactory.hh
    albertareader.hhcommon/grid.hh
    albertareader.hhcommon/gridfactory.hh
    geometryreference.hhcommon/geometry.hh
    hierarchiciterator.hhcommon/entityiterator.hh
    leafiterator.hhcommon/entityiterator.hh
    leveliterator.hhcommon/entityiterator.hh
    macrodata.ccexceptions.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000000_000014.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000000_000014.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    albertagrid → io Relation

    File in dune/grid/albertagridIncludes file in dune/grid/io
    albertagrid/dgfparser.hhfile / dgfparser / blocks / io/file/dgfparser/blocks/projection.hh
    albertagrid/dgfparser.hhfile / dgfparser / io/file/dgfparser/dgfparser.hh
    albertagrid/dgfparser.hhfile / dgfparser / parser.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000000_000017.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000000_000017.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    albertagrid → utility Relation

    File in dune/grid/albertagridIncludes file in dune/grid/utility
    albertagrid/persistentcontainer.hhpersistentcontainervector.hh
    albertagrid/persistentcontainer.hhutility/persistentcontainer.hh
    albertagrid/structuredgridfactory.hhmultiindex.hh
    albertagrid/structuredgridfactory.hhutility/structuredgridfactory.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000001_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000001_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n
    \n-

    archetypes → common Relation

    File in dune/grid/concepts/archetypesIncludes file in dune/grid/common
    concepts/archetypes/datahandle.hhdatahandleif.hh
    concepts/archetypes/entity.hhgridenums.hh
    \n+

    archetypes → common Relation

    File in dune/grid/concepts/archetypesIncludes file in dune/grid/common
    concepts/archetypes/datahandle.hhdatahandleif.hh
    concepts/archetypes/entity.hhgridenums.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000002_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000002_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n
    \n-

    blocks → common Relation

    File in dune/grid/io/file/dgfparser/blocksIncludes file in dune/grid/common
    io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    \n+

    blocks → common Relation

    File in dune/grid/io/file/dgfparser/blocksIncludes file in dune/grid/common
    io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000003_000014.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000003_000014.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    common → io Relation

    File in dune/grid/commonIncludes file in dune/grid/io
    boundaryprojection.hhfile / gmshreader.hh
    \n+

    common → io Relation

    File in dune/grid/commonIncludes file in dune/grid/io
    boundaryprojection.hhfile / gmshreader.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000004_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000004_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    concepts → common Relation

    File in dune/grid/conceptsIncludes file in dune/grid/common
    archetypes / concepts/archetypes/datahandle.hhdatahandleif.hh
    archetypes / concepts/archetypes/entity.hhgridenums.hh
    concepts/entity.hhgridenums.hh
    concepts/grid.hhcommon/capabilities.hh
    concepts/grid.hhgridenums.hh
    concepts/gridview.hhcommon/capabilities.hh
    concepts/gridview.hhgridenums.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000005_000002.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000005_000002.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    dgfparser → blocks Relation

    File in dune/grid/io/file/dgfparserIncludes file in dune/grid/io/file/dgfparser/blocks
    dgfgeogrid.hhio/file/dgfparser/blocks/projection.hh
    dgfug.hhgridparameter.hh
    io/file/dgfparser/dgfparser.ccboundarydom.hh
    io/file/dgfparser/dgfparser.hhbasic.hh
    io/file/dgfparser/dgfparser.hhboundarydom.hh
    io/file/dgfparser/dgfparser.hhboundaryseg.hh
    io/file/dgfparser/dgfparser.hhcube.hh
    io/file/dgfparser/dgfparser.hhdim.hh
    io/file/dgfparser/dgfparser.hhgeneral.hh
    io/file/dgfparser/dgfparser.hhgridparameter.hh
    io/file/dgfparser/dgfparser.hhinterval.hh
    io/file/dgfparser/dgfparser.hhio/file/dgfparser/blocks/projection.hh
    io/file/dgfparser/dgfparser.hhperiodicfacetrans.hh
    io/file/dgfparser/dgfparser.hhpolygon.hh
    io/file/dgfparser/dgfparser.hhpolyhedron.hh
    io/file/dgfparser/dgfparser.hhsimplex.hh
    io/file/dgfparser/dgfparser.hhsimplexgeneration.hh
    io/file/dgfparser/dgfparser.hhvertex.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000005_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000005_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    dgfparser → common Relation

    File in dune/grid/io/file/dgfparserIncludes file in dune/grid/common
    dgfgeogrid.hhcommon/intersection.hh
    dgfgridfactory.hhcommon/intersection.hh
    dgfoned.hhcommon/intersection.hh
    dgfug.hhcommon/intersection.hh
    dgfwriter.hhcommon/grid.hh
    dgfwriter.hhrangegenerators.hh
    dgfyasp.hhcommon/intersection.hh
    gridptr.hhcommon/intersection.hh
    gridptr.hhdatahandleif.hh
    gridptr.hhgridenums.hh
    gridptr.hhpartitionset.hh
    gridptr.hhrangegenerators.hh
    blocks / io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    io/file/dgfparser/dgfparser.hhdatahandleif.hh
    io/file/dgfparser/dgfparser.hhgridenums.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000005_000017.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000005_000017.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n
    \n-

    dgfparser → utility Relation

    File in dune/grid/io/file/dgfparserIncludes file in dune/grid/utility
    dgfgeogrid.hhhostgridaccess.hh
    dgfidentitygrid.hhhostgridaccess.hh
    \n+

    dgfparser → utility Relation

    File in dune/grid/io/file/dgfparserIncludes file in dune/grid/utility
    dgfgeogrid.hhhostgridaccess.hh
    dgfidentitygrid.hhhostgridaccess.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    file → common Relation

    File in dune/grid/io/fileIncludes file in dune/grid/common
    dgfparser / dgfgeogrid.hhcommon/intersection.hh
    dgfparser / dgfgridfactory.hhcommon/intersection.hh
    dgfparser / dgfoned.hhcommon/intersection.hh
    dgfparser / dgfug.hhcommon/intersection.hh
    dgfparser / dgfwriter.hhcommon/grid.hh
    dgfparser / dgfwriter.hhrangegenerators.hh
    dgfparser / dgfyasp.hhcommon/intersection.hh
    gmshreader.hhboundarysegment.hh
    gmshreader.hhcommon/gridfactory.hh
    gmshwriter.hhcommon/grid.hh
    gmshwriter.hhmcmgmapper.hh
    gnuplot.hhcommon/grid.hh
    dgfparser / gridptr.hhcommon/intersection.hh
    dgfparser / gridptr.hhdatahandleif.hh
    dgfparser / gridptr.hhgridenums.hh
    dgfparser / gridptr.hhpartitionset.hh
    dgfparser / gridptr.hhrangegenerators.hh
    dgfparser / blocks / io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    dgfparser / io/file/dgfparser/dgfparser.hhdatahandleif.hh
    dgfparser / io/file/dgfparser/dgfparser.hhgridenums.hh
    printgrid.hhmcmgmapper.hh
    starcdreader.hhcommon/gridfactory.hh
    vtk / function.hhmcmgmapper.hh
    vtk / volumeiterators.hhgridenums.hh
    vtk / vtkwriter.hhmcmgmapper.hh
    vtk / vtkwriter.hhgridenums.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000005.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000005.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    file → dgfparser Relation

    File in dune/grid/io/fileIncludes file in dune/grid/io/file/dgfparser
    dgfparser / dgfgeogrid.hhblocks / io/file/dgfparser/blocks/projection.hh
    dgfparser / dgfug.hhblocks / gridparameter.hh
    io/file/dgfparser.hhdgfgeogrid.hh
    io/file/dgfparser.hhdgfidentitygrid.hh
    io/file/dgfparser.hhdgfoned.hh
    io/file/dgfparser.hhdgfug.hh
    io/file/dgfparser.hhdgfyasp.hh
    io/file/dgfparser.hhio/file/dgfparser/dgfparser.hh
    dgfparser / io/file/dgfparser/dgfparser.ccblocks / boundarydom.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / basic.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / boundarydom.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / boundaryseg.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / cube.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / dim.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / general.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / gridparameter.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / interval.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / io/file/dgfparser/blocks/projection.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / periodicfacetrans.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / polygon.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / polyhedron.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / simplex.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / simplexgeneration.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / vertex.hh
    \n+

    file → dgfparser Relation

    File in dune/grid/io/fileIncludes file in dune/grid/io/file/dgfparser
    dgfparser / dgfgeogrid.hhblocks / io/file/dgfparser/blocks/projection.hh
    dgfparser / dgfug.hhblocks / gridparameter.hh
    io/file/dgfparser.hhdgfgeogrid.hh
    io/file/dgfparser.hhdgfidentitygrid.hh
    io/file/dgfparser.hhdgfoned.hh
    io/file/dgfparser.hhdgfug.hh
    io/file/dgfparser.hhdgfyasp.hh
    io/file/dgfparser.hhio/file/dgfparser/dgfparser.hh
    dgfparser / io/file/dgfparser/dgfparser.ccblocks / boundarydom.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / basic.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / boundarydom.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / boundaryseg.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / cube.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / dim.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / general.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / gridparameter.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / interval.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / io/file/dgfparser/blocks/projection.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / periodicfacetrans.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / polygon.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / polyhedron.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / simplex.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / simplexgeneration.hh
    dgfparser / io/file/dgfparser/dgfparser.hhblocks / vertex.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000011.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000011.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    file → gnuplot Relation

    File in dune/grid/io/fileIncludes file in dune/grid/io/file/gnuplot
    gnuplot.hhgnuplot.cc
    \n+

    file → gnuplot Relation

    File in dune/grid/io/fileIncludes file in dune/grid/io/file/gnuplot
    gnuplot.hhgnuplot.cc
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000017.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000017.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    file → utility Relation

    File in dune/grid/io/fileIncludes file in dune/grid/utility
    dgfparser / dgfgeogrid.hhhostgridaccess.hh
    dgfparser / dgfidentitygrid.hhhostgridaccess.hh
    \n+

    file → utility Relation

    File in dune/grid/io/fileIncludes file in dune/grid/utility
    dgfparser / dgfgeogrid.hhhostgridaccess.hh
    dgfparser / dgfidentitygrid.hhhostgridaccess.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000019.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000009_000019.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    file → vtk Relation

    File in dune/grid/io/fileIncludes file in dune/grid/io/file/vtk
    vtk.hhboundarywriter.hh
    vtk.hhsubsamplingvtkwriter.hh
    vtk.hhvolumewriter.hh
    vtk.hhvtksequencewriter.hh
    vtk.hhvtkwriter.hh
    \n+

    file → vtk Relation

    File in dune/grid/io/fileIncludes file in dune/grid/io/file/vtk
    vtk.hhboundarywriter.hh
    vtk.hhsubsamplingvtkwriter.hh
    vtk.hhvolumewriter.hh
    vtk.hhvtksequencewriter.hh
    vtk.hhvtkwriter.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000010_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000010_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    geometrygrid → common Relation

    File in dune/grid/geometrygridIncludes file in dune/grid/common
    cachedcoordfunction.hhgridenums.hh
    geometrygrid/backuprestore.hhcommon/backuprestore.hh
    geometrygrid/capabilities.hhcommon/capabilities.hh
    geometrygrid/datahandle.hhcommon/grid.hh
    geometrygrid/datahandle.hhdatahandleif.hh
    geometrygrid/entity.hhcommon/grid.hh
    geometrygrid/entityseed.hhcommon/entityseed.hh
    geometrygrid/geometry.hhcommon/capabilities.hh
    geometrygrid/grid.hhcommon/grid.hh
    geometrygrid/gridfamily.hhcommon/grid.hh
    geometrygrid/gridview.hhcommon/capabilities.hh
    geometrygrid/gridview.hhcommon/gridview.hh
    geometrygrid/indexsets.hhcommon/indexidset.hh
    geometrygrid/indexsets.hhgridenums.hh
    hostcorners.hhcommon/entity.hh
    idset.hhcommon/indexidset.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000010_000017.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000010_000017.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    geometrygrid → utility Relation

    File in dune/grid/geometrygridIncludes file in dune/grid/utility
    cachedcoordfunction.hhutility/persistentcontainer.hh
    geometrygrid/persistentcontainer.hhpersistentcontainerwrapper.hh
    geometrygrid/persistentcontainer.hhutility/persistentcontainer.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000000.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000000.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    grid → albertagrid Relation

    File in dune/gridIncludes file in dune/grid/albertagrid
    albertagrid.hhagrid.hh
    albertagrid.hhalbertagrid/gridfactory.hh
    albertagrid.hhalbertagrid/persistentcontainer.hh
    albertagrid.hhalbertagrid/structuredgridfactory.hh
    io / file / io/file/dgfparser.hhalbertagrid/dgfparser.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    grid → common Relation

    File in dune/gridIncludes file in dune/grid/common
    albertagrid / agrid.hhadaptcallback.hh
    albertagrid / agrid.hhcommon/grid.hh
    albertagrid / agrid.hhcommon/gridfactory.hh
    albertagrid / agrid.hhsizecache.hh
    albertagrid / albertagrid/backuprestore.hhcommon/backuprestore.hh
    albertagrid / albertagrid/capabilities.hhcommon/capabilities.hh
    albertagrid / albertagrid/datahandle.hhcommon/grid.hh
    albertagrid / albertagrid/dgfparser.hhcommon/intersection.hh
    albertagrid / albertagrid/entity.hhcommon/entity.hh
    albertagrid / albertagrid/geometry.hhcommon/geometry.hh
    albertagrid / albertagrid/gridfactory.hhcommon/gridfactory.hh
    albertagrid / albertagrid/gridfamily.hhcommon/entity.hh
    albertagrid / albertagrid/gridfamily.hhcommon/entityiterator.hh
    albertagrid / albertagrid/gridfamily.hhcommon/geometry.hh
    albertagrid / albertagrid/gridfamily.hhcommon/intersection.hh
    albertagrid / albertagrid/gridfamily.hhcommon/intersectioniterator.hh
    albertagrid / albertagrid/gridview.hhcommon/capabilities.hh
    albertagrid / albertagrid/gridview.hhcommon/gridview.hh
    albertagrid / albertagrid/indexsets.hhcommon/grid.hh
    albertagrid / albertagrid/indexsets.hhcommon/indexidset.hh
    albertagrid / albertagrid/intersection.hhcommon/intersection.hh
    albertagrid / albertagrid/intersectioniterator.hhcommon/intersectioniterator.hh
    albertagrid / albertagrid/projection.hhboundaryprojection.hh
    albertagrid / albertagrid/structuredgridfactory.hhcommon/gridfactory.hh
    albertagrid / albertareader.hhcommon/grid.hh
    albertagrid / albertareader.hhcommon/gridfactory.hh
    geometrygrid / cachedcoordfunction.hhgridenums.hh
    concepts / archetypes / concepts/archetypes/datahandle.hhdatahandleif.hh
    concepts / archetypes / concepts/archetypes/entity.hhgridenums.hh
    concepts / concepts/entity.hhgridenums.hh
    concepts / concepts/grid.hhcommon/capabilities.hh
    concepts / concepts/grid.hhgridenums.hh
    concepts / concepts/gridview.hhcommon/capabilities.hh
    concepts / concepts/gridview.hhgridenums.hh
    io / file / dgfparser / dgfgeogrid.hhcommon/intersection.hh
    io / file / dgfparser / dgfgridfactory.hhcommon/intersection.hh
    io / file / dgfparser / dgfoned.hhcommon/intersection.hh
    io / file / dgfparser / dgfug.hhcommon/intersection.hh
    io / file / dgfparser / dgfwriter.hhcommon/grid.hh
    io / file / dgfparser / dgfwriter.hhrangegenerators.hh
    io / file / dgfparser / dgfyasp.hhcommon/intersection.hh
    geometrygrid / geometrygrid/backuprestore.hhcommon/backuprestore.hh
    geometrygrid / geometrygrid/capabilities.hhcommon/capabilities.hh
    geometrygrid / geometrygrid/datahandle.hhcommon/grid.hh
    geometrygrid / geometrygrid/datahandle.hhdatahandleif.hh
    geometrygrid / geometrygrid/entity.hhcommon/grid.hh
    geometrygrid / geometrygrid/entityseed.hhcommon/entityseed.hh
    geometrygrid / geometrygrid/geometry.hhcommon/capabilities.hh
    geometrygrid / geometrygrid/grid.hhcommon/grid.hh
    geometrygrid / geometrygrid/gridfamily.hhcommon/grid.hh
    geometrygrid / geometrygrid/gridview.hhcommon/capabilities.hh
    geometrygrid / geometrygrid/gridview.hhcommon/gridview.hh
    geometrygrid / geometrygrid/indexsets.hhcommon/indexidset.hh
    geometrygrid / geometrygrid/indexsets.hhgridenums.hh
    albertagrid / geometryreference.hhcommon/geometry.hh
    io / file / gmshreader.hhboundarysegment.hh
    io / file / gmshreader.hhcommon/gridfactory.hh
    io / file / gmshwriter.hhcommon/grid.hh
    io / file / gmshwriter.hhmcmgmapper.hh
    io / file / gnuplot.hhcommon/grid.hh
    io / file / dgfparser / gridptr.hhcommon/intersection.hh
    io / file / dgfparser / gridptr.hhdatahandleif.hh
    io / file / dgfparser / gridptr.hhgridenums.hh
    io / file / dgfparser / gridptr.hhpartitionset.hh
    io / file / dgfparser / gridptr.hhrangegenerators.hh
    albertagrid / hierarchiciterator.hhcommon/entityiterator.hh
    geometrygrid / hostcorners.hhcommon/entity.hh
    identitygrid.hhcommon/capabilities.hh
    identitygrid.hhcommon/grid.hh
    geometrygrid / idset.hhcommon/indexidset.hh
    io / file / dgfparser / blocks / io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    io / file / dgfparser / io/file/dgfparser/dgfparser.hhdatahandleif.hh
    io / file / dgfparser / io/file/dgfparser/dgfparser.hhgridenums.hh
    albertagrid / leafiterator.hhcommon/entityiterator.hh
    albertagrid / leveliterator.hhcommon/entityiterator.hh
    albertagrid / macrodata.ccexceptions.hh
    onedgrid.hhcommon/capabilities.hh
    onedgrid.hhcommon/grid.hh
    onedgrid.hhcommon/gridfactory.hh
    io / file / printgrid.hhmcmgmapper.hh
    io / file / starcdreader.hhcommon/gridfactory.hh
    uggrid.hhboundarysegment.hh
    uggrid.hhcommon/capabilities.hh
    uggrid.hhcommon/grid.hh
    yaspgrid.hhcommon/backuprestore.hh
    yaspgrid.hhcommon/capabilities.hh
    yaspgrid.hhcommon/grid.hh
    yaspgrid.hhcommon/indexidset.hh
    yaspgrid.hhdatahandleif.hh
    identitygrid / identitygridentity.hhcommon/grid.hh
    identitygrid / identitygridgeometry.hhcommon/geometry.hh
    identitygrid / identitygridindexsets.hhcommon/indexidset.hh
    identitygrid / identitygridintersectioniterator.hhcommon/intersection.hh
    identitygrid / identitygridleafiterator.hhgridenums.hh
    identitygrid / identitygridleveliterator.hhgridenums.hh
    uggrid / uggridfactory.hhboundarysegment.hh
    uggrid / uggridfactory.hhcommon/gridfactory.hh
    utility / entitycommhelper.hhgridenums.hh
    utility / globalindexset.hhgridenums.hh
    utility / globalindexset.hhdatahandleif.hh
    utility / utility/gridinfo.hhmcmgmapper.hh
    utility / hierarchicsearch.hhcommon/grid.hh
    utility / hierarchicsearch.hhgridenums.hh
    utility / parmetisgridpartitioner.hhmcmgmapper.hh
    utility / parmetisgridpartitioner.hhrangegenerators.hh
    utility / persistentcontainermap.hhcommon/capabilities.hh
    utility / utility/structuredgridfactory.hhcommon/gridfactory.hh
    utility / tensorgridfactory.hhcommon/gridfactory.hh
    io / file / vtk / function.hhmcmgmapper.hh
    io / file / vtk / volumeiterators.hhgridenums.hh
    io / file / vtk / vtkwriter.hhmcmgmapper.hh
    io / file / vtk / vtkwriter.hhgridenums.hh
    yaspgrid / yaspgrid/backuprestore.hhcommon/backuprestore.hh
    yaspgrid / torus.hhexceptions.hh
    \n+

    grid → common Relation

    File in dune/gridIncludes file in dune/grid/common
    albertagrid / agrid.hhadaptcallback.hh
    albertagrid / agrid.hhcommon/grid.hh
    albertagrid / agrid.hhcommon/gridfactory.hh
    albertagrid / agrid.hhsizecache.hh
    albertagrid / albertagrid/backuprestore.hhcommon/backuprestore.hh
    albertagrid / albertagrid/capabilities.hhcommon/capabilities.hh
    albertagrid / albertagrid/datahandle.hhcommon/grid.hh
    albertagrid / albertagrid/dgfparser.hhcommon/intersection.hh
    albertagrid / albertagrid/entity.hhcommon/entity.hh
    albertagrid / albertagrid/geometry.hhcommon/geometry.hh
    albertagrid / albertagrid/gridfactory.hhcommon/gridfactory.hh
    albertagrid / albertagrid/gridfamily.hhcommon/entity.hh
    albertagrid / albertagrid/gridfamily.hhcommon/entityiterator.hh
    albertagrid / albertagrid/gridfamily.hhcommon/geometry.hh
    albertagrid / albertagrid/gridfamily.hhcommon/intersection.hh
    albertagrid / albertagrid/gridfamily.hhcommon/intersectioniterator.hh
    albertagrid / albertagrid/gridview.hhcommon/capabilities.hh
    albertagrid / albertagrid/gridview.hhcommon/gridview.hh
    albertagrid / albertagrid/indexsets.hhcommon/grid.hh
    albertagrid / albertagrid/indexsets.hhcommon/indexidset.hh
    albertagrid / albertagrid/intersection.hhcommon/intersection.hh
    albertagrid / albertagrid/intersectioniterator.hhcommon/intersectioniterator.hh
    albertagrid / albertagrid/projection.hhboundaryprojection.hh
    albertagrid / albertagrid/structuredgridfactory.hhcommon/gridfactory.hh
    albertagrid / albertareader.hhcommon/grid.hh
    albertagrid / albertareader.hhcommon/gridfactory.hh
    geometrygrid / cachedcoordfunction.hhgridenums.hh
    concepts / archetypes / concepts/archetypes/datahandle.hhdatahandleif.hh
    concepts / archetypes / concepts/archetypes/entity.hhgridenums.hh
    concepts / concepts/entity.hhgridenums.hh
    concepts / concepts/grid.hhcommon/capabilities.hh
    concepts / concepts/grid.hhgridenums.hh
    concepts / concepts/gridview.hhcommon/capabilities.hh
    concepts / concepts/gridview.hhgridenums.hh
    io / file / dgfparser / dgfgeogrid.hhcommon/intersection.hh
    io / file / dgfparser / dgfgridfactory.hhcommon/intersection.hh
    io / file / dgfparser / dgfoned.hhcommon/intersection.hh
    io / file / dgfparser / dgfug.hhcommon/intersection.hh
    io / file / dgfparser / dgfwriter.hhcommon/grid.hh
    io / file / dgfparser / dgfwriter.hhrangegenerators.hh
    io / file / dgfparser / dgfyasp.hhcommon/intersection.hh
    geometrygrid / geometrygrid/backuprestore.hhcommon/backuprestore.hh
    geometrygrid / geometrygrid/capabilities.hhcommon/capabilities.hh
    geometrygrid / geometrygrid/datahandle.hhcommon/grid.hh
    geometrygrid / geometrygrid/datahandle.hhdatahandleif.hh
    geometrygrid / geometrygrid/entity.hhcommon/grid.hh
    geometrygrid / geometrygrid/entityseed.hhcommon/entityseed.hh
    geometrygrid / geometrygrid/geometry.hhcommon/capabilities.hh
    geometrygrid / geometrygrid/grid.hhcommon/grid.hh
    geometrygrid / geometrygrid/gridfamily.hhcommon/grid.hh
    geometrygrid / geometrygrid/gridview.hhcommon/capabilities.hh
    geometrygrid / geometrygrid/gridview.hhcommon/gridview.hh
    geometrygrid / geometrygrid/indexsets.hhcommon/indexidset.hh
    geometrygrid / geometrygrid/indexsets.hhgridenums.hh
    albertagrid / geometryreference.hhcommon/geometry.hh
    io / file / gmshreader.hhboundarysegment.hh
    io / file / gmshreader.hhcommon/gridfactory.hh
    io / file / gmshwriter.hhcommon/grid.hh
    io / file / gmshwriter.hhmcmgmapper.hh
    io / file / gnuplot.hhcommon/grid.hh
    io / file / dgfparser / gridptr.hhcommon/intersection.hh
    io / file / dgfparser / gridptr.hhdatahandleif.hh
    io / file / dgfparser / gridptr.hhgridenums.hh
    io / file / dgfparser / gridptr.hhpartitionset.hh
    io / file / dgfparser / gridptr.hhrangegenerators.hh
    albertagrid / hierarchiciterator.hhcommon/entityiterator.hh
    geometrygrid / hostcorners.hhcommon/entity.hh
    identitygrid.hhcommon/capabilities.hh
    identitygrid.hhcommon/grid.hh
    geometrygrid / idset.hhcommon/indexidset.hh
    io / file / dgfparser / blocks / io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    io / file / dgfparser / io/file/dgfparser/dgfparser.hhdatahandleif.hh
    io / file / dgfparser / io/file/dgfparser/dgfparser.hhgridenums.hh
    albertagrid / leafiterator.hhcommon/entityiterator.hh
    albertagrid / leveliterator.hhcommon/entityiterator.hh
    albertagrid / macrodata.ccexceptions.hh
    onedgrid.hhcommon/capabilities.hh
    onedgrid.hhcommon/grid.hh
    onedgrid.hhcommon/gridfactory.hh
    io / file / printgrid.hhmcmgmapper.hh
    io / file / starcdreader.hhcommon/gridfactory.hh
    uggrid.hhboundarysegment.hh
    uggrid.hhcommon/capabilities.hh
    uggrid.hhcommon/grid.hh
    yaspgrid.hhcommon/backuprestore.hh
    yaspgrid.hhcommon/capabilities.hh
    yaspgrid.hhcommon/grid.hh
    yaspgrid.hhcommon/indexidset.hh
    yaspgrid.hhdatahandleif.hh
    identitygrid / identitygridentity.hhcommon/grid.hh
    identitygrid / identitygridgeometry.hhcommon/geometry.hh
    identitygrid / identitygridindexsets.hhcommon/indexidset.hh
    identitygrid / identitygridintersectioniterator.hhcommon/intersection.hh
    identitygrid / identitygridleafiterator.hhgridenums.hh
    identitygrid / identitygridleveliterator.hhgridenums.hh
    uggrid / uggridfactory.hhboundarysegment.hh
    uggrid / uggridfactory.hhcommon/gridfactory.hh
    utility / entitycommhelper.hhgridenums.hh
    utility / globalindexset.hhgridenums.hh
    utility / globalindexset.hhdatahandleif.hh
    utility / utility/gridinfo.hhmcmgmapper.hh
    utility / hierarchicsearch.hhcommon/grid.hh
    utility / hierarchicsearch.hhgridenums.hh
    utility / parmetisgridpartitioner.hhmcmgmapper.hh
    utility / parmetisgridpartitioner.hhrangegenerators.hh
    utility / persistentcontainermap.hhcommon/capabilities.hh
    utility / utility/structuredgridfactory.hhcommon/gridfactory.hh
    utility / tensorgridfactory.hhcommon/gridfactory.hh
    io / file / vtk / function.hhmcmgmapper.hh
    io / file / vtk / volumeiterators.hhgridenums.hh
    io / file / vtk / vtkwriter.hhmcmgmapper.hh
    io / file / vtk / vtkwriter.hhgridenums.hh
    yaspgrid / yaspgrid/backuprestore.hhcommon/backuprestore.hh
    yaspgrid / torus.hhexceptions.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000010.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000010.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    grid → geometrygrid Relation

    File in dune/gridIncludes file in dune/grid/geometrygrid
    geometrygrid.hhgeometrygrid/grid.hh
    geometrygrid.hhgeometrygrid/persistentcontainer.hh
    utility / hostgridaccess.hhgeometrygrid/intersection.hh
    \n+

    grid → geometrygrid Relation

    File in dune/gridIncludes file in dune/grid/geometrygrid
    geometrygrid.hhgeometrygrid/grid.hh
    geometrygrid.hhgeometrygrid/persistentcontainer.hh
    utility / hostgridaccess.hhgeometrygrid/intersection.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000013.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000013.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    grid → identitygrid Relation

    File in dune/gridIncludes file in dune/grid/identitygrid
    identitygrid.hhidentitygridentity.hh
    identitygrid.hhidentitygridentityseed.hh
    identitygrid.hhidentitygridgeometry.hh
    identitygrid.hhidentitygridhierarchiciterator.hh
    identitygrid.hhidentitygridindexsets.hh
    identitygrid.hhidentitygridintersectioniterator.hh
    identitygrid.hhidentitygridleafiterator.hh
    identitygrid.hhidentitygridleveliterator.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000020.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000012_000020.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    grid → yaspgrid Relation

    File in dune/gridIncludes file in dune/grid/yaspgrid
    yaspgrid.hhcoordinates.hh
    yaspgrid.hhstructuredyaspgridfactory.hh
    yaspgrid.hhtorus.hh
    yaspgrid.hhyaspgrid/backuprestore.hh
    yaspgrid.hhyaspgridentity.hh
    yaspgrid.hhyaspgridentityseed.hh
    yaspgrid.hhyaspgridgeometry.hh
    yaspgrid.hhyaspgridhierarchiciterator.hh
    yaspgrid.hhyaspgrididset.hh
    yaspgrid.hhyaspgridindexsets.hh
    yaspgrid.hhyaspgridintersection.hh
    yaspgrid.hhyaspgridintersectioniterator.hh
    yaspgrid.hhyaspgridleveliterator.hh
    yaspgrid.hhyaspgridpersistentcontainer.hh
    yaspgrid.hhygrid.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000013_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000013_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    identitygrid → common Relation

    File in dune/grid/identitygridIncludes file in dune/grid/common
    identitygridentity.hhcommon/grid.hh
    identitygridgeometry.hhcommon/geometry.hh
    identitygridindexsets.hhcommon/indexidset.hh
    identitygridintersectioniterator.hhcommon/intersection.hh
    identitygridleafiterator.hhgridenums.hh
    identitygridleveliterator.hhgridenums.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000014_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000014_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    io → common Relation

    File in dune/grid/ioIncludes file in dune/grid/common
    file / dgfparser / dgfgeogrid.hhcommon/intersection.hh
    file / dgfparser / dgfgridfactory.hhcommon/intersection.hh
    file / dgfparser / dgfoned.hhcommon/intersection.hh
    file / dgfparser / dgfug.hhcommon/intersection.hh
    file / dgfparser / dgfwriter.hhcommon/grid.hh
    file / dgfparser / dgfwriter.hhrangegenerators.hh
    file / dgfparser / dgfyasp.hhcommon/intersection.hh
    file / gmshreader.hhboundarysegment.hh
    file / gmshreader.hhcommon/gridfactory.hh
    file / gmshwriter.hhcommon/grid.hh
    file / gmshwriter.hhmcmgmapper.hh
    file / gnuplot.hhcommon/grid.hh
    file / dgfparser / gridptr.hhcommon/intersection.hh
    file / dgfparser / gridptr.hhdatahandleif.hh
    file / dgfparser / gridptr.hhgridenums.hh
    file / dgfparser / gridptr.hhpartitionset.hh
    file / dgfparser / gridptr.hhrangegenerators.hh
    file / dgfparser / blocks / io/file/dgfparser/blocks/projection.hhboundaryprojection.hh
    file / dgfparser / io/file/dgfparser/dgfparser.hhdatahandleif.hh
    file / dgfparser / io/file/dgfparser/dgfparser.hhgridenums.hh
    file / printgrid.hhmcmgmapper.hh
    file / starcdreader.hhcommon/gridfactory.hh
    file / vtk / function.hhmcmgmapper.hh
    file / vtk / volumeiterators.hhgridenums.hh
    file / vtk / vtkwriter.hhmcmgmapper.hh
    file / vtk / vtkwriter.hhgridenums.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000014_000017.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000014_000017.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    io → utility Relation

    File in dune/grid/ioIncludes file in dune/grid/utility
    file / dgfparser / dgfgeogrid.hhhostgridaccess.hh
    file / dgfparser / dgfidentitygrid.hhhostgridaccess.hh
    \n+

    io → utility Relation

    File in dune/grid/ioIncludes file in dune/grid/utility
    file / dgfparser / dgfgeogrid.hhhostgridaccess.hh
    file / dgfparser / dgfidentitygrid.hhhostgridaccess.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000015_000008.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000015_000008.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    recipes → dune Relation

    File in doc/recipesIncludes file in dune
    recipe-integration.ccgrid / yaspgrid.hh
    recipe-iterate-over-grid.ccgrid / yaspgrid.hh
    \n+

    recipes → dune Relation

    File in doc/recipesIncludes file in dune
    recipe-integration.ccgrid / yaspgrid.hh
    recipe-iterate-over-grid.ccgrid / yaspgrid.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000016_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000016_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    uggrid → common Relation

    File in dune/grid/uggridIncludes file in dune/grid/common
    uggridfactory.hhboundarysegment.hh
    uggridfactory.hhcommon/gridfactory.hh
    \n+

    uggrid → common Relation

    File in dune/grid/uggridIncludes file in dune/grid/common
    uggridfactory.hhboundarysegment.hh
    uggridfactory.hhcommon/gridfactory.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000017_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000017_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    utility → common Relation

    File in dune/grid/utilityIncludes file in dune/grid/common
    entitycommhelper.hhgridenums.hh
    globalindexset.hhdatahandleif.hh
    globalindexset.hhgridenums.hh
    hierarchicsearch.hhcommon/grid.hh
    hierarchicsearch.hhgridenums.hh
    parmetisgridpartitioner.hhmcmgmapper.hh
    parmetisgridpartitioner.hhrangegenerators.hh
    persistentcontainermap.hhcommon/capabilities.hh
    tensorgridfactory.hhcommon/gridfactory.hh
    utility/gridinfo.hhmcmgmapper.hh
    utility/structuredgridfactory.hhcommon/gridfactory.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000017_000010.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000017_000010.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    utility → geometrygrid Relation

    File in dune/grid/utilityIncludes file in dune/grid/geometrygrid
    hostgridaccess.hhgeometrygrid/intersection.hh
    \n+

    utility → geometrygrid Relation

    File in dune/grid/utilityIncludes file in dune/grid/geometrygrid
    hostgridaccess.hhgeometrygrid/intersection.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000017_000014.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000017_000014.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n
    \n-

    utility → io Relation

    File in dune/grid/utilityIncludes file in dune/grid/io
    gridinfo-gmsh-main.hhfile / gmshreader.hh
    \n+

    utility → io Relation

    File in dune/grid/utilityIncludes file in dune/grid/io
    gridinfo-gmsh-main.hhfile / gmshreader.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000019_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000019_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n
    \n-

    vtk → common Relation

    File in dune/grid/io/file/vtkIncludes file in dune/grid/common
    function.hhmcmgmapper.hh
    volumeiterators.hhgridenums.hh
    vtkwriter.hhgridenums.hh
    vtkwriter.hhmcmgmapper.hh
    \n+

    vtk → common Relation

    File in dune/grid/io/file/vtkIncludes file in dune/grid/common
    function.hhmcmgmapper.hh
    volumeiterators.hhgridenums.hh
    vtkwriter.hhgridenums.hh
    vtkwriter.hhmcmgmapper.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000020_000003.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000020_000003.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n
    \n-

    yaspgrid → common Relation

    File in dune/grid/yaspgridIncludes file in dune/grid/common
    torus.hhexceptions.hh
    yaspgrid/backuprestore.hhcommon/backuprestore.hh
    \n+

    yaspgrid → common Relation

    File in dune/grid/yaspgridIncludes file in dune/grid/common
    torus.hhexceptions.hh
    yaspgrid/backuprestore.hhcommon/backuprestore.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000020_000017.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_000020_000017.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n \n \n \n+

    yaspgrid → utility Relation

    File in dune/grid/yaspgridIncludes file in dune/grid/utility
    structuredyaspgridfactory.hhutility/structuredgridfactory.hh
    yaspgridpersistentcontainer.hhpersistentcontainervector.hh
    yaspgridpersistentcontainer.hhutility/persistentcontainer.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_0009240fada98b921d3b7adcfc3fe68b.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_0009240fada98b921d3b7adcfc3fe68b.html", "unified_diff": "@@ -93,123 +93,123 @@\n \"\"\n \"\"\n \n \n \n \n-\n-\n+\n+\n \n-\n+\n \n \n \n-\n+\n \n-\n+\n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n-\n-\n+\n+\n \n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n \n \n-\n-\n+\n+\n \n-\n+\n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n \n \n \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

     agrid.hh
     provides the AlbertaGrid class
     agrid.hh
     provides the AlbertaGrid class
     
     albertagrid.cc
     albertagrid.cc
     
     albertaheader.hh
     
     albertareader.hh
     albertareader.hh
     
     algebra.hh
     algebra.hh
     
     backuprestore.hh
     
     capabilities.hh
     
     coordcache.hh
     coordcache.hh
     
     datahandle.hh
     
     dgfparser.cc
     
     dgfparser.hh
     
     dofadmin.hh
     dofadmin.hh
     
     dofvector.hh
     dofvector.hh
     
     elementinfo.cc
     provides a wrapper for ALBERTA's el_info structure
     elementinfo.cc
     provides a wrapper for ALBERTA's el_info structure
     
     elementinfo.hh
     provides a wrapper for ALBERTA's el_info structure
     elementinfo.hh
     provides a wrapper for ALBERTA's el_info structure
     
     entity.cc
     entity.cc
     
     entity.hh
     
     entityseed.hh
     
     geometry.cc
     geometry.cc
     
     geometry.hh
     
     geometrycache.hh
     geometrycache.hh
     
     geometryreference.hh
     Wrapper and interface classes for element geometries.
     geometryreference.hh
     Wrapper and interface classes for element geometries.
     
     gridfactory.hh
     specialization of the generic GridFactory for AlbertaGrid
     
     gridfamily.hh
     provides the GridFamily for AlbertaGrid
     
     gridview.hh
     
     hierarchiciterator.hh
     hierarchiciterator.hh
     
     indexsets.cc
     indexsets.cc
     
     indexsets.hh
     
     indexstack.hh
     Provides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid)
     indexstack.hh
     Provides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid)
     
     intersection.cc
     intersection.cc
     
     intersection.hh
     
     intersectioniterator.hh
     Implementation of the IntersectionIterator for AlbertaGrid.
     
     leafiterator.hh
     leafiterator.hh
     
     level.hh
     level.hh
     
     leveliterator.hh
     leveliterator.hh
     
     macrodata.cc
     provides a wrapper for ALBERTA's macro_data structure
     macrodata.cc
     provides a wrapper for ALBERTA's macro_data structure
     
     macrodata.hh
     provides a wrapper for ALBERTA's macro_data structure
     macrodata.hh
     provides a wrapper for ALBERTA's macro_data structure
     
     macroelement.hh
     macroelement.hh
     
     meshpointer.cc
     meshpointer.cc
     
     meshpointer.hh
     provides a wrapper for ALBERTA's mesh structure
     meshpointer.hh
     provides a wrapper for ALBERTA's mesh structure
     
     misc.hh
     misc.hh
     
     persistentcontainer.hh
     
     projection.hh
     
     refinement.hh
     provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
     refinement.hh
     provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
     
     structuredgridfactory.hh
     specialization of the generic StructuredGridFactory for AlbertaGrid
     
     transformation.hh
     
     treeiterator.hh
     treeiterator.hh
     
     undefine-2.0.hh
     Contains #undefs for all preprocessor macros defined by alberta.
     undefine-2.0.hh
     Contains #undefs for all preprocessor macros defined by alberta.
     
     undefine-3.0.hh
     Contains #undefs for all preprocessor macros defined by alberta.
     
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_3101a3055293843fecabc3e467bfc546.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_3101a3055293843fecabc3e467bfc546.html", "unified_diff": "@@ -87,69 +87,69 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\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

     basic.cc
     basic.cc
     
     basic.hh
     basic.hh
     
     boundarydom.cc
     boundarydom.cc
     
     boundarydom.hh
     boundarydom.hh
     
     boundaryseg.cc
     boundaryseg.cc
     
     boundaryseg.hh
     boundaryseg.hh
     
     cube.cc
     cube.cc
     
     cube.hh
     cube.hh
     
     dim.cc
     dim.cc
     
     dim.hh
     dim.hh
     
     general.cc
     general.cc
     
     general.hh
     general.hh
     
     gridparameter.cc
     gridparameter.cc
     
     gridparameter.hh
     gridparameter.hh
     
     interval.cc
     interval.cc
     
     interval.hh
     interval.hh
     
     periodicfacetrans.cc
     periodicfacetrans.cc
     
     periodicfacetrans.hh
     periodicfacetrans.hh
     
     polygon.hh
     polygon.hh
     
     polyhedron.hh
     polyhedron.hh
     
     projection.cc
     projection.cc
     
     projection.hh
     
     simplex.cc
     simplex.cc
     
     simplex.hh
     simplex.hh
     
     simplexgeneration.cc
     simplexgeneration.cc
     
     simplexgeneration.hh
     simplexgeneration.hh
     
     vertex.cc
     vertex.cc
     
     vertex.hh
     vertex.hh
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_51efcf388a7f62d4a2fa1c6b4b0f3d93.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_51efcf388a7f62d4a2fa1c6b4b0f3d93.html", "unified_diff": "@@ -92,53 +92,53 @@\n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n \n \n-\n+\n \n \n \n \n \n \n \n \n \n \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

     backuprestore.hh
     
     cachedcoordfunction.hh
     cachedcoordfunction.hh
     
     capabilities.hh
     
     coordfunction.hh
     coordfunction.hh
     
     coordfunctioncaller.hh
     coordfunctioncaller.hh
     
     cornerstorage.hh
     cornerstorage.hh
     
     datahandle.hh
     
     declaration.hh
     declaration.hh
     
     entity.hh
     
     entityseed.hh
     
     geometry.hh
     
     grid.hh
     
     gridfamily.hh
     
     gridview.hh
     
     hostcorners.hh
     hostcorners.hh
     
     identity.hh
     identity.hh
     
     idset.hh
     
     indexsets.hh
     
     intersection.hh
     
     intersectioniterator.hh
     
     iterator.hh
     iterator.hh
     
     persistentcontainer.hh
     
    \n \n \n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_63e32640819d3744ac1cd322c9d6003e.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_63e32640819d3744ac1cd322c9d6003e.html", "unified_diff": "@@ -92,53 +92,53 @@\n \n \n \n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\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

     backuprestore.hh
     
     coordinates.hh
     This provides container classes for the coordinates to be used in YaspGrid Upon implementation of the tensorproduct feature, the coordinate information has been encapsulated to keep performance for the equidistant grid. Containers for equidistant and tensorproduct grids are provided here.
     coordinates.hh
     This provides container classes for the coordinates to be used in YaspGrid Upon implementation of the tensorproduct feature, the coordinate information has been encapsulated to keep performance for the equidistant grid. Containers for equidistant and tensorproduct grids are provided here.
     
     partitioning.hh
     This file provides tools to partition YaspGrids. If you want to write your own partitioner, inherit from Yasp::Partitioning and implement the partition() method. You can also browse this file for already available useful partitioners, like Yasp::FixedSizePartitioning.
     partitioning.hh
     This file provides tools to partition YaspGrids. If you want to write your own partitioner, inherit from Yasp::Partitioning and implement the partition() method. You can also browse this file for already available useful partitioners, like Yasp::FixedSizePartitioning.
     
     structuredyaspgridfactory.hh
     Specialization of the StructuredGridFactory class for YaspGrid.
     structuredyaspgridfactory.hh
     Specialization of the StructuredGridFactory class for YaspGrid.
     
     torus.hh
     This file provides the infrastructure for toroidal communication in YaspGrid.
     torus.hh
     This file provides the infrastructure for toroidal communication in YaspGrid.
     
     yaspgridentity.hh
     the YaspEntity class and its specializations
     yaspgridentity.hh
     the YaspEntity class and its specializations
     
     yaspgridentityseed.hh
     The YaspEntitySeed class.
     yaspgridentityseed.hh
     The YaspEntitySeed class.
     
     yaspgridgeometry.hh
     The YaspGeometry class and its specializations.
     yaspgridgeometry.hh
     The YaspGeometry class and its specializations.
     
     yaspgridhierarchiciterator.hh
     yaspgridhierarchiciterator.hh
     
     yaspgrididset.hh
     yaspgrididset.hh
     
     yaspgridindexsets.hh
     level-wise, non-persistent, consecutive indices for YaspGrid
     yaspgridindexsets.hh
     level-wise, non-persistent, consecutive indices for YaspGrid
     
     yaspgridintersection.hh
     The YaspIntersection class.
     yaspgridintersection.hh
     The YaspIntersection class.
     
     yaspgridintersectioniterator.hh
     The YaspIntersectionIterator class.
     yaspgridintersectioniterator.hh
     The YaspIntersectionIterator class.
     
     yaspgridleveliterator.hh
     The YaspLevelIterator class.
     yaspgridleveliterator.hh
     The YaspLevelIterator class.
     
     yaspgridpersistentcontainer.hh
     Specialization of the PersistentContainer for YaspGrid.
     yaspgridpersistentcontainer.hh
     Specialization of the PersistentContainer for YaspGrid.
     
     ygrid.hh
     This provides a YGrid, the elemental component of the yaspgrid implementation.
     
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_6b8c365152847b3387fb5004eec7d3cc.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_6b8c365152847b3387fb5004eec7d3cc.html", "unified_diff": "@@ -87,40 +87,40 @@\n \"\"\n \"\"\n \n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\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

     identitygridentity.hh
     The IdentityGridEntity class.
     identitygridentity.hh
     The IdentityGridEntity class.
     
     identitygridentityseed.hh
     The IdentityGridEntitySeed class.
     identitygridentityseed.hh
     The IdentityGridEntitySeed class.
     
     identitygridgeometry.hh
     The IdentityGridGeometry class and its specializations.
     identitygridgeometry.hh
     The IdentityGridGeometry class and its specializations.
     
     identitygridhierarchiciterator.hh
     The IdentityGridHierarchicIterator class.
     identitygridhierarchiciterator.hh
     The IdentityGridHierarchicIterator class.
     
     identitygridindexsets.hh
     The index and id sets for the IdentityGrid class.
     identitygridindexsets.hh
     The index and id sets for the IdentityGrid class.
     
     identitygridintersectioniterator.hh
     The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes.
     identitygridintersectioniterator.hh
     The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes.
     
     identitygridintersections.hh
     The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.
     identitygridintersections.hh
     The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.
     
     identitygridleafiterator.hh
     The IdentityGridLeafIterator class.
     identitygridleafiterator.hh
     The IdentityGridLeafIterator class.
     
     identitygridleveliterator.hh
     The IdentityGridLevelIterator class.
     identitygridleveliterator.hh
     The IdentityGridLevelIterator class.
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_8a7c3b45c9645f41c3ea2c94b08d5fa1.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_8a7c3b45c9645f41c3ea2c94b08d5fa1.html", "unified_diff": "@@ -84,19 +84,19 @@\n \"\"\n \"\"\n \n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n

    \n Files

     dgf2dgf.cc
     a small program converting a DGF file into a DGF file
     dgf2dgf.cc
     a small program converting a DGF file into a DGF file
     
     gmsh2dgf.cc
     a small program converting a gmsh file into a DGF file
     gmsh2dgf.cc
     a small program converting a gmsh file into a DGF file
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_8d29adac9322a6a2ee0cd26fd57d5299.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_8d29adac9322a6a2ee0cd26fd57d5299.html", "unified_diff": "@@ -84,16 +84,16 @@\n \"\"\n \"\"\n \n \n \n \n-\n-\n+\n+\n \n

    \n Files

     gnuplot.cc
     Implementation of gnuplot output for 1D and 2D grids.
     gnuplot.cc
     Implementation of gnuplot output for 1D and 2D grids.
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_9cbaec8e9232e242a682ff9656a6bc7e.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_9cbaec8e9232e242a682ff9656a6bc7e.html", "unified_diff": "@@ -87,17 +87,17 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n

    \n Files

     recipe-integration.cc
     recipe-integration.cc
     
     recipe-iterate-over-grid.cc
     recipe-iterate-over-grid.cc
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_afe722c9aeb4f33ba80bf13de411ce03.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_afe722c9aeb4f33ba80bf13de411ce03.html", "unified_diff": "@@ -93,55 +93,55 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n \n \n-\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

     entitycommhelper.hh
     entitycommhelper.hh
     
     globalindexset.hh
     Provides a globally unique index for all entities of a distributed Dune grid.
     globalindexset.hh
     Provides a globally unique index for all entities of a distributed Dune grid.
     
     gridinfo-gmsh-main.hh
     Generic main() function for printing information about a mesh read from a .msh-file.
     gridinfo-gmsh-main.hh
     Generic main() function for printing information about a mesh read from a .msh-file.
     
     gridinfo.hh
     
     gridtype.hh
     This file can be included directly following config.h to test if a grid type was correctly selected.
     gridtype.hh
     This file can be included directly following config.h to test if a grid type was correctly selected.
     
     hierarchicsearch.hh
     Utility class for hierarchically searching for an Entity containing a given point.
     hierarchicsearch.hh
     Utility class for hierarchically searching for an Entity containing a given point.
     
     hostgridaccess.hh
     hostgridaccess.hh
     
     multiindex.hh
     Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes.
     multiindex.hh
     Implements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes.
     
     parmetisgridpartitioner.hh
     Compute a repartitioning of a Dune grid using ParMetis.
     parmetisgridpartitioner.hh
     Compute a repartitioning of a Dune grid using ParMetis.
     
     persistentcontainer.hh
     
     persistentcontainerinterface.hh
     persistentcontainerinterface.hh
     
     persistentcontainermap.hh
     persistentcontainermap.hh
     
     persistentcontainervector.hh
     persistentcontainervector.hh
     
     persistentcontainerwrapper.hh
     persistentcontainerwrapper.hh
     
     structuredgridfactory.hh
     A class to construct structured cube and simplex grids using the grid factory.
     
     tensorgridfactory.hh
     This file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series.
     tensorgridfactory.hh
     This file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series.
     
     vertexorderfactory.hh
     vertexorderfactory.hh
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_b770a3c3155c345f795a6741b9d3499a.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_b770a3c3155c345f795a6741b9d3499a.html", "unified_diff": "@@ -87,63 +87,63 @@\n \"\"\n \"\"\n \n \n \n \n-\n-\n+\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n-\n+\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

     b64enc.hh
     Simple base64 encode.
     b64enc.hh
     Simple base64 encode.
     
     basicwriter.hh
     basicwriter.hh
     
     boundaryiterators.hh
     Functions for VTK output on the skeleton.
     boundaryiterators.hh
     Functions for VTK output on the skeleton.
     
     boundarywriter.hh
     boundarywriter.hh
     
     common.hh
     Common stuff for the VTKWriter.
     common.hh
     Common stuff for the VTKWriter.
     
     corner.hh
     corner.hh
     
     corneriterator.hh
     corneriterator.hh
     
     dataarraywriter.hh
     Data array writers for the VTKWriter.
     dataarraywriter.hh
     Data array writers for the VTKWriter.
     
     function.hh
     Functions for VTK output.
     function.hh
     Functions for VTK output.
     
     functionwriter.hh
     functionwriter.hh
     
     pointiterator.hh
     pointiterator.hh
     
     pvtuwriter.hh
     pvtuwriter.hh
     
     skeletonfunction.hh
     Functions for VTK output on the skeleton.
     skeletonfunction.hh
     Functions for VTK output on the skeleton.
     
     streams.hh
     streams.hh
     
     subsamplingvtkwriter.hh
     Provides subsampled file i/o for the visualization toolkit.
     subsamplingvtkwriter.hh
     Provides subsampled file i/o for the visualization toolkit.
     
     volumeiterators.hh
     volumeiterators.hh
     
     volumewriter.hh
     volumewriter.hh
     
     vtksequencewriter.hh
     vtksequencewriter.hh
     
     vtksequencewriterbase.hh
     vtksequencewriterbase.hh
     
     vtkwriter.hh
     Provides file i/o for the visualization toolkit.
     vtkwriter.hh
     Provides file i/o for the visualization toolkit.
     
     vtuwriter.hh
     vtuwriter.hh
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_c7946cd8c64c74ddbfaba08069596fbe.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_c7946cd8c64c74ddbfaba08069596fbe.html", "unified_diff": "@@ -103,46 +103,46 @@\n

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

     dgfexception.hh
     dgfexception.hh
     
     dgfgeogrid.hh
     dgfgeogrid.hh
     
     dgfgridfactory.hh
     dgfgridfactory.hh
     
     dgfidentitygrid.hh
     dgfidentitygrid.hh
     
     dgfoned.hh
     dgfoned.hh
     
     dgfparser.cc
     
     dgfparser.hh
     
     dgfug.cc
     dgfug.cc
     
     dgfug.hh
     dgfug.hh
     
     dgfwriter.hh
     write a GridView to a DGF file
     dgfwriter.hh
     write a GridView to a DGF file
     
     dgfyasp.hh
     dgfyasp.hh
     
     entitykey.hh
     entitykey.hh
     
     entitykey_inline.hh
     entitykey_inline.hh
     
     gridptr.hh
     gridptr.hh
     
     macrogrid.hh
     macrogrid.hh
     
     parser.hh
     parser.hh
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_e5ae0335e78259a61f16e105bf289391.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_e5ae0335e78259a61f16e105bf289391.html", "unified_diff": "@@ -117,27 +117,27 @@\n  vtk\n  \n \n \n \n \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

     dgfparser.hh
     
     gmshreader.hh
     gmshreader.hh
     
     gmshwriter.hh
     gmshwriter.hh
     
     gnuplot.hh
     Provides gnuplot output for 1D Grids.
     gnuplot.hh
     Provides gnuplot output for 1D Grids.
     
     printgrid.hh
     printgrid.hh
     
     starcdreader.hh
     starcdreader.hh
     
     vtk.hh
     Convenience header which includes all available VTK writers.
     vtk.hh
     Convenience header which includes all available VTK writers.
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dir_e674d52c20e1458e445f655f7f65f7ce.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dir_e674d52c20e1458e445f655f7f65f7ce.html", "unified_diff": "@@ -87,48 +87,48 @@\n \"\"\n \"\"\n
    \n \n \n \n-\n-\n+\n+\n \n \n \n-\n+\n \n-\n-\n+\n+\n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n@@ -137,29 +137,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+\n+\n \n

    \n Files

     adaptcallback.hh
     interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
     adaptcallback.hh
     interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
     
     backuprestore.hh
     
     boundaryprojection.hh
     boundaryprojection.hh
     
     boundarysegment.hh
     Base class for grid boundary segments of arbitrary geometry.
     boundarysegment.hh
     Base class for grid boundary segments of arbitrary geometry.
     
     capabilities.hh
     A set of traits classes to store static information about grid implementation.
     
     datahandleif.hh
     Describes the parallel communication interface class for MessageBuffers and DataHandles.
     
     defaultgridview.hh
     defaultgridview.hh
     
     entity.hh
     
     entityiterator.hh
     
     entityseed.hh
     Interface class EntitySeed.
     
     exceptions.hh
     exceptions.hh
     
     geometry.hh
     Wrapper and interface classes for element geometries.
     
     grid.hh
     Different resources needed by all grid implementations.
     
     gridenums.hh
     gridenums.hh
     
     gridfactory.hh
     Provide a generic factory class for unstructured grids.
     
     gridinfo.hh
     Some functions to list information about a grid.
     
     indexidset.hh
     Provides base classes for index and id sets.
     
     intersection.hh
     
     intersectioniterator.hh
     
     mapper.hh
     Provides classes with basic mappers which are used to attach data to a grid.
     mapper.hh
     Provides classes with basic mappers which are used to attach data to a grid.
     
     mcmgmapper.hh
     Mapper for multiple codim and multiple geometry types.
     mcmgmapper.hh
     Mapper for multiple codim and multiple geometry types.
     
     partitionset.hh
     partitionset.hh
     
     rangegenerators.hh
     rangegenerators.hh
     
     scsgmapper.hh
     Mapper classes are used to attach data to a grid.
     scsgmapper.hh
     Mapper classes are used to attach data to a grid.
     
     sizecache.hh
     Provides size cache classes to implement the grids size method efficiently.
     sizecache.hh
     Provides size cache classes to implement the grids size method efficiently.
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/dune-grid.tag.gz", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/dune-grid.tag.gz", "unified_diff": null, "details": [{"source1": "dune-grid.tag", "source2": "dune-grid.tag", "unified_diff": null, "details": [{"source1": "dune-grid.tag", "source2": "dune-grid.tag", "unified_diff": "@@ -19,97 +19,97 @@\n dune/grid/modules.txt\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/\n a07088.html\n \n \n recipe-integration.cc\n /build/reproducible-path/dune-grid-2.10.0/doc/recipes/\n- a00146.html\n+ a00143.html\n dune/grid/yaspgrid.hh\n \n int\n main\n- a00146.html\n+ a00143.html\n a3c04138a5bfe5d72780bb7e82a18e627\n (int argc, char **argv)\n \n \n \n recipe-iterate-over-grid.cc\n /build/reproducible-path/dune-grid-2.10.0/doc/recipes/\n- a00149.html\n+ a00146.html\n dune/grid/yaspgrid.hh\n \n int\n main\n- a00149.html\n+ a00146.html\n a3c04138a5bfe5d72780bb7e82a18e627\n (int argc, char **argv)\n \n \n \n albertagrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/\n a00722.html\n- albertagrid/agrid.hh\n+ albertagrid/agrid.hh\n albertagrid/gridfactory.hh\n albertagrid/structuredgridfactory.hh\n albertagrid/persistentcontainer.hh\n \n \n agrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00659.html\n+ a00698.html\n dune/grid/common/grid.hh\n dune/grid/common/gridfactory.hh\n- dune/grid/common/adaptcallback.hh\n- dune/grid/common/sizecache.hh\n+ dune/grid/common/adaptcallback.hh\n+ dune/grid/common/sizecache.hh\n albertaheader.hh\n- dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/misc.hh\n dune/grid/albertagrid/capabilities.hh\n dune/grid/albertagrid/backuprestore.hh\n- dune/grid/albertagrid/coordcache.hh\n+ dune/grid/albertagrid/coordcache.hh\n dune/grid/albertagrid/gridfamily.hh\n- dune/grid/albertagrid/level.hh\n+ dune/grid/albertagrid/level.hh\n dune/grid/albertagrid/intersection.hh\n dune/grid/albertagrid/intersectioniterator.hh\n dune/grid/albertagrid/datahandle.hh\n dune/grid/albertagrid/entityseed.hh\n indexsets.hh\n geometry.hh\n entity.hh\n- hierarchiciterator.hh\n- treeiterator.hh\n- leveliterator.hh\n- leafiterator.hh\n- albertagrid.cc\n+ hierarchiciterator.hh\n+ treeiterator.hh\n+ leveliterator.hh\n+ leafiterator.hh\n+ albertagrid.cc\n dune/grid/albertagrid/undefine-3.0.hh\n Dune::AlbertaGrid\n Dune\n \n #define\n _ALBERTA_H_\n- a00659.html\n+ a00698.html\n a1067446415cacb23802d0f38ff2017d7\n \n \n \n \n albertagrid.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00689.html\n- geometry.cc\n- entity.cc\n- intersection.cc\n+ a00716.html\n+ geometry.cc\n+ entity.cc\n+ intersection.cc\n Dune\n Dune::Alberta\n \n #define\n DUNE_ALBERTAGRID_CC\n- a00689.html\n+ a00716.html\n a53133f6d063b9eb2237193ae58eef706\n \n \n \n \n albertaheader.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n@@ -156,25 +156,25 @@\n a0c6debd1ce74543115f35b5661f4f48b\n \n \n \n \n albertareader.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00674.html\n+ a00668.html\n dune/grid/common/grid.hh\n dune/grid/common/gridfactory.hh\n- dune/grid/albertagrid/macrodata.hh\n+ dune/grid/albertagrid/macrodata.hh\n Dune::AlbertaReader\n Dune\n \n \n algebra.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00656.html\n+ a00671.html\n Dune\n Dune::Alberta\n \n \n albertagrid/backuprestore.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07091.html\n@@ -191,15 +191,15 @@\n Dune\n \n \n geometrygrid/backuprestore.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07097.html\n dune/grid/common/backuprestore.hh\n- dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/declaration.hh\n dune/grid/geometrygrid/capabilities.hh\n Dune::GeoGrid::BackupRestoreFacilities\n Dune::GeoGrid::BackupRestoreFacilities< Grid, true >\n Dune::BackupRestoreFacility< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n Dune\n Dune::GeoGrid\n \n@@ -266,15 +266,15 @@\n Dune::Capabilities\n \n \n geometrygrid/capabilities.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07109.html\n dune/grid/common/capabilities.hh\n- dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/declaration.hh\n Dune::Capabilities::hasSingleGeometryType< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n Dune::Capabilities::hasEntity< GeometryGrid< HostGrid, CoordFunction, Allocator >, codim >\n Dune::Capabilities::hasEntityIterator< GeometryGrid< HostGrid, CoordFunction, Allocator >, codim >\n Dune::Capabilities::canCommunicate< GeometryGrid< HostGrid, CoordFunction, Allocator >, codim >\n Dune::Capabilities::hasBackupRestoreFacilities< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n Dune::Capabilities::isLevelwiseConforming< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n Dune::Capabilities::isLeafwiseConforming< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n@@ -285,33 +285,33 @@\n Dune::Capabilities::CodimCache\n Dune\n Dune::Capabilities\n \n \n coordcache.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00653.html\n- dune/grid/albertagrid/meshpointer.hh\n- dune/grid/albertagrid/dofadmin.hh\n- dune/grid/albertagrid/dofvector.hh\n+ a00686.html\n+ dune/grid/albertagrid/meshpointer.hh\n+ dune/grid/albertagrid/dofadmin.hh\n+ dune/grid/albertagrid/dofvector.hh\n Dune::Alberta::CoordCache\n Dune::Alberta::CoordCache::LocalCaching\n Dune::Alberta::CoordCache::Interpolation\n Dune\n Dune::Alberta\n \n \n albertagrid/datahandle.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07112.html\n dune/grid/common/grid.hh\n- dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/misc.hh\n dune/grid/albertagrid/albertaheader.hh\n- dune/grid/albertagrid/elementinfo.hh\n- dune/grid/albertagrid/refinement.hh\n+ dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/refinement.hh\n Dune::Alberta::AdaptRestrictProlongHandler\n Dune\n Dune::Alberta\n \n \n concepts/archetypes/datahandle.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/concepts/archetypes/\n@@ -356,176 +356,176 @@\n \n \n \n io/file/dgfparser/dgfparser.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n a07127.html\n dune/grid/io/file/dgfparser/dgfparser.hh\n- dune/grid/io/file/dgfparser/blocks/boundarydom.hh\n+ dune/grid/io/file/dgfparser/blocks/boundarydom.hh\n Dune::DGFPrintInfo\n Dune\n \n \n albertagrid/dgfparser.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07130.html\n dune/grid/albertagrid.hh\n dune/grid/albertagrid/gridfactory.hh\n dune/grid/io/file/dgfparser/dgfparser.hh\n dune/grid/io/file/dgfparser/blocks/projection.hh\n dune/grid/common/intersection.hh\n- dune/grid/io/file/dgfparser/parser.hh\n+ dune/grid/io/file/dgfparser/parser.hh\n Dune::DGFGridFactory< AlbertaGrid< dim, dimworld > >\n Dune::DGFGridInfo< AlbertaGrid< dim, dimworld > >\n Dune\n \n \n io/file/dgfparser.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n a07133.html\n dgfparser/dgfparser.hh\n dune/grid/albertagrid/dgfparser.hh\n- dgfparser/dgfug.hh\n- dgfparser/dgfoned.hh\n- dgfparser/dgfyasp.hh\n- dgfparser/dgfgeogrid.hh\n- dgfparser/dgfidentitygrid.hh\n+ dgfparser/dgfug.hh\n+ dgfparser/dgfoned.hh\n+ dgfparser/dgfyasp.hh\n+ dgfparser/dgfgeogrid.hh\n+ dgfparser/dgfidentitygrid.hh\n \n \n io/file/dgfparser/dgfparser.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n a07136.html\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n dune/grid/common/datahandleif.hh\n- dune/grid/io/file/dgfparser/dgfexception.hh\n- dune/grid/io/file/dgfparser/entitykey.hh\n- dune/grid/io/file/dgfparser/parser.hh\n- dune/grid/io/file/dgfparser/gridptr.hh\n- dune/grid/io/file/dgfparser/macrogrid.hh\n- dune/grid/io/file/dgfparser/dgfgridfactory.hh\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n- dune/grid/io/file/dgfparser/blocks/boundarydom.hh\n- dune/grid/io/file/dgfparser/blocks/boundaryseg.hh\n- dune/grid/io/file/dgfparser/blocks/cube.hh\n- dune/grid/io/file/dgfparser/blocks/dim.hh\n- dune/grid/io/file/dgfparser/blocks/general.hh\n- dune/grid/io/file/dgfparser/blocks/gridparameter.hh\n- dune/grid/io/file/dgfparser/blocks/interval.hh\n- dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh\n- dune/grid/io/file/dgfparser/blocks/polygon.hh\n- dune/grid/io/file/dgfparser/blocks/polyhedron.hh\n+ dune/grid/io/file/dgfparser/dgfexception.hh\n+ dune/grid/io/file/dgfparser/entitykey.hh\n+ dune/grid/io/file/dgfparser/parser.hh\n+ dune/grid/io/file/dgfparser/gridptr.hh\n+ dune/grid/io/file/dgfparser/macrogrid.hh\n+ dune/grid/io/file/dgfparser/dgfgridfactory.hh\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n+ dune/grid/io/file/dgfparser/blocks/boundarydom.hh\n+ dune/grid/io/file/dgfparser/blocks/boundaryseg.hh\n+ dune/grid/io/file/dgfparser/blocks/cube.hh\n+ dune/grid/io/file/dgfparser/blocks/dim.hh\n+ dune/grid/io/file/dgfparser/blocks/general.hh\n+ dune/grid/io/file/dgfparser/blocks/gridparameter.hh\n+ dune/grid/io/file/dgfparser/blocks/interval.hh\n+ dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh\n+ dune/grid/io/file/dgfparser/blocks/polygon.hh\n+ dune/grid/io/file/dgfparser/blocks/polyhedron.hh\n dune/grid/io/file/dgfparser/blocks/projection.hh\n- dune/grid/io/file/dgfparser/blocks/simplex.hh\n- dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh\n- dune/grid/io/file/dgfparser/blocks/vertex.hh\n+ dune/grid/io/file/dgfparser/blocks/simplex.hh\n+ dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh\n+ dune/grid/io/file/dgfparser/blocks/vertex.hh\n Dune::DGFGridInfo\n Dune\n \n \n dofadmin.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00617.html\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ a00650.html\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/elementinfo.hh\n Dune::Alberta::DofAccess\n Dune::Alberta::HierarchyDofNumbering\n Dune\n Dune::Alberta\n \n \n dofvector.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00668.html\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/elementinfo.hh\n- dune/grid/albertagrid/refinement.hh\n+ a00704.html\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/refinement.hh\n Dune::Alberta::DofVectorProvider< int >\n Dune::Alberta::DofVectorProvider< signed char >\n Dune::Alberta::DofVectorProvider< unsigned char >\n Dune::Alberta::DofVectorProvider< Real >\n Dune::Alberta::DofVectorProvider< GlobalVector >\n Dune::Alberta::DofVectorPointer\n Dune\n Dune::Alberta\n \n \n elementinfo.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00683.html\n- dune/grid/albertagrid/elementinfo.hh\n- dune/grid/albertagrid/meshpointer.hh\n+ a00626.html\n+ dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/meshpointer.hh\n Dune\n Dune::Alberta\n \n \n elementinfo.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00620.html\n- dune/grid/albertagrid/geometrycache.hh\n- dune/grid/albertagrid/macroelement.hh\n+ a00659.html\n+ dune/grid/albertagrid/geometrycache.hh\n+ dune/grid/albertagrid/macroelement.hh\n Dune::Alberta::ElementInfo\n Dune::Alberta::ElementInfo::Instance\n Dune::Alberta::ElementInfo::Stack\n Dune::Alberta::ElementInfo::Seed\n Dune\n Dune::Alberta\n \n \n entity.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00629.html\n+ a00632.html\n Dune\n \n #define\n DUNE_ALBERTA_ENTITY_CC\n- a00629.html\n+ a00632.html\n a52a3d21da8af78e4568aaed1c24da792\n \n \n \n \n albertagrid/entity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07139.html\n dune/grid/common/entity.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/elementinfo.hh\n dune/grid/albertagrid/entityseed.hh\n dune/grid/albertagrid/geometry.hh\n Dune::AlbertaGridEntity\n Dune::AlbertaGridEntity::Codim\n Dune::AlbertaGridEntity< 0, dim, Grid >\n Dune::AlbertaGridEntity< 0, dim, Grid >::Codim\n Dune\n \n \n common/entity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n a07142.html\n grid.hh\n- rangegenerators.hh\n+ rangegenerators.hh\n Dune::Entity\n Dune::Entity< 0, dim, GridImp, EntityImp >\n Dune::Entity< 0, dim, GridImp, EntityImp >::Codim\n Dune::EntityDefaultImplementation\n Dune::EntityDefaultImplementation< 0, dim, GridImp, EntityImp >\n Dune\n \n \n concepts/archetypes/entity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/concepts/archetypes/\n a07148.html\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n dune/grid/concepts/archetypes/entity.hh\n dune/grid/concepts/archetypes/geometry.hh\n \n \n concepts/entity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/concepts/\n a07145.html\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n dune/grid/concepts/geometry.hh\n dune/grid/concepts/archetypes/entity.hh\n Dune\n Dune::Concept\n Dune::Concept::EntitySeed\n Dune::Concept::EntityGeneral\n Dune::Concept::EntityExtended\n@@ -533,28 +533,28 @@\n \n \n geometrygrid/entity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07151.html\n dune/grid/common/grid.hh\n dune/grid/geometrygrid/capabilities.hh\n- dune/grid/geometrygrid/cornerstorage.hh\n+ dune/grid/geometrygrid/cornerstorage.hh\n Dune::GeoGrid::EntityBase< codim, Grid, false >\n Dune::GeoGrid::EntityBase< codim, Grid, true >\n Dune::GeoGrid::Entity\n Dune::GeoGrid::Entity< 0, dim, Grid >\n Dune\n Dune::GeoGrid\n \n \n albertagrid/entityseed.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07154.html\n- dune/grid/albertagrid/elementinfo.hh\n- dune/grid/albertagrid/meshpointer.hh\n+ dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/meshpointer.hh\n Dune::AlbertaGridEntitySeed< codim, const AlbertaGrid< dim, dimworld > >\n Dune::AlbertaGridEntitySeed< 0, const AlbertaGrid< dim, dimworld > >\n Dune\n \n \n common/entityseed.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n@@ -573,36 +573,36 @@\n Dune::GeoGrid::EntitySeed< codim, Grd, true >\n Dune\n Dune::GeoGrid\n \n \n geometry.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00677.html\n- dune/grid/albertagrid/algebra.hh\n+ a00665.html\n+ dune/grid/albertagrid/algebra.hh\n dune/grid/albertagrid/geometry.hh\n- dune/grid/albertagrid/refinement.hh\n+ dune/grid/albertagrid/refinement.hh\n Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader\n Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader\n Dune\n \n #define\n DUNE_ALBERTA_GEOMETRY_CC\n- a00677.html\n+ a00665.html\n a085bbe8bddf730dd71a187dceae4e610\n \n \n \n \n albertagrid/geometry.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07163.html\n dune/grid/common/geometry.hh\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/elementinfo.hh\n Dune::AlbertaGridCoordinateReader\n Dune::AlbertaGridGeometry\n Dune::AlbertaGridGlobalGeometry\n Dune::AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >\n Dune::AlbertaGridLocalGeometryProvider\n Dune::AlbertaGridLocalGeometryProvider::Codim\n Dune\n@@ -632,62 +632,62 @@\n Dune::Concept::Geometry\n \n \n geometrygrid/geometry.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07175.html\n dune/grid/common/capabilities.hh\n- dune/grid/geometrygrid/cornerstorage.hh\n+ dune/grid/geometrygrid/cornerstorage.hh\n Dune::GeoGrid::InferHasSingleGeometryType\n Dune::GeoGrid::InferHasSingleGeometryType< hasSingleGeometryType, dim, 1 >\n Dune::GeoGrid::InferHasSingleGeometryType< hasSingleGeometryType, dim, 0 >\n Dune::GeoGrid::GeometryTraits\n Dune::GeoGrid::GeometryTraits::CornerStorage\n Dune::GeoGrid::GeometryTraits::hasSingleGeometryType\n Dune::GeoGrid::Geometry\n Dune::GeoGrid::Geometry::Mapping\n Dune\n Dune::GeoGrid\n \n \n geometrycache.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00662.html\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/algebra.hh\n+ a00647.html\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/algebra.hh\n Dune::Alberta::GeometryCache\n Dune::Alberta::GeometryCacheProxy\n Dune\n Dune::Alberta\n \n \n geometryreference.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00698.html\n+ a00614.html\n dune/grid/common/geometry.hh\n Dune::GeometryReference\n Dune::LocalGeometryReference\n Dune\n \n \n albertagrid/gridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07178.html\n dune/grid/common/gridfactory.hh\n- dune/grid/albertagrid/agrid.hh\n+ dune/grid/albertagrid/agrid.hh\n Dune::GridFactory< AlbertaGrid< dim, dimworld > >\n Dune::GridFactory< AlbertaGrid< dim, dimworld > >::Codim\n Dune::GridFactory< AlbertaGrid< dim, dimworld > >::ProjectionFactory\n Dune\n \n \n common/gridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n a07181.html\n- dune/grid/common/boundarysegment.hh\n+ dune/grid/common/boundarysegment.hh\n dune/grid/common/grid.hh\n Dune::GridFactoryInterface\n Dune::GridFactoryInterface::Codim\n Dune::GridFactory\n Dune\n \n \n@@ -695,37 +695,37 @@\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07184.html\n dune/grid/common/entity.hh\n dune/grid/common/geometry.hh\n dune/grid/common/intersection.hh\n dune/grid/common/intersectioniterator.hh\n dune/grid/common/entityiterator.hh\n- dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/misc.hh\n dune/grid/albertagrid/gridview.hh\n- dune/grid/albertagrid/geometryreference.hh\n+ dune/grid/albertagrid/geometryreference.hh\n Dune::AlbertaGridFamily\n Dune::AlbertaGridFamily::Traits\n Dune::AlbertaGridFamily::Traits::Codim\n Dune::AlbertaGridFamily::Traits::Codim::Partition\n Dune\n \n \n geometrygrid/gridfamily.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07187.html\n dune/grid/common/grid.hh\n dune/grid/geometrygrid/capabilities.hh\n- dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/declaration.hh\n dune/grid/geometrygrid/entity.hh\n dune/grid/geometrygrid/entityseed.hh\n dune/grid/geometrygrid/geometry.hh\n dune/grid/geometrygrid/gridview.hh\n dune/grid/geometrygrid/intersection.hh\n dune/grid/geometrygrid/intersectioniterator.hh\n- dune/grid/geometrygrid/iterator.hh\n+ dune/grid/geometrygrid/iterator.hh\n dune/grid/geometrygrid/idset.hh\n dune/grid/geometrygrid/indexsets.hh\n Dune::GeoGrid::ExportParams\n Dune::GeoGrid::GridFamily\n Dune::GeoGrid::GridFamily::Traits\n Dune::GeoGrid::GridFamily::Traits::Codim\n Dune::GeoGrid::GridFamily::Traits::Codim::Partition\n@@ -752,27 +752,27 @@\n Dune\n \n \n common/gridview.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n a07193.html\n dune/grid/common/datahandleif.hh\n- dune/grid/common/rangegenerators.hh\n+ dune/grid/common/rangegenerators.hh\n Dune::GridView\n Dune::GridView::Codim\n Dune::GridView::Codim::Partition\n Dune::GridView::DeprecatedMethodEmptyFuture\n Dune\n \n \n concepts/gridview.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/concepts/\n a07196.html\n dune/grid/common/capabilities.hh\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n dune/grid/concepts/entityiterator.hh\n dune/grid/concepts/geometry.hh\n dune/grid/concepts/indexidset.hh\n dune/grid/concepts/intersection.hh\n dune/grid/concepts/intersectioniterator.hh\n dune/grid/concepts/archetypes/datahandle.hh\n Dune\n@@ -785,100 +785,100 @@\n a07199.html\n dune/grid/common/capabilities.hh\n dune/grid/common/gridview.hh\n dune/grid/geometrygrid/datahandle.hh\n dune/grid/geometrygrid/indexsets.hh\n dune/grid/geometrygrid/intersection.hh\n dune/grid/geometrygrid/intersectioniterator.hh\n- dune/grid/geometrygrid/iterator.hh\n+ dune/grid/geometrygrid/iterator.hh\n Dune::GeoGrid::GridViewTraits\n Dune::GeoGrid::GridViewTraits::Codim\n Dune::GeoGrid::GridViewTraits::Codim::Partition\n Dune::GeoGrid::GridView\n Dune::GeoGrid::GridView::Codim\n Dune\n Dune::GeoGrid\n \n \n hierarchiciterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00614.html\n- dune/grid/albertagrid/elementinfo.hh\n+ a00692.html\n+ dune/grid/albertagrid/elementinfo.hh\n dune/grid/common/entityiterator.hh\n Dune::AlbertaGridHierarchicIterator\n Dune\n \n \n indexsets.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00707.html\n+ a00644.html\n dune/grid/albertagrid/indexsets.hh\n- dune/grid/albertagrid/agrid.hh\n+ dune/grid/albertagrid/agrid.hh\n Dune\n \n \n albertagrid/indexsets.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07202.html\n dune/grid/common/grid.hh\n dune/grid/common/indexidset.hh\n- dune/grid/albertagrid/indexstack.hh\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/dofadmin.hh\n- dune/grid/albertagrid/dofvector.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/indexstack.hh\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/dofadmin.hh\n+ dune/grid/albertagrid/dofvector.hh\n+ dune/grid/albertagrid/elementinfo.hh\n dune/grid/albertagrid/gridfamily.hh\n Dune::AlbertaGridHierarchicIndexSet\n Dune::AlbertaGridHierarchicIndexSet::InitEntityNumber\n Dune::AlbertaGridIndexSet\n Dune::AlbertaGridIdSet\n Dune\n Dune::Alberta\n \n \n geometrygrid/indexsets.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07205.html\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n dune/grid/common/indexidset.hh\n- dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/declaration.hh\n Dune::GeoGrid::IndexSet\n Dune\n Dune::GeoGrid\n \n \n indexstack.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00644.html\n+ a00674.html\n Dune::IndexStack\n Dune\n \n \n intersection.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00650.html\n+ a00695.html\n dune/grid/albertagrid/intersection.hh\n Dune::AlbertaGridIntersectionBase::GlobalCoordReader\n Dune::AlbertaGridIntersectionBase::LocalCoordReader\n Dune\n \n #define\n DUNE_ALBERTA_INTERSECTION_CC\n- a00650.html\n+ a00695.html\n a8d4a192c9f43ac0db61703b46cb6a297\n \n \n \n \n albertagrid/intersection.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07208.html\n dune/grid/common/intersection.hh\n dune/grid/albertagrid/transformation.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/elementinfo.hh\n dune/grid/albertagrid/geometry.hh\n Dune::AlbertaGridIntersectionBase\n Dune::AlbertaGridLeafIntersection\n Dune\n \n \n common/intersection.hh\n@@ -899,16 +899,16 @@\n Dune::Concept\n Dune::Concept::Intersection\n \n \n geometrygrid/intersection.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07217.html\n- dune/grid/geometrygrid/declaration.hh\n- dune/grid/geometrygrid/cornerstorage.hh\n+ dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/cornerstorage.hh\n Dune::GeoGrid::Intersection\n Dune\n Dune::GeoGrid\n \n \n albertagrid/intersectioniterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n@@ -947,99 +947,99 @@\n Dune::GeoGrid::IntersectionIterator\n Dune\n Dune::GeoGrid\n \n \n leafiterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00626.html\n+ a00680.html\n dune/grid/common/entityiterator.hh\n- dune/grid/albertagrid/treeiterator.hh\n+ dune/grid/albertagrid/treeiterator.hh\n Dune::AlbertaGridLeafIterator\n Dune::AlbertaGridLeafIterator< codim, Ghost_Partition, GridImp >\n Dune\n \n \n level.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00635.html\n- dune/grid/albertagrid/meshpointer.hh\n- dune/grid/albertagrid/dofadmin.hh\n- dune/grid/albertagrid/dofvector.hh\n+ a00707.html\n+ dune/grid/albertagrid/meshpointer.hh\n+ dune/grid/albertagrid/dofadmin.hh\n+ dune/grid/albertagrid/dofvector.hh\n Dune::AlbertaGridLevelProvider\n Dune::AlbertaGridLevelProvider::SetLocal\n Dune::AlbertaGridLevelProvider::CalcMaxLevel\n Dune::AlbertaGridLevelProvider::Interpolation\n Dune\n \n \n leveliterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00719.html\n+ a00635.html\n dune/grid/common/entityiterator.hh\n- dune/grid/albertagrid/treeiterator.hh\n+ dune/grid/albertagrid/treeiterator.hh\n Dune::AlbertaGridLevelIterator\n Dune::AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp >\n Dune\n \n \n macrodata.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00716.html\n- dune/grid/common/exceptions.hh\n- dune/grid/albertagrid/macrodata.hh\n+ a00719.html\n+ dune/grid/common/exceptions.hh\n+ dune/grid/albertagrid/macrodata.hh\n Dune\n Dune::Alberta\n \n \n macrodata.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00695.html\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/algebra.hh\n+ a00662.html\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/algebra.hh\n dune/grid/albertagrid/albertaheader.hh\n Dune::Alberta::MacroData\n Dune::Alberta::MacroData::Library\n Dune\n Dune::Alberta\n \n \n macroelement.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00686.html\n- dune/grid/albertagrid/misc.hh\n+ a00701.html\n+ dune/grid/albertagrid/misc.hh\n Dune::Alberta::MacroElement\n Dune\n Dune::Alberta\n \n \n meshpointer.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00647.html\n- dune/grid/albertagrid/meshpointer.hh\n+ a00710.html\n+ dune/grid/albertagrid/meshpointer.hh\n Dune\n Dune::Alberta\n \n \n meshpointer.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00671.html\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/elementinfo.hh\n- dune/grid/albertagrid/macrodata.hh\n+ a00623.html\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/macrodata.hh\n dune/grid/albertagrid/projection.hh\n Dune::Alberta::MeshPointer\n Dune::Alberta::MeshPointer::MacroIterator\n Dune\n Dune::Alberta\n \n \n misc.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00623.html\n+ a00683.html\n dune/grid/albertagrid/albertaheader.hh\n Dune::AlbertaError\n Dune::AlbertaIOError\n Dune::Alberta::GlobalSpace\n Dune::Alberta::NumSubEntities< dim, 0 >\n Dune::Alberta::NumSubEntities< dim, dim >\n Dune::Alberta::NumSubEntities< 0, 0 >\n@@ -1072,81 +1072,81 @@\n Dune::Alberta::Twist< dim, 2 >\n Dune::Alberta::Twist< 2, 2 >\n Dune\n Dune::Alberta\n \n #define\n DUNE_ALBERTA_CACHE_COORDINATES\n- a00623.html\n+ a00683.html\n ac7a758bde399b9ddaa1d7efc4d08c19a\n \n \n \n \n albertagrid/persistentcontainer.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07232.html\n dune/grid/utility/persistentcontainer.hh\n- dune/grid/utility/persistentcontainervector.hh\n+ dune/grid/utility/persistentcontainervector.hh\n Dune::PersistentContainer< AlbertaGrid< dim, dimworld >, T >\n Dune\n \n \n geometrygrid/persistentcontainer.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07235.html\n- dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/declaration.hh\n dune/grid/utility/persistentcontainer.hh\n- dune/grid/utility/persistentcontainerwrapper.hh\n+ dune/grid/utility/persistentcontainerwrapper.hh\n Dune::PersistentContainer< GeometryGrid< HostGrid, CoordFunction, Allocator >, T >\n Dune\n \n \n utility/persistentcontainer.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n a07238.html\n- dune/grid/utility/persistentcontainermap.hh\n+ dune/grid/utility/persistentcontainermap.hh\n Dune::PersistentContainer\n Dune::PersistentContainer< const Grid, T >\n Dune\n std\n \n \n albertagrid/projection.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07241.html\n- dune/grid/common/boundaryprojection.hh\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/common/boundaryprojection.hh\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/elementinfo.hh\n Dune::Alberta::DuneBoundaryProjection\n Dune::Alberta::ProjectionFactoryInterface\n Dune::Alberta::ProjectionFactory\n Dune::Alberta::DuneGlobalBoundaryProjectionFactory\n Dune::Alberta::BasicNodeProjection\n Dune::Alberta::NodeProjection\n Dune\n Dune::Alberta\n \n \n io/file/dgfparser/blocks/projection.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n a07244.html\n- dune/grid/common/boundaryprojection.hh\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ dune/grid/common/boundaryprojection.hh\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::ProjectionBlock\n Dune::dgf::ProjectionBlock::Expression\n Dune\n Dune::dgf\n \n \n refinement.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00704.html\n- dune/grid/albertagrid/misc.hh\n- dune/grid/albertagrid/elementinfo.hh\n+ a00653.html\n+ dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/elementinfo.hh\n Dune::Alberta::Patch\n Dune::Alberta::ForEachInteriorSubChild< dim, 0 >\n Dune::Alberta::ForEachInteriorSubChild< dim, dim >\n Dune::Alberta::ForEachInteriorSubChild< 2, 1 >\n Dune::Alberta::ForEachInteriorSubChild< 3, 1 >\n Dune::Alberta::ForEachInteriorSubChild< 3, 2 >\n Dune::Alberta::GeometryInFather< 1 >\n@@ -1156,83 +1156,83 @@\n Dune::Alberta\n \n \n albertagrid/structuredgridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a07247.html\n dune/grid/common/gridfactory.hh\n- dune/grid/utility/multiindex.hh\n+ dune/grid/utility/multiindex.hh\n dune/grid/utility/structuredgridfactory.hh\n Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >\n Dune\n \n \n utility/structuredgridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n a07250.html\n dune/grid/common/gridfactory.hh\n- dune/grid/utility/multiindex.hh\n+ dune/grid/utility/multiindex.hh\n Dune::StructuredGridFactory\n Dune\n \n \n transformation.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a00638.html\n- dune/grid/albertagrid/misc.hh\n+ dune/grid/albertagrid/misc.hh\n Dune::AlbertaTransformation\n Dune\n \n \n treeiterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00665.html\n- dune/grid/albertagrid/elementinfo.hh\n- dune/grid/albertagrid/meshpointer.hh\n+ a00689.html\n+ dune/grid/albertagrid/elementinfo.hh\n+ dune/grid/albertagrid/meshpointer.hh\n Dune::AlbertaMarkerVector\n Dune::AlbertaMarkerVector::MarkSubEntities::Codim\n Dune::AlbertaGridTreeIterator\n Dune\n \n \n undefine-2.0.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n- a00710.html\n+ a00629.html\n \n \n undefine-3.0.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/albertagrid/\n a00641.html\n \n \n adaptcallback.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00296.html\n+ a00236.html\n Dune::AdaptDataHandleInterface\n Dune::AdaptDataHandle\n Dune::CombinedAdaptProlongRestrict\n Dune\n \n \n boundaryprojection.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00350.html\n- dune/grid/common/boundarysegment.hh\n+ a00314.html\n+ dune/grid/common/boundarysegment.hh\n dune/grid/common/datahandleif.hh\n- dune/grid/io/file/gmshreader.hh\n+ dune/grid/io/file/gmshreader.hh\n Dune::DuneBoundaryProjection\n Dune::BoundaryProjectionWrapper\n Dune::BoundarySegmentWrapper\n Dune::CircleBoundaryProjection\n Dune\n \n \n boundarysegment.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00299.html\n+ a00335.html\n Dune::BoundarySegmentBackupRestore\n Dune::BoundarySegment\n Dune\n \n \n datahandleif.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n@@ -1240,15 +1240,15 @@\n Dune::MessageBufferIF\n Dune::CommDataHandleIF\n Dune\n \n \n defaultgridview.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00335.html\n+ a00245.html\n dune/grid/common/capabilities.hh\n dune/grid/common/gridview.hh\n Dune::DefaultLevelGridViewTraits\n Dune::DefaultLevelGridViewTraits::Codim\n Dune::DefaultLevelGridViewTraits::Codim::Partition\n Dune::DefaultLevelGridView\n Dune::DefaultLevelGridView::Codim\n@@ -1276,28 +1276,28 @@\n Dune\n Dune::Concept\n Dune::Concept::EntityIterator\n \n \n exceptions.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00344.html\n+ a00353.html\n Dune::GridError\n Dune\n \n \n common/grid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n a07259.html\n- dune/grid/common/gridenums.hh\n- dune/grid/common/exceptions.hh\n+ dune/grid/common/gridenums.hh\n+ dune/grid/common/exceptions.hh\n dune/grid/common/capabilities.hh\n dune/grid/common/datahandleif.hh\n dune/grid/common/gridview.hh\n- dune/grid/common/defaultgridview.hh\n+ dune/grid/common/defaultgridview.hh\n dune/grid/common/entityseed.hh\n geometry.hh\n entity.hh\n intersection.hh\n intersectioniterator.hh\n entityiterator.hh\n indexidset.hh\n@@ -1314,15 +1314,15 @@\n Dune\n Dune::Capabilities\n \n \n concepts/grid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/concepts/\n a07262.html\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n dune/grid/common/capabilities.hh\n dune/grid/concepts/entity.hh\n dune/grid/concepts/entityiterator.hh\n dune/grid/concepts/geometry.hh\n dune/grid/concepts/gridview.hh\n dune/grid/concepts/indexidset.hh\n dune/grid/concepts/intersection.hh\n@@ -1337,40 +1337,40 @@\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a07265.html\n dune/grid/common/grid.hh\n dune/grid/geometrygrid/backuprestore.hh\n dune/grid/geometrygrid/capabilities.hh\n dune/grid/geometrygrid/datahandle.hh\n dune/grid/geometrygrid/gridfamily.hh\n- dune/grid/geometrygrid/identity.hh\n+ dune/grid/geometrygrid/identity.hh\n dune/grid/geometrygrid/persistentcontainer.hh\n Dune::DefaultCoordFunction\n Dune::GeometryGrid\n Dune::GeometryGrid::Codim\n Dune::GeometryGrid::Codim::Partition\n Dune\n \n \n gridenums.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00260.html\n+ a00242.html\n Dune\n \n \n common/gridinfo.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n a07268.html\n grid.hh\n Dune\n \n \n utility/gridinfo.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n a07271.html\n- dune/grid/common/mcmgmapper.hh\n+ dune/grid/common/mcmgmapper.hh\n Dune::EntityInfo\n Dune::GridViewInfoGTCompare\n Dune::GridViewInfo\n Dune\n \n \n common/indexidset.hh\n@@ -1393,57 +1393,57 @@\n Dune::Concept\n Dune::Concept::IndexSet\n Dune::Concept::IdSet\n \n \n mapper.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00317.html\n+ a00287.html\n Dune::Mapper\n Dune\n \n \n mcmgmapper.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00362.html\n- mapper.hh\n+ a00359.html\n+ mapper.hh\n Dune::MultipleCodimMultipleGeomTypeMapper\n Dune\n \n \n partitionset.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00332.html\n- dune/grid/common/gridenums.hh\n+ a00269.html\n+ dune/grid/common/gridenums.hh\n Dune::PartitionSet\n Dune\n Dune::Partitions\n \n \n rangegenerators.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00329.html\n- dune/grid/common/gridenums.hh\n- dune/grid/common/partitionset.hh\n+ a00362.html\n+ dune/grid/common/gridenums.hh\n+ dune/grid/common/partitionset.hh\n Dune\n \n \n scsgmapper.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00281.html\n- mapper.hh\n+ a00341.html\n+ mapper.hh\n dune/grid/common/grid.hh\n Dune::SingleCodimSingleGeomTypeMapper\n Dune\n \n \n sizecache.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/common/\n- a00353.html\n- dune/grid/common/gridenums.hh\n+ a00296.html\n+ dune/grid/common/gridenums.hh\n dune/grid/common/capabilities.hh\n Dune::SizeCache\n Dune\n \n \n archetypes/messagebuffer.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/concepts/archetypes/\n@@ -1464,76 +1464,76 @@\n a00728.html\n dune/grid/geometrygrid/grid.hh\n dune/grid/geometrygrid/persistentcontainer.hh\n \n \n cachedcoordfunction.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00581.html\n- dune/grid/common/gridenums.hh\n+ a00590.html\n+ dune/grid/common/gridenums.hh\n dune/grid/geometrygrid/capabilities.hh\n- dune/grid/geometrygrid/coordfunctioncaller.hh\n+ dune/grid/geometrygrid/coordfunctioncaller.hh\n dune/grid/utility/persistentcontainer.hh\n Dune::GeoGrid::CoordCache\n Dune::CachedCoordFunction\n Dune\n Dune::GeoGrid\n \n \n coordfunction.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00584.html\n+ a00608.html\n Dune::AnalyticalCoordFunctionInterface\n Dune::AnalyticalCoordFunction\n Dune::DiscreteCoordFunctionInterface\n Dune::DiscreteCoordFunction\n Dune\n Dune::GeoGrid\n \n \n coordfunctioncaller.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00605.html\n- dune/grid/geometrygrid/hostcorners.hh\n- dune/grid/geometrygrid/coordfunction.hh\n+ a00599.html\n+ dune/grid/geometrygrid/hostcorners.hh\n+ dune/grid/geometrygrid/coordfunction.hh\n Dune\n Dune::GeoGrid\n \n \n cornerstorage.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00566.html\n- dune/grid/geometrygrid/coordfunctioncaller.hh\n+ a00596.html\n+ dune/grid/geometrygrid/coordfunctioncaller.hh\n Dune::GeoGrid::CoordVector< mydim, Grid, false >\n Dune::GeoGrid::CoordVector< mydim, Grid, true >\n Dune::GeoGrid::IntersectionCoordVector\n Dune::GeoGrid::CornerStorage\n Dune\n Dune::GeoGrid\n \n \n declaration.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00569.html\n+ a00566.html\n Dune\n \n \n hostcorners.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00596.html\n+ a00572.html\n dune/grid/common/entity.hh\n Dune::GeoGrid::HostCorners\n Dune\n Dune::GeoGrid\n \n \n identity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00578.html\n- dune/grid/geometrygrid/coordfunction.hh\n+ a00584.html\n+ dune/grid/geometrygrid/coordfunction.hh\n Dune::IdenticalCoordFunction\n Dune\n \n \n idset.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n a00587.html\n@@ -1541,17 +1541,17 @@\n Dune::GeoGrid::IdSet\n Dune\n Dune::GeoGrid\n \n \n iterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/geometrygrid/\n- a00590.html\n+ a00575.html\n dune/grid/geometrygrid/capabilities.hh\n- dune/grid/geometrygrid/declaration.hh\n+ dune/grid/geometrygrid/declaration.hh\n dune/grid/geometrygrid/entity.hh\n Dune::GeoGrid::PartitionIteratorFilter< codim, Interior_Partition, Grid >\n Dune::GeoGrid::PartitionIteratorFilter< codim, InteriorBorder_Partition, Grid >\n Dune::GeoGrid::PartitionIteratorFilter< codim, Overlap_Partition, Grid >\n Dune::GeoGrid::PartitionIteratorFilter< codim, OverlapFront_Partition, Grid >\n Dune::GeoGrid::PartitionIteratorFilter< codim, All_Partition, Grid >\n Dune::GeoGrid::PartitionIteratorFilter< codim, Ghost_Partition, Grid >\n@@ -1563,289 +1563,289 @@\n \n \n identitygrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/\n a00731.html\n dune/grid/common/capabilities.hh\n dune/grid/common/grid.hh\n- identitygrid/identitygridgeometry.hh\n- identitygrid/identitygridentity.hh\n- identitygrid/identitygridentityseed.hh\n- identitygrid/identitygridintersectioniterator.hh\n- identitygrid/identitygridleveliterator.hh\n- identitygrid/identitygridleafiterator.hh\n- identitygrid/identitygridhierarchiciterator.hh\n- identitygrid/identitygridindexsets.hh\n+ identitygrid/identitygridgeometry.hh\n+ identitygrid/identitygridentity.hh\n+ identitygrid/identitygridentityseed.hh\n+ identitygrid/identitygridintersectioniterator.hh\n+ identitygrid/identitygridleveliterator.hh\n+ identitygrid/identitygridleafiterator.hh\n+ identitygrid/identitygridhierarchiciterator.hh\n+ identitygrid/identitygridindexsets.hh\n Dune::IdentityGridFamily\n Dune::IdentityGrid\n Dune\n Dune::Capabilities\n \n \n identitygridentity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00740.html\n+ a00734.html\n dune/grid/common/grid.hh\n Dune::IdentityGridEntity\n Dune::IdentityGridEntity< 0, dim, GridImp >\n Dune\n \n \n identitygridentityseed.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00749.html\n+ a00752.html\n Dune::IdentityGridEntitySeed\n Dune\n \n \n identitygridgeometry.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00758.html\n+ a00755.html\n dune/grid/common/geometry.hh\n Dune::IdentityGridGeometry\n Dune\n \n \n identitygridhierarchiciterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00743.html\n+ a00737.html\n Dune::IdentityGridHierarchicIterator\n Dune\n \n \n identitygridindexsets.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00755.html\n+ a00746.html\n dune/grid/common/indexidset.hh\n Dune::IdentityGridLevelIndexSet\n Dune::IdentityGridLeafIndexSet\n Dune::IdentityGridGlobalIdSet\n Dune::IdentityGridLocalIdSet\n Dune\n \n \n identitygridintersectioniterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00746.html\n- identitygridintersections.hh\n- identitygridentity.hh\n+ a00740.html\n+ identitygridintersections.hh\n+ identitygridentity.hh\n dune/grid/common/intersection.hh\n Dune::IdentityGridLeafIntersectionIterator\n Dune::IdentityGridLevelIntersectionIterator\n Dune\n \n \n identitygridintersections.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00737.html\n- identitygridleafiterator.hh\n- dune/grid/identitygrid/identitygridentity.hh\n+ a00749.html\n+ identitygridleafiterator.hh\n+ dune/grid/identitygrid/identitygridentity.hh\n Dune::IdentityGridLeafIntersection\n Dune::IdentityGridLevelIntersection\n Dune\n \n \n identitygridleafiterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00734.html\n- dune/grid/common/gridenums.hh\n+ a00743.html\n+ dune/grid/common/gridenums.hh\n Dune::IdentityGridLeafIterator\n Dune\n \n \n identitygridleveliterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/identitygrid/\n- a00752.html\n- dune/grid/common/gridenums.hh\n+ a00758.html\n+ dune/grid/common/gridenums.hh\n Dune::IdentityGridLevelIterator\n Dune\n \n \n basic.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00800.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00884.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune\n Dune::dgf\n \n \n basic.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00863.html\n- dune/grid/io/file/dgfparser/entitykey.hh\n- dune/grid/io/file/dgfparser/dgfexception.hh\n+ a00860.html\n+ dune/grid/io/file/dgfparser/entitykey.hh\n+ dune/grid/io/file/dgfparser/dgfexception.hh\n Dune::dgf::BasicBlock\n Dune\n Dune::dgf\n \n \n boundarydom.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00827.html\n- dune/grid/io/file/dgfparser/blocks/boundarydom.hh\n+ a00881.html\n+ dune/grid/io/file/dgfparser/blocks/boundarydom.hh\n Dune\n Dune::dgf\n \n \n boundarydom.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00836.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n- dune/grid/io/file/dgfparser/parser.hh\n+ a00929.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n+ dune/grid/io/file/dgfparser/parser.hh\n Dune::dgf::DomainData\n Dune::dgf::Domain\n Dune::dgf::BoundaryDomBlock\n Dune\n Dune::dgf\n \n \n boundaryseg.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00794.html\n- dune/grid/io/file/dgfparser/blocks/boundaryseg.hh\n+ a00887.html\n+ dune/grid/io/file/dgfparser/blocks/boundaryseg.hh\n Dune\n Dune::dgf\n \n \n boundaryseg.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00860.html\n- dune/grid/io/file/dgfparser/parser.hh\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00905.html\n+ dune/grid/io/file/dgfparser/parser.hh\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::BoundarySegBlock\n Dune\n Dune::dgf\n \n \n cube.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00845.html\n- dune/grid/io/file/dgfparser/blocks/cube.hh\n+ a00890.html\n+ dune/grid/io/file/dgfparser/blocks/cube.hh\n Dune\n Dune::dgf\n \n \n cube.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00854.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00908.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::CubeBlock\n Dune\n Dune::dgf\n \n \n dim.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00815.html\n- dune/grid/io/file/dgfparser/blocks/dim.hh\n+ a00926.html\n+ dune/grid/io/file/dgfparser/blocks/dim.hh\n Dune\n Dune::dgf\n \n \n dim.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00812.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00875.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::DimBlock\n Dune\n Dune::dgf\n \n \n general.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00833.html\n- dune/grid/io/file/dgfparser/blocks/general.hh\n+ a00932.html\n+ dune/grid/io/file/dgfparser/blocks/general.hh\n Dune\n Dune::dgf\n \n \n general.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00839.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00899.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::GeneralBlock\n Dune\n Dune::dgf\n \n \n gridparameter.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00806.html\n- dune/grid/io/file/dgfparser/blocks/gridparameter.hh\n+ a00869.html\n+ dune/grid/io/file/dgfparser/blocks/gridparameter.hh\n Dune\n Dune::dgf\n \n \n gridparameter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00830.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00866.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::GridParameterBlock\n Dune\n Dune::dgf\n \n \n interval.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00848.html\n- dune/grid/io/file/dgfparser/blocks/interval.hh\n+ a00920.html\n+ dune/grid/io/file/dgfparser/blocks/interval.hh\n Dune\n Dune::dgf\n \n \n interval.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00791.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00902.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::IntervalBlock\n Dune::dgf::IntervalBlock::Interval\n Dune\n Dune::dgf\n \n \n periodicfacetrans.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00797.html\n- dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh\n+ a00854.html\n+ dune/grid/io/file/dgfparser/blocks/periodicfacetrans.hh\n Dune\n Dune::dgf\n \n \n periodicfacetrans.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00809.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00914.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::PeriodicFaceTransformationBlock\n Dune::dgf::PeriodicFaceTransformationBlock::Matrix\n Dune::dgf::PeriodicFaceTransformationBlock::AffineTransformation\n Dune\n Dune::dgf\n \n \n polygon.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00788.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00923.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::PolygonBlock\n Dune\n Dune::dgf\n \n \n polyhedron.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00803.html\n- dune/grid/io/file/dgfparser/blocks/polygon.hh\n+ a00917.html\n+ dune/grid/io/file/dgfparser/blocks/polygon.hh\n Dune::dgf::PolyhedronBlock\n Dune\n Dune::dgf\n \n \n projection.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00857.html\n+ a00872.html\n dune/grid/io/file/dgfparser/blocks/projection.hh\n Dune::dgf::Expr::ConstantExpression\n Dune::dgf::Expr::VariableExpression\n Dune::dgf::Expr::FunctionCallExpression\n Dune::dgf::Expr::VectorExpression\n Dune::dgf::Expr::BracketExpression\n Dune::dgf::Expr::MinusExpression\n@@ -1861,313 +1861,313 @@\n Dune\n Dune::dgf\n Dune::dgf::Expr\n \n \n simplex.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00818.html\n- dune/grid/io/file/dgfparser/blocks/simplex.hh\n+ a00893.html\n+ dune/grid/io/file/dgfparser/blocks/simplex.hh\n Dune\n Dune::dgf\n \n \n simplex.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00821.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00857.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::SimplexBlock\n Dune\n Dune::dgf\n \n \n simplexgeneration.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00842.html\n- dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh\n+ a00911.html\n+ dune/grid/io/file/dgfparser/blocks/simplexgeneration.hh\n Dune\n Dune::dgf\n \n \n simplexgeneration.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00851.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00896.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::SimplexGenerationBlock\n Dune\n Dune::dgf\n \n \n vertex.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00866.html\n- dune/grid/io/file/dgfparser/blocks/vertex.hh\n+ a00878.html\n+ dune/grid/io/file/dgfparser/blocks/vertex.hh\n Dune\n Dune::dgf\n \n \n vertex.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/blocks/\n- a00824.html\n- dune/grid/io/file/dgfparser/blocks/basic.hh\n+ a00863.html\n+ dune/grid/io/file/dgfparser/blocks/basic.hh\n Dune::dgf::VertexBlock\n Dune\n Dune::dgf\n \n \n dgfexception.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00896.html\n+ a00941.html\n Dune::DGFException\n Dune\n \n \n dgfgeogrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00887.html\n+ a00968.html\n dune/grid/geometrygrid.hh\n dune/grid/io/file/dgfparser/dgfparser.hh\n dune/grid/io/file/dgfparser/blocks/projection.hh\n- dune/grid/utility/hostgridaccess.hh\n+ dune/grid/utility/hostgridaccess.hh\n dune/grid/common/intersection.hh\n- dune/grid/io/file/dgfparser/parser.hh\n+ dune/grid/io/file/dgfparser/parser.hh\n Dune::DGFCoordFunction\n Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, false >\n Dune::DGFCoordFunctionFactory< HostGrid, CoordFunction, true >\n Dune::DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >, false >\n Dune::DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n Dune::DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n Dune\n \n \n dgfgridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00881.html\n- dune/grid/io/file/dgfparser/dgfexception.hh\n- dune/grid/io/file/dgfparser/macrogrid.hh\n- dune/grid/io/file/dgfparser/parser.hh\n+ a00842.html\n+ dune/grid/io/file/dgfparser/dgfexception.hh\n+ dune/grid/io/file/dgfparser/macrogrid.hh\n+ dune/grid/io/file/dgfparser/parser.hh\n dune/grid/common/intersection.hh\n Dune::DGFGridFactory\n Dune\n \n \n dgfidentitygrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00869.html\n+ a00950.html\n dune/grid/identitygrid.hh\n dune/grid/io/file/dgfparser/dgfparser.hh\n- dune/grid/utility/hostgridaccess.hh\n+ dune/grid/utility/hostgridaccess.hh\n Dune::DGFGridFactory< IdentityGrid< HostGrid > >\n Dune::DGFGridInfo< IdentityGrid< HostGrid > >\n Dune\n \n \n dgfoned.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00905.html\n+ a00935.html\n dune/grid/common/intersection.hh\n dune/grid/onedgrid.hh\n dgfparser.hh\n Dune::DGFGridInfo< OneDGrid >\n Dune::DGFGridFactory< OneDGrid >\n Dune\n \n \n dgfug.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00902.html\n- dune/grid/io/file/dgfparser/dgfug.hh\n+ a00947.html\n+ dune/grid/io/file/dgfparser/dgfug.hh\n Dune\n Dune::dgf\n \n \n dgfug.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00899.html\n+ a00845.html\n dune/grid/common/intersection.hh\n dune/grid/uggrid.hh\n dgfparser.hh\n- blocks/gridparameter.hh\n+ blocks/gridparameter.hh\n Dune::dgf::UGGridParameterBlock\n Dune::DGFGridInfo< UGGrid< dim > >\n Dune::DGFGridFactory< UGGrid< dim > >\n Dune\n Dune::dgf\n \n \n dgfwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00872.html\n+ a00962.html\n dune/grid/common/grid.hh\n- dune/grid/common/rangegenerators.hh\n+ dune/grid/common/rangegenerators.hh\n Dune::DGFWriter\n Dune\n \n \n dgfyasp.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00893.html\n+ a00965.html\n dune/grid/common/intersection.hh\n dune/grid/yaspgrid.hh\n dgfparser.hh\n Dune::dgf::YaspGridParameterBlock\n Dune::DGFGridFactory< YaspGrid< dim, EquidistantCoordinates< ctype, dim > > >\n Dune::DGFGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > >\n Dune::DGFGridFactory< Dune::YaspGrid< dim, Dune::TensorProductCoordinates< ctype, dim > > >\n Dune::DGFGridInfo< YaspGrid< dim, Coordinates > >\n Dune\n Dune::dgf\n \n \n entitykey.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00782.html\n- dune/grid/io/file/dgfparser/dgfexception.hh\n- entitykey_inline.hh\n+ a00953.html\n+ dune/grid/io/file/dgfparser/dgfexception.hh\n+ entitykey_inline.hh\n Dune::DGFEntityKey\n Dune::ElementFaceUtil\n Dune\n \n \n entitykey_inline.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00890.html\n- dune/grid/io/file/dgfparser/entitykey.hh\n+ a00956.html\n+ dune/grid/io/file/dgfparser/entitykey.hh\n Dune\n \n \n gridptr.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00779.html\n- dune/grid/common/gridenums.hh\n+ a00938.html\n+ dune/grid/common/gridenums.hh\n dune/grid/common/datahandleif.hh\n dune/grid/common/intersection.hh\n- dune/grid/common/partitionset.hh\n- dune/grid/common/rangegenerators.hh\n- dune/grid/io/file/dgfparser/dgfexception.hh\n- dune/grid/io/file/dgfparser/entitykey.hh\n- dune/grid/io/file/dgfparser/parser.hh\n- dune/grid/io/file/gmshreader.hh\n+ dune/grid/common/partitionset.hh\n+ dune/grid/common/rangegenerators.hh\n+ dune/grid/io/file/dgfparser/dgfexception.hh\n+ dune/grid/io/file/dgfparser/entitykey.hh\n+ dune/grid/io/file/dgfparser/parser.hh\n+ dune/grid/io/file/gmshreader.hh\n Dune::GridPtr\n Dune::GridPtr::mygrid_ptr\n Dune::GridPtr::DataHandle\n Dune\n \n \n macrogrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00884.html\n- dune/grid/io/file/dgfparser/parser.hh\n+ a00959.html\n+ dune/grid/io/file/dgfparser/parser.hh\n Dune::MacroGrid\n Dune\n \n \n parser.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/\n- a00785.html\n- dune/grid/io/file/dgfparser/entitykey.hh\n+ a00944.html\n+ dune/grid/io/file/dgfparser/entitykey.hh\n Dune::DGFBoundaryParameter\n Dune::DuneGridFormatParser\n Dune\n \n \n dgf2dgf.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/utils/\n- a00878.html\n- dune/grid/io/file/dgfparser/dgfwriter.hh\n+ a00851.html\n+ dune/grid/io/file/dgfparser/dgfwriter.hh\n \n int\n main\n- a00878.html\n+ a00851.html\n a0ddf1224851353fc92bfbff6f499fa97\n (int argc, char *argv[])\n \n \n \n gmsh2dgf.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/dgfparser/utils/\n- a00875.html\n- dune/grid/io/file/gmshreader.hh\n- dune/grid/io/file/dgfparser/dgfwriter.hh\n+ a00848.html\n+ dune/grid/io/file/gmshreader.hh\n+ dune/grid/io/file/dgfparser/dgfwriter.hh\n \n int\n main\n- a00875.html\n+ a00848.html\n a0ddf1224851353fc92bfbff6f499fa97\n (int argc, char *argv[])\n \n \n \n gmshreader.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n- a00764.html\n- dune/grid/common/boundarysegment.hh\n+ a00761.html\n+ dune/grid/common/boundarysegment.hh\n dune/grid/common/gridfactory.hh\n Dune::GmshReaderOptions\n Dune::GmshReaderParser\n Dune::GmshReader\n Dune\n Dune::Gmsh\n \n \n gmshwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n- a00776.html\n+ a00836.html\n dune/grid/common/grid.hh\n- dune/grid/common/mcmgmapper.hh\n+ dune/grid/common/mcmgmapper.hh\n Dune::GmshWriter\n Dune\n \n \n gnuplot.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n- a00767.html\n+ a00971.html\n dune/grid/common/grid.hh\n- gnuplot/gnuplot.cc\n+ gnuplot/gnuplot.cc\n Dune::GnuplotWriter\n Dune::LeafGnuplotWriter\n Dune::LevelGnuplotWriter\n Dune\n \n \n gnuplot.cc\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/gnuplot/\n- a00773.html\n- ../gnuplot.hh\n+ a00764.html\n+ ../gnuplot.hh\n Dune\n \n \n printgrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n- a00761.html\n- dune/grid/common/mcmgmapper.hh\n+ a00839.html\n+ dune/grid/common/mcmgmapper.hh\n Dune\n \n \n starcdreader.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n- a00908.html\n+ a00770.html\n dune/grid/common/gridfactory.hh\n Dune::StarCDReader\n Dune\n \n \n vtk.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/\n- a00770.html\n- vtk/boundarywriter.hh\n- vtk/subsamplingvtkwriter.hh\n- vtk/vtksequencewriter.hh\n- vtk/vtkwriter.hh\n- vtk/volumewriter.hh\n+ a00767.html\n+ vtk/boundarywriter.hh\n+ vtk/subsamplingvtkwriter.hh\n+ vtk/vtksequencewriter.hh\n+ vtk/vtkwriter.hh\n+ vtk/volumewriter.hh\n \n \n b64enc.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00914.html\n+ a00779.html\n Dune::b64chunk\n Dune\n \n const char\n base64table\n a01067.html\n a0f8eaefa183de6150378561ac93d210a\n@@ -2180,247 +2180,247 @@\n a0f8eaefa183de6150378561ac93d210a\n []\n \n \n \n basicwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00959.html\n- dune/grid/io/file/vtk/common.hh\n- dune/grid/io/file/vtk/functionwriter.hh\n- dune/grid/io/file/vtk/pvtuwriter.hh\n- dune/grid/io/file/vtk/vtuwriter.hh\n+ a00785.html\n+ dune/grid/io/file/vtk/common.hh\n+ dune/grid/io/file/vtk/functionwriter.hh\n+ dune/grid/io/file/vtk/pvtuwriter.hh\n+ dune/grid/io/file/vtk/vtuwriter.hh\n Dune::VTK::BasicWriter\n Dune\n Dune::VTK\n \n \n boundaryiterators.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00917.html\n- dune/grid/io/file/vtk/corner.hh\n- dune/grid/io/file/vtk/corneriterator.hh\n- dune/grid/io/file/vtk/functionwriter.hh\n+ a00824.html\n+ dune/grid/io/file/vtk/corner.hh\n+ dune/grid/io/file/vtk/corneriterator.hh\n+ dune/grid/io/file/vtk/functionwriter.hh\n Dune::VTK::BoundaryIterator\n Dune::VTK::IntersectionIndexSet\n Dune::VTK::NonConformingBoundaryIteratorFactory\n Dune\n Dune::VTK\n \n \n boundarywriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00965.html\n- dune/grid/io/file/vtk/basicwriter.hh\n- dune/grid/io/file/vtk/boundaryiterators.hh\n- dune/grid/io/file/vtk/skeletonfunction.hh\n+ a00803.html\n+ dune/grid/io/file/vtk/basicwriter.hh\n+ dune/grid/io/file/vtk/boundaryiterators.hh\n+ dune/grid/io/file/vtk/skeletonfunction.hh\n Dune::VTK::NonConformingBoundaryWriter\n Dune\n Dune::VTK\n \n \n common.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00950.html\n+ a00821.html\n Dune::VTK::PrintType\n Dune::VTK::PrintType< unsigned char >\n Dune::VTK::PrintType< signed char >\n Dune::VTK::PrintType< char >\n Dune::VTK::FieldInfo\n Dune\n Dune::VTK\n \n \n corner.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00938.html\n- dune/grid/io/file/vtk/common.hh\n+ a00827.html\n+ dune/grid/io/file/vtk/common.hh\n Dune::VTK::Corner\n Dune\n Dune::VTK\n \n \n corneriterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00932.html\n- dune/grid/io/file/vtk/corner.hh\n+ a00773.html\n+ dune/grid/io/file/vtk/corner.hh\n Dune::VTK::CornerIterator\n Dune\n Dune::VTK\n \n \n dataarraywriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00962.html\n- dune/grid/io/file/vtk/streams.hh\n- dune/grid/io/file/vtk/common.hh\n+ a00791.html\n+ dune/grid/io/file/vtk/streams.hh\n+ dune/grid/io/file/vtk/common.hh\n Dune::VTK::DataArrayWriter\n Dune::VTK::AsciiDataArrayWriter\n Dune::VTK::BinaryDataArrayWriter\n Dune::VTK::AppendedRawDataArrayWriter\n Dune::VTK::AppendedBase64DataArrayWriter\n Dune::VTK::NakedBase64DataArrayWriter\n Dune::VTK::NakedRawDataArrayWriter\n Dune::VTK::DataArrayWriterFactory\n Dune\n Dune::VTK\n \n \n function.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00935.html\n- dune/grid/common/mcmgmapper.hh\n- dune/grid/io/file/vtk/common.hh\n+ a00782.html\n+ dune/grid/common/mcmgmapper.hh\n+ dune/grid/io/file/vtk/common.hh\n Dune::VTKFunction\n Dune::P0VTKFunction\n Dune::P1VTKFunction\n Dune\n \n \n functionwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00941.html\n- dune/grid/io/file/vtk/common.hh\n- dune/grid/io/file/vtk/dataarraywriter.hh\n- dune/grid/io/file/vtk/pvtuwriter.hh\n- dune/grid/io/file/vtk/vtuwriter.hh\n+ a00812.html\n+ dune/grid/io/file/vtk/common.hh\n+ dune/grid/io/file/vtk/dataarraywriter.hh\n+ dune/grid/io/file/vtk/pvtuwriter.hh\n+ dune/grid/io/file/vtk/vtuwriter.hh\n Dune::VTK::FunctionWriterBase\n Dune::VTK::VTKFunctionWriter\n Dune::VTK::CoordinatesWriter\n Dune::VTK::ConformingConnectivityWriter\n Dune::VTK::NonConformingConnectivityWriter\n Dune::VTK::OffsetsWriter\n Dune::VTK::TypesWriter\n Dune\n Dune::VTK\n \n \n pointiterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00944.html\n- dune/grid/io/file/vtk/corner.hh\n- dune/grid/io/file/vtk/corneriterator.hh\n+ a00794.html\n+ dune/grid/io/file/vtk/corner.hh\n+ dune/grid/io/file/vtk/corneriterator.hh\n Dune::VTK::PointIterator\n Dune\n Dune::VTK\n \n \n pvtuwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00971.html\n- dune/grid/io/file/vtk/common.hh\n+ a00806.html\n+ dune/grid/io/file/vtk/common.hh\n Dune::VTK::PVTUWriter\n Dune\n Dune::VTK\n \n \n skeletonfunction.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00968.html\n- dune/grid/io/file/vtk/functionwriter.hh\n- dune/grid/io/file/vtk/pvtuwriter.hh\n- dune/grid/io/file/vtk/vtuwriter.hh\n+ a00776.html\n+ dune/grid/io/file/vtk/functionwriter.hh\n+ dune/grid/io/file/vtk/pvtuwriter.hh\n+ dune/grid/io/file/vtk/vtuwriter.hh\n Dune::VTK::SkeletonFunctionTraits\n Dune::VTK::SkeletonFunctionInterface\n Dune::VTK::SkeletonFunctionWriter\n Dune\n Dune::VTK\n \n \n streams.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00926.html\n- dune/grid/io/file/vtk/b64enc.hh\n+ a00809.html\n+ dune/grid/io/file/vtk/b64enc.hh\n Dune::Base64Stream\n Dune::RawStream\n Dune\n \n \n subsamplingvtkwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00923.html\n- dune/grid/io/file/vtk/vtkwriter.hh\n- dune/grid/io/file/vtk/vtuwriter.hh\n+ a00830.html\n+ dune/grid/io/file/vtk/vtkwriter.hh\n+ dune/grid/io/file/vtk/vtuwriter.hh\n Dune::SubsamplingVTKWriter\n Dune\n \n \n volumeiterators.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00920.html\n- dune/grid/common/gridenums.hh\n- dune/grid/io/file/vtk/corner.hh\n- dune/grid/io/file/vtk/corneriterator.hh\n- dune/grid/io/file/vtk/functionwriter.hh\n- dune/grid/io/file/vtk/pointiterator.hh\n+ a00815.html\n+ dune/grid/common/gridenums.hh\n+ dune/grid/io/file/vtk/corner.hh\n+ dune/grid/io/file/vtk/corneriterator.hh\n+ dune/grid/io/file/vtk/functionwriter.hh\n+ dune/grid/io/file/vtk/pointiterator.hh\n Dune::VTK::ConformingVolumeIteratorFactory\n Dune::VTK::NonConformingVolumeIteratorFactory\n Dune\n Dune::VTK\n \n \n volumewriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00911.html\n- dune/grid/io/file/vtk/basicwriter.hh\n- dune/grid/io/file/vtk/function.hh\n- dune/grid/io/file/vtk/functionwriter.hh\n- dune/grid/io/file/vtk/volumeiterators.hh\n+ a00818.html\n+ dune/grid/io/file/vtk/basicwriter.hh\n+ dune/grid/io/file/vtk/function.hh\n+ dune/grid/io/file/vtk/functionwriter.hh\n+ dune/grid/io/file/vtk/volumeiterators.hh\n Dune::VTK::ConformingVolumeWriter\n Dune\n Dune::VTK\n \n \n vtksequencewriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00953.html\n- dune/grid/io/file/vtk/vtksequencewriterbase.hh\n- dune/grid/io/file/vtk/vtkwriter.hh\n- dune/grid/io/file/vtk/subsamplingvtkwriter.hh\n+ a00800.html\n+ dune/grid/io/file/vtk/vtksequencewriterbase.hh\n+ dune/grid/io/file/vtk/vtkwriter.hh\n+ dune/grid/io/file/vtk/subsamplingvtkwriter.hh\n Dune::VTKSequenceWriter\n Dune\n \n \n vtksequencewriterbase.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00956.html\n- dune/grid/io/file/vtk/common.hh\n- dune/grid/io/file/vtk/vtkwriter.hh\n+ a00833.html\n+ dune/grid/io/file/vtk/common.hh\n+ dune/grid/io/file/vtk/vtkwriter.hh\n Dune::VTKSequenceWriterBase\n Dune\n \n \n vtkwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00929.html\n- dune/grid/common/mcmgmapper.hh\n- dune/grid/common/gridenums.hh\n- dune/grid/io/file/vtk/common.hh\n- dune/grid/io/file/vtk/dataarraywriter.hh\n- dune/grid/io/file/vtk/function.hh\n- dune/grid/io/file/vtk/pvtuwriter.hh\n- dune/grid/io/file/vtk/streams.hh\n- dune/grid/io/file/vtk/vtuwriter.hh\n+ a00788.html\n+ dune/grid/common/mcmgmapper.hh\n+ dune/grid/common/gridenums.hh\n+ dune/grid/io/file/vtk/common.hh\n+ dune/grid/io/file/vtk/dataarraywriter.hh\n+ dune/grid/io/file/vtk/function.hh\n+ dune/grid/io/file/vtk/pvtuwriter.hh\n+ dune/grid/io/file/vtk/streams.hh\n+ dune/grid/io/file/vtk/vtuwriter.hh\n Dune::VTKWriter\n Dune::VTKWriter::VTKLocalFunction\n Dune::VTKWriter::VTKLocalFunction::FunctionWrapperBase\n Dune::VTKWriter::VTKLocalFunction::FunctionWrapper\n Dune::VTKWriter::VTKLocalFunction::GlobalFunctionWrapper\n Dune::VTKWriter::VTKLocalFunction::VTKFunctionWrapper\n Dune::VTKWriter::CellIterator\n Dune::VTKWriter::VertexIterator\n Dune::VTKWriter::CornerIterator\n Dune\n \n \n vtuwriter.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/io/file/vtk/\n- a00947.html\n- dune/grid/io/file/vtk/common.hh\n- dune/grid/io/file/vtk/dataarraywriter.hh\n+ a00797.html\n+ dune/grid/io/file/vtk/common.hh\n+ dune/grid/io/file/vtk/dataarraywriter.hh\n Dune::VTK::VTUWriter\n Dune\n Dune::VTK\n \n \n onedgrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/\n@@ -2438,15 +2438,15 @@\n Dune\n Dune::Capabilities\n \n \n uggrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/\n a00977.html\n- dune/grid/common/boundarysegment.hh\n+ dune/grid/common/boundarysegment.hh\n dune/grid/common/capabilities.hh\n dune/grid/common/grid.hh\n uggrid/uggridfactory.hh\n Dune::UGGridFamily\n Dune::UGGrid\n Dune::Capabilities::hasEntity< UGGrid< dim >, codim >\n Dune::Capabilities::hasEntityIterator< UGGrid< dim >, codim >\n@@ -2522,288 +2522,288 @@\n \n \n \n \n uggridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/uggrid/\n a00980.html\n- dune/grid/common/boundarysegment.hh\n+ dune/grid/common/boundarysegment.hh\n dune/grid/common/gridfactory.hh\n dune/grid/uggrid.hh\n Dune::GridFactory< UGGrid< dimworld > >\n Dune::GridFactory< UGGrid< dimworld > >::Codim\n Dune\n \n \n entitycommhelper.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01004.html\n- dune/grid/common/gridenums.hh\n+ a00998.html\n+ dune/grid/common/gridenums.hh\n Dune::EntityCommHelper< InteriorBorder_InteriorBorder_Interface >\n Dune::EntityCommHelper< InteriorBorder_All_Interface >\n Dune::EntityCommHelper< Overlap_OverlapFront_Interface >\n Dune::EntityCommHelper< Overlap_All_Interface >\n Dune::EntityCommHelper< All_All_Interface >\n Dune\n \n \n globalindexset.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a00995.html\n- dune/grid/common/gridenums.hh\n+ a01016.html\n+ dune/grid/common/gridenums.hh\n dune/grid/common/datahandleif.hh\n Dune::GlobalIndexSet\n Dune::GlobalIndexSet::SubPartitionTypeProvider\n Dune::GlobalIndexSet::SubPartitionTypeProvider< Entity, 0 >\n Dune\n \n \n gridinfo-gmsh-main.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01001.html\n- dune/grid/io/file/gmshreader.hh\n+ a00986.html\n+ dune/grid/io/file/gmshreader.hh\n dune/grid/utility/gridinfo.hh\n \n \n gridtype.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01016.html\n+ a01004.html\n \n \n hierarchicsearch.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a00998.html\n+ a00995.html\n dune/grid/common/grid.hh\n- dune/grid/common/gridenums.hh\n+ dune/grid/common/gridenums.hh\n Dune::HierarchicSearch\n Dune\n \n \n hostgridaccess.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a00983.html\n+ a01010.html\n dune/grid/geometrygrid/intersection.hh\n Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >\n Dune::HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >::Codim\n Dune::HostGridAccess< IdentityGrid< HG > >\n Dune::HostGridAccess< IdentityGrid< HG > >::Codim\n Dune\n \n \n multiindex.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a00992.html\n+ a01001.html\n Dune::FactoryUtilities::MultiIndex\n Dune\n Dune::FactoryUtilities\n \n \n parmetisgridpartitioner.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01013.html\n- dune/grid/utility/globalindexset.hh\n- dune/grid/common/mcmgmapper.hh\n- dune/grid/common/rangegenerators.hh\n+ a01022.html\n+ dune/grid/utility/globalindexset.hh\n+ dune/grid/common/mcmgmapper.hh\n+ dune/grid/common/rangegenerators.hh\n \n \n persistentcontainerinterface.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01007.html\n+ a00983.html\n Dune::PersistentContainerInterface\n Dune\n \n \n persistentcontainermap.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01010.html\n+ a00992.html\n dune/grid/common/capabilities.hh\n Dune::PersistentContainerMap\n Dune::PersistentContainerMap::IteratorWrapper\n Dune\n \n \n persistentcontainervector.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a00986.html\n+ a01019.html\n Dune::PersistentContainerVector\n Dune\n \n \n persistentcontainerwrapper.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01022.html\n- dune/grid/utility/hostgridaccess.hh\n+ a00989.html\n+ dune/grid/utility/hostgridaccess.hh\n dune/grid/utility/persistentcontainer.hh\n Dune::PersistentContainerWrapper\n Dune\n \n \n tensorgridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a00989.html\n+ a01007.html\n dune/grid/common/gridfactory.hh\n dune/grid/yaspgrid.hh\n- dune/grid/utility/multiindex.hh\n+ dune/grid/utility/multiindex.hh\n Dune::TensorGridFactory\n Dune::TensorGridFactoryCreator\n Dune::TensorGridFactoryCreator< YaspGrid< dim, TensorProductCoordinates< ctype, dim > > >\n Dune\n \n \n vertexorderfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/utility/\n- a01019.html\n+ a01013.html\n Dune::VertexOrderByIdFactory\n Dune::VertexOrderByIdFactory::VertexOrder\n Dune\n \n \n yaspgrid.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/\n a01025.html\n dune/grid/common/backuprestore.hh\n dune/grid/common/grid.hh\n dune/grid/common/capabilities.hh\n dune/grid/common/indexidset.hh\n dune/grid/common/datahandleif.hh\n- dune/grid/yaspgrid/coordinates.hh\n- dune/grid/yaspgrid/torus.hh\n+ dune/grid/yaspgrid/coordinates.hh\n+ dune/grid/yaspgrid/torus.hh\n dune/grid/yaspgrid/ygrid.hh\n- dune/grid/yaspgrid/yaspgridgeometry.hh\n- dune/grid/yaspgrid/yaspgridentity.hh\n- dune/grid/yaspgrid/yaspgridintersection.hh\n- dune/grid/yaspgrid/yaspgridintersectioniterator.hh\n- dune/grid/yaspgrid/yaspgridhierarchiciterator.hh\n- dune/grid/yaspgrid/yaspgridentityseed.hh\n- dune/grid/yaspgrid/yaspgridleveliterator.hh\n- dune/grid/yaspgrid/yaspgridindexsets.hh\n- dune/grid/yaspgrid/yaspgrididset.hh\n- dune/grid/yaspgrid/yaspgridpersistentcontainer.hh\n- dune/grid/yaspgrid/structuredyaspgridfactory.hh\n+ dune/grid/yaspgrid/yaspgridgeometry.hh\n+ dune/grid/yaspgrid/yaspgridentity.hh\n+ dune/grid/yaspgrid/yaspgridintersection.hh\n+ dune/grid/yaspgrid/yaspgridintersectioniterator.hh\n+ dune/grid/yaspgrid/yaspgridhierarchiciterator.hh\n+ dune/grid/yaspgrid/yaspgridentityseed.hh\n+ dune/grid/yaspgrid/yaspgridleveliterator.hh\n+ dune/grid/yaspgrid/yaspgridindexsets.hh\n+ dune/grid/yaspgrid/yaspgrididset.hh\n+ dune/grid/yaspgrid/yaspgridpersistentcontainer.hh\n+ dune/grid/yaspgrid/structuredyaspgridfactory.hh\n dune/grid/yaspgrid/backuprestore.hh\n Dune::YaspGridFamily\n Dune::YaspGrid\n Dune\n Dune::Capabilities\n \n \n coordinates.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00227.html\n+ a00182.html\n Dune::EquidistantCoordinates\n Dune::EquidistantOffsetCoordinates\n Dune::TensorProductCoordinates\n Dune\n Dune::Yasp\n \n \n partitioning.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00176.html\n+ a00203.html\n Dune::Yasp::Partitioning\n Dune::Yasp::DefaultPartitioning\n Dune::Yasp::PowerDPartitioning\n Dune::Yasp::FixedSizePartitioning\n Dune\n Dune::Yasp\n \n \n structuredyaspgridfactory.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00224.html\n+ a00209.html\n dune/grid/utility/structuredgridfactory.hh\n Dune::StructuredGridFactory< YaspGrid< dim, EquidistantCoordinates< ctype, dim > > >\n Dune::StructuredGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > >\n Dune\n \n \n torus.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00233.html\n- dune/grid/common/exceptions.hh\n- partitioning.hh\n+ a00200.html\n+ dune/grid/common/exceptions.hh\n+ partitioning.hh\n Dune::Torus\n Dune::Torus::ProcListIterator\n Dune\n \n \n yaspgridentity.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00197.html\n+ a00170.html\n Dune::YaspEntity\n Dune::YaspEntity< 0, dim, GridImp >\n Dune::YaspEntity< 0, dim, GridImp >::Codim\n Dune::YaspEntity< dim, dim, GridImp >\n Dune\n Dune::Yasp\n \n \n yaspgridentityseed.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00188.html\n+ a00218.html\n Dune::YaspEntitySeed\n Dune\n \n \n yaspgridgeometry.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00194.html\n+ a00197.html\n Dune::YaspGeometry\n Dune::YaspGeometry< mydim, mydim, GridImp >\n Dune::YaspGeometry< 0, cdim, GridImp >\n Dune\n \n \n yaspgridhierarchiciterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00191.html\n+ a00188.html\n Dune::YaspHierarchicIterator\n Dune\n \n \n yaspgrididset.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00218.html\n+ a00194.html\n Dune::YaspGlobalIdSet\n Dune\n \n \n yaspgridindexsets.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00170.html\n+ a00164.html\n Dune::YaspIndexSet\n Dune\n \n \n yaspgridintersection.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00185.html\n+ a00167.html\n Dune::YaspIntersection\n Dune\n \n \n yaspgridintersectioniterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00164.html\n+ a00179.html\n Dune::YaspIntersectionIterator\n Dune\n \n \n yaspgridleveliterator.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00179.html\n+ a00233.html\n Dune::YaspLevelIterator\n Dune\n \n \n yaspgridpersistentcontainer.hh\n /build/reproducible-path/dune-grid-2.10.0/dune/grid/yaspgrid/\n- a00200.html\n+ a00185.html\n dune/grid/utility/persistentcontainer.hh\n- dune/grid/utility/persistentcontainervector.hh\n+ dune/grid/utility/persistentcontainervector.hh\n ../yaspgrid.hh\n Dune::YaspPersistentContainerIndex\n Dune::PersistentContainer< YaspGrid< dim, CoordCont >, T >\n Dune\n \n \n ygrid.hh\n"}]}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/files.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/files.html", "unified_diff": "@@ -73,95 +73,95 @@\n \n
    \n
    Here is a list of all files with brief descriptions:
    \n
    [detail level 1234567]
    \n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n \n-\n+\n \n \n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n \n \n-\n+\n \n-\n-\n+\n+\n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n-\n+\n \n \n-\n-\n+\n+\n \n \n-\n+\n \n-\n-\n+\n+\n \n \n-\n+\n \n \n \n-\n+\n \n \n-\n+\n \n \n \n \n \n \n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n \n \n \n \n \n \n \n@@ -172,163 +172,163 @@\n \n \n \n \n \n \n \n-\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n+\n \n \n \n \n \n \n-\n-\n+\n+\n \n \n \n \n-\n+\n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n+\n+\n+\n+\n \n-\n-\n+\n+\n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/globals.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/globals.html", "unified_diff": "@@ -70,28 +70,28 @@\n \n
    \n
    Here is a list of all file members with links to the files they belong to:
    \n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/globals_defs.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/globals_defs.html", "unified_diff": "@@ -70,26 +70,26 @@\n \n
    \n
    Here is a list of all macros with links to the files they belong to:
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/globals_func.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/globals_func.html", "unified_diff": "@@ -66,15 +66,15 @@\n
    \n \n \n \n \n
    \n
    Here is a list of all functions with links to the files they belong to:
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00149.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00143.html", "comments": ["Files 94% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: recipe-iterate-over-grid.cc File Reference\n+dune-grid: recipe-integration.cc File Reference\n \n \n \n \n \n \n \n@@ -71,27 +71,29 @@\n \n \n \n
    \n \n-
    recipe-iterate-over-grid.cc File Reference
    \n+
    recipe-integration.cc File Reference
    \n
    \n
    \n
    #include <math.h>
    \n #include <iostream>
    \n #include <dune/common/parallel/mpihelper.hh>
    \n #include <dune/common/parametertreeparser.hh>
    \n #include <dune/common/timer.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/quadraturerules.hh>
    \n #include <dune/grid/yaspgrid.hh>
    \n
      doc
     doxygen
      recipes
     recipe-integration.cc
     recipe-iterate-over-grid.cc
     recipe-integration.cc
     recipe-iterate-over-grid.cc
      dune
      grid
      albertagrid
     agrid.hhAlbertaGrid class
     albertagrid.cc
     agrid.hhAlbertaGrid class
     albertagrid.cc
     albertaheader.hh
     albertareader.hh
     algebra.hh
     albertareader.hh
     algebra.hh
     backuprestore.hh
     capabilities.hh
     coordcache.hh
     coordcache.hh
     datahandle.hh
     dgfparser.cc
     dgfparser.hh
     dofadmin.hh
     dofvector.hh
     elementinfo.ccWrapper for ALBERTA's el_info structure
     elementinfo.hhWrapper for ALBERTA's el_info structure
     entity.cc
     dofadmin.hh
     dofvector.hh
     elementinfo.ccWrapper for ALBERTA's el_info structure
     elementinfo.hhWrapper for ALBERTA's el_info structure
     entity.cc
     entity.hh
     entityseed.hh
     geometry.cc
     geometry.cc
     geometry.hh
     geometrycache.hh
     geometryreference.hhWrapper and interface classes for element geometries
     geometrycache.hh
     geometryreference.hhWrapper and interface classes for element geometries
     gridfactory.hhSpecialization of the generic GridFactory for AlbertaGrid
     gridfamily.hhGridFamily for AlbertaGrid
     gridview.hh
     hierarchiciterator.hh
     indexsets.cc
     hierarchiciterator.hh
     indexsets.cc
     indexsets.hh
     indexstack.hhProvides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid)
     intersection.cc
     indexstack.hhProvides an index stack that supplies indices for element numbering for a grid (i.e. AlbertaGrid and ALUGrid)
     intersection.cc
     intersection.hh
     intersectioniterator.hhImplementation of the IntersectionIterator for AlbertaGrid
     leafiterator.hh
     level.hh
     leveliterator.hh
     macrodata.ccWrapper for ALBERTA's macro_data structure
     macrodata.hhWrapper for ALBERTA's macro_data structure
     macroelement.hh
     meshpointer.cc
     meshpointer.hhWrapper for ALBERTA's mesh structure
     misc.hh
     leafiterator.hh
     level.hh
     leveliterator.hh
     macrodata.ccWrapper for ALBERTA's macro_data structure
     macrodata.hhWrapper for ALBERTA's macro_data structure
     macroelement.hh
     meshpointer.cc
     meshpointer.hhWrapper for ALBERTA's mesh structure
     misc.hh
     persistentcontainer.hh
     projection.hh
     refinement.hhWrapper for ALBERTA's refinement patches and the corners for geometryInFather
     refinement.hhWrapper for ALBERTA's refinement patches and the corners for geometryInFather
     structuredgridfactory.hhSpecialization of the generic StructuredGridFactory for AlbertaGrid
     transformation.hh
     treeiterator.hh
     undefine-2.0.hhContains #undefs for all preprocessor macros defined by alberta
     treeiterator.hh
     undefine-2.0.hhContains #undefs for all preprocessor macros defined by alberta
     undefine-3.0.hhContains #undefs for all preprocessor macros defined by alberta
      common
     adaptcallback.hhInterfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
     adaptcallback.hhInterfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
     backuprestore.hh
     boundaryprojection.hh
     boundarysegment.hhBase class for grid boundary segments of arbitrary geometry
     boundaryprojection.hh
     boundarysegment.hhBase class for grid boundary segments of arbitrary geometry
     capabilities.hhA set of traits classes to store static information about grid implementation
     datahandleif.hhDescribes the parallel communication interface class for MessageBuffers and DataHandles
     defaultgridview.hh
     defaultgridview.hh
     entity.hh
     entityiterator.hh
     entityseed.hhInterface class EntitySeed
     exceptions.hh
     exceptions.hh
     geometry.hhWrapper and interface classes for element geometries
     grid.hhDifferent resources needed by all grid implementations
     gridenums.hh
     gridenums.hh
     gridfactory.hhProvide a generic factory class for unstructured grids
     gridinfo.hhSome functions to list information about a grid
     gridview.hh
     indexidset.hhProvides base classes for index and id sets
     intersection.hh
     intersectioniterator.hh
     mapper.hhProvides classes with basic mappers which are used to attach data to a grid
     mcmgmapper.hhMapper for multiple codim and multiple geometry types
     partitionset.hh
     rangegenerators.hh
     scsgmapper.hhMapper classes are used to attach data to a grid
     sizecache.hhProvides size cache classes to implement the grids size method efficiently
     mapper.hhProvides classes with basic mappers which are used to attach data to a grid
     mcmgmapper.hhMapper for multiple codim and multiple geometry types
     partitionset.hh
     rangegenerators.hh
     scsgmapper.hhMapper classes are used to attach data to a grid
     sizecache.hhProvides size cache classes to implement the grids size method efficiently
      concepts
      archetypes
     datahandle.hh
     entity.hh
     geometry.hh
     messagebuffer.hh
     datahandle.hh
     gridview.hh
     indexidset.hh
     intersection.hh
     intersectioniterator.hh
     messagebuffer.hh
      geometrygrid
     backuprestore.hh
     cachedcoordfunction.hh
     cachedcoordfunction.hh
     capabilities.hh
     coordfunction.hh
     coordfunctioncaller.hh
     cornerstorage.hh
     coordfunction.hh
     coordfunctioncaller.hh
     cornerstorage.hh
     datahandle.hh
     declaration.hh
     declaration.hh
     entity.hh
     entityseed.hh
     geometry.hh
     grid.hh
     gridfamily.hh
     gridview.hh
     hostcorners.hh
     identity.hh
     hostcorners.hh
     identity.hh
     idset.hh
     indexsets.hh
     intersection.hh
     intersectioniterator.hh
     iterator.hh
     iterator.hh
     persistentcontainer.hh
      identitygrid
     identitygridentity.hhThe IdentityGridEntity class
     identitygridentityseed.hhThe IdentityGridEntitySeed class
     identitygridgeometry.hhThe IdentityGridGeometry class and its specializations
     identitygridhierarchiciterator.hhThe IdentityGridHierarchicIterator class
     identitygridindexsets.hhThe index and id sets for the IdentityGrid class
     identitygridintersectioniterator.hhThe IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes
     identitygridintersections.hhThe IdentityGridLeafIntersection and IdentityGridLevelIntersection classes
     identitygridleafiterator.hhThe IdentityGridLeafIterator class
     identitygridleveliterator.hhThe IdentityGridLevelIterator class
     identitygridentity.hhThe IdentityGridEntity class
     identitygridentityseed.hhThe IdentityGridEntitySeed class
     identitygridgeometry.hhThe IdentityGridGeometry class and its specializations
     identitygridhierarchiciterator.hhThe IdentityGridHierarchicIterator class
     identitygridindexsets.hhThe index and id sets for the IdentityGrid class
     identitygridintersectioniterator.hhThe IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes
     identitygridintersections.hhThe IdentityGridLeafIntersection and IdentityGridLevelIntersection classes
     identitygridleafiterator.hhThe IdentityGridLeafIterator class
     identitygridleveliterator.hhThe IdentityGridLevelIterator class
      io
      file
      dgfparser
      blocks
     basic.cc
     basic.hh
     boundarydom.cc
     boundarydom.hh
     boundaryseg.cc
     boundaryseg.hh
     cube.cc
     cube.hh
     dim.cc
     dim.hh
     general.cc
     general.hh
     gridparameter.cc
     gridparameter.hh
     interval.cc
     interval.hh
     periodicfacetrans.cc
     periodicfacetrans.hh
     polygon.hh
     polyhedron.hh
     projection.cc
     basic.cc
     basic.hh
     boundarydom.cc
     boundarydom.hh
     boundaryseg.cc
     boundaryseg.hh
     cube.cc
     cube.hh
     dim.cc
     dim.hh
     general.cc
     general.hh
     gridparameter.cc
     gridparameter.hh
     interval.cc
     interval.hh
     periodicfacetrans.cc
     periodicfacetrans.hh
     polygon.hh
     polyhedron.hh
     projection.cc
     projection.hh
     simplex.cc
     simplex.hh
     simplexgeneration.cc
     simplexgeneration.hh
     vertex.cc
     vertex.hh
     simplex.cc
     simplex.hh
     simplexgeneration.cc
     simplexgeneration.hh
     vertex.cc
     vertex.hh
      utils
     dgf2dgf.ccSmall program converting a DGF file into a DGF file
     gmsh2dgf.ccSmall program converting a gmsh file into a DGF file
     dgfexception.hh
     dgfgeogrid.hh
     dgfgridfactory.hh
     dgfidentitygrid.hh
     dgfoned.hh
     dgf2dgf.ccSmall program converting a DGF file into a DGF file
     gmsh2dgf.ccSmall program converting a gmsh file into a DGF file
     dgfexception.hh
     dgfgeogrid.hh
     dgfgridfactory.hh
     dgfidentitygrid.hh
     dgfoned.hh
     dgfparser.cc
     dgfparser.hh
     dgfug.cc
     dgfug.hh
     dgfwriter.hhWrite a GridView to a DGF file
     dgfyasp.hh
     entitykey.hh
     entitykey_inline.hh
     gridptr.hh
     macrogrid.hh
     parser.hh
     dgfug.cc
     dgfug.hh
     dgfwriter.hhWrite a GridView to a DGF file
     dgfyasp.hh
     entitykey.hh
     entitykey_inline.hh
     gridptr.hh
     macrogrid.hh
     parser.hh
      gnuplot
     gnuplot.ccImplementation of gnuplot output for 1D and 2D grids
     gnuplot.ccImplementation of gnuplot output for 1D and 2D grids
      vtk
     b64enc.hhSimple base64 encode
     basicwriter.hh
     boundaryiterators.hhFunctions for VTK output on the skeleton
     boundarywriter.hh
     common.hhCommon stuff for the VTKWriter
     corner.hh
     corneriterator.hh
     dataarraywriter.hhData array writers for the VTKWriter
     function.hhFunctions for VTK output
     functionwriter.hh
     pointiterator.hh
     pvtuwriter.hh
     skeletonfunction.hhFunctions for VTK output on the skeleton
     streams.hh
     subsamplingvtkwriter.hhProvides subsampled file i/o for the visualization toolkit
     volumeiterators.hh
     volumewriter.hh
     vtksequencewriter.hh
     vtksequencewriterbase.hh
     vtkwriter.hhProvides file i/o for the visualization toolkit
     vtuwriter.hh
     b64enc.hhSimple base64 encode
     basicwriter.hh
     boundaryiterators.hhFunctions for VTK output on the skeleton
     boundarywriter.hh
     common.hhCommon stuff for the VTKWriter
     corner.hh
     corneriterator.hh
     dataarraywriter.hhData array writers for the VTKWriter
     function.hhFunctions for VTK output
     functionwriter.hh
     pointiterator.hh
     pvtuwriter.hh
     skeletonfunction.hhFunctions for VTK output on the skeleton
     streams.hh
     subsamplingvtkwriter.hhProvides subsampled file i/o for the visualization toolkit
     volumeiterators.hh
     volumewriter.hh
     vtksequencewriter.hh
     vtksequencewriterbase.hh
     vtkwriter.hhProvides file i/o for the visualization toolkit
     vtuwriter.hh
     dgfparser.hh
     gmshreader.hh
     gmshwriter.hh
     gnuplot.hhProvides gnuplot output for 1D Grids
     printgrid.hh
     starcdreader.hh
     vtk.hhConvenience header which includes all available VTK writers
     gmshreader.hh
     gmshwriter.hh
     gnuplot.hhProvides gnuplot output for 1D Grids
     printgrid.hh
     starcdreader.hh
     vtk.hhConvenience header which includes all available VTK writers
      uggrid
     uggridfactory.hhThe specialization of the generic GridFactory for UGGrid
      utility
     entitycommhelper.hh
     globalindexset.hhProvides a globally unique index for all entities of a distributed Dune grid
     gridinfo-gmsh-main.hhGeneric main() function for printing information about a mesh read from a .msh-file
     entitycommhelper.hh
     globalindexset.hhProvides a globally unique index for all entities of a distributed Dune grid
     gridinfo-gmsh-main.hhGeneric main() function for printing information about a mesh read from a .msh-file
     gridinfo.hh
     gridtype.hhThis file can be included directly following config.h to test if a grid type was correctly selected
     hierarchicsearch.hhUtility class for hierarchically searching for an Entity containing a given point
     hostgridaccess.hh
     multiindex.hhImplements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes
     parmetisgridpartitioner.hhCompute a repartitioning of a Dune grid using ParMetis
     gridtype.hhThis file can be included directly following config.h to test if a grid type was correctly selected
     hierarchicsearch.hhUtility class for hierarchically searching for an Entity containing a given point
     hostgridaccess.hh
     multiindex.hhImplements a multiindex with arbitrary dimension and fixed index ranges This is used by various factory classes
     parmetisgridpartitioner.hhCompute a repartitioning of a Dune grid using ParMetis
     persistentcontainer.hh
     persistentcontainerinterface.hh
     persistentcontainermap.hh
     persistentcontainervector.hh
     persistentcontainerwrapper.hh
     persistentcontainerinterface.hh
     persistentcontainermap.hh
     persistentcontainervector.hh
     persistentcontainerwrapper.hh
     structuredgridfactory.hhA class to construct structured cube and simplex grids using the grid factory
     tensorgridfactory.hhThis file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series
     vertexorderfactory.hh
     tensorgridfactory.hhThis file provides a factory class for tensorproduct grids. This is a collection of methods to generate monotonous sequences as needed for a tensorproduct grid. Apart from easy ones for locally equidistant grids, there are also more involved methods like splitting a range according to a geometric series
     vertexorderfactory.hh
      yaspgrid
     backuprestore.hh
     coordinates.hhThis provides container classes for the coordinates to be used in YaspGrid Upon implementation of the tensorproduct feature, the coordinate information has been encapsulated to keep performance for the equidistant grid. Containers for equidistant and tensorproduct grids are provided here
     partitioning.hhThis file provides tools to partition YaspGrids. If you want to write your own partitioner, inherit from Yasp::Partitioning and implement the partition() method. You can also browse this file for already available useful partitioners, like Yasp::FixedSizePartitioning
     structuredyaspgridfactory.hhSpecialization of the StructuredGridFactory class for YaspGrid
     torus.hhThis file provides the infrastructure for toroidal communication in YaspGrid
     yaspgridentity.hhYaspEntity class and its specializations
     yaspgridentityseed.hhThe YaspEntitySeed class
     yaspgridgeometry.hhThe YaspGeometry class and its specializations
     yaspgridhierarchiciterator.hh
     yaspgrididset.hh
     yaspgridindexsets.hhLevel-wise, non-persistent, consecutive indices for YaspGrid
     yaspgridintersection.hhThe YaspIntersection class
     yaspgridintersectioniterator.hhThe YaspIntersectionIterator class
     yaspgridleveliterator.hhThe YaspLevelIterator class
     yaspgridpersistentcontainer.hhSpecialization of the PersistentContainer for YaspGrid
     coordinates.hhThis provides container classes for the coordinates to be used in YaspGrid Upon implementation of the tensorproduct feature, the coordinate information has been encapsulated to keep performance for the equidistant grid. Containers for equidistant and tensorproduct grids are provided here
     partitioning.hhThis file provides tools to partition YaspGrids. If you want to write your own partitioner, inherit from Yasp::Partitioning and implement the partition() method. You can also browse this file for already available useful partitioners, like Yasp::FixedSizePartitioning
     structuredyaspgridfactory.hhSpecialization of the StructuredGridFactory class for YaspGrid
     torus.hhThis file provides the infrastructure for toroidal communication in YaspGrid
     yaspgridentity.hhYaspEntity class and its specializations
     yaspgridentityseed.hhThe YaspEntitySeed class
     yaspgridgeometry.hhThe YaspGeometry class and its specializations
     yaspgridhierarchiciterator.hh
     yaspgrididset.hh
     yaspgridindexsets.hhLevel-wise, non-persistent, consecutive indices for YaspGrid
     yaspgridintersection.hhThe YaspIntersection class
     yaspgridintersectioniterator.hhThe YaspIntersectionIterator class
     yaspgridleveliterator.hhThe YaspLevelIterator class
     yaspgridpersistentcontainer.hhSpecialization of the PersistentContainer for YaspGrid
     ygrid.hhThis provides a YGrid, the elemental component of the yaspgrid implementation
     albertagrid.hh
     geometrygrid.hh
     identitygrid.hhThe IdentityGrid class
     onedgrid.hhThe OneDGrid class
     uggrid.hhThe UGGrid class
     yaspgrid.hh
    \n \n-\n+\n \n

    \n Functions

    int main (int argc, char **argv)
    int main (int argc, char **argv)
     
    \n

    Function Documentation

    \n \n

    ◆ main()

    \n \n
    \n@@ -113,18 +115,21 @@\n \n )\n \n \n \n
    \n

    [set up grid]

    \n-

    [extract gridview]

    \n-

    [iterate over codim]

    \n-

    [iterate over grid view]

    \n-

    [access to subentities]

    \n+

    [small vectors and matrices]

    \n+

    [a function to integrate]

    \n+

    [integration with midpoint rule]

    \n+

    [integration with quadrature rule]

    \n+

    [integrating a flux]

    \n+
    Examples
    recipe-integration.cc, and recipe-iterate-over-grid.cc.
    \n+
    \n \n
    \n
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,29 +1,34 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * doc\n * recipes\n Functions\n-recipe-iterate-over-grid.cc File Reference\n+recipe-integration.cc File Reference\n #include \n #include \n #include \n #include \n #include \n+#include \n+#include \n #include \n Functions\n int\u00a0 main (int argc, char **argv)\n \u00a0\n ***** Function Documentation *****\n ***** \u25c6\u00a0main() *****\n int main ( int\u00a0 argc,\n char **\u00a0 argv\u00a0\n )\n [set up grid]\n-[extract gridview]\n-[iterate over codim]\n-[iterate over grid view]\n-[access to subentities]\n+[small vectors and matrices]\n+[a function to integrate]\n+[integration with midpoint rule]\n+[integration with quadrature rule]\n+[integrating a flux]\n+ Examples\n+ recipe-integration.cc, and recipe-iterate-over-grid.cc.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00176.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00203.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -81,15 +81,15 @@\n
    \n \n

    This file provides tools to partition YaspGrids. If you want to write your own partitioner, inherit from Yasp::Partitioning and implement the partition() method. You can also browse this file for already available useful partitioners, like Yasp::FixedSizePartitioning. \n More...

    \n
    #include <array>
    \n #include <dune/common/math.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n \n \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00176_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00203_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,15 +77,15 @@\n
  • dune
  • grid
  • yaspgrid
  • \n \n \n
    \n
    partitioning.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3#ifndef DUNE_GRID_YASPGRID_PARTITIONING_HH
    \n
    4#define DUNE_GRID_YASPGRID_PARTITIONING_HH
    \n
    5
    \n
    13#include<array>
    \n
    14
    \n
    15#include<dune/common/math.hh>
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00191.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00287.html", "comments": ["Files 92% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridhierarchiciterator.hh File Reference\n+dune-grid: mapper.hh File Reference\n \n \n \n \n \n \n \n@@ -65,42 +65,47 @@\n
    \n
    \n
    \n \n \n \n \n
    \n \n-
    yaspgridhierarchiciterator.hh File Reference
    \n+
    mapper.hh File Reference
    \n
    \n
    \n \n-

    Go to the source code of this file.

    \n+

    Provides classes with basic mappers which are used to attach data to a grid. \n+More...

    \n+
    #include <utility>
    \n+#include <dune/common/bartonnackmanifcheck.hh>
    \n+
    \n+

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::Yasp::Partitioning< d >
     a base class for the yaspgrid partitioning strategy More...
     
    class  Dune::Yasp::DefaultPartitioning< d >
    \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::YaspHierarchicIterator< GridImp >
     YaspHierarchicIterator enables iteration over son entities of codim 0. More...
    class  Dune::Mapper< G, MapperImp, IndexType >
     Mapper interface. More...
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n

    Detailed Description

    \n-

    The YaspHierarchicIterator class

    \n-

    Enables iteration over son entities of codim 0

    \n+

    Provides classes with basic mappers which are used to attach data to a grid.

    \n+
    Author
    Peter Bastian
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,24 +1,28 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * yaspgrid\n+ * common\n Classes | Namespaces\n-yaspgridhierarchiciterator.hh File Reference\n+mapper.hh File Reference\n+Provides classes with basic mappers which are used to attach data to a grid.\n+More...\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::YaspHierarchicIterator<_GridImp_>\n-\u00a0 YaspHierarchicIterator enables iteration over son entities of codim 0.\n- More...\n+class \u00a0 Dune::Mapper<_G,_MapperImp,_IndexType_>\n+\u00a0 Mapper interface. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ***** Detailed Description *****\n-The YaspHierarchicIterator class\n-Enables iteration over son entities of codim 0\n+Provides classes with basic mappers which are used to attach data to a grid.\n+ Author\n+ Peter Bastian\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00191_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00806_source.html", "comments": ["Files 87% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: yaspgridhierarchiciterator.hh Source File\n+dune-grid: pvtuwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,185 +70,197 @@\n
    \n \n \n \n \n \n \n
    \n-
    yaspgridhierarchiciterator.hh
    \n+
    pvtuwriter.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH
    \n-
    6#define DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH
    \n-
    7
    \n-
    14namespace Dune {
    \n-
    15
    \n-
    18 template<class GridImp>
    \n-
    \n-\n-
    20 {
    \n-
    21 constexpr static int dim = GridImp::dimension;
    \n-
    22
    \n-\n-
    24
    \n-
    25 public:
    \n-
    26 // types used from grids
    \n-
    27 typedef typename GridImp::YGridLevelIterator YGLI;
    \n-
    28 typedef typename GridImp::YGrid::Iterator I;
    \n-
    29 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n-
    30
    \n-
    32 YaspHierarchicIterator () : _entity(), _maxlevel(-1), stack() {}
    \n-
    33
    \n-
    \n-
    35 YaspHierarchicIterator (const YGLI& g, const I& it, int maxlevel) :
    \n-
    36 _entity(YaspEntity<0, dim, GridImp>(g,it))
    \n-
    37 {
    \n-
    38 // store reference to entity implementation for better readability
    \n-
    39 YaspEntityImp& entity = _entity.impl();
    \n-
    40 // now iterator points to current cell
    \n-
    41 StackElem se(entity._g);
    \n-
    42 std::copy(entity._it.coord().begin(), entity._it.coord().end(), se.coord.begin());
    \n-
    43 stack.push(se);
    \n-
    44
    \n-
    45 // determine maximum level
    \n-
    46 _maxlevel = std::min(maxlevel,entity._g->mg->maxLevel());
    \n-
    47
    \n-
    48 // if maxlevel not reached then push yourself and sons
    \n-
    49 if (entity._g->level()<_maxlevel)
    \n-
    50 {
    \n-
    51 push_sons();
    \n-
    52 }
    \n-
    53
    \n-
    54 // and make iterator point to first son if stack is not empty
    \n-
    55 if (!stack.empty())
    \n-
    56 pop_tos();
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    \n-
    60 void increment ()
    \n-
    61 {
    \n-
    62 // sanity check: do nothing when stack is empty
    \n-
    63 if (stack.empty()) return;
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH
    \n+
    8
    \n+
    9#include <ostream>
    \n+
    10#include <string>
    \n+
    11
    \n+
    12#include <dune/common/exceptions.hh>
    \n+
    13#include <dune/common/indent.hh>
    \n+
    14
    \n+\n+
    16
    \n+
    17namespace Dune {
    \n+
    18
    \n+
    21
    \n+
    22 namespace VTK {
    \n+
    23
    \n+
    25
    \n+
    \n+
    62 class PVTUWriter {
    \n+
    63 std::ostream& stream;
    \n
    64
    \n-
    65 // if maxlevel not reached then push sons
    \n-
    66 if (_entity.impl()._g->level()<_maxlevel)
    \n-
    67 push_sons();
    \n+
    65 std::string fileType;
    \n+
    66
    \n+
    67 Indent indent;
    \n
    68
    \n-
    69 // in any case pop one element
    \n-
    70 pop_tos();
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    \n-
    74 bool equals (const YaspHierarchicIterator& rhs) const
    \n-
    75 {
    \n-
    76 return (_entity == rhs._entity);
    \n-
    77 }
    \n-
    \n-
    78
    \n-
    \n-
    80 const Entity& dereference() const
    \n-
    81 {
    \n-
    82 return _entity;
    \n-
    83 }
    \n-
    \n-
    84
    \n-
    \n-
    85 void print (std::ostream& s) const
    \n-
    86 {
    \n-
    87 // store reference to entity implementation for better readability
    \n-
    88 YaspEntityImp& entity = _entity.impl();
    \n-
    89 s << "HIER: " << "level=" << entity._g.level()
    \n-
    90 << " position=" << entity._it.coord()
    \n-
    91 << " superindex=" << entity._it.superindex()
    \n-
    92 << " maxlevel=" << entity._maxlevel
    \n-
    93 << " stacksize=" << stack.size()
    \n-
    94 << std::endl;
    \n-
    95 }
    \n-
    \n-
    96
    \n-
    97 private:
    \n-
    98 Entity _entity;
    \n-
    99
    \n-
    100 int _maxlevel;
    \n-
    101
    \n-
    102 struct StackElem {
    \n-
    103 YGLI g; // grid level of the element
    \n-
    104 std::array<int,dim> coord; // and the coordinates
    \n-
    105 StackElem(YGLI gg) : g(gg) {}
    \n-
    106 };
    \n-
    107 std::stack<StackElem> stack;
    \n-
    108
    \n-
    109 // push sons of current element on the stack
    \n-
    110 void push_sons ()
    \n-
    111 {
    \n-
    112 // store reference to entity implementation for better readability
    \n-
    113 YaspEntityImp& entity = _entity.impl();
    \n-
    114
    \n-
    115 // yes, process all 1<<dim sons
    \n-
    116 YGLI finer = entity._g;
    \n-
    117 ++finer;
    \n-
    118 StackElem se(finer);
    \n-
    119 for (int i=0; i<(1<<dim); i++)
    \n-
    120 {
    \n-
    121 for (int k=0; k<dim; k++)
    \n-
    122 if (i&(1<<k))
    \n-
    123 se.coord[k] = entity._it.coord(k)*2+1;
    \n-
    124 else
    \n-
    125 se.coord[k] = entity._it.coord(k)*2;
    \n-
    126 // not all entities have 2^d subentities due to refineOptions with keep_ovlp==false
    \n-
    127 bool exists = true;
    \n-
    128 for (int k=0; k<dim; k++)
    \n-
    129 if ((se.coord[k] < finer->overlap[0].dataBegin()->origin(k)) || (se.coord[k] >= finer->overlap[0].dataBegin()->origin(k)+finer->overlap[0].dataBegin()->size(k)))
    \n-
    130 exists = false;
    \n-
    131 if (exists)
    \n-
    132 stack.push(se);
    \n-
    133 }
    \n-
    134 }
    \n+
    69 public:
    \n+
    71
    \n+
    \n+
    78 inline PVTUWriter(std::ostream& stream_, FileType fileType_)
    \n+
    79 : stream(stream_)
    \n+
    80 {
    \n+
    81 switch(fileType_) {
    \n+
    82 case polyData :
    \n+
    83 fileType = "PPolyData";
    \n+
    84 break;
    \n+
    85 case unstructuredGrid :
    \n+
    86 fileType = "PUnstructuredGrid";
    \n+
    87 break;
    \n+
    88 default :
    \n+
    89 DUNE_THROW(IOError, "PVTUWriter: Unknown fileType: " << fileType_);
    \n+
    90 }
    \n+
    91 const std::string& byteOrder = getEndiannessString();
    \n+
    92
    \n+
    93 stream << indent << "<?xml version=\\"1.0\\"?>\\n";
    \n+
    94 stream << indent << "<VTKFile"
    \n+
    95 << " type=\\"" << fileType << "\\""
    \n+
    96 << " version=\\"0.1\\""
    \n+
    97 << " byte_order=\\"" << byteOrder << "\\">\\n";
    \n+
    98 ++indent;
    \n+
    99 }
    \n+
    \n+
    100
    \n+
    \n+
    102 inline ~PVTUWriter() {
    \n+
    103 --indent;
    \n+
    104 stream << indent << "</VTKFile>\\n"
    \n+
    105 << std::flush;
    \n+
    106 }
    \n+
    \n+
    107
    \n+
    109
    \n+
    \n+
    120 inline void beginPointData(const std::string& scalars = "",
    \n+
    121 const std::string& vectors = "") {
    \n+
    122 stream << indent << "<PPointData";
    \n+
    123 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n+
    124 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n+
    125 stream << ">\\n";
    \n+
    126 ++indent;
    \n+
    127 }
    \n+
    \n+
    \n+
    129 inline void endPointData() {
    \n+
    130 --indent;
    \n+
    131 stream << indent << "</PPointData>\\n";
    \n+
    132 }
    \n+
    \n+
    133
    \n
    135
    \n-
    136 // make TOS the current element
    \n-
    137 void pop_tos ()
    \n-
    138 {
    \n-
    139 StackElem se = stack.top();
    \n-
    140 stack.pop();
    \n-
    141 YaspEntityImp& entity = _entity.impl();
    \n-
    142 entity._g = se.g;
    \n-
    143 entity._it.reinit(entity._g->overlap[0],se.coord);
    \n-
    144 }
    \n-
    145 };
    \n-
    \n-
    146
    \n-
    147} // namespace Dune
    \n-
    148
    \n-
    149#endif // DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH
    \n+
    \n+
    146 inline void beginCellData(const std::string& scalars = "",
    \n+
    147 const std::string& vectors = "") {
    \n+
    148 stream << indent << "<PCellData";
    \n+
    149 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n+
    150 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n+
    151 stream << ">\\n";
    \n+
    152 ++indent;
    \n+
    153 }
    \n+
    \n+
    \n+
    155 inline void endCellData() {
    \n+
    156 --indent;
    \n+
    157 stream << indent << "</PCellData>\\n";
    \n+
    158 }
    \n+
    \n+
    159
    \n+
    161
    \n+
    \n+
    166 inline void beginPoints() {
    \n+
    167 stream << indent << "<PPoints>\\n";
    \n+
    168 ++indent;
    \n+
    169 }
    \n+
    \n+
    \n+
    171 inline void endPoints() {
    \n+
    172 --indent;
    \n+
    173 stream << indent << "</PPoints>\\n";
    \n+
    174 }
    \n+
    \n+
    175
    \n+
    177
    \n+
    \n+
    189 inline void beginMain(unsigned ghostLevel = 0) {
    \n+
    190 stream << indent << "<" << fileType
    \n+
    191 << " GhostLevel=\\"" << ghostLevel << "\\">\\n";
    \n+
    192 ++indent;
    \n+
    193 }
    \n+
    \n+
    \n+
    195 inline void endMain() {
    \n+
    196 --indent;
    \n+
    197 stream << indent << "</" << fileType << ">\\n";
    \n+
    198 }
    \n+
    \n+
    199
    \n+
    201
    \n+
    \n+
    207 void addArray(const std::string& name, unsigned ncomps, Precision prec) {
    \n+
    208 stream << indent << "<PDataArray"
    \n+
    209 << " type=\\"" << toString(prec) << "\\""
    \n+
    210 << " Name=\\"" << name << "\\""
    \n+
    211 << " NumberOfComponents=\\"" << ncomps << "\\"/>\\n";
    \n+
    212 }
    \n+
    \n+
    213
    \n+
    \n+
    215 inline void addPiece(const std::string& filename) {
    \n+
    216 stream << indent << "<Piece "
    \n+
    217 << " Source=\\"" << filename << "\\"/>\\n";
    \n+
    218 }
    \n+
    \n+
    219 };
    \n+
    \n+
    220
    \n+
    221 } // namespace VTK
    \n+
    222
    \n+
    224
    \n+
    225} // namespace Dune
    \n+
    226
    \n+
    227#endif // DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH
    \n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Implementation & impl()
    access to the underlying implementation
    Definition common/entity.hh:80
    \n-
    Definition yaspgridentity.hh:242
    \n-
    YGLI _g
    Definition yaspgridentity.hh:400
    \n-
    I _it
    Definition yaspgridentity.hh:399
    \n-
    YaspHierarchicIterator enables iteration over son entities of codim 0.
    Definition yaspgridhierarchiciterator.hh:20
    \n-
    YaspHierarchicIterator()
    default constructor creating empty iterator
    Definition yaspgridhierarchiciterator.hh:32
    \n-
    GridImp::template Codim< 0 >::Entity Entity
    Definition yaspgridhierarchiciterator.hh:29
    \n-
    void print(std::ostream &s) const
    Definition yaspgridhierarchiciterator.hh:85
    \n-
    GridImp::YGrid::Iterator I
    Definition yaspgridhierarchiciterator.hh:28
    \n-
    const Entity & dereference() const
    dereferencing
    Definition yaspgridhierarchiciterator.hh:80
    \n-
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridhierarchiciterator.hh:27
    \n-
    void increment()
    increment
    Definition yaspgridhierarchiciterator.hh:60
    \n-
    bool equals(const YaspHierarchicIterator &rhs) const
    equality
    Definition yaspgridhierarchiciterator.hh:74
    \n-
    YaspHierarchicIterator(const YGLI &g, const I &it, int maxlevel)
    constructor
    Definition yaspgridhierarchiciterator.hh:35
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n+
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n+
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n+
    std::string toString(Precision p)
    map precision to VTK type name
    Definition common.hh:280
    \n+
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition pvtuwriter.hh:62
    \n+
    ~PVTUWriter()
    write footer
    Definition pvtuwriter.hh:102
    \n+
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition pvtuwriter.hh:195
    \n+
    void endCellData()
    finish CellData section
    Definition pvtuwriter.hh:155
    \n+
    void addArray(const std::string &name, unsigned ncomps, Precision prec)
    Add an array to the output file.
    Definition pvtuwriter.hh:207
    \n+
    void beginMain(unsigned ghostLevel=0)
    start the main PPolyData/PUnstructuredGrid section
    Definition pvtuwriter.hh:189
    \n+
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition pvtuwriter.hh:146
    \n+
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition pvtuwriter.hh:120
    \n+
    void addPiece(const std::string &filename)
    Add a serial piece to the output file.
    Definition pvtuwriter.hh:215
    \n+
    PVTUWriter(std::ostream &stream_, FileType fileType_)
    create a PVTUWriter object
    Definition pvtuwriter.hh:78
    \n+
    void endPointData()
    finish PointData section
    Definition pvtuwriter.hh:129
    \n+
    void endPoints()
    finish section for the point coordinates
    Definition pvtuwriter.hh:171
    \n+
    void beginPoints()
    start section for the point coordinates
    Definition pvtuwriter.hh:166
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,205 +1,225 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * yaspgrid\n-yaspgridhierarchiciterator.hh\n+ * io\n+ * file\n+ * vtk\n+pvtuwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH\n-6#define DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH\n-7\n-14namespace Dune {\n-15\n-18 template\n-19 class YaspHierarchicIterator\n-20 {\n-21 constexpr static int dim = GridImp::dimension;\n-22\n-23 typedef YaspEntity<0,GridImp::dimension,GridImp> YaspEntityImp;\n-24\n-25 public:\n-26 // types used from grids\n-27 typedef typename GridImp::YGridLevelIterator YGLI;\n-28 typedef typename GridImp::YGrid::Iterator I;\n-29 typedef typename GridImp::template Codim<0>::Entity Entity;\n-30\n-32 YaspHierarchicIterator () : _entity(), _maxlevel(-1), stack() {}\n-33\n-35 YaspHierarchicIterator (const YGLI& g, const I& it, int maxlevel) :\n-36 _entity(YaspEntity<0, dim, GridImp>(g,it))\n-37 {\n-38 // store reference to entity implementation for better readability\n-39 YaspEntityImp& entity = _entity.impl();\n-40 // now iterator points to current cell\n-41 StackElem se(entity._g);\n-42 std::copy(entity._it.coord().begin(), entity._it.coord().end(),\n-se.coord.begin());\n-43 stack.push(se);\n-44\n-45 // determine maximum level\n-46 _maxlevel = std::min(maxlevel,entity._g->mg->maxLevel());\n-47\n-48 // if maxlevel not reached then push yourself and sons\n-49 if (entity._g->level()<_maxlevel)\n-50 {\n-51 push_sons();\n-52 }\n-53\n-54 // and make iterator point to first son if stack is not empty\n-55 if (!stack.empty())\n-56 pop_tos();\n-57 }\n-58\n-60 void increment ()\n-61 {\n-62 // sanity check: do nothing when stack is empty\n-63 if (stack.empty()) return;\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH\n+8\n+9#include \n+10#include \n+11\n+12#include \n+13#include \n+14\n+15#include \n+16\n+17namespace Dune {\n+18\n+21\n+22 namespace VTK {\n+23\n+25\n+62 class PVTUWriter {\n+63 std::ostream& stream;\n 64\n-65 // if maxlevel not reached then push sons\n-66 if (_entity.impl()._g->level()<_maxlevel)\n-67 push_sons();\n+65 std::string fileType;\n+66\n+67 Indent indent;\n 68\n-69 // in any case pop one element\n-70 pop_tos();\n-71 }\n-72\n-74 bool equals (const YaspHierarchicIterator& rhs) const\n-75 {\n-76 return (_entity == rhs._entity);\n-77 }\n-78\n-80 const Entity& dereference() const\n-81 {\n-82 return _entity;\n-83 }\n-84\n-85 void print (std::ostream& s) const\n-86 {\n-87 // store reference to entity implementation for better readability\n-88 YaspEntityImp& entity = _entity.impl();\n-89 s << \"HIER: \" << \"level=\" << entity._g.level()\n-90 << \" position=\" << entity._it.coord()\n-91 << \" superindex=\" << entity._it.superindex()\n-92 << \" maxlevel=\" << entity._maxlevel\n-93 << \" stacksize=\" << stack.size()\n-94 << std::endl;\n-95 }\n-96\n-97 private:\n-98 Entity _entity;\n-99\n-100 int _maxlevel;\n-101\n-102 struct StackElem {\n-103 YGLI g; // grid level of the element\n-104 std::array coord; // and the coordinates\n-105 StackElem(YGLI gg) : g(gg) {}\n-106 };\n-107 std::stack stack;\n-108\n-109 // push sons of current element on the stack\n-110 void push_sons ()\n-111 {\n-112 // store reference to entity implementation for better readability\n-113 YaspEntityImp& entity = _entity.impl();\n-114\n-115 // yes, process all 1<overlap[0].dataBegin()->origin(k)) || (se.coord\n-[k] >= finer->overlap[0].dataBegin()->origin(k)+finer->overlap[0].dataBegin()-\n->size(k)))\n-130 exists = false;\n-131 if (exists)\n-132 stack.push(se);\n-133 }\n-134 }\n+69 public:\n+71\n+78 inline PVTUWriter(std::ostream& stream_, FileType fileType_)\n+79 : stream(stream_)\n+80 {\n+81 switch(fileType_) {\n+82 case polyData :\n+83 fileType = \"PPolyData\";\n+84 break;\n+85 case unstructuredGrid :\n+86 fileType = \"PUnstructuredGrid\";\n+87 break;\n+88 default :\n+89 DUNE_THROW(IOError, \"PVTUWriter: Unknown fileType: \" << fileType_);\n+90 }\n+91 const std::string& byteOrder = getEndiannessString();\n+92\n+93 stream << indent << \"\\n\";\n+94 stream << indent << \"\\n\";\n+98 ++indent;\n+99 }\n+100\n+102 inline ~PVTUWriter() {\n+103 --indent;\n+104 stream << indent << \"\\n\"\n+105 << std::flush;\n+106 }\n+107\n+109\n+120 inline void beginPointData(const std::string& scalars = \"\",\n+121 const std::string& vectors = \"\") {\n+122 stream << indent << \"\\n\";\n+126 ++indent;\n+127 }\n+129 inline void endPointData() {\n+130 --indent;\n+131 stream << indent << \"\\n\";\n+132 }\n+133\n 135\n-136 // make TOS the current element\n-137 void pop_tos ()\n-138 {\n-139 StackElem se = stack.top();\n-140 stack.pop();\n-141 YaspEntityImp& entity = _entity.impl();\n-142 entity._g = se.g;\n-143 entity._it.reinit(entity._g->overlap[0],se.coord);\n-144 }\n-145 };\n-146\n-147} // namespace Dune\n-148\n-149#endif // DUNE_GRID_YASPGRIDHIERARCHICITERATOR_HH\n+146 inline void beginCellData(const std::string& scalars = \"\",\n+147 const std::string& vectors = \"\") {\n+148 stream << indent << \"\\n\";\n+152 ++indent;\n+153 }\n+155 inline void endCellData() {\n+156 --indent;\n+157 stream << indent << \"\\n\";\n+158 }\n+159\n+161\n+166 inline void beginPoints() {\n+167 stream << indent << \"\\n\";\n+168 ++indent;\n+169 }\n+171 inline void endPoints() {\n+172 --indent;\n+173 stream << indent << \"\\n\";\n+174 }\n+175\n+177\n+189 inline void beginMain(unsigned ghostLevel = 0) {\n+190 stream << indent << \"<\" << fileType\n+191 << \" GhostLevel=\\\"\" << ghostLevel << \"\\\">\\n\";\n+192 ++indent;\n+193 }\n+195 inline void endMain() {\n+196 --indent;\n+197 stream << indent << \"\\n\";\n+198 }\n+199\n+201\n+207 void addArray(const std::string& name, unsigned ncomps, Precision prec) {\n+208 stream << indent << \"\\n\";\n+212 }\n+213\n+215 inline void addPiece(const std::string& filename) {\n+216 stream << indent << \"\\n\";\n+218 }\n+219 };\n+220\n+221 } // namespace VTK\n+222\n+224\n+225} // namespace Dune\n+226\n+227#endif // DUNE_GRID_IO_FILE_VTK_PVTUWRITER_HH\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Entity::impl\n-Implementation & impl()\n-access to the underlying implementation\n-Definition common/entity.hh:80\n-Dune::YaspEntity\n-Definition yaspgridentity.hh:242\n-Dune::YaspEntity::_g\n-YGLI _g\n-Definition yaspgridentity.hh:400\n-Dune::YaspEntity::_it\n-I _it\n-Definition yaspgridentity.hh:399\n-Dune::YaspHierarchicIterator\n-YaspHierarchicIterator enables iteration over son entities of codim 0.\n-Definition yaspgridhierarchiciterator.hh:20\n-Dune::YaspHierarchicIterator::YaspHierarchicIterator\n-YaspHierarchicIterator()\n-default constructor creating empty iterator\n-Definition yaspgridhierarchiciterator.hh:32\n-Dune::YaspHierarchicIterator::Entity\n-GridImp::template Codim< 0 >::Entity Entity\n-Definition yaspgridhierarchiciterator.hh:29\n-Dune::YaspHierarchicIterator::print\n-void print(std::ostream &s) const\n-Definition yaspgridhierarchiciterator.hh:85\n-Dune::YaspHierarchicIterator::I\n-GridImp::YGrid::Iterator I\n-Definition yaspgridhierarchiciterator.hh:28\n-Dune::YaspHierarchicIterator::dereference\n-const Entity & dereference() const\n-dereferencing\n-Definition yaspgridhierarchiciterator.hh:80\n-Dune::YaspHierarchicIterator::YGLI\n-GridImp::YGridLevelIterator YGLI\n-Definition yaspgridhierarchiciterator.hh:27\n-Dune::YaspHierarchicIterator::increment\n-void increment()\n-increment\n-Definition yaspgridhierarchiciterator.hh:60\n-Dune::YaspHierarchicIterator::equals\n-bool equals(const YaspHierarchicIterator &rhs) const\n-equality\n-Definition yaspgridhierarchiciterator.hh:74\n-Dune::YaspHierarchicIterator::YaspHierarchicIterator\n-YaspHierarchicIterator(const YGLI &g, const I &it, int maxlevel)\n-constructor\n-Definition yaspgridhierarchiciterator.hh:35\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::FileType\n+FileType\n+which type of VTK file to write\n+Definition common.hh:252\n+Dune::VTK::polyData\n+@ polyData\n+for .vtp files (PolyData)\n+Definition common.hh:254\n+Dune::VTK::unstructuredGrid\n+@ unstructuredGrid\n+for .vtu files (UnstructuredGrid)\n+Definition common.hh:256\n+Dune::VTK::toString\n+std::string toString(Precision p)\n+map precision to VTK type name\n+Definition common.hh:280\n+Dune::VTK::getEndiannessString\n+std::string getEndiannessString()\n+determine endianness of this C++ implementation\n+Definition common.hh:232\n+Dune::VTK::PVTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition pvtuwriter.hh:62\n+Dune::VTK::PVTUWriter::~PVTUWriter\n+~PVTUWriter()\n+write footer\n+Definition pvtuwriter.hh:102\n+Dune::VTK::PVTUWriter::endMain\n+void endMain()\n+finish the main PolyData/UnstructuredGrid section\n+Definition pvtuwriter.hh:195\n+Dune::VTK::PVTUWriter::endCellData\n+void endCellData()\n+finish CellData section\n+Definition pvtuwriter.hh:155\n+Dune::VTK::PVTUWriter::addArray\n+void addArray(const std::string &name, unsigned ncomps, Precision prec)\n+Add an array to the output file.\n+Definition pvtuwriter.hh:207\n+Dune::VTK::PVTUWriter::beginMain\n+void beginMain(unsigned ghostLevel=0)\n+start the main PPolyData/PUnstructuredGrid section\n+Definition pvtuwriter.hh:189\n+Dune::VTK::PVTUWriter::beginCellData\n+void beginCellData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start CellData section\n+Definition pvtuwriter.hh:146\n+Dune::VTK::PVTUWriter::beginPointData\n+void beginPointData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start PointData section\n+Definition pvtuwriter.hh:120\n+Dune::VTK::PVTUWriter::addPiece\n+void addPiece(const std::string &filename)\n+Add a serial piece to the output file.\n+Definition pvtuwriter.hh:215\n+Dune::VTK::PVTUWriter::PVTUWriter\n+PVTUWriter(std::ostream &stream_, FileType fileType_)\n+create a PVTUWriter object\n+Definition pvtuwriter.hh:78\n+Dune::VTK::PVTUWriter::endPointData\n+void endPointData()\n+finish PointData section\n+Definition pvtuwriter.hh:129\n+Dune::VTK::PVTUWriter::endPoints\n+void endPoints()\n+finish section for the point coordinates\n+Definition pvtuwriter.hh:171\n+Dune::VTK::PVTUWriter::beginPoints\n+void beginPoints()\n+start section for the point coordinates\n+Definition pvtuwriter.hh:166\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00224.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00209.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -81,15 +81,15 @@\n
    \n \n

    Specialization of the StructuredGridFactory class for YaspGrid. \n More...

    \n
    #include <memory>
    \n #include <dune/grid/utility/structuredgridfactory.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n \n \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00224_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00209_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,15 +77,15 @@\n
  • dune
  • grid
  • yaspgrid
  • \n \n \n
    \n
    structuredyaspgridfactory.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_YASPGRID_STRUCTUREDYASPGRIDFACTORY_HH
    \n
    6#define DUNE_GRID_YASPGRID_STRUCTUREDYASPGRIDFACTORY_HH
    \n
    7
    \n
    8#include <memory>
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00227.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00182.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -84,15 +84,15 @@\n

    This provides container classes for the coordinates to be used in YaspGrid Upon implementation of the tensorproduct feature, the coordinate information has been encapsulated to keep performance for the equidistant grid. Containers for equidistant and tensorproduct grids are provided here. \n More...

    \n
    #include <array>
    \n #include <bitset>
    \n #include <vector>
    \n #include <dune/common/fvector.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::StructuredGridFactory< YaspGrid< dim, EquidistantCoordinates< ctype, dim > > >
     Specialization of the StructuredGridFactory for YaspGrid. More...
     
    class  Dune::StructuredGridFactory< YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > >
    \n \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00227_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00182_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,15 +77,15 @@\n
  • dune
  • grid
  • yaspgrid
  • \n \n \n
    \n
    coordinates.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_YASPGRID_COORDINATES_HH
    \n
    6#define DUNE_GRID_YASPGRID_COORDINATES_HH
    \n
    7
    \n
    8#include <array>
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00260.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00242.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -79,15 +79,15 @@\n Functions
    \n
    gridenums.hh File Reference
    \n
    \n
    \n
    #include <iostream>
    \n #include <dune/common/exceptions.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::EquidistantCoordinates< ct, dim >
     Container for equidistant coordinates in a YaspGrid. More...
     
    class  Dune::EquidistantOffsetCoordinates< ct, dim >
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00260_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00242_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,15 +77,15 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n
    gridenums.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_COMMON_GRIDENUMS_HH
    \n
    6#define DUNE_GRID_COMMON_GRIDENUMS_HH
    \n
    7
    \n
    8#include <iostream>
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00281.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00341.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -79,18 +79,18 @@\n
    scsgmapper.hh File Reference
    \n
    \n
    \n \n

    Mapper classes are used to attach data to a grid. \n More...

    \n
    #include <iostream>
    \n-#include "mapper.hh"
    \n+#include "mapper.hh"
    \n #include <dune/grid/common/grid.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n Classes

    class  Dune::SingleCodimSingleGeomTypeMapper< GV, c >
     Implementation class for a single codim and single geometry type mapper. More...
     
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00281_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00341_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,23 +77,23 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n
    scsgmapper.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_COMMON_SCSGMAPPER_HH
    \n
    6#define DUNE_GRID_COMMON_SCSGMAPPER_HH
    \n
    7
    \n
    8#include <iostream>
    \n-
    9#include "mapper.hh"
    \n+
    9#include "mapper.hh"
    \n
    10
    \n \n
    12
    \n
    19namespace Dune
    \n
    20{
    \n
    37 template <typename GV, int c>
    \n
    \n@@ -180,15 +180,15 @@\n
    155 GV gridView_;
    \n
    156 const typename GV::IndexSet* indexSet_;
    \n
    157 };
    \n
    \n
    158
    \n
    160}
    \n
    161#endif
    \n-
    Provides classes with basic mappers which are used to attach data to a grid.
    \n+
    Provides classes with basic mappers which are used to attach data to a grid.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n
    Mapper interface.
    Definition mapper.hh:110
    \n
    Implementation class for a single codim and single geometry type mapper.
    Definition scsgmapper.hh:40
    \n
    bool contains(const EntityType &e, Index &result) const
    Returns true if the entity is contained in the index set.
    Definition scsgmapper.hh:112
    \n
    GV::IndexSet::IndexType Index
    Number type used for indices.
    Definition scsgmapper.hh:44
    \n
    bool contains(const typename GV::template Codim< 0 >::Entity &e, int i, int cc, Index &result) const
    Returns true if the entity is contained in the index set.
    Definition scsgmapper.hh:126
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00299.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00572.html", "comments": ["Files 92% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarysegment.hh File Reference\n+dune-grid: hostcorners.hh File Reference\n \n \n \n \n \n \n \n@@ -65,51 +65,43 @@\n
    \n
    \n
    \n \n \n \n \n
    \n \n-
    boundarysegment.hh File Reference
    \n+
    hostcorners.hh File Reference
    \n
    \n
    \n-\n-

    Base class for grid boundary segments of arbitrary geometry. \n-More...

    \n-
    #include <map>
    \n-#include <sstream>
    \n-#include <dune/common/singleton.hh>
    \n-#include <dune/common/parameterizedobject.hh>
    \n-#include <dune/common/fvector.hh>
    \n+
    #include <dune/geometry/type.hh>
    \n+#include <dune/grid/common/entity.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n Classes

    class  Dune::BoundarySegmentBackupRestore< BndSeg >
     
    struct  Dune::BoundarySegment< dim, dimworld, ctype >
     Base class for classes implementing geometries of boundary segments. More...
    class  Dune::GeoGrid::HostCorners< HostEntity >
     
    \n \n \n \n \n+\n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n-

    Detailed Description

    \n-

    Base class for grid boundary segments of arbitrary geometry.

    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,31 +1,24 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * common\n+ * geometrygrid\n Classes | Namespaces\n-boundarysegment.hh File Reference\n-Base class for grid boundary segments of arbitrary geometry. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n+hostcorners.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::BoundarySegmentBackupRestore<_BndSeg_>\n-\u00a0\n-struct \u00a0 Dune::BoundarySegment<_dim,_dimworld,_ctype_>\n-\u00a0 Base class for classes implementing geometries of boundary segments.\n- More...\n+class \u00a0 Dune::GeoGrid::HostCorners<_HostEntity_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Base class for grid boundary segments of arbitrary geometry.\n+namespace \u00a0 Dune::GeoGrid\n+\u00a0 namespace containing the implementations of GeometryGrid\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00299_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00794_source.html", "comments": ["Files 91% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: boundarysegment.hh Source File\n+dune-grid: pointiterator.hh Source File\n \n \n \n \n \n \n \n@@ -70,134 +70,151 @@\n \n \n \n \n \n \n \n
    \n-
    boundarysegment.hh
    \n+
    pointiterator.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
    \n-
    6#define DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
    \n-
    7
    \n-
    8#include <map>
    \n-
    9#include <sstream>
    \n-
    10
    \n-
    11#include <dune/common/singleton.hh>
    \n-
    12#include <dune/common/parameterizedobject.hh>
    \n-
    13#include <dune/common/fvector.hh>
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH
    \n+
    8
    \n+
    9#include <iterator>
    \n+
    10#include <vector>
    \n+
    11
    \n+
    12#include <dune/common/iteratorfacades.hh>
    \n+
    13#include <dune/common/typetraits.hh>
    \n
    14
    \n-
    19namespace Dune {
    \n-
    20
    \n-
    36 template< int dim, int dimworld = dim, class ctype = double >
    \n-
    37 struct BoundarySegment;
    \n-
    38
    \n-
    39 template <class BndSeg>
    \n-
    \n-\n-
    41 {
    \n-
    42 public:
    \n-
    43 // type of object stream used for storing boundary segment information
    \n-
    44 typedef std::stringstream ObjectStreamType ;
    \n-
    45
    \n-
    46 protected:
    \n-
    48 typedef BndSeg BoundarySegment;
    \n-
    49
    \n-
    51 typedef Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment > ( ObjectStreamType& ), int > FactoryType;
    \n-
    52
    \n-
    \n-
    59 static std::unique_ptr< BoundarySegment > restore( ObjectStreamType& in )
    \n-
    60 {
    \n-
    61 int key = -1;
    \n-
    62 // read class key for restore
    \n-
    63 in.read( (char *) &key, sizeof( int ) );
    \n-
    64
    \n-
    65 // factory creates a unique_ptr which can be released later on
    \n-
    66 return factory().create( key, in );
    \n-
    67 }
    \n-
    \n-
    68
    \n-
    69 template <class DerivedType>
    \n-
    \n-
    70 static int registerFactory()
    \n-
    71 {
    \n-
    72 const int key = createKey();
    \n-
    73 // create factory method that produces unique_ptr
    \n-
    74 factory().template define< DerivedType >( key );
    \n-
    75 // return key for storage in derived class
    \n-
    76 return key;
    \n-
    77 }
    \n-
    \n-
    78
    \n-
    79 private:
    \n-
    80 static int createKey()
    \n-
    81 {
    \n-
    82 static int key = 0;
    \n-
    83 return key++;
    \n-
    84 }
    \n+\n+\n+
    17
    \n+
    18namespace Dune
    \n+
    19{
    \n+
    22
    \n+
    23 namespace VTK {
    \n+
    24
    \n+
    26
    \n+
    49 template<typename CellIterator, typename IS>
    \n+
    \n+\n+
    51 : public ForwardIteratorFacade
    \n+
    52 < PointIterator<CellIterator, IS>,
    \n+
    53 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n+
    54 CellIterator>::value_type>::type>,
    \n+
    55 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n+
    56 CellIterator>::value_type>::type>&,
    \n+
    57 typename std::iterator_traits<CellIterator>::difference_type>
    \n+
    58 {
    \n+
    59 public:
    \n+
    60 typedef VTK::Corner<typename std::remove_const<typename std::iterator_traits<
    \n+
    61 CellIterator>::value_type>::type> Corner;
    \n+
    62
    \n+
    63 // reiterate the facades typedefs here
    \n+\n+
    65 typedef const Corner Value;
    \n+
    66 typedef Value& Reference;
    \n+
    67 typedef typename std::iterator_traits<CellIterator>::difference_type
    \n+\n+
    69
    \n+
    70 static const unsigned mydim = std::iterator_traits<CellIterator>::
    \n+
    71 value_type::mydimension;
    \n+
    72
    \n+
    73 private:
    \n+
    74 typedef ForwardIteratorFacade<DerivedType, Value, Reference,
    \n+
    75 DifferenceType> Facade;
    \n+
    76
    \n+\n+
    78 const IS* is;
    \n+
    79 std::vector<bool> seen;
    \n+
    80
    \n+
    81 public:
    \n+
    \n+\n+
    83 return *cornerit;
    \n+
    84 }
    \n+
    \n
    85
    \n-
    86 static FactoryType& factory()
    \n-
    87 {
    \n-
    88 return Dune::Singleton< FactoryType > :: instance();
    \n-
    89 }
    \n-
    90 };
    \n-
    \n-
    91
    \n-
    92 template< int dim, int dimworld, class ctype >
    \n-
    \n-
    93 struct BoundarySegment : public BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > >
    \n-
    94 {
    \n-\n-\n-
    97
    \n-
    98 typedef typename BaseType :: ObjectStreamType ObjectStreamType;
    \n-
    99
    \n-
    100 using BaseType :: restore;
    \n-\n-
    102
    \n-
    104 virtual ~BoundarySegment() {}
    \n+
    \n+
    86 bool isDereferencable() const {
    \n+
    87 return cornerit.isDereferencable();
    \n+
    88 }
    \n+
    \n+
    89
    \n+
    \n+
    90 bool equals(const DerivedType& other) const {
    \n+
    91 return cornerit == other.cornerit;
    \n+
    92 }
    \n+
    \n+
    93
    \n+
    \n+
    94 void increment() {
    \n+
    95 for(++cornerit; isDereferencable(); ++cornerit) {
    \n+
    96 typename IS::IndexType index =
    \n+
    97 is->subIndex(cornerit->cell(), cornerit->duneIndex(), mydim);
    \n+
    98
    \n+
    99 if(!seen[index]) {
    \n+
    100 seen[index] = true;
    \n+
    101 break;
    \n+
    102 }
    \n+
    103 }
    \n+
    104 }
    \n+
    \n
    105
    \n-
    108 virtual FieldVector< ctype, dimworld >
    \n-
    109 operator() ( const FieldVector< ctype, dim-1> &local ) const = 0;
    \n-
    110
    \n-
    \n-
    114 virtual void backup( [[maybe_unused]] ObjectStreamType& buffer ) const
    \n-
    115 {
    \n-
    116 DUNE_THROW(NotImplemented,"BoundarySegment::backup needs to be overloaded!");
    \n-
    117 }
    \n-
    \n-
    118 };
    \n-
    \n-
    119
    \n-
    120
    \n-
    121} // end namespace Dune
    \n-
    122
    \n-
    123#endif
    \n+
    107
    \n+
    \n+
    112 PointIterator(const CellIterator& cellit, const CellIterator& cellend,
    \n+
    113 const IS& is_)
    \n+
    114 : cornerit(cellit, cellend), is(&is_), seen(is->size(mydim), false)
    \n+
    115 { }
    \n+
    \n+
    117
    \n+
    \n+
    120 PointIterator(const CellIterator& cellend_)
    \n+
    121 : cornerit(cellend_), is(0)
    \n+
    122 { }
    \n+
    \n+
    123 };
    \n+
    \n+
    124
    \n+
    125 } // namespace VTK
    \n+
    126
    \n+
    128
    \n+
    129} // namespace Dune
    \n+
    130
    \n+
    131#endif // DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    BaseType::ObjectStreamType ObjectStreamType
    Definition boundarysegment.hh:98
    \n-
    BoundarySegment< dim, dimworld, ctype > ThisType
    Definition boundarysegment.hh:95
    \n-
    virtual void backup(ObjectStreamType &buffer) const
    write BoundarySegment's data to stream buffer
    Definition boundarysegment.hh:114
    \n-
    BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > > BaseType
    Definition boundarysegment.hh:96
    \n-
    virtual FieldVector< ctype, dimworld > operator()(const FieldVector< ctype, dim-1 > &local) const =0
    A function mapping local coordinates on a boundary segment to world coordinates.
    \n-
    virtual ~BoundarySegment()
    Dummy virtual destructor.
    Definition boundarysegment.hh:104
    \n-
    Definition boundarysegment.hh:41
    \n-
    static std::unique_ptr< BoundarySegment > restore(ObjectStreamType &in)
    create an object of BoundarySegment type from a previously registered factory linked to key.
    Definition boundarysegment.hh:59
    \n-
    Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >(ObjectStreamType &), int > FactoryType
    type of factory creating a unique_ptr from an ObjectStreamType
    Definition boundarysegment.hh:51
    \n-
    BndSeg BoundarySegment
    type of BoundarySegment interface class
    Definition boundarysegment.hh:48
    \n-
    std::stringstream ObjectStreamType
    Definition boundarysegment.hh:44
    \n-
    static int registerFactory()
    Definition boundarysegment.hh:70
    \n+
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n+
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n+
    bool isDereferencable() const
    Definition corneriterator.hh:69
    \n+
    iterate over the points of some corner range
    Definition pointiterator.hh:58
    \n+
    PointIterator(const CellIterator &cellit, const CellIterator &cellend, const IS &is_)
    construct a CornerIterator
    Definition pointiterator.hh:112
    \n+
    void increment()
    Definition pointiterator.hh:94
    \n+
    VTK::Corner< typename std::remove_const< typename std::iterator_traits< CellIterator >::value_type >::type > Corner
    Definition pointiterator.hh:61
    \n+
    Reference dereference() const
    Definition pointiterator.hh:82
    \n+
    std::iterator_traits< CellIterator >::difference_type DifferenceType
    Definition pointiterator.hh:68
    \n+
    static const unsigned mydim
    Definition pointiterator.hh:70
    \n+
    PointIterator(const CellIterator &cellend_)
    construct a CornerIterator
    Definition pointiterator.hh:120
    \n+
    bool equals(const DerivedType &other) const
    Definition pointiterator.hh:90
    \n+
    PointIterator< CellIterator, IS > DerivedType
    Definition pointiterator.hh:64
    \n+
    const Corner Value
    Definition pointiterator.hh:65
    \n+
    Value & Reference
    Definition pointiterator.hh:66
    \n+
    bool isDereferencable() const
    Definition pointiterator.hh:86
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,154 +1,169 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * common\n-boundarysegment.hh\n+ * io\n+ * file\n+ * vtk\n+pointiterator.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH\n-6#define DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13#include \n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH\n+7#define DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH\n+8\n+9#include \n+10#include \n+11\n+12#include \n+13#include \n 14\n-19namespace Dune {\n-20\n-36 template< int dim, int dimworld = dim, class ctype = double >\n-37 struct BoundarySegment;\n-38\n-39 template \n-40 class BoundarySegmentBackupRestore\n-41 {\n-42 public:\n-43 // type of object stream used for storing boundary segment information\n-44 typedef std::stringstream ObjectStreamType ;\n-45\n-46 protected:\n-48 typedef BndSeg BoundarySegment;\n-49\n-51 typedef Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >\n-( ObjectStreamType& ), int > FactoryType;\n-52\n-59 static std::unique_ptr< BoundarySegment > restore( ObjectStreamType& in )\n-60 {\n-61 int key = -1;\n-62 // read class key for restore\n-63 in.read( (char *) &key, sizeof( int ) );\n-64\n-65 // factory creates a unique_ptr which can be released later on\n-66 return factory().create( key, in );\n-67 }\n-68\n-69 template \n-70 static int registerFactory()\n-71 {\n-72 const int key = createKey();\n-73 // create factory method that produces unique_ptr\n-74 factory().template define< DerivedType >( key );\n-75 // return key for storage in derived class\n-76 return key;\n-77 }\n-78\n-79 private:\n-80 static int createKey()\n-81 {\n-82 static int key = 0;\n-83 return key++;\n+15#include \n+16#include \n+17\n+18namespace Dune\n+19{\n+22\n+23 namespace VTK {\n+24\n+26\n+49 template\n+50 class PointIterator\n+51 : public ForwardIteratorFacade\n+52 < PointIterator,\n+53 const Corner::value_type>::type>,\n+55 const Corner::value_type>::type>&,\n+57 typename std::iterator_traits::difference_type>\n+58 {\n+59 public:\n+60 typedef VTK::Corner::value_type>::type> Corner;\n+62\n+63 // reiterate the facades typedefs here\n+64 typedef PointIterator DerivedType;\n+65 typedef const Corner Value;\n+66 typedef Value& Reference;\n+67 typedef typename std::iterator_traits::difference_type\n+68 DifferenceType;\n+69\n+70 static const unsigned mydim = std::iterator_traits::\n+71 value_type::mydimension;\n+72\n+73 private:\n+74 typedef ForwardIteratorFacade Facade;\n+76\n+77 CornerIterator cornerit;\n+78 const IS* is;\n+79 std::vector seen;\n+80\n+81 public:\n+82 Reference dereference() const {\n+83 return *cornerit;\n 84 }\n 85\n-86 static FactoryType& factory()\n-87 {\n-88 return Dune::Singleton< FactoryType > :: instance();\n-89 }\n-90 };\n-91\n-92 template< int dim, int dimworld, class ctype >\n-93 struct BoundarySegment : public BoundarySegmentBackupRestore<\n-BoundarySegment< dim, dimworld, ctype > >\n-94 {\n-95 typedef BoundarySegment<_dim,_dimworld,_ctype_> ThisType;\n-96 typedef BoundarySegmentBackupRestore<_BoundarySegment<_dim,_dimworld,_ctype\n-> > BaseType;\n-97\n-98 typedef typename BaseType :: ObjectStreamType ObjectStreamType;\n-99\n-100 using BaseType ::_restore;\n-101 using BaseType ::_registerFactory;\n-102\n-104 virtual ~BoundarySegment() {}\n+86 bool isDereferencable() const {\n+87 return cornerit.isDereferencable();\n+88 }\n+89\n+90 bool equals(const DerivedType& other) const {\n+91 return cornerit == other.cornerit;\n+92 }\n+93\n+94 void increment() {\n+95 for(++cornerit; isDereferencable(); ++cornerit) {\n+96 typename IS::IndexType index =\n+97 is->subIndex(cornerit->cell(), cornerit->duneIndex(), mydim);\n+98\n+99 if(!seen[index]) {\n+100 seen[index] = true;\n+101 break;\n+102 }\n+103 }\n+104 }\n 105\n-108 virtual FieldVector< ctype, dimworld >\n-109 operator()_( const FieldVector< ctype, dim-1> &local ) const = 0;\n-110\n-114 virtual void backup( [[maybe_unused]] ObjectStreamType& buffer ) const\n-115 {\n-116 DUNE_THROW(NotImplemented,\"BoundarySegment::backup needs to be\n-overloaded!\");\n-117 }\n-118 };\n-119\n-120\n-121} // end namespace Dune\n-122\n-123#endif\n+107\n+112 PointIterator(const CellIterator& cellit, const CellIterator& cellend,\n+113 const IS& is_)\n+114 : cornerit(cellit, cellend), is(&is_), seen(is->size(mydim), false)\n+115 { }\n+117\n+120 PointIterator(const CellIterator& cellend_)\n+121 : cornerit(cellend_), is(0)\n+122 { }\n+123 };\n+124\n+125 } // namespace VTK\n+126\n+128\n+129} // namespace Dune\n+130\n+131#endif // DUNE_GRID_IO_FILE_VTK_POINTITERATOR_HH\n+corneriterator.hh\n+corner.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::BoundarySegment::ObjectStreamType\n-BaseType::ObjectStreamType ObjectStreamType\n-Definition boundarysegment.hh:98\n-Dune::BoundarySegment::ThisType\n-BoundarySegment< dim, dimworld, ctype > ThisType\n-Definition boundarysegment.hh:95\n-Dune::BoundarySegment::backup\n-virtual void backup(ObjectStreamType &buffer) const\n-write BoundarySegment's data to stream buffer\n-Definition boundarysegment.hh:114\n-Dune::BoundarySegment::BaseType\n-BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > >\n-BaseType\n-Definition boundarysegment.hh:96\n-Dune::BoundarySegment::operator()\n-virtual FieldVector< ctype, dimworld > operator()(const FieldVector< ctype,\n-dim-1 > &local) const =0\n-A function mapping local coordinates on a boundary segment to world\n-coordinates.\n-Dune::BoundarySegment::~BoundarySegment\n-virtual ~BoundarySegment()\n-Dummy virtual destructor.\n-Definition boundarysegment.hh:104\n-Dune::BoundarySegmentBackupRestore\n-Definition boundarysegment.hh:41\n-Dune::BoundarySegmentBackupRestore::restore\n-static std::unique_ptr< BoundarySegment > restore(ObjectStreamType &in)\n-create an object of BoundarySegment type from a previously registered factory\n-linked to key.\n-Definition boundarysegment.hh:59\n-Dune::BoundarySegmentBackupRestore::FactoryType\n-Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >\n-(ObjectStreamType &), int > FactoryType\n-type of factory creating a unique_ptr from an ObjectStreamType\n-Definition boundarysegment.hh:51\n-Dune::BoundarySegmentBackupRestore::BoundarySegment\n-BndSeg BoundarySegment\n-type of BoundarySegment interface class\n-Definition boundarysegment.hh:48\n-Dune::BoundarySegmentBackupRestore::ObjectStreamType\n-std::stringstream ObjectStreamType\n-Definition boundarysegment.hh:44\n-Dune::BoundarySegmentBackupRestore::registerFactory\n-static int registerFactory()\n-Definition boundarysegment.hh:70\n+Dune::VTK::Corner\n+simple class representing a corner of a cell\n+Definition corner.hh:25\n+Dune::VTK::CornerIterator\n+iterate over the corners of some cell range\n+Definition corneriterator.hh:39\n+Dune::VTK::CornerIterator::isDereferencable\n+bool isDereferencable() const\n+Definition corneriterator.hh:69\n+Dune::VTK::PointIterator\n+iterate over the points of some corner range\n+Definition pointiterator.hh:58\n+Dune::VTK::PointIterator::PointIterator\n+PointIterator(const CellIterator &cellit, const CellIterator &cellend, const IS\n+&is_)\n+construct a CornerIterator\n+Definition pointiterator.hh:112\n+Dune::VTK::PointIterator::increment\n+void increment()\n+Definition pointiterator.hh:94\n+Dune::VTK::PointIterator::Corner\n+VTK::Corner< typename std::remove_const< typename std::iterator_traits<\n+CellIterator >::value_type >::type > Corner\n+Definition pointiterator.hh:61\n+Dune::VTK::PointIterator::dereference\n+Reference dereference() const\n+Definition pointiterator.hh:82\n+Dune::VTK::PointIterator::DifferenceType\n+std::iterator_traits< CellIterator >::difference_type DifferenceType\n+Definition pointiterator.hh:68\n+Dune::VTK::PointIterator::mydim\n+static const unsigned mydim\n+Definition pointiterator.hh:70\n+Dune::VTK::PointIterator::PointIterator\n+PointIterator(const CellIterator &cellend_)\n+construct a CornerIterator\n+Definition pointiterator.hh:120\n+Dune::VTK::PointIterator::equals\n+bool equals(const DerivedType &other) const\n+Definition pointiterator.hh:90\n+Dune::VTK::PointIterator::DerivedType\n+PointIterator< CellIterator, IS > DerivedType\n+Definition pointiterator.hh:64\n+Dune::VTK::PointIterator::Value\n+const Corner Value\n+Definition pointiterator.hh:65\n+Dune::VTK::PointIterator::Reference\n+Value & Reference\n+Definition pointiterator.hh:66\n+Dune::VTK::PointIterator::isDereferencable\n+bool isDereferencable() const\n+Definition pointiterator.hh:86\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00317.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00599.html", "comments": ["Files 91% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: mapper.hh File Reference\n+dune-grid: coordfunctioncaller.hh File Reference\n \n \n \n \n \n \n \n@@ -65,47 +65,37 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    mapper.hh File Reference
    \n+
    coordfunctioncaller.hh File Reference
    \n
    \n
    \n-\n-

    Provides classes with basic mappers which are used to attach data to a grid. \n-More...

    \n-
    #include <utility>
    \n-#include <dune/common/bartonnackmanifcheck.hh>
    \n+\n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::Mapper< G, MapperImp, IndexType >
     Mapper interface. More...
     
    \n \n \n \n \n+\n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n-

    Detailed Description

    \n-

    Provides classes with basic mappers which are used to attach data to a grid.

    \n-
    Author
    Peter Bastian
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,28 +1,21 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * common\n-Classes | Namespaces\n-mapper.hh File Reference\n-Provides classes with basic mappers which are used to attach data to a grid.\n-More...\n-#include \n-#include \n+ * geometrygrid\n+Namespaces\n+coordfunctioncaller.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n-Classes\n-class \u00a0 Dune::Mapper<_G,_MapperImp,_IndexType_>\n-\u00a0 Mapper interface. More...\n-\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-***** Detailed Description *****\n-Provides classes with basic mappers which are used to attach data to a grid.\n- Author\n- Peter Bastian\n+namespace \u00a0 Dune::GeoGrid\n+\u00a0 namespace containing the implementations of GeometryGrid\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00317_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00287_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,15 +77,15 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n
    mapper.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_COMMON_MAPPER_HH
    \n
    6#define DUNE_GRID_COMMON_MAPPER_HH
    \n
    7
    \n
    8#include <utility>
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00329.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00692.html", "comments": ["Files 88% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: rangegenerators.hh File Reference\n+dune-grid: hierarchiciterator.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,34 @@\n
    \n
    \n
    \n \n \n \n \n
    \n \n-
    rangegenerators.hh File Reference
    \n+
    hierarchiciterator.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/iteratorrange.hh>
    \n-#include <dune/common/rangeutilities.hh>
    \n-#include <dune/geometry/dimension.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/common/partitionset.hh>
    \n+\n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::AlbertaGridHierarchicIterator< GridImp >
     
    \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,21 +1,21 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * common\n-Namespaces\n-rangegenerators.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+ * albertagrid\n+Classes | Namespaces\n+hierarchiciterator.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::AlbertaGridHierarchicIterator<_GridImp_>\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00329_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00797_source.html", "comments": ["Files 82% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: rangegenerators.hh Source File\n+dune-grid: vtuwriter.hh Source File\n \n \n \n \n \n \n \n@@ -70,306 +70,308 @@\n
    \n \n \n \n \n \n \n
    \n-
    rangegenerators.hh
    \n+
    vtuwriter.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_COMMON_RANGEGENERATORS_HH
    \n-
    6#define DUNE_GRID_COMMON_RANGEGENERATORS_HH
    \n-
    7
    \n-
    8#include <dune/common/iteratorrange.hh>
    \n-
    9#include <dune/common/rangeutilities.hh>
    \n-
    10#include <dune/geometry/dimension.hh>
    \n-\n-\n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17#ifdef DOXYGEN
    \n-
    18
    \n-
    206 // *****************************************************************************************
    \n-
    207 // Doxygen documentation
    \n-
    208 // *****************************************************************************************
    \n-
    209 //
    \n-
    210 // In the following, the range generating functions are documented for Doxygen; the actual
    \n-
    211 // implementations are further down in this file and hidden from Doxygen.
    \n-
    212 // The main reason for this split are the return types of those functions, which either contain
    \n-
    213 // long type listings to obtain the iterator type or (in the case of the forwarded functions
    \n-
    214 // use the new-style function syntax and calculate the return type using decltype. In both cases,
    \n-
    215 // Doxygen generates function signatures that are very confusing to the average user.
    \n-
    216 //
    \n-
    217 // *****************************************************************************************
    \n-
    218
    \n-
    219
    \n-
    220
    \n-
    224
    \n-
    225
    \n-
    227
    \n-
    256 template<typename GV>
    \n-
    257 inline IteratorRange<...> elements(const GV& gv);
    \n-
    258
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH
    \n+
    8
    \n+
    9#include <ostream>
    \n+
    10#include <string>
    \n+
    11
    \n+
    12#include <dune/common/exceptions.hh>
    \n+
    13#include <dune/common/indent.hh>
    \n+
    14
    \n+\n+\n+
    17
    \n+
    18namespace Dune {
    \n+
    19
    \n+
    22
    \n+
    23 namespace VTK {
    \n+
    24
    \n+
    26
    \n+
    \n+
    98 class VTUWriter {
    \n+
    99 public:
    \n+
    100 std::ostream& stream;
    \n+\n+
    102
    \n+
    103 private:
    \n+\n+
    105 Indent indent;
    \n+
    106
    \n+
    107 std::string fileType;
    \n+
    108 std::string cellName;
    \n+
    109
    \n+
    110 bool doAppended;
    \n+
    111
    \n+
    112 public:
    \n+
    114
    \n+
    \n+
    122 inline VTUWriter(std::ostream& stream_, OutputType outputType,
    \n+
    123 FileType fileType_)
    \n+
    124 : stream(stream_), factory(outputType, stream)
    \n+
    125 {
    \n+
    126 switch(fileType_) {
    \n+
    127 case polyData :
    \n+
    128 fileType = "PolyData";
    \n+
    129 cellName = "Lines";
    \n+
    130 break;
    \n+
    131 case unstructuredGrid :
    \n+
    132 fileType = "UnstructuredGrid";
    \n+
    133 cellName = "Cells";
    \n+
    134 break;
    \n+
    135 default :
    \n+
    136 DUNE_THROW(IOError, "VTUWriter: Unknown fileType: " << fileType_);
    \n+
    137 }
    \n+
    138 const std::string& byteOrder = getEndiannessString();
    \n+
    139
    \n+
    140 stream << indent << "<?xml version=\\"1.0\\"?>\\n";
    \n+
    141 stream << indent << "<VTKFile"
    \n+
    142 << " type=\\"" << fileType << "\\""
    \n+
    143 << " version=\\"0.1\\""
    \n+
    144 << " byte_order=\\"" << byteOrder << "\\">\\n";
    \n+
    145 ++indent;
    \n+
    146 }
    \n+
    \n+
    147
    \n+
    \n+
    149 inline ~VTUWriter() {
    \n+
    150 --indent;
    \n+
    151 stream << indent << "</VTKFile>\\n"
    \n+
    152 << std::flush;
    \n+
    153 }
    \n+
    \n+
    154
    \n+
    156
    \n+
    \n+
    167 inline void beginPointData(const std::string& scalars = "",
    \n+
    168 const std::string& vectors = "") {
    \n+
    169 switch(phase) {
    \n+
    170 case main :
    \n+
    171 stream << indent << "<PointData";
    \n+
    172 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n+
    173 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n+
    174 stream << ">\\n";
    \n+
    175 ++indent;
    \n+
    176 break;
    \n+
    177 case appended :
    \n+
    178 break;
    \n+
    179 }
    \n+
    180 }
    \n+
    \n+
    \n+
    182 inline void endPointData() {
    \n+
    183 switch(phase) {
    \n+
    184 case main :
    \n+
    185 --indent;
    \n+
    186 stream << indent << "</PointData>\\n";
    \n+
    187 break;
    \n+
    188 case appended :
    \n+
    189 break;
    \n+
    190 }
    \n+
    191 }
    \n+
    \n+
    192
    \n+
    194
    \n+
    \n+
    205 inline void beginCellData(const std::string& scalars = "",
    \n+
    206 const std::string& vectors = "") {
    \n+
    207 switch(phase) {
    \n+
    208 case main :
    \n+
    209 stream << indent << "<CellData";
    \n+
    210 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n+
    211 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n+
    212 stream << ">\\n";
    \n+
    213 ++indent;
    \n+
    214 break;
    \n+
    215 case appended :
    \n+
    216 break;
    \n+
    217 }
    \n+
    218 }
    \n+
    \n+
    \n+
    220 inline void endCellData() {
    \n+
    221 switch(phase) {
    \n+
    222 case main :
    \n+
    223 --indent;
    \n+
    224 stream << indent << "</CellData>\\n";
    \n+
    225 break;
    \n+
    226 case appended :
    \n+
    227 break;
    \n+
    228 }
    \n+
    229 }
    \n+
    \n+
    230
    \n+
    232
    \n+
    \n+
    238 inline void beginPoints() {
    \n+
    239 switch(phase) {
    \n+
    240 case main :
    \n+
    241 stream << indent << "<Points>\\n";
    \n+
    242 ++indent;
    \n+
    243 break;
    \n+
    244 case appended :
    \n+
    245 break;
    \n+
    246 }
    \n+
    247 }
    \n+
    \n+
    \n+
    249 inline void endPoints() {
    \n+
    250 switch(phase) {
    \n+
    251 case main :
    \n+
    252 --indent;
    \n+
    253 stream << indent << "</Points>\\n";
    \n+
    254 break;
    \n+
    255 case appended :
    \n+
    256 break;
    \n+
    257 }
    \n+
    258 }
    \n+
    \n
    259
    \n
    261
    \n-
    290 template<typename GV>
    \n-
    291 inline IteratorRange<...> facets(const GV& gv);
    \n-
    292
    \n-
    293
    \n+
    \n+
    274 inline void beginCells() {
    \n+
    275 switch(phase) {
    \n+
    276 case main :
    \n+
    277 stream << indent << "<" << cellName << ">\\n";
    \n+
    278 ++indent;
    \n+
    279 break;
    \n+
    280 case appended :
    \n+
    281 break;
    \n+
    282 }
    \n+
    283 }
    \n+
    \n+
    \n+
    285 inline void endCells() {
    \n+
    286 switch(phase) {
    \n+
    287 case main :
    \n+
    288 --indent;
    \n+
    289 stream << indent << "</" << cellName << ">\\n";
    \n+
    290 break;
    \n+
    291 case appended :
    \n+
    292 break;
    \n+
    293 }
    \n+
    294 }
    \n+
    \n
    295
    \n-
    324 template<typename GV>
    \n-
    325 inline IteratorRange<...> edges(const GV& gv);
    \n+
    297
    \n+
    \n+
    310 inline void beginMain(unsigned ncells, unsigned npoints) {
    \n+
    311 stream << indent << "<" << fileType << ">\\n";
    \n+
    312 ++indent;
    \n+
    313 stream << indent << "<Piece"
    \n+
    314 << " NumberOf" << cellName << "=\\"" << ncells << "\\""
    \n+
    315 << " NumberOfPoints=\\"" << npoints << "\\">\\n";
    \n+
    316 ++indent;
    \n+
    317 phase = main;
    \n+
    318 }
    \n+
    \n+
    \n+
    320 inline void endMain() {
    \n+
    321 --indent;
    \n+
    322 stream << indent << "</Piece>\\n";
    \n+
    323 --indent;
    \n+
    324 stream << indent << "</" << fileType << ">\\n";
    \n+
    325 }
    \n+
    \n
    326
    \n-
    327
    \n-
    329
    \n-
    358 template<typename GV>
    \n-
    359 inline IteratorRange<...> vertices(const GV& gv);
    \n-
    360
    \n-
    361
    \n-
    363
    \n-
    364
    \n-
    365
    \n-
    369
    \n-
    371
    \n-
    394 template<typename GV, typename Entity>
    \n-
    395 inline IteratorRange<...> intersections(const GV& gv, const Entity& e);
    \n-
    396
    \n-
    397
    \n-
    399
    \n-
    400
    \n-
    401
    \n-
    405
    \n-
    406
    \n-
    408
    \n-
    434 template<typename Entity>
    \n-
    435 inline IteratorRange<...> descendantElements(const Entity& e, int maxLevel);
    \n-
    436 // Entity<int dim, class GridImp, template<int,int,class> class EntityImp>
    \n-
    437
    \n-
    439
    \n-
    440
    \n-
    441
    \n-
    445
    \n-
    446
    \n-
    448
    \n-
    486 template<typename GV, int codim>
    \n-
    487 inline IteratorRange<...> entities(const GV& gv, Codim<codim> cd);
    \n-
    488
    \n-
    489
    \n-
    491
    \n-
    531 template<typename GV, int dim>
    \n-
    532 inline IteratorRange<...> entities(const GV& gv, Dim<dim> d);
    \n-
    533
    \n-
    535
    \n-
    536
    \n-
    537
    \n-
    541
    \n-
    542
    \n-
    544
    \n-
    570 template<typename GV, unsigned int partitions>
    \n-\n-
    572
    \n-
    573
    \n-
    575
    \n-
    604 template<typename GV, unsigned int partitions>
    \n-\n-
    606
    \n-
    607
    \n-
    609
    \n-
    635 template<typename GV, unsigned int partitions>
    \n-\n-
    637
    \n-
    638
    \n-
    640
    \n-
    666 template<typename GV, unsigned int partitions>
    \n-\n-
    668
    \n-
    670
    \n-
    671
    \n-
    672
    \n-
    676
    \n-
    677
    \n-
    679
    \n-
    715 template<typename GV, int codim, unsigned int partitions>
    \n-\n-
    717
    \n-
    718
    \n-
    720
    \n-
    756 template<typename GV, int dim, unsigned int partitions>
    \n-\n-
    758
    \n-
    759
    \n-
    761
    \n-
    782 template<typename E, int codim>
    \n-
    783 inline IteratorRange<...> subEntities(const E& e, Codim<codim> c);
    \n-
    784
    \n-
    785
    \n-
    787
    \n-
    788
    \n-
    789#else // DOXYGEN
    \n-
    790
    \n-
    791 // ******************************************************************************************
    \n-
    792 // Implementations
    \n-
    793 // ******************************************************************************************
    \n-
    794
    \n-
    795
    \n-
    805 template<typename GV, int codim, unsigned int partitions>
    \n-
    806 inline auto entities(const GV& gv, Codim<codim>, PartitionSet<partitions>)
    \n-
    807 -> IteratorRange<decltype(gv.template begin<codim,derive_partition_iterator_type<partitions>::value>())>
    \n-
    808 {
    \n-
    809 static_assert(0 <= codim && codim <= GV::dimension, "invalid codimension for given GridView");
    \n-
    810 const PartitionIteratorType pit = derive_partition_iterator_type<partitions>::value;
    \n-
    811 typedef IteratorRange<decltype(gv.template begin<codim,pit>())> return_type;
    \n-
    812 return return_type(gv.template begin<codim,pit>(),gv.template end<codim,pit>());
    \n-
    813 }
    \n-
    814
    \n-
    822 template<typename GV, int codim>
    \n-
    823 inline auto entities(const GV& gv, Codim<codim>)
    \n-
    824 -> IteratorRange<decltype(gv.template begin<codim>())>
    \n-
    825 {
    \n-
    826 static_assert(0 <= codim && codim <= GV::dimension, "invalid codimension for given GridView");
    \n-
    827 typedef IteratorRange<decltype(gv.template begin<codim>())> return_type;
    \n-
    828 return return_type(gv.template begin<codim>(),gv.template end<codim>());
    \n-
    829 }
    \n-
    830
    \n-
    834 template<typename Entity>
    \n-
    835 inline IteratorRange<typename Entity::HierarchicIterator> descendantElements(const Entity& e, int maxLevel)
    \n-
    836 {
    \n-
    837 typedef IteratorRange<typename Entity::HierarchicIterator> return_type;
    \n-
    838 return return_type(e.hbegin(maxLevel),e.hend(maxLevel));
    \n-
    839 }
    \n-
    840
    \n-
    844 template<typename GV, typename Entity>
    \n-
    845 inline auto intersections(const GV& gv, const Entity& e)
    \n-
    846 -> IteratorRange<decltype(gv.ibegin(e))>
    \n-
    847 {
    \n-
    848 return IteratorRange<decltype(gv.ibegin(e))>(gv.ibegin(e),gv.iend(e));
    \n-
    849 }
    \n-
    850
    \n-
    851
    \n-
    857 template<typename GV, int dim, unsigned int partitions>
    \n-
    858 inline auto entities(const GV& gv, Dim<dim>, PartitionSet<partitions>)
    \n-
    859 -> decltype(entities(gv,Codim<GV::dimension - dim>(),PartitionSet<partitions>()))
    \n-
    860 {
    \n-
    861 static_assert(0 <= dim && dim <= GV::dimension, "invalid dimension for given GridView");
    \n-
    862 return entities(gv,Codim<GV::dimension - dim>(),PartitionSet<partitions>());
    \n-
    863 }
    \n-
    864
    \n-
    865 template<typename GV, int dim>
    \n-
    866 inline auto entities(const GV& gv, Dim<dim>)
    \n-
    867 -> decltype(entities(gv,Codim<GV::dimension - dim>()))
    \n-
    868 {
    \n-
    869 static_assert(0 <= dim && dim <= GV::dimension, "invalid dimension for given GridView");
    \n-
    870 return entities(gv,Codim<GV::dimension - dim>());
    \n-
    871 }
    \n-
    872
    \n-
    873 template<typename GV, unsigned int partitions>
    \n-
    874 inline auto elements(const GV& gv, PartitionSet<partitions>)
    \n-
    875 -> decltype(entities(gv,Codim<0>(),PartitionSet<partitions>()))
    \n-
    876 {
    \n-
    877 return entities(gv,Codim<0>(),PartitionSet<partitions>());
    \n-
    878 }
    \n-
    879
    \n-
    880 template<typename GV>
    \n-
    881 inline auto elements(const GV& gv)
    \n-
    882 -> decltype(entities(gv,Codim<0>()))
    \n-
    883 {
    \n-
    884 return entities(gv,Codim<0>());
    \n-
    885 }
    \n-
    886
    \n-
    887 template<typename GV, unsigned int partitions>
    \n-
    888 inline auto facets(const GV& gv, PartitionSet<partitions>)
    \n-
    889 -> decltype(entities(gv,Codim<1>(),PartitionSet<partitions>()))
    \n-
    890 {
    \n-
    891 return entities(gv,Codim<1>(),PartitionSet<partitions>());
    \n-
    892 }
    \n-
    893
    \n-
    894 template<typename GV>
    \n-
    895 inline auto facets(const GV& gv)
    \n-
    896 -> decltype(entities(gv,Codim<1>()))
    \n-
    897 {
    \n-
    898 return entities(gv,Codim<1>());
    \n-
    899 }
    \n-
    900
    \n-
    901 template<typename GV, unsigned int partitions>
    \n-
    902 inline auto edges(const GV& gv, PartitionSet<partitions>)
    \n-
    903 -> decltype(entities(gv,Dim<1>(),PartitionSet<partitions>()))
    \n-
    904 {
    \n-
    905 return entities(gv,Dim<1>(),PartitionSet<partitions>());
    \n-
    906 }
    \n-
    907
    \n-
    908 template<typename GV>
    \n-
    909 inline auto edges(const GV& gv)
    \n-
    910 -> decltype(entities(gv,Dim<1>()))
    \n-
    911 {
    \n-
    912 return entities(gv,Dim<1>());
    \n-
    913 }
    \n-
    914
    \n-
    915 template<typename GV, unsigned int partitions>
    \n-
    916 inline auto vertices(const GV& gv, PartitionSet<partitions>)
    \n-
    917 -> decltype(entities(gv,Dim<0>(),PartitionSet<partitions>()))
    \n-
    918 {
    \n-
    919 return entities(gv,Dim<0>(),PartitionSet<partitions>());
    \n-
    920 }
    \n-
    921
    \n-
    922 template<typename GV>
    \n-
    923 inline auto vertices(const GV& gv)
    \n-
    924 -> decltype(entities(gv,Dim<0>()))
    \n-
    925 {
    \n-
    926 return entities(gv,Dim<0>());
    \n-
    927 }
    \n-
    928
    \n-
    929 template<typename E, int codim>
    \n-
    930 inline auto subEntities(const E& e, Codim<codim> c)
    \n-
    931 {
    \n-
    932 static_assert(E::codimension <= codim,
    \n-
    933 "Can only iterate over sub-entities with equal or larger codimension");
    \n-
    934 return transformedRangeView(
    \n-
    935 range(static_cast<int>(e.subEntities(c))),
    \n-
    936 [&](const int i){ return e.template subEntity<codim>(i); }
    \n-
    937 );
    \n-
    938 }
    \n-
    939
    \n-
    940#endif // DOXYGEN
    \n-
    941
    \n-
    946} // namespace Dune
    \n-
    947
    \n-
    948#endif // DUNE_GRID_COMMON_RANGEGENERATORS_HH
    \n-\n-\n-
    PartitionIteratorType
    Parameter to be used for the parallel level- and leaf iterators.
    Definition gridenums.hh:136
    \n-
    IteratorRange<... > intersections(const GV &gv, const Entity &e)
    Iterates over all Intersections of an Entity with respect to the given GridView.
    \n-
    IteratorRange<... > vertices(const GV &gv)
    Iterates over all vertices (entities with dimension 0) of a GridView.
    \n-
    IteratorRange<... > elements(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all elements / cells (entities with codimension 0) of a GridView that belong to the giv...
    \n-
    IteratorRange<... > entities(const GV &gv, Codim< codim > cd, PartitionSet< partitions > ps)
    Iterates over all entities of a GridView with the given codimension that belong to the given Partitio...
    \n-
    IteratorRange<... > edges(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all edges (entities with dimension 1) of a GridView that belong to the given PartitionS...
    \n-
    IteratorRange<... > entities(const GV &gv, Dim< dim > d, PartitionSet< partitions > ps)
    Iterates over all entities of a GridView with the given dimension that belong to the given PartitionS...
    \n-
    IteratorRange<... > entities(const GV &gv, Dim< dim > d)
    Iterates over all entities of a GridView with the given dimension.
    \n-
    IteratorRange<... > subEntities(const E &e, Codim< codim > c)
    Iterates over all sub-entities of an entity given the codimension of the sub-entities.
    \n-
    IteratorRange<... > vertices(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all vertices (entities with dimension 0) of a GridView that belong to the given Partiti...
    \n-
    IteratorRange<... > elements(const GV &gv)
    Iterates over all elements / cells (entities with codimension 0) of a GridView.
    \n-
    IteratorRange<... > entities(const GV &gv, Codim< codim > cd)
    Iterates over all entities of a GridView with the given codimension.
    \n-
    IteratorRange<... > facets(const GV &gv, PartitionSet< partitions > ps)
    Iterates over all facets (entities with codimension 1) of a GridView that belong to the given Partiti...
    \n-
    IteratorRange<... > facets(const GV &gv)
    Iterates over all facets (entities with codimension 1) of a GridView.
    \n-
    IteratorRange<... > edges(const GV &gv)
    Iterates over all edges (entities with dimension 1) of a GridView.
    \n-
    IteratorRange<... > descendantElements(const Entity &e, int maxLevel)
    Iterates over all descendant elements of the given element up to a maximum level.
    \n+
    328
    \n+
    \n+
    345 inline bool beginAppended() {
    \n+
    346 doAppended = factory.beginAppended();
    \n+
    347 if(doAppended) {
    \n+
    348 const std::string& encoding = factory.appendedEncoding();
    \n+
    349 stream << indent << "<AppendedData"
    \n+
    350 << " encoding=\\"" << encoding << "\\">\\n";
    \n+
    351 ++indent;
    \n+
    352 // mark begin of data
    \n+
    353 stream << indent << "_";
    \n+
    354 }
    \n+
    355 phase = appended;
    \n+
    356 return doAppended;
    \n+
    357 }
    \n+
    \n+
    \n+
    359 inline void endAppended() {
    \n+
    360 if(doAppended) {
    \n+
    361 stream << "\\n";
    \n+
    362 --indent;
    \n+
    363 stream << indent << "</AppendedData>\\n";
    \n+
    364 }
    \n+
    365 }
    \n+
    \n+
    366
    \n+
    368
    \n+
    \n+
    380 DataArrayWriter* makeArrayWriter(const std::string& name,
    \n+
    381 unsigned ncomps, unsigned nitems,
    \n+
    382 Precision prec) {
    \n+
    383 return factory.make(name, ncomps, nitems, indent, prec);
    \n+
    384 }
    \n+
    \n+
    385 };
    \n+
    \n+
    386
    \n+
    387 } // namespace VTK
    \n+
    388
    \n+
    390
    \n+
    391} // namespace Dune
    \n+
    392
    \n+
    393#endif // DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH
    \n+
    Data array writers for the VTKWriter.
    \n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n-
    A set of PartitionType values.
    Definition partitionset.hh:137
    \n+
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n+
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n+
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n+
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n+
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n+
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n+
    base class for data array writers
    Definition dataarraywriter.hh:56
    \n+
    a factory for DataArrayWriters
    Definition dataarraywriter.hh:462
    \n+
    bool beginAppended()
    signal start of the appended section
    Definition dataarraywriter.hh:497
    \n+
    DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned nitems, const Indent &indent, Precision prec)
    create a DataArrayWriter
    Definition dataarraywriter.hh:541
    \n+
    const std::string & appendedEncoding() const
    query encoding string for appended data
    Definition dataarraywriter.hh:510
    \n+
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n+
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n+
    bool beginAppended()
    start the appended data section
    Definition vtuwriter.hh:345
    \n+
    void endAppended()
    finish the appended data section
    Definition vtuwriter.hh:359
    \n+
    VTUWriter(std::ostream &stream_, OutputType outputType, FileType fileType_)
    create a VTUWriter object
    Definition vtuwriter.hh:122
    \n+
    std::ostream & stream
    Definition vtuwriter.hh:100
    \n+
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n+
    void beginMain(unsigned ncells, unsigned npoints)
    start the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:310
    \n+
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n+
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n+
    Phase
    Definition vtuwriter.hh:101
    \n+
    @ appended
    Definition vtuwriter.hh:101
    \n+
    @ main
    Definition vtuwriter.hh:101
    \n+
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n+
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n+
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n+
    ~VTUWriter()
    write footer
    Definition vtuwriter.hh:149
    \n+
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n+
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n+
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:320
    \n+
    enum Dune::VTK::VTUWriter::Phase phase
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,382 +1,364 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * common\n-rangegenerators.hh\n+ * io\n+ * file\n+ * vtk\n+vtuwriter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_COMMON_RANGEGENERATORS_HH\n-6#define DUNE_GRID_COMMON_RANGEGENERATORS_HH\n-7\n-8#include \n-9#include \n-10#include \n-11#include \n-12#include \n-13\n-14namespace Dune\n-15{\n-16\n-17#ifdef DOXYGEN\n-18\n-206 /\n-/\n-*****************************************************************************************\n-207 // Doxygen documentation\n-208 /\n-/\n-*****************************************************************************************\n-209 //\n-210 // In the following, the range generating functions are documented for\n-Doxygen; the actual\n-211 // implementations are further down in this file and hidden from Doxygen.\n-212 // The main reason for this split are the return types of those functions,\n-which either contain\n-213 // long type listings to obtain the iterator type or (in the case of the\n-forwarded functions\n-214 // use the new-style function syntax and calculate the return type using\n-decltype. In both cases,\n-215 // Doxygen generates function signatures that are very confusing to the\n-average user.\n-216 //\n-217 /\n-/\n-*****************************************************************************************\n-218\n-219\n-220\n-224\n-225\n-227\n-256 template\n-257 inline IteratorRange<...> elements(const GV& gv);\n-258\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH\n+8\n+9#include \n+10#include \n+11\n+12#include \n+13#include \n+14\n+15#include \n+16#include \n+17\n+18namespace Dune {\n+19\n+22\n+23 namespace VTK {\n+24\n+26\n+98 class VTUWriter {\n+99 public:\n+100 std::ostream& stream;\n+101 enum Phase { main, appended } phase;\n+102\n+103 private:\n+104 DataArrayWriterFactory factory;\n+105 Indent indent;\n+106\n+107 std::string fileType;\n+108 std::string cellName;\n+109\n+110 bool doAppended;\n+111\n+112 public:\n+114\n+122 inline VTUWriter(std::ostream& stream_, OutputType outputType,\n+123 FileType fileType_)\n+124 : stream(stream_), factory(outputType, stream)\n+125 {\n+126 switch(fileType_) {\n+127 case polyData :\n+128 fileType = \"PolyData\";\n+129 cellName = \"Lines\";\n+130 break;\n+131 case unstructuredGrid :\n+132 fileType = \"UnstructuredGrid\";\n+133 cellName = \"Cells\";\n+134 break;\n+135 default :\n+136 DUNE_THROW(IOError, \"VTUWriter: Unknown fileType: \" << fileType_);\n+137 }\n+138 const std::string& byteOrder = getEndiannessString();\n+139\n+140 stream << indent << \"\\n\";\n+141 stream << indent << \"\\n\";\n+145 ++indent;\n+146 }\n+147\n+149 inline ~VTUWriter() {\n+150 --indent;\n+151 stream << indent << \"\\n\"\n+152 << std::flush;\n+153 }\n+154\n+156\n+167 inline void beginPointData(const std::string& scalars = \"\",\n+168 const std::string& vectors = \"\") {\n+169 switch(phase) {\n+170 case main :\n+171 stream << indent << \"\\n\";\n+175 ++indent;\n+176 break;\n+177 case appended :\n+178 break;\n+179 }\n+180 }\n+182 inline void endPointData() {\n+183 switch(phase) {\n+184 case main :\n+185 --indent;\n+186 stream << indent << \"\\n\";\n+187 break;\n+188 case appended :\n+189 break;\n+190 }\n+191 }\n+192\n+194\n+205 inline void beginCellData(const std::string& scalars = \"\",\n+206 const std::string& vectors = \"\") {\n+207 switch(phase) {\n+208 case main :\n+209 stream << indent << \"\\n\";\n+213 ++indent;\n+214 break;\n+215 case appended :\n+216 break;\n+217 }\n+218 }\n+220 inline void endCellData() {\n+221 switch(phase) {\n+222 case main :\n+223 --indent;\n+224 stream << indent << \"\\n\";\n+225 break;\n+226 case appended :\n+227 break;\n+228 }\n+229 }\n+230\n+232\n+238 inline void beginPoints() {\n+239 switch(phase) {\n+240 case main :\n+241 stream << indent << \"\\n\";\n+242 ++indent;\n+243 break;\n+244 case appended :\n+245 break;\n+246 }\n+247 }\n+249 inline void endPoints() {\n+250 switch(phase) {\n+251 case main :\n+252 --indent;\n+253 stream << indent << \"\\n\";\n+254 break;\n+255 case appended :\n+256 break;\n+257 }\n+258 }\n 259\n 261\n-290 template\n-291 inline IteratorRange<...> facets(const GV& gv);\n-292\n-293\n+274 inline void beginCells() {\n+275 switch(phase) {\n+276 case main :\n+277 stream << indent << \"<\" << cellName << \">\\n\";\n+278 ++indent;\n+279 break;\n+280 case appended :\n+281 break;\n+282 }\n+283 }\n+285 inline void endCells() {\n+286 switch(phase) {\n+287 case main :\n+288 --indent;\n+289 stream << indent << \"\\n\";\n+290 break;\n+291 case appended :\n+292 break;\n+293 }\n+294 }\n 295\n-324 template\n-325 inline IteratorRange<...> edges(const GV& gv);\n+297\n+310 inline void beginMain(unsigned ncells, unsigned npoints) {\n+311 stream << indent << \"<\" << fileType << \">\\n\";\n+312 ++indent;\n+313 stream << indent << \"\\n\";\n+316 ++indent;\n+317 phase = main;\n+318 }\n+320 inline void endMain() {\n+321 --indent;\n+322 stream << indent << \"\\n\";\n+323 --indent;\n+324 stream << indent << \"\\n\";\n+325 }\n 326\n-327\n-329\n-358 template\n-359 inline IteratorRange<...> vertices(const GV& gv);\n-360\n-361\n-363\n-364\n-365\n-369\n-371\n-394 template\n-395 inline IteratorRange<...> intersections(const GV& gv, const Entity& e);\n-396\n-397\n-399\n-400\n-401\n-405\n-406\n-408\n-434 template\n-435 inline IteratorRange<...> descendantElements(const Entity& e, int\n-maxLevel);\n-436 // Entity class EntityImp>\n-437\n-439\n-440\n-441\n-445\n-446\n-448\n-486 template\n-487 inline IteratorRange<...> entities(const GV& gv, Codim cd);\n-488\n-489\n-491\n-531 template\n-532 inline IteratorRange<...> entities(const GV& gv, Dim d);\n-533\n-535\n-536\n-537\n-541\n-542\n-544\n-570 template\n-571 inline IteratorRange<...> elements(const GV& gv, PartitionSet\n-ps);\n-572\n-573\n-575\n-604 template\n-605 inline IteratorRange<...> facets(const GV& gv, PartitionSet\n-ps);\n-606\n-607\n-609\n-635 template\n-636 inline IteratorRange<...> edges(const GV& gv, PartitionSet ps);\n-637\n-638\n-640\n-666 template\n-667 inline IteratorRange<...> vertices(const GV& gv, PartitionSet\n-ps);\n-668\n-670\n-671\n-672\n-676\n-677\n-679\n-715 template\n-716 inline IteratorRange<...> entities(const GV& gv, Codim cd,\n-PartitionSet ps);\n-717\n-718\n-720\n-756 template\n-757 inline IteratorRange<...> entities(const GV& gv, Dim d,\n-PartitionSet ps);\n-758\n-759\n-761\n-782 template\n-783 inline IteratorRange<...> subEntities(const E& e, Codim c);\n-784\n-785\n-787\n-788\n-789#else // DOXYGEN\n-790\n-791 /\n-/\n-******************************************************************************************\n-792 // Implementations\n-793 /\n-/\n-******************************************************************************************\n-794\n-795\n-805 template\n-806 inline auto entities(const GV& gv, Codim, PartitionSet)\n-807 -> IteratorRange::value>())>\n-808 {\n-809 static_assert(0 <= codim && codim <= GV::dimension, \"invalid codimension\n-for given GridView\");\n-810 const PartitionIteratorType pit = derive_partition_iterator_\n-type::value;\n-811 typedef IteratorRange())> return_\n-type;\n-812 return return_type(gv.template begin(),gv.template\n-end());\n-813 }\n-814\n-822 template\n-823 inline auto entities(const GV& gv, Codim)\n-824 -> IteratorRange())>\n-825 {\n-826 static_assert(0 <= codim && codim <= GV::dimension, \"invalid codimension\n-for given GridView\");\n-827 typedef IteratorRange())> return_type;\n-828 return return_type(gv.template begin(),gv.template end());\n-829 }\n-830\n-834 template\n-835 inline IteratorRange\n-descendantElements(const Entity& e, int maxLevel)\n-836 {\n-837 typedef IteratorRange return_type;\n-838 return return_type(e.hbegin(maxLevel),e.hend(maxLevel));\n-839 }\n-840\n-844 template\n-845 inline auto intersections(const GV& gv, const Entity& e)\n-846 -> IteratorRange\n-847 {\n-848 return IteratorRange(gv.ibegin(e),gv.iend(e));\n-849 }\n-850\n-851\n-857 template\n-858 inline auto entities(const GV& gv, Dim, PartitionSet)\n-859 -> decltype(entities(gv,Codim\n-(),PartitionSet()))\n-860 {\n-861 static_assert(0 <= dim && dim <= GV::dimension, \"invalid dimension for\n-given GridView\");\n-862 return entities(gv,Codim(),PartitionSet\n-());\n-863 }\n-864\n-865 template\n-866 inline auto entities(const GV& gv, Dim)\n-867 -> decltype(entities(gv,Codim()))\n-868 {\n-869 static_assert(0 <= dim && dim <= GV::dimension, \"invalid dimension for\n-given GridView\");\n-870 return entities(gv,Codim());\n-871 }\n-872\n-873 template\n-874 inline auto elements(const GV& gv, PartitionSet)\n-875 -> decltype(entities(gv,Codim<0>(),PartitionSet()))\n-876 {\n-877 return entities(gv,Codim<0>(),PartitionSet());\n-878 }\n-879\n-880 template\n-881 inline auto elements(const GV& gv)\n-882 -> decltype(entities(gv,Codim<0>()))\n-883 {\n-884 return entities(gv,Codim<0>());\n-885 }\n-886\n-887 template\n-888 inline auto facets(const GV& gv, PartitionSet)\n-889 -> decltype(entities(gv,Codim<1>(),PartitionSet()))\n-890 {\n-891 return entities(gv,Codim<1>(),PartitionSet());\n-892 }\n-893\n-894 template\n-895 inline auto facets(const GV& gv)\n-896 -> decltype(entities(gv,Codim<1>()))\n-897 {\n-898 return entities(gv,Codim<1>());\n-899 }\n-900\n-901 template\n-902 inline auto edges(const GV& gv, PartitionSet)\n-903 -> decltype(entities(gv,Dim<1>(),PartitionSet()))\n-904 {\n-905 return entities(gv,Dim<1>(),PartitionSet());\n-906 }\n-907\n-908 template\n-909 inline auto edges(const GV& gv)\n-910 -> decltype(entities(gv,Dim<1>()))\n-911 {\n-912 return entities(gv,Dim<1>());\n-913 }\n-914\n-915 template\n-916 inline auto vertices(const GV& gv, PartitionSet)\n-917 -> decltype(entities(gv,Dim<0>(),PartitionSet()))\n-918 {\n-919 return entities(gv,Dim<0>(),PartitionSet());\n-920 }\n-921\n-922 template\n-923 inline auto vertices(const GV& gv)\n-924 -> decltype(entities(gv,Dim<0>()))\n-925 {\n-926 return entities(gv,Dim<0>());\n-927 }\n-928\n-929 template\n-930 inline auto subEntities(const E& e, Codim c)\n-931 {\n-932 static_assert(E::codimension <= codim,\n-933 \"Can only iterate over sub-entities with equal or larger codimension\");\n-934 return transformedRangeView(\n-935 range(static_cast(e.subEntities(c))),\n-936 [&](const int i){ return e.template subEntity(i); }\n-937 );\n-938 }\n-939\n-940#endif // DOXYGEN\n-941\n-946} // namespace Dune\n-947\n-948#endif // DUNE_GRID_COMMON_RANGEGENERATORS_HH\n-gridenums.hh\n-partitionset.hh\n-Dune::PartitionIteratorType\n-PartitionIteratorType\n-Parameter to be used for the parallel level- and leaf iterators.\n-Definition gridenums.hh:136\n-Dune::Entity::intersections\n-IteratorRange<... > intersections(const GV &gv, const Entity &e)\n-Iterates over all Intersections of an Entity with respect to the given\n-GridView.\n-Dune::GridView::vertices\n-IteratorRange<... > vertices(const GV &gv)\n-Iterates over all vertices (entities with dimension 0) of a GridView.\n-Dune::GridView::elements\n-IteratorRange<... > elements(const GV &gv, PartitionSet< partitions > ps)\n-Iterates over all elements / cells (entities with codimension 0) of a GridView\n-that belong to the giv...\n-Dune::GridView::entities\n-IteratorRange<... > entities(const GV &gv, Codim< codim > cd, PartitionSet<\n-partitions > ps)\n-Iterates over all entities of a GridView with the given codimension that belong\n-to the given Partitio...\n-Dune::GridView::edges\n-IteratorRange<... > edges(const GV &gv, PartitionSet< partitions > ps)\n-Iterates over all edges (entities with dimension 1) of a GridView that belong\n-to the given PartitionS...\n-Dune::GridView::entities\n-IteratorRange<... > entities(const GV &gv, Dim< dim > d, PartitionSet<\n-partitions > ps)\n-Iterates over all entities of a GridView with the given dimension that belong\n-to the given PartitionS...\n-Dune::GridView::entities\n-IteratorRange<... > entities(const GV &gv, Dim< dim > d)\n-Iterates over all entities of a GridView with the given dimension.\n-Dune::Entity::subEntities\n-IteratorRange<... > subEntities(const E &e, Codim< codim > c)\n-Iterates over all sub-entities of an entity given the codimension of the sub-\n-entities.\n-Dune::GridView::vertices\n-IteratorRange<... > vertices(const GV &gv, PartitionSet< partitions > ps)\n-Iterates over all vertices (entities with dimension 0) of a GridView that\n-belong to the given Partiti...\n-Dune::GridView::elements\n-IteratorRange<... > elements(const GV &gv)\n-Iterates over all elements / cells (entities with codimension 0) of a GridView.\n-Dune::GridView::entities\n-IteratorRange<... > entities(const GV &gv, Codim< codim > cd)\n-Iterates over all entities of a GridView with the given codimension.\n-Dune::GridView::facets\n-IteratorRange<... > facets(const GV &gv, PartitionSet< partitions > ps)\n-Iterates over all facets (entities with codimension 1) of a GridView that\n-belong to the given Partiti...\n-Dune::GridView::facets\n-IteratorRange<... > facets(const GV &gv)\n-Iterates over all facets (entities with codimension 1) of a GridView.\n-Dune::GridView::edges\n-IteratorRange<... > edges(const GV &gv)\n-Iterates over all edges (entities with dimension 1) of a GridView.\n-Dune::Entity::descendantElements\n-IteratorRange<... > descendantElements(const Entity &e, int maxLevel)\n-Iterates over all descendant elements of the given element up to a maximum\n-level.\n+328\n+345 inline bool beginAppended() {\n+346 doAppended = factory.beginAppended();\n+347 if(doAppended) {\n+348 const std::string& encoding = factory.appendedEncoding();\n+349 stream << indent << \"\\n\";\n+351 ++indent;\n+352 // mark begin of data\n+353 stream << indent << \"_\";\n+354 }\n+355 phase = appended;\n+356 return doAppended;\n+357 }\n+359 inline void endAppended() {\n+360 if(doAppended) {\n+361 stream << \"\\n\";\n+362 --indent;\n+363 stream << indent << \"\\n\";\n+364 }\n+365 }\n+366\n+368\n+380 DataArrayWriter* makeArrayWriter(const std::string& name,\n+381 unsigned ncomps, unsigned nitems,\n+382 Precision prec) {\n+383 return factory.make(name, ncomps, nitems, indent, prec);\n+384 }\n+385 };\n+386\n+387 } // namespace VTK\n+388\n+390\n+391} // namespace Dune\n+392\n+393#endif // DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH\n+dataarraywriter.hh\n+Data array writers for the VTKWriter.\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::GridView::Codim\n-A struct that collects all associated types of one implementation from the\n-Traits class.\n-Definition common/gridview.hh:104\n-Dune::PartitionSet\n-A set of PartitionType values.\n-Definition partitionset.hh:137\n+Dune::VTK::Precision\n+Precision\n+which precision to use when writing out data to vtk files\n+Definition common.hh:271\n+Dune::VTK::OutputType\n+OutputType\n+How the bulk data should be stored in the file.\n+Definition common.hh:43\n+Dune::VTK::FileType\n+FileType\n+which type of VTK file to write\n+Definition common.hh:252\n+Dune::VTK::polyData\n+@ polyData\n+for .vtp files (PolyData)\n+Definition common.hh:254\n+Dune::VTK::unstructuredGrid\n+@ unstructuredGrid\n+for .vtu files (UnstructuredGrid)\n+Definition common.hh:256\n+Dune::VTK::getEndiannessString\n+std::string getEndiannessString()\n+determine endianness of this C++ implementation\n+Definition common.hh:232\n+Dune::VTK::DataArrayWriter\n+base class for data array writers\n+Definition dataarraywriter.hh:56\n+Dune::VTK::DataArrayWriterFactory\n+a factory for DataArrayWriters\n+Definition dataarraywriter.hh:462\n+Dune::VTK::DataArrayWriterFactory::beginAppended\n+bool beginAppended()\n+signal start of the appended section\n+Definition dataarraywriter.hh:497\n+Dune::VTK::DataArrayWriterFactory::make\n+DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned\n+nitems, const Indent &indent, Precision prec)\n+create a DataArrayWriter\n+Definition dataarraywriter.hh:541\n+Dune::VTK::DataArrayWriterFactory::appendedEncoding\n+const std::string & appendedEncoding() const\n+query encoding string for appended data\n+Definition dataarraywriter.hh:510\n+Dune::VTK::VTUWriter\n+Dump a .vtu/.vtp files contents to a stream.\n+Definition vtuwriter.hh:98\n+Dune::VTK::VTUWriter::makeArrayWriter\n+DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n+unsigned nitems, Precision prec)\n+acquire a DataArrayWriter\n+Definition vtuwriter.hh:380\n+Dune::VTK::VTUWriter::beginAppended\n+bool beginAppended()\n+start the appended data section\n+Definition vtuwriter.hh:345\n+Dune::VTK::VTUWriter::endAppended\n+void endAppended()\n+finish the appended data section\n+Definition vtuwriter.hh:359\n+Dune::VTK::VTUWriter::VTUWriter\n+VTUWriter(std::ostream &stream_, OutputType outputType, FileType fileType_)\n+create a VTUWriter object\n+Definition vtuwriter.hh:122\n+Dune::VTK::VTUWriter::stream\n+std::ostream & stream\n+Definition vtuwriter.hh:100\n+Dune::VTK::VTUWriter::endCellData\n+void endCellData()\n+finish CellData section\n+Definition vtuwriter.hh:220\n+Dune::VTK::VTUWriter::beginMain\n+void beginMain(unsigned ncells, unsigned npoints)\n+start the main PolyData/UnstructuredGrid section\n+Definition vtuwriter.hh:310\n+Dune::VTK::VTUWriter::beginCells\n+void beginCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:274\n+Dune::VTK::VTUWriter::endPointData\n+void endPointData()\n+finish PointData section\n+Definition vtuwriter.hh:182\n+Dune::VTK::VTUWriter::Phase\n+Phase\n+Definition vtuwriter.hh:101\n+Dune::VTK::VTUWriter::appended\n+@ appended\n+Definition vtuwriter.hh:101\n+Dune::VTK::VTUWriter::main\n+@ main\n+Definition vtuwriter.hh:101\n+Dune::VTK::VTUWriter::beginCellData\n+void beginCellData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start CellData section\n+Definition vtuwriter.hh:205\n+Dune::VTK::VTUWriter::beginPointData\n+void beginPointData(const std::string &scalars=\"\", const std::string\n+&vectors=\"\")\n+start PointData section\n+Definition vtuwriter.hh:167\n+Dune::VTK::VTUWriter::endPoints\n+void endPoints()\n+finish section for the point coordinates\n+Definition vtuwriter.hh:249\n+Dune::VTK::VTUWriter::~VTUWriter\n+~VTUWriter()\n+write footer\n+Definition vtuwriter.hh:149\n+Dune::VTK::VTUWriter::endCells\n+void endCells()\n+start section for the grid cells/PolyData lines\n+Definition vtuwriter.hh:285\n+Dune::VTK::VTUWriter::beginPoints\n+void beginPoints()\n+start section for the point coordinates\n+Definition vtuwriter.hh:238\n+Dune::VTK::VTUWriter::endMain\n+void endMain()\n+finish the main PolyData/UnstructuredGrid section\n+Definition vtuwriter.hh:320\n+Dune::VTK::VTUWriter::phase\n+enum Dune::VTK::VTUWriter::Phase phase\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00332.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00269.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -78,17 +78,17 @@\n Namespaces |\n Typedefs |\n Variables
    \n
    partitionset.hh File Reference
    \n \n
    \n
    #include <dune/common/typetraits.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n+#include <dune/grid/common/gridenums.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::PartitionSet< partitions >
     A set of PartitionType values. More...
     
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00332_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00269_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,23 +77,23 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n
    partitionset.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_COMMON_PARTITIONSET_HH
    \n
    6#define DUNE_GRID_COMMON_PARTITIONSET_HH
    \n
    7
    \n
    8#include <dune/common/typetraits.hh>
    \n-\n+\n
    10
    \n
    11namespace Dune {
    \n
    12
    \n
    18 namespace {
    \n
    19
    \n
    20 // Simple TMP to deduce partition iterator type from set of partitions.
    \n
    21 template<unsigned int partitions>
    \n@@ -381,15 +381,15 @@\n
    326
    \n
    327 } // namespace Partitions
    \n
    \n
    328
    \n
    333} // namespace Dune
    \n
    334
    \n
    335#endif // DUNE_GRID_COMMON_PARTITIONSET_HH
    \n-\n+\n
    @ Interior_Partition
    only interior entities
    Definition gridenums.hh:137
    \n
    @ FrontEntity
    on boundary between overlap and ghost
    Definition gridenums.hh:34
    \n
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n
    @ GhostEntity
    ghost entities
    Definition gridenums.hh:35
    \n
    @ BorderEntity
    on boundary between interior and overlap
    Definition gridenums.hh:32
    \n
    @ OverlapEntity
    all entities lying in the overlap zone
    Definition gridenums.hh:33
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00344.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00701.html", "comments": ["Files 92% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: exceptions.hh File Reference\n+dune-grid: macroelement.hh File Reference\n \n \n \n \n \n \n \n@@ -65,39 +65,40 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    exceptions.hh File Reference
    \n+
    macroelement.hh File Reference
    \n
    \n
    \n \n-\n-\n+\n \n

    \n Classes

    class  Dune::GridError
     Base class for exceptions in Dune grid modules. More...
    struct  Dune::Alberta::MacroElement< dim >
     
    \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,21 +1,22 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * common\n+ * albertagrid\n Classes | Namespaces\n-exceptions.hh File Reference\n-#include \n+macroelement.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::GridError\n-\u00a0 Base class for exceptions in Dune grid modules. More...\n+struct \u00a0 Dune::Alberta::MacroElement<_dim_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+namespace \u00a0 Dune::Alberta\n+\u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00350.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00314.html", "comments": ["Files 96% similar despite different names"], "unified_diff": "@@ -79,19 +79,19 @@\n
    boundaryprojection.hh File Reference
    \n \n
    \n
    #include <cmath>
    \n #include <memory>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/geometry/multilineargeometry.hh>
    \n-#include <dune/grid/common/boundarysegment.hh>
    \n+#include <dune/grid/common/boundarysegment.hh>
    \n #include <dune/grid/common/datahandleif.hh>
    \n-#include <dune/grid/io/file/gmshreader.hh>
    \n+#include <dune/grid/io/file/gmshreader.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

    \n \n \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00350_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00314_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,15 +77,15 @@\n
  • dune
  • grid
  • common
  • \n \n \n
    \n
    boundaryprojection.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GRID_COMMON_BOUNDARYPROJECTION_HH
    \n
    6#define DUNE_GRID_COMMON_BOUNDARYPROJECTION_HH
    \n
    7
    \n
    8//- system includes
    \n@@ -93,17 +93,17 @@\n
    10#include <memory>
    \n
    11
    \n
    12//- Dune includes
    \n
    13#include <dune/common/fvector.hh>
    \n
    14
    \n
    15#include <dune/geometry/multilineargeometry.hh>
    \n
    16
    \n-\n+\n \n-\n+\n
    20
    \n
    21namespace Dune
    \n
    22{
    \n
    25 template <int dimworld>
    \n
    26 struct DuneBoundaryProjection;
    \n
    27
    \n
    30 template <int dimworld>
    \n@@ -359,17 +359,17 @@\n
    264 const double radius_;
    \n
    265 };
    \n
    \n
    266
    \n
    267} // end namespace
    \n
    268
    \n
    269#endif // #ifndef DUNE_GRID_COMMON_BOUNDARYPROJECTION_HH
    \n-
    Base class for grid boundary segments of arbitrary geometry.
    \n
    Describes the parallel communication interface class for MessageBuffers and DataHandles.
    \n-\n+
    Base class for grid boundary segments of arbitrary geometry.
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Interface class for vertex projection at the boundary.
    Definition boundaryprojection.hh:33
    \n
    DuneBoundaryProjection< dimworld > ThisType
    Definition boundaryprojection.hh:34
    \n
    virtual void backup(ObjectStreamType &buffer) const
    write DuneBoundaryProjection's data to stream buffer
    Definition boundaryprojection.hh:52
    \n
    static std::unique_ptr< ThisType > restoreFromBuffer(MessageBufferIF< BufferImp > &buffer)
    Definition boundaryprojection.hh:85
    \n
    virtual CoordinateType operator()(const CoordinateType &global) const =0
    projection operator projection a global coordinate
    \n
    void toBuffer(BufferImp &buffer) const
    Definition boundaryprojection.hh:58
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -250,19 +250,19 @@\n 262 protected:\n 264 const double radius_;\n 265 };\n 266\n 267} // end namespace\n 268\n 269#endif // #ifndef DUNE_GRID_COMMON_BOUNDARYPROJECTION_HH\n-boundarysegment.hh\n-Base class for grid boundary segments of arbitrary geometry.\n datahandleif.hh\n Describes the parallel communication interface class for MessageBuffers and\n DataHandles.\n+boundarysegment.hh\n+Base class for grid boundary segments of arbitrary geometry.\n gmshreader.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::DuneBoundaryProjection\n Interface class for vertex projection at the boundary.\n Definition boundaryprojection.hh:33\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00569.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00632.html", "comments": ["Files 82% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: declaration.hh File Reference\n+dune-grid: entity.cc File Reference\n \n \n \n \n \n \n \n@@ -65,32 +65,53 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    declaration.hh File Reference
    \n+Namespaces |\n+Macros
    \n+
    entity.cc File Reference
    \n \n

    \n Classes

    struct  Dune::DuneBoundaryProjection< dimworld >
     Interface class for vertex projection at the boundary. More...
     
    class  Dune::BoundaryProjectionWrapper< dimworld >
    \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n+\n+\n+\n

    \n+Macros

    #define DUNE_ALBERTA_ENTITY_CC
     
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_ALBERTA_ENTITY_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_ALBERTA_ENTITY_CC
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,16 +1,22 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * geometrygrid\n-Namespaces\n-declaration.hh File Reference\n+ * albertagrid\n+Namespaces | Macros\n+entity.cc File Reference\n Go_to_the_source_code_of_this_file.\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n+Macros\n+#define\u00a0 DUNE_ALBERTA_ENTITY_CC\n+\u00a0\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_ALBERTA_ENTITY_CC *****\n+#define DUNE_ALBERTA_ENTITY_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00578.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00680.html", "comments": ["Files 84% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identity.hh File Reference\n+dune-grid: leafiterator.hh File Reference\n \n \n \n \n \n \n \n@@ -65,31 +65,34 @@\n \n \n \n \n \n \n \n
    \n \n-
    identity.hh File Reference
    \n+
    leafiterator.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/geometrygrid/coordfunction.hh>
    \n+\n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n Classes

    class  Dune::IdenticalCoordFunction< ctype, dim >
    class  Dune::AlbertaGridLeafIterator< codim, pitype, GridImp >
     
    class  Dune::AlbertaGridLeafIterator< codim, Ghost_Partition, GridImp >
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,20 +1,23 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * geometrygrid\n+ * albertagrid\n Classes | Namespaces\n-identity.hh File Reference\n-#include \n+leafiterator.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::IdenticalCoordFunction<_ctype,_dim_>\n+class \u00a0 Dune::AlbertaGridLeafIterator<_codim,_pitype,_GridImp_>\n+\u00a0\n+class \u00a0 Dune::AlbertaGridLeafIterator<_codim,_Ghost_Partition,_GridImp_>\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00578_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00875_source.html", "comments": ["Files 78% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: identity.hh Source File\n+dune-grid: dim.hh Source File\n \n \n \n \n \n \n \n@@ -70,73 +70,79 @@\n \n \n \n \n \n \n \n
    \n-
    identity.hh
    \n+
    dim.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GEOGRID_IDENTITY_HH
    \n-
    6#define DUNE_GEOGRID_IDENTITY_HH
    \n+
    5#ifndef DUNE_DGF_DIMBLOCK_HH
    \n+
    6#define DUNE_DGF_DIMBLOCK_HH
    \n
    7
    \n-\n+
    8#include <iostream>
    \n
    9
    \n-
    10namespace Dune
    \n-
    11{
    \n+\n+
    11
    \n
    12
    \n-
    13 template< class ctype, unsigned int dim >
    \n-
    \n-\n-\n-
    16 < ctype, dim, dim, IdenticalCoordFunction< ctype, dim > >
    \n+
    13namespace Dune
    \n+
    14{
    \n+
    15
    \n+
    16 namespace dgf
    \n
    17 {
    \n-\n-\n-
    20
    \n-
    21 public:
    \n-
    22 typedef typename Base :: DomainVector DomainVector;
    \n-
    23 typedef typename Base :: RangeVector RangeVector;
    \n-
    24
    \n-
    25 template< typename... Args >
    \n+
    \n+
    18 class DimBlock : public BasicBlock {
    \n+
    19 int _dimworld; // dimension of world
    \n+
    20 int _dim; // dimension of grid
    \n+
    21 public:
    \n+
    22 const static char* ID;
    \n+
    23 // initialize block and get dimension of world
    \n+
    24 DimBlock ( std :: istream &in );
    \n+
    25 // get dimension of world found in block
    \n
    \n-\n-
    27 {}
    \n+
    26 int dim() {
    \n+
    27 return _dim;
    \n+
    28 }
    \n
    \n-
    28
    \n
    \n-\n-
    30 {
    \n-
    31 return x;
    \n-
    32 }
    \n+
    29 int dimworld() {
    \n+
    30 return _dimworld;
    \n+
    31 }
    \n+
    \n+
    32 // some information
    \n+
    \n+
    33 bool ok() {
    \n+
    34 return true;
    \n+
    35 }
    \n
    \n-
    33
    \n-
    34 };
    \n+
    36 };
    \n
    \n-
    35
    \n-
    36}
    \n
    37
    \n-
    38#endif
    \n-\n+
    38 } // end namespace dgf
    \n+
    39
    \n+
    40} // end namespace Dune
    \n+
    41
    \n+
    42#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Derive an implementation of an analytical coordinate function from this class.
    Definition coordfunction.hh:134
    \n-
    Definition identity.hh:17
    \n-
    IdenticalCoordFunction(Args &...)
    Definition identity.hh:26
    \n-
    Base::RangeVector RangeVector
    Definition identity.hh:23
    \n-
    RangeVector operator()(const DomainVector &x) const
    Definition identity.hh:29
    \n-
    Base::DomainVector DomainVector
    Definition identity.hh:22
    \n+
    Definition basic.hh:31
    \n+
    Definition dim.hh:18
    \n+
    int dimworld()
    Definition dim.hh:29
    \n+
    static const char * ID
    Definition dim.hh:22
    \n+
    bool ok()
    Definition dim.hh:33
    \n+
    int dim()
    Definition dim.hh:26
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,71 +1,77 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * geometrygrid\n-identity.hh\n+ * io\n+ * file\n+ * dgfparser\n+ * blocks\n+dim.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GEOGRID_IDENTITY_HH\n-6#define DUNE_GEOGRID_IDENTITY_HH\n+5#ifndef DUNE_DGF_DIMBLOCK_HH\n+6#define DUNE_DGF_DIMBLOCK_HH\n 7\n-8#include \n+8#include \n 9\n-10namespace Dune\n-11{\n+10#include \n+11\n 12\n-13 template< class ctype, unsigned int dim >\n-14 class IdenticalCoordFunction\n-15 : public AnalyticalCoordFunction\n-16 < ctype, dim, dim, IdenticalCoordFunction< ctype, dim > >\n+13namespace Dune\n+14{\n+15\n+16 namespace dgf\n 17 {\n-18 typedef IdenticalCoordFunction<_ctype,_dim_> This;\n-19 typedef AnalyticalCoordFunction<_ctype,_dim,_dim,_This_> Base;\n-20\n+18 class DimBlock : public BasicBlock {\n+19 int _dimworld; // dimension of world\n+20 int _dim; // dimension of grid\n 21 public:\n-22 typedef typename Base :: DomainVector DomainVector;\n-23 typedef typename Base :: RangeVector RangeVector;\n-24\n-25 template< typename... Args >\n-26 IdenticalCoordFunction( Args&... )\n-27 {}\n-28\n-29 RangeVector operator()(const DomainVector& x) const\n-30 {\n-31 return x;\n-32 }\n-33\n-34 };\n-35\n-36}\n+22 const static char* ID;\n+23 // initialize block and get dimension of world\n+24 DimBlock ( std :: istream &in );\n+25 // get dimension of world found in block\n+26 int dim() {\n+27 return _dim;\n+28 }\n+29 int dimworld() {\n+30 return _dimworld;\n+31 }\n+32 // some information\n+33 bool ok() {\n+34 return true;\n+35 }\n+36 };\n 37\n-38#endif\n-coordfunction.hh\n+38 } // end namespace dgf\n+39\n+40} // end namespace Dune\n+41\n+42#endif\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::AnalyticalCoordFunction\n-Derive an implementation of an analytical coordinate function from this class.\n-Definition coordfunction.hh:134\n-Dune::IdenticalCoordFunction\n-Definition identity.hh:17\n-Dune::IdenticalCoordFunction::IdenticalCoordFunction\n-IdenticalCoordFunction(Args &...)\n-Definition identity.hh:26\n-Dune::IdenticalCoordFunction::RangeVector\n-Base::RangeVector RangeVector\n-Definition identity.hh:23\n-Dune::IdenticalCoordFunction::operator()\n-RangeVector operator()(const DomainVector &x) const\n-Definition identity.hh:29\n-Dune::IdenticalCoordFunction::DomainVector\n-Base::DomainVector DomainVector\n-Definition identity.hh:22\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::DimBlock\n+Definition dim.hh:18\n+Dune::dgf::DimBlock::dimworld\n+int dimworld()\n+Definition dim.hh:29\n+Dune::dgf::DimBlock::ID\n+static const char * ID\n+Definition dim.hh:22\n+Dune::dgf::DimBlock::ok\n+bool ok()\n+Definition dim.hh:33\n+Dune::dgf::DimBlock::dim\n+int dim()\n+Definition dim.hh:26\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00581.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00236.html", "comments": ["Files 89% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cachedcoordfunction.hh File Reference\n+dune-grid: adaptcallback.hh File Reference\n \n \n \n \n \n \n \n@@ -65,50 +65,50 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    cachedcoordfunction.hh File Reference
    \n+
    adaptcallback.hh File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <memory>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/grid/common/gridenums.hh>
    \n-#include <dune/grid/geometrygrid/capabilities.hh>
    \n-#include <dune/grid/geometrygrid/coordfunctioncaller.hh>
    \n-#include <dune/grid/utility/persistentcontainer.hh>
    \n-
    \n-

    Go to the source code of this file.

    \n+\n+

    interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid \n+More...

    \n+\n+

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n \n-\n+\n+\n \n-\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::GeoGrid::CoordCache< HostGrid, Coordinate >
    class  Dune::AdaptDataHandleInterface< Grid, Impl >
     Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface. More...
     
    class  Dune::CachedCoordFunction< HostGrid, CoordFunction >
    class  Dune::AdaptDataHandle< Grid, Impl >
     
    class  Dune::CombinedAdaptProlongRestrict< A, B >
     class for combining 2 index sets together for adaptation process More...
     
    \n \n \n \n \n-\n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n-
    \n+

    Detailed Description

    \n+

    interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid

    \n+
    Author
    Martin Nolte
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,31 +1,34 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * geometrygrid\n+ * common\n Classes | Namespaces\n-cachedcoordfunction.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+adaptcallback.hh File Reference\n+interfaces and wrappers needed for the callback adaptation provided by\n+AlbertaGrid and dune-ALUGrid More...\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0 Dune::GeoGrid::CoordCache<_HostGrid,_Coordinate_>\n+class \u00a0 Dune::AdaptDataHandleInterface<_Grid,_Impl_>\n+\u00a0 Interface class for the Grid's adapt method where the parameter is a\n+ AdaptDataHandleInterface. More...\n \u00a0\n-class \u00a0 Dune::CachedCoordFunction<_HostGrid,_CoordFunction_>\n+class \u00a0 Dune::AdaptDataHandle<_Grid,_Impl_>\n+\u00a0\n+class \u00a0 Dune::CombinedAdaptProlongRestrict<_A,_B_>\n+\u00a0 class for combining 2 index sets together for adaptation process\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::GeoGrid\n-\u00a0 namespace containing the implementations of GeometryGrid\n-\u00a0\n+***** Detailed Description *****\n+interfaces and wrappers needed for the callback adaptation provided by\n+AlbertaGrid and dune-ALUGrid\n+ Author\n+ Martin Nolte\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00581_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00842_source.html", "comments": ["Files 92% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cachedcoordfunction.hh Source File\n+dune-grid: dgfgridfactory.hh Source File\n \n \n \n \n \n \n \n@@ -70,274 +70,271 @@\n \n \n \n \n \n \n \n
    \n-
    cachedcoordfunction.hh
    \n+
    dgfgridfactory.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH
    \n-
    6#define DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH
    \n+
    5#ifndef DUNE_DGF_GRIDFACTORY_HH
    \n+
    6#define DUNE_DGF_GRIDFACTORY_HH
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9#include <memory>
    \n-
    10
    \n-
    11#include <dune/common/typetraits.hh>
    \n-
    12
    \n-\n-
    14
    \n-\n-\n-\n-
    18
    \n-
    19namespace Dune
    \n-
    20{
    \n+
    8#include <iostream>
    \n+
    9#include <string>
    \n+
    10#include <vector>
    \n+
    11#include <map>
    \n+
    12#include <assert.h>
    \n+
    13
    \n+
    14#include <dune/common/parallel/mpihelper.hh>
    \n+\n+\n+
    17
    \n+\n+\n+
    20
    \n
    21
    \n-
    22 // Internal Forward Declarations
    \n-
    23 // -----------------------------
    \n+
    22namespace Dune
    \n+
    23{
    \n
    24
    \n-
    25 template< class HostGrid, class CoordFunction >
    \n-
    26 class CachedCoordFunction;
    \n+
    25 // External Forward Declarations
    \n+
    26 // -----------------------------
    \n
    27
    \n-
    28
    \n-
    29
    \n-
    30 // GeoGrid::CoordCache
    \n-
    31 // -------------------
    \n+
    28 template < class GridImp, class IntersectionImp >
    \n+
    29 class Intersection;
    \n+
    30
    \n+
    31
    \n
    32
    \n-
    33 namespace GeoGrid
    \n-
    34 {
    \n+
    33 // DGFGridFactory
    \n+
    34 // --------------
    \n
    35
    \n-
    36 template< class HostGrid, class Coordinate >
    \n+
    36 template < class G >
    \n
    \n-\n-
    38 {
    \n-\n-
    40
    \n-
    41 static const unsigned int dimension = HostGrid::dimension;
    \n+\n+
    38 {
    \n+
    39 typedef G Grid;
    \n+
    40 const static int dimension = Grid::dimension;
    \n+
    41 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n
    42
    \n-
    43 typedef typename HostGrid::template Codim< dimension >::Entity Vertex;
    \n-
    44
    \n-\n-
    46
    \n-
    47 public:
    \n-
    \n-
    48 explicit CoordCache ( const HostGrid &hostGrid )
    \n-
    49 : data_( hostGrid, dimension )
    \n-
    50 {}
    \n-
    \n-
    51
    \n-
    52 template< class Entity >
    \n-
    \n-
    53 const Coordinate &operator() ( const Entity &entity, unsigned int corner ) const
    \n-
    54 {
    \n-
    55 return data_( entity, corner );
    \n-
    56 }
    \n-
    \n-
    57
    \n-
    \n-
    58 const Coordinate &operator() ( const Vertex &vertex, unsigned int corner ) const
    \n-
    59 {
    \n-
    60 assert( corner == 0 );
    \n-
    61 return data_[ vertex ];
    \n-
    62 }
    \n-
    \n-
    63
    \n-
    64 template< class Entity >
    \n-
    \n-
    65 Coordinate &operator() ( const Entity &entity, unsigned int corner )
    \n-
    66 {
    \n-
    67 return data_( entity,corner) ;
    \n-
    68 }
    \n-
    \n+
    43 private:
    \n+
    44 typedef typename Grid::template Codim< 0 >::Entity Element;
    \n+
    45
    \n+
    46 typedef typename Grid::template Codim< dimension >::Entity Vertex;
    \n+
    47
    \n+
    48 public:
    \n+
    49
    \n+
    \n+
    50 explicit DGFGridFactory ( const std::string &filename,
    \n+
    51 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    52 : macroGrid_( filename.c_str(), comm )
    \n+
    53 {
    \n+
    54 grid_ = macroGrid_.template createGrid< Grid >();
    \n+
    55
    \n+
    56 if( macroGrid_.nofelparams > 0 )
    \n+
    57 {
    \n+
    58 const size_t nofElements = macroGrid_.elements.size();
    \n+
    59 for( size_t i = 0; i < nofElements; ++i )
    \n+
    60 {
    \n+
    61 std::vector< double > coord;
    \n+
    62
    \n+
    63 DomainType p(0);
    \n+
    64 const size_t nofCorners = macroGrid_.elements[i].size();
    \n+
    65 for (size_t k=0; k<nofCorners; ++k)
    \n+
    66 for (int j=0; j<DomainType::dimension; ++j)
    \n+
    67 p[j]+=macroGrid_.vtx[macroGrid_.elements[i][k]][j];
    \n+
    68 p/=double(nofCorners);
    \n
    69
    \n-
    \n-
    70 Coordinate &operator() ( const Vertex &vertex, unsigned int corner )
    \n-
    71 {
    \n-
    72 assert( corner == 0 );
    \n-
    73 return data_[ vertex ];
    \n-
    74 }
    \n-
    \n-
    75
    \n-
    \n-
    76 void adapt ()
    \n-
    77 {
    \n-
    78 data_.resize();
    \n-
    79 data_.shrinkToFit();
    \n-
    80 }
    \n-
    \n-
    81
    \n-
    82 private:
    \n-
    83 CoordCache ( const This & );
    \n-
    84 This &operator= ( const This & );
    \n-
    85
    \n-
    86 DataCache data_;
    \n-
    87 };
    \n-
    \n-
    88
    \n-
    89 } // namespace GeoGrid
    \n-
    90
    \n-
    91
    \n-
    92
    \n-
    93 // CachedCoordFunction
    \n-
    94 // -------------------
    \n-
    95
    \n-
    96 template< class HostGrid, class CoordFunction >
    \n-
    \n-\n-
    98 : public DiscreteCoordFunction< typename CoordFunction::ctype, CoordFunction::dimRange, CachedCoordFunction< HostGrid, CoordFunction > >
    \n-
    99 {
    \n-\n-\n-
    102
    \n-
    103 public:
    \n-
    104 typedef typename Base::ctype ctype;
    \n-
    105
    \n-\n-
    107
    \n-
    108 private:
    \n-\n-
    110
    \n-
    111 public:
    \n-
    112 explicit
    \n-
    \n-
    113 CachedCoordFunction ( const HostGrid &hostGrid,
    \n-
    114 const CoordFunction &coordFunction = CoordFunction() )
    \n-
    115 : hostGrid_( hostGrid ),
    \n-
    116 coordFunction_( coordFunction ),
    \n-
    117 cache_( hostGrid )
    \n-
    118 {
    \n-
    119 buildCache();
    \n-
    120 }
    \n-
    \n-
    121
    \n-
    \n-
    122 void adapt ()
    \n-
    123 {
    \n-
    124 cache_.adapt();
    \n-
    125 buildCache();
    \n-
    126 }
    \n-
    \n-
    127
    \n-
    128 void buildCache ();
    \n-
    129
    \n-
    130 template< class HostEntity >
    \n-
    131 void insertEntity ( const HostEntity &hostEntity );
    \n-
    132
    \n-
    133 template< class HostEntity >
    \n-
    \n-
    134 void evaluate ( const HostEntity &hostEntity, unsigned int corner, RangeVector &y ) const
    \n-
    135 {
    \n-
    136 y = cache_( hostEntity, corner );
    \n-
    137#ifndef NDEBUG
    \n-\n-
    139 CoordFunctionCaller;
    \n-
    140
    \n-
    141 RangeVector z;
    \n-
    142 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );
    \n-
    143 coordFunctionCaller.evaluate( corner, z );
    \n-
    144 assert( ((y - z).two_norm() < 1e-6) );
    \n-
    145#endif
    \n-
    146 }
    \n-
    \n-
    147
    \n-
    148 private:
    \n-
    149 const HostGrid &hostGrid_;
    \n-
    150 const CoordFunction &coordFunction_;
    \n-
    151 Cache cache_;
    \n-
    152 };
    \n+
    70 elInsertOrder_.insert( std::make_pair( p, i ) );
    \n+
    71 }
    \n+
    72 }
    \n+
    73
    \n+
    74 if( macroGrid_.nofvtxparams > 0 )
    \n+
    75 {
    \n+
    76 const size_t nofVertices = macroGrid_.vtx.size();
    \n+
    77 for( size_t i = 0; i < nofVertices; ++i )
    \n+
    78 {
    \n+
    79 std::vector< double > coord;
    \n+
    80
    \n+
    81 DomainType p;
    \n+
    82 for( int k = 0; k < DomainType::dimension; ++k )
    \n+
    83 p[ k ] = macroGrid_.vtx[i][k];
    \n+
    84
    \n+
    85 vtxInsertOrder_.insert( std::make_pair( p, i ) );
    \n+
    86 }
    \n+
    87 }
    \n+
    88 }
    \n+
    \n+
    89
    \n+
    \n+\n+
    91 {
    \n+
    92 return grid_;
    \n+
    93 }
    \n+
    \n+
    94
    \n+
    95 template <class Intersection>
    \n+
    \n+
    96 bool wasInserted(const Intersection &intersection) const
    \n+
    97 {
    \n+
    98 return intersection.boundary();
    \n+
    99 }
    \n+
    \n+
    100
    \n+
    101 template <class Intersection>
    \n+
    \n+
    102 int boundaryId(const Intersection &intersection) const
    \n+
    103 {
    \n+
    104 return (intersection.boundary()) ? int(intersection.indexInInside()+1) : int(0);
    \n+
    105 }
    \n+
    \n+
    106
    \n+
    107 template< int codim >
    \n+
    \n+
    108 int numParameters () const
    \n+
    109 {
    \n+
    110 if( codim == 0 )
    \n+
    111 return macroGrid_.nofelparams;
    \n+
    112 else if( codim == dimension )
    \n+
    113 return macroGrid_.nofvtxparams;
    \n+
    114 else
    \n+
    115 return 0;
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    118 template < class Entity >
    \n+
    \n+
    119 int numParameters ( const Entity & ) const
    \n+
    120 {
    \n+
    121 return numParameters< Entity::codimension >();
    \n+
    122 }
    \n+
    \n+
    123
    \n+
    \n+
    124 std::vector<double>& parameter(const Element &element)
    \n+
    125 {
    \n+
    126 const typename Element::Geometry &geo = element.geometry();
    \n+
    127 DomainType coord( geo.corner( 0 ) );
    \n+
    128 for( int i = 1; i < geo.corners(); ++i )
    \n+
    129 coord += geo.corner( i );
    \n+
    130 coord /= double( geo.corners() );
    \n+
    131
    \n+
    132 InsertOrderIterator it = elInsertOrder_.find( coord );
    \n+
    133 if( it != elInsertOrder_.end() )
    \n+
    134 return macroGrid_.elParams[ it->second ];
    \n+
    135 assert(0);
    \n+
    136 return emptyParam;
    \n+
    137 }
    \n+
    \n+
    138
    \n+
    \n+
    139 std::vector<double>& parameter(const Vertex &vertex)
    \n+
    140 {
    \n+
    141 const typename Vertex::Geometry &geo = vertex.geometry();
    \n+
    142 DomainType coord( geo.corner( 0 ) );
    \n+
    143
    \n+
    144 InsertOrderIterator it = vtxInsertOrder_.find( coord );
    \n+
    145 if( it != vtxInsertOrder_.end() )
    \n+
    146 return macroGrid_.vtxParams[ it->second ];
    \n+
    147 return emptyParam;
    \n+
    148 }
    \n+
    \n+
    149
    \n+
    150 // return true if boundary parameters found
    \n+
    \n+\n+
    152 {
    \n+
    153 return false;
    \n+
    154 }
    \n
    \n-
    153
    \n-
    154
    \n
    155
    \n-
    156 // Implementation of CachedCoordFunction
    \n-
    157 // -------------------------------------
    \n-
    158
    \n-
    159 template< class HostGrid, class CoordFunction >
    \n-
    \n-\n-
    161 {
    \n-
    162 typedef typename HostGrid::template Codim< 0 >::Entity Element;
    \n-
    163 typedef typename HostGrid::LevelGridView MacroView;
    \n-
    164 typedef typename HostGrid::HierarchicIterator HierarchicIterator;
    \n-
    165
    \n-
    166 typedef typename MacroView::template Codim< 0 >::template Partition< All_Partition >::Iterator MacroIterator;
    \n-
    167
    \n-
    168 const MacroView macroView = hostGrid_.levelGridView( 0 );
    \n-
    169 const int maxLevel = hostGrid_.maxLevel();
    \n-
    170
    \n-
    171 const MacroIterator mend = macroView.template end< 0, All_Partition >();
    \n-
    172 for( MacroIterator mit = macroView.template begin< 0, All_Partition >(); mit != mend; ++mit )
    \n-
    173 {
    \n-
    174 const Element &macroElement = *mit;
    \n-
    175 insertEntity( macroElement );
    \n-
    176
    \n-
    177 const HierarchicIterator hend = macroElement.hend( maxLevel );
    \n-
    178 for( HierarchicIterator hit = macroElement.hbegin( maxLevel ); hit != hend; ++hit )
    \n-
    179 insertEntity( *hit );
    \n-
    180 }
    \n-
    181 }
    \n-
    \n-
    182
    \n-
    183
    \n-
    184 template< class HostGrid, class CoordFunction >
    \n-
    185 template< class HostEntity >
    \n-\n-
    \n-
    187 ::insertEntity ( const HostEntity &hostEntity )
    \n-
    188 {
    \n-\n-
    190 CoordFunctionCaller;
    \n-
    191
    \n-
    192 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );
    \n-
    193 auto refElement = referenceElement< ctype, HostEntity::dimension >( hostEntity.type() );
    \n+
    156 template< class GG, class II >
    \n+
    157 const typename DGFBoundaryParameter::type &
    \n+
    \n+
    158 boundaryParameter ( const Intersection< GG, II > & intersection ) const
    \n+
    159 {
    \n+\n+
    161 }
    \n+
    \n+
    162
    \n+
    163 private:
    \n+
    164 typedef FieldVector<typename Grid::ctype,Grid::dimensionworld> DomainType;
    \n+
    165 struct Compare
    \n+
    166 {
    \n+
    167 bool operator() ( const DomainType &a, const DomainType &b ) const
    \n+
    168 {
    \n+
    169 // returns true, if a < b; c[i] < -eps;
    \n+
    170 const DomainType c = a - b;
    \n+
    171 const double eps = 1e-8;
    \n+
    172
    \n+
    173 for( int i = 0; i < DomainType::dimension; ++i )
    \n+
    174 {
    \n+
    175 if( c[ i ] <= -eps )
    \n+
    176 return true;
    \n+
    177 if( c[ i ] >= eps )
    \n+
    178 return false;
    \n+
    179 }
    \n+
    180 return false;
    \n+
    181 }
    \n+
    182 };
    \n+
    183 typedef std::map< DomainType, size_t, Compare > InsertOrderMap;
    \n+
    184 typedef typename InsertOrderMap::const_iterator InsertOrderIterator;
    \n+
    185
    \n+
    186 MacroGrid macroGrid_;
    \n+
    187 Grid *grid_;
    \n+
    188 InsertOrderMap elInsertOrder_;
    \n+
    189 InsertOrderMap vtxInsertOrder_;
    \n+
    190 std::vector<double> emptyParam;
    \n+
    191 };
    \n+
    \n+
    192
    \n+
    193} // end namespace Dune
    \n
    194
    \n-
    195 const unsigned int numCorners = refElement.size( HostEntity::dimension );
    \n-
    196 for( unsigned int i = 0; i < numCorners; ++i )
    \n-
    197 coordFunctionCaller.evaluate( i, cache_( hostEntity, i ) );
    \n-
    198 }
    \n-
    \n-
    199
    \n-
    200} // namespace Dune
    \n-
    201
    \n-
    202#endif // #ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH
    \n-\n-\n+
    195#endif
    \n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition cachedcoordfunction.hh:99
    \n-
    void adapt()
    Definition cachedcoordfunction.hh:122
    \n-
    CachedCoordFunction(const HostGrid &hostGrid, const CoordFunction &coordFunction=CoordFunction())
    Definition cachedcoordfunction.hh:113
    \n-
    void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
    Definition cachedcoordfunction.hh:134
    \n-
    Base::ctype ctype
    Definition cachedcoordfunction.hh:104
    \n-
    Base::RangeVector RangeVector
    Definition cachedcoordfunction.hh:106
    \n-
    void buildCache()
    Definition cachedcoordfunction.hh:160
    \n-
    void insertEntity(const HostEntity &hostEntity)
    Definition cachedcoordfunction.hh:187
    \n-
    Definition cachedcoordfunction.hh:38
    \n-
    void adapt()
    Definition cachedcoordfunction.hh:76
    \n-
    CoordCache(const HostGrid &hostGrid)
    Definition cachedcoordfunction.hh:48
    \n-
    const Coordinate & operator()(const Entity &entity, unsigned int corner) const
    Definition cachedcoordfunction.hh:53
    \n-
    Derive an implementation of a discrete coordinate function from this class.
    Definition coordfunction.hh:248
    \n-
    Base::RangeVector RangeVector
    Definition coordfunction.hh:253
    \n-
    ct ctype
    field type of the coordinate vector
    Definition coordfunction.hh:185
    \n-
    Definition coordfunctioncaller.hh:21
    \n-
    DUNE-conform implementation of the entity.
    Definition geometrygrid/entity.hh:694
    \n-\n-
    void resize(const Value &value=Value())
    Definition persistentcontainermap.hh:87
    \n-
    void shrinkToFit()
    Definition persistentcontainermap.hh:93
    \n-\n-\n+
    Definition dgfgridfactory.hh:38
    \n+
    int numParameters() const
    Definition dgfgridfactory.hh:108
    \n+
    int boundaryId(const Intersection &intersection) const
    Definition dgfgridfactory.hh:102
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfgridfactory.hh:158
    \n+
    std::vector< double > & parameter(const Vertex &vertex)
    Definition dgfgridfactory.hh:139
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n+
    int numParameters(const Entity &) const
    Definition dgfgridfactory.hh:119
    \n+
    bool wasInserted(const Intersection &intersection) const
    Definition dgfgridfactory.hh:96
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfgridfactory.hh:50
    \n+
    G Grid
    Definition dgfgridfactory.hh:39
    \n+
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n+
    Grid * grid()
    Definition dgfgridfactory.hh:90
    \n+
    std::vector< double > & parameter(const Element &element)
    Definition dgfgridfactory.hh:124
    \n+
    bool haveBoundaryParameters() const
    Definition dgfgridfactory.hh:151
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    bool boundary() const
    Return true if intersection is with interior or exterior boundary (see the cases above)
    Definition common/intersection.hh:216
    \n+
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    int nofvtxparams
    Definition parser.hh:163
    \n+
    std::vector< std::vector< double > > vtxParams
    Definition parser.hh:165
    \n+
    int nofelparams
    Definition parser.hh:163
    \n+
    std::vector< std::vector< double > > elParams
    Definition parser.hh:165
    \n+
    std::vector< std::vector< double > > vtx
    Definition parser.hh:125
    \n+
    std ::vector< std ::vector< unsigned int > > elements
    Definition parser.hh:134
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,290 +1,310 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * geometrygrid\n-cachedcoordfunction.hh\n+ * io\n+ * file\n+ * dgfparser\n+dgfgridfactory.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH\n-6#define DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH\n+5#ifndef DUNE_DGF_GRIDFACTORY_HH\n+6#define DUNE_DGF_GRIDFACTORY_HH\n 7\n-8#include \n-9#include \n-10\n-11#include \n-12\n-13#include \n-14\n-15#include \n-16#include \n-17#include \n-18\n-19namespace Dune\n-20{\n+8#include \n+9#include \n+10#include \n+11#include \n+12#include \n+13\n+14#include \n+15#include \n+16#include \n+17\n+18#include \n+19#include \n+20\n 21\n-22 // Internal Forward Declarations\n-23 // -----------------------------\n+22namespace Dune\n+23{\n 24\n-25 template< class HostGrid, class CoordFunction >\n-26 class CachedCoordFunction;\n+25 // External Forward Declarations\n+26 // -----------------------------\n 27\n-28\n-29\n-30 // GeoGrid::CoordCache\n-31 // -------------------\n+28 template < class GridImp, class IntersectionImp >\n+29 class Intersection;\n+30\n+31\n 32\n-33 namespace GeoGrid\n-34 {\n+33 // DGFGridFactory\n+34 // --------------\n 35\n-36 template< class HostGrid, class Coordinate >\n-37 class CoordCache\n+36 template < class G >\n+37 struct DGFGridFactory\n 38 {\n-39 typedef CoordCache<_HostGrid,_Coordinate_> This;\n-40\n-41 static const unsigned int dimension = HostGrid::dimension;\n+39 typedef G Grid;\n+40 const static int dimension = Grid::dimension;\n+41 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n 42\n-43 typedef typename HostGrid::template Codim< dimension >::Entity Vertex;\n-44\n-45 typedef PersistentContainer<_HostGrid,_Coordinate_> DataCache;\n-46\n-47 public:\n-48 explicit CoordCache ( const HostGrid &hostGrid )\n-49 : data_( hostGrid, dimension )\n-50 {}\n-51\n-52 template< class Entity >\n-53 const Coordinate &operator()_( const Entity &entity, unsigned int corner )\n-const\n-54 {\n-55 return data_( entity, corner );\n-56 }\n-57\n-58 const Coordinate &operator()_( const Vertex &vertex, unsigned int corner )\n-const\n-59 {\n-60 assert( corner == 0 );\n-61 return data_[ vertex ];\n-62 }\n-63\n-64 template< class Entity >\n-65 Coordinate &operator()_( const Entity &entity, unsigned int corner )\n-66 {\n-67 return data_( entity,corner) ;\n-68 }\n+43 private:\n+44 typedef typename Grid::template Codim< 0 >::Entity Element;\n+45\n+46 typedef typename Grid::template Codim< dimension >::Entity Vertex;\n+47\n+48 public:\n+49\n+50 explicit DGFGridFactory ( const std::string &filename,\n+51 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+52 : macroGrid_( filename.c_str(), comm )\n+53 {\n+54 grid_ = macroGrid_.template createGrid< Grid >();\n+55\n+56 if( macroGrid_.nofelparams > 0 )\n+57 {\n+58 const size_t nofElements = macroGrid_.elements.size();\n+59 for( size_t i = 0; i < nofElements; ++i )\n+60 {\n+61 std::vector< double > coord;\n+62\n+63 DomainType p(0);\n+64 const size_t nofCorners = macroGrid_.elements[i].size();\n+65 for (size_t k=0; k\n-97 class CachedCoordFunction\n-98 : public DiscreteCoordFunction< typename CoordFunction::ctype,\n-CoordFunction::dimRange, CachedCoordFunction< HostGrid, CoordFunction > >\n-99 {\n-100 typedef CachedCoordFunction<_HostGrid,_CoordFunction_> This;\n-101 typedef DiscreteCoordFunction<_typename_CoordFunction::ctype,\n-CoordFunction::dimRange,_This_> Base;\n-102\n-103 public:\n-104 typedef typename Base::ctype ctype;\n-105\n-106 typedef typename Base::RangeVector RangeVector;\n-107\n-108 private:\n-109 typedef GeoGrid::CoordCache<_HostGrid,_RangeVector_> Cache;\n-110\n-111 public:\n-112 explicit\n-113 CachedCoordFunction ( const HostGrid &hostGrid,\n-114 const CoordFunction &coordFunction = CoordFunction() )\n-115 : hostGrid_( hostGrid ),\n-116 coordFunction_( coordFunction ),\n-117 cache_( hostGrid )\n-118 {\n-119 buildCache();\n-120 }\n-121\n-122 void adapt ()\n-123 {\n-124 cache_.adapt();\n-125 buildCache();\n-126 }\n-127\n-128 void buildCache ();\n-129\n-130 template< class HostEntity >\n-131 void insertEntity ( const HostEntity &hostEntity );\n-132\n-133 template< class HostEntity >\n-134 void evaluate ( const HostEntity &hostEntity, unsigned int corner,\n-RangeVector &y ) const\n-135 {\n-136 y = cache_( hostEntity, corner );\n-137#ifndef NDEBUG\n-138 typedef GeoGrid::CoordFunctionCaller<_HostEntity,_typename_CoordFunction::\n-Interface_>\n-139 CoordFunctionCaller;\n-140\n-141 RangeVector z;\n-142 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );\n-143 coordFunctionCaller.evaluate( corner, z );\n-144 assert( ((y - z).two_norm() < 1e-6) );\n-145#endif\n-146 }\n-147\n-148 private:\n-149 const HostGrid &hostGrid_;\n-150 const CoordFunction &coordFunction_;\n-151 Cache cache_;\n-152 };\n-153\n-154\n+70 elInsertOrder_.insert( std::make_pair( p, i ) );\n+71 }\n+72 }\n+73\n+74 if( macroGrid_.nofvtxparams > 0 )\n+75 {\n+76 const size_t nofVertices = macroGrid_.vtx.size();\n+77 for( size_t i = 0; i < nofVertices; ++i )\n+78 {\n+79 std::vector< double > coord;\n+80\n+81 DomainType p;\n+82 for( int k = 0; k < DomainType::dimension; ++k )\n+83 p[ k ] = macroGrid_.vtx[i][k];\n+84\n+85 vtxInsertOrder_.insert( std::make_pair( p, i ) );\n+86 }\n+87 }\n+88 }\n+89\n+90 Grid *grid()\n+91 {\n+92 return grid_;\n+93 }\n+94\n+95 template \n+96 bool wasInserted(const Intersection &intersection) const\n+97 {\n+98 return intersection.boundary();\n+99 }\n+100\n+101 template \n+102 int boundaryId(const Intersection &intersection) const\n+103 {\n+104 return (intersection.boundary()) ? int(intersection.indexInInside()+1) :\n+int(0);\n+105 }\n+106\n+107 template< int codim >\n+108 int numParameters () const\n+109 {\n+110 if( codim == 0 )\n+111 return macroGrid_.nofelparams;\n+112 else if( codim == dimension )\n+113 return macroGrid_.nofvtxparams;\n+114 else\n+115 return 0;\n+116 }\n+117\n+118 template < class Entity >\n+119 int numParameters ( const Entity & ) const\n+120 {\n+121 return numParameters< Entity::codimension >();\n+122 }\n+123\n+124 std::vector& parameter(const Element &element)\n+125 {\n+126 const typename Element::Geometry &geo = element.geometry();\n+127 DomainType coord( geo.corner( 0 ) );\n+128 for( int i = 1; i < geo.corners(); ++i )\n+129 coord += geo.corner( i );\n+130 coord /= double( geo.corners() );\n+131\n+132 InsertOrderIterator it = elInsertOrder_.find( coord );\n+133 if( it != elInsertOrder_.end() )\n+134 return macroGrid_.elParams[ it->second ];\n+135 assert(0);\n+136 return emptyParam;\n+137 }\n+138\n+139 std::vector& parameter(const Vertex &vertex)\n+140 {\n+141 const typename Vertex::Geometry &geo = vertex.geometry();\n+142 DomainType coord( geo.corner( 0 ) );\n+143\n+144 InsertOrderIterator it = vtxInsertOrder_.find( coord );\n+145 if( it != vtxInsertOrder_.end() )\n+146 return macroGrid_.vtxParams[ it->second ];\n+147 return emptyParam;\n+148 }\n+149\n+150 // return true if boundary parameters found\n+151 bool haveBoundaryParameters () const\n+152 {\n+153 return false;\n+154 }\n 155\n-156 // Implementation of CachedCoordFunction\n-157 // -------------------------------------\n-158\n-159 template< class HostGrid, class CoordFunction >\n-160 inline void CachedCoordFunction<_HostGrid,_CoordFunction_>::buildCache ()\n-161 {\n-162 typedef typename HostGrid::template Codim< 0 >::Entity Element;\n-163 typedef typename HostGrid::LevelGridView MacroView;\n-164 typedef typename HostGrid::HierarchicIterator HierarchicIterator;\n-165\n-166 typedef typename MacroView::template Codim< 0 >::template Partition< All_\n-Partition >::Iterator MacroIterator;\n-167\n-168 const MacroView macroView = hostGrid_.levelGridView( 0 );\n-169 const int maxLevel = hostGrid_.maxLevel();\n-170\n-171 const MacroIterator mend = macroView.template end< 0, All_Partition >();\n-172 for( MacroIterator mit = macroView.template begin< 0, All_Partition >();\n-mit != mend; ++mit )\n-173 {\n-174 const Element ¯oElement = *mit;\n-175 insertEntity( macroElement );\n-176\n-177 const HierarchicIterator hend = macroElement.hend( maxLevel );\n-178 for( HierarchicIterator hit = macroElement.hbegin( maxLevel ); hit != hend;\n-++hit )\n-179 insertEntity( *hit );\n-180 }\n+156 template< class GG, class II >\n+157 const typename DGFBoundaryParameter::type &\n+158 boundaryParameter ( const Intersection<_GG,_II_> & intersection ) const\n+159 {\n+160 return DGFBoundaryParameter::defaultValue();\n+161 }\n+162\n+163 private:\n+164 typedef FieldVector DomainType;\n+165 struct Compare\n+166 {\n+167 bool operator() ( const DomainType &a, const DomainType &b ) const\n+168 {\n+169 // returns true, if a < b; c[i] < -eps;\n+170 const DomainType c = a - b;\n+171 const double eps = 1e-8;\n+172\n+173 for( int i = 0; i < DomainType::dimension; ++i )\n+174 {\n+175 if( c[ i ] <= -eps )\n+176 return true;\n+177 if( c[ i ] >= eps )\n+178 return false;\n+179 }\n+180 return false;\n 181 }\n-182\n-183\n-184 template< class HostGrid, class CoordFunction >\n-185 template< class HostEntity >\n-186 inline void CachedCoordFunction<_HostGrid,_CoordFunction_>\n-187_::insertEntity ( const HostEntity &hostEntity )\n-188 {\n-189 typedef GeoGrid::CoordFunctionCaller<_HostEntity,_typename_CoordFunction::\n-Interface_>\n-190 CoordFunctionCaller;\n-191\n-192 CoordFunctionCaller coordFunctionCaller( hostEntity, coordFunction_ );\n-193 auto refElement = referenceElement< ctype, HostEntity::dimension >\n-( hostEntity.type() );\n+182 };\n+183 typedef std::map< DomainType, size_t, Compare > InsertOrderMap;\n+184 typedef typename InsertOrderMap::const_iterator InsertOrderIterator;\n+185\n+186 MacroGrid macroGrid_;\n+187 Grid *grid_;\n+188 InsertOrderMap elInsertOrder_;\n+189 InsertOrderMap vtxInsertOrder_;\n+190 std::vector emptyParam;\n+191 };\n+192\n+193} // end namespace Dune\n 194\n-195 const unsigned int numCorners = refElement.size( HostEntity::dimension );\n-196 for( unsigned int i = 0; i < numCorners; ++i )\n-197 coordFunctionCaller.evaluate( i, cache_( hostEntity, i ) );\n-198 }\n-199\n-200} // namespace Dune\n-201\n-202#endif // #ifndef DUNE_GEOGRID_CACHEDCOORDFUNCTION_HH\n-gridenums.hh\n-coordfunctioncaller.hh\n+195#endif\n+dgfexception.hh\n+parser.hh\n+macrogrid.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::CachedCoordFunction\n-Definition cachedcoordfunction.hh:99\n-Dune::CachedCoordFunction::adapt\n-void adapt()\n-Definition cachedcoordfunction.hh:122\n-Dune::CachedCoordFunction::CachedCoordFunction\n-CachedCoordFunction(const HostGrid &hostGrid, const CoordFunction\n-&coordFunction=CoordFunction())\n-Definition cachedcoordfunction.hh:113\n-Dune::CachedCoordFunction::evaluate\n-void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector\n-&y) const\n-Definition cachedcoordfunction.hh:134\n-Dune::CachedCoordFunction::ctype\n-Base::ctype ctype\n-Definition cachedcoordfunction.hh:104\n-Dune::CachedCoordFunction::RangeVector\n-Base::RangeVector RangeVector\n-Definition cachedcoordfunction.hh:106\n-Dune::CachedCoordFunction::buildCache\n-void buildCache()\n-Definition cachedcoordfunction.hh:160\n-Dune::CachedCoordFunction::insertEntity\n-void insertEntity(const HostEntity &hostEntity)\n-Definition cachedcoordfunction.hh:187\n-Dune::GeoGrid::CoordCache\n-Definition cachedcoordfunction.hh:38\n-Dune::GeoGrid::CoordCache::adapt\n-void adapt()\n-Definition cachedcoordfunction.hh:76\n-Dune::GeoGrid::CoordCache::CoordCache\n-CoordCache(const HostGrid &hostGrid)\n-Definition cachedcoordfunction.hh:48\n-Dune::GeoGrid::CoordCache::operator()\n-const Coordinate & operator()(const Entity &entity, unsigned int corner) const\n-Definition cachedcoordfunction.hh:53\n-Dune::DiscreteCoordFunction\n-Derive an implementation of a discrete coordinate function from this class.\n-Definition coordfunction.hh:248\n-Dune::DiscreteCoordFunction::RangeVector\n-Base::RangeVector RangeVector\n-Definition coordfunction.hh:253\n-Dune::DiscreteCoordFunctionInterface::ctype\n-ct ctype\n-field type of the coordinate vector\n-Definition coordfunction.hh:185\n-Dune::GeoGrid::CoordFunctionCaller\n-Definition coordfunctioncaller.hh:21\n-Dune::GeoGrid::Entity\n-DUNE-conform implementation of the entity.\n-Definition geometrygrid/entity.hh:694\n-Dune::PersistentContainer<_HostGrid,_Coordinate_>\n-Dune::PersistentContainerMap::resize\n-void resize(const Value &value=Value())\n-Definition persistentcontainermap.hh:87\n-Dune::PersistentContainerMap::shrinkToFit\n-void shrinkToFit()\n-Definition persistentcontainermap.hh:93\n-capabilities.hh\n-persistentcontainer.hh\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::numParameters\n+int numParameters() const\n+Definition dgfgridfactory.hh:108\n+Dune::DGFGridFactory::boundaryId\n+int boundaryId(const Intersection &intersection) const\n+Definition dgfgridfactory.hh:102\n+Dune::DGFGridFactory::boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n+> &intersection) const\n+Definition dgfgridfactory.hh:158\n+Dune::DGFGridFactory::parameter\n+std::vector< double > & parameter(const Vertex &vertex)\n+Definition dgfgridfactory.hh:139\n+Dune::DGFGridFactory::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition dgfgridfactory.hh:41\n+Dune::DGFGridFactory::numParameters\n+int numParameters(const Entity &) const\n+Definition dgfgridfactory.hh:119\n+Dune::DGFGridFactory::wasInserted\n+bool wasInserted(const Intersection &intersection) const\n+Definition dgfgridfactory.hh:96\n+Dune::DGFGridFactory::DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicatorType\n+comm=MPIHelper::getCommunicator())\n+Definition dgfgridfactory.hh:50\n+Dune::DGFGridFactory::Grid\n+G Grid\n+Definition dgfgridfactory.hh:39\n+Dune::DGFGridFactory::dimension\n+static const int dimension\n+Definition dgfgridfactory.hh:40\n+Dune::DGFGridFactory::grid\n+Grid * grid()\n+Definition dgfgridfactory.hh:90\n+Dune::DGFGridFactory::parameter\n+std::vector< double > & parameter(const Element &element)\n+Definition dgfgridfactory.hh:124\n+Dune::DGFGridFactory::haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+Definition dgfgridfactory.hh:151\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::boundary\n+bool boundary() const\n+Return true if intersection is with interior or exterior boundary (see the\n+cases above)\n+Definition common/intersection.hh:216\n+Dune::Intersection::indexInInside\n+int indexInInside() const\n+Local index of codim 1 entity in the inside() entity where intersection is\n+contained in.\n+Definition common/intersection.hh:346\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Grid::dimension\n+static constexpr int dimension\n+The dimension of the grid.\n+Definition common/grid.hh:387\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+Dune::DGFBoundaryParameter::defaultValue\n+static const type & defaultValue()\n+default constructor\n+Definition parser.hh:28\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+Dune::DuneGridFormatParser::nofvtxparams\n+int nofvtxparams\n+Definition parser.hh:163\n+Dune::DuneGridFormatParser::vtxParams\n+std::vector< std::vector< double > > vtxParams\n+Definition parser.hh:165\n+Dune::DuneGridFormatParser::nofelparams\n+int nofelparams\n+Definition parser.hh:163\n+Dune::DuneGridFormatParser::elParams\n+std::vector< std::vector< double > > elParams\n+Definition parser.hh:165\n+Dune::DuneGridFormatParser::vtx\n+std::vector< std::vector< double > > vtx\n+Definition parser.hh:125\n+Dune::DuneGridFormatParser::elements\n+std ::vector< std ::vector< unsigned int > > elements\n+Definition parser.hh:134\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00605.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00167.html", "comments": ["Files 85% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: coordfunctioncaller.hh File Reference\n+dune-grid: yaspgridintersection.hh File Reference\n \n \n \n \n \n \n \n@@ -65,37 +65,45 @@\n
    \n \n \n \n \n \n \n
    \n \n-
    coordfunctioncaller.hh File Reference
    \n+
    yaspgridintersection.hh File Reference
    \n
    \n
    \n-\n-

    Go to the source code of this file.

    \n+\n+

    The YaspIntersection class. \n+More...

    \n+\n+

    Go to the source code of this file.

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

    \n+Classes

    class  Dune::YaspIntersection< GridImp >
     YaspIntersection provides data about intersection with neighboring codim 0 entities. More...
     
    \n \n \n \n \n-\n-\n-\n

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n-
    \n+

    Detailed Description

    \n+

    The YaspIntersection class.

    \n+

    YaspIntersection provides data about intersection with neighboring codim 0 entities.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,21 +1,26 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * geometrygrid\n-Namespaces\n-coordfunctioncaller.hh File Reference\n-#include \n-#include \n+ * yaspgrid\n+Classes | Namespaces\n+yaspgridintersection.hh File Reference\n+The YaspIntersection class. More...\n Go_to_the_source_code_of_this_file.\n+Classes\n+class \u00a0 Dune::YaspIntersection<_GridImp_>\n+\u00a0 YaspIntersection provides data about intersection with neighboring\n+ codim 0 entities. More...\n+\u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::GeoGrid\n-\u00a0 namespace containing the implementations of GeometryGrid\n-\u00a0\n+***** Detailed Description *****\n+The YaspIntersection class.\n+YaspIntersection provides data about intersection with neighboring codim 0\n+entities.\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00605_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00599_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,23 +77,23 @@\n
  • dune
  • grid
  • geometrygrid
  • \n \n \n
    \n
    coordfunctioncaller.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_GEOGRID_COORDFUNCTIONCALLER_HH
    \n
    6#define DUNE_GEOGRID_COORDFUNCTIONCALLER_HH
    \n
    7
    \n-\n-\n+\n+\n
    10
    \n
    11namespace Dune
    \n
    12{
    \n
    13
    \n
    14 namespace GeoGrid
    \n
    15 {
    \n
    16
    \n@@ -177,16 +177,16 @@\n
    94 };
    \n
    95
    \n
    96 } // namespace GeoGrid
    \n
    97
    \n
    98} // namespace Dune
    \n
    99
    \n
    100#endif // #ifndef DUNE_GEOGRID_COORDFUNCTIONCALLER_HH
    \n-\n-\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    GeometryType
    Type representing VTK's entity geometry types.
    Definition common.hh:132
    \n
    Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid....
    Definition coordfunction.hh:44
    \n
    Definition coordfunctioncaller.hh:21
    \n
    \n \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -109,16 +109,16 @@\n 94 };\n 95\n 96 } // namespace GeoGrid\n 97\n 98} // namespace Dune\n 99\n 100#endif // #ifndef DUNE_GEOGRID_COORDFUNCTIONCALLER_HH\n-coordfunction.hh\n hostcorners.hh\n+coordfunction.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::VTK::GeometryType\n GeometryType\n Type representing VTK's entity geometry types.\n Definition common.hh:132\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00617_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00608_source.html", "comments": ["Files 91% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dofadmin.hh Source File\n+dune-grid: coordfunction.hh Source File\n \n \n \n \n \n \n \n@@ -70,391 +70,374 @@\n
    \n \n \n \n \n \n \n
    \n-
    dofadmin.hh
    \n+
    coordfunction.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_DOFADMIN_HH
    \n-
    6#define DUNE_ALBERTA_DOFADMIN_HH
    \n+
    5#ifndef DUNE_GEOGRID_COORDFUNCTION_HH
    \n+
    6#define DUNE_GEOGRID_COORDFUNCTION_HH
    \n
    7
    \n-
    8#include <utility>
    \n+
    8#include <cassert>
    \n
    9
    \n-
    10#include <dune/common/hybridutilities.hh>
    \n-
    11
    \n-\n-\n-
    14
    \n-
    15#if HAVE_ALBERTA
    \n-
    16
    \n-
    17namespace Dune
    \n-
    18{
    \n-
    19
    \n-
    20 namespace Alberta
    \n-
    21 {
    \n-
    22
    \n-
    23 // External Forward Declarations
    \n-
    24 // -----------------------------
    \n+
    10#include <dune/common/fvector.hh>
    \n+
    11#include <dune/common/std/type_traits.hh>
    \n+
    12
    \n+
    13namespace Dune
    \n+
    14{
    \n+
    15
    \n+
    16 // Internal Forward Declarations
    \n+
    17 // -----------------------------
    \n+
    18
    \n+
    19 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n+
    20 class AnalyticalCoordFunction;
    \n+
    21
    \n+
    22 template< class ct, unsigned int dimR, class Impl >
    \n+
    23 class DiscreteCoordFunction;
    \n+
    24
    \n
    25
    \n-
    26 template< int dim >
    \n-
    27 class MeshPointer;
    \n-
    28
    \n+
    26
    \n+
    27 // AnalyticalCoordFunctionInterface
    \n+
    28 // --------------------------------
    \n
    29
    \n-
    30
    \n-
    31 // DofAccess
    \n-
    32 // ---------
    \n-
    33
    \n-
    34 template< int dim, int codim >
    \n-
    \n-\n-
    36 {
    \n-
    37 static const int codimtype = CodimType< dim, codim >::value;
    \n-
    38
    \n-
    39 public:
    \n-\n-
    41
    \n-
    42 static const int dimension = dim;
    \n-
    43 static const int codimension = codim;
    \n-
    44
    \n-\n+
    42 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n+
    \n+\n+
    44 {
    \n+\n
    46
    \n-
    \n-\n-
    48 : node_( -1 )
    \n-
    49 {}
    \n-
    \n-
    50
    \n-
    \n-
    51 explicit DofAccess ( const DofSpace *dofSpace )
    \n-
    52 {
    \n-
    53 assert( dofSpace );
    \n-
    54 node_ = dofSpace->admin->mesh->node[ codimtype ];
    \n-
    55 index_ = dofSpace->admin->n0_dof[ codimtype ];
    \n-
    56 }
    \n-
    \n-
    57
    \n-
    \n-
    58 int operator() ( const Element *element, int subEntity, int i ) const
    \n-
    59 {
    \n-
    60 assert( element );
    \n-
    61 assert( node_ != -1 );
    \n-
    62 assert( subEntity < numSubEntities );
    \n-
    63 return element->dof[ node_ + subEntity ][ index_ + i ];
    \n-
    64 }
    \n-
    \n+
    47 friend class AnalyticalCoordFunction< ct, dimD, dimR, Impl >;
    \n+
    48
    \n+
    49 public:
    \n+
    50 typedef This Interface;
    \n+
    51 typedef Impl Implementation;
    \n+
    52
    \n+
    54 typedef ct ctype;
    \n+
    55
    \n+
    57 static const unsigned int dimDomain = dimD;
    \n+
    59 static const unsigned int dimRange = dimR;
    \n+
    60
    \n+
    62 typedef FieldVector< ctype, dimDomain > DomainVector;
    \n+
    64 typedef FieldVector< ctype, dimRange > RangeVector;
    \n
    65
    \n-
    \n-
    66 int operator() ( const Element *element, int subEntity ) const
    \n-
    67 {
    \n-
    68 return (*this)( element, subEntity, 0 );
    \n-
    69 }
    \n-
    \n-
    70
    \n-
    \n-
    71 int operator() ( const ElementInfo &elementInfo, int subEntity, int i ) const
    \n-
    72 {
    \n-
    73 return (*this)( elementInfo.el(), subEntity, i );
    \n-
    74 }
    \n-
    \n-
    75
    \n-
    \n-
    76 int operator() ( const ElementInfo &elementInfo, int subEntity ) const
    \n-
    77 {
    \n-
    78 return (*this)( elementInfo.el(), subEntity );
    \n-
    79 }
    \n-
    \n-
    80
    \n-
    81 private:
    \n-
    82 int node_;
    \n-
    83 int index_;
    \n-
    84 };
    \n-
    \n-
    85
    \n+
    66 private:
    \n+\n+
    68 AnalyticalCoordFunctionInterface ( const This & ) = default;
    \n+\n+\n+
    71 This &operator= ( const This & ) = default;
    \n+
    72 This &operator= ( This && ) = default;
    \n+
    73
    \n+
    74 // helper for picking the correct version of evaluate further down
    \n+
    75 template<typename F, typename DV>
    \n+
    76 using has_operator_parentheses = decltype(std::declval<F>()(std::declval<DV>()));
    \n+
    77
    \n+
    78 public:
    \n+
    79
    \n+
    80#ifdef DOXYGEN
    \n+
    81
    \n+
    83 void evaluate ( const DomainVector &x, RangeVector &y ) const;
    \n+
    84
    \n+
    85#else
    \n
    86
    \n-
    87
    \n-
    88 // HierarchyDofNumbering
    \n-
    89 // ---------------------
    \n-
    90
    \n-
    91 template< int dim >
    \n-
    \n-\n-
    93 {
    \n-\n+
    87 template<typename DV>
    \n+
    88 std::enable_if_t<
    \n+
    89 Std::is_detected<has_operator_parentheses,Impl,DV>::value
    \n+
    90 >
    \n+
    91 evaluate ( const DV &x, RangeVector &y ) const
    \n+
    92 {
    \n+
    93 y = asImp()(x);
    \n+
    94 }
    \n
    95
    \n-
    96 public:
    \n-
    97 static const int dimension = dim;
    \n-
    98
    \n-\n-\n-
    101
    \n-
    102 private:
    \n-
    103 static const int nNodeTypes = N_NODE_TYPES;
    \n-
    104
    \n-
    105 template< int codim >
    \n-
    106 struct CreateDofSpace;
    \n-
    107
    \n-
    108 template< int codim >
    \n-
    109 struct CacheDofSpace;
    \n+
    96 template<typename DV>
    \n+
    97 std::enable_if_t<
    \n+
    98 not Std::is_detected<has_operator_parentheses,Impl,DV>::value
    \n+
    99 >
    \n+
    100 evaluate ( const DV &x, RangeVector &y ) const
    \n+
    101 {
    \n+
    102 assert(
    \n+
    103 static_cast<void(This::*)(const DomainVector&, RangeVector&) const>(&This::evaluate) !=
    \n+
    104 static_cast<void(Impl::*)(const DomainVector&, RangeVector&) const>(&Impl::evaluate) &&
    \n+
    105 "You need to implement either operator() or evaluate() in your coordinate function!");
    \n+
    106 asImp().evaluate( x, y );
    \n+
    107 }
    \n+
    108
    \n+
    109#endif // DOXYGEN
    \n
    110
    \n-
    111 typedef std::pair< int, int > Cache;
    \n+
    111 protected:
    \n
    112
    \n-
    113 public:
    \n-
    \n-\n-
    115 {}
    \n-
    \n-
    116
    \n-
    117 private:
    \n-
    118 HierarchyDofNumbering ( const This & );
    \n-
    119 This &operator= ( const This & );
    \n-
    120
    \n-
    121 public:
    \n-
    \n-\n-
    123 {
    \n-
    124 release();
    \n-
    125 }
    \n-
    \n-
    126
    \n-
    \n-
    127 int operator() ( const Element *element, int codim, unsigned int subEntity ) const
    \n-
    128 {
    \n-
    129 assert( !(*this) == false );
    \n-
    130 assert( (codim >= 0) && (codim <= dimension) );
    \n-
    131 const Cache &cache = cache_[ codim ];
    \n-
    132 return element->dof[ cache.first + subEntity ][ cache.second ];
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    \n-
    135 int operator() ( const ElementInfo &element, int codim, unsigned int subEntity ) const
    \n-
    136 {
    \n-
    137 return (*this)( element.el(), codim, subEntity );
    \n-
    138 }
    \n-
    \n-
    139
    \n-
    \n-
    140 explicit operator bool () const
    \n-
    141 {
    \n-
    142 return (bool)mesh_;
    \n-
    143 }
    \n-
    \n-
    144
    \n-
    \n-
    145 const DofSpace *dofSpace ( int codim ) const
    \n-
    146 {
    \n-
    147 assert( *this );
    \n-
    148 assert( (codim >= 0) && (codim <= dimension) );
    \n-
    149 return dofSpace_[ codim ];
    \n-
    150 }
    \n-
    \n+
    \n+
    113 const Implementation &asImp () const
    \n+
    114 {
    \n+
    115 return static_cast< const Implementation & >( *this );
    \n+
    116 }
    \n+
    \n+
    117
    \n+
    \n+\n+
    119 {
    \n+
    120 return static_cast< Implementation & >( *this );
    \n+
    121 }
    \n+
    \n+
    122 };
    \n+
    \n+
    123
    \n+
    124
    \n+
    125
    \n+
    126 // AnalyticalCoordFunction
    \n+
    127 // -----------------------
    \n+
    131 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n+
    \n+\n+
    133 : public AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >
    \n+
    134 {
    \n+\n+\n+
    137
    \n+
    138 public:
    \n+
    139 typedef typename Base :: DomainVector DomainVector;
    \n+
    140 typedef typename Base :: RangeVector RangeVector;
    \n+
    141
    \n+
    142 protected:
    \n+\n+
    144 AnalyticalCoordFunction ( const This & ) = default;
    \n+\n+\n+
    147 This &operator= ( const This & ) = default;
    \n+
    148 This &operator= ( This && ) = default;
    \n+
    149
    \n+
    150 private:
    \n
    151
    \n-
    \n-
    152 const DofSpace *emptyDofSpace () const
    \n-
    153 {
    \n-
    154 assert( *this );
    \n-
    155 return emptySpace_;
    \n-
    156 }
    \n-
    \n-
    157
    \n-
    \n-
    158 const MeshPointer &mesh () const
    \n-
    159 {
    \n-
    160 return mesh_;
    \n-
    161 }
    \n-
    \n-
    162
    \n-
    \n-
    163 int size ( int codim ) const
    \n-
    164 {
    \n-
    165 return dofSpace( codim )->admin->size;
    \n-
    166 }
    \n-
    \n-
    167
    \n-
    \n-
    168 void create ( const MeshPointer &mesh );
    \n-
    169
    \n-
    \n-
    170 void release ()
    \n-
    171 {
    \n-
    172 if( *this )
    \n-
    173 {
    \n-
    174 for( int codim = 0; codim <= dimension; ++codim )
    \n-
    175 freeDofSpace( dofSpace_[ codim ] );
    \n-
    176 freeDofSpace( emptySpace_ );
    \n-
    177 mesh_ = MeshPointer();
    \n-
    178 }
    \n-
    179 }
    \n-
    \n-
    180
    \n-
    181 private:
    \n-
    182 static const DofSpace *createEmptyDofSpace ( const MeshPointer &mesh );
    \n-
    183 static const DofSpace *createDofSpace ( const MeshPointer &mesh,
    \n-
    184 const std::string &name,
    \n-
    185 const int (&ndof)[ nNodeTypes ],
    \n-
    186 const bool periodic = false );
    \n-
    187 static void freeDofSpace ( const DofSpace *dofSpace );
    \n-
    188
    \n-
    189 MeshPointer mesh_;
    \n-
    190 const DofSpace *emptySpace_;
    \n-
    191 const DofSpace *dofSpace_[ dimension+1 ];
    \n-
    192 Cache cache_[ dimension+1 ];
    \n-
    193 };
    \n-
    194
    \n-
    195
    \n-
    196
    \n-
    197 template< int dim >
    \n-
    198 inline void
    \n-
    \n-\n-
    200 {
    \n-
    201 release();
    \n-
    202
    \n-
    203 if( !mesh )
    \n-
    204 return;
    \n-
    205
    \n-
    206 mesh_ = mesh;
    \n-
    207
    \n-
    208 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i ){ CreateDofSpace< i >::apply( mesh_, dofSpace_ ); } );
    \n-
    209 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i ){ CacheDofSpace< i >::apply( dofSpace_, cache_ ); } );
    \n-
    210
    \n-
    211 emptySpace_ = createEmptyDofSpace( mesh_ );
    \n-
    212 for( int i = 0; i < nNodeTypes; ++i )
    \n-
    213 assert( emptySpace_->admin->n_dof[ i ] == 0 );
    \n-
    214 }
    \n+
    152 };
    \n
    \n+
    153
    \n+
    154
    \n+
    155
    \n+
    156 // DiscreteCoordFunctionInterface
    \n+
    157 // ------------------------------
    \n+
    158
    \n+
    173 template< class ct, unsigned int dimR, class Impl >
    \n+
    \n+\n+
    175 {
    \n+\n+
    177
    \n+
    178 friend class DiscreteCoordFunction< ct, dimR, Impl >;
    \n+
    179
    \n+
    180 public:
    \n+\n+
    182 typedef Impl Implementation;
    \n+
    183
    \n+
    185 typedef ct ctype;
    \n+
    186
    \n+
    188 static const unsigned int dimRange = dimR;
    \n+
    189
    \n+
    191 typedef FieldVector< ctype, dimRange > RangeVector;
    \n+
    192
    \n+
    193 private:
    \n+\n+
    195 DiscreteCoordFunctionInterface ( const This & ) = default;
    \n+
    196 DiscreteCoordFunctionInterface ( This && ) = default;
    \n+\n+
    198 This &operator= ( const This & ) = default;
    \n+
    199 This &operator= ( This && ) = default;
    \n+
    200
    \n+
    201 public:
    \n+
    210 template< class HostEntity >
    \n+
    \n+
    211 void evaluate ( const HostEntity &hostEntity, unsigned int corner,
    \n+
    212 RangeVector &y ) const
    \n+
    213 {
    \n+
    214 asImp().evaluate( hostEntity, corner, y );
    \n+
    215 }
    \n
    \n-
    215
    \n
    216
    \n-
    217
    \n-
    218 template< int dim >
    \n-
    219 inline const DofSpace *
    \n-\n+
    \n+
    220 void adapt ()
    \n
    221 {
    \n-
    222 int ndof[ nNodeTypes ];
    \n-
    223 for( int i = 0; i < nNodeTypes; ++i )
    \n-
    224 ndof[ i ] = 0;
    \n-
    225 std::string name = "Empty";
    \n-
    226 return createDofSpace( mesh, name, ndof );
    \n-
    227 }
    \n-
    228
    \n-
    229
    \n-
    230 template< int dim >
    \n-
    231 inline const DofSpace *
    \n-
    232 HierarchyDofNumbering< dim >::createDofSpace ( const MeshPointer &mesh,
    \n-
    233 const std::string &name,
    \n-
    234 const int (&ndof)[ nNodeTypes ],
    \n-
    235 const bool periodic )
    \n-
    236 {
    \n-
    237 const ALBERTA FLAGS flags
    \n-
    238 = ADM_PRESERVE_COARSE_DOFS | (periodic ? ADM_PERIODIC : 0);
    \n-
    239 return ALBERTA get_dof_space ( mesh, name.c_str(), ndof, flags );
    \n-
    240 }
    \n-
    241
    \n-
    242
    \n-
    243 template< int dim >
    \n-
    244 inline void
    \n-
    245 HierarchyDofNumbering< dim >::freeDofSpace ( const DofSpace *dofSpace )
    \n-
    246 {
    \n-
    247 ALBERTA free_fe_space( dofSpace );
    \n-
    248 }
    \n-
    249
    \n-
    250
    \n+
    222 asImp().adapt();
    \n+
    223 }
    \n+
    \n+
    224
    \n+
    225 protected:
    \n+
    \n+
    226 const Implementation &asImp () const
    \n+
    227 {
    \n+
    228 return static_cast< const Implementation & >( *this );
    \n+
    229 }
    \n+
    \n+
    230
    \n+
    \n+\n+
    232 {
    \n+
    233 return static_cast< Implementation & >( *this );
    \n+
    234 }
    \n+
    \n+
    235 };
    \n+
    \n+
    236
    \n+
    237
    \n+
    238
    \n+
    239 // DiscreteCoordFunction
    \n+
    240 // ---------------------
    \n+
    241 //
    \n+
    245 template< class ct, unsigned int dimR, class Impl >
    \n+
    \n+\n+
    247 : public DiscreteCoordFunctionInterface< ct, dimR, Impl >
    \n+
    248 {
    \n+\n+\n
    251
    \n-
    252 // HierarchyDofNumbering::CreateDofSpace
    \n-
    253 // -------------------------------------
    \n+
    252 public:
    \n+
    253 typedef typename Base :: RangeVector RangeVector;
    \n
    254
    \n-
    255 template< int dim >
    \n-
    256 template< int codim >
    \n-
    257 struct HierarchyDofNumbering< dim >::CreateDofSpace
    \n-
    258 {
    \n-
    259 static void apply ( const MeshPointer &mesh, const DofSpace *(&dofSpace)[ dim+1 ] )
    \n-
    260 {
    \n-
    261 int ndof[ nNodeTypes ];
    \n-
    262 for( int i = 0; i < nNodeTypes; ++i )
    \n-
    263 ndof[ i ] = 0;
    \n-
    264 ndof[ CodimType< dim, codim >::value ] = 1;
    \n+
    255 protected:
    \n+\n+
    257 DiscreteCoordFunction ( const This & ) = default;
    \n+
    258 DiscreteCoordFunction ( This && ) = default;
    \n+\n+
    260 This &operator= ( const This & ) = default;
    \n+
    261 This &operator= ( This && ) = default;
    \n+
    262
    \n+
    \n+
    263 void adapt ()
    \n+
    264 {}
    \n+
    \n
    265
    \n-
    266 std::string name = "Codimension ";
    \n-
    267 name += (char)(codim + '0');
    \n-
    268
    \n-
    269 dofSpace[ codim ] = createDofSpace( mesh, name, ndof );
    \n-
    270 assert( dofSpace[ codim ] );
    \n-
    271 }
    \n-
    272 };
    \n+
    266 private:
    \n+
    267 template< class HostEntity >
    \n+
    268 void evaluate ( const HostEntity &hostEntity, unsigned int corner,
    \n+
    269 RangeVector &y ) const;
    \n+
    270 };
    \n+
    \n+
    271
    \n+
    272
    \n
    273
    \n-
    274
    \n-
    275
    \n-
    276 // HierarchyDofNumbering::CacheDofSpace
    \n-
    277 // ------------------------------------
    \n-
    278
    \n-
    279 template< int dim >
    \n-
    280 template< int codim >
    \n-
    281 struct HierarchyDofNumbering< dim >::CacheDofSpace
    \n+
    274 namespace GeoGrid
    \n+
    275 {
    \n+
    276
    \n+
    277 // isCoordFunctionInterface
    \n+
    278 // ------------------------
    \n+
    279
    \n+
    280 template< class CoordFunctionInterface >
    \n+
    281 struct isCoordFunctionInterface
    \n
    282 {
    \n-
    283 static void apply ( const DofSpace *(&dofSpace)[ dim+1 ], Cache (&cache)[ dim+1 ] )
    \n-
    284 {
    \n-
    285 assert( dofSpace[ codim ] );
    \n-
    286 const int codimtype = CodimType< dim, codim >::value;
    \n-
    287 cache[ codim ].first = dofSpace[ codim ]->mesh->node[ codimtype ];
    \n-
    288 cache[ codim ].second = dofSpace[ codim ]->admin->n0_dof[ codimtype ];
    \n-
    289 }
    \n-
    290 };
    \n-
    291
    \n-
    292 } // namespace Alberta
    \n-
    293
    \n-
    294} // namespace Dune
    \n-
    295
    \n-
    296#endif // #if HAVE_ALBERTA
    \n-
    297
    \n-
    298#endif // #ifndef DUNE_ALBERTA_DOFADMIN_HH
    \n-
    \n-
    provides a wrapper for ALBERTA's el_info structure
    \n-\n-
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+
    283 static const bool value = false;
    \n+
    284 };
    \n+
    285
    \n+
    286 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >
    \n+
    287 struct isCoordFunctionInterface
    \n+
    288 < AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl > >
    \n+
    289 {
    \n+
    290 static const bool value = true;
    \n+
    291 };
    \n+
    292
    \n+
    293 template< class ct, unsigned int dimR, class Impl >
    \n+
    294 struct isCoordFunctionInterface
    \n+
    295 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >
    \n+
    296 {
    \n+
    297 static const bool value = true;
    \n+
    298 };
    \n+
    299
    \n+
    300
    \n+
    301
    \n+
    302 // isDiscreteCoordFunctionInterface
    \n+
    303 // --------------------------------
    \n+
    304
    \n+
    305 template< class CoordFunctionInterface >
    \n+
    306 struct isDiscreteCoordFunctionInterface
    \n+
    307 {
    \n+
    308 static const bool value = false;
    \n+
    309 };
    \n+
    310
    \n+
    311 template< class ct, unsigned int dimR, class Impl >
    \n+
    312 struct isDiscreteCoordFunctionInterface
    \n+
    313 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >
    \n+
    314 {
    \n+
    315 static const bool value = true;
    \n+
    316 };
    \n+
    317
    \n+
    318
    \n+
    319
    \n+
    320 // AdaptCoordFunction
    \n+
    321 // ------------------
    \n+
    322
    \n+
    323 template< class CoordFunctionInterface >
    \n+
    324 struct AdaptCoordFunction
    \n+
    325 {
    \n+
    326 static void adapt ( CoordFunctionInterface & )
    \n+
    327 {}
    \n+
    328 };
    \n+
    329
    \n+
    330 template< class ct, unsigned int dimR, class Impl >
    \n+
    331 struct AdaptCoordFunction< DiscreteCoordFunctionInterface< ct, dimR, Impl > >
    \n+
    332 {
    \n+
    333 typedef DiscreteCoordFunctionInterface< ct, dimR, Impl > CoordFunctionInterface;
    \n+
    334
    \n+
    335 static void adapt ( CoordFunctionInterface &coordFunction )
    \n+
    336 {
    \n+
    337 coordFunction.adapt();
    \n+
    338 }
    \n+
    339 };
    \n+
    340
    \n+
    341 } // namespace GeoGrid
    \n+
    342
    \n+
    343} // namespace Dune
    \n+
    344
    \n+
    345#endif // #ifndef DUNE_GEOGRID_COORDFUNCTION_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    ALBERTA EL Element
    Definition misc.hh:54
    \n-
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n-\n-
    Definition dofadmin.hh:36
    \n-
    static const int dimension
    Definition dofadmin.hh:42
    \n-
    DofAccess()
    Definition dofadmin.hh:47
    \n-
    static const int codimension
    Definition dofadmin.hh:43
    \n-
    static const int numSubEntities
    Definition dofadmin.hh:40
    \n-
    DofAccess(const DofSpace *dofSpace)
    Definition dofadmin.hh:51
    \n-
    int operator()(const Element *element, int subEntity, int i) const
    Definition dofadmin.hh:58
    \n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition dofadmin.hh:45
    \n-
    Definition dofadmin.hh:93
    \n-
    HierarchyDofNumbering()
    Definition dofadmin.hh:114
    \n-
    int operator()(const Element *element, int codim, unsigned int subEntity) const
    Definition dofadmin.hh:127
    \n-
    const MeshPointer & mesh() const
    Definition dofadmin.hh:158
    \n-
    void create(const MeshPointer &mesh)
    Definition dofadmin.hh:199
    \n-
    ~HierarchyDofNumbering()
    Definition dofadmin.hh:122
    \n-
    Alberta::MeshPointer< dimension > MeshPointer
    Definition dofadmin.hh:99
    \n-
    int size(int codim) const
    Definition dofadmin.hh:163
    \n-
    const DofSpace * dofSpace(int codim) const
    Definition dofadmin.hh:145
    \n-
    Alberta::ElementInfo< dimension > ElementInfo
    Definition dofadmin.hh:100
    \n-
    static const int dimension
    Definition dofadmin.hh:97
    \n-
    const DofSpace * emptyDofSpace() const
    Definition dofadmin.hh:152
    \n-
    void release()
    Definition dofadmin.hh:170
    \n-\n-
    Element * el() const
    Definition elementinfo.hh:737
    \n-
    Definition misc.hh:148
    \n-
    Definition misc.hh:192
    \n+
    Derive an implementation of an analytical coordinate function from this class.
    Definition coordfunction.hh:134
    \n+
    Base::DomainVector DomainVector
    Definition coordfunction.hh:139
    \n+\n+\n+
    AnalyticalCoordFunction(This &&)=default
    \n+
    Base::RangeVector RangeVector
    Definition coordfunction.hh:140
    \n+
    This & operator=(const This &)=default
    \n+
    AnalyticalCoordFunction(const This &)=default
    \n+
    Derive an implementation of a discrete coordinate function from this class.
    Definition coordfunction.hh:248
    \n+
    This & operator=(const This &)=default
    \n+
    void adapt()
    Definition coordfunction.hh:263
    \n+\n+
    DiscreteCoordFunction(This &&)=default
    \n+\n+
    DiscreteCoordFunction(const This &)=default
    \n+
    Base::RangeVector RangeVector
    Definition coordfunction.hh:253
    \n+
    Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid....
    Definition coordfunction.hh:44
    \n+
    Impl Implementation
    Definition coordfunction.hh:51
    \n+
    FieldVector< ctype, dimRange > RangeVector
    range vector for the evaluate method
    Definition coordfunction.hh:64
    \n+
    void evaluate(const DomainVector &x, RangeVector &y) const
    evaluate method for global mapping
    \n+
    static const unsigned int dimRange
    dimension of the range vector
    Definition coordfunction.hh:59
    \n+
    ct ctype
    field type of the coordinate vector
    Definition coordfunction.hh:54
    \n+
    static const unsigned int dimDomain
    dimension of the range vector (dimensionworld of host grid)
    Definition coordfunction.hh:57
    \n+
    const Implementation & asImp() const
    Definition coordfunction.hh:113
    \n+
    This Interface
    Definition coordfunction.hh:50
    \n+
    Implementation & asImp()
    Definition coordfunction.hh:118
    \n+
    FieldVector< ctype, dimDomain > DomainVector
    domain vector for the evaluate method
    Definition coordfunction.hh:62
    \n+
    Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid....
    Definition coordfunction.hh:175
    \n+
    static const unsigned int dimRange
    dimension of the range vector
    Definition coordfunction.hh:188
    \n+
    void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
    evaluate method
    Definition coordfunction.hh:211
    \n+
    Implementation & asImp()
    Definition coordfunction.hh:231
    \n+
    ct ctype
    field type of the coordinate vector
    Definition coordfunction.hh:185
    \n+
    void adapt()
    method called from grid.adapt() method to allow adaptation of the discrete coordinate function
    Definition coordfunction.hh:220
    \n+
    FieldVector< ctype, dimRange > RangeVector
    range vector for the evaluate method
    Definition coordfunction.hh:191
    \n+
    const Implementation & asImp() const
    Definition coordfunction.hh:226
    \n+
    Impl Implementation
    Definition coordfunction.hh:182
    \n+
    This Interface
    Definition coordfunction.hh:181
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,403 +1,429 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-dofadmin.hh\n+ * geometrygrid\n+coordfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_DOFADMIN_HH\n-6#define DUNE_ALBERTA_DOFADMIN_HH\n+5#ifndef DUNE_GEOGRID_COORDFUNCTION_HH\n+6#define DUNE_GEOGRID_COORDFUNCTION_HH\n 7\n-8#include \n+8#include \n 9\n-10#include \n-11\n-12#include \n-13#include \n-14\n-15#if HAVE_ALBERTA\n-16\n-17namespace Dune\n-18{\n-19\n-20 namespace Alberta\n-21 {\n-22\n-23 // External Forward Declarations\n-24 // -----------------------------\n+10#include \n+11#include \n+12\n+13namespace Dune\n+14{\n+15\n+16 // Internal Forward Declarations\n+17 // -----------------------------\n+18\n+19 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n+20 class AnalyticalCoordFunction;\n+21\n+22 template< class ct, unsigned int dimR, class Impl >\n+23 class DiscreteCoordFunction;\n+24\n 25\n-26 template< int dim >\n-27 class MeshPointer;\n-28\n+26\n+27 // AnalyticalCoordFunctionInterface\n+28 // --------------------------------\n 29\n-30\n-31 // DofAccess\n-32 // ---------\n-33\n-34 template< int dim, int codim >\n-35 class DofAccess\n-36 {\n-37 static const int codimtype = CodimType<_dim,_codim_>::value;\n-38\n-39 public:\n-40 static const int numSubEntities = NumSubEntities<_dim,_codim_>::value;\n-41\n-42 static const int dimension = dim;\n-43 static const int codimension = codim;\n-44\n-45 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n+42 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n+43 class AnalyticalCoordFunctionInterface\n+44 {\n+45 typedef AnalyticalCoordFunctionInterface<_ct,_dimD,_dimR,_Impl_> This;\n 46\n-47 DofAccess ()\n-48 : node_( -1 )\n-49 {}\n-50\n-51 explicit DofAccess ( const DofSpace *dofSpace )\n-52 {\n-53 assert( dofSpace );\n-54 node_ = dofSpace->admin->mesh->node[ codimtype ];\n-55 index_ = dofSpace->admin->n0_dof[ codimtype ];\n-56 }\n-57\n-58 int operator()_( const Element *element, int subEntity, int i ) const\n-59 {\n-60 assert( element );\n-61 assert( node_ != -1 );\n-62 assert( subEntity < numSubEntities );\n-63 return element->dof[ node_ + subEntity ][ index_ + i ];\n-64 }\n+47 friend class AnalyticalCoordFunction< ct, dimD, dimR, Impl >;\n+48\n+49 public:\n+50 typedef This Interface;\n+51 typedef Impl Implementation;\n+52\n+54 typedef ct ctype;\n+55\n+57 static const unsigned int dimDomain = dimD;\n+59 static const unsigned int dimRange = dimR;\n+60\n+62 typedef FieldVector< ctype, dimDomain > DomainVector;\n+64 typedef FieldVector< ctype, dimRange > RangeVector;\n 65\n-66 int operator()_( const Element *element, int subEntity ) const\n-67 {\n-68 return (*this)( element, subEntity, 0 );\n-69 }\n-70\n-71 int operator()_( const ElementInfo &elementInfo, int subEntity, int i )\n-const\n-72 {\n-73 return (*this)( elementInfo.el(), subEntity, i );\n-74 }\n-75\n-76 int operator()_( const ElementInfo &elementInfo, int subEntity ) const\n-77 {\n-78 return (*this)( elementInfo.el(), subEntity );\n-79 }\n-80\n-81 private:\n-82 int node_;\n-83 int index_;\n-84 };\n-85\n+66 private:\n+67 AnalyticalCoordFunctionInterface () = default;\n+68 AnalyticalCoordFunctionInterface ( const This & ) = default;\n+69 AnalyticalCoordFunctionInterface ( This && ) = default;\n+70 ~AnalyticalCoordFunctionInterface () = default;\n+71 This &operator= ( const This & ) = default;\n+72 This &operator= ( This && ) = default;\n+73\n+74 // helper for picking the correct version of evaluate further down\n+75 template\n+76 using has_operator_parentheses = decltype(std::declval()(std::declval\n+()));\n+77\n+78 public:\n+79\n+80#ifdef DOXYGEN\n+81\n+83 void evaluate ( const DomainVector &x, RangeVector &y ) const;\n+84\n+85#else\n 86\n-87\n-88 // HierarchyDofNumbering\n-89 // ---------------------\n-90\n-91 template< int dim >\n-92 class HierarchyDofNumbering\n-93 {\n-94 typedef HierarchyDofNumbering<_dim_> This;\n+87 template\n+88 std::enable_if_t<\n+89 Std::is_detected::value\n+90 >\n+91 evaluate ( const DV &x, RangeVector &y ) const\n+92 {\n+93 y = asImp()(x);\n+94 }\n 95\n-96 public:\n-97 static const int dimension = dim;\n-98\n-99 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n-100 typedef Alberta::ElementInfo<_dimension_> ElementInfo;\n-101\n-102 private:\n-103 static const int nNodeTypes = N_NODE_TYPES;\n-104\n-105 template< int codim >\n-106 struct CreateDofSpace;\n-107\n-108 template< int codim >\n-109 struct CacheDofSpace;\n+96 template\n+97 std::enable_if_t<\n+98 not Std::is_detected::value\n+99 >\n+100 evaluate ( const DV &x, RangeVector &y ) const\n+101 {\n+102 assert(\n+103 static_cast(&This::\n+evaluate) !=\n+104 static_cast(&Impl::\n+evaluate) &&\n+105 \"You need to implement either operator() or evaluate() in your coordinate\n+function!\");\n+106 asImp().evaluate( x, y );\n+107 }\n+108\n+109#endif // DOXYGEN\n 110\n-111 typedef std::pair< int, int > Cache;\n+111 protected:\n 112\n-113 public:\n-114 HierarchyDofNumbering ()\n-115 {}\n-116\n-117 private:\n-118 HierarchyDofNumbering ( const This & );\n-119 This &operator= ( const This & );\n-120\n-121 public:\n-122 ~HierarchyDofNumbering ()\n-123 {\n-124 release();\n-125 }\n-126\n-127 int operator()_( const Element *element, int codim, unsigned int subEntity\n-) const\n-128 {\n-129 assert( !(*this) == false );\n-130 assert( (codim >= 0) && (codim <= dimension) );\n-131 const Cache &cache = cache_[ codim ];\n-132 return element->dof[ cache.first + subEntity ][ cache.second ];\n-133 }\n-134\n-135 int operator()_( const ElementInfo &element, int codim, unsigned int\n-subEntity ) const\n-136 {\n-137 return (*this)( element.el(), codim, subEntity );\n-138 }\n-139\n-140 explicit operator bool () const\n-141 {\n-142 return (bool)mesh_;\n-143 }\n-144\n-145 const DofSpace *dofSpace ( int codim ) const\n-146 {\n-147 assert( *this );\n-148 assert( (codim >= 0) && (codim <= dimension) );\n-149 return dofSpace_[ codim ];\n-150 }\n+113 const Implementation &asImp () const\n+114 {\n+115 return static_cast< const Implementation & >( *this );\n+116 }\n+117\n+118 Implementation &asImp ()\n+119 {\n+120 return static_cast< Implementation & >( *this );\n+121 }\n+122 };\n+123\n+124\n+125\n+126 // AnalyticalCoordFunction\n+127 // -----------------------\n+131 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n+132 class AnalyticalCoordFunction\n+133 : public AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >\n+134 {\n+135 typedef AnalyticalCoordFunction<_ct,_dimD,_dimR,_Impl_> This;\n+136 typedef AnalyticalCoordFunctionInterface<_ct,_dimD,_dimR,_Impl_> Base;\n+137\n+138 public:\n+139 typedef typename Base :: DomainVector DomainVector;\n+140 typedef typename Base :: RangeVector RangeVector;\n+141\n+142 protected:\n+143 AnalyticalCoordFunction () = default;\n+144 AnalyticalCoordFunction ( const This & ) = default;\n+145 AnalyticalCoordFunction ( This && ) = default;\n+146 ~AnalyticalCoordFunction () = default;\n+147 This &operator=_( const This & ) = default;\n+148 This &operator=_( This && ) = default;\n+149\n+150 private:\n 151\n-152 const DofSpace *emptyDofSpace () const\n-153 {\n-154 assert( *this );\n-155 return emptySpace_;\n-156 }\n-157\n-158 const MeshPointer &mesh () const\n-159 {\n-160 return mesh_;\n-161 }\n-162\n-163 int size ( int codim ) const\n-164 {\n-165 return dofSpace( codim )->admin->size;\n-166 }\n-167\n-168 void create ( const MeshPointer &mesh );\n-169\n-170 void release ()\n-171 {\n-172 if( *this )\n-173 {\n-174 for( int codim = 0; codim <= dimension; ++codim )\n-175 freeDofSpace( dofSpace_[ codim ] );\n-176 freeDofSpace( emptySpace_ );\n-177 mesh_ = MeshPointer();\n-178 }\n-179 }\n-180\n-181 private:\n-182 static const DofSpace *createEmptyDofSpace ( const MeshPointer &mesh );\n-183 static const DofSpace *createDofSpace ( const MeshPointer &mesh,\n-184 const std::string &name,\n-185 const int (&ndof)[ nNodeTypes ],\n-186 const bool periodic = false );\n-187 static void freeDofSpace ( const DofSpace *dofSpace );\n-188\n-189 MeshPointer mesh_;\n-190 const DofSpace *emptySpace_;\n-191 const DofSpace *dofSpace_[ dimension+1 ];\n-192 Cache cache_[ dimension+1 ];\n-193 };\n-194\n-195\n-196\n-197 template< int dim >\n-198 inline void\n-199 HierarchyDofNumbering<_dim_>::create ( const MeshPointer &mesh )\n-200 {\n-201 release();\n-202\n-203 if( !mesh )\n-204 return;\n-205\n-206 mesh_ = mesh;\n-207\n-208 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i )\n-{ CreateDofSpace< i >::apply( mesh_, dofSpace_ ); } );\n-209 Hybrid::forEach( std::make_index_sequence< dimension+1 >{}, [ & ]( auto i )\n-{ CacheDofSpace< i >::apply( dofSpace_, cache_ ); } );\n-210\n-211 emptySpace_ = createEmptyDofSpace( mesh_ );\n-212 for( int i = 0; i < nNodeTypes; ++i )\n-213 assert( emptySpace_->admin->n_dof[ i ] == 0 );\n-214 }\n-215\n+152 };\n+153\n+154\n+155\n+156 // DiscreteCoordFunctionInterface\n+157 // ------------------------------\n+158\n+173 template< class ct, unsigned int dimR, class Impl >\n+174 class DiscreteCoordFunctionInterface\n+175 {\n+176 typedef DiscreteCoordFunctionInterface<_ct,_dimR,_Impl_> This;\n+177\n+178 friend class DiscreteCoordFunction< ct, dimR, Impl >;\n+179\n+180 public:\n+181 typedef This Interface;\n+182 typedef Impl Implementation;\n+183\n+185 typedef ct ctype;\n+186\n+188 static const unsigned int dimRange = dimR;\n+189\n+191 typedef FieldVector< ctype, dimRange > RangeVector;\n+192\n+193 private:\n+194 DiscreteCoordFunctionInterface () = default;\n+195 DiscreteCoordFunctionInterface ( const This & ) = default;\n+196 DiscreteCoordFunctionInterface ( This && ) = default;\n+197 ~DiscreteCoordFunctionInterface () = default;\n+198 This &operator= ( const This & ) = default;\n+199 This &operator= ( This && ) = default;\n+200\n+201 public:\n+210 template< class HostEntity >\n+211 void evaluate ( const HostEntity &hostEntity, unsigned int corner,\n+212 RangeVector &y ) const\n+213 {\n+214 asImp().evaluate( hostEntity, corner, y );\n+215 }\n 216\n-217\n-218 template< int dim >\n-219 inline const DofSpace *\n-220 HierarchyDofNumbering<_dim_>::createEmptyDofSpace ( const MeshPointer &mesh\n-)\n+220 void adapt ()\n 221 {\n-222 int ndof[ nNodeTypes ];\n-223 for( int i = 0; i < nNodeTypes; ++i )\n-224 ndof[ i ] = 0;\n-225 std::string name = \"Empty\";\n-226 return createDofSpace( mesh, name, ndof );\n-227 }\n-228\n-229\n-230 template< int dim >\n-231 inline const DofSpace *\n-232 HierarchyDofNumbering< dim >::createDofSpace ( const MeshPointer &mesh,\n-233 const std::string &name,\n-234 const int (&ndof)[ nNodeTypes ],\n-235 const bool periodic )\n-236 {\n-237 const ALBERTA FLAGS flags\n-238 = ADM_PRESERVE_COARSE_DOFS | (periodic ? ADM_PERIODIC : 0);\n-239 return ALBERTA get_dof_space ( mesh, name.c_str(), ndof, flags );\n-240 }\n-241\n-242\n-243 template< int dim >\n-244 inline void\n-245 HierarchyDofNumbering< dim >::freeDofSpace ( const DofSpace *dofSpace )\n-246 {\n-247 ALBERTA free_fe_space( dofSpace );\n-248 }\n-249\n-250\n+222 asImp().adapt();\n+223 }\n+224\n+225 protected:\n+226 const Implementation &asImp () const\n+227 {\n+228 return static_cast< const Implementation & >( *this );\n+229 }\n+230\n+231 Implementation &asImp ()\n+232 {\n+233 return static_cast< Implementation & >( *this );\n+234 }\n+235 };\n+236\n+237\n+238\n+239 // DiscreteCoordFunction\n+240 // ---------------------\n+241 //\n+245 template< class ct, unsigned int dimR, class Impl >\n+246 class DiscreteCoordFunction\n+247 : public DiscreteCoordFunctionInterface< ct, dimR, Impl >\n+248 {\n+249 typedef DiscreteCoordFunction<_ct,_dimR,_Impl_> This;\n+250 typedef DiscreteCoordFunctionInterface<_ct,_dimR,_Impl_> Base;\n 251\n-252 // HierarchyDofNumbering::CreateDofSpace\n-253 // -------------------------------------\n+252 public:\n+253 typedef typename Base :: RangeVector RangeVector;\n 254\n-255 template< int dim >\n-256 template< int codim >\n-257 struct HierarchyDofNumbering< dim >::CreateDofSpace\n-258 {\n-259 static void apply ( const MeshPointer &mesh, const DofSpace *(&dofSpace)\n-[ dim+1 ] )\n-260 {\n-261 int ndof[ nNodeTypes ];\n-262 for( int i = 0; i < nNodeTypes; ++i )\n-263 ndof[ i ] = 0;\n-264 ndof[ CodimType< dim, codim >::value ] = 1;\n+255 protected:\n+256 DiscreteCoordFunction () = default;\n+257 DiscreteCoordFunction ( const This & ) = default;\n+258 DiscreteCoordFunction ( This && ) = default;\n+259 ~DiscreteCoordFunction () = default;\n+260 This &operator=_( const This & ) = default;\n+261 This &operator=_( This && ) = default;\n+262\n+263 void adapt ()\n+264 {}\n 265\n-266 std::string name = \"Codimension \";\n-267 name += (char)(codim + '0');\n-268\n-269 dofSpace[ codim ] = createDofSpace( mesh, name, ndof );\n-270 assert( dofSpace[ codim ] );\n-271 }\n-272 };\n+266 private:\n+267 template< class HostEntity >\n+268 void evaluate ( const HostEntity &hostEntity, unsigned int corner,\n+269 RangeVector &y ) const;\n+270 };\n+271\n+272\n 273\n-274\n-275\n-276 // HierarchyDofNumbering::CacheDofSpace\n-277 // ------------------------------------\n-278\n-279 template< int dim >\n-280 template< int codim >\n-281 struct HierarchyDofNumbering< dim >::CacheDofSpace\n+274 namespace GeoGrid\n+275 {\n+276\n+277 // isCoordFunctionInterface\n+278 // ------------------------\n+279\n+280 template< class CoordFunctionInterface >\n+281 struct isCoordFunctionInterface\n 282 {\n-283 static void apply ( const DofSpace *(&dofSpace)[ dim+1 ], Cache (&cache)\n-[ dim+1 ] )\n-284 {\n-285 assert( dofSpace[ codim ] );\n-286 const int codimtype = CodimType< dim, codim >::value;\n-287 cache[ codim ].first = dofSpace[ codim ]->mesh->node[ codimtype ];\n-288 cache[ codim ].second = dofSpace[ codim ]->admin->n0_dof[ codimtype ];\n-289 }\n-290 };\n-291\n-292 } // namespace Alberta\n-293\n-294} // namespace Dune\n-295\n-296#endif // #if HAVE_ALBERTA\n-297\n-298#endif // #ifndef DUNE_ALBERTA_DOFADMIN_HH\n-elementinfo.hh\n-provides a wrapper for ALBERTA's el_info structure\n-misc.hh\n-ALBERTA\n-#define ALBERTA\n-Definition albertaheader.hh:29\n+283 static const bool value = false;\n+284 };\n+285\n+286 template< class ct, unsigned int dimD, unsigned int dimR, class Impl >\n+287 struct isCoordFunctionInterface\n+288 < AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl > >\n+289 {\n+290 static const bool value = true;\n+291 };\n+292\n+293 template< class ct, unsigned int dimR, class Impl >\n+294 struct isCoordFunctionInterface\n+295 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >\n+296 {\n+297 static const bool value = true;\n+298 };\n+299\n+300\n+301\n+302 // isDiscreteCoordFunctionInterface\n+303 // --------------------------------\n+304\n+305 template< class CoordFunctionInterface >\n+306 struct isDiscreteCoordFunctionInterface\n+307 {\n+308 static const bool value = false;\n+309 };\n+310\n+311 template< class ct, unsigned int dimR, class Impl >\n+312 struct isDiscreteCoordFunctionInterface\n+313 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >\n+314 {\n+315 static const bool value = true;\n+316 };\n+317\n+318\n+319\n+320 // AdaptCoordFunction\n+321 // ------------------\n+322\n+323 template< class CoordFunctionInterface >\n+324 struct AdaptCoordFunction\n+325 {\n+326 static void adapt ( CoordFunctionInterface & )\n+327 {}\n+328 };\n+329\n+330 template< class ct, unsigned int dimR, class Impl >\n+331 struct AdaptCoordFunction< DiscreteCoordFunctionInterface< ct, dimR, Impl >\n+>\n+332 {\n+333 typedef DiscreteCoordFunctionInterface< ct, dimR, Impl >\n+CoordFunctionInterface;\n+334\n+335 static void adapt ( CoordFunctionInterface &coordFunction )\n+336 {\n+337 coordFunction.adapt();\n+338 }\n+339 };\n+340\n+341 } // namespace GeoGrid\n+342\n+343} // namespace Dune\n+344\n+345#endif // #ifndef DUNE_GEOGRID_COORDFUNCTION_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::Element\n-ALBERTA EL Element\n-Definition misc.hh:54\n-Dune::Alberta::DofSpace\n-ALBERTA FE_SPACE DofSpace\n-Definition misc.hh:65\n-Dune::Alberta::MeshPointer<_dimension_>\n-Dune::Alberta::DofAccess\n-Definition dofadmin.hh:36\n-Dune::Alberta::DofAccess::dimension\n-static const int dimension\n-Definition dofadmin.hh:42\n-Dune::Alberta::DofAccess::DofAccess\n-DofAccess()\n-Definition dofadmin.hh:47\n-Dune::Alberta::DofAccess::codimension\n-static const int codimension\n-Definition dofadmin.hh:43\n-Dune::Alberta::DofAccess::numSubEntities\n-static const int numSubEntities\n-Definition dofadmin.hh:40\n-Dune::Alberta::DofAccess::DofAccess\n-DofAccess(const DofSpace *dofSpace)\n-Definition dofadmin.hh:51\n-Dune::Alberta::DofAccess::operator()\n-int operator()(const Element *element, int subEntity, int i) const\n-Definition dofadmin.hh:58\n-Dune::Alberta::DofAccess::ElementInfo\n-Alberta::ElementInfo< dimension > ElementInfo\n-Definition dofadmin.hh:45\n-Dune::Alberta::HierarchyDofNumbering\n-Definition dofadmin.hh:93\n-Dune::Alberta::HierarchyDofNumbering::HierarchyDofNumbering\n-HierarchyDofNumbering()\n-Definition dofadmin.hh:114\n-Dune::Alberta::HierarchyDofNumbering::operator()\n-int operator()(const Element *element, int codim, unsigned int subEntity) const\n-Definition dofadmin.hh:127\n-Dune::Alberta::HierarchyDofNumbering::mesh\n-const MeshPointer & mesh() const\n-Definition dofadmin.hh:158\n-Dune::Alberta::HierarchyDofNumbering::create\n-void create(const MeshPointer &mesh)\n-Definition dofadmin.hh:199\n-Dune::Alberta::HierarchyDofNumbering::~HierarchyDofNumbering\n-~HierarchyDofNumbering()\n-Definition dofadmin.hh:122\n-Dune::Alberta::HierarchyDofNumbering::MeshPointer\n-Alberta::MeshPointer< dimension > MeshPointer\n-Definition dofadmin.hh:99\n-Dune::Alberta::HierarchyDofNumbering::size\n-int size(int codim) const\n-Definition dofadmin.hh:163\n-Dune::Alberta::HierarchyDofNumbering::dofSpace\n-const DofSpace * dofSpace(int codim) const\n-Definition dofadmin.hh:145\n-Dune::Alberta::HierarchyDofNumbering::ElementInfo\n-Alberta::ElementInfo< dimension > ElementInfo\n-Definition dofadmin.hh:100\n-Dune::Alberta::HierarchyDofNumbering::dimension\n-static const int dimension\n-Definition dofadmin.hh:97\n-Dune::Alberta::HierarchyDofNumbering::emptyDofSpace\n-const DofSpace * emptyDofSpace() const\n-Definition dofadmin.hh:152\n-Dune::Alberta::HierarchyDofNumbering::release\n-void release()\n-Definition dofadmin.hh:170\n-Dune::Alberta::ElementInfo<_dimension_>\n-Dune::Alberta::ElementInfo::el\n-Element * el() const\n-Definition elementinfo.hh:737\n-Dune::Alberta::NumSubEntities\n-Definition misc.hh:148\n-Dune::Alberta::CodimType\n-Definition misc.hh:192\n+Dune::AnalyticalCoordFunction\n+Derive an implementation of an analytical coordinate function from this class.\n+Definition coordfunction.hh:134\n+Dune::AnalyticalCoordFunction::DomainVector\n+Base::DomainVector DomainVector\n+Definition coordfunction.hh:139\n+Dune::AnalyticalCoordFunction::AnalyticalCoordFunction\n+AnalyticalCoordFunction()=default\n+Dune::AnalyticalCoordFunction::~AnalyticalCoordFunction\n+~AnalyticalCoordFunction()=default\n+Dune::AnalyticalCoordFunction::AnalyticalCoordFunction\n+AnalyticalCoordFunction(This &&)=default\n+Dune::AnalyticalCoordFunction::RangeVector\n+Base::RangeVector RangeVector\n+Definition coordfunction.hh:140\n+Dune::AnalyticalCoordFunction::operator=\n+This & operator=(const This &)=default\n+Dune::AnalyticalCoordFunction::AnalyticalCoordFunction\n+AnalyticalCoordFunction(const This &)=default\n+Dune::DiscreteCoordFunction\n+Derive an implementation of a discrete coordinate function from this class.\n+Definition coordfunction.hh:248\n+Dune::DiscreteCoordFunction::operator=\n+This & operator=(const This &)=default\n+Dune::DiscreteCoordFunction::adapt\n+void adapt()\n+Definition coordfunction.hh:263\n+Dune::DiscreteCoordFunction::DiscreteCoordFunction\n+DiscreteCoordFunction()=default\n+Dune::DiscreteCoordFunction::DiscreteCoordFunction\n+DiscreteCoordFunction(This &&)=default\n+Dune::DiscreteCoordFunction::~DiscreteCoordFunction\n+~DiscreteCoordFunction()=default\n+Dune::DiscreteCoordFunction::DiscreteCoordFunction\n+DiscreteCoordFunction(const This &)=default\n+Dune::DiscreteCoordFunction::RangeVector\n+Base::RangeVector RangeVector\n+Definition coordfunction.hh:253\n+Dune::AnalyticalCoordFunctionInterface\n+Interface class for using an analytical function to define the geometry of a\n+Dune::GeometryGrid....\n+Definition coordfunction.hh:44\n+Dune::AnalyticalCoordFunctionInterface::Implementation\n+Impl Implementation\n+Definition coordfunction.hh:51\n+Dune::AnalyticalCoordFunctionInterface::RangeVector\n+FieldVector< ctype, dimRange > RangeVector\n+range vector for the evaluate method\n+Definition coordfunction.hh:64\n+Dune::AnalyticalCoordFunctionInterface::evaluate\n+void evaluate(const DomainVector &x, RangeVector &y) const\n+evaluate method for global mapping\n+Dune::AnalyticalCoordFunctionInterface::dimRange\n+static const unsigned int dimRange\n+dimension of the range vector\n+Definition coordfunction.hh:59\n+Dune::AnalyticalCoordFunctionInterface::ctype\n+ct ctype\n+field type of the coordinate vector\n+Definition coordfunction.hh:54\n+Dune::AnalyticalCoordFunctionInterface::dimDomain\n+static const unsigned int dimDomain\n+dimension of the range vector (dimensionworld of host grid)\n+Definition coordfunction.hh:57\n+Dune::AnalyticalCoordFunctionInterface::asImp\n+const Implementation & asImp() const\n+Definition coordfunction.hh:113\n+Dune::AnalyticalCoordFunctionInterface::Interface\n+This Interface\n+Definition coordfunction.hh:50\n+Dune::AnalyticalCoordFunctionInterface::asImp\n+Implementation & asImp()\n+Definition coordfunction.hh:118\n+Dune::AnalyticalCoordFunctionInterface::DomainVector\n+FieldVector< ctype, dimDomain > DomainVector\n+domain vector for the evaluate method\n+Definition coordfunction.hh:62\n+Dune::DiscreteCoordFunctionInterface\n+Interface class for using a discrete function to define the geometry of a\n+Dune::GeometryGrid....\n+Definition coordfunction.hh:175\n+Dune::DiscreteCoordFunctionInterface::dimRange\n+static const unsigned int dimRange\n+dimension of the range vector\n+Definition coordfunction.hh:188\n+Dune::DiscreteCoordFunctionInterface::evaluate\n+void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector\n+&y) const\n+evaluate method\n+Definition coordfunction.hh:211\n+Dune::DiscreteCoordFunctionInterface::asImp\n+Implementation & asImp()\n+Definition coordfunction.hh:231\n+Dune::DiscreteCoordFunctionInterface::ctype\n+ct ctype\n+field type of the coordinate vector\n+Definition coordfunction.hh:185\n+Dune::DiscreteCoordFunctionInterface::adapt\n+void adapt()\n+method called from grid.adapt() method to allow adaptation of the discrete\n+coordinate function\n+Definition coordfunction.hh:220\n+Dune::DiscreteCoordFunctionInterface::RangeVector\n+FieldVector< ctype, dimRange > RangeVector\n+range vector for the evaluate method\n+Definition coordfunction.hh:191\n+Dune::DiscreteCoordFunctionInterface::asImp\n+const Implementation & asImp() const\n+Definition coordfunction.hh:226\n+Dune::DiscreteCoordFunctionInterface::Implementation\n+Impl Implementation\n+Definition coordfunction.hh:182\n+Dune::DiscreteCoordFunctionInterface::Interface\n+This Interface\n+Definition coordfunction.hh:181\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00620.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00359.html", "comments": ["Files 73% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: elementinfo.hh File Reference\n+dune-grid: mcmgmapper.hh File Reference\n \n \n \n \n \n \n \n@@ -65,57 +65,79 @@\n
    \n
    \n
    \n \n \n \n \n
    \n \n-
    elementinfo.hh File Reference
    \n+Namespaces |\n+Typedefs |\n+Functions
    \n+
    mcmgmapper.hh File Reference
    \n \n
    \n \n-

    provides a wrapper for ALBERTA's el_info structure \n+

    Mapper for multiple codim and multiple geometry types. \n More...

    \n-
    #include <cassert>
    \n-#include <vector>
    \n-#include <utility>
    \n-#include <dune/grid/albertagrid/geometrycache.hh>
    \n-#include <dune/grid/albertagrid/macroelement.hh>
    \n+
    #include <functional>
    \n+#include <iostream>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/rangeutilities.hh>
    \n+#include <dune/geometry/dimension.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/geometry/typeindex.hh>
    \n+#include "mapper.hh"
    \n
    \n-

    Go to the source code of this file.

    \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::Alberta::ElementInfo< dim >
     
    struct  Dune::Alberta::ElementInfo< dim >::Instance
     
    class  Dune::Alberta::ElementInfo< dim >::Stack
     
    struct  Dune::Alberta::ElementInfo< dim >::Seed
    class  Dune::MultipleCodimMultipleGeomTypeMapper< GV >
     Implementation class for a multiple codim and multiple geometry type mapper. More...
     
    \n \n \n \n \n-\n-\n+

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    namespace  Dune::Alberta
     
    \n+\n+\n+\n+\n+

    \n+Typedefs

    using Dune::MCMGLayout = std::function< size_t(GeometryType, int)>
     layout function for MultipleCodimMultipleGeomTypeMapper
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    template<int codim>
    MCMGLayout Dune::mcmgLayout (Codim< codim >)
     layout for entities of codimension codim
     
    template<int dim>
    MCMGLayout Dune::mcmgLayout (Dim< dim >)
     layout for entities of dimension dim
     
    MCMGLayout Dune::mcmgElementLayout ()
     layout for elements (codim-0 entities)
     
    MCMGLayout Dune::mcmgVertexLayout ()
     layout for vertices (dim-0 entities)
     
    \n

    Detailed Description

    \n-

    provides a wrapper for ALBERTA's el_info structure

    \n-
    Author
    Martin Nolte
    \n+

    Mapper for multiple codim and multiple geometry types.

    \n+
    Author
    Peter Bastian
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,37 +1,54 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-Classes | Namespaces\n-elementinfo.hh File Reference\n-provides a wrapper for ALBERTA's el_info structure More...\n-#include \n-#include \n-#include \n-#include \n-#include \n+ * common\n+Classes | Namespaces | Typedefs | Functions\n+mcmgmapper.hh File Reference\n+Mapper for multiple codim and multiple geometry types. More...\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \"mapper.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0 Dune::Alberta::ElementInfo<_dim_>\n-\u00a0\n-struct \u00a0 Dune::Alberta::ElementInfo<_dim_>::Instance\n-\u00a0\n- class \u00a0 Dune::Alberta::ElementInfo<_dim_>::Stack\n-\u00a0\n-struct \u00a0 Dune::Alberta::ElementInfo<_dim_>::Seed\n+class \u00a0 Dune::MultipleCodimMultipleGeomTypeMapper<_GV_>\n+\u00a0 Implementation class for a multiple codim and multiple geometry type\n+ mapper. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-namespace \u00a0 Dune::Alberta\n+Typedefs\n+using\u00a0 Dune::MCMGLayout = std::function< size_t(GeometryType, int)>\n+\u00a0 layout function for MultipleCodimMultipleGeomTypeMapper\n+\u00a0\n+Functions\n+template\n+MCMGLayout\u00a0 Dune::mcmgLayout (Codim< codim >)\n+\u00a0 layout for entities of codimension codim\n+\u00a0\n+template\n+MCMGLayout\u00a0 Dune::mcmgLayout (Dim< dim >)\n+\u00a0 layout for entities of dimension dim\n+\u00a0\n+MCMGLayout\u00a0 Dune::mcmgElementLayout ()\n+\u00a0 layout for elements (codim-0 entities)\n+\u00a0\n+MCMGLayout\u00a0 Dune::mcmgVertexLayout ()\n+\u00a0 layout for vertices (dim-0 entities)\n \u00a0\n ***** Detailed Description *****\n-provides a wrapper for ALBERTA's el_info structure\n+Mapper for multiple codim and multiple geometry types.\n Author\n- Martin Nolte\n+ Peter Bastian\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00620_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00683_source.html", "comments": ["Files 75% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: elementinfo.hh Source File\n+dune-grid: misc.hh Source File\n \n \n \n \n \n \n \n@@ -74,1228 +74,870 @@\n \n \n
    \n
    \n-
    elementinfo.hh
    \n+
    misc.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_ELEMENTINFO_HH
    \n-
    6#define DUNE_ALBERTA_ELEMENTINFO_HH
    \n+
    5#ifndef DUNE_ALBERTA_MISC_HH
    \n+
    6#define DUNE_ALBERTA_MISC_HH
    \n
    7
    \n-
    13#include <cassert>
    \n-
    14#include <vector>
    \n-
    15#include <utility>
    \n+
    8#include <cassert>
    \n+
    9#include <utility>
    \n+
    10
    \n+
    11#include <dune/common/exceptions.hh>
    \n+
    12#include <dune/common/hybridutilities.hh>
    \n+
    13#include <dune/common/typetraits.hh>
    \n+
    14
    \n+\n
    16
    \n-\n-\n-
    19
    \n-
    20#if HAVE_ALBERTA
    \n-
    21
    \n-
    22namespace Dune
    \n-
    23{
    \n-
    24
    \n-
    25 namespace Alberta
    \n-
    26 {
    \n-
    27
    \n-
    28 // External Forward Declarations
    \n-
    29 // -----------------------------
    \n-
    30
    \n-
    31 template< int dim >
    \n-
    32 class MeshPointer;
    \n+
    17#if HAVE_ALBERTA
    \n+
    18
    \n+
    19// should the coordinates be cached in a vector (required for ALBERTA 2.0)?
    \n+
    20#ifndef DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    21#define DUNE_ALBERTA_CACHE_COORDINATES 1
    \n+
    22#endif
    \n+
    23
    \n+
    24namespace Dune
    \n+
    25{
    \n+
    26
    \n+
    27 // Exceptions
    \n+
    28 // ----------
    \n+
    29
    \n+
    \n+\n+
    31 : public Exception
    \n+
    32 {};
    \n+
    \n
    33
    \n-
    34 struct BasicNodeProjection;
    \n-
    35
    \n-
    36
    \n+
    \n+\n+
    35 : public IOError
    \n+
    36 {};
    \n+
    \n
    37
    \n-
    38 // ElementInfo
    \n-
    39 // -----------
    \n-
    40
    \n-
    41 template< int dim >
    \n-
    \n-\n-
    43 {
    \n-
    44 struct Instance;
    \n-
    45 class Stack;
    \n-
    46
    \n-
    47 template< int >
    \n-
    48 struct Library;
    \n-
    49
    \n-
    50 typedef Instance *InstancePtr;
    \n-
    51
    \n-
    52 public:
    \n-
    53 static const int dimension = dim;
    \n-
    54
    \n-\n-\n-
    57
    \n-\n-\n-\n-
    61
    \n-
    62 static const int maxNeighbors = N_NEIGH_MAX;
    \n-
    63
    \n-
    64 static const int maxLevelNeighbors = Library< dimWorld >::maxLevelNeighbors;
    \n-
    65
    \n-
    66#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n-\n-
    68#endif
    \n-
    69
    \n-
    70 struct Seed;
    \n+
    38
    \n+
    39
    \n+
    40 namespace Alberta
    \n+
    41 {
    \n+
    42
    \n+
    43 // Import Types
    \n+
    44 // ------------
    \n+
    45
    \n+
    46 static const int dimWorld = DIM_OF_WORLD;
    \n+
    47
    \n+
    48 typedef ALBERTA REAL Real;
    \n+
    49 typedef ALBERTA REAL_B LocalVector; // in barycentric coordinates
    \n+
    50 typedef ALBERTA REAL_D GlobalVector;
    \n+
    51 typedef ALBERTA REAL_DD GlobalMatrix;
    \n+
    52 typedef ALBERTA AFF_TRAFO AffineTransformation;
    \n+
    53 typedef ALBERTA MESH Mesh;
    \n+
    54 typedef ALBERTA EL Element;
    \n+
    55
    \n+
    56 static const int meshRefined = MESH_REFINED;
    \n+
    57 static const int meshCoarsened = MESH_COARSENED;
    \n+
    58
    \n+
    59 static const int InteriorBoundary = INTERIOR;
    \n+
    60 static const int DirichletBoundary = DIRICHLET;
    \n+
    61 typedef ALBERTA BNDRY_TYPE BoundaryId;
    \n+
    62
    \n+
    63 typedef U_CHAR ElementType;
    \n+
    64
    \n+
    65 typedef ALBERTA FE_SPACE DofSpace;
    \n+
    66
    \n+
    67
    \n+
    68
    \n+
    69 // Memory Manipulation Functions
    \n+
    70 // -----------------------------
    \n
    71
    \n-
    72 private:
    \n-
    73 explicit ElementInfo ( const InstancePtr &instance );
    \n-
    74
    \n-
    75 public:
    \n-
    \n-\n-
    \n-\n-
    78 typename FillFlags::Flags fillFlags = FillFlags::standard );
    \n+
    72 template< class Data >
    \n+
    \n+
    73 inline Data *memAlloc ( size_t size )
    \n+
    74 {
    \n+
    75 return MEM_ALLOC( size, Data );
    \n+
    76 }
    \n+
    \n+
    77
    \n+
    78 template< class Data >
    \n
    \n-
    79 ElementInfo ( const MeshPointer &mesh, const Seed &seed,
    \n-
    80 typename FillFlags::Flags fillFlags = FillFlags::standard );
    \n-
    \n-
    81 ElementInfo ( const ElementInfo &other );
    \n-
    \n-\n+
    79 inline Data *memCAlloc ( size_t size )
    \n+
    80 {
    \n+
    81 return MEM_CALLOC( size, Data );
    \n+
    82 }
    \n+
    \n
    83
    \n-
    \n-\n-
    85
    \n-
    \n-\n-
    \n-\n-
    88
    \n-
    89 explicit operator bool () const { return (instance_ != null()); }
    \n-
    90
    \n+
    84 template< class Data >
    \n+
    \n+
    85 inline Data *memReAlloc ( Data *ptr, size_t oldSize, size_t newSize )
    \n+
    86 {
    \n+
    87 return MEM_REALLOC( ptr, oldSize, newSize, Data );
    \n+
    88 }
    \n+
    \n+
    89
    \n+
    90 template< class Data >
    \n
    \n-
    91 bool operator== ( const ElementInfo &other ) const;
    \n-
    \n-
    92 bool operator!= ( const ElementInfo &other ) const;
    \n-
    93
    \n-
    \n-
    94 const MacroElement &macroElement () const;
    \n-
    \n-\n-
    \n-
    96 int indexInFather () const;
    \n-
    \n-
    97 ElementInfo child ( int i ) const;
    \n-
    \n-
    98 bool isLeaf () const;
    \n-
    99
    \n-
    \n-
    100 Seed seed () const;
    \n-
    101
    \n-
    \n-\n-
    103
    \n-
    \n-
    104 bool mightVanish () const;
    \n-
    105
    \n-
    \n-
    106 int level () const;
    \n-
    107 // see ALBERTA documentation for definition of element type
    \n-
    108 // values are 0, 1, 2
    \n-
    \n-
    109 int type () const;
    \n-
    110
    \n-
    \n-
    111 int getMark () const;
    \n-
    \n-
    112 void setMark ( int refCount ) const;
    \n-
    113
    \n-
    \n-
    114 bool hasLeafNeighbor ( const int face ) const;
    \n-
    \n-
    115 ElementInfo leafNeighbor ( const int face ) const;
    \n-
    116
    \n-
    117 /* obtain all level neighbors of a face
    \n-
    118 *
    \n-
    119 * param[in] face face for which the neighbors are desired
    \n-
    120 * param[out] neighbor array storing the neighbors
    \n-
    121 * param[out] faceInNeighbor array storing the faces in neighbor
    \n-
    122 * (-1, if this neighbor does not exist)
    \n-
    123 *
    \n-
    124 * returns (potential) number of neighbors (i.e., the number of valid
    \n-
    125 * entries in the output arrays
    \n-
    126 */
    \n-
    \n-
    127 int levelNeighbors ( const int face, ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const;
    \n-
    128
    \n-
    129 template< int codim >
    \n-
    \n-
    130 int twist ( int subEntity ) const;
    \n+
    91 inline void memFree ( Data *ptr, size_t size )
    \n+
    92 {
    \n+
    93 return MEM_FREE( ptr, size, Data );
    \n+
    94 }
    \n+
    \n+
    95
    \n+
    96
    \n+
    97
    \n+
    98 // GlobalSpace
    \n+
    99 // -----------
    \n+
    100
    \n+
    \n+\n+
    102 {
    \n+
    103 typedef GlobalSpace This;
    \n+
    104
    \n+
    105 public:
    \n+\n+\n+
    108
    \n+
    109 private:
    \n+
    110 Matrix identityMatrix_;
    \n+
    111 Vector nullVector_;
    \n+
    112
    \n+
    113 GlobalSpace ()
    \n+
    114 {
    \n+
    115 for( int i = 0; i < dimWorld; ++i )
    \n+
    116 {
    \n+
    117 for( int j = 0; j < dimWorld; ++j )
    \n+
    118 identityMatrix_[ i ][ j ] = Real( 0 );
    \n+
    119 identityMatrix_[ i ][ i ] = Real( 1 );
    \n+
    120 nullVector_[ i ] = Real( 0 );
    \n+
    121 }
    \n+
    122 }
    \n+
    123
    \n+
    124 static This &instance ()
    \n+
    125 {
    \n+
    126 static This theInstance;
    \n+
    127 return theInstance;
    \n+
    128 }
    \n+
    129
    \n+
    130 public:
    \n
    \n-
    131 int twistInNeighbor ( int face ) const;
    \n-
    \n-
    132 bool isBoundary ( int face ) const;
    \n-
    \n-
    133 int boundaryId ( int face ) const;
    \n-
    \n-\n-
    \n-\n-
    136
    \n-
    \n-
    137 bool hasCoordinates () const;
    \n-
    \n-
    138 const GlobalVector &coordinate ( int vertex ) const;
    \n-
    139#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    \n-\n-
    141 {
    \n-
    142 return GeometryCache( instance_->geometryCache, instance_->elInfo );
    \n-
    143 }
    \n-
    \n-
    144#endif
    \n-
    145
    \n-
    146 template< class Functor >
    \n-
    \n-
    147 void hierarchicTraverse ( Functor &functor ) const;
    \n-
    148
    \n-
    149 template< class Functor >
    \n-
    \n-
    150 void leafTraverse ( Functor &functor ) const;
    \n-
    151
    \n-
    \n-
    152 const Element *element () const;
    \n-
    \n-
    153 const Element *neighbor ( int face ) const;
    \n-
    \n-
    154 Element *el () const;
    \n-
    \n-
    155 ALBERTA EL_INFO &elInfo () const;
    \n-
    156
    \n-
    157 static ElementInfo
    \n-
    \n-\n-
    159 const Element *element, int level, int type = 0 );
    \n-
    \n-
    160 static ElementInfo createFake ( const ALBERTA EL_INFO &elInfo );
    \n+
    131 static const Matrix &identityMatrix ()
    \n+
    132 {
    \n+
    133 return instance().identityMatrix_;
    \n+
    134 }
    \n+
    \n+
    135
    \n+
    \n+
    136 static const Vector &nullVector ()
    \n+
    137 {
    \n+
    138 return instance().nullVector_;
    \n+
    139 }
    \n+
    \n+
    140 };
    \n+
    \n+
    141
    \n+
    142
    \n+
    143
    \n+
    144 // NumSubEntities
    \n+
    145 // --------------
    \n+
    146
    \n+
    147 template< int dim, int codim >
    \n+\n+
    149
    \n+
    150 template< int dim >
    \n+
    \n+
    151 struct NumSubEntities< dim, 0 >
    \n+
    152 {
    \n+
    153 static const int value = 1;
    \n+
    154 };
    \n+
    \n+
    155
    \n+
    156 template< int dim >
    \n+
    \n+
    157 struct NumSubEntities< dim, dim >
    \n+
    158 {
    \n+
    159 static const int value = dim+1;
    \n+
    160 };
    \n+
    \n
    161
    \n-
    162 private:
    \n-
    163 static bool isLeaf ( Element *element );
    \n-
    164 static bool mightVanish ( Element *element, int depth );
    \n-
    165
    \n-
    166 static void fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO &elInfo );
    \n-
    167 static void fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA EL_INFO &elInfo );
    \n-
    168
    \n-
    169 void addReference () const;
    \n-
    170 void removeReference () const;
    \n-
    171
    \n-
    172 static InstancePtr null ();
    \n-
    173 static Stack &stack ();
    \n-
    174
    \n-
    175 InstancePtr instance_;
    \n-
    176 };
    \n-
    177
    \n-
    178
    \n-
    179
    \n-
    180 // ElementInfo::Instance
    \n-
    181 // ---------------------
    \n-
    182
    \n-
    183 template< int dim >
    \n-
    \n-
    184 struct ElementInfo< dim >::Instance
    \n-
    185 {
    \n-\n-
    187 unsigned int refCount;
    \n-
    188
    \n-
    \n-\n-
    190 {
    \n-
    191 return parent_;
    \n-
    192 }
    \n+
    162 template<>
    \n+
    \n+
    163 struct NumSubEntities< 0, 0 >
    \n+
    164 {
    \n+
    165 static const int value = 1;
    \n+
    166 };
    \n+
    \n+
    167
    \n+
    168 template<>
    \n+
    \n+
    169 struct NumSubEntities< 2, 1 >
    \n+
    170 {
    \n+
    171 static const int value = 3;
    \n+
    172 };
    \n+
    \n+
    173
    \n+
    174 template<>
    \n+
    \n+
    175 struct NumSubEntities< 3, 1 >
    \n+
    176 {
    \n+
    177 static const int value = 4;
    \n+
    178 };
    \n
    \n+
    179
    \n+
    180 template<>
    \n+
    \n+
    181 struct NumSubEntities< 3, 2 >
    \n+
    182 {
    \n+
    183 static const int value = 6;
    \n+
    184 };
    \n+
    \n+
    185
    \n+
    186
    \n+
    187
    \n+
    188 // CodimType
    \n+
    189 // ---------
    \n+
    190
    \n+
    191 template< int dim, int codim >
    \n+
    192 struct CodimType;
    \n
    193
    \n-
    194 private:
    \n-
    195 InstancePtr parent_;
    \n-
    196
    \n-
    197#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    198 public:
    \n-\n-
    200#endif
    \n-
    201 };
    \n-
    \n-
    202
    \n-
    203
    \n-
    204
    \n-
    205 // ElementInfo::Stack
    \n-
    206 // ------------------
    \n-
    207
    \n-
    208 template< int dim >
    \n-
    \n-
    209 class ElementInfo< dim >::Stack
    \n-
    210 {
    \n-
    211 InstancePtr top_;
    \n-
    212 Instance null_;
    \n-
    213
    \n-
    214 public:
    \n-
    \n-
    215 Stack ();
    \n-
    \n-
    216 ~Stack ();
    \n+
    194 template< int dim >
    \n+
    \n+
    195 struct CodimType< dim, 0 >
    \n+
    196 {
    \n+
    197 static const int value = CENTER;
    \n+
    198 };
    \n+
    \n+
    199
    \n+
    200 template< int dim >
    \n+
    \n+
    201 struct CodimType< dim, dim >
    \n+
    202 {
    \n+
    203 static const int value = VERTEX;
    \n+
    204 };
    \n+
    \n+
    205
    \n+
    206 template<>
    \n+
    \n+
    207 struct CodimType< 2, 1 >
    \n+
    208 {
    \n+
    209 static const int value = EDGE;
    \n+
    210 };
    \n+
    \n+
    211
    \n+
    212 template<>
    \n+
    \n+
    213 struct CodimType< 3, 1 >
    \n+
    214 {
    \n+
    215 static const int value = FACE;
    \n+
    216 };
    \n+
    \n
    217
    \n-
    \n-
    218 InstancePtr allocate ();
    \n-
    \n-
    219 void release ( InstancePtr &p );
    \n-
    \n-
    220 InstancePtr null ();
    \n-
    221 };
    \n-
    222
    \n+
    218 template<>
    \n+
    \n+
    219 struct CodimType< 3, 2 >
    \n+
    220 {
    \n+
    221 static const int value = EDGE;
    \n+
    222 };
    \n+
    \n
    223
    \n
    224
    \n-
    225 // ElementInfo::Library
    \n-
    226 // --------------------
    \n-
    227
    \n-
    228 template< int dim >
    \n-
    229 template< int >
    \n-
    230 struct ElementInfo< dim >::Library
    \n+
    225
    \n+
    226 // FillFlags
    \n+
    227 // ---------
    \n+
    228
    \n+
    229 template< int dim >
    \n+
    \n+\n
    231 {
    \n-\n+
    232 typedef ALBERTA FLAGS Flags;
    \n
    233
    \n-
    234 static const int maxLevelNeighbors = (1 << (dim-1));
    \n+
    234 static const Flags nothing = FILL_NOTHING;
    \n
    235
    \n-
    236 static int
    \n-
    237 leafNeighbor ( const ElementInfo &element, const int face, ElementInfo &neighbor );
    \n-
    238
    \n-
    239 static int
    \n-
    240 levelNeighbors ( const ElementInfo &element, const int face,
    \n-
    241 ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] );
    \n-
    242
    \n-
    243 private:
    \n-
    244 static int
    \n-
    245 macroNeighbor ( const ElementInfo &element, const int face, ElementInfo &neighbor );
    \n-
    246 };
    \n+
    236 static const Flags coords = FILL_COORDS;
    \n+
    237
    \n+
    238 static const Flags neighbor = FILL_NEIGH;
    \n+
    239
    \n+
    240 static const Flags orientation = (dim == 3 ? FILL_ORIENTATION : FILL_NOTHING);
    \n+
    241
    \n+
    242 static const Flags projection = FILL_PROJECTION;
    \n+
    243
    \n+
    244 static const Flags elementType = FILL_NOTHING;
    \n+
    245
    \n+
    246 static const Flags boundaryId = FILL_MACRO_WALLS;
    \n
    247
    \n-
    248
    \n+
    248 static const Flags nonPeriodic = FILL_NON_PERIODIC;
    \n
    249
    \n-
    250 // ElementInfo::Seed
    \n-
    251 // -----------------
    \n+\n+\n
    252
    \n-
    253 template< int dim >
    \n-
    \n-
    254 struct ElementInfo< dim >::Seed
    \n-
    255 {
    \n-
    \n-\n-
    257 : macroIndex_( -1 ), level_( 0 ), path_( 0 )
    \n-
    258 {}
    \n-
    \n-
    259
    \n-
    \n-
    260 Seed ( const int macroIndex, const int level, const unsigned long path )
    \n-
    261 : macroIndex_( macroIndex ), level_( level ), path_( path )
    \n-
    262 {}
    \n+
    253 static const Flags standardWithCoords = all & ~nonPeriodic & ~projection;
    \n+
    254
    \n+
    255#if DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    256 static const Flags standard = standardWithCoords & ~coords;
    \n+
    257#else
    \n+\n+
    259#endif
    \n+
    260 };
    \n
    \n+
    261
    \n+
    262
    \n
    263
    \n-
    \n-
    264 bool operator== ( const Seed &other ) const
    \n-
    265 {
    \n-
    266 return (macroIndex() == other.macroIndex()) && (level() == other.level()) && (path() == other.path());
    \n-
    267 }
    \n-
    \n-
    268
    \n-
    \n-
    269 bool operator< ( const Seed &other ) const
    \n-
    270 {
    \n-
    271 const bool ml = (macroIndex() < other.macroIndex());
    \n-
    272 const bool me = (macroIndex() == other.macroIndex());
    \n-
    273 const bool ll = (level() < other.level());
    \n-
    274 const bool le = (level() == other.level());
    \n-
    275 const bool pl = (path() < other.path());
    \n-
    276 return ml | (me & (ll | (le & pl)));
    \n-
    277 }
    \n+
    264 // RefinementEdge
    \n+
    265 // --------------
    \n+
    266
    \n+
    267 template< int dim >
    \n+
    \n+\n+
    269 {
    \n+
    270 static const int value = 0;
    \n+
    271 };
    \n+
    \n+
    272
    \n+
    273 template<>
    \n+
    \n+
    274 struct RefinementEdge< 2 >
    \n+
    275 {
    \n+
    276 static const int value = 2;
    \n+
    277 };
    \n
    \n
    278
    \n-
    279 bool operator!= ( const Seed &other ) const { return !(*this == other); }
    \n-
    280 bool operator<= ( const Seed &other ) const { return !(other < *this); }
    \n-
    281 bool operator> ( const Seed &other ) const { return (other < *this); }
    \n-
    282 bool operator>= ( const Seed &other ) const { return !(*this < other); }
    \n+
    279
    \n+
    280
    \n+
    281 // Dune2AlbertaNumbering
    \n+
    282 // ---------------------
    \n
    283
    \n-
    284 bool isValid ( ) const { return macroIndex_ != -1; }
    \n-
    285
    \n-
    286 int macroIndex () const { return macroIndex_; }
    \n-
    287 int level () const { return level_; }
    \n-
    288 unsigned long path () const { return path_; }
    \n-
    289
    \n-
    290 private:
    \n-
    291 int macroIndex_;
    \n-
    292 int level_;
    \n-
    293 unsigned long path_;
    \n-
    294 };
    \n-
    \n-
    295
    \n-
    296
    \n-
    297
    \n-
    298 // Implementation of ElementInfo
    \n-
    299 // -----------------------------
    \n-
    300
    \n-
    301 template< int dim >
    \n-
    302 inline ElementInfo< dim >::ElementInfo ( const InstancePtr &instance )
    \n-
    303 : instance_( instance )
    \n-
    304 {
    \n-
    305 addReference();
    \n-
    306 }
    \n+
    284 template< int dim, int codim >
    \n+
    \n+\n+
    286 {
    \n+
    \n+
    287 static int apply ( const int i )
    \n+
    288 {
    \n+
    289 assert( (i >= 0) && (i < NumSubEntities< dim, codim >::value) );
    \n+
    290 return i;
    \n+
    291 }
    \n+
    \n+
    292 };
    \n+
    \n+
    293
    \n+
    294 template<>
    \n+
    \n+\n+
    296 {
    \n+
    297 static const int numSubEntities = NumSubEntities< 3, 2 >::value;
    \n+
    298
    \n+
    \n+
    299 static int apply ( const int i )
    \n+
    300 {
    \n+
    301 assert( (i >= 0) && (i < numSubEntities) );
    \n+
    302 static int dune2alberta[ numSubEntities ] = { 0, 3, 1, 2, 4, 5 };
    \n+
    303 return dune2alberta[ i ];
    \n+
    304 }
    \n+
    \n+
    305 };
    \n+
    \n+
    306
    \n
    307
    \n
    308
    \n-
    309 template< int dim >
    \n-
    \n-\n-
    311 : instance_( null() )
    \n-
    312 {
    \n-
    313 addReference();
    \n-
    314 }
    \n-
    \n-
    315
    \n-
    316
    \n-
    317 template< int dim >
    \n-
    318 inline ElementInfo< dim >
    \n-
    \n-
    319 ::ElementInfo ( const MeshPointer &mesh, const MacroElement &macroElement,
    \n-
    320 typename FillFlags::Flags fillFlags )
    \n-
    321 {
    \n-
    322 instance_ = stack().allocate();
    \n-
    323 instance_->parent() = null();
    \n-
    324 ++(instance_->parent()->refCount);
    \n-
    325
    \n-
    326 addReference();
    \n-
    327
    \n-
    328 elInfo().fill_flag = fillFlags;
    \n-
    329
    \n-
    330 // Alberta fills opp_vertex only if there is a neighbor
    \n-
    331 for( int k = 0; k < maxNeighbors; ++k )
    \n-
    332 elInfo().opp_vertex[ k ] = -1;
    \n-
    333
    \n-
    334 fill( mesh, &macroElement, elInfo() );
    \n-
    335 }
    \n-
    \n-
    336
    \n-
    337
    \n-
    338 template< int dim >
    \n-
    339 inline ElementInfo< dim >
    \n-
    \n-
    340 ::ElementInfo ( const MeshPointer &mesh, const Seed &seed,
    \n-
    341 typename FillFlags::Flags fillFlags )
    \n-
    342 {
    \n-
    343 instance_ = stack().allocate();
    \n-
    344 instance_->parent() = null();
    \n-
    345 ++(instance_->parent()->refCount);
    \n+
    309 // Generic2AlbertaNumbering
    \n+
    310 // ------------------------
    \n+
    311
    \n+
    312 template< int dim, int codim >
    \n+
    \n+\n+
    314 {
    \n+
    \n+
    315 static int apply ( const int i )
    \n+
    316 {
    \n+
    317 assert( (i >= 0) && (i < NumSubEntities< dim, codim >::value) );
    \n+
    318 return i;
    \n+
    319 }
    \n+
    \n+
    320 };
    \n+
    \n+
    321
    \n+
    322 template< int dim >
    \n+
    \n+\n+
    324 {
    \n+
    \n+
    325 static int apply ( const int i )
    \n+
    326 {
    \n+
    327 assert( (i >= 0) && (i < NumSubEntities< dim, 1 >::value) );
    \n+
    328 return dim - i;
    \n+
    329 }
    \n+
    \n+
    330 };
    \n+
    \n+
    331
    \n+
    332 template<>
    \n+
    \n+\n+
    334 {
    \n+
    \n+
    335 static int apply ( const int i )
    \n+
    336 {
    \n+
    337 assert( (i >= 0) && (i < NumSubEntities< 1, 1 >::value) );
    \n+
    338 return i;
    \n+
    339 }
    \n+
    \n+
    340 };
    \n+
    \n+
    341
    \n+
    342 template<>
    \n+
    \n+\n+
    344 {
    \n+
    345 static const int numSubEntities = NumSubEntities< 3, 2 >::value;
    \n
    346
    \n-
    347 addReference();
    \n-
    348
    \n-
    349 // fill in macro element info
    \n-
    350 elInfo().fill_flag = fillFlags;
    \n-
    351
    \n-
    352 // Alberta fills opp_vertex only if there is a neighbor
    \n-
    353 for( int k = 0; k < maxNeighbors; ++k )
    \n-
    354 elInfo().opp_vertex[ k ] = -1;
    \n+
    \n+
    347 static int apply ( const int i )
    \n+
    348 {
    \n+
    349 assert( (i >= 0) && (i < numSubEntities) );
    \n+
    350 static int generic2alberta[ numSubEntities ] = { 0, 1, 3, 2, 4, 5 };
    \n+
    351 return generic2alberta[ i ];
    \n+
    352 }
    \n+
    \n+
    353 };
    \n+
    \n+
    354
    \n
    355
    \n-
    356 fill( mesh, ((Mesh *)mesh)->macro_els + seed.macroIndex(), elInfo() );
    \n-
    357
    \n-
    358 // traverse the seed's path
    \n-
    359 unsigned long path = seed.path();
    \n-
    360 for( int i = 0; i < seed.level(); ++i )
    \n-
    361 {
    \n-
    362 InstancePtr child = stack().allocate();
    \n-
    363 child->parent() = instance_;
    \n+
    356
    \n+
    357 // NumberingMap
    \n+
    358 // ------------
    \n+
    359
    \n+
    360 template< int dim, template< int, int > class Numbering = Generic2AlbertaNumbering >
    \n+
    \n+\n+
    362 {
    \n+\n
    364
    \n-
    365 // Alberta fills opp_vertex only if there is a neighbor
    \n-
    366 for( int k = 0; k < maxNeighbors; ++k )
    \n-
    367 child->elInfo.opp_vertex[ k ] = -2;
    \n-
    368
    \n-
    369 fill( path & 1, elInfo(), child->elInfo );
    \n-
    370
    \n-
    371 instance_ = child;
    \n-
    372 addReference();
    \n-
    373
    \n-
    374 path = path >> 1;
    \n-
    375 }
    \n-
    376
    \n-
    377 assert( this->seed() == seed );
    \n-
    378 }
    \n+
    365 template< int codim >
    \n+
    366 struct Initialize;
    \n+
    367
    \n+
    368 int *dune2alberta_[ dim+1 ];
    \n+
    369 int *alberta2dune_[ dim+1 ];
    \n+
    370 int numSubEntities_[ dim+1 ];
    \n+
    371
    \n+
    372 NumberingMap ( const This & );
    \n+
    373 This &operator= ( const This & );
    \n+
    374
    \n+
    375 public:
    \n+
    \n+\n+
    377 {
    \n+
    378 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ Initialize< i >::apply( *this ); } );
    \n+
    379 }
    \n
    \n-
    379
    \n
    380
    \n-
    381 template< int dim >
    \n-
    \n-\n-
    383 : instance_( other.instance_ )
    \n-
    384 {
    \n-
    385 addReference();
    \n-
    386 }
    \n-
    \n-
    387
    \n-
    388 template< int dim >
    \n-
    \n-\n-
    390 : instance_( NULL )
    \n-
    391 {
    \n-
    392 using std::swap;
    \n-
    393 swap( instance_, other.instance_ );
    \n-
    394 }
    \n+
    \n+\n+
    382 {
    \n+
    383 for( int codim = 0; codim <= dim; ++codim )
    \n+
    384 {
    \n+
    385 delete[]( dune2alberta_[ codim ] );
    \n+
    386 delete[]( alberta2dune_[ codim ] );
    \n+
    387 }
    \n+
    388 }
    \n+
    \n+
    389
    \n+
    \n+
    390 int dune2alberta ( int codim, int i ) const
    \n+
    391 {
    \n+
    392 assert( (codim >= 0) && (codim <= dim) );
    \n+
    393 assert( (i >= 0) && (i < numSubEntities( codim )) );
    \n+
    394 return dune2alberta_[ codim ][ i ];
    \n+
    395 }
    \n
    \n-
    395
    \n-
    396 template< int dim >
    \n+
    396
    \n
    \n-\n-
    398 {
    \n-
    399 removeReference();
    \n-
    400 }
    \n-
    \n-
    401
    \n-
    402
    \n-
    403 template< int dim >
    \n-
    404 inline ElementInfo< dim > &
    \n-
    \n-\n-
    406 {
    \n-
    407 other.addReference();
    \n-
    408 removeReference();
    \n-
    409 instance_ = other.instance_;
    \n-
    410 return *this;
    \n-
    411 }
    \n+
    397 int alberta2dune ( int codim, int i ) const
    \n+
    398 {
    \n+
    399 assert( (codim >= 0) && (codim <= dim) );
    \n+
    400 assert( (i >= 0) && (i < numSubEntities( codim )) );
    \n+
    401 return alberta2dune_[ codim ][ i ];
    \n+
    402 }
    \n+
    \n+
    403
    \n+
    \n+
    404 int numSubEntities ( int codim ) const
    \n+
    405 {
    \n+
    406 assert( (codim >= 0) && (codim <= dim) );
    \n+
    407 return numSubEntities_[ codim ];
    \n+
    408 }
    \n
    \n-
    412
    \n-
    413 template< int dim >
    \n-
    414 inline ElementInfo< dim > &
    \n-
    \n-\n-
    416 {
    \n-
    417 using std::swap;
    \n-
    418 swap( instance_, other.instance_ );
    \n-
    419 return *this;
    \n-
    420 }
    \n+
    409 };
    \n
    \n+
    410
    \n+
    411
    \n+
    412
    \n+
    413 // NumberingMap::Initialize
    \n+
    414 // ------------------------
    \n+
    415
    \n+
    416 template< int dim, template< int, int > class Numbering >
    \n+
    417 template< int codim >
    \n+
    418 struct NumberingMap< dim, Numbering >::Initialize
    \n+
    419 {
    \n+
    420 static const int numSubEntities = NumSubEntities< dim, codim >::value;
    \n
    421
    \n-
    422 template< int dim >
    \n-
    423 inline bool
    \n-
    \n-\n-
    425 {
    \n-
    426 return (instance_->elInfo.el == other.instance_->elInfo.el);
    \n-
    427 }
    \n-
    \n-
    428
    \n-
    429
    \n-
    430 template< int dim >
    \n-
    431 inline bool
    \n-
    \n-\n-
    433 {
    \n-
    434 return (instance_->elInfo.el != other.instance_->elInfo.el);
    \n-
    435 }
    \n-
    \n+
    422 static void apply ( NumberingMap< dim, Numbering > &map )
    \n+
    423 {
    \n+
    424 map.numSubEntities_[ codim ] = numSubEntities;
    \n+
    425 map.dune2alberta_[ codim ] = new int[ numSubEntities ];
    \n+
    426 map.alberta2dune_[ codim ] = new int[ numSubEntities ];
    \n+
    427
    \n+
    428 for( int i = 0; i < numSubEntities; ++i )
    \n+
    429 {
    \n+
    430 const int j = Numbering< dim, codim >::apply( i );
    \n+
    431 map.dune2alberta_[ codim ][ i ] = j;
    \n+
    432 map.alberta2dune_[ codim ][ j ] = i;
    \n+
    433 }
    \n+
    434 }
    \n+
    435 };
    \n
    436
    \n
    437
    \n-
    438 template< int dim >
    \n-
    439 inline const typename ElementInfo< dim >::MacroElement &
    \n-
    \n-\n-
    441 {
    \n-
    442 assert( !!(*this) );
    \n-
    443 assert( elInfo().macro_el != NULL );
    \n-
    444 return static_cast< const MacroElement & >( *(elInfo().macro_el) );
    \n-
    445 }
    \n-
    \n-
    446
    \n-
    447
    \n-
    448 template< int dim >
    \n-
    \n-\n-
    450 {
    \n-
    451 assert( !!(*this) );
    \n-
    452 return ElementInfo< dim >( instance_->parent() );
    \n-
    453 }
    \n+
    438
    \n+
    439 // MapVertices
    \n+
    440 // -----------
    \n+
    441
    \n+
    442 template< int dim, int codim >
    \n+\n+
    444
    \n+
    445 template< int dim >
    \n+
    \n+
    446 struct MapVertices< dim, 0 >
    \n+
    447 {
    \n+
    \n+
    448 static int apply ( int subEntity, int vertex )
    \n+
    449 {
    \n+
    450 assert( subEntity == 0 );
    \n+
    451 assert( (vertex >= 0) && (vertex <= NumSubEntities< dim, dim >::value) );
    \n+
    452 return vertex;
    \n+
    453 }
    \n+
    \n+
    454 };
    \n
    \n-
    454
    \n
    455
    \n-
    456 template< int dim >
    \n-
    \n-\n-
    458 {
    \n-
    459 const Element *element = elInfo().el;
    \n-
    460 const Element *father = elInfo().parent->el;
    \n-
    461 assert( father != NULL );
    \n-
    462
    \n-
    463 const int index = (father->child[ 0 ] == element ? 0 : 1);
    \n-
    464 assert( father->child[ index ] == element );
    \n-
    465 return index;
    \n-
    466 }
    \n+
    456 template<>
    \n+
    \n+
    457 struct MapVertices< 2, 1 >
    \n+
    458 {
    \n+
    \n+
    459 static int apply ( int subEntity, int vertex )
    \n+
    460 {
    \n+
    461 assert( (subEntity >= 0) && (subEntity < 3) );
    \n+
    462 assert( (vertex >= 0) && (vertex < 2) );
    \n+
    463 //static const int map[ 3 ][ 2 ] = { {1,2}, {2,0}, {0,1} };
    \n+
    464 static const int map[ 3 ][ 2 ] = { {1,2}, {0,2}, {0,1} };
    \n+
    465 return map[ subEntity ][ vertex ];
    \n+
    466 }
    \n+
    \n+
    467 };
    \n
    \n-
    467
    \n
    468
    \n-
    469 template< int dim >
    \n-
    \n-\n-
    471 {
    \n-
    472 assert( !isLeaf() );
    \n-
    473
    \n-
    474 InstancePtr child = stack().allocate();
    \n-
    475 child->parent() = instance_;
    \n-
    476 addReference();
    \n-
    477
    \n-
    478 // Alberta fills opp_vertex only if there is a neighbor
    \n-
    479 for( int k = 0; k < maxNeighbors; ++k )
    \n-
    480 child->elInfo.opp_vertex[ k ] = -2;
    \n+
    469 template<>
    \n+
    \n+
    470 struct MapVertices< 3, 1 >
    \n+
    471 {
    \n+
    \n+
    472 static int apply ( int subEntity, int vertex )
    \n+
    473 {
    \n+
    474 assert( (subEntity >= 0) && (subEntity < 4) );
    \n+
    475 assert( (vertex >= 0) && (vertex < 3) );
    \n+
    476 //static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,3,2}, {0,1,3}, {0,2,1} };
    \n+
    477 static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,2,3}, {0,1,3}, {0,1,2} };
    \n+
    478 return map[ subEntity ][ vertex ];
    \n+
    479 }
    \n+
    \n+
    480 };
    \n+
    \n
    481
    \n-
    482 fill( i, elInfo(), child->elInfo );
    \n-
    483 return ElementInfo< dim >( child );
    \n-
    484 }
    \n-
    \n-
    485
    \n-
    486
    \n-
    487 template< int dim >
    \n-
    \n-
    488 inline bool ElementInfo< dim >::isLeaf () const
    \n-
    489 {
    \n-
    490 assert( !(*this) == false );
    \n-
    491 return isLeaf( el() );
    \n-
    492 }
    \n+
    482 template<>
    \n+
    \n+
    483 struct MapVertices< 3, 2 >
    \n+
    484 {
    \n+
    \n+
    485 static int apply ( int subEntity, int vertex )
    \n+
    486 {
    \n+
    487 assert( (subEntity >= 0) && (subEntity < 6) );
    \n+
    488 assert( (vertex >= 0) && (vertex < 2) );
    \n+
    489 static const int map[ 6 ][ 2 ] = { {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3} };
    \n+
    490 return map[ subEntity ][ vertex ];
    \n+
    491 }
    \n
    \n-
    493
    \n-
    494
    \n-
    495 template< int dim >
    \n-
    \n-\n-
    497 {
    \n-
    498 assert( !!(*this) );
    \n-
    499
    \n-
    500 int level = 0;
    \n-
    501 unsigned long path = 0;
    \n-
    502 for( InstancePtr p = instance_; p->parent() != null(); p = p->parent() )
    \n-
    503 {
    \n-
    504 const Element *element = p->elInfo.el;
    \n-
    505 const Element *father = p->parent()->elInfo.el;
    \n-
    506 const unsigned long child = static_cast< unsigned long >( father->child[ 1 ] == element );
    \n-
    507 path = (path << 1) | child;
    \n-
    508 ++level;
    \n-
    509 }
    \n-
    510
    \n-
    511 if( level != elInfo().level )
    \n-
    512 DUNE_THROW( NotImplemented, "Seed for fake elements not implemented." );
    \n-
    513
    \n-
    514 return Seed( macroElement().index, level, path );
    \n-
    515 }
    \n-
    \n-
    516
    \n-
    517
    \n-
    518 template< int dim >
    \n-
    \n-\n-
    520 {
    \n-
    521 return MeshPointer( elInfo().mesh );
    \n-
    522 }
    \n-
    \n-
    523
    \n-
    524
    \n-
    525 template< int dim >
    \n-
    \n-\n-
    527 {
    \n-
    528 return mightVanish( el(), 0 );
    \n-
    529 }
    \n-
    \n-
    530
    \n-
    531
    \n-
    532 template< int dim >
    \n-
    \n-
    533 inline int ElementInfo< dim >::level () const
    \n-
    534 {
    \n-
    535 return elInfo().level;
    \n-
    536 }
    \n+
    492 };
    \n
    \n+
    493
    \n+
    494 template< int dim >
    \n+
    \n+
    495 struct MapVertices< dim, dim >
    \n+
    496 {
    \n+
    \n+
    497 static int apply ( int subEntity, int vertex )
    \n+
    498 {
    \n+
    499 assert( (subEntity >= 0) && (subEntity < NumSubEntities< dim, 1 >::value) );
    \n+
    500 assert( vertex == 0 );
    \n+
    501 return subEntity;
    \n+
    502 }
    \n+
    \n+
    503 };
    \n+
    \n+
    504
    \n+
    505
    \n+
    506
    \n+
    507 // Twist
    \n+
    508 // -----
    \n+
    509
    \n+
    510 // ******************************************************************
    \n+
    511 // Meaning of the twist (same as in ALU)
    \n+
    512 // -------------------------------------
    \n+
    513 //
    \n+
    514 // Consider a fixed ordering of the vertices v_1, ... v_n of a face
    \n+
    515 // (here, we assume their indices to be increasing). Denote by k the
    \n+
    516 // local number of a vertex v within the element and by t the twist.
    \n+
    517 // Then, v = v_j, where j is computed by the following formula:
    \n+
    518 //
    \n+
    519 // / (2n + 1 - k + t) % n, if t < 0
    \n+
    520 // j = <
    \n+
    521 // \\ (k + t) % n, if t >= 0
    \n+
    522 //
    \n+
    523 // Note: We use the order of the 0-th vertex dof to assign the twist.
    \n+
    524 // This is ok for two reasons:
    \n+
    525 // - ALBERTA preserves the relative order of the dofs during
    \n+
    526 // dof compression.
    \n+
    527 // - ALBERTA enforces the first vertex dof admin to be periodic.
    \n+
    528 // ******************************************************************
    \n+
    529
    \n+
    530 template< int dim, int subdim >
    \n+
    \n+
    531 struct Twist
    \n+
    532 {
    \n+
    533 static const int numSubEntities = NumSubEntities< dim, dim-subdim >::value;
    \n+
    534
    \n+
    535 static const int minTwist = 0;
    \n+
    536 static const int maxTwist = 0;
    \n
    537
    \n-
    538
    \n-
    539 template< int dim >
    \n-
    \n-
    540 inline int ElementInfo< dim >::type () const
    \n-
    541 {
    \n-
    542 return 0;
    \n-
    543 }
    \n+
    \n+
    538 static int twist ( [[maybe_unused]] const Element *element,
    \n+
    539 [[maybe_unused]] int subEntity )
    \n+
    540 {
    \n+
    541 assert( (subEntity >= 0) && (subEntity < numSubEntities) );
    \n+
    542 return 0;
    \n+
    543 }
    \n+
    \n+
    544 };
    \n
    \n-
    544
    \n
    545
    \n-
    546 template<>
    \n-
    \n-
    547 inline int ElementInfo< 3 >::type () const
    \n-
    548 {
    \n-
    549 return instance_->elInfo.el_type;
    \n-
    550 }
    \n-
    \n-
    551
    \n-
    552
    \n-
    553 template< int dim >
    \n+
    546 template< int dim >
    \n+
    \n+
    547 struct Twist< dim, 1 >
    \n+
    548 {
    \n+
    549 static const int numSubEntities = NumSubEntities< dim, dim-1 >::value;
    \n+
    550
    \n+
    551 static const int minTwist = 0;
    \n+
    552 static const int maxTwist = 1;
    \n+
    553
    \n
    \n-
    554 inline int ElementInfo< dim >::getMark () const
    \n-
    555 {
    \n-
    556 return el()->mark;
    \n-
    557 }
    \n-
    \n-
    558
    \n-
    559
    \n-
    560 template< int dim >
    \n-
    \n-
    561 inline void ElementInfo< dim >::setMark ( int refCount ) const
    \n-
    562 {
    \n-
    563 assert( isLeaf() );
    \n-
    564 assert( (refCount >= -128) && (refCount < 127) );
    \n-
    565 el()->mark = refCount;
    \n-
    566 }
    \n+
    554 static int twist ( const Element *element, int subEntity )
    \n+
    555 {
    \n+
    556 assert( (subEntity >= 0) && (subEntity < numSubEntities) );
    \n+
    557 const int numVertices = NumSubEntities< 1, 1 >::value;
    \n+
    558 int dof[ numVertices ];
    \n+
    559 for( int i = 0; i < numVertices; ++i )
    \n+
    560 {
    \n+
    561 const int j = MapVertices< dim, dim-1 >::apply( subEntity, i );
    \n+
    562 dof[ i ] = element->dof[ j ][ 0 ];
    \n+
    563 }
    \n+
    564 return (dof[ 0 ] < dof[ 1 ] ? 0 : 1);
    \n+
    565 }
    \n+
    \n+
    566 };
    \n
    \n
    567
    \n
    568
    \n-
    569 template< int dim >
    \n-
    \n-
    570 inline bool ElementInfo< dim >::hasLeafNeighbor ( const int face ) const
    \n-
    571 {
    \n-
    572 assert( !!(*this) );
    \n-
    573 assert( (face >= 0) && (face < maxNeighbors) );
    \n+
    569 template<>
    \n+
    \n+
    570 struct Twist< 1, 1 >
    \n+
    571 {
    \n+
    572 static const int minTwist = 0;
    \n+
    573 static const int maxTwist = 0;
    \n
    574
    \n-
    575 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n-
    576 const int macroFace = elInfo().macro_wall[ face ];
    \n-
    577 if( macroFace >= 0 )
    \n-
    578 return (macroElement().neighbor( macroFace ) != NULL);
    \n-
    579 else
    \n-
    580 return true;
    \n-
    581 }
    \n+
    \n+
    575 static int twist ( [[maybe_unused]] const Element *element,
    \n+
    576 [[maybe_unused]] int subEntity )
    \n+
    577 {
    \n+
    578 assert( subEntity == 0 );
    \n+
    579 return 0;
    \n+
    580 }
    \n+
    \n+
    581 };
    \n
    \n
    582
    \n
    583
    \n
    584 template< int dim >
    \n-
    \n-\n-
    586 {
    \n-
    587 assert( (face >= 0) && (face < numFaces) );
    \n-
    588 ElementInfo neighbor;
    \n-
    589 Library< dimWorld >::leafNeighbor( *this, face, neighbor );
    \n-
    590 return neighbor;
    \n-
    591 }
    \n-
    \n-
    592
    \n-
    593
    \n-
    594 template< int dim >
    \n-
    595 inline int ElementInfo< dim >
    \n-
    \n-
    596 ::levelNeighbors ( const int face, ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const
    \n-
    597 {
    \n-
    598 assert( (face >= 0) && (face < numFaces) );
    \n-
    599 return Library< dimWorld >::levelNeighbors( *this, face, neighbor, faceInNeighbor );
    \n-
    600 }
    \n-
    \n-
    601
    \n+
    \n+
    585 struct Twist< dim, 2 >
    \n+
    586 {
    \n+
    587 static const int numSubEntities = NumSubEntities< dim, dim-2 >::value;
    \n+
    588
    \n+
    589 static const int minTwist = -3;
    \n+
    590 static const int maxTwist = 2;
    \n+
    591
    \n+
    \n+
    592 static int twist ( const Element *element, int subEntity )
    \n+
    593 {
    \n+
    594 assert( (subEntity >= 0) && (subEntity < numSubEntities) );
    \n+
    595 const int numVertices = NumSubEntities< 2, 2 >::value;
    \n+
    596 int dof[ numVertices ];
    \n+
    597 for( int i = 0; i < numVertices; ++i )
    \n+
    598 {
    \n+
    599 const int j = MapVertices< dim, dim-2 >::apply( subEntity, i );
    \n+
    600 dof[ i ] = element->dof[ j ][ 0 ];
    \n+
    601 }
    \n
    602
    \n-
    603 template< int dim >
    \n-
    604 template< int codim >
    \n-
    \n-
    605 inline int ElementInfo< dim >::twist ( int subEntity ) const
    \n-
    606 {
    \n-
    607 return Twist< dim, dim-codim >::twist( element(), subEntity );
    \n-
    608 }
    \n-
    \n-
    609
    \n-
    610
    \n-
    611 template< int dim >
    \n-
    \n-
    612 inline int ElementInfo< dim >::twistInNeighbor ( const int face ) const
    \n-
    613 {
    \n-
    614 assert( neighbor( face ) != NULL );
    \n-
    615 return Twist< dim, dim-1 >::twist( neighbor( face ), elInfo().opp_vertex[ face ] );
    \n-
    616 }
    \n-
    \n-
    617
    \n+
    603 const int twist[ 8 ] = { -2, 1, 666, -1, 2, 666, -3, 0 };
    \n+
    604 const int k = int( dof[ 0 ] < dof[ 1 ] )
    \n+
    605 | (int( dof[ 0 ] < dof[ 2 ] ) << 1)
    \n+
    606 | (int( dof[ 1 ] < dof[ 2 ] ) << 2);
    \n+
    607 assert( twist[ k ] != 666 );
    \n+
    608 return twist[ k ];
    \n+
    609 }
    \n+
    \n+
    610 };
    \n+
    \n+
    611
    \n+
    612
    \n+
    613 template<>
    \n+
    \n+
    614 struct Twist< 2, 2 >
    \n+
    615 {
    \n+
    616 static const int minTwist = 0;
    \n+
    617 static const int maxTwist = 0;
    \n
    618
    \n-
    619 template< int dim >
    \n-
    \n-
    620 inline bool ElementInfo< dim >::isBoundary ( int face ) const
    \n-
    621 {
    \n-
    622 assert( !!(*this) );
    \n-
    623 assert( (face >= 0) && (face < maxNeighbors) );
    \n-
    624
    \n-
    625 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n-
    626 const int macroFace = elInfo().macro_wall[ face ];
    \n-
    627 if( macroFace >= 0 )
    \n-
    628 return macroElement().isBoundary( macroFace );
    \n-
    629 else
    \n-
    630 return false;
    \n-
    631 }
    \n-
    \n-
    632
    \n-
    633
    \n-
    634 template< int dim >
    \n-
    \n-
    635 inline int ElementInfo< dim >::boundaryId ( int face ) const
    \n-
    636 {
    \n-
    637 assert( !!(*this) );
    \n-
    638 assert( (face >= 0) && (face < N_WALLS_MAX) );
    \n-
    639
    \n-
    640 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n-
    641 const int macroFace = elInfo().macro_wall[ face ];
    \n-
    642 const int id = macroElement().boundaryId( macroFace );
    \n-
    643 // this assertion is only allowed, if FILL_BOUND is set
    \n-
    644 // assert( id == elInfo().wall_bound[ face ] );
    \n-
    645 return id;
    \n-
    646 }
    \n-
    \n-
    647
    \n+
    \n+
    619 static int twist ( [[maybe_unused]] const Element *element,
    \n+
    620 [[maybe_unused]] int subEntity )
    \n+
    621 {
    \n+
    622 assert( subEntity == 0 );
    \n+
    623 return 0;
    \n+
    624 }
    \n+
    \n+
    625 };
    \n+
    \n+
    626
    \n+
    627
    \n+
    628
    \n+
    629 template< int dim >
    \n+
    \n+
    630 inline int applyTwist ( int twist, int i )
    \n+
    631 {
    \n+
    632 const int numCorners = NumSubEntities< dim, dim >::value;
    \n+
    633 return (twist < 0 ? (2*numCorners + 1 - i + twist) : i + twist) % numCorners;
    \n+
    634 }
    \n+
    \n+
    635
    \n+
    636 template< int dim >
    \n+
    \n+
    637 inline int applyInverseTwist ( int twist, int i )
    \n+
    638 {
    \n+
    639 const int numCorners = NumSubEntities< dim, dim >::value;
    \n+
    640 return (twist < 0 ? (2*numCorners + 1 - i + twist) : numCorners + i - twist) % numCorners;
    \n+
    641 }
    \n+
    \n+
    642
    \n+
    643 }
    \n+
    644
    \n+
    645}
    \n+
    646
    \n+
    647#endif // #if HAVE_ALBERTA
    \n
    648
    \n-
    649 template< int dim >
    \n-
    650 inline AffineTransformation *
    \n-
    \n-\n-
    652 {
    \n-
    653 assert( !!(*this) );
    \n-
    654 assert( (face >= 0) && (face < N_WALLS_MAX) );
    \n-
    655
    \n-
    656 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n-
    657 const int macroFace = elInfo().macro_wall[ face ];
    \n-
    658 return (macroFace < 0 ? NULL : macroElement().wall_trafo[ macroFace ]);
    \n-
    659 }
    \n-
    \n-
    660
    \n-
    661
    \n-
    662 template< int dim >
    \n-
    663 inline BasicNodeProjection *
    \n-
    \n-\n-
    665 {
    \n-
    666 assert( !!(*this) );
    \n-
    667 assert( (face >= 0) && (face < N_WALLS_MAX) );
    \n-
    668
    \n-
    669 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );
    \n-
    670 const int macroFace = elInfo().macro_wall[ face ];
    \n-
    671 if( macroFace >= 0 )
    \n-
    672 return static_cast< BasicNodeProjection * >( macroElement().projection[ macroFace+1 ] );
    \n-
    673 else
    \n-
    674 return 0;
    \n-
    675 }
    \n-
    \n-
    676
    \n-
    677
    \n-
    678 template< int dim >
    \n-
    \n-\n-
    680 {
    \n-
    681 return ((elInfo().fill_flag & FillFlags::coords) != 0);
    \n-
    682 }
    \n-
    \n-
    683
    \n-
    684 template< int dim >
    \n-
    \n-
    685 inline const GlobalVector &ElementInfo< dim >::coordinate ( int vertex ) const
    \n-
    686 {
    \n-
    687 assert( hasCoordinates() );
    \n-
    688 assert( (vertex >= 0) && (vertex < numVertices) );
    \n-
    689 return elInfo().coord[ vertex ];
    \n-
    690 }
    \n-
    \n-
    691
    \n-
    692
    \n-
    693 template< int dim >
    \n-
    694 template< class Functor >
    \n-
    \n-
    695 inline void ElementInfo< dim >::hierarchicTraverse ( Functor &functor ) const
    \n-
    696 {
    \n-
    697 functor( *this );
    \n-
    698 if( !isLeaf() )
    \n-
    699 {
    \n-
    700 child( 0 ).hierarchicTraverse( functor );
    \n-
    701 child( 1 ).hierarchicTraverse( functor );
    \n-
    702 }
    \n-
    703 }
    \n-
    \n-
    704
    \n-
    705
    \n-
    706 template< int dim >
    \n-
    707 template< class Functor >
    \n-
    \n-
    708 inline void ElementInfo< dim >::leafTraverse ( Functor &functor ) const
    \n-
    709 {
    \n-
    710 if( !isLeaf() )
    \n-
    711 {
    \n-
    712 child( 0 ).leafTraverse( functor );
    \n-
    713 child( 1 ).leafTraverse( functor );
    \n-
    714 }
    \n-
    715 else
    \n-
    716 functor( *this );
    \n-
    717 }
    \n-
    \n-
    718
    \n-
    719
    \n-
    720 template< int dim >
    \n-
    \n-\n-
    722 {
    \n-
    723 return elInfo().el;
    \n-
    724 }
    \n-
    \n-
    725
    \n-
    726
    \n-
    727 template< int dim >
    \n-
    \n-
    728 inline const Element *ElementInfo< dim >::neighbor ( int face ) const
    \n-
    729 {
    \n-
    730 assert( (face >= 0) && (face < numFaces) );
    \n-
    731 assert( (elInfo().fill_flag & FillFlags::neighbor) != 0 );
    \n-
    732 return elInfo().neigh[ face ];
    \n-
    733 }
    \n-
    \n-
    734
    \n-
    735
    \n-
    736 template< int dim >
    \n-
    \n-\n-
    738 {
    \n-
    739 return elInfo().el;
    \n-
    740 }
    \n-
    \n-
    741
    \n-
    742
    \n-
    743 template< int dim >
    \n-
    \n-
    744 inline ALBERTA EL_INFO &ElementInfo< dim >::elInfo () const
    \n-
    745 {
    \n-
    746 return (instance_->elInfo);
    \n-
    747 }
    \n-
    \n-
    748
    \n-
    749
    \n-
    750 template< int dim >
    \n-
    751 inline ElementInfo< dim >
    \n-
    \n-\n-
    753 const Element *element, int level, int type )
    \n-
    754 {
    \n-
    755 InstancePtr instance = stack().allocate();
    \n-
    756 instance->parent() = null();
    \n-
    757 ++(instance->parent()->refCount);
    \n-
    758
    \n-
    759 instance->elInfo.mesh = mesh;
    \n-
    760 instance->elInfo.macro_el = NULL;
    \n-
    761 instance->elInfo.el = const_cast< Element * >( element );
    \n-
    762 instance->elInfo.parent = NULL;
    \n-
    763 instance->elInfo.fill_flag = FillFlags::nothing;
    \n-
    764 instance->elInfo.level = level;
    \n-
    765 instance->elInfo.el_type = type;
    \n-
    766
    \n-
    767 return ElementInfo< dim >( instance );
    \n-
    768 }
    \n-
    \n-
    769
    \n-
    770
    \n-
    771 template< int dim >
    \n-
    772 inline ElementInfo< dim >
    \n-
    \n-
    773 ElementInfo< dim >::createFake ( const ALBERTA EL_INFO &elInfo )
    \n-
    774 {
    \n-
    775 InstancePtr instance = stack().allocate();
    \n-
    776 instance->parent() = null();
    \n-
    777 ++(instance->parent()->refCount);
    \n-
    778
    \n-
    779 instance->elInfo = elInfo;
    \n-
    780 return ElementInfo< dim >( instance );
    \n-
    781 }
    \n-
    \n-
    782
    \n-
    783
    \n-
    784 template< int dim >
    \n-
    785 inline bool ElementInfo< dim >::isLeaf ( Element *element )
    \n-
    786 {
    \n-
    787 return IS_LEAF_EL( element );
    \n-
    788 }
    \n-
    789
    \n-
    790
    \n-
    791 template< int dim >
    \n-
    792 inline bool ElementInfo< dim >::mightVanish ( Alberta::Element *element, int depth )
    \n-
    793 {
    \n-
    794 if( isLeaf( element ) )
    \n-
    795 return (element->mark < depth);
    \n-
    796 else
    \n-
    797 return (mightVanish( element->child[ 0 ], depth-1 ) && mightVanish( element->child[ 1 ], depth-1 ));
    \n-
    798 }
    \n-
    799
    \n-
    800
    \n-
    801 template< int dim >
    \n-
    802 inline void ElementInfo< dim >
    \n-
    803 ::fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO &elInfo )
    \n-
    804 {
    \n-
    805 ALBERTA fill_macro_info( mesh, mel, &elInfo );
    \n-
    806 }
    \n-
    807
    \n-
    808 template< int dim >
    \n-
    809 inline void ElementInfo< dim >
    \n-
    810 ::fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA EL_INFO &elInfo )
    \n-
    811 {
    \n-
    812 ALBERTA fill_elinfo( ichild, FILL_ANY, &parentInfo, &elInfo );
    \n-
    813 }
    \n-
    814
    \n-
    815
    \n-
    816 template< int dim >
    \n-
    817 inline void ElementInfo< dim >::addReference () const
    \n-
    818 {
    \n-
    819 ++(instance_->refCount);
    \n-
    820 }
    \n-
    821
    \n-
    822
    \n-
    823 template< int dim >
    \n-
    824 inline void ElementInfo< dim >::removeReference () const
    \n-
    825 {
    \n-
    826 // short-circuit for rvalues that have been drained as argument to a move operation
    \n-
    827 if ( !instance_ )
    \n-
    828 return;
    \n-
    829 // this loop breaks when instance becomes null()
    \n-
    830 for( InstancePtr instance = instance_; --(instance->refCount) == 0; )
    \n-
    831 {
    \n-
    832 const InstancePtr parent = instance->parent();
    \n-
    833 stack().release( instance );
    \n-
    834 instance = parent;
    \n-
    835 }
    \n-
    836 }
    \n-
    837
    \n-
    838
    \n-
    839 template< int dim >
    \n-
    840 inline typename ElementInfo< dim >::InstancePtr
    \n-
    841 ElementInfo< dim >::null ()
    \n-
    842 {
    \n-
    843 return stack().null();
    \n-
    844 }
    \n-
    845
    \n-
    846
    \n-
    847 template< int dim >
    \n-
    848 inline typename ElementInfo< dim >::Stack &
    \n-
    849 ElementInfo< dim >::stack ()
    \n-
    850 {
    \n-
    851 static Stack s;
    \n-
    852 return s;
    \n-
    853 }
    \n-
    854
    \n-
    855
    \n-
    856
    \n-
    857 // Implementation of ElementInfo::Stack
    \n-
    858 // ------------------------------------
    \n-
    859
    \n-
    860 template< int dim >
    \n-
    \n-\n-
    862 : top_( 0 )
    \n-
    863 {
    \n-
    864 null_.elInfo.el = NULL;
    \n-
    865 null_.refCount = 1;
    \n-
    866 null_.parent() = 0;
    \n-
    867 }
    \n-
    \n-
    868
    \n-
    869
    \n-
    870 template< int dim >
    \n-
    \n-\n-
    872 {
    \n-
    873 while( top_ != 0 )
    \n-
    874 {
    \n-
    875 InstancePtr p = top_;
    \n-
    876 top_ = p->parent();
    \n-
    877 delete p;
    \n-
    878 }
    \n-
    879 }
    \n-
    \n-
    880
    \n-
    881
    \n-
    882 template< int dim >
    \n-
    883 inline typename ElementInfo< dim >::InstancePtr
    \n-
    \n-\n-
    885 {
    \n-
    886 InstancePtr p = top_;
    \n-
    887 if( p != 0 )
    \n-
    888 top_ = p->parent();
    \n-
    889 else
    \n-
    890 p = new Instance;
    \n-
    891 p->refCount = 0;
    \n-
    892 return p;
    \n-
    893 }
    \n-
    \n-
    894
    \n-
    895
    \n-
    896 template< int dim >
    \n-
    \n-\n-
    898 {
    \n-
    899 assert( (p != null()) && (p->refCount == 0) );
    \n-
    900 p->parent() = top_;
    \n-
    901 top_ = p;
    \n-
    902 }
    \n-
    \n-
    903
    \n-
    904
    \n-
    905 template< int dim >
    \n-
    906 inline typename ElementInfo< dim >::InstancePtr
    \n-
    \n-\n-
    908 {
    \n-
    909 return &null_;
    \n-
    910 }
    \n-
    \n-
    \n-
    911
    \n-
    912 } // namespace Alberta
    \n-
    913
    \n-
    914} // namespace Dune
    \n-
    915
    \n-
    916#endif // #if HAVE_ALBERTA
    \n-
    917
    \n-
    918#endif // #ifndef DUNE_ALBERTA_ELEMENTINFO_HH
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-
    \n-\n-\n+
    649#endif // #ifndef DUNE_ALBERTA_MISC_HH
    \n+\n+
    #define DIM_OF_WORLD
    Definition albertaheader.hh:23
    \n
    #define ALBERTA
    Definition albertaheader.hh:29
    \n-
    void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T > &b)
    Definition utility/persistentcontainer.hh:83
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n+
    int applyInverseTwist(int twist, int i)
    Definition misc.hh:637
    \n
    ALBERTA MESH Mesh
    Definition misc.hh:53
    \n+
    int applyTwist(int twist, int i)
    Definition misc.hh:630
    \n+
    void memFree(Data *ptr, size_t size)
    Definition misc.hh:91
    \n+
    ALBERTA REAL_DD GlobalMatrix
    Definition misc.hh:51
    \n
    ALBERTA AFF_TRAFO AffineTransformation
    Definition misc.hh:52
    \n+
    ALBERTA REAL_B LocalVector
    Definition misc.hh:49
    \n
    ALBERTA EL Element
    Definition misc.hh:54
    \n+
    ALBERTA BNDRY_TYPE BoundaryId
    Definition misc.hh:61
    \n+
    static const int InteriorBoundary
    Definition misc.hh:59
    \n+
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    static const int meshRefined
    Definition misc.hh:56
    \n+
    Data * memAlloc(size_t size)
    Definition misc.hh:73
    \n+
    Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)
    Definition misc.hh:85
    \n+
    static const int DirichletBoundary
    Definition misc.hh:60
    \n+
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n+
    Data * memCAlloc(size_t size)
    Definition misc.hh:79
    \n+
    static const int dimWorld
    Definition misc.hh:46
    \n+
    U_CHAR ElementType
    Definition misc.hh:63
    \n+
    static const int meshCoarsened
    Definition misc.hh:57
    \n
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n-\n-
    Definition elementinfo.hh:43
    \n-
    ElementInfo leafNeighbor(const int face) const
    Definition elementinfo.hh:585
    \n-
    bool isLeaf() const
    Definition elementinfo.hh:488
    \n-
    static ElementInfo createFake(const MeshPointer &mesh, const Element *element, int level, int type=0)
    Definition elementinfo.hh:752
    \n-
    ElementInfo child(int i) const
    Definition elementinfo.hh:470
    \n-
    int level() const
    Definition elementinfo.hh:533
    \n-
    bool mightVanish() const
    Definition elementinfo.hh:526
    \n-
    static const int numFaces
    Definition elementinfo.hh:56
    \n-
    int twist(int subEntity) const
    Definition elementinfo.hh:605
    \n-
    int twistInNeighbor(int face) const
    Definition elementinfo.hh:612
    \n-
    Alberta::MacroElement< dimension > MacroElement
    Definition elementinfo.hh:58
    \n-
    BasicNodeProjection * boundaryProjection(int face) const
    Definition elementinfo.hh:664
    \n-
    const MacroElement & macroElement() const
    Definition elementinfo.hh:440
    \n-
    static const int maxLevelNeighbors
    Definition elementinfo.hh:64
    \n-
    ElementInfo father() const
    Definition elementinfo.hh:449
    \n-
    ElementInfo(const ElementInfo &other)
    Definition elementinfo.hh:382
    \n-
    GeometryCacheProxy< dim > GeometryCache
    Definition elementinfo.hh:67
    \n-
    ElementInfo & operator=(const ElementInfo &other)
    Definition elementinfo.hh:405
    \n-
    bool hasLeafNeighbor(const int face) const
    Definition elementinfo.hh:570
    \n-
    bool operator==(const ElementInfo &other) const
    Definition elementinfo.hh:424
    \n-
    static const int dimension
    Definition elementinfo.hh:53
    \n-
    void hierarchicTraverse(Functor &functor) const
    Definition elementinfo.hh:695
    \n-
    int type() const
    Definition elementinfo.hh:540
    \n-
    static const int maxNeighbors
    Definition elementinfo.hh:62
    \n-
    void setMark(int refCount) const
    Definition elementinfo.hh:561
    \n-
    ~ElementInfo()
    Definition elementinfo.hh:397
    \n-
    const GlobalVector & coordinate(int vertex) const
    Definition elementinfo.hh:685
    \n-
    static const int numVertices
    Definition elementinfo.hh:55
    \n-
    int getMark() const
    Definition elementinfo.hh:554
    \n-
    void leafTraverse(Functor &functor) const
    Definition elementinfo.hh:708
    \n-
    Alberta::MeshPointer< dimension > MeshPointer
    Definition elementinfo.hh:59
    \n-
    const Element * neighbor(int face) const
    Definition elementinfo.hh:728
    \n-
    static ElementInfo createFake(const ALBERTA EL_INFO &elInfo)
    Definition elementinfo.hh:773
    \n-
    ElementInfo()
    Definition elementinfo.hh:310
    \n-
    int boundaryId(int face) const
    Definition elementinfo.hh:635
    \n-
    bool operator!=(const ElementInfo &other) const
    Definition elementinfo.hh:432
    \n-
    Alberta::FillFlags< dimension > FillFlags
    Definition elementinfo.hh:60
    \n-
    ElementInfo(const MeshPointer &mesh, const MacroElement &macroElement, typename FillFlags::Flags fillFlags=FillFlags::standard)
    Definition elementinfo.hh:319
    \n-
    AffineTransformation * transformation(int face) const
    Definition elementinfo.hh:651
    \n-
    bool isBoundary(int face) const
    Definition elementinfo.hh:620
    \n-
    int indexInFather() const
    Definition elementinfo.hh:457
    \n-
    Seed seed() const
    Definition elementinfo.hh:496
    \n-
    Element * el() const
    Definition elementinfo.hh:737
    \n-
    const Element * element() const
    Definition elementinfo.hh:721
    \n-
    ALBERTA EL_INFO & elInfo() const
    Definition elementinfo.hh:744
    \n-
    MeshPointer mesh() const
    Definition elementinfo.hh:519
    \n-
    GeometryCache geometryCache() const
    Definition elementinfo.hh:140
    \n-
    bool hasCoordinates() const
    Definition elementinfo.hh:679
    \n-
    int levelNeighbors(const int face, ElementInfo(&neighbor)[maxLevelNeighbors], int(&faceInNeighbor)[maxLevelNeighbors]) const
    Definition elementinfo.hh:596
    \n-
    ElementInfo(ElementInfo &&other)
    Definition elementinfo.hh:389
    \n-
    ElementInfo(const MeshPointer &mesh, const Seed &seed, typename FillFlags::Flags fillFlags=FillFlags::standard)
    Definition elementinfo.hh:340
    \n-
    Definition elementinfo.hh:185
    \n-
    InstancePtr & parent()
    Definition elementinfo.hh:189
    \n-
    Alberta::GeometryCache< dim > geometryCache
    Definition elementinfo.hh:199
    \n-
    ALBERTA EL_INFO elInfo
    Definition elementinfo.hh:186
    \n-
    unsigned int refCount
    Definition elementinfo.hh:187
    \n-
    Definition elementinfo.hh:210
    \n-
    InstancePtr null()
    Definition elementinfo.hh:907
    \n-
    ~Stack()
    Definition elementinfo.hh:871
    \n-
    void release(InstancePtr &p)
    Definition elementinfo.hh:897
    \n-
    Stack()
    Definition elementinfo.hh:861
    \n-
    InstancePtr allocate()
    Definition elementinfo.hh:884
    \n-
    Definition elementinfo.hh:255
    \n-
    Seed(const int macroIndex, const int level, const unsigned long path)
    Definition elementinfo.hh:260
    \n-
    Seed()
    Definition elementinfo.hh:256
    \n-
    int level() const
    Definition elementinfo.hh:287
    \n-
    bool isValid() const
    Definition elementinfo.hh:284
    \n-
    unsigned long path() const
    Definition elementinfo.hh:288
    \n-
    int macroIndex() const
    Definition elementinfo.hh:286
    \n-
    Definition geometrycache.hh:24
    \n-
    Definition geometrycache.hh:91
    \n-
    Definition macroelement.hh:24
    \n+
    Definition misc.hh:32
    \n+
    Definition misc.hh:36
    \n+
    Definition misc.hh:102
    \n+
    static const Matrix & identityMatrix()
    Definition misc.hh:131
    \n+
    static const Vector & nullVector()
    Definition misc.hh:136
    \n+
    GlobalMatrix Matrix
    Definition misc.hh:106
    \n+
    GlobalVector Vector
    Definition misc.hh:107
    \n
    Definition misc.hh:148
    \n+
    Definition misc.hh:192
    \n
    Definition misc.hh:231
    \n
    static const Flags nothing
    Definition misc.hh:234
    \n+
    static const Flags nonPeriodic
    Definition misc.hh:248
    \n
    static const Flags boundaryId
    Definition misc.hh:246
    \n+
    static const Flags elementType
    Definition misc.hh:244
    \n
    ALBERTA FLAGS Flags
    Definition misc.hh:232
    \n+
    static const Flags projection
    Definition misc.hh:242
    \n
    static const Flags coords
    Definition misc.hh:236
    \n+
    static const Flags orientation
    Definition misc.hh:240
    \n
    static const Flags standard
    Definition misc.hh:258
    \n
    static const Flags neighbor
    Definition misc.hh:238
    \n+
    static const Flags all
    Definition misc.hh:250
    \n+
    static const Flags standardWithCoords
    Definition misc.hh:253
    \n+
    Definition misc.hh:269
    \n+
    static const int value
    Definition misc.hh:270
    \n+\n+
    static int apply(const int i)
    Definition misc.hh:287
    \n+
    static int apply(const int i)
    Definition misc.hh:299
    \n+\n+
    static int apply(const int i)
    Definition misc.hh:315
    \n+
    static int apply(const int i)
    Definition misc.hh:325
    \n+
    static int apply(const int i)
    Definition misc.hh:335
    \n+
    static int apply(const int i)
    Definition misc.hh:347
    \n+
    Definition misc.hh:362
    \n+
    int alberta2dune(int codim, int i) const
    Definition misc.hh:397
    \n+
    int numSubEntities(int codim) const
    Definition misc.hh:404
    \n+
    int dune2alberta(int codim, int i) const
    Definition misc.hh:390
    \n+
    ~NumberingMap()
    Definition misc.hh:381
    \n+
    NumberingMap()
    Definition misc.hh:376
    \n+
    Definition misc.hh:443
    \n+
    static int apply(int subEntity, int vertex)
    Definition misc.hh:448
    \n+
    static int apply(int subEntity, int vertex)
    Definition misc.hh:459
    \n+
    static int apply(int subEntity, int vertex)
    Definition misc.hh:472
    \n+
    static int apply(int subEntity, int vertex)
    Definition misc.hh:485
    \n+
    static int apply(int subEntity, int vertex)
    Definition misc.hh:497
    \n+
    Definition misc.hh:532
    \n+
    static const int maxTwist
    Definition misc.hh:536
    \n+
    static const int minTwist
    Definition misc.hh:535
    \n
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:538
    \n-
    Definition albertagrid/projection.hh:208
    \n+
    static const int numSubEntities
    Definition misc.hh:533
    \n+
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:554
    \n+
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:575
    \n+
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:592
    \n+
    static int twist(const Element *element, int subEntity)
    Definition misc.hh:619
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,1211 +1,888 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * albertagrid\n-elementinfo.hh\n+misc.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_ELEMENTINFO_HH\n-6#define DUNE_ALBERTA_ELEMENTINFO_HH\n+5#ifndef DUNE_ALBERTA_MISC_HH\n+6#define DUNE_ALBERTA_MISC_HH\n 7\n-13#include \n-14#include \n-15#include \n+8#include \n+9#include \n+10\n+11#include \n+12#include \n+13#include \n+14\n+15#include \n 16\n-17#include \n-18#include \n-19\n-20#if HAVE_ALBERTA\n-21\n-22namespace Dune\n-23{\n-24\n-25 namespace Alberta\n-26 {\n-27\n-28 // External Forward Declarations\n-29 // -----------------------------\n-30\n-31 template< int dim >\n-32 class MeshPointer;\n+17#if HAVE_ALBERTA\n+18\n+19// should the coordinates be cached in a vector (required for ALBERTA 2.0)?\n+20#ifndef DUNE_ALBERTA_CACHE_COORDINATES\n+21#define DUNE_ALBERTA_CACHE_COORDINATES 1\n+22#endif\n+23\n+24namespace Dune\n+25{\n+26\n+27 // Exceptions\n+28 // ----------\n+29\n+30 class AlbertaError\n+31 : public Exception\n+32 {};\n 33\n-34 struct BasicNodeProjection;\n-35\n-36\n+34 class AlbertaIOError\n+35 : public IOError\n+36 {};\n 37\n-38 // ElementInfo\n-39 // -----------\n-40\n-41 template< int dim >\n-42 class ElementInfo\n-43 {\n-44 struct Instance;\n-45 class Stack;\n-46\n-47 template< int >\n-48 struct Library;\n-49\n-50 typedef Instance *InstancePtr;\n-51\n-52 public:\n-53 static const int dimension = dim;\n-54\n-55 static const int numVertices = NumSubEntities<_dimension,_dimension_>::\n-value;\n-56 static const int numFaces = NumSubEntities<_dimension,_1_>::value;\n-57\n-58 typedef Alberta::MacroElement<_dimension_> MacroElement;\n-59 typedef Alberta::MeshPointer<_dimension_> MeshPointer;\n-60 typedef Alberta::FillFlags<_dimension_> FillFlags;\n-61\n-62 static const int maxNeighbors = N_NEIGH_MAX;\n-63\n-64 static const int maxLevelNeighbors = Library< dimWorld >::maxLevelNeighbors;\n-65\n-66#if !DUNE_ALBERTA_CACHE_COORDINATES\n-67 typedef GeometryCacheProxy<_dim_> GeometryCache;\n-68#endif\n-69\n-70 struct Seed;\n+38\n+39\n+40 namespace Alberta\n+41 {\n+42\n+43 // Import Types\n+44 // ------------\n+45\n+46 static const int dimWorld = DIM_OF_WORLD;\n+47\n+48 typedef ALBERTA REAL Real;\n+49 typedef ALBERTA REAL_B LocalVector; // in barycentric coordinates\n+50 typedef ALBERTA REAL_D GlobalVector;\n+51 typedef ALBERTA REAL_DD GlobalMatrix;\n+52 typedef ALBERTA AFF_TRAFO AffineTransformation;\n+53 typedef ALBERTA MESH Mesh;\n+54 typedef ALBERTA EL Element;\n+55\n+56 static const int meshRefined = MESH_REFINED;\n+57 static const int meshCoarsened = MESH_COARSENED;\n+58\n+59 static const int InteriorBoundary = INTERIOR;\n+60 static const int DirichletBoundary = DIRICHLET;\n+61 typedef ALBERTA BNDRY_TYPE BoundaryId;\n+62\n+63 typedef U_CHAR ElementType;\n+64\n+65 typedef ALBERTA FE_SPACE DofSpace;\n+66\n+67\n+68\n+69 // Memory Manipulation Functions\n+70 // -----------------------------\n 71\n-72 private:\n-73 explicit ElementInfo ( const InstancePtr &instance );\n-74\n-75 public:\n-76 ElementInfo ();\n-77 ElementInfo ( const MeshPointer &mesh, const MacroElement ¯oElement,\n-78 typename FillFlags::Flags fillFlags = FillFlags::standard );\n-79 ElementInfo ( const MeshPointer &mesh, const Seed &seed,\n-80 typename FillFlags::Flags fillFlags = FillFlags::standard );\n-81 ElementInfo ( const ElementInfo &other );\n-82 ElementInfo ( ElementInfo&& other );\n+72 template< class Data >\n+73 inline Data *memAlloc ( size_t size )\n+74 {\n+75 return MEM_ALLOC( size, Data );\n+76 }\n+77\n+78 template< class Data >\n+79 inline Data *memCAlloc ( size_t size )\n+80 {\n+81 return MEM_CALLOC( size, Data );\n+82 }\n 83\n-84 ~ElementInfo ();\n-85\n-86 ElementInfo &operator=_( const ElementInfo &other );\n-87 ElementInfo &operator=_( ElementInfo &&other );\n-88\n-89 explicit operator bool () const { return (instance_ != null()); }\n-90\n-91 bool operator==_( const ElementInfo &other ) const;\n-92 bool operator!=_( const ElementInfo &other ) const;\n-93\n-94 const MacroElement ¯oElement () const;\n-95 ElementInfo father () const;\n-96 int indexInFather () const;\n-97 ElementInfo child ( int i ) const;\n-98 bool isLeaf () const;\n-99\n-100 Seed seed () const;\n-101\n-102 MeshPointer mesh () const;\n-103\n-104 bool mightVanish () const;\n-105\n-106 int level () const;\n-107 // see ALBERTA documentation for definition of element type\n-108 // values are 0, 1, 2\n-109 int type () const;\n-110\n-111 int getMark () const;\n-112 void setMark ( int refCount ) const;\n-113\n-114 bool hasLeafNeighbor ( const int face ) const;\n-115 ElementInfo leafNeighbor ( const int face ) const;\n-116\n-117 /* obtain all level neighbors of a face\n-118 *\n-119 * param[in] face face for which the neighbors are desired\n-120 * param[out] neighbor array storing the neighbors\n-121 * param[out] faceInNeighbor array storing the faces in neighbor\n-122 * (-1, if this neighbor does not exist)\n-123 *\n-124 * returns (potential) number of neighbors (i.e., the number of valid\n-125 * entries in the output arrays\n-126 */\n-127 int levelNeighbors ( const int face, ElementInfo (&neighbor)\n-[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const;\n-128\n-129 template< int codim >\n-130 int twist ( int subEntity ) const;\n-131 int twistInNeighbor ( int face ) const;\n-132 bool isBoundary ( int face ) const;\n-133 int boundaryId ( int face ) const;\n-134 AffineTransformation *transformation ( int face ) const;\n-135 BasicNodeProjection *boundaryProjection ( int face ) const;\n-136\n-137 bool hasCoordinates () const;\n-138 const GlobalVector &coordinate ( int vertex ) const;\n-139#if !DUNE_ALBERTA_CACHE_COORDINATES\n-140 GeometryCache geometryCache () const\n-141 {\n-142 return GeometryCache( instance_->geometryCache, instance_->elInfo );\n-143 }\n-144#endif\n-145\n-146 template< class Functor >\n-147 void hierarchicTraverse ( Functor &functor ) const;\n-148\n-149 template< class Functor >\n-150 void leafTraverse ( Functor &functor ) const;\n-151\n-152 const Element *element () const;\n-153 const Element *neighbor ( int face ) const;\n-154 Element *el () const;\n-155 ALBERTA EL_INFO &elInfo () const;\n-156\n-157 static ElementInfo\n-158 createFake ( const MeshPointer &mesh,\n-159 const Element *element, int level, int type = 0 );\n-160 static ElementInfo createFake ( const ALBERTA EL_INFO &elInfo );\n+84 template< class Data >\n+85 inline Data *memReAlloc ( Data *ptr, size_t oldSize, size_t newSize )\n+86 {\n+87 return MEM_REALLOC( ptr, oldSize, newSize, Data );\n+88 }\n+89\n+90 template< class Data >\n+91 inline void memFree ( Data *ptr, size_t size )\n+92 {\n+93 return MEM_FREE( ptr, size, Data );\n+94 }\n+95\n+96\n+97\n+98 // GlobalSpace\n+99 // -----------\n+100\n+101 class GlobalSpace\n+102 {\n+103 typedef GlobalSpace This;\n+104\n+105 public:\n+106 typedef GlobalMatrix Matrix;\n+107 typedef GlobalVector Vector;\n+108\n+109 private:\n+110 Matrix identityMatrix_;\n+111 Vector nullVector_;\n+112\n+113 GlobalSpace ()\n+114 {\n+115 for( int i = 0; i < dimWorld; ++i )\n+116 {\n+117 for( int j = 0; j < dimWorld; ++j )\n+118 identityMatrix_[ i ][ j ] = Real( 0 );\n+119 identityMatrix_[ i ][ i ] = Real( 1 );\n+120 nullVector_[ i ] = Real( 0 );\n+121 }\n+122 }\n+123\n+124 static This &instance ()\n+125 {\n+126 static This theInstance;\n+127 return theInstance;\n+128 }\n+129\n+130 public:\n+131 static const Matrix &identityMatrix ()\n+132 {\n+133 return instance().identityMatrix_;\n+134 }\n+135\n+136 static const Vector &nullVector ()\n+137 {\n+138 return instance().nullVector_;\n+139 }\n+140 };\n+141\n+142\n+143\n+144 // NumSubEntities\n+145 // --------------\n+146\n+147 template< int dim, int codim >\n+148 struct NumSubEntities;\n+149\n+150 template< int dim >\n+151 struct NumSubEntities< dim, 0 >\n+152 {\n+153 static const int value = 1;\n+154 };\n+155\n+156 template< int dim >\n+157 struct NumSubEntities< dim, dim >\n+158 {\n+159 static const int value = dim+1;\n+160 };\n 161\n-162 private:\n-163 static bool isLeaf ( Element *element );\n-164 static bool mightVanish ( Element *element, int depth );\n-165\n-166 static void fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO\n-&elInfo );\n-167 static void fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA\n-EL_INFO &elInfo );\n-168\n-169 void addReference () const;\n-170 void removeReference () const;\n-171\n-172 static InstancePtr null ();\n-173 static Stack &stack ();\n-174\n-175 InstancePtr instance_;\n-176 };\n-177\n-178\n+162 template<>\n+163 struct NumSubEntities< 0, 0 >\n+164 {\n+165 static const int value = 1;\n+166 };\n+167\n+168 template<>\n+169 struct NumSubEntities< 2, 1 >\n+170 {\n+171 static const int value = 3;\n+172 };\n+173\n+174 template<>\n+175 struct NumSubEntities< 3, 1 >\n+176 {\n+177 static const int value = 4;\n+178 };\n 179\n-180 // ElementInfo::Instance\n-181 // ---------------------\n-182\n-183 template< int dim >\n-184 struct ElementInfo< dim >::Instance\n-185 {\n-186 ALBERTA EL_INFO elInfo;\n-187 unsigned int refCount;\n-188\n-189 InstancePtr &parent ()\n-190 {\n-191 return parent_;\n-192 }\n+180 template<>\n+181 struct NumSubEntities< 3, 2 >\n+182 {\n+183 static const int value = 6;\n+184 };\n+185\n+186\n+187\n+188 // CodimType\n+189 // ---------\n+190\n+191 template< int dim, int codim >\n+192 struct CodimType;\n 193\n-194 private:\n-195 InstancePtr parent_;\n-196\n-197#if !DUNE_ALBERTA_CACHE_COORDINATES\n-198 public:\n-199 Alberta::GeometryCache<_dim_> geometryCache;\n-200#endif\n-201 };\n-202\n-203\n-204\n-205 // ElementInfo::Stack\n-206 // ------------------\n-207\n-208 template< int dim >\n-209 class ElementInfo< dim >::Stack\n-210 {\n-211 InstancePtr top_;\n-212 Instance null_;\n-213\n-214 public:\n-215 Stack ();\n-216 ~Stack ();\n+194 template< int dim >\n+195 struct CodimType< dim, 0 >\n+196 {\n+197 static const int value = CENTER;\n+198 };\n+199\n+200 template< int dim >\n+201 struct CodimType< dim, dim >\n+202 {\n+203 static const int value = VERTEX;\n+204 };\n+205\n+206 template<>\n+207 struct CodimType< 2, 1 >\n+208 {\n+209 static const int value = EDGE;\n+210 };\n+211\n+212 template<>\n+213 struct CodimType< 3, 1 >\n+214 {\n+215 static const int value = FACE;\n+216 };\n 217\n-218 InstancePtr allocate ();\n-219 void release ( InstancePtr &p );\n-220 InstancePtr null ();\n-221 };\n-222\n+218 template<>\n+219 struct CodimType< 3, 2 >\n+220 {\n+221 static const int value = EDGE;\n+222 };\n 223\n 224\n-225 // ElementInfo::Library\n-226 // --------------------\n-227\n-228 template< int dim >\n-229 template< int >\n-230 struct ElementInfo< dim >::Library\n+225\n+226 // FillFlags\n+227 // ---------\n+228\n+229 template< int dim >\n+230 struct FillFlags\n 231 {\n-232 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n+232 typedef ALBERTA FLAGS Flags;\n 233\n-234 static const int maxLevelNeighbors = (1 << (dim-1));\n+234 static const Flags nothing = FILL_NOTHING;\n 235\n-236 static int\n-237 leafNeighbor ( const ElementInfo &element, const int face, ElementInfo\n-&neighbor );\n-238\n-239 static int\n-240 levelNeighbors ( const ElementInfo &element, const int face,\n-241 ElementInfo (&neighbor)[ maxLevelNeighbors ], int (&faceInNeighbor)\n-[ maxLevelNeighbors ] );\n-242\n-243 private:\n-244 static int\n-245 macroNeighbor ( const ElementInfo &element, const int face, ElementInfo\n-&neighbor );\n-246 };\n+236 static const Flags coords = FILL_COORDS;\n+237\n+238 static const Flags neighbor = FILL_NEIGH;\n+239\n+240 static const Flags orientation = (dim == 3 ? FILL_ORIENTATION : FILL_\n+NOTHING);\n+241\n+242 static const Flags projection = FILL_PROJECTION;\n+243\n+244 static const Flags elementType = FILL_NOTHING;\n+245\n+246 static const Flags boundaryId = FILL_MACRO_WALLS;\n 247\n-248\n+248 static const Flags nonPeriodic = FILL_NON_PERIODIC;\n 249\n-250 // ElementInfo::Seed\n-251 // -----------------\n+250 static const Flags all = coords | neighbor | boundaryId | nonPeriodic\n+251 | orientation | projection | elementType;\n 252\n-253 template< int dim >\n-254 struct ElementInfo< dim >::Seed\n-255 {\n-256 Seed ()\n-257 : macroIndex_( -1 ), level_( 0 ), path_( 0 )\n-258 {}\n-259\n-260 Seed ( const int macroIndex, const int level, const unsigned long path )\n-261 : macroIndex_( macroIndex ), level_( level ), path_( path )\n-262 {}\n+253 static const Flags standardWithCoords = all & ~nonPeriodic & ~projection;\n+254\n+255#if DUNE_ALBERTA_CACHE_COORDINATES\n+256 static const Flags standard = standardWithCoords & ~coords;\n+257#else\n+258 static const Flags standard = standardWithCoords;\n+259#endif\n+260 };\n+261\n+262\n 263\n-264 bool operator==_( const Seed &other ) const\n-265 {\n-266 return (macroIndex() == other.macroIndex()) && (level() == other.level())\n-&& (path() == other.path());\n-267 }\n-268\n-269 bool operator< ( const Seed &other ) const\n-270 {\n-271 const bool ml = (macroIndex() < other.macroIndex());\n-272 const bool me = (macroIndex() == other.macroIndex());\n-273 const bool ll = (level() < other.level());\n-274 const bool le = (level() == other.level());\n-275 const bool pl = (path() < other.path());\n-276 return ml | (me & (ll | (le & pl)));\n-277 }\n+264 // RefinementEdge\n+265 // --------------\n+266\n+267 template< int dim >\n+268 struct RefinementEdge\n+269 {\n+270 static const int value = 0;\n+271 };\n+272\n+273 template<>\n+274 struct RefinementEdge< 2 >\n+275 {\n+276 static const int value = 2;\n+277 };\n 278\n-279 bool operator!=_( const Seed &other ) const { return !(*this == other); }\n-280 bool operator<= ( const Seed &other ) const { return !(other < *this); }\n-281 bool operator> ( const Seed &other ) const { return (other < *this); }\n-282 bool operator>= ( const Seed &other ) const { return !(*this < other); }\n+279\n+280\n+281 // Dune2AlbertaNumbering\n+282 // ---------------------\n 283\n-284 bool isValid ( ) const { return macroIndex_ != -1; }\n-285\n-286 int macroIndex () const { return macroIndex_; }\n-287 int level () const { return level_; }\n-288 unsigned long path () const { return path_; }\n-289\n-290 private:\n-291 int macroIndex_;\n-292 int level_;\n-293 unsigned long path_;\n-294 };\n-295\n-296\n-297\n-298 // Implementation of ElementInfo\n-299 // -----------------------------\n-300\n-301 template< int dim >\n-302 inline ElementInfo<_dim_>::ElementInfo ( const InstancePtr &instance )\n-303 : instance_( instance )\n-304 {\n-305 addReference();\n-306 }\n+284 template< int dim, int codim >\n+285 struct Dune2AlbertaNumbering\n+286 {\n+287 static int apply ( const int i )\n+288 {\n+289 assert( (i >= 0) && (i < NumSubEntities<_dim,_codim_>::value) );\n+290 return i;\n+291 }\n+292 };\n+293\n+294 template<>\n+295 struct Dune2AlbertaNumbering< 3, 2 >\n+296 {\n+297 static const int numSubEntities = NumSubEntities<_3,_2_>::value;\n+298\n+299 static int apply ( const int i )\n+300 {\n+301 assert( (i >= 0) && (i < numSubEntities) );\n+302 static int dune2alberta[ numSubEntities ] = { 0, 3, 1, 2, 4, 5 };\n+303 return dune2alberta[ i ];\n+304 }\n+305 };\n+306\n 307\n 308\n-309 template< int dim >\n-310 inline ElementInfo<_dim_>::ElementInfo ()\n-311 : instance_( null() )\n-312 {\n-313 addReference();\n-314 }\n-315\n-316\n-317 template< int dim >\n-318 inline ElementInfo<_dim_>\n-319_::ElementInfo ( const MeshPointer &mesh, const MacroElement ¯oElement,\n-320 typename FillFlags::Flags fillFlags )\n-321 {\n-322 instance_ = stack().allocate();\n-323 instance_->parent() = null();\n-324 ++(instance_->parent()->refCount);\n-325\n-326 addReference();\n-327\n-328 elInfo().fill_flag = fillFlags;\n-329\n-330 // Alberta fills opp_vertex only if there is a neighbor\n-331 for( int k = 0; k < maxNeighbors; ++k )\n-332 elInfo().opp_vertex[ k ] = -1;\n-333\n-334 fill( mesh, ¯oElement, elInfo() );\n-335 }\n-336\n-337\n-338 template< int dim >\n-339 inline ElementInfo<_dim_>\n-340_::ElementInfo ( const MeshPointer &mesh, const Seed &seed,\n-341 typename FillFlags::Flags fillFlags )\n-342 {\n-343 instance_ = stack().allocate();\n-344 instance_->parent() = null();\n-345 ++(instance_->parent()->refCount);\n+309 // Generic2AlbertaNumbering\n+310 // ------------------------\n+311\n+312 template< int dim, int codim >\n+313 struct Generic2AlbertaNumbering\n+314 {\n+315 static int apply ( const int i )\n+316 {\n+317 assert( (i >= 0) && (i < NumSubEntities<_dim,_codim_>::value) );\n+318 return i;\n+319 }\n+320 };\n+321\n+322 template< int dim >\n+323 struct Generic2AlbertaNumbering< dim, 1 >\n+324 {\n+325 static int apply ( const int i )\n+326 {\n+327 assert( (i >= 0) && (i < NumSubEntities<_dim,_1_>::value) );\n+328 return dim - i;\n+329 }\n+330 };\n+331\n+332 template<>\n+333 struct Generic2AlbertaNumbering< 1, 1 >\n+334 {\n+335 static int apply ( const int i )\n+336 {\n+337 assert( (i >= 0) && (i < NumSubEntities<_1,_1_>::value) );\n+338 return i;\n+339 }\n+340 };\n+341\n+342 template<>\n+343 struct Generic2AlbertaNumbering< 3, 2 >\n+344 {\n+345 static const int numSubEntities = NumSubEntities<_3,_2_>::value;\n 346\n-347 addReference();\n-348\n-349 // fill in macro element info\n-350 elInfo().fill_flag = fillFlags;\n-351\n-352 // Alberta fills opp_vertex only if there is a neighbor\n-353 for( int k = 0; k < maxNeighbors; ++k )\n-354 elInfo().opp_vertex[ k ] = -1;\n+347 static int apply ( const int i )\n+348 {\n+349 assert( (i >= 0) && (i < numSubEntities) );\n+350 static int generic2alberta[ numSubEntities ] = { 0, 1, 3, 2, 4, 5 };\n+351 return generic2alberta[ i ];\n+352 }\n+353 };\n+354\n 355\n-356 fill( mesh, ((Mesh *)mesh)->macro_els + seed.macroIndex(), elInfo() );\n-357\n-358 // traverse the seed's path\n-359 unsigned long path = seed.path();\n-360 for( int i = 0; i < seed.level(); ++i )\n-361 {\n-362 InstancePtr child = stack().allocate();\n-363 child->parent() = instance_;\n+356\n+357 // NumberingMap\n+358 // ------------\n+359\n+360 template< int dim, template< int, int > class Numbering =\n+Generic2AlbertaNumbering >\n+361 class NumberingMap\n+362 {\n+363 typedef NumberingMap<_dim,_Numbering_> This;\n 364\n-365 // Alberta fills opp_vertex only if there is a neighbor\n-366 for( int k = 0; k < maxNeighbors; ++k )\n-367 child->elInfo.opp_vertex[ k ] = -2;\n-368\n-369 fill( path & 1, elInfo(), child->elInfo );\n-370\n-371 instance_ = child;\n-372 addReference();\n-373\n-374 path = path >> 1;\n-375 }\n-376\n-377 assert( this->seed() == seed );\n-378 }\n-379\n+365 template< int codim >\n+366 struct Initialize;\n+367\n+368 int *dune2alberta_[ dim+1 ];\n+369 int *alberta2dune_[ dim+1 ];\n+370 int numSubEntities_[ dim+1 ];\n+371\n+372 NumberingMap ( const This & );\n+373 This &operator= ( const This & );\n+374\n+375 public:\n+376 NumberingMap ()\n+377 {\n+378 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n+{ Initialize< i >::apply( *this ); } );\n+379 }\n 380\n-381 template< int dim >\n-382 inline ElementInfo<_dim_>::ElementInfo ( const ElementInfo &other )\n-383 : instance_( other.instance_ )\n+381 ~NumberingMap ()\n+382 {\n+383 for( int codim = 0; codim <= dim; ++codim )\n 384 {\n-385 addReference();\n-386 }\n-387\n-388 template< int dim >\n-389 inline ElementInfo<_dim_>::ElementInfo ( ElementInfo &&other )\n-390 : instance_( NULL )\n+385 delete[]( dune2alberta_[ codim ] );\n+386 delete[]( alberta2dune_[ codim ] );\n+387 }\n+388 }\n+389\n+390 int dune2alberta ( int codim, int i ) const\n 391 {\n-392 using std::swap;\n-393 swap( instance_, other.instance_ );\n-394 }\n-395\n-396 template< int dim >\n-397 inline ElementInfo<_dim_>::~ElementInfo ()\n+392 assert( (codim >= 0) && (codim <= dim) );\n+393 assert( (i >= 0) && (i < numSubEntities( codim )) );\n+394 return dune2alberta_[ codim ][ i ];\n+395 }\n+396\n+397 int alberta2dune ( int codim, int i ) const\n 398 {\n-399 removeReference();\n-400 }\n-401\n-402\n-403 template< int dim >\n-404 inline ElementInfo<_dim_> &\n-405 ElementInfo<_dim_>::operator=_( const ElementInfo<_dim_> &other )\n-406 {\n-407 other.addReference();\n-408 removeReference();\n-409 instance_ = other.instance_;\n-410 return *this;\n-411 }\n+399 assert( (codim >= 0) && (codim <= dim) );\n+400 assert( (i >= 0) && (i < numSubEntities( codim )) );\n+401 return alberta2dune_[ codim ][ i ];\n+402 }\n+403\n+404 int numSubEntities ( int codim ) const\n+405 {\n+406 assert( (codim >= 0) && (codim <= dim) );\n+407 return numSubEntities_[ codim ];\n+408 }\n+409 };\n+410\n+411\n 412\n-413 template< int dim >\n-414 inline ElementInfo<_dim_> &\n-415 ElementInfo<_dim_>::operator=_( ElementInfo<_dim_> &&other )\n-416 {\n-417 using std::swap;\n-418 swap( instance_, other.instance_ );\n-419 return *this;\n-420 }\n+413 // NumberingMap::Initialize\n+414 // ------------------------\n+415\n+416 template< int dim, template< int, int > class Numbering >\n+417 template< int codim >\n+418 struct NumberingMap< dim, Numbering >::Initialize\n+419 {\n+420 static const int numSubEntities = NumSubEntities< dim, codim >::value;\n 421\n-422 template< int dim >\n-423 inline bool\n-424 ElementInfo<_dim_>::operator==_( const ElementInfo<_dim_> &other ) const\n-425 {\n-426 return (instance_->elInfo.el == other.instance_->elInfo.el);\n-427 }\n-428\n-429\n-430 template< int dim >\n-431 inline bool\n-432 ElementInfo<_dim_>::operator!=_( const ElementInfo<_dim_> &other ) const\n-433 {\n-434 return (instance_->elInfo.el != other.instance_->elInfo.el);\n-435 }\n+422 static void apply ( NumberingMap< dim, Numbering > &map )\n+423 {\n+424 map.numSubEntities_[ codim ] = numSubEntities;\n+425 map.dune2alberta_[ codim ] = new int[ numSubEntities ];\n+426 map.alberta2dune_[ codim ] = new int[ numSubEntities ];\n+427\n+428 for( int i = 0; i < numSubEntities; ++i )\n+429 {\n+430 const int j = Numbering< dim, codim >::apply( i );\n+431 map.dune2alberta_[ codim ][ i ] = j;\n+432 map.alberta2dune_[ codim ][ j ] = i;\n+433 }\n+434 }\n+435 };\n 436\n 437\n-438 template< int dim >\n-439 inline const typename ElementInfo<_dim_>::MacroElement &\n-440 ElementInfo<_dim_>::macroElement () const\n-441 {\n-442 assert( !!(*this) );\n-443 assert( elInfo().macro_el != NULL );\n-444 return static_cast< const MacroElement & >( *(elInfo().macro_el) );\n-445 }\n-446\n-447\n-448 template< int dim >\n-449 inline ElementInfo<_dim_> ElementInfo<_dim_>::father () const\n-450 {\n-451 assert( !!(*this) );\n-452 return ElementInfo<_dim_>( instance_->parent() );\n+438\n+439 // MapVertices\n+440 // -----------\n+441\n+442 template< int dim, int codim >\n+443 struct MapVertices;\n+444\n+445 template< int dim >\n+446 struct MapVertices< dim, 0 >\n+447 {\n+448 static int apply ( int subEntity, int vertex )\n+449 {\n+450 assert( subEntity == 0 );\n+451 assert( (vertex >= 0) && (vertex <= NumSubEntities<_dim,_dim_>::value) );\n+452 return vertex;\n 453 }\n-454\n+454 };\n 455\n-456 template< int dim >\n-457 inline int ElementInfo<_dim_>::indexInFather () const\n+456 template<>\n+457 struct MapVertices< 2, 1 >\n 458 {\n-459 const Element *element = elInfo().el;\n-460 const Element *father = elInfo().parent->el;\n-461 assert( father != NULL );\n-462\n-463 const int index = (father->child[ 0 ] == element ? 0 : 1);\n-464 assert( father->child[ index ] == element );\n-465 return index;\n+459 static int apply ( int subEntity, int vertex )\n+460 {\n+461 assert( (subEntity >= 0) && (subEntity < 3) );\n+462 assert( (vertex >= 0) && (vertex < 2) );\n+463 //static const int map[ 3 ][ 2 ] = { {1,2}, {2,0}, {0,1} };\n+464 static const int map[ 3 ][ 2 ] = { {1,2}, {0,2}, {0,1} };\n+465 return map[ subEntity ][ vertex ];\n 466 }\n-467\n+467 };\n 468\n-469 template< int dim >\n-470 inline ElementInfo<_dim_> ElementInfo<_dim_>::child ( int i ) const\n+469 template<>\n+470 struct MapVertices< 3, 1 >\n 471 {\n-472 assert( !isLeaf() );\n-473\n-474 InstancePtr child = stack().allocate();\n-475 child->parent() = instance_;\n-476 addReference();\n-477\n-478 // Alberta fills opp_vertex only if there is a neighbor\n-479 for( int k = 0; k < maxNeighbors; ++k )\n-480 child->elInfo.opp_vertex[ k ] = -2;\n+472 static int apply ( int subEntity, int vertex )\n+473 {\n+474 assert( (subEntity >= 0) && (subEntity < 4) );\n+475 assert( (vertex >= 0) && (vertex < 3) );\n+476 //static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,3,2}, {0,1,3}, {0,2,1} };\n+477 static const int map[ 4 ][ 3 ] = { {1,2,3}, {0,2,3}, {0,1,3}, {0,1,2} };\n+478 return map[ subEntity ][ vertex ];\n+479 }\n+480 };\n 481\n-482 fill( i, elInfo(), child->elInfo );\n-483 return ElementInfo<_dim_>( child );\n-484 }\n-485\n-486\n-487 template< int dim >\n-488 inline bool ElementInfo<_dim_>::isLeaf () const\n-489 {\n-490 assert( !(*this) == false );\n-491 return isLeaf( el() );\n-492 }\n+482 template<>\n+483 struct MapVertices< 3, 2 >\n+484 {\n+485 static int apply ( int subEntity, int vertex )\n+486 {\n+487 assert( (subEntity >= 0) && (subEntity < 6) );\n+488 assert( (vertex >= 0) && (vertex < 2) );\n+489 static const int map[ 6 ][ 2 ] = { {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3}\n+};\n+490 return map[ subEntity ][ vertex ];\n+491 }\n+492 };\n 493\n-494\n-495 template< int dim >\n-496 inline typename ElementInfo<_dim_>::Seed ElementInfo<_dim_>::seed () const\n-497 {\n-498 assert( !!(*this) );\n-499\n-500 int level = 0;\n-501 unsigned long path = 0;\n-502 for( InstancePtr p = instance_; p->parent() != null(); p = p->parent() )\n-503 {\n-504 const Element *element = p->elInfo.el;\n-505 const Element *father = p->parent()->elInfo.el;\n-506 const unsigned long child = static_cast< unsigned long >( father->child[ 1\n-] == element );\n-507 path = (path << 1) | child;\n-508 ++level;\n-509 }\n-510\n-511 if( level != elInfo().level )\n-512 DUNE_THROW( NotImplemented, \"Seed for fake elements not implemented.\" );\n-513\n-514 return Seed( macroElement().index, level, path );\n-515 }\n-516\n-517\n-518 template< int dim >\n-519 inline typename ElementInfo<_dim_>::MeshPointer ElementInfo<_dim_>::mesh ()\n-const\n-520 {\n-521 return MeshPointer( elInfo().mesh );\n-522 }\n-523\n-524\n-525 template< int dim >\n-526 inline bool ElementInfo<_dim_>::mightVanish () const\n-527 {\n-528 return mightVanish( el(), 0 );\n-529 }\n-530\n-531\n-532 template< int dim >\n-533 inline int ElementInfo<_dim_>::level () const\n-534 {\n-535 return elInfo().level;\n-536 }\n+494 template< int dim >\n+495 struct MapVertices< dim, dim >\n+496 {\n+497 static int apply ( int subEntity, int vertex )\n+498 {\n+499 assert( (subEntity >= 0) && (subEntity < NumSubEntities<_dim,_1_>::value)\n+);\n+500 assert( vertex == 0 );\n+501 return subEntity;\n+502 }\n+503 };\n+504\n+505\n+506\n+507 // Twist\n+508 // -----\n+509\n+510 // ******************************************************************\n+511 // Meaning of the twist (same as in ALU)\n+512 // -------------------------------------\n+513 //\n+514 // Consider a fixed ordering of the vertices v_1, ... v_n of a face\n+515 // (here, we assume their indices to be increasing). Denote by k the\n+516 // local number of a vertex v within the element and by t the twist.\n+517 // Then, v = v_j, where j is computed by the following formula:\n+518 //\n+519 // / (2n + 1 - k + t) % n, if t < 0\n+520 // j = <\n+521 // \\ (k + t) % n, if t >= 0\n+522 //\n+523 // Note: We use the order of the 0-th vertex dof to assign the twist.\n+524 // This is ok for two reasons:\n+525 // - ALBERTA preserves the relative order of the dofs during\n+526 // dof compression.\n+527 // - ALBERTA enforces the first vertex dof admin to be periodic.\n+528 // ******************************************************************\n+529\n+530 template< int dim, int subdim >\n+531 struct Twist\n+532 {\n+533 static const int numSubEntities = NumSubEntities< dim, dim-subdim >::value;\n+534\n+535 static const int minTwist = 0;\n+536 static const int maxTwist = 0;\n 537\n-538\n-539 template< int dim >\n-540 inline int ElementInfo<_dim_>::type () const\n-541 {\n+538 static int twist ( [[maybe_unused]] const Element *element,\n+539 [[maybe_unused]] int subEntity )\n+540 {\n+541 assert( (subEntity >= 0) && (subEntity < numSubEntities) );\n 542 return 0;\n 543 }\n-544\n+544 };\n 545\n-546 template<>\n-547 inline int ElementInfo<_3_>::type () const\n+546 template< int dim >\n+547 struct Twist< dim, 1 >\n 548 {\n-549 return instance_->elInfo.el_type;\n-550 }\n-551\n-552\n-553 template< int dim >\n-554 inline int ElementInfo<_dim_>::getMark () const\n+549 static const int numSubEntities = NumSubEntities< dim, dim-1 >::value;\n+550\n+551 static const int minTwist = 0;\n+552 static const int maxTwist = 1;\n+553\n+554 static int twist ( const Element *element, int subEntity )\n 555 {\n-556 return el()->mark;\n-557 }\n-558\n-559\n-560 template< int dim >\n-561 inline void ElementInfo<_dim_>::setMark ( int refCount ) const\n-562 {\n-563 assert( isLeaf() );\n-564 assert( (refCount >= -128) && (refCount < 127) );\n-565 el()->mark = refCount;\n-566 }\n+556 assert( (subEntity >= 0) && (subEntity < numSubEntities) );\n+557 const int numVertices = NumSubEntities<_1,_1_>::value;\n+558 int dof[ numVertices ];\n+559 for( int i = 0; i < numVertices; ++i )\n+560 {\n+561 const int j = MapVertices<_dim,_dim-1_>::apply( subEntity, i );\n+562 dof[ i ] = element->dof[ j ][ 0 ];\n+563 }\n+564 return (dof[ 0 ] < dof[ 1 ] ? 0 : 1);\n+565 }\n+566 };\n 567\n 568\n-569 template< int dim >\n-570 inline bool ElementInfo<_dim_>::hasLeafNeighbor ( const int face ) const\n+569 template<>\n+570 struct Twist< 1, 1 >\n 571 {\n-572 assert( !!(*this) );\n-573 assert( (face >= 0) && (face < maxNeighbors) );\n+572 static const int minTwist = 0;\n+573 static const int maxTwist = 0;\n 574\n-575 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n-576 const int macroFace = elInfo().macro_wall[ face ];\n-577 if( macroFace >= 0 )\n-578 return (macroElement().neighbor( macroFace ) != NULL);\n-579 else\n-580 return true;\n-581 }\n+575 static int twist ( [[maybe_unused]] const Element *element,\n+576 [[maybe_unused]] int subEntity )\n+577 {\n+578 assert( subEntity == 0 );\n+579 return 0;\n+580 }\n+581 };\n 582\n 583\n 584 template< int dim >\n-585 inline ElementInfo<_dim_> ElementInfo<_dim_>::leafNeighbor ( const int face\n-) const\n+585 struct Twist< dim, 2 >\n 586 {\n-587 assert( (face >= 0) && (face < numFaces) );\n-588 ElementInfo neighbor;\n-589 Library< dimWorld >::leafNeighbor( *this, face, neighbor );\n-590 return neighbor;\n-591 }\n-592\n-593\n-594 template< int dim >\n-595 inline int ElementInfo<_dim_>\n-596_::levelNeighbors ( const int face, ElementInfo (&neighbor)\n-[ maxLevelNeighbors ], int (&faceInNeighbor)[ maxLevelNeighbors ] ) const\n-597 {\n-598 assert( (face >= 0) && (face < numFaces) );\n-599 return Library< dimWorld >::levelNeighbors( *this, face, neighbor,\n-faceInNeighbor );\n-600 }\n-601\n+587 static const int numSubEntities = NumSubEntities< dim, dim-2 >::value;\n+588\n+589 static const int minTwist = -3;\n+590 static const int maxTwist = 2;\n+591\n+592 static int twist ( const Element *element, int subEntity )\n+593 {\n+594 assert( (subEntity >= 0) && (subEntity < numSubEntities) );\n+595 const int numVertices = NumSubEntities<_2,_2_>::value;\n+596 int dof[ numVertices ];\n+597 for( int i = 0; i < numVertices; ++i )\n+598 {\n+599 const int j = MapVertices<_dim,_dim-2_>::apply( subEntity, i );\n+600 dof[ i ] = element->dof[ j ][ 0 ];\n+601 }\n 602\n-603 template< int dim >\n-604 template< int codim >\n-605 inline int ElementInfo<_dim_>::twist ( int subEntity ) const\n-606 {\n-607 return Twist<_dim,_dim-codim_>::twist( element(), subEntity );\n-608 }\n-609\n-610\n-611 template< int dim >\n-612 inline int ElementInfo<_dim_>::twistInNeighbor ( const int face ) const\n-613 {\n-614 assert( neighbor( face ) != NULL );\n-615 return Twist<_dim,_dim-1_>::twist( neighbor( face ), elInfo().opp_vertex\n-[ face ] );\n-616 }\n-617\n+603 const int twist[ 8 ] = { -2, 1, 666, -1, 2, 666, -3, 0 };\n+604 const int k = int( dof[ 0 ] < dof[ 1 ] )\n+605 | (int( dof[ 0 ] < dof[ 2 ] ) << 1)\n+606 | (int( dof[ 1 ] < dof[ 2 ] ) << 2);\n+607 assert( twist[ k ] != 666 );\n+608 return twist[ k ];\n+609 }\n+610 };\n+611\n+612\n+613 template<>\n+614 struct Twist< 2, 2 >\n+615 {\n+616 static const int minTwist = 0;\n+617 static const int maxTwist = 0;\n 618\n-619 template< int dim >\n-620 inline bool ElementInfo<_dim_>::isBoundary ( int face ) const\n+619 static int twist ( [[maybe_unused]] const Element *element,\n+620 [[maybe_unused]] int subEntity )\n 621 {\n-622 assert( !!(*this) );\n-623 assert( (face >= 0) && (face < maxNeighbors) );\n-624\n-625 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n-626 const int macroFace = elInfo().macro_wall[ face ];\n-627 if( macroFace >= 0 )\n-628 return macroElement().isBoundary( macroFace );\n-629 else\n-630 return false;\n-631 }\n-632\n-633\n-634 template< int dim >\n-635 inline int ElementInfo<_dim_>::boundaryId ( int face ) const\n-636 {\n-637 assert( !!(*this) );\n-638 assert( (face >= 0) && (face < N_WALLS_MAX) );\n-639\n-640 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n-641 const int macroFace = elInfo().macro_wall[ face ];\n-642 const int id = macroElement().boundaryId( macroFace );\n-643 // this assertion is only allowed, if FILL_BOUND is set\n-644 // assert( id == elInfo().wall_bound[ face ] );\n-645 return id;\n-646 }\n-647\n+622 assert( subEntity == 0 );\n+623 return 0;\n+624 }\n+625 };\n+626\n+627\n+628\n+629 template< int dim >\n+630 inline int applyTwist ( int twist, int i )\n+631 {\n+632 const int numCorners = NumSubEntities<_dim,_dim_>::value;\n+633 return (twist < 0 ? (2*numCorners + 1 - i + twist) : i + twist) %\n+numCorners;\n+634 }\n+635\n+636 template< int dim >\n+637 inline int applyInverseTwist ( int twist, int i )\n+638 {\n+639 const int numCorners = NumSubEntities<_dim,_dim_>::value;\n+640 return (twist < 0 ? (2*numCorners + 1 - i + twist) : numCorners + i -\n+twist) % numCorners;\n+641 }\n+642\n+643 }\n+644\n+645}\n+646\n+647#endif // #if HAVE_ALBERTA\n 648\n-649 template< int dim >\n-650 inline AffineTransformation *\n-651 ElementInfo<_dim_>::transformation ( int face ) const\n-652 {\n-653 assert( !!(*this) );\n-654 assert( (face >= 0) && (face < N_WALLS_MAX) );\n-655\n-656 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n-657 const int macroFace = elInfo().macro_wall[ face ];\n-658 return (macroFace < 0 ? NULL : macroElement().wall_trafo[ macroFace ]);\n-659 }\n-660\n-661\n-662 template< int dim >\n-663 inline BasicNodeProjection *\n-664 ElementInfo<_dim_>::boundaryProjection ( int face ) const\n-665 {\n-666 assert( !!(*this) );\n-667 assert( (face >= 0) && (face < N_WALLS_MAX) );\n-668\n-669 assert( (elInfo().fill_flag & FillFlags::boundaryId) != 0 );\n-670 const int macroFace = elInfo().macro_wall[ face ];\n-671 if( macroFace >= 0 )\n-672 return static_cast< BasicNodeProjection * >( macroElement().projection\n-[ macroFace+1 ] );\n-673 else\n-674 return 0;\n-675 }\n-676\n-677\n-678 template< int dim >\n-679 inline bool ElementInfo<_dim_>::hasCoordinates () const\n-680 {\n-681 return ((elInfo().fill_flag & FillFlags::coords) != 0);\n-682 }\n-683\n-684 template< int dim >\n-685 inline const GlobalVector &ElementInfo<_dim_>::coordinate ( int vertex )\n-const\n-686 {\n-687 assert( hasCoordinates() );\n-688 assert( (vertex >= 0) && (vertex < numVertices) );\n-689 return elInfo().coord[ vertex ];\n-690 }\n-691\n-692\n-693 template< int dim >\n-694 template< class Functor >\n-695 inline void ElementInfo<_dim_>::hierarchicTraverse ( Functor &functor )\n-const\n-696 {\n-697 functor( *this );\n-698 if( !isLeaf() )\n-699 {\n-700 child( 0 ).hierarchicTraverse( functor );\n-701 child( 1 ).hierarchicTraverse( functor );\n-702 }\n-703 }\n-704\n-705\n-706 template< int dim >\n-707 template< class Functor >\n-708 inline void ElementInfo<_dim_>::leafTraverse ( Functor &functor ) const\n-709 {\n-710 if( !isLeaf() )\n-711 {\n-712 child( 0 ).leafTraverse( functor );\n-713 child( 1 ).leafTraverse( functor );\n-714 }\n-715 else\n-716 functor( *this );\n-717 }\n-718\n-719\n-720 template< int dim >\n-721 inline const Element *ElementInfo<_dim_>::element () const\n-722 {\n-723 return elInfo().el;\n-724 }\n-725\n-726\n-727 template< int dim >\n-728 inline const Element *ElementInfo<_dim_>::neighbor ( int face ) const\n-729 {\n-730 assert( (face >= 0) && (face < numFaces) );\n-731 assert( (elInfo().fill_flag & FillFlags::neighbor) != 0 );\n-732 return elInfo().neigh[ face ];\n-733 }\n-734\n-735\n-736 template< int dim >\n-737 inline Element *ElementInfo<_dim_>::el () const\n-738 {\n-739 return elInfo().el;\n-740 }\n-741\n-742\n-743 template< int dim >\n-744 inline ALBERTA EL_INFO &ElementInfo<_dim_>::elInfo () const\n-745 {\n-746 return (instance_->elInfo);\n-747 }\n-748\n-749\n-750 template< int dim >\n-751 inline ElementInfo<_dim_>\n-752 ElementInfo<_dim_>::createFake ( const MeshPointer &mesh,\n-753 const Element *element, int level, int type )\n-754 {\n-755 InstancePtr instance = stack().allocate();\n-756 instance->parent() = null();\n-757 ++(instance->parent()->refCount);\n-758\n-759 instance->elInfo.mesh = mesh;\n-760 instance->elInfo.macro_el = NULL;\n-761 instance->elInfo.el = const_cast< Element * >( element );\n-762 instance->elInfo.parent = NULL;\n-763 instance->elInfo.fill_flag = FillFlags::nothing;\n-764 instance->elInfo.level = level;\n-765 instance->elInfo.el_type = type;\n-766\n-767 return ElementInfo<_dim_>( instance );\n-768 }\n-769\n-770\n-771 template< int dim >\n-772 inline ElementInfo<_dim_>\n-773 ElementInfo<_dim_>::createFake ( const ALBERTA EL_INFO &elInfo )\n-774 {\n-775 InstancePtr instance = stack().allocate();\n-776 instance->parent() = null();\n-777 ++(instance->parent()->refCount);\n-778\n-779 instance->elInfo = elInfo;\n-780 return ElementInfo<_dim_>( instance );\n-781 }\n-782\n-783\n-784 template< int dim >\n-785 inline bool ElementInfo<_dim_>::isLeaf ( Element *element )\n-786 {\n-787 return IS_LEAF_EL( element );\n-788 }\n-789\n-790\n-791 template< int dim >\n-792 inline bool ElementInfo<_dim_>::mightVanish ( Alberta::Element *element,\n-int depth )\n-793 {\n-794 if( isLeaf( element ) )\n-795 return (element->mark < depth);\n-796 else\n-797 return (mightVanish( element->child[ 0 ], depth-1 ) && mightVanish\n-( element->child[ 1 ], depth-1 ));\n-798 }\n-799\n-800\n-801 template< int dim >\n-802 inline void ElementInfo< dim >\n-803 ::fill ( Mesh *mesh, const ALBERTA MACRO_EL *mel, ALBERTA EL_INFO &elInfo )\n-804 {\n-805 ALBERTA fill_macro_info( mesh, mel, &elInfo );\n-806 }\n-807\n-808 template< int dim >\n-809 inline void ElementInfo< dim >\n-810 ::fill ( int ichild, const ALBERTA EL_INFO &parentInfo, ALBERTA EL_INFO\n-&elInfo )\n-811 {\n-812 ALBERTA fill_elinfo( ichild, FILL_ANY, &parentInfo, &elInfo );\n-813 }\n-814\n-815\n-816 template< int dim >\n-817 inline void ElementInfo< dim >::addReference () const\n-818 {\n-819 ++(instance_->refCount);\n-820 }\n-821\n-822\n-823 template< int dim >\n-824 inline void ElementInfo< dim >::removeReference () const\n-825 {\n-826 // short-circuit for rvalues that have been drained as argument to a move\n-operation\n-827 if ( !instance_ )\n-828 return;\n-829 // this loop breaks when instance becomes null()\n-830 for( InstancePtr instance = instance_; --(instance->refCount) == 0; )\n-831 {\n-832 const InstancePtr parent = instance->parent();\n-833 stack().release( instance );\n-834 instance = parent;\n-835 }\n-836 }\n-837\n-838\n-839 template< int dim >\n-840 inline typename ElementInfo< dim >::InstancePtr\n-841 ElementInfo< dim >::null ()\n-842 {\n-843 return stack().null();\n-844 }\n-845\n-846\n-847 template< int dim >\n-848 inline typename ElementInfo< dim >::Stack &\n-849 ElementInfo< dim >::stack ()\n-850 {\n-851 static Stack s;\n-852 return s;\n-853 }\n-854\n-855\n-856\n-857 // Implementation of ElementInfo::Stack\n-858 // ------------------------------------\n-859\n-860 template< int dim >\n-861 inline ElementInfo<_dim_>::Stack::Stack ()\n-862 : top_( 0 )\n-863 {\n-864 null_.elInfo.el = NULL;\n-865 null_.refCount = 1;\n-866 null_.parent() = 0;\n-867 }\n-868\n-869\n-870 template< int dim >\n-871 inline ElementInfo<_dim_>::Stack::~Stack ()\n-872 {\n-873 while( top_ != 0 )\n-874 {\n-875 InstancePtr p = top_;\n-876 top_ = p->parent();\n-877 delete p;\n-878 }\n-879 }\n-880\n-881\n-882 template< int dim >\n-883 inline typename ElementInfo<_dim_>::InstancePtr\n-884 ElementInfo<_dim_>::Stack::allocate ()\n-885 {\n-886 InstancePtr p = top_;\n-887 if( p != 0 )\n-888 top_ = p->parent();\n-889 else\n-890 p = new Instance;\n-891 p->refCount = 0;\n-892 return p;\n-893 }\n-894\n-895\n-896 template< int dim >\n-897 inline void ElementInfo<_dim_>::Stack::release ( InstancePtr &p )\n-898 {\n-899 assert( (p != null()) && (p->refCount == 0) );\n-900 p->parent() = top_;\n-901 top_ = p;\n-902 }\n-903\n-904\n-905 template< int dim >\n-906 inline typename ElementInfo<_dim_>::InstancePtr\n-907 ElementInfo<_dim_>::Stack::null ()\n-908 {\n-909 return &null_;\n-910 }\n-911\n-912 } // namespace Alberta\n-913\n-914} // namespace Dune\n-915\n-916#endif // #if HAVE_ALBERTA\n-917\n-918#endif // #ifndef DUNE_ALBERTA_ELEMENTINFO_HH\n-geometrycache.hh\n-macroelement.hh\n+649#endif // #ifndef DUNE_ALBERTA_MISC_HH\n+albertaheader.hh\n+DIM_OF_WORLD\n+#define DIM_OF_WORLD\n+Definition albertaheader.hh:23\n ALBERTA\n #define ALBERTA\n Definition albertaheader.hh:29\n-std::swap\n-void swap(Dune::PersistentContainer< G, T > &a, Dune::PersistentContainer< G, T\n-> &b)\n-Definition utility/persistentcontainer.hh:83\n Dune\n Include standard header files.\n Definition agrid.hh:60\n+Dune::Alberta::applyInverseTwist\n+int applyInverseTwist(int twist, int i)\n+Definition misc.hh:637\n Dune::Alberta::Mesh\n ALBERTA MESH Mesh\n Definition misc.hh:53\n+Dune::Alberta::applyTwist\n+int applyTwist(int twist, int i)\n+Definition misc.hh:630\n+Dune::Alberta::memFree\n+void memFree(Data *ptr, size_t size)\n+Definition misc.hh:91\n+Dune::Alberta::GlobalMatrix\n+ALBERTA REAL_DD GlobalMatrix\n+Definition misc.hh:51\n Dune::Alberta::AffineTransformation\n ALBERTA AFF_TRAFO AffineTransformation\n Definition misc.hh:52\n+Dune::Alberta::LocalVector\n+ALBERTA REAL_B LocalVector\n+Definition misc.hh:49\n Dune::Alberta::Element\n ALBERTA EL Element\n Definition misc.hh:54\n+Dune::Alberta::BoundaryId\n+ALBERTA BNDRY_TYPE BoundaryId\n+Definition misc.hh:61\n+Dune::Alberta::InteriorBoundary\n+static const int InteriorBoundary\n+Definition misc.hh:59\n+Dune::Alberta::Real\n+ALBERTA REAL Real\n+Definition misc.hh:48\n+Dune::Alberta::meshRefined\n+static const int meshRefined\n+Definition misc.hh:56\n+Dune::Alberta::memAlloc\n+Data * memAlloc(size_t size)\n+Definition misc.hh:73\n+Dune::Alberta::memReAlloc\n+Data * memReAlloc(Data *ptr, size_t oldSize, size_t newSize)\n+Definition misc.hh:85\n+Dune::Alberta::DirichletBoundary\n+static const int DirichletBoundary\n+Definition misc.hh:60\n+Dune::Alberta::DofSpace\n+ALBERTA FE_SPACE DofSpace\n+Definition misc.hh:65\n+Dune::Alberta::memCAlloc\n+Data * memCAlloc(size_t size)\n+Definition misc.hh:79\n+Dune::Alberta::dimWorld\n+static const int dimWorld\n+Definition misc.hh:46\n+Dune::Alberta::ElementType\n+U_CHAR ElementType\n+Definition misc.hh:63\n+Dune::Alberta::meshCoarsened\n+static const int meshCoarsened\n+Definition misc.hh:57\n Dune::Alberta::GlobalVector\n ALBERTA REAL_D GlobalVector\n Definition misc.hh:50\n-Dune::Alberta::MeshPointer<_dimension_>\n-Dune::Alberta::ElementInfo\n-Definition elementinfo.hh:43\n-Dune::Alberta::ElementInfo::leafNeighbor\n-ElementInfo leafNeighbor(const int face) const\n-Definition elementinfo.hh:585\n-Dune::Alberta::ElementInfo::isLeaf\n-bool isLeaf() const\n-Definition elementinfo.hh:488\n-Dune::Alberta::ElementInfo::createFake\n-static ElementInfo createFake(const MeshPointer &mesh, const Element *element,\n-int level, int type=0)\n-Definition elementinfo.hh:752\n-Dune::Alberta::ElementInfo::child\n-ElementInfo child(int i) const\n-Definition elementinfo.hh:470\n-Dune::Alberta::ElementInfo::level\n-int level() const\n-Definition elementinfo.hh:533\n-Dune::Alberta::ElementInfo::mightVanish\n-bool mightVanish() const\n-Definition elementinfo.hh:526\n-Dune::Alberta::ElementInfo::numFaces\n-static const int numFaces\n-Definition elementinfo.hh:56\n-Dune::Alberta::ElementInfo::twist\n-int twist(int subEntity) const\n-Definition elementinfo.hh:605\n-Dune::Alberta::ElementInfo::twistInNeighbor\n-int twistInNeighbor(int face) const\n-Definition elementinfo.hh:612\n-Dune::Alberta::ElementInfo::MacroElement\n-Alberta::MacroElement< dimension > MacroElement\n-Definition elementinfo.hh:58\n-Dune::Alberta::ElementInfo::boundaryProjection\n-BasicNodeProjection * boundaryProjection(int face) const\n-Definition elementinfo.hh:664\n-Dune::Alberta::ElementInfo::macroElement\n-const MacroElement & macroElement() const\n-Definition elementinfo.hh:440\n-Dune::Alberta::ElementInfo::maxLevelNeighbors\n-static const int maxLevelNeighbors\n-Definition elementinfo.hh:64\n-Dune::Alberta::ElementInfo::father\n-ElementInfo father() const\n-Definition elementinfo.hh:449\n-Dune::Alberta::ElementInfo::ElementInfo\n-ElementInfo(const ElementInfo &other)\n-Definition elementinfo.hh:382\n-Dune::Alberta::ElementInfo::GeometryCache\n-GeometryCacheProxy< dim > GeometryCache\n-Definition elementinfo.hh:67\n-Dune::Alberta::ElementInfo::operator=\n-ElementInfo & operator=(const ElementInfo &other)\n-Definition elementinfo.hh:405\n-Dune::Alberta::ElementInfo::hasLeafNeighbor\n-bool hasLeafNeighbor(const int face) const\n-Definition elementinfo.hh:570\n-Dune::Alberta::ElementInfo::operator==\n-bool operator==(const ElementInfo &other) const\n-Definition elementinfo.hh:424\n-Dune::Alberta::ElementInfo::dimension\n-static const int dimension\n-Definition elementinfo.hh:53\n-Dune::Alberta::ElementInfo::hierarchicTraverse\n-void hierarchicTraverse(Functor &functor) const\n-Definition elementinfo.hh:695\n-Dune::Alberta::ElementInfo::type\n-int type() const\n-Definition elementinfo.hh:540\n-Dune::Alberta::ElementInfo::maxNeighbors\n-static const int maxNeighbors\n-Definition elementinfo.hh:62\n-Dune::Alberta::ElementInfo::setMark\n-void setMark(int refCount) const\n-Definition elementinfo.hh:561\n-Dune::Alberta::ElementInfo::~ElementInfo\n-~ElementInfo()\n-Definition elementinfo.hh:397\n-Dune::Alberta::ElementInfo::coordinate\n-const GlobalVector & coordinate(int vertex) const\n-Definition elementinfo.hh:685\n-Dune::Alberta::ElementInfo::numVertices\n-static const int numVertices\n-Definition elementinfo.hh:55\n-Dune::Alberta::ElementInfo::getMark\n-int getMark() const\n-Definition elementinfo.hh:554\n-Dune::Alberta::ElementInfo::leafTraverse\n-void leafTraverse(Functor &functor) const\n-Definition elementinfo.hh:708\n-Dune::Alberta::ElementInfo::MeshPointer\n-Alberta::MeshPointer< dimension > MeshPointer\n-Definition elementinfo.hh:59\n-Dune::Alberta::ElementInfo::neighbor\n-const Element * neighbor(int face) const\n-Definition elementinfo.hh:728\n-Dune::Alberta::ElementInfo::createFake\n-static ElementInfo createFake(const ALBERTA EL_INFO &elInfo)\n-Definition elementinfo.hh:773\n-Dune::Alberta::ElementInfo::ElementInfo\n-ElementInfo()\n-Definition elementinfo.hh:310\n-Dune::Alberta::ElementInfo::boundaryId\n-int boundaryId(int face) const\n-Definition elementinfo.hh:635\n-Dune::Alberta::ElementInfo::operator!=\n-bool operator!=(const ElementInfo &other) const\n-Definition elementinfo.hh:432\n-Dune::Alberta::ElementInfo::FillFlags\n-Alberta::FillFlags< dimension > FillFlags\n-Definition elementinfo.hh:60\n-Dune::Alberta::ElementInfo::ElementInfo\n-ElementInfo(const MeshPointer &mesh, const MacroElement ¯oElement, typename\n-FillFlags::Flags fillFlags=FillFlags::standard)\n-Definition elementinfo.hh:319\n-Dune::Alberta::ElementInfo::transformation\n-AffineTransformation * transformation(int face) const\n-Definition elementinfo.hh:651\n-Dune::Alberta::ElementInfo::isBoundary\n-bool isBoundary(int face) const\n-Definition elementinfo.hh:620\n-Dune::Alberta::ElementInfo::indexInFather\n-int indexInFather() const\n-Definition elementinfo.hh:457\n-Dune::Alberta::ElementInfo::seed\n-Seed seed() const\n-Definition elementinfo.hh:496\n-Dune::Alberta::ElementInfo::el\n-Element * el() const\n-Definition elementinfo.hh:737\n-Dune::Alberta::ElementInfo::element\n-const Element * element() const\n-Definition elementinfo.hh:721\n-Dune::Alberta::ElementInfo::elInfo\n-ALBERTA EL_INFO & elInfo() const\n-Definition elementinfo.hh:744\n-Dune::Alberta::ElementInfo::mesh\n-MeshPointer mesh() const\n-Definition elementinfo.hh:519\n-Dune::Alberta::ElementInfo::geometryCache\n-GeometryCache geometryCache() const\n-Definition elementinfo.hh:140\n-Dune::Alberta::ElementInfo::hasCoordinates\n-bool hasCoordinates() const\n-Definition elementinfo.hh:679\n-Dune::Alberta::ElementInfo::levelNeighbors\n-int levelNeighbors(const int face, ElementInfo(&neighbor)[maxLevelNeighbors],\n-int(&faceInNeighbor)[maxLevelNeighbors]) const\n-Definition elementinfo.hh:596\n-Dune::Alberta::ElementInfo::ElementInfo\n-ElementInfo(ElementInfo &&other)\n-Definition elementinfo.hh:389\n-Dune::Alberta::ElementInfo::ElementInfo\n-ElementInfo(const MeshPointer &mesh, const Seed &seed, typename FillFlags::\n-Flags fillFlags=FillFlags::standard)\n-Definition elementinfo.hh:340\n-Dune::Alberta::ElementInfo::Instance\n-Definition elementinfo.hh:185\n-Dune::Alberta::ElementInfo::Instance::parent\n-InstancePtr & parent()\n-Definition elementinfo.hh:189\n-Dune::Alberta::ElementInfo::Instance::geometryCache\n-Alberta::GeometryCache< dim > geometryCache\n-Definition elementinfo.hh:199\n-Dune::Alberta::ElementInfo::Instance::elInfo\n-ALBERTA EL_INFO elInfo\n-Definition elementinfo.hh:186\n-Dune::Alberta::ElementInfo::Instance::refCount\n-unsigned int refCount\n-Definition elementinfo.hh:187\n-Dune::Alberta::ElementInfo::Stack\n-Definition elementinfo.hh:210\n-Dune::Alberta::ElementInfo::Stack::null\n-InstancePtr null()\n-Definition elementinfo.hh:907\n-Dune::Alberta::ElementInfo::Stack::~Stack\n-~Stack()\n-Definition elementinfo.hh:871\n-Dune::Alberta::ElementInfo::Stack::release\n-void release(InstancePtr &p)\n-Definition elementinfo.hh:897\n-Dune::Alberta::ElementInfo::Stack::Stack\n-Stack()\n-Definition elementinfo.hh:861\n-Dune::Alberta::ElementInfo::Stack::allocate\n-InstancePtr allocate()\n-Definition elementinfo.hh:884\n-Dune::Alberta::ElementInfo::Seed\n-Definition elementinfo.hh:255\n-Dune::Alberta::ElementInfo::Seed::Seed\n-Seed(const int macroIndex, const int level, const unsigned long path)\n-Definition elementinfo.hh:260\n-Dune::Alberta::ElementInfo::Seed::Seed\n-Seed()\n-Definition elementinfo.hh:256\n-Dune::Alberta::ElementInfo::Seed::level\n-int level() const\n-Definition elementinfo.hh:287\n-Dune::Alberta::ElementInfo::Seed::isValid\n-bool isValid() const\n-Definition elementinfo.hh:284\n-Dune::Alberta::ElementInfo::Seed::path\n-unsigned long path() const\n-Definition elementinfo.hh:288\n-Dune::Alberta::ElementInfo::Seed::macroIndex\n-int macroIndex() const\n-Definition elementinfo.hh:286\n-Dune::Alberta::GeometryCache\n-Definition geometrycache.hh:24\n-Dune::Alberta::GeometryCacheProxy\n-Definition geometrycache.hh:91\n-Dune::Alberta::MacroElement\n-Definition macroelement.hh:24\n+Dune::AlbertaError\n+Definition misc.hh:32\n+Dune::AlbertaIOError\n+Definition misc.hh:36\n+Dune::Alberta::GlobalSpace\n+Definition misc.hh:102\n+Dune::Alberta::GlobalSpace::identityMatrix\n+static const Matrix & identityMatrix()\n+Definition misc.hh:131\n+Dune::Alberta::GlobalSpace::nullVector\n+static const Vector & nullVector()\n+Definition misc.hh:136\n+Dune::Alberta::GlobalSpace::Matrix\n+GlobalMatrix Matrix\n+Definition misc.hh:106\n+Dune::Alberta::GlobalSpace::Vector\n+GlobalVector Vector\n+Definition misc.hh:107\n Dune::Alberta::NumSubEntities\n Definition misc.hh:148\n+Dune::Alberta::CodimType\n+Definition misc.hh:192\n Dune::Alberta::FillFlags\n Definition misc.hh:231\n Dune::Alberta::FillFlags::nothing\n static const Flags nothing\n Definition misc.hh:234\n+Dune::Alberta::FillFlags::nonPeriodic\n+static const Flags nonPeriodic\n+Definition misc.hh:248\n Dune::Alberta::FillFlags::boundaryId\n static const Flags boundaryId\n Definition misc.hh:246\n+Dune::Alberta::FillFlags::elementType\n+static const Flags elementType\n+Definition misc.hh:244\n Dune::Alberta::FillFlags::Flags\n ALBERTA FLAGS Flags\n Definition misc.hh:232\n+Dune::Alberta::FillFlags::projection\n+static const Flags projection\n+Definition misc.hh:242\n Dune::Alberta::FillFlags::coords\n static const Flags coords\n Definition misc.hh:236\n+Dune::Alberta::FillFlags::orientation\n+static const Flags orientation\n+Definition misc.hh:240\n Dune::Alberta::FillFlags::standard\n static const Flags standard\n Definition misc.hh:258\n Dune::Alberta::FillFlags::neighbor\n static const Flags neighbor\n Definition misc.hh:238\n+Dune::Alberta::FillFlags::all\n+static const Flags all\n+Definition misc.hh:250\n+Dune::Alberta::FillFlags::standardWithCoords\n+static const Flags standardWithCoords\n+Definition misc.hh:253\n+Dune::Alberta::RefinementEdge\n+Definition misc.hh:269\n+Dune::Alberta::RefinementEdge::value\n+static const int value\n+Definition misc.hh:270\n+Dune::Alberta::Dune2AlbertaNumbering\n+Definition misc.hh:286\n+Dune::Alberta::Dune2AlbertaNumbering::apply\n+static int apply(const int i)\n+Definition misc.hh:287\n+Dune::Alberta::Dune2AlbertaNumbering<_3,_2_>::apply\n+static int apply(const int i)\n+Definition misc.hh:299\n+Dune::Alberta::Generic2AlbertaNumbering\n+Definition misc.hh:314\n+Dune::Alberta::Generic2AlbertaNumbering::apply\n+static int apply(const int i)\n+Definition misc.hh:315\n+Dune::Alberta::Generic2AlbertaNumbering<_dim,_1_>::apply\n+static int apply(const int i)\n+Definition misc.hh:325\n+Dune::Alberta::Generic2AlbertaNumbering<_1,_1_>::apply\n+static int apply(const int i)\n+Definition misc.hh:335\n+Dune::Alberta::Generic2AlbertaNumbering<_3,_2_>::apply\n+static int apply(const int i)\n+Definition misc.hh:347\n+Dune::Alberta::NumberingMap\n+Definition misc.hh:362\n+Dune::Alberta::NumberingMap::alberta2dune\n+int alberta2dune(int codim, int i) const\n+Definition misc.hh:397\n+Dune::Alberta::NumberingMap::numSubEntities\n+int numSubEntities(int codim) const\n+Definition misc.hh:404\n+Dune::Alberta::NumberingMap::dune2alberta\n+int dune2alberta(int codim, int i) const\n+Definition misc.hh:390\n+Dune::Alberta::NumberingMap::~NumberingMap\n+~NumberingMap()\n+Definition misc.hh:381\n+Dune::Alberta::NumberingMap::NumberingMap\n+NumberingMap()\n+Definition misc.hh:376\n+Dune::Alberta::MapVertices\n+Definition misc.hh:443\n+Dune::Alberta::MapVertices<_dim,_0_>::apply\n+static int apply(int subEntity, int vertex)\n+Definition misc.hh:448\n+Dune::Alberta::MapVertices<_2,_1_>::apply\n+static int apply(int subEntity, int vertex)\n+Definition misc.hh:459\n+Dune::Alberta::MapVertices<_3,_1_>::apply\n+static int apply(int subEntity, int vertex)\n+Definition misc.hh:472\n+Dune::Alberta::MapVertices<_3,_2_>::apply\n+static int apply(int subEntity, int vertex)\n+Definition misc.hh:485\n+Dune::Alberta::MapVertices<_dim,_dim_>::apply\n+static int apply(int subEntity, int vertex)\n+Definition misc.hh:497\n+Dune::Alberta::Twist\n+Definition misc.hh:532\n+Dune::Alberta::Twist::maxTwist\n+static const int maxTwist\n+Definition misc.hh:536\n+Dune::Alberta::Twist::minTwist\n+static const int minTwist\n+Definition misc.hh:535\n Dune::Alberta::Twist::twist\n static int twist(const Element *element, int subEntity)\n Definition misc.hh:538\n-Dune::Alberta::BasicNodeProjection\n-Definition albertagrid/projection.hh:208\n+Dune::Alberta::Twist::numSubEntities\n+static const int numSubEntities\n+Definition misc.hh:533\n+Dune::Alberta::Twist<_dim,_1_>::twist\n+static int twist(const Element *element, int subEntity)\n+Definition misc.hh:554\n+Dune::Alberta::Twist<_1,_1_>::twist\n+static int twist(const Element *element, int subEntity)\n+Definition misc.hh:575\n+Dune::Alberta::Twist<_dim,_2_>::twist\n+static int twist(const Element *element, int subEntity)\n+Definition misc.hh:592\n+Dune::Alberta::Twist<_2,_2_>::twist\n+static int twist(const Element *element, int subEntity)\n+Definition misc.hh:619\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00626_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00680_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,24 +77,24 @@\n
  • dune
  • grid
  • albertagrid
  • \n
    \n
    \n
    \n
    leafiterator.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5#ifndef DUNE_ALBERTA_LEAFITERATOR_HH
    \n
    6#define DUNE_ALBERTA_LEAFITERATOR_HH
    \n
    7
    \n \n
    9
    \n-\n+\n
    11
    \n
    12#if HAVE_ALBERTA
    \n
    13
    \n
    14namespace Dune
    \n
    15{
    \n
    16
    \n
    17 // AlbertaGridLeafIterator
    \n@@ -182,15 +182,15 @@\n
    \n
    86
    \n
    87}
    \n
    88
    \n
    89#endif // #if HAVE_ALBERTA
    \n
    90
    \n
    91#endif // #ifndef DUNE_ALBERTA_LEAFITERATOR_HH
    \n-\n+\n
    @ Ghost_Partition
    only ghost entities
    Definition gridenums.hh:142
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Definition treeiterator.hh:189
    \n
    GridImp::template Codim< codim >::Entity Entity
    Definition treeiterator.hh:207
    \n
    int level() const
    ask for level of entities
    Definition treeiterator.hh:243
    \n
    void increment()
    increment
    Definition treeiterator.hh:411
    \n
    const GridImp & grid() const
    obtain a reference to the grid
    Definition treeiterator.hh:253
    \n"}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00644_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00833_source.html", "comments": ["Files 76% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: indexstack.hh Source File\n+dune-grid: vtksequencewriterbase.hh Source File\n \n \n \n \n \n \n \n@@ -70,261 +70,209 @@\n
    \n
    \n
    \n
    \n \n \n
    \n
    \n-
    indexstack.hh
    \n+
    vtksequencewriterbase.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTAGRID_INDEXSTACK_HH
    \n-
    6#define DUNE_ALBERTAGRID_INDEXSTACK_HH
    \n-
    7
    \n-
    8#include <assert.h>
    \n-
    9#include <stack>
    \n-
    10
    \n-
    11#include <dune/common/exceptions.hh>
    \n-
    12#include <dune/common/reservedvector.hh>
    \n-
    13
    \n-
    20namespace Dune {
    \n-
    21
    \n-
    24 template <class T, int length>
    \n-
    \n-\n-
    26 {
    \n-
    27 class MyFiniteStack : public ReservedVector<T,length>
    \n-
    28 {
    \n-
    29 typedef ReservedVector<T,length> BaseType ;
    \n-
    30 public:
    \n-
    32 bool full () const { return this->size() >= length; }
    \n-
    33
    \n-
    35 void push( const T& t ) { BaseType :: push_back( t ); }
    \n-
    36
    \n-
    38 T topAndPop ()
    \n-
    39 {
    \n-
    40 assert( !this->empty() );
    \n-
    41 assert( this->size() <= length );
    \n-
    42 // This code is not slower than using the array structure directly.
    \n-
    43 // The compiler removes the temporary completely. I measured this.
    \n-
    44 // See the commit message for revision 7837 for more details.
    \n-
    45 T tmp = this->back();
    \n-
    46 this->pop_back();
    \n-
    47 return tmp;
    \n-
    48 }
    \n-
    49 };
    \n-
    50
    \n-
    51 typedef MyFiniteStack StackType;
    \n-
    52 typedef typename std::stack < StackType * > StackListType;
    \n-
    53
    \n-
    54 StackListType fullStackList_;
    \n-
    55 StackListType emptyStackList_;
    \n-
    56
    \n-
    57 //typedef typename StackListType::Iterator DListIteratorType;
    \n-
    58 StackType * stack_;
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH
    \n+
    8
    \n+
    9#include <vector>
    \n+
    10#include <iostream>
    \n+
    11#include <sstream>
    \n+
    12#include <fstream>
    \n+
    13#include <iomanip>
    \n+
    14#include <memory>
    \n+
    15
    \n+\n+
    17#include <dune/common/path.hh>
    \n+
    18
    \n+\n+
    20
    \n+
    21namespace Dune {
    \n+
    22
    \n+
    32 template<class GridView>
    \n+
    \n+\n+
    34 {
    \n+
    35 std::shared_ptr<VTKWriter<GridView> > vtkWriter_;
    \n+
    36 std::vector<double> timesteps_;
    \n+
    37 std::string name_,path_,extendpath_;
    \n+
    38 int rank_;
    \n+
    39 int size_;
    \n+
    40 public:
    \n+
    \n+\n+
    48 const std::string& name,
    \n+
    49 const std::string& path,
    \n+
    50 const std::string& extendpath,
    \n+
    51 int rank,
    \n+
    52 int size)
    \n+
    53 : vtkWriter_(vtkWriter),
    \n+
    54 name_(name), path_(path),
    \n+
    55 extendpath_(extendpath),
    \n+
    56 rank_(rank),
    \n+
    57 size_(size)
    \n+
    58 {}
    \n+
    \n
    59
    \n-
    60 // current maxIndex
    \n-
    61 int maxIndex_;
    \n-
    62 public:
    \n-
    64 inline IndexStack();
    \n-
    65
    \n-
    67 inline ~IndexStack ();
    \n-
    68
    \n-
    70 inline void checkAndSetMax(T index) { if(index > maxIndex_) maxIndex_ = index;}
    \n-
    71
    \n-
    73 inline void setMaxIndex(T index) { maxIndex_ = index; }
    \n-
    74
    \n-
    76 inline int getMaxIndex() const { return maxIndex_; }
    \n-
    77
    \n-
    79 inline int size() const { return getMaxIndex(); }
    \n-
    80
    \n-
    82 inline T getIndex ();
    \n-
    83
    \n-
    85 inline void freeIndex(T index);
    \n-
    86
    \n-
    88 inline void test ();
    \n-
    89
    \n-
    90 // backup set to out stream
    \n-
    91 inline void backupIndexSet ( std::ostream & os );
    \n-
    92
    \n-
    93 // restore from in stream
    \n-
    94 inline void restoreIndexSet ( std::istream & is );
    \n-
    95 private:
    \n-
    96 // no copy constructor allowed
    \n-
    97 IndexStack( const IndexStack<T,length> & s) : maxIndex_ (0) , stack_(0) {}
    \n-
    98
    \n-
    99 // no assignment operator allowed
    \n-
    100 IndexStack<T,length> & operator = ( const IndexStack<T,length> & s)
    \n-
    101 {
    \n-
    102 DUNE_THROW(Exception, "IndexStack::operator = () not allowed!");
    \n-
    103 return *this;
    \n-
    104 }
    \n-
    105
    \n-
    106 // clear fullStacks
    \n-
    107 void clearStack ();
    \n-
    108
    \n-
    109 }; // end class IndexStack
    \n-
    \n-
    110
    \n-
    111 //****************************************************************
    \n-
    112 // Inline implementation
    \n-
    113 // ***************************************************************
    \n-
    114 template <class T, int length>
    \n-
    \n-\n-
    116 : stack_ ( new StackType () ) , maxIndex_ (0) {}
    \n-
    \n-
    117
    \n-
    118 template <class T, int length>
    \n-
    \n-\n-
    120 {
    \n-
    121 if(stack_) delete stack_;
    \n-
    122 stack_ = 0;
    \n-
    123
    \n-
    124 while( !fullStackList_.empty() )
    \n-
    125 {
    \n-
    126 StackType * st = fullStackList_.top();
    \n-
    127 if(st) delete st;
    \n-
    128 fullStackList_.pop();
    \n-
    129 }
    \n-
    130 while( !emptyStackList_.empty() )
    \n-
    131 {
    \n-
    132 StackType * st = emptyStackList_.top();
    \n-
    133 if(st) delete st;
    \n-
    134 emptyStackList_.pop();
    \n-
    135 }
    \n-
    136 }
    \n-
    \n-
    137
    \n-
    138 template <class T, int length>
    \n-
    \n-\n-
    140 {
    \n-
    141 if((*stack_).empty())
    \n-
    142 {
    \n-
    143 if( fullStackList_.size() <= 0)
    \n-
    144 {
    \n-
    145 return maxIndex_++;
    \n-
    146 }
    \n-
    147 else
    \n-
    148 {
    \n-
    149 emptyStackList_.push( stack_ );
    \n-
    150 stack_ = fullStackList_.top();
    \n-
    151 fullStackList_.pop();
    \n-
    152 }
    \n-
    153 }
    \n-
    154 return (*stack_).topAndPop();
    \n-
    155 }
    \n-
    \n-
    156
    \n-
    157 template <class T, int length>
    \n-
    \n-
    158 inline void IndexStack<T,length>::freeIndex ( T index )
    \n-
    159 {
    \n-
    160 if((*stack_).full())
    \n-
    161 {
    \n-
    162 fullStackList_.push( stack_ );
    \n-
    163 if(emptyStackList_.size() <= 0)
    \n-
    164 {
    \n-
    165 stack_ = new StackType ();
    \n-
    166 }
    \n-
    167 else
    \n-
    168 {
    \n-
    169 stack_ = emptyStackList_.top();
    \n-
    170 emptyStackList_.pop();
    \n-
    171 }
    \n-
    172 }
    \n-
    173 (*stack_).push(index);
    \n-
    174 }
    \n-
    \n-
    175
    \n-
    176 template <class T, int length>
    \n-
    \n-\n-
    178 {
    \n-
    179 T vec[2*length];
    \n+
    \n+
    63 const std::shared_ptr< VTKWriter<GridView> >& vtkWriter() const
    \n+
    64 {
    \n+
    65 return vtkWriter_;
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    \n+
    69 void addCellData (const std::shared_ptr<const typename VTKWriter<GridView>::VTKFunction> &p)
    \n+
    70 {
    \n+
    71 vtkWriter_->addCellData(p);
    \n+
    72 }
    \n+
    \n+
    73
    \n+
    79 template<class V >
    \n+
    \n+
    80 void addCellData (const V &v, const std::string &name, int ncomps=1)
    \n+
    81 {
    \n+
    82 vtkWriter_->addCellData(v, name, ncomps);
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    \n+
    86 void addVertexData (const std::shared_ptr<const typename VTKWriter<GridView>::VTKFunction> &p)
    \n+
    87 {
    \n+
    88 vtkWriter_->addVertexData(p);
    \n+
    89 }
    \n+
    \n+
    90
    \n+
    96 template<class V >
    \n+
    \n+
    97 void addVertexData (const V &v, const std::string &name, int ncomps=1)
    \n+
    98 {
    \n+
    99 vtkWriter_->addVertexData(v, name, ncomps);
    \n+
    100 }
    \n+
    \n+
    101
    \n+
    102
    \n+
    \n+
    108 void write (double time, VTK::OutputType type = VTK::ascii)
    \n+
    109 {
    \n+
    110 /* remember current time step */
    \n+
    111 unsigned int count = timesteps_.size();
    \n+
    112 timesteps_.push_back(time);
    \n+
    113
    \n+
    114 /* write VTK file */
    \n+
    115 if(size_==1)
    \n+
    116 vtkWriter_->write(concatPaths(path_,seqName(count)),type);
    \n+
    117 else
    \n+
    118 vtkWriter_->pwrite(seqName(count), path_,extendpath_,type);
    \n+
    119
    \n+
    120 /* write pvd file ... only on rank 0 */
    \n+
    121 if (rank_==0) {
    \n+
    122 std::ofstream pvdFile;
    \n+
    123 pvdFile.exceptions(std::ios_base::badbit | std::ios_base::failbit |
    \n+
    124 std::ios_base::eofbit);
    \n+
    125 std::string pvdname = name_ + ".pvd";
    \n+
    126 pvdFile.open(pvdname.c_str());
    \n+
    127 pvdFile << "<?xml version=\\"1.0\\"?> \\n"
    \n+
    128 << "<VTKFile type=\\"Collection\\" version=\\"0.1\\" byte_order=\\"" << VTK::getEndiannessString() << "\\"> \\n"
    \n+
    129 << "<Collection> \\n";
    \n+
    130 for (unsigned int i=0; i<=count; i++)
    \n+
    131 {
    \n+
    132 // filename
    \n+
    133 std::string piecepath;
    \n+
    134 std::string fullname;
    \n+
    135 if(size_==1) {
    \n+
    136 piecepath = path_;
    \n+
    137 fullname = vtkWriter_->getSerialPieceName(seqName(i), piecepath);
    \n+
    138 }
    \n+
    139 else {
    \n+
    140 piecepath = concatPaths(path_, extendpath_);
    \n+
    141 fullname = vtkWriter_->getParallelHeaderName(seqName(i), piecepath, size_);
    \n+
    142 }
    \n+
    143 pvdFile << "<DataSet timestep=\\"" << timesteps_[i]
    \n+
    144 << "\\" group=\\"\\" part=\\"0\\" name=\\"\\" file=\\""
    \n+
    145 << fullname << "\\"/> \\n";
    \n+
    146 }
    \n+
    147 pvdFile << "</Collection> \\n"
    \n+
    148 << "</VTKFile> \\n" << std::flush;
    \n+
    149 pvdFile.close();
    \n+
    150 }
    \n+
    151 }
    \n+
    \n+
    152
    \n+
    \n+
    156 void clear()
    \n+
    157 {
    \n+
    158 vtkWriter_->clear();
    \n+
    159 }
    \n+
    \n+
    160
    \n+
    \n+
    164 const std::vector<double>& getTimeSteps() const
    \n+
    165 {
    \n+
    166 return timesteps_;
    \n+
    167 }
    \n+
    \n+
    168
    \n+
    \n+
    174 void setTimeSteps(const std::vector<double>& timesteps)
    \n+
    175 {
    \n+
    176 timesteps_ = timesteps;
    \n+
    177 }
    \n+
    \n+
    178
    \n+
    179 private:
    \n
    180
    \n-
    181 for(int i=0; i<2*length; i++)
    \n-
    182 vec[i] = getIndex();
    \n-
    183
    \n-
    184 for(int i=0; i<2*length; i++)
    \n-
    185 freeIndex(vec[i]);
    \n-
    186
    \n-
    187 for(int i=0; i<2*length; i++)
    \n-
    188 vec[i] = getIndex();
    \n-
    189
    \n-
    190 for(int i=0; i<2*length; i++)
    \n-
    191 printf(" index [%d] = %d \\n",i,vec[i]);
    \n-
    192 }
    \n-
    \n-
    193
    \n-
    194 template <class T, int length>
    \n-
    \n-
    195 inline void IndexStack<T,length>::backupIndexSet ( std::ostream & os )
    \n-
    196 {
    \n-
    197 // holes are not stored at the moment
    \n-
    198 os.write( ((const char *) &maxIndex_ ), sizeof(int) ) ;
    \n-
    199 return ;
    \n-
    200 }
    \n-
    \n-
    201
    \n-
    202 template <class T, int length>
    \n-
    \n-
    203 inline void IndexStack<T,length>::restoreIndexSet ( std::istream & is )
    \n-
    204 {
    \n-
    205 is.read ( ((char *) &maxIndex_), sizeof(int) );
    \n-
    206 clearStack ();
    \n-
    207
    \n-
    208 return ;
    \n-
    209 }
    \n-
    \n-
    210
    \n-
    211 template <class T, int length>
    \n-\n-
    213 {
    \n-
    214 if(stack_)
    \n-
    215 {
    \n-
    216 delete stack_;
    \n-
    217 stack_ = new StackType();
    \n-
    218 assert(stack_);
    \n-
    219 }
    \n-
    220
    \n-
    221 while( !fullStackList_.empty() )
    \n-
    222 {
    \n-
    223 StackType * st = fullStackList_.top();
    \n-
    224 if(st) delete st;
    \n-
    225 fullStackList_.pop();
    \n-
    226 }
    \n-
    227 return;
    \n-
    228 }
    \n-
    229
    \n-
    230} // end namespace Dune
    \n-
    231#endif
    \n+
    181 // create sequence name
    \n+
    182 std::string seqName(unsigned int count) const
    \n+
    183 {
    \n+
    184 std::stringstream n;
    \n+
    185 n.fill('0');
    \n+
    186 n << name_ << "-" << std::setw(5) << count;
    \n+
    187 return n.str();
    \n+
    188 }
    \n+
    189 };
    \n+
    \n+
    190
    \n+
    191} // end namespace Dune
    \n+
    192
    \n+
    193#endif
    \n+
    Provides file i/o for the visualization toolkit.
    \n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition indexstack.hh:26
    \n-
    void restoreIndexSet(std::istream &is)
    Definition indexstack.hh:203
    \n-
    void checkAndSetMax(T index)
    set index as maxIndex if index is bigger than maxIndex
    Definition indexstack.hh:70
    \n-
    void backupIndexSet(std::ostream &os)
    Definition indexstack.hh:195
    \n-
    ~IndexStack()
    Destructor, deleting all stacks.
    Definition indexstack.hh:119
    \n-
    T getIndex()
    restore index from stack or create new index
    Definition indexstack.hh:139
    \n-
    IndexStack()
    Constructor, create new IndexStack.
    Definition indexstack.hh:115
    \n-
    void setMaxIndex(T index)
    set index as maxIndex
    Definition indexstack.hh:73
    \n-
    int size() const
    return maxIndex which is also the
    Definition indexstack.hh:79
    \n-
    void test()
    test stack functionality
    Definition indexstack.hh:177
    \n-
    void freeIndex(T index)
    store index on stack
    Definition indexstack.hh:158
    \n-
    int getMaxIndex() const
    return maxIndex which is also the
    Definition indexstack.hh:76
    \n+
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n+
    @ ascii
    Output to the file is in ascii.
    Definition common.hh:45
    \n+
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n+
    A base class for grid functions with any return type and dimension.
    Definition function.hh:42
    \n+
    Base class to write pvd-files which contains a list of all collected vtk-files.
    Definition vtksequencewriterbase.hh:34
    \n+
    void addVertexData(const V &v, const std::string &name, int ncomps=1)
    Adds a field of vertex data to the VTK file.
    Definition vtksequencewriterbase.hh:97
    \n+
    const std::vector< double > & getTimeSteps() const
    Retrieve the current list of time steps.
    Definition vtksequencewriterbase.hh:164
    \n+
    const std::shared_ptr< VTKWriter< GridView > > & vtkWriter() const
    Definition vtksequencewriterbase.hh:63
    \n+
    void write(double time, VTK::OutputType type=VTK::ascii)
    Writes VTK data for the given time,.
    Definition vtksequencewriterbase.hh:108
    \n+
    void addVertexData(const std::shared_ptr< const typename VTKWriter< GridView >::VTKFunction > &p)
    Adds a field of vertex data to the VTK file.
    Definition vtksequencewriterbase.hh:86
    \n+
    void addCellData(const V &v, const std::string &name, int ncomps=1)
    Adds a field of cell data to the VTK file.
    Definition vtksequencewriterbase.hh:80
    \n+
    VTKSequenceWriterBase(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const std::string &name, const std::string &path, const std::string &extendpath, int rank, int size)
    Set up the VTKSequenceWriterBase class.
    Definition vtksequencewriterbase.hh:47
    \n+
    void addCellData(const std::shared_ptr< const typename VTKWriter< GridView >::VTKFunction > &p)
    Adds a field of cell data to the VTK file.
    Definition vtksequencewriterbase.hh:69
    \n+
    void setTimeSteps(const std::vector< double > &timesteps)
    Set the current list of time steps.
    Definition vtksequencewriterbase.hh:174
    \n+
    void clear()
    Clears all VTK data added to the VTK writer.
    Definition vtksequencewriterbase.hh:156
    \n+
    Writer for the output of grid functions in the vtk format.
    Definition vtkwriter.hh:95
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,271 +1,236 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-indexstack.hh\n+ * io\n+ * file\n+ * vtk\n+vtksequencewriterbase.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTAGRID_INDEXSTACK_HH\n-6#define DUNE_ALBERTAGRID_INDEXSTACK_HH\n-7\n-8#include \n-9#include \n-10\n-11#include \n-12#include \n-13\n-20namespace Dune {\n-21\n-24 template \n-25 class IndexStack\n-26 {\n-27 class MyFiniteStack : public ReservedVector\n-28 {\n-29 typedef ReservedVector BaseType ;\n-30 public:\n-32 bool full () const { return this->size() >= length; }\n-33\n-35 void push( const T& t ) { BaseType :: push_back( t ); }\n-36\n-38 T topAndPop ()\n-39 {\n-40 assert( !this->empty() );\n-41 assert( this->size() <= length );\n-42 // This code is not slower than using the array structure directly.\n-43 // The compiler removes the temporary completely. I measured this.\n-44 // See the commit message for revision 7837 for more details.\n-45 T tmp = this->back();\n-46 this->pop_back();\n-47 return tmp;\n-48 }\n-49 };\n-50\n-51 typedef MyFiniteStack StackType;\n-52 typedef typename std::stack < StackType * > StackListType;\n-53\n-54 StackListType fullStackList_;\n-55 StackListType emptyStackList_;\n-56\n-57 //typedef typename StackListType::Iterator DListIteratorType;\n-58 StackType * stack_;\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH\n+7#define DUNE_GRID_IO_FILE_VTK_VTKSEQUENCEWRITERBASE_HH\n+8\n+9#include \n+10#include \n+11#include \n+12#include \n+13#include \n+14#include \n+15\n+16#include \n+17#include \n+18\n+19#include \n+20\n+21namespace Dune {\n+22\n+32 template\n+33 class VTKSequenceWriterBase\n+34 {\n+35 std::shared_ptr > vtkWriter_;\n+36 std::vector timesteps_;\n+37 std::string name_,path_,extendpath_;\n+38 int rank_;\n+39 int size_;\n+40 public:\n+47 explicit VTKSequenceWriterBase( std::shared_ptr >\n+vtkWriter,\n+48 const std::string& name,\n+49 const std::string& path,\n+50 const std::string& extendpath,\n+51 int rank,\n+52 int size)\n+53 : vtkWriter_(vtkWriter),\n+54 name_(name), path_(path),\n+55 extendpath_(extendpath),\n+56 rank_(rank),\n+57 size_(size)\n+58 {}\n 59\n-60 // current maxIndex\n-61 int maxIndex_;\n-62 public:\n-64 inline IndexStack();\n-65\n-67 inline ~IndexStack ();\n-68\n-70 inline void checkAndSetMax(T index) { if(index > maxIndex_) maxIndex_ =\n-index;}\n-71\n-73 inline void setMaxIndex(T index) { maxIndex_ = index; }\n-74\n-76 inline int getMaxIndex() const { return maxIndex_; }\n-77\n-79 inline int size() const { return getMaxIndex(); }\n-80\n-82 inline T getIndex ();\n-83\n-85 inline void freeIndex(T index);\n-86\n-88 inline void test ();\n-89\n-90 // backup set to out stream\n-91 inline void backupIndexSet ( std::ostream & os );\n-92\n-93 // restore from in stream\n-94 inline void restoreIndexSet ( std::istream & is );\n-95 private:\n-96 // no copy constructor allowed\n-97 IndexStack( const IndexStack & s) : maxIndex_ (0) , stack_(0) {}\n-98\n-99 // no assignment operator allowed\n-100 IndexStack & operator = ( const IndexStack & s)\n-101 {\n-102 DUNE_THROW(Exception, \"IndexStack::operator = () not allowed!\");\n-103 return *this;\n-104 }\n-105\n-106 // clear fullStacks\n-107 void clearStack ();\n-108\n-109 }; // end class IndexStack\n-110\n-111 //****************************************************************\n-112 // Inline implementation\n-113 // ***************************************************************\n-114 template \n-115 inline IndexStack::IndexStack()\n-116 : stack_ ( new StackType () ) , maxIndex_ (0) {}\n-117\n-118 template \n-119 inline IndexStack::~IndexStack ()\n-120 {\n-121 if(stack_) delete stack_;\n-122 stack_ = 0;\n-123\n-124 while( !fullStackList_.empty() )\n-125 {\n-126 StackType * st = fullStackList_.top();\n-127 if(st) delete st;\n-128 fullStackList_.pop();\n-129 }\n-130 while( !emptyStackList_.empty() )\n+63 const std::shared_ptr< VTKWriter >& vtkWriter() const\n+64 {\n+65 return vtkWriter_;\n+66 }\n+67\n+69 void addCellData (const std::shared_ptr::\n+VTKFunction> &p)\n+70 {\n+71 vtkWriter_->addCellData(p);\n+72 }\n+73\n+79 template\n+80 void addCellData (const V &v, const std::string &name, int ncomps=1)\n+81 {\n+82 vtkWriter_->addCellData(v, name, ncomps);\n+83 }\n+84\n+86 void addVertexData (const std::shared_ptr::VTKFunction> &p)\n+87 {\n+88 vtkWriter_->addVertexData(p);\n+89 }\n+90\n+96 template\n+97 void addVertexData (const V &v, const std::string &name, int ncomps=1)\n+98 {\n+99 vtkWriter_->addVertexData(v, name, ncomps);\n+100 }\n+101\n+102\n+108 void write (double time, VTK::OutputType type = VTK::ascii)\n+109 {\n+110 /* remember current time step */\n+111 unsigned int count = timesteps_.size();\n+112 timesteps_.push_back(time);\n+113\n+114 /* write VTK file */\n+115 if(size_==1)\n+116 vtkWriter_->write(concatPaths(path_,seqName(count)),type);\n+117 else\n+118 vtkWriter_->pwrite(seqName(count), path_,extendpath_,type);\n+119\n+120 /* write pvd file ... only on rank 0 */\n+121 if (rank_==0) {\n+122 std::ofstream pvdFile;\n+123 pvdFile.exceptions(std::ios_base::badbit | std::ios_base::failbit |\n+124 std::ios_base::eofbit);\n+125 std::string pvdname = name_ + \".pvd\";\n+126 pvdFile.open(pvdname.c_str());\n+127 pvdFile << \" \\n\"\n+128 << \" \\n\"\n+129 << \" \\n\";\n+130 for (unsigned int i=0; i<=count; i++)\n 131 {\n-132 StackType * st = emptyStackList_.top();\n-133 if(st) delete st;\n-134 emptyStackList_.pop();\n-135 }\n-136 }\n-137\n-138 template \n-139 inline T IndexStack::getIndex ()\n-140 {\n-141 if((*stack_).empty())\n-142 {\n-143 if( fullStackList_.size() <= 0)\n-144 {\n-145 return maxIndex_++;\n+132 // filename\n+133 std::string piecepath;\n+134 std::string fullname;\n+135 if(size_==1) {\n+136 piecepath = path_;\n+137 fullname = vtkWriter_->getSerialPieceName(seqName(i), piecepath);\n+138 }\n+139 else {\n+140 piecepath = concatPaths(path_, extendpath_);\n+141 fullname = vtkWriter_->getParallelHeaderName(seqName(i), piecepath, size_);\n+142 }\n+143 pvdFile << \" \\n\";\n 146 }\n-147 else\n-148 {\n-149 emptyStackList_.push( stack_ );\n-150 stack_ = fullStackList_.top();\n-151 fullStackList_.pop();\n-152 }\n-153 }\n-154 return (*stack_).topAndPop();\n-155 }\n-156\n-157 template \n-158 inline void IndexStack::freeIndex ( T index )\n-159 {\n-160 if((*stack_).full())\n-161 {\n-162 fullStackList_.push( stack_ );\n-163 if(emptyStackList_.size() <= 0)\n-164 {\n-165 stack_ = new StackType ();\n-166 }\n-167 else\n-168 {\n-169 stack_ = emptyStackList_.top();\n-170 emptyStackList_.pop();\n-171 }\n-172 }\n-173 (*stack_).push(index);\n-174 }\n-175\n-176 template \n-177 inline void IndexStack::test ()\n-178 {\n-179 T vec[2*length];\n+147 pvdFile << \" \\n\"\n+148 << \" \\n\" << std::flush;\n+149 pvdFile.close();\n+150 }\n+151 }\n+152\n+156 void clear()\n+157 {\n+158 vtkWriter_->clear();\n+159 }\n+160\n+164 const std::vector& getTimeSteps() const\n+165 {\n+166 return timesteps_;\n+167 }\n+168\n+174 void setTimeSteps(const std::vector& timesteps)\n+175 {\n+176 timesteps_ = timesteps;\n+177 }\n+178\n+179 private:\n 180\n-181 for(int i=0; i<2*length; i++)\n-182 vec[i] = getIndex();\n-183\n-184 for(int i=0; i<2*length; i++)\n-185 freeIndex(vec[i]);\n-186\n-187 for(int i=0; i<2*length; i++)\n-188 vec[i] = getIndex();\n-189\n-190 for(int i=0; i<2*length; i++)\n-191 printf(\" index [%d] = %d \\n\",i,vec[i]);\n-192 }\n-193\n-194 template \n-195 inline void IndexStack::backupIndexSet ( std::ostream & os )\n-196 {\n-197 // holes are not stored at the moment\n-198 os.write( ((const char *) &maxIndex_ ), sizeof(int) ) ;\n-199 return ;\n-200 }\n-201\n-202 template \n-203 inline void IndexStack::restoreIndexSet ( std::istream & is )\n-204 {\n-205 is.read ( ((char *) &maxIndex_), sizeof(int) );\n-206 clearStack ();\n-207\n-208 return ;\n-209 }\n-210\n-211 template \n-212 inline void IndexStack::clearStack ()\n-213 {\n-214 if(stack_)\n-215 {\n-216 delete stack_;\n-217 stack_ = new StackType();\n-218 assert(stack_);\n-219 }\n-220\n-221 while( !fullStackList_.empty() )\n-222 {\n-223 StackType * st = fullStackList_.top();\n-224 if(st) delete st;\n-225 fullStackList_.pop();\n-226 }\n-227 return;\n-228 }\n-229\n-230} // end namespace Dune\n-231#endif\n+181 // create sequence name\n+182 std::string seqName(unsigned int count) const\n+183 {\n+184 std::stringstream n;\n+185 n.fill('0');\n+186 n << name_ << \"-\" << std::setw(5) << count;\n+187 return n.str();\n+188 }\n+189 };\n+190\n+191} // end namespace Dune\n+192\n+193#endif\n+vtkwriter.hh\n+Provides file i/o for the visualization toolkit.\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::IndexStack\n-Definition indexstack.hh:26\n-Dune::IndexStack::restoreIndexSet\n-void restoreIndexSet(std::istream &is)\n-Definition indexstack.hh:203\n-Dune::IndexStack::checkAndSetMax\n-void checkAndSetMax(T index)\n-set index as maxIndex if index is bigger than maxIndex\n-Definition indexstack.hh:70\n-Dune::IndexStack::backupIndexSet\n-void backupIndexSet(std::ostream &os)\n-Definition indexstack.hh:195\n-Dune::IndexStack::~IndexStack\n-~IndexStack()\n-Destructor, deleting all stacks.\n-Definition indexstack.hh:119\n-Dune::IndexStack::getIndex\n-T getIndex()\n-restore index from stack or create new index\n-Definition indexstack.hh:139\n-Dune::IndexStack::IndexStack\n-IndexStack()\n-Constructor, create new IndexStack.\n-Definition indexstack.hh:115\n-Dune::IndexStack::setMaxIndex\n-void setMaxIndex(T index)\n-set index as maxIndex\n-Definition indexstack.hh:73\n-Dune::IndexStack::size\n-int size() const\n-return maxIndex which is also the\n-Definition indexstack.hh:79\n-Dune::IndexStack::test\n-void test()\n-test stack functionality\n-Definition indexstack.hh:177\n-Dune::IndexStack::freeIndex\n-void freeIndex(T index)\n-store index on stack\n-Definition indexstack.hh:158\n-Dune::IndexStack::getMaxIndex\n-int getMaxIndex() const\n-return maxIndex which is also the\n-Definition indexstack.hh:76\n+Dune::VTK::OutputType\n+OutputType\n+How the bulk data should be stored in the file.\n+Definition common.hh:43\n+Dune::VTK::ascii\n+@ ascii\n+Output to the file is in ascii.\n+Definition common.hh:45\n+Dune::VTK::getEndiannessString\n+std::string getEndiannessString()\n+determine endianness of this C++ implementation\n+Definition common.hh:232\n+Dune::VTKFunction\n+A base class for grid functions with any return type and dimension.\n+Definition function.hh:42\n+Dune::VTKSequenceWriterBase\n+Base class to write pvd-files which contains a list of all collected vtk-files.\n+Definition vtksequencewriterbase.hh:34\n+Dune::VTKSequenceWriterBase::addVertexData\n+void addVertexData(const V &v, const std::string &name, int ncomps=1)\n+Adds a field of vertex data to the VTK file.\n+Definition vtksequencewriterbase.hh:97\n+Dune::VTKSequenceWriterBase::getTimeSteps\n+const std::vector< double > & getTimeSteps() const\n+Retrieve the current list of time steps.\n+Definition vtksequencewriterbase.hh:164\n+Dune::VTKSequenceWriterBase::vtkWriter\n+const std::shared_ptr< VTKWriter< GridView > > & vtkWriter() const\n+Definition vtksequencewriterbase.hh:63\n+Dune::VTKSequenceWriterBase::write\n+void write(double time, VTK::OutputType type=VTK::ascii)\n+Writes VTK data for the given time,.\n+Definition vtksequencewriterbase.hh:108\n+Dune::VTKSequenceWriterBase::addVertexData\n+void addVertexData(const std::shared_ptr< const typename VTKWriter< GridView\n+>::VTKFunction > &p)\n+Adds a field of vertex data to the VTK file.\n+Definition vtksequencewriterbase.hh:86\n+Dune::VTKSequenceWriterBase::addCellData\n+void addCellData(const V &v, const std::string &name, int ncomps=1)\n+Adds a field of cell data to the VTK file.\n+Definition vtksequencewriterbase.hh:80\n+Dune::VTKSequenceWriterBase::VTKSequenceWriterBase\n+VTKSequenceWriterBase(std::shared_ptr< VTKWriter< GridView > > vtkWriter, const\n+std::string &name, const std::string &path, const std::string &extendpath, int\n+rank, int size)\n+Set up the VTKSequenceWriterBase class.\n+Definition vtksequencewriterbase.hh:47\n+Dune::VTKSequenceWriterBase::addCellData\n+void addCellData(const std::shared_ptr< const typename VTKWriter< GridView >::\n+VTKFunction > &p)\n+Adds a field of cell data to the VTK file.\n+Definition vtksequencewriterbase.hh:69\n+Dune::VTKSequenceWriterBase::setTimeSteps\n+void setTimeSteps(const std::vector< double > ×teps)\n+Set the current list of time steps.\n+Definition vtksequencewriterbase.hh:174\n+Dune::VTKSequenceWriterBase::clear\n+void clear()\n+Clears all VTK data added to the VTK writer.\n+Definition vtksequencewriterbase.hh:156\n+Dune::VTKWriter\n+Writer for the output of grid functions in the vtk format.\n+Definition vtkwriter.hh:95\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00677.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00608.html", "comments": ["Files 76% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: geometry.cc File Reference\n+dune-grid: coordfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -65,64 +65,54 @@\n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n-
    geometry.cc File Reference
    \n+Namespaces
    \n+
    coordfunction.hh File Reference
    \n
    \n
    \n-
    #include <dune/grid/albertagrid/algebra.hh>
    \n-#include <dune/grid/albertagrid/geometry.hh>
    \n-#include <dune/grid/albertagrid/refinement.hh>
    \n+
    #include <cassert>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/common/std/type_traits.hh>
    \n
    \n-

    Go to the source code of this file.

    \n+

    Go to the source code of this file.

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

    \n Classes

    struct  Dune::AlbertaGridLocalGeometryProvider< Grid >::GeoInFatherCoordReader< Grid >
    class  Dune::AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl >
     Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid. An implementation should be derived from Dune::AnalyticalCoordFunction and the evaluate method mapping \"$ has to be supplied. More...
     
    struct  Dune::AlbertaGridLocalGeometryProvider< Grid >::FaceCoordReader< Grid >
    class  Dune::AnalyticalCoordFunction< ct, dimD, dimR, Impl >
     Derive an implementation of an analytical coordinate function from this class. More...
     
    class  Dune::DiscreteCoordFunctionInterface< ct, dimR, Impl >
     Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid. An implementation should be derived from Dune::DiscreteCoordinateFunction and the evaluate method taking an entity of the host grid together with the number of a vertex returns the coordinate in \"$ of that corner. The user must ensure continuity of this mapping. In addition an adapt method is provided which is called whenever adapt() is called on the Dune::GeometryGrid. More...
     
    class  Dune::DiscreteCoordFunction< ct, dimR, Impl >
     Derive an implementation of a discrete coordinate function from this class. More...
     
    \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     Include standard header files.
     
    \n-\n-\n-\n+\n+\n+\n

    \n-Macros

    #define DUNE_ALBERTA_GEOMETRY_CC
     
    namespace  Dune::GeoGrid
     namespace containing the implementations of GeometryGrid
     
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_ALBERTA_GEOMETRY_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_ALBERTA_GEOMETRY_CC
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,32 +1,46 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-Classes | Namespaces | Macros\n-geometry.cc File Reference\n-#include \n-#include \n-#include \n+ * geometrygrid\n+Classes | Namespaces\n+coordfunction.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0 Dune::AlbertaGridLocalGeometryProvider<_Grid_>::\n- GeoInFatherCoordReader<_Grid_>\n+class \u00a0 Dune::AnalyticalCoordFunctionInterface<_ct,_dimD,_dimR,_Impl_>\n+ Interface class for using an analytical function to define the geometry\n+\u00a0 of a Dune::GeometryGrid. An implementation should be derived from\n+ Dune::AnalyticalCoordFunction and the evaluate method mapping [$ R^d\\to\n+ R^r $]has to be supplied. More...\n \u00a0\n-struct \u00a0 Dune::AlbertaGridLocalGeometryProvider<_Grid_>::FaceCoordReader<_Grid\n- >\n+class \u00a0 Dune::AnalyticalCoordFunction<_ct,_dimD,_dimR,_Impl_>\n+\u00a0 Derive an implementation of an analytical coordinate function from this\n+ class. More...\n+\u00a0\n+class \u00a0 Dune::DiscreteCoordFunctionInterface<_ct,_dimR,_Impl_>\n+ Interface class for using a discrete function to define the geometry of\n+ a Dune::GeometryGrid. An implementation should be derived from Dune::\n+ DiscreteCoordinateFunction and the evaluate method taking an entity of\n+\u00a0 the host grid together with the number of a vertex returns the\n+ coordinate in [$ R^r $]of that corner. The user must ensure continuity\n+ of this mapping. In addition an adapt method is provided which is\n+ called whenever adapt() is called on the Dune::GeometryGrid. More...\n+\u00a0\n+class \u00a0 Dune::DiscreteCoordFunction<_ct,_dimR,_Impl_>\n+\u00a0 Derive an implementation of a discrete coordinate function from this\n+ class. More...\n \u00a0\n Namespaces\n namespace \u00a0 Dune\n \u00a0 Include standard header files.\n \u00a0\n-Macros\n-#define\u00a0 DUNE_ALBERTA_GEOMETRY_CC\n+namespace \u00a0 Dune::GeoGrid\n+\u00a0 namespace containing the implementations of GeometryGrid\n \u00a0\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_ALBERTA_GEOMETRY_CC *****\n-#define DUNE_ALBERTA_GEOMETRY_CC\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00677_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00845_source.html", "comments": ["Files 88% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: geometry.cc Source File\n+dune-grid: dgfug.hh Source File\n \n \n \n \n \n \n \n@@ -70,348 +70,317 @@\n
    \n
    \n \n \n \n \n \n
    \n-
    geometry.cc
    \n+
    dgfug.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_GEOMETRY_CC
    \n-
    6#define DUNE_ALBERTA_GEOMETRY_CC
    \n+
    5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH
    \n+
    6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH
    \n
    7
    \n-\n-\n-\n-
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    15 // AlbertaGridGeometry
    \n-
    16 // -------------------
    \n-
    17
    \n-
    18 // print the GeometryInformation
    \n-
    19 template <int mydim, int cdim, class GridImp>
    \n-
    \n-
    20 inline void AlbertaGridGeometry<mydim,cdim,GridImp>::print (std::ostream& ss) const
    \n-
    21 {
    \n-
    22 ss << "AlbertaGridGeometry<" << mydim << "," << cdim << "> = { \\n";
    \n-
    23 for(int i=0; i<corners(); i++)
    \n-
    24 {
    \n-
    25 ss << " corner " << i << " = ";
    \n-
    26 ss << ((*this)[i]); ss << "\\n";
    \n-
    27 }
    \n-
    28 ss << "} \\n";
    \n-
    29 }
    \n-
    \n-
    30
    \n+
    8//- C++ includes
    \n+
    9#include <fstream>
    \n+
    10#include <istream>
    \n+
    11#include <string>
    \n+
    12#include <vector>
    \n+
    13
    \n+
    14//- dune-common includes
    \n+
    15#include <dune/common/exceptions.hh>
    \n+
    16#include <dune/common/fvector.hh>
    \n+
    17#include <dune/common/parallel/mpihelper.hh>
    \n+
    18
    \n+
    19//- dune-grid includes
    \n+
    20#include <dune-grid-config.hh> // HAVE_DUNE_UGGRID
    \n+\n+
    22#include <dune/grid/uggrid.hh>
    \n+
    23
    \n+
    24//- local includes
    \n+
    25#include "dgfparser.hh"
    \n+\n+
    27
    \n+
    28
    \n+
    29namespace Dune
    \n+
    30{
    \n
    31
    \n-
    32 template< int mydim, int cdim, class GridImp >
    \n-\n-
    \n-\n-
    35 {
    \n-
    36 GlobalCoordinate y = corner( 0 );
    \n-
    37 jacobianTransposed().umtv( local, y );
    \n-
    38 return y;
    \n-
    39 }
    \n-
    \n-
    40
    \n-
    41
    \n-
    42 //local implementation for mydim < cdim
    \n-
    43 template< int mydim, int cdim, class GridImp >
    \n-\n-
    \n-\n-
    46 {
    \n-\n-
    48 jacobianInverseTransposed().mtv( global - corner( 0 ), x );
    \n-
    49 return x;
    \n-
    50 }
    \n-
    \n-
    51
    \n-
    52
    \n-
    53 template< int mydim, int cdim, class GridImp >
    \n-\n-
    \n-\n-
    56 {
    \n-
    57 if( !builtJT_ )
    \n-
    58 {
    \n-
    59 const FieldVector< ctype, coorddimension > &origin = coord_[ 0 ];
    \n-
    60 for( int i = 0; i < mydimension; ++i )
    \n-
    61 {
    \n-
    62 jT_[ i ] = coord_[ i+1 ];
    \n-
    63 jT_[ i ] -= origin;
    \n-
    64 }
    \n-
    65 builtJT_ = true;
    \n-
    66 }
    \n-
    67 return jT_;
    \n-
    68 }
    \n+
    32 namespace dgf
    \n+
    33 {
    \n+
    34
    \n+
    35 // UGGridParameterBlock
    \n+
    36 // --------------------
    \n+
    37
    \n+
    \n+\n+
    39 : public GridParameterBlock
    \n+
    40 {
    \n+
    42 explicit UGGridParameterBlock ( std::istream &input );
    \n+
    43
    \n+
    45 bool noClosure () const { return noClosure_; }
    \n+
    47 bool noCopy () const { return noCopy_; }
    \n+
    49 size_t heapSize () const { return heapSize_; }
    \n+
    50
    \n+
    51 protected:
    \n+
    52 bool noClosure_; // no closure for UGGrid
    \n+
    53 bool noCopy_; // no copies for UGGrid
    \n+
    54 size_t heapSize_; // heap size for UGGrid
    \n+
    55 };
    \n+
    \n+
    56
    \n+
    57 } // namespace dgf
    \n+
    58
    \n+
    59
    \n+
    60
    \n+
    61#if HAVE_DUNE_UGGRID
    \n+
    62 template< int dim >
    \n+
    \n+
    63 struct DGFGridInfo< UGGrid< dim > >
    \n+
    64 {
    \n+
    \n+
    65 static int refineStepsForHalf ()
    \n+
    66 {
    \n+
    67 return 1;
    \n+
    68 }
    \n
    \n
    69
    \n-
    70
    \n-
    71 template< int mydim, int cdim, class GridImp >
    \n-\n-
    \n-\n-
    74 {
    \n-
    75 if( !builtJTInv_ )
    \n-
    76 {
    \n-
    77 elDet_ = std::abs( Alberta::invert( jacobianTransposed(), jTInv_ ) );
    \n-
    78 assert( elDet_ > 1.0e-25 );
    \n-
    79 calcedDet_ = true;
    \n-
    80 builtJTInv_ = true;
    \n-
    81 }
    \n-
    82 return jTInv_;
    \n-
    83 }
    \n-
    \n-
    84
    \n-
    85
    \n-
    86 // built Geometry
    \n-
    87 template< int mydim, int cdim, class GridImp >
    \n-
    88 template< class CoordReader >
    \n-\n-
    \n-
    90 ::build ( const CoordReader &coordReader )
    \n-
    91 {
    \n-
    92 builtJT_ = false;
    \n-
    93 builtJTInv_ = false;
    \n-
    94
    \n-
    95 // copy corners
    \n-
    96 for( int i = 0; i < numCorners; ++i )
    \n-
    97 coordReader.coordinate( i, coord_[ i ] );
    \n-
    98
    \n-
    99 // calculate centroid
    \n-
    100 centroid_ = coord_[ 0 ];
    \n-
    101 for( int i = 1; i < numCorners; ++i )
    \n-
    102 centroid_ += coord_[ i ];
    \n-
    103 centroid_ *= 1.0 / numCorners;
    \n-
    104
    \n-
    105 elDet_ = (coordReader.hasDeterminant() ? coordReader.determinant() : elDeterminant());
    \n-
    106 assert( std::abs( elDet_ ) > 0.0 );
    \n-
    107 calcedDet_ = true;
    \n-
    108 }
    \n-
    \n-
    109
    \n-
    110
    \n-
    111#if !DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    112 template< int dim, int cdim >
    \n-\n-
    114 AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::global ( const LocalCoordinate &local ) const
    \n-
    115 {
    \n-
    116 GlobalCoordinate y = corner( 0 );
    \n-
    117 jacobianTransposed().umtv( local, y );
    \n-
    118 return y;
    \n-
    119 }
    \n-
    120
    \n-
    121
    \n-
    122 //local implementation for mydim < cdim
    \n-
    123 template< int dim, int cdim >
    \n-
    124 inline typename AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::LocalCoordinate
    \n-
    125 AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::local ( const GlobalCoordinate &global ) const
    \n-
    126 {
    \n-
    127 LocalCoordinate x;
    \n-
    128 jacobianInverseTransposed().mtv( global - corner( 0 ), x );
    \n-
    129 return x;
    \n-
    130 }
    \n-
    131#endif // #if !DUNE_ALBERTA_CACHE_COORDINATES
    \n-
    132
    \n+
    \n+
    70 static double refineWeight ()
    \n+
    71 {
    \n+
    72 return -1.;
    \n+
    73 }
    \n+
    \n+
    74 };
    \n+
    \n+
    75
    \n+
    76
    \n+
    77
    \n+
    78 // DGFGridFactory< UGGrid< dim > >
    \n+
    79 // -------------------------------
    \n+
    80
    \n+
    81 template< int dim >
    \n+
    \n+
    82 struct DGFGridFactory< UGGrid< dim > >
    \n+
    83 {
    \n+\n+
    87 static const int dimension = dim;
    \n+
    89 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n+
    90
    \n+
    \n+
    92 explicit DGFGridFactory ( std::istream &input,
    \n+
    93 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    94 : grid_( 0 ),
    \n+
    95 factory_(),
    \n+
    96 dgf_( rank( comm ), size( comm ) )
    \n+
    97 {
    \n+
    98 generate( input );
    \n+
    99 }
    \n+
    \n+
    100
    \n+
    \n+
    102 explicit DGFGridFactory ( const std::string &filename,
    \n+
    103 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n+
    104 : grid_( 0 ),
    \n+
    105 factory_(),
    \n+
    106 dgf_( rank( comm ), size( comm ) )
    \n+
    107 {
    \n+
    108 std::ifstream input( filename.c_str() );
    \n+
    109 if ( !input )
    \n+
    110 DUNE_THROW( DGFException, "Error: Macrofile " << filename << " not found" );
    \n+
    111 generate( input );
    \n+
    112 }
    \n+
    \n+
    113
    \n+
    \n+\n+
    116 {
    \n+
    117 return grid_;
    \n+
    118 }
    \n+
    \n+
    119
    \n+
    121 template< class GG, class II >
    \n+
    \n+
    122 bool wasInserted ( const Dune::Intersection< GG, II > &intersection ) const
    \n+
    123 {
    \n+
    124 return factory_.wasInserted( intersection );
    \n+
    125 }
    \n+
    \n+
    126
    \n+
    128 template< class GG, class II >
    \n+
    \n+
    129 int boundaryId ( const Dune::Intersection< GG, II > &intersection ) const
    \n+
    130 {
    \n+
    131 return intersection.boundarySegmentIndex();
    \n+
    132 }
    \n+
    \n
    133
    \n-
    134
    \n-
    135 // AlbertaGridLocalGeometryProvider
    \n-
    136 // --------------------------------
    \n-
    137
    \n-
    138 template< class Grid >
    \n-
    139 void AlbertaGridLocalGeometryProvider< Grid >::buildGeometryInFather ()
    \n-
    140 {
    \n-
    141 for( int child = 0; child < numChildren; ++child )
    \n-
    142 {
    \n-
    143 for( int orientation = 0; orientation < 2; ++orientation )
    \n-
    144 {
    \n-
    145 const GeoInFatherCoordReader coordReader( child, orientation );
    \n-
    146 geometryInFather_[ child ][ orientation ] = new LocalElementGeometry( coordReader );
    \n-
    147 }
    \n-
    148 }
    \n-
    149 }
    \n-
    150
    \n-
    151
    \n-
    152 template< class Grid >
    \n-
    153 void AlbertaGridLocalGeometryProvider< Grid >::buildFaceGeometry ()
    \n-
    154 {
    \n-
    155 for( int face = 0; face < numFaces; ++face )
    \n-
    156 {
    \n-
    157 for( int twist = minFaceTwist; twist <= maxFaceTwist; ++twist )
    \n-
    158 {
    \n-
    159 const FaceCoordReader coordReader( face, twist );
    \n-
    160 faceGeometry_[ face ][ twist - minFaceTwist ] = new LocalFaceGeometry( coordReader );
    \n-
    161 }
    \n+
    135 template< int codim >
    \n+
    \n+
    136 int numParameters () const
    \n+
    137 {
    \n+
    138 if( codim == 0 )
    \n+
    139 return dgf_.nofelparams;
    \n+
    140 else if( codim == dimension )
    \n+
    141 return dgf_.nofvtxparams;
    \n+
    142 else
    \n+
    143 return 0;
    \n+
    144 }
    \n+
    \n+
    145
    \n+
    147 template< class Entity >
    \n+
    \n+
    148 int numParameters ( const Entity & ) const
    \n+
    149 {
    \n+
    150 return numParameters< Entity::codimension >();
    \n+
    151 }
    \n+
    \n+
    152
    \n+
    \n+
    154 std::vector< double > &parameter ( const typename Grid::template Codim< 0 >::Entity &element )
    \n+
    155 {
    \n+
    156 if( numParameters< 0 >() <= 0 )
    \n+
    157 {
    \n+
    158 DUNE_THROW( InvalidStateException,
    \n+
    159 "Calling DGFGridFactory::parameter is only allowed if there are parameters." );
    \n+
    160 }
    \n+
    161 return dgf_.elParams[ factory_.insertionIndex( element ) ];
    \n
    162 }
    \n-
    163 }
    \n-
    164
    \n-
    165
    \n-
    166
    \n-
    167 // AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader
    \n-
    168 // --------------------------------------------------------
    \n-
    169
    \n-
    170 template< class Grid >
    \n-
    \n-\n-
    172 {
    \n-\n-
    174
    \n-\n-
    176
    \n-
    177 private:
    \n-\n-
    179
    \n-
    180 public:
    \n-
    \n-
    181 GeoInFatherCoordReader ( int child, int orientation )
    \n-
    182 : child_( child ),
    \n-
    183 orientation_( orientation )
    \n-
    184 {}
    \n-
    \n-
    185
    \n-
    \n-
    186 void coordinate ( int i, Coordinate &x ) const
    \n-
    187 {
    \n-
    188 const typename GeoInFather::LocalVector &coord
    \n-
    189 = GeoInFather::coordinate( child_, orientation_, i );
    \n-
    190 for( int j = 0; j < dimension; ++j )
    \n-
    191 x[ j ] = coord[ j ];
    \n-
    192 }
    \n-
    \n-
    193
    \n-
    \n-
    194 bool hasDeterminant () const
    \n-
    195 {
    \n-
    196 return false;
    \n-
    197 }
    \n-
    \n-
    198
    \n-
    \n-\n-
    200 {
    \n-
    201 return ctype( 0 );
    \n-
    202 }
    \n-
    \n-
    203
    \n-
    204 private:
    \n-
    205 const int child_;
    \n-
    206 const int orientation_;
    \n-
    207 };
    \n
    \n-
    208
    \n-
    209
    \n-
    210
    \n-
    211 // AlbertaGridLocalGeometryProvider::FaceCoordReader
    \n-
    212 // -------------------------------------------------
    \n-
    213
    \n-
    214 template< class Grid >
    \n-
    \n-\n-
    216 {
    \n-\n-
    218
    \n-\n-
    220
    \n-
    \n-
    221 FaceCoordReader ( const int face, const int twist = 0 )
    \n-
    222 : face_( face ),
    \n-
    223 twist_( twist )
    \n-
    224 {}
    \n-
    \n-
    225
    \n-
    \n-
    226 void coordinate ( const int i, Coordinate &x ) const
    \n-
    227 {
    \n-
    228 const int ti = Alberta::applyInverseTwist< dimension-1 >( twist_, i );
    \n-
    229 const int j = mapVertices< 1 >( face_, ti );
    \n-
    230 refCorner( j, x );
    \n-
    231 }
    \n-
    \n-
    232
    \n-
    \n-
    233 bool hasDeterminant () const
    \n-
    234 {
    \n-
    235 return false;
    \n-
    236 }
    \n+
    163
    \n+
    \n+
    165 std::vector< double > &parameter ( const typename Grid::template Codim< dimension >::Entity &vertex )
    \n+
    166 {
    \n+
    167 if( numParameters< dimension >() <= 0 )
    \n+
    168 {
    \n+
    169 DUNE_THROW( InvalidStateException,
    \n+
    170 "Calling DGFGridFactory::parameter is only allowed if there are parameters." );
    \n+
    171 }
    \n+
    172 return dgf_.vtxParams[ factory_.insertionIndex( vertex ) ];
    \n+
    173 }
    \n
    \n+
    174
    \n+
    \n+\n+
    177 {
    \n+
    178 return dgf_.haveBndParameters;
    \n+
    179 }
    \n+
    \n+
    180
    \n+
    182 template< class GG, class II >
    \n+
    \n+\n+
    184 {
    \n+\n+
    186 typename Intersection::Entity entity = intersection.inside();
    \n+
    187 const int face = intersection.indexInInside();
    \n+
    188
    \n+
    189 auto refElem = referenceElement< double, dimension >( entity.type() );
    \n+
    190 int corners = refElem.size( face, 1, dimension );
    \n+
    191 std::vector< unsigned int > bound( corners );
    \n+
    192 for( int i = 0; i < corners; ++i )
    \n+
    193 {
    \n+
    194 const int k = refElem.subEntity( face, 1, i, dimension );
    \n+
    195 bound[ i ] = factory_.insertionIndex( entity.template subEntity< dimension >( k ) );
    \n+
    196 }
    \n+
    197
    \n+
    198 DuneGridFormatParser::facemap_t::key_type key( bound, false );
    \n+
    199 const DuneGridFormatParser::facemap_t::const_iterator pos = dgf_.facemap.find( key );
    \n+
    200 if( pos != dgf_.facemap.end() )
    \n+
    201 return dgf_.facemap.find( key )->second.second;
    \n+
    202 else
    \n+\n+
    204 }
    \n+
    \n+
    205
    \n+
    206 private:
    \n+
    207 // create grid
    \n+
    208 void generate ( std::istream &input );
    \n+
    209
    \n+
    210 // return rank
    \n+
    211 static int rank( MPICommunicatorType MPICOMM )
    \n+
    212 {
    \n+
    213 int rank = 0;
    \n+
    214#if HAVE_MPI
    \n+
    215 MPI_Comm_rank( MPICOMM, &rank );
    \n+
    216#endif
    \n+
    217 return rank;
    \n+
    218 }
    \n+
    219
    \n+
    220 // return size
    \n+
    221 static int size( MPICommunicatorType MPICOMM )
    \n+
    222 {
    \n+
    223 int size = 1;
    \n+
    224#if HAVE_MPI
    \n+
    225 MPI_Comm_size( MPICOMM, &size );
    \n+
    226#endif
    \n+
    227 return size;
    \n+
    228 }
    \n+
    229
    \n+
    230 Grid *grid_;
    \n+
    231 GridFactory< UGGrid< dim > > factory_;
    \n+
    232 DuneGridFormatParser dgf_;
    \n+
    233 };
    \n+
    \n+
    234#endif // #if HAVE_DUNE_UGGRID
    \n+
    235
    \n+
    236} // namespace Dune
    \n
    237
    \n-
    \n-\n-
    239 {
    \n-
    240 return ctype( 0 );
    \n-
    241 }
    \n-
    \n-
    242
    \n-
    243 private:
    \n-
    244 static void refCorner ( const int i, Coordinate &x )
    \n-
    245 {
    \n-
    246 x = ctype( 0 );
    \n-
    247 if( i > 0 )
    \n-
    248 x[ i-1 ] = ctype( 1 );
    \n-
    249 }
    \n-
    250
    \n-
    251 int face_;
    \n-
    252 int twist_;
    \n-
    253 };
    \n-
    \n-
    254
    \n-
    255} // namespace Dune
    \n-
    256
    \n-
    257#endif // #ifndef DUNE_ALBERTA_GEOMETRY_CC
    \n-\n-
    provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
    \n+
    238#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH
    \n+\n+
    The UGGrid class.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    int applyInverseTwist(int twist, int i)
    Definition misc.hh:637
    \n-
    ALBERTA REAL Real
    Definition misc.hh:48
    \n-
    static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 > &inverse)
    Definition algebra.hh:81
    \n-\n-
    FieldVector< ctype, dimension > Coordinate
    Definition geometry.cc:175
    \n-\n-
    void coordinate(int i, Coordinate &x) const
    Definition geometry.cc:186
    \n-
    GeoInFatherCoordReader(int child, int orientation)
    Definition geometry.cc:181
    \n-
    bool hasDeterminant() const
    Definition geometry.cc:194
    \n-
    ctype determinant() const
    Definition geometry.cc:199
    \n-\n-
    FaceCoordReader(const int face, const int twist=0)
    Definition geometry.cc:221
    \n-
    void coordinate(const int i, Coordinate &x) const
    Definition geometry.cc:226
    \n-
    ctype determinant() const
    Definition geometry.cc:238
    \n-
    FieldVector< ctype, dimension > Coordinate
    Definition geometry.cc:219
    \n-
    bool hasDeterminant() const
    Definition geometry.cc:233
    \n-
    Alberta::Real ctype
    Definition geometry.cc:217
    \n-
    geometry implementation for AlbertaGrid
    Definition albertagrid/geometry.hh:108
    \n-
    const JacobianTransposed & jacobianTransposed() const
    transposed of the geometry mapping's Jacobian
    Definition geometry.cc:55
    \n-
    LocalCoordinate local(const GlobalCoordinate &global) const
    map a point from the geometry to the reference element
    Definition geometry.cc:45
    \n-
    const JacobianInverseTransposed & jacobianInverseTransposed() const
    transposed inverse of the geometry mapping's Jacobian
    Definition geometry.cc:73
    \n-
    FieldVector< ctype, mydimension > LocalCoordinate
    Definition albertagrid/geometry.hh:126
    \n-
    FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
    Definition albertagrid/geometry.hh:130
    \n-
    void print(std::ostream &out) const
    Definition geometry.cc:20
    \n-
    GlobalCoordinate global(const LocalCoordinate &local) const
    map a point from the reference element to the geometry
    Definition geometry.cc:34
    \n-
    FieldVector< ctype, coorddimension > GlobalCoordinate
    Definition albertagrid/geometry.hh:127
    \n-
    FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
    Definition albertagrid/geometry.hh:129
    \n-
    Definition albertagrid/geometry.hh:303
    \n-
    Definition albertagrid/geometry.hh:504
    \n-
    static constexpr int dimension
    Definition albertagrid/geometry.hh:510
    \n-
    Grid::ctype ctype
    Definition albertagrid/geometry.hh:508
    \n-
    Definition albertagrid/geometry.hh:514
    \n-
    Definition refinement.hh:292
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-\n+
    Definition dgfgridfactory.hh:38
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n+
    G Grid
    Definition dgfgridfactory.hh:39
    \n+
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n+
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n+
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n+
    size_t boundarySegmentIndex() const
    index of the boundary segment within the macro grid
    Definition common/intersection.hh:236
    \n+
    Entity inside() const
    return Entity on the inside of this intersection. That is the Entity where we started this.
    Definition common/intersection.hh:250
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Type of entity that this Intersection belongs to.
    Definition common/intersection.hh:192
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n+
    Common Grid parameters.
    Definition gridparameter.hh:35
    \n+
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n+
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n+
    Definition dgfug.hh:40
    \n+
    size_t heapSize() const
    returns heap size used on construction of the grid
    Definition dgfug.hh:49
    \n+
    bool noCopy_
    Definition dgfug.hh:53
    \n+
    size_t heapSize_
    Definition dgfug.hh:54
    \n+
    bool noClosure_
    Definition dgfug.hh:52
    \n+
    bool noCopy() const
    returns true if no copies are made for UGGrid elements
    Definition dgfug.hh:47
    \n+
    bool noClosure() const
    returns true if no closure should be used for UGGrid
    Definition dgfug.hh:45
    \n+
    static double refineWeight()
    Definition dgfug.hh:70
    \n+
    static int refineStepsForHalf()
    Definition dgfug.hh:65
    \n+
    const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
    return invalid value
    Definition dgfug.hh:183
    \n+
    std::vector< double > & parameter(const typename Grid::template Codim< dimension >::Entity &vertex)
    return parameter for vertex
    Definition dgfug.hh:165
    \n+
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking filename
    Definition dgfug.hh:102
    \n+
    MPIHelper::MPICommunicator MPICommunicatorType
    MPI communicator type.
    Definition dgfug.hh:89
    \n+
    int numParameters(const Entity &) const
    return number of parameters
    Definition dgfug.hh:148
    \n+
    int boundaryId(const Dune::Intersection< GG, II > &intersection) const
    will return boundary segment index
    Definition dgfug.hh:129
    \n+
    UGGrid< dim > Grid
    grid type
    Definition dgfug.hh:85
    \n+
    bool wasInserted(const Dune::Intersection< GG, II > &intersection) const
    please doc me
    Definition dgfug.hh:122
    \n+
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    constructor taking istream
    Definition dgfug.hh:92
    \n+
    int numParameters() const
    return number of parameters
    Definition dgfug.hh:136
    \n+
    bool haveBoundaryParameters() const
    UGGrid does not support boundary parameters.
    Definition dgfug.hh:176
    \n+
    std::vector< double > & parameter(const typename Grid::template Codim< 0 >::Entity &element)
    return parameter for codim 0 entity
    Definition dgfug.hh:154
    \n+
    Grid * grid()
    return grid
    Definition dgfug.hh:115
    \n+
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n+
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n+
    Front-end for the grid manager of the finite element toolbox UG3.
    Definition uggrid.hh:208
    \n+\n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,393 +1,395 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-geometry.cc\n+ * io\n+ * file\n+ * dgfparser\n+dgfug.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_GEOMETRY_CC\n-6#define DUNE_ALBERTA_GEOMETRY_CC\n+5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH\n+6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH\n 7\n-8#include \n-9#include \n-10#include \n-11\n-12namespace Dune\n-13{\n-14\n-15 // AlbertaGridGeometry\n-16 // -------------------\n-17\n-18 // print the GeometryInformation\n-19 template \n-20 inline void AlbertaGridGeometry::print (std::ostream&\n-ss) const\n-21 {\n-22 ss << \"AlbertaGridGeometry<\" << mydim << \",\" << cdim << \"> = { \\n\";\n-23 for(int i=0; i\n+10#include \n+11#include \n+12#include \n+13\n+14//- dune-common includes\n+15#include \n+16#include \n+17#include \n+18\n+19//- dune-grid includes\n+20#include // HAVE_DUNE_UGGRID\n+21#include \n+22#include \n+23\n+24//- local includes\n+25#include \"dgfparser.hh\"\n+26#include \"blocks/gridparameter.hh\"\n+27\n+28\n+29namespace Dune\n+30{\n 31\n-32 template< int mydim, int cdim, class GridImp >\n-33 inline typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::\n-GlobalCoordinate\n-34 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::global ( const LocalCoordinate\n-&local ) const\n-35 {\n-36 GlobalCoordinate y = corner( 0 );\n-37 jacobianTransposed().umtv( local, y );\n-38 return y;\n-39 }\n-40\n-41\n-42 //local implementation for mydim < cdim\n-43 template< int mydim, int cdim, class GridImp >\n-44 inline typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::LocalCoordinate\n-45 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::local ( const GlobalCoordinate\n-&global ) const\n-46 {\n-47 LocalCoordinate x;\n-48 jacobianInverseTransposed().mtv( global - corner( 0 ), x );\n-49 return x;\n-50 }\n-51\n-52\n-53 template< int mydim, int cdim, class GridImp >\n-54 inline const typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::\n-JacobianTransposed &\n-55 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::jacobianTransposed () const\n-56 {\n-57 if( !builtJT_ )\n-58 {\n-59 const FieldVector< ctype, coorddimension > &origin = coord_[ 0 ];\n-60 for( int i = 0; i < mydimension; ++i )\n-61 {\n-62 jT_[ i ] = coord_[ i+1 ];\n-63 jT_[ i ] -= origin;\n-64 }\n-65 builtJT_ = true;\n-66 }\n-67 return jT_;\n+32 namespace dgf\n+33 {\n+34\n+35 // UGGridParameterBlock\n+36 // --------------------\n+37\n+38 struct UGGridParameterBlock\n+39 : public GridParameterBlock\n+40 {\n+42 explicit UGGridParameterBlock ( std::istream &input );\n+43\n+45 bool noClosure () const { return noClosure_; }\n+47 bool noCopy () const { return noCopy_; }\n+49 size_t heapSize () const { return heapSize_; }\n+50\n+51 protected:\n+52 bool noClosure_; // no closure for UGGrid\n+53 bool noCopy_; // no copies for UGGrid\n+54 size_t heapSize_; // heap size for UGGrid\n+55 };\n+56\n+57 } // namespace dgf\n+58\n+59\n+60\n+61#if HAVE_DUNE_UGGRID\n+62 template< int dim >\n+63 struct DGFGridInfo< UGGrid< dim > >\n+64 {\n+65 static int refineStepsForHalf ()\n+66 {\n+67 return 1;\n 68 }\n 69\n-70\n-71 template< int mydim, int cdim, class GridImp >\n-72 inline const typename AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::\n-JacobianInverseTransposed &\n-73 AlbertaGridGeometry<_mydim,_cdim,_GridImp_>::jacobianInverseTransposed ()\n-const\n-74 {\n-75 if( !builtJTInv_ )\n-76 {\n-77 elDet_ = std::abs( Alberta::invert( jacobianTransposed(), jTInv_ ) );\n-78 assert( elDet_ > 1.0e-25 );\n-79 calcedDet_ = true;\n-80 builtJTInv_ = true;\n-81 }\n-82 return jTInv_;\n-83 }\n-84\n-85\n-86 // built Geometry\n-87 template< int mydim, int cdim, class GridImp >\n-88 template< class CoordReader >\n-89 inline void AlbertaGridGeometry<_mydim,_cdim,_GridImp_>\n-90_::build ( const CoordReader &coordReader )\n-91 {\n-92 builtJT_ = false;\n-93 builtJTInv_ = false;\n-94\n-95 // copy corners\n-96 for( int i = 0; i < numCorners; ++i )\n-97 coordReader.coordinate( i, coord_[ i ] );\n-98\n-99 // calculate centroid\n-100 centroid_ = coord_[ 0 ];\n-101 for( int i = 1; i < numCorners; ++i )\n-102 centroid_ += coord_[ i ];\n-103 centroid_ *= 1.0 / numCorners;\n-104\n-105 elDet_ = (coordReader.hasDeterminant() ? coordReader.determinant() :\n-elDeterminant());\n-106 assert( std::abs( elDet_ ) > 0.0 );\n-107 calcedDet_ = true;\n-108 }\n-109\n-110\n-111#if !DUNE_ALBERTA_CACHE_COORDINATES\n-112 template< int dim, int cdim >\n-113 inline typename AlbertaGridGlobalGeometry<_dim,_cdim,_const_AlbertaGrid<\n-dim,_cdim_> >::GlobalCoordinate\n-114 AlbertaGridGlobalGeometry<_dim,_cdim,_const_AlbertaGrid<_dim,_cdim_> >::\n-global ( const LocalCoordinate &local ) const\n-115 {\n-116 GlobalCoordinate y = corner( 0 );\n-117 jacobianTransposed().umtv( local, y );\n-118 return y;\n-119 }\n-120\n-121\n-122 //local implementation for mydim < cdim\n-123 template< int dim, int cdim >\n-124 inline typename AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid<\n-dim, cdim > >::LocalCoordinate\n-125 AlbertaGridGlobalGeometry< dim, cdim, const AlbertaGrid< dim, cdim > >::\n-local ( const GlobalCoordinate &global ) const\n-126 {\n-127 LocalCoordinate x;\n-128 jacobianInverseTransposed().mtv( global - corner( 0 ), x );\n-129 return x;\n-130 }\n-131#endif // #if !DUNE_ALBERTA_CACHE_COORDINATES\n-132\n+70 static double refineWeight ()\n+71 {\n+72 return -1.;\n+73 }\n+74 };\n+75\n+76\n+77\n+78 // DGFGridFactory< UGGrid< dim > >\n+79 // -------------------------------\n+80\n+81 template< int dim >\n+82 struct DGFGridFactory< UGGrid< dim > >\n+83 {\n+85 typedef UGGrid<_dim_> Grid;\n+87 static const int dimension = dim;\n+89 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n+90\n+92 explicit DGFGridFactory ( std::istream &input,\n+93 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+94 : grid_( 0 ),\n+95 factory_(),\n+96 dgf_( rank( comm ), size( comm ) )\n+97 {\n+98 generate( input );\n+99 }\n+100\n+102 explicit DGFGridFactory ( const std::string &filename,\n+103 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+104 : grid_( 0 ),\n+105 factory_(),\n+106 dgf_( rank( comm ), size( comm ) )\n+107 {\n+108 std::ifstream input( filename.c_str() );\n+109 if ( !input )\n+110 DUNE_THROW( DGFException, \"Error: Macrofile \" << filename << \" not found\"\n+);\n+111 generate( input );\n+112 }\n+113\n+115 Grid *grid ()\n+116 {\n+117 return grid_;\n+118 }\n+119\n+121 template< class GG, class II >\n+122 bool wasInserted ( const Dune::Intersection<_GG,_II_> &intersection ) const\n+123 {\n+124 return factory_.wasInserted( intersection );\n+125 }\n+126\n+128 template< class GG, class II >\n+129 int boundaryId ( const Dune::Intersection<_GG,_II_> &intersection ) const\n+130 {\n+131 return intersection.boundarySegmentIndex();\n+132 }\n 133\n-134\n-135 // AlbertaGridLocalGeometryProvider\n-136 // --------------------------------\n-137\n-138 template< class Grid >\n-139 void AlbertaGridLocalGeometryProvider< Grid >::buildGeometryInFather ()\n-140 {\n-141 for( int child = 0; child < numChildren; ++child )\n-142 {\n-143 for( int orientation = 0; orientation < 2; ++orientation )\n-144 {\n-145 const GeoInFatherCoordReader coordReader( child, orientation );\n-146 geometryInFather_[ child ][ orientation ] = new LocalElementGeometry\n-( coordReader );\n-147 }\n-148 }\n-149 }\n-150\n-151\n-152 template< class Grid >\n-153 void AlbertaGridLocalGeometryProvider< Grid >::buildFaceGeometry ()\n-154 {\n-155 for( int face = 0; face < numFaces; ++face )\n-156 {\n-157 for( int twist = minFaceTwist; twist <= maxFaceTwist; ++twist )\n-158 {\n-159 const FaceCoordReader coordReader( face, twist );\n-160 faceGeometry_[ face ][ twist - minFaceTwist ] = new LocalFaceGeometry\n-( coordReader );\n-161 }\n+135 template< int codim >\n+136 int numParameters () const\n+137 {\n+138 if( codim == 0 )\n+139 return dgf_.nofelparams;\n+140 else if( codim == dimension )\n+141 return dgf_.nofvtxparams;\n+142 else\n+143 return 0;\n+144 }\n+145\n+147 template< class Entity >\n+148 int numParameters ( const Entity & ) const\n+149 {\n+150 return numParameters< Entity::codimension >();\n+151 }\n+152\n+154 std::vector< double > ¶meter ( const typename Grid::template Codim< 0\n+>::Entity &element )\n+155 {\n+156 if( numParameters< 0 >() <= 0 )\n+157 {\n+158 DUNE_THROW( InvalidStateException,\n+159 \"Calling DGFGridFactory::parameter is only allowed if there are\n+parameters.\" );\n+160 }\n+161 return dgf_.elParams[ factory_.insertionIndex( element ) ];\n 162 }\n-163 }\n-164\n-165\n-166\n-167 // AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader\n-168 // --------------------------------------------------------\n-169\n-170 template< class Grid >\n-171 struct AlbertaGridLocalGeometryProvider< Grid >::GeoInFatherCoordReader\n-172 {\n-173 typedef Alberta::Real ctype;\n+163\n+165 std::vector< double > ¶meter ( const typename Grid::template Codim<\n+dimension >::Entity &vertex )\n+166 {\n+167 if( numParameters< dimension >() <= 0 )\n+168 {\n+169 DUNE_THROW( InvalidStateException,\n+170 \"Calling DGFGridFactory::parameter is only allowed if there are\n+parameters.\" );\n+171 }\n+172 return dgf_.vtxParams[ factory_.insertionIndex( vertex ) ];\n+173 }\n 174\n-175 typedef FieldVector<_ctype,_dimension_> Coordinate;\n-176\n-177 private:\n-178 typedef Alberta::GeometryInFather<_dimension_> GeoInFather;\n-179\n-180 public:\n-181 GeoInFatherCoordReader ( int child, int orientation )\n-182 : child_( child ),\n-183 orientation_( orientation )\n-184 {}\n-185\n-186 void coordinate ( int i, Coordinate &x ) const\n-187 {\n-188 const typename GeoInFather::LocalVector &coord\n-189 = GeoInFather::coordinate( child_, orientation_, i );\n-190 for( int j = 0; j < dimension; ++j )\n-191 x[ j ] = coord[ j ];\n-192 }\n-193\n-194 bool hasDeterminant () const\n-195 {\n-196 return false;\n-197 }\n-198\n-199 ctype determinant () const\n-200 {\n-201 return ctype( 0 );\n-202 }\n-203\n-204 private:\n-205 const int child_;\n-206 const int orientation_;\n-207 };\n-208\n+176 bool haveBoundaryParameters () const\n+177 {\n+178 return dgf_.haveBndParameters;\n+179 }\n+180\n+182 template< class GG, class II >\n+183 const DGFBoundaryParameter::type &boundaryParameter ( const Dune::\n+Intersection<_GG,_II_> &intersection ) const\n+184 {\n+185 typedef Dune::Intersection<_GG,_II_> Intersection;\n+186 typename Intersection::Entity entity = intersection.inside();\n+187 const int face = intersection.indexInInside();\n+188\n+189 auto refElem = referenceElement< double, dimension >( entity.type() );\n+190 int corners = refElem.size( face, 1, dimension );\n+191 std::vector< unsigned int > bound( corners );\n+192 for( int i = 0; i < corners; ++i )\n+193 {\n+194 const int k = refElem.subEntity( face, 1, i, dimension );\n+195 bound[ i ] = factory_.insertionIndex( entity.template subEntity< dimension\n+>( k ) );\n+196 }\n+197\n+198 DuneGridFormatParser::facemap_t::key_type key( bound, false );\n+199 const DuneGridFormatParser::facemap_t::const_iterator pos =\n+dgf_.facemap.find( key );\n+200 if( pos != dgf_.facemap.end() )\n+201 return dgf_.facemap.find( key )->second.second;\n+202 else\n+203 return DGFBoundaryParameter::defaultValue();\n+204 }\n+205\n+206 private:\n+207 // create grid\n+208 void generate ( std::istream &input );\n 209\n-210\n-211 // AlbertaGridLocalGeometryProvider::FaceCoordReader\n-212 // -------------------------------------------------\n-213\n-214 template< class Grid >\n-215 struct AlbertaGridLocalGeometryProvider< Grid >::FaceCoordReader\n-216 {\n-217 typedef Alberta::Real ctype;\n-218\n-219 typedef FieldVector<_ctype,_dimension_> Coordinate;\n-220\n-221 FaceCoordReader ( const int face, const int twist = 0 )\n-222 : face_( face ),\n-223 twist_( twist )\n-224 {}\n-225\n-226 void coordinate ( const int i, Coordinate &x ) const\n-227 {\n-228 const int ti = Alberta::applyInverseTwist< dimension-1 >( twist_, i );\n-229 const int j = mapVertices<_1_>( face_, ti );\n-230 refCorner( j, x );\n-231 }\n-232\n-233 bool hasDeterminant () const\n-234 {\n-235 return false;\n-236 }\n+210 // return rank\n+211 static int rank( MPICommunicatorType MPICOMM )\n+212 {\n+213 int rank = 0;\n+214#if HAVE_MPI\n+215 MPI_Comm_rank( MPICOMM, &rank );\n+216#endif\n+217 return rank;\n+218 }\n+219\n+220 // return size\n+221 static int size( MPICommunicatorType MPICOMM )\n+222 {\n+223 int size = 1;\n+224#if HAVE_MPI\n+225 MPI_Comm_size( MPICOMM, &size );\n+226#endif\n+227 return size;\n+228 }\n+229\n+230 Grid *grid_;\n+231 GridFactory< UGGrid< dim > > factory_;\n+232 DuneGridFormatParser dgf_;\n+233 };\n+234#endif // #if HAVE_DUNE_UGGRID\n+235\n+236} // namespace Dune\n 237\n-238 ctype determinant () const\n-239 {\n-240 return ctype( 0 );\n-241 }\n-242\n-243 private:\n-244 static void refCorner ( const int i, Coordinate &x )\n-245 {\n-246 x = ctype( 0 );\n-247 if( i > 0 )\n-248 x[ i-1 ] = ctype( 1 );\n-249 }\n-250\n-251 int face_;\n-252 int twist_;\n-253 };\n-254\n-255} // namespace Dune\n-256\n-257#endif // #ifndef DUNE_ALBERTA_GEOMETRY_CC\n-algebra.hh\n-refinement.hh\n-provides a wrapper for ALBERTA's refinement patches and the corners for\n-geometryInFather\n+238#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFUG_HH\n+gridparameter.hh\n+uggrid.hh\n+The UGGrid class.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::applyInverseTwist\n-int applyInverseTwist(int twist, int i)\n-Definition misc.hh:637\n-Dune::Alberta::Real\n-ALBERTA REAL Real\n-Definition misc.hh:48\n-Dune::Alberta::invert\n-static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 >\n-&inverse)\n-Definition algebra.hh:81\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader\n-Definition geometry.cc:172\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::Coordinate\n-FieldVector< ctype, dimension > Coordinate\n-Definition geometry.cc:175\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::ctype\n-Alberta::Real ctype\n-Definition geometry.cc:173\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::coordinate\n-void coordinate(int i, Coordinate &x) const\n-Definition geometry.cc:186\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::\n-GeoInFatherCoordReader\n-GeoInFatherCoordReader(int child, int orientation)\n-Definition geometry.cc:181\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::hasDeterminant\n-bool hasDeterminant() const\n-Definition geometry.cc:194\n-Dune::AlbertaGridLocalGeometryProvider::GeoInFatherCoordReader::determinant\n-ctype determinant() const\n-Definition geometry.cc:199\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader\n-Definition geometry.cc:216\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::FaceCoordReader\n-FaceCoordReader(const int face, const int twist=0)\n-Definition geometry.cc:221\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::coordinate\n-void coordinate(const int i, Coordinate &x) const\n-Definition geometry.cc:226\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::determinant\n-ctype determinant() const\n-Definition geometry.cc:238\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::Coordinate\n-FieldVector< ctype, dimension > Coordinate\n-Definition geometry.cc:219\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::hasDeterminant\n-bool hasDeterminant() const\n-Definition geometry.cc:233\n-Dune::AlbertaGridLocalGeometryProvider::FaceCoordReader::ctype\n-Alberta::Real ctype\n-Definition geometry.cc:217\n-Dune::AlbertaGridGeometry\n-geometry implementation for AlbertaGrid\n-Definition albertagrid/geometry.hh:108\n-Dune::AlbertaGridGeometry::jacobianTransposed\n-const JacobianTransposed & jacobianTransposed() const\n-transposed of the geometry mapping's Jacobian\n-Definition geometry.cc:55\n-Dune::AlbertaGridGeometry::local\n-LocalCoordinate local(const GlobalCoordinate &global) const\n-map a point from the geometry to the reference element\n-Definition geometry.cc:45\n-Dune::AlbertaGridGeometry::jacobianInverseTransposed\n-const JacobianInverseTransposed & jacobianInverseTransposed() const\n-transposed inverse of the geometry mapping's Jacobian\n-Definition geometry.cc:73\n-Dune::AlbertaGridGeometry::LocalCoordinate\n-FieldVector< ctype, mydimension > LocalCoordinate\n-Definition albertagrid/geometry.hh:126\n-Dune::AlbertaGridGeometry::JacobianInverseTransposed\n-FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed\n-Definition albertagrid/geometry.hh:130\n-Dune::AlbertaGridGeometry::print\n-void print(std::ostream &out) const\n-Definition geometry.cc:20\n-Dune::AlbertaGridGeometry::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-map a point from the reference element to the geometry\n-Definition geometry.cc:34\n-Dune::AlbertaGridGeometry::GlobalCoordinate\n-FieldVector< ctype, coorddimension > GlobalCoordinate\n-Definition albertagrid/geometry.hh:127\n-Dune::AlbertaGridGeometry::JacobianTransposed\n-FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed\n-Definition albertagrid/geometry.hh:129\n-Dune::AlbertaGridGlobalGeometry\n-Definition albertagrid/geometry.hh:303\n-Dune::AlbertaGridLocalGeometryProvider\n-Definition albertagrid/geometry.hh:504\n-Dune::AlbertaGridLocalGeometryProvider::dimension\n-static constexpr int dimension\n-Definition albertagrid/geometry.hh:510\n-Dune::AlbertaGridLocalGeometryProvider::ctype\n-Grid::ctype ctype\n-Definition albertagrid/geometry.hh:508\n-Dune::AlbertaGridLocalGeometryProvider::Codim\n-Definition albertagrid/geometry.hh:514\n-Dune::Alberta::GeometryInFather\n-Definition refinement.hh:292\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-geometry.hh\n+Dune::DGFGridFactory\n+Definition dgfgridfactory.hh:38\n+Dune::DGFGridFactory::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+Definition dgfgridfactory.hh:41\n+Dune::DGFGridFactory::Grid\n+G Grid\n+Definition dgfgridfactory.hh:39\n+Dune::DGFGridFactory::dimension\n+static const int dimension\n+Definition dgfgridfactory.hh:40\n+Dune::Intersection\n+Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n+element or with the d...\n+Definition common/intersection.hh:164\n+Dune::Intersection::indexInInside\n+int indexInInside() const\n+Local index of codim 1 entity in the inside() entity where intersection is\n+contained in.\n+Definition common/intersection.hh:346\n+Dune::Intersection::boundarySegmentIndex\n+size_t boundarySegmentIndex() const\n+index of the boundary segment within the macro grid\n+Definition common/intersection.hh:236\n+Dune::Intersection::inside\n+Entity inside() const\n+return Entity on the inside of this intersection. That is the Entity where we\n+started this.\n+Definition common/intersection.hh:250\n+Dune::Intersection::Entity\n+GridImp::template Codim< 0 >::Entity Entity\n+Type of entity that this Intersection belongs to.\n+Definition common/intersection.hh:192\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n+Dune::dgf::GridParameterBlock\n+Common Grid parameters.\n+Definition gridparameter.hh:35\n+Dune::DGFException\n+exception class for IO errors in the DGF parser\n+Definition dgfexception.hh:16\n+Dune::DGFGridInfo\n+Some simple static information for a given GridType.\n+Definition io/file/dgfparser/dgfparser.hh:56\n+Dune::dgf::UGGridParameterBlock\n+Definition dgfug.hh:40\n+Dune::dgf::UGGridParameterBlock::heapSize\n+size_t heapSize() const\n+returns heap size used on construction of the grid\n+Definition dgfug.hh:49\n+Dune::dgf::UGGridParameterBlock::noCopy_\n+bool noCopy_\n+Definition dgfug.hh:53\n+Dune::dgf::UGGridParameterBlock::heapSize_\n+size_t heapSize_\n+Definition dgfug.hh:54\n+Dune::dgf::UGGridParameterBlock::noClosure_\n+bool noClosure_\n+Definition dgfug.hh:52\n+Dune::dgf::UGGridParameterBlock::noCopy\n+bool noCopy() const\n+returns true if no copies are made for UGGrid elements\n+Definition dgfug.hh:47\n+Dune::dgf::UGGridParameterBlock::noClosure\n+bool noClosure() const\n+returns true if no closure should be used for UGGrid\n+Definition dgfug.hh:45\n+Dune::DGFGridInfo<_UGGrid<_dim_>_>::refineWeight\n+static double refineWeight()\n+Definition dgfug.hh:70\n+Dune::DGFGridInfo<_UGGrid<_dim_>_>::refineStepsForHalf\n+static int refineStepsForHalf()\n+Definition dgfug.hh:65\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::boundaryParameter\n+const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection<\n+GG, II > &intersection) const\n+return invalid value\n+Definition dgfug.hh:183\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::parameter\n+std::vector< double > & parameter(const typename Grid::template Codim<\n+dimension >::Entity &vertex)\n+return parameter for vertex\n+Definition dgfug.hh:165\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::DGFGridFactory\n+DGFGridFactory(const std::string &filename, MPICommunicatorType\n+comm=MPIHelper::getCommunicator())\n+constructor taking filename\n+Definition dgfug.hh:102\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::MPICommunicatorType\n+MPIHelper::MPICommunicator MPICommunicatorType\n+MPI communicator type.\n+Definition dgfug.hh:89\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::numParameters\n+int numParameters(const Entity &) const\n+return number of parameters\n+Definition dgfug.hh:148\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::boundaryId\n+int boundaryId(const Dune::Intersection< GG, II > &intersection) const\n+will return boundary segment index\n+Definition dgfug.hh:129\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::Grid\n+UGGrid< dim > Grid\n+grid type\n+Definition dgfug.hh:85\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::wasInserted\n+bool wasInserted(const Dune::Intersection< GG, II > &intersection) const\n+please doc me\n+Definition dgfug.hh:122\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::DGFGridFactory\n+DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n+getCommunicator())\n+constructor taking istream\n+Definition dgfug.hh:92\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::numParameters\n+int numParameters() const\n+return number of parameters\n+Definition dgfug.hh:136\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::haveBoundaryParameters\n+bool haveBoundaryParameters() const\n+UGGrid does not support boundary parameters.\n+Definition dgfug.hh:176\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::parameter\n+std::vector< double > & parameter(const typename Grid::template Codim< 0 >::\n+Entity &element)\n+return parameter for codim 0 entity\n+Definition dgfug.hh:154\n+Dune::DGFGridFactory<_UGGrid<_dim_>_>::grid\n+Grid * grid()\n+return grid\n+Definition dgfug.hh:115\n+Dune::DGFBoundaryParameter::defaultValue\n+static const type & defaultValue()\n+default constructor\n+Definition parser.hh:28\n+Dune::DGFBoundaryParameter::type\n+std::string type\n+type of additional boundary parameters\n+Definition parser.hh:25\n+Dune::UGGrid\n+Front-end for the grid manager of the finite element toolbox UG3.\n+Definition uggrid.hh:208\n+dgfparser.hh\n+intersection.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00710_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00167_source.html", "comments": ["Files 82% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: undefine-2.0.hh Source File\n+dune-grid: yaspgridintersection.hh Source File\n \n \n \n \n \n \n \n@@ -70,480 +70,405 @@\n
    \n
    \n
    \n
    \n \n \n \n
    \n-
    undefine-2.0.hh
    \n+
    yaspgridintersection.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    12#ifdef _ALBERTA_H_
    \n-
    13 #undef _ALBERTA_H_
    \n-
    14#endif // _ALBERTA_H_
    \n-
    15
    \n-
    16#ifdef ALBERTA_VERSION
    \n-
    17 #undef ALBERTA_VERSION
    \n-
    18#endif // ALBERTA_VERSION
    \n-
    19
    \n-
    20#ifdef ALBERTA_DEBUG
    \n-
    21 #undef ALBERTA_DEBUG
    \n-
    22#endif // ALBERTA_DEBUG
    \n-
    23
    \n-
    24#ifdef DIM_MAX
    \n-
    25 #undef DIM_MAX
    \n-
    26#endif // DIM_MAX
    \n-
    27
    \n-
    28#ifdef N_VERTICES
    \n-
    29 #undef N_VERTICES
    \n-
    30#endif // N_VERTICES
    \n+
    5#ifndef DUNE_GRID_YASPGRIDINTERSECTION_HH
    \n+
    6#define DUNE_GRID_YASPGRIDINTERSECTION_HH
    \n+
    7
    \n+
    15namespace Dune {
    \n+
    16
    \n+
    20 template<class GridImp>
    \n+
    \n+\n+
    22 {
    \n+
    23 constexpr static int dim = GridImp::dimension;
    \n+
    24 constexpr static int dimworld = GridImp::dimensionworld;
    \n+
    25 typedef typename GridImp::ctype ctype;
    \n+
    26
    \n+
    27 typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
    \n+
    28 typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
    \n+
    29
    \n+
    30 friend class YaspIntersectionIterator<GridImp>;
    \n
    31
    \n-
    32#ifdef N_EDGES
    \n-
    33 #undef N_EDGES
    \n-
    34#endif // N_EDGES
    \n-
    35
    \n-
    36#ifdef N_WALLS
    \n-
    37 #undef N_WALLS
    \n-
    38#endif // N_WALLS
    \n+
    32 public:
    \n+
    33 // types used from grids
    \n+
    34 typedef typename GridImp::YGridLevelIterator YGLI;
    \n+
    35 typedef typename GridImp::YGrid::Iterator I;
    \n+
    36 typedef typename GridImp::template Codim<0>::Entity Entity;
    \n+
    37 typedef typename GridImp::template Codim<1>::Geometry Geometry;
    \n+
    38 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
    \n
    39
    \n-
    40#ifdef N_FACES
    \n-
    41 #undef N_FACES
    \n-
    42#endif // N_FACES
    \n-
    43
    \n-
    44#ifdef N_NEIGH
    \n-
    45 #undef N_NEIGH
    \n-
    46#endif // N_NEIGH
    \n+
    \n+
    40 void update() {
    \n+
    41
    \n+
    42 // vector with per-direction movements
    \n+
    43 std::array<int,dim> dist{{0}};
    \n+
    44
    \n+
    45 // first move: back to center
    \n+
    46 dist[_dir] = 1 - 2*_face;
    \n
    47
    \n-
    48#ifdef DIM_FAC
    \n-
    49 #undef DIM_FAC
    \n-
    50#endif // DIM_FAC
    \n+
    48 // update face info
    \n+
    49 _dir = _count / 2;
    \n+
    50 _face = _count % 2;
    \n
    51
    \n-
    52#ifdef N_VERTICES_0D
    \n-
    53 #undef N_VERTICES_0D
    \n-
    54#endif // N_VERTICES_0D
    \n-
    55
    \n-
    56#ifdef N_EDGES_0D
    \n-
    57 #undef N_EDGES_0D
    \n-
    58#endif // N_EDGES_0D
    \n-
    59
    \n-
    60#ifdef N_FACES_0D
    \n-
    61 #undef N_FACES_0D
    \n-
    62#endif // N_FACES_0D
    \n-
    63
    \n-
    64#ifdef N_NEIGH_0D
    \n-
    65 #undef N_NEIGH_0D
    \n-
    66#endif // N_NEIGH_0D
    \n-
    67
    \n-
    68#ifdef N_WALLS_0D
    \n-
    69 #undef N_WALLS_0D
    \n-
    70#endif // N_WALLS_0D
    \n-
    71
    \n-
    72#ifdef N_VERTICES_1D
    \n-
    73 #undef N_VERTICES_1D
    \n-
    74#endif // N_VERTICES_1D
    \n-
    75
    \n-
    76#ifdef N_EDGES_1D
    \n-
    77 #undef N_EDGES_1D
    \n-
    78#endif // N_EDGES_1D
    \n-
    79
    \n-
    80#ifdef N_FACES_1D
    \n-
    81 #undef N_FACES_1D
    \n-
    82#endif // N_FACES_1D
    \n+
    52 // second move: to new neighbor
    \n+
    53 dist[_dir] += -1 + 2*_face;
    \n+
    54
    \n+
    55 // move transforming iterator
    \n+
    56 _outside.transformingsubiterator().move(dist);
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    \n+
    62 bool boundary () const
    \n+
    63 {
    \n+
    64 // Coordinate of intersection in its direction
    \n+
    65 int coord = _inside.transformingsubiterator().coord(_dir) + _face;
    \n+
    66 if (_inside.gridlevel()->mg->isPeriodic(_dir))
    \n+
    67 return false;
    \n+
    68 else
    \n+
    69 return coord == 0
    \n+
    70 ||
    \n+
    71 coord == _inside.gridlevel()->mg->levelSize(_inside.gridlevel()->level(),_dir);
    \n+
    72 }
    \n+
    \n+
    73
    \n+
    \n+
    75 bool neighbor () const
    \n+
    76 {
    \n+
    77 // Coordinate of intersection in its direction
    \n+
    78 int coord = _inside.transformingsubiterator().coord(_dir) + _face;
    \n+
    79 return coord > _inside.gridlevel()->overlap[0].dataBegin()->min(_dir)
    \n+
    80 &&
    \n+
    81 coord <= _inside.gridlevel()->overlap[0].dataBegin()->max(_dir);
    \n+
    82 }
    \n+
    \n
    83
    \n-
    84#ifdef N_NEIGH_1D
    \n-
    85 #undef N_NEIGH_1D
    \n-
    86#endif // N_NEIGH_1D
    \n-
    87
    \n-
    88#ifdef N_WALLS_1D
    \n-
    89 #undef N_WALLS_1D
    \n-
    90#endif // N_WALLS_1D
    \n-
    91
    \n-
    92#ifdef N_VERTICES_2D
    \n-
    93 #undef N_VERTICES_2D
    \n-
    94#endif // N_VERTICES_2D
    \n-
    95
    \n-
    96#ifdef N_EDGES_2D
    \n-
    97 #undef N_EDGES_2D
    \n-
    98#endif // N_EDGES_2D
    \n-
    99
    \n-
    100#ifdef N_FACES_2D
    \n-
    101 #undef N_FACES_2D
    \n-
    102#endif // N_FACES_2D
    \n-
    103
    \n-
    104#ifdef N_NEIGH_2D
    \n-
    105 #undef N_NEIGH_2D
    \n-
    106#endif // N_NEIGH_2D
    \n-
    107
    \n-
    108#ifdef N_WALLS_2D
    \n-
    109 #undef N_WALLS_2D
    \n-
    110#endif // N_WALLS_2D
    \n-
    111
    \n-
    112#ifdef N_VERTICES_3D
    \n-
    113 #undef N_VERTICES_3D
    \n-
    114#endif // N_VERTICES_3D
    \n-
    115
    \n-
    116#ifdef N_EDGES_3D
    \n-
    117 #undef N_EDGES_3D
    \n-
    118#endif // N_EDGES_3D
    \n-
    119
    \n-
    120#ifdef N_FACES_3D
    \n-
    121 #undef N_FACES_3D
    \n-
    122#endif // N_FACES_3D
    \n+
    \n+
    85 bool conforming () const
    \n+
    86 {
    \n+
    87 return true;
    \n+
    88 }
    \n+
    \n+
    89
    \n+
    \n+
    92 Entity inside() const
    \n+
    93 {
    \n+
    94 return Entity(_inside);
    \n+
    95 }
    \n+
    \n+
    96
    \n+
    \n+\n+
    99 {
    \n+
    100 return Entity(_outside);
    \n+
    101 }
    \n+
    \n+
    102
    \n+
    \n+\n+
    106 {
    \n+
    107 if(! boundary())
    \n+
    108 DUNE_THROW(GridError, "called boundarySegmentIndex while boundary() == false");
    \n+
    109 // size of local macro grid
    \n+
    110 const std::array<int, dim> & size = _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->size();
    \n+
    111 const std::array<int, dim> & origin = _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin();
    \n+
    112 std::array<int, dim> sides;
    \n+
    113 {
    \n+
    114 for (int i=0; i<dim; i++)
    \n+
    115 {
    \n+
    116 sides[i] =
    \n+
    117 ((_inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin(i)
    \n+
    118 == 0)+
    \n+
    119 (_inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin(i) +
    \n+
    120 _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->size(i)
    \n+
    121 ==
    \n+
    122 _inside.gridlevel()->mg->levelSize(0,i)));
    \n
    123
    \n-
    124#ifdef N_NEIGH_3D
    \n-
    125 #undef N_NEIGH_3D
    \n-
    126#endif // N_NEIGH_3D
    \n-
    127
    \n-
    128#ifdef N_WALLS_3D
    \n-
    129 #undef N_WALLS_3D
    \n-
    130#endif // N_WALLS_3D
    \n-
    131
    \n-
    132#ifdef N_VERTICES_MAX
    \n-
    133 #undef N_VERTICES_MAX
    \n-
    134#endif // N_VERTICES_MAX
    \n-
    135
    \n-
    136#ifdef N_EDGES_MAX
    \n-
    137 #undef N_EDGES_MAX
    \n-
    138#endif // N_EDGES_MAX
    \n-
    139
    \n-
    140#ifdef N_FACES_MAX
    \n-
    141 #undef N_FACES_MAX
    \n-
    142#endif // N_FACES_MAX
    \n-
    143
    \n-
    144#ifdef N_NEIGH_MAX
    \n-
    145 #undef N_NEIGH_MAX
    \n-
    146#endif // N_NEIGH_MAX
    \n-
    147
    \n-
    148#ifdef N_WALLS_MAX
    \n-
    149 #undef N_WALLS_MAX
    \n-
    150#endif // N_WALLS_MAX
    \n-
    151
    \n-
    152#ifdef N_LAMBDA
    \n-
    153 #undef N_LAMBDA
    \n-
    154#endif // N_LAMBDA
    \n-
    155
    \n-
    156#ifdef LAMBDA_MAX
    \n-
    157 #undef LAMBDA_MAX
    \n-
    158#endif // LAMBDA_MAX
    \n-
    159
    \n-
    160#ifdef INDEX
    \n-
    161 #undef INDEX
    \n-
    162#endif // INDEX
    \n+
    124 }
    \n+
    125 }
    \n+
    126 // global position of the cell on macro grid
    \n+
    127 std::array<int, dim> pos = _inside.transformingsubiterator().coord();
    \n+
    128 for(int i=0; i<dim; i++)
    \n+
    129 {
    \n+
    130 pos[i] = pos[i] / (1<<_inside.level());
    \n+
    131 pos[i] = pos[i] - origin[i];
    \n+
    132 }
    \n+
    133 // compute unit-cube-face-sizes
    \n+
    134 std::array<int, dim> fsize;
    \n+
    135 {
    \n+
    136 int vol = 1;
    \n+
    137 for (int k=0; k<dim; k++)
    \n+
    138 vol *= size[k];
    \n+
    139 for (int k=0; k<dim; k++)
    \n+
    140 fsize[k] = vol/size[k];
    \n+
    141 }
    \n+
    142 // compute index in the unit-cube-face
    \n+
    143 int index = 0;
    \n+
    144 {
    \n+
    145 int localoffset = 1;
    \n+
    146 for (int k=dim-1; k>=0; k--)
    \n+
    147 {
    \n+
    148 if (k == _dir) continue;
    \n+
    149 index += (pos[k]) * localoffset;
    \n+
    150 localoffset *= size[k];
    \n+
    151 }
    \n+
    152 }
    \n+
    153 // add unit-cube-face-offsets
    \n+
    154 {
    \n+
    155 for (int k=0; k<_dir; k++)
    \n+
    156 index += sides[k] * fsize[k];
    \n+
    157 // add fsize if we are on the right face and there is a left-face-boundary on this processor
    \n+
    158 index += _face * (sides[_dir]>1) * fsize[_dir];
    \n+
    159 }
    \n+
    160
    \n+
    161 return index;
    \n+
    162 }
    \n+
    \n
    163
    \n-
    164#ifdef INDEX
    \n-
    165 #undef INDEX
    \n-
    166#endif // INDEX
    \n-
    167
    \n-
    168#ifdef IS_LEAF_EL
    \n-
    169 #undef IS_LEAF_EL
    \n-
    170#endif // IS_LEAF_EL
    \n-
    171
    \n-
    172#ifdef LEAF_DATA
    \n-
    173 #undef LEAF_DATA
    \n-
    174#endif // LEAF_DATA
    \n+
    \n+
    165 FieldVector<ctype, dimworld> outerNormal (const FieldVector<ctype, dim-1>& /* local */) const
    \n+
    166 {
    \n+
    167 return centerUnitOuterNormal();
    \n+
    168 }
    \n+
    \n+
    169
    \n+
    \n+
    171 FieldVector<ctype, dimworld> unitOuterNormal (const FieldVector<ctype, dim-1>& /* local */) const
    \n+
    172 {
    \n+
    173 return centerUnitOuterNormal();
    \n+
    174 }
    \n+
    \n
    175
    \n-
    176#ifdef INTERIOR
    \n-
    177 #undef INTERIOR
    \n-
    178#endif // INTERIOR
    \n-
    179
    \n-
    180#ifdef DIRICHLET
    \n-
    181 #undef DIRICHLET
    \n-
    182#endif // DIRICHLET
    \n+
    \n+
    177 FieldVector<ctype, dimworld> centerUnitOuterNormal () const
    \n+
    178 {
    \n+
    179 FieldVector<ctype, dimworld> normal(0);
    \n+
    180 normal[_dir] = (_face==0) ? -1.0 : 1.0;
    \n+
    181 return normal;
    \n+
    182 }
    \n+
    \n
    183
    \n-
    184#ifdef NEUMANN
    \n-
    185 #undef NEUMANN
    \n-
    186#endif // NEUMANN
    \n-
    187
    \n-
    188#ifdef IS_NEUMANN
    \n-
    189 #undef IS_NEUMANN
    \n-
    190#endif // IS_NEUMANN
    \n+
    \n+
    187 FieldVector<ctype, dimworld> integrationOuterNormal ([[maybe_unused]] const FieldVector<ctype, dim-1>& local) const
    \n+
    188 {
    \n+
    189 return geometry().volume() * centerUnitOuterNormal();
    \n+
    190 }
    \n+
    \n
    191
    \n-
    192#ifdef IS_DIRICHLET
    \n-
    193 #undef IS_DIRICHLET
    \n-
    194#endif // IS_DIRICHLET
    \n-
    195
    \n-
    196#ifdef IS_INTERIOR
    \n-
    197 #undef IS_INTERIOR
    \n-
    198#endif // IS_INTERIOR
    \n-
    199
    \n-
    200#ifdef N_NODE_TYPES
    \n-
    201 #undef N_NODE_TYPES
    \n-
    202#endif // N_NODE_TYPES
    \n-
    203
    \n-
    204#ifdef VERTEX
    \n-
    205 #undef VERTEX
    \n-
    206#endif // VERTEX
    \n+
    \n+\n+
    196 {
    \n+
    197 // set of dimensions that span the intersection
    \n+
    198 std::bitset<dim> s;
    \n+
    199 s.set();
    \n+
    200 s[_dir] = false;
    \n+
    201
    \n+
    202 // lower-left and upper-right corners
    \n+
    203 Dune::FieldVector<ctype, dim> ll(0.0);
    \n+
    204 Dune::FieldVector<ctype, dim> ur(1.0);
    \n+
    205
    \n+
    206 ll[_dir] = ur[_dir] = (_face==0) ? 0.0 : 1.0;
    \n
    207
    \n-
    208#ifdef CENTER
    \n-
    209 #undef CENTER
    \n-
    210#endif // CENTER
    \n-
    211
    \n-
    212#ifdef EDGE
    \n-
    213 #undef EDGE
    \n-
    214#endif // EDGE
    \n-
    215
    \n-
    216#ifdef FACE
    \n-
    217 #undef FACE
    \n-
    218#endif // FACE
    \n-
    219
    \n-
    220#ifdef LIST_ENTRY
    \n-
    221 #undef LIST_ENTRY
    \n-
    222#endif // LIST_ENTRY
    \n-
    223
    \n-
    224#ifdef WALL_BOUND
    \n-
    225 #undef WALL_BOUND
    \n-
    226#endif // WALL_BOUND
    \n-
    227
    \n-
    228#ifdef FILL_NOTHING
    \n-
    229 #undef FILL_NOTHING
    \n-
    230#endif // FILL_NOTHING
    \n-
    231
    \n-
    232#ifdef FILL_COORDS
    \n-
    233 #undef FILL_COORDS
    \n-
    234#endif // FILL_COORDS
    \n-
    235
    \n-
    236#ifdef FILL_BOUND
    \n-
    237 #undef FILL_BOUND
    \n-
    238#endif // FILL_BOUND
    \n-
    239
    \n-
    240#ifdef FILL_NEIGH
    \n-
    241 #undef FILL_NEIGH
    \n-
    242#endif // FILL_NEIGH
    \n+
    208 return LocalGeometry(LocalGeometryImpl(ll,ur,s));
    \n+
    209 }
    \n+
    \n+
    210
    \n+
    \n+\n+
    215 {
    \n+
    216 // set of dimensions that span the intersection
    \n+
    217 std::bitset<dim> s;
    \n+
    218 s.set();
    \n+
    219 s[_dir] = false;
    \n+
    220
    \n+
    221 // lower-left and upper-right corners
    \n+
    222 Dune::FieldVector<ctype, dim> ll(0.0);
    \n+
    223 Dune::FieldVector<ctype, dim> ur(1.0);
    \n+
    224
    \n+
    225 ll[_dir] = ur[_dir] = (_face==1) ? 0.0 : 1.0;
    \n+
    226
    \n+
    227 return LocalGeometry(LocalGeometryImpl(ll,ur,s));
    \n+
    228 }
    \n+
    \n+
    229
    \n+
    \n+\n+
    233 {
    \n+
    234
    \n+
    235 std::bitset<dim> shift;
    \n+
    236 shift.set();
    \n+
    237 shift[_dir] = false;
    \n+
    238
    \n+
    239 Dune::FieldVector<ctype,dimworld> ll, ur;
    \n+
    240 for (int i=0; i<dimworld; i++)
    \n+
    241 {
    \n+
    242 int coord = _inside.transformingsubiterator().coord(i);
    \n
    243
    \n-
    244#ifdef FILL_OPP_COORDS
    \n-
    245 #undef FILL_OPP_COORDS
    \n-
    246#endif // FILL_OPP_COORDS
    \n-
    247
    \n-
    248#ifdef FILL_ORIENTATION
    \n-
    249 #undef FILL_ORIENTATION
    \n-
    250#endif // FILL_ORIENTATION
    \n+
    244 if ((i == _dir) and (_face))
    \n+
    245 coord++;
    \n+
    246
    \n+
    247 ll[i] = _inside.transformingsubiterator().coordCont()->coordinate(i,coord);
    \n+
    248 if (i != _dir)
    \n+
    249 coord++;
    \n+
    250 ur[i] = _inside.transformingsubiterator().coordCont()->coordinate(i,coord);
    \n
    251
    \n-
    252#ifdef FILL_EL_TYPE
    \n-
    253 #undef FILL_EL_TYPE
    \n-
    254#endif // FILL_EL_TYPE
    \n-
    255
    \n-
    256#ifdef FILL_PROJECTION
    \n-
    257 #undef FILL_PROJECTION
    \n-
    258#endif // FILL_PROJECTION
    \n-
    259
    \n-
    260#ifdef FILL_ANY
    \n-
    261 #undef FILL_ANY
    \n-
    262#endif // FILL_ANY
    \n-
    263
    \n-
    264#ifdef HOOK_QUEUE_OFFSET
    \n-
    265 #undef HOOK_QUEUE_OFFSET
    \n-
    266#endif // HOOK_QUEUE_OFFSET
    \n-
    267
    \n-
    268#ifdef RUN_HOOKS_0
    \n-
    269 #undef RUN_HOOKS_0
    \n-
    270#endif // RUN_HOOKS_0
    \n-
    271
    \n-
    272#ifdef RUN_BAS_FCTS_HOOKS
    \n-
    273 #undef RUN_BAS_FCTS_HOOKS
    \n-
    274#endif // RUN_BAS_FCTS_HOOKS
    \n-
    275
    \n-
    276#ifdef RUN_HOOKS_1
    \n-
    277 #undef RUN_HOOKS_1
    \n-
    278#endif // RUN_HOOKS_1
    \n-
    279
    \n-
    280#ifdef RUN_HOOKS_2
    \n-
    281 #undef RUN_HOOKS_2
    \n-
    282#endif // RUN_HOOKS_2
    \n-
    283
    \n-
    284#ifdef RUN_HOOKS_3
    \n-
    285 #undef RUN_HOOKS_3
    \n-
    286#endif // RUN_HOOKS_3
    \n-
    287
    \n-
    288#ifdef RUN_HOOKS_4
    \n-
    289 #undef RUN_HOOKS_4
    \n-
    290#endif // RUN_HOOKS_4
    \n-
    291
    \n-
    292#ifdef RUN_HOOKS_5
    \n-
    293 #undef RUN_HOOKS_5
    \n-
    294#endif // RUN_HOOKS_5
    \n+
    252 // If on periodic overlap, transform coordinates by domain size
    \n+
    253 if (_inside.gridlevel()->mg->isPeriodic(i)) {
    \n+
    254 int coordPeriodic = _inside.transformingsubiterator().coord(i);
    \n+
    255 if (coordPeriodic < 0) {
    \n+
    256 auto size = _inside.gridlevel()->mg->domainSize()[i];
    \n+
    257 ll[i] += size;
    \n+
    258 ur[i] += size;
    \n+
    259 } else if (coordPeriodic + 1 > _inside.gridlevel()->mg->levelSize(_inside.gridlevel()->level(),i)) {
    \n+
    260 auto size = _inside.gridlevel()->mg->domainSize()[i];
    \n+
    261 ll[i] -= size;
    \n+
    262 ur[i] -= size;
    \n+
    263 }
    \n+
    264 }
    \n+
    265 }
    \n+
    266
    \n+
    267 GeometryImpl _is_global(ll,ur,shift);
    \n+
    268 return Geometry( _is_global );
    \n+
    269 }
    \n+
    \n+
    270
    \n+
    \n+
    272 GeometryType type () const
    \n+
    273 {
    \n+
    274 return GeometryTypes::cube(dim-1);
    \n+
    275 }
    \n+
    \n+
    276
    \n+
    \n+
    278 int indexInInside () const
    \n+
    279 {
    \n+
    280 return _count;
    \n+
    281 }
    \n+
    \n+
    282
    \n+
    \n+
    284 int indexInOutside () const
    \n+
    285 {
    \n+
    286 // flip the last bit
    \n+
    287 return _count^1;
    \n+
    288 }
    \n+
    \n+
    289
    \n+
    \n+\n+
    291 : _count(~std::uint8_t(0)) // Use as marker for invalid intersection
    \n+
    292 , _dir(0)
    \n+
    293 , _face(0)
    \n+
    294 {}
    \n+
    \n
    295
    \n-
    296#ifdef RUN_HOOKS_6
    \n-
    297 #undef RUN_HOOKS_6
    \n-
    298#endif // RUN_HOOKS_6
    \n-
    299
    \n-
    300#ifdef RUN_HOOKS_7
    \n-
    301 #undef RUN_HOOKS_7
    \n-
    302#endif // RUN_HOOKS_7
    \n-
    303
    \n-
    304#ifdef CALL_EVERY_EL_PREORDER
    \n-
    305 #undef CALL_EVERY_EL_PREORDER
    \n-
    306#endif // CALL_EVERY_EL_PREORDER
    \n-
    307
    \n-
    308#ifdef CALL_EVERY_EL_INORDER
    \n-
    309 #undef CALL_EVERY_EL_INORDER
    \n-
    310#endif // CALL_EVERY_EL_INORDER
    \n-
    311
    \n-
    312#ifdef CALL_EVERY_EL_POSTORDER
    \n-
    313 #undef CALL_EVERY_EL_POSTORDER
    \n-
    314#endif // CALL_EVERY_EL_POSTORDER
    \n-
    315
    \n-
    316#ifdef CALL_LEAF_EL
    \n-
    317 #undef CALL_LEAF_EL
    \n-
    318#endif // CALL_LEAF_EL
    \n-
    319
    \n-
    320#ifdef CALL_LEAF_EL_LEVEL
    \n-
    321 #undef CALL_LEAF_EL_LEVEL
    \n-
    322#endif // CALL_LEAF_EL_LEVEL
    \n-
    323
    \n-
    324#ifdef CALL_EL_LEVEL
    \n-
    325 #undef CALL_EL_LEVEL
    \n-
    326#endif // CALL_EL_LEVEL
    \n-
    327
    \n-
    328#ifdef CALL_MG_LEVEL
    \n-
    329 #undef CALL_MG_LEVEL
    \n-
    330#endif // CALL_MG_LEVEL
    \n-
    331
    \n-
    332#ifdef TEST_FLAG
    \n-
    333 #undef TEST_FLAG
    \n-
    334#endif // TEST_FLAG
    \n-
    335
    \n-
    336#ifdef DOF_ADMIN_DEF
    \n-
    337 #undef DOF_ADMIN_DEF
    \n-
    338#endif // DOF_ADMIN_DEF
    \n-
    339
    \n-
    340#ifdef DOF_FREE_SIZE
    \n-
    341 #undef DOF_FREE_SIZE
    \n-
    342#endif // DOF_FREE_SIZE
    \n+
    \n+
    297 YaspIntersection (const YaspEntity<0,dim,GridImp>& myself, bool toend) :
    \n+
    298 _inside(myself.gridlevel(),
    \n+
    299 myself.transformingsubiterator()),
    \n+
    300 _outside(myself.gridlevel(),
    \n+
    301 myself.transformingsubiterator()),
    \n+
    302 // initialize to first neighbor
    \n+
    303 _count(0),
    \n+
    304 _dir(0),
    \n+
    305 _face(0)
    \n+
    306 {
    \n+
    307 if (toend)
    \n+
    308 {
    \n+
    309 // initialize end iterator
    \n+
    310 _count = 2*dim;
    \n+
    311 return;
    \n+
    312 }
    \n+
    313 _count = 0;
    \n+
    314
    \n+
    315 // move transforming iterator
    \n+
    316 _outside.transformingsubiterator().move(_dir,-1);
    \n+
    317 }
    \n+
    \n+
    318
    \n+
    320
    \n+
    \n+
    322 void assign (const YaspIntersection& it)
    \n+
    323 {
    \n+
    324 *this = it;
    \n+
    325 }
    \n+
    \n+
    326
    \n+
    \n+
    327 bool equals(const YaspIntersection& other) const
    \n+
    328 {
    \n+
    329 // compare counts first -- that's cheaper if the test fails
    \n+
    330 return _count == other._count && _inside.equals(other._inside);
    \n+
    331 }
    \n+
    \n+
    332
    \n+
    333 private:
    \n+
    334 /* The two entities that make up the intersection */
    \n+\n+\n+
    337 /* current position */
    \n+
    338 std::uint8_t _count;
    \n+
    339 std::uint8_t _dir;
    \n+
    340 std::uint8_t _face;
    \n+
    341 };
    \n+
    \n+
    342} // namespace Dune
    \n
    343
    \n-
    344#ifdef DOF_UNIT_ALL_FREE
    \n-
    345 #undef DOF_UNIT_ALL_FREE
    \n-
    346#endif // DOF_UNIT_ALL_FREE
    \n-
    347
    \n-
    348#ifdef FOR_ALL_DOFS
    \n-
    349 #undef FOR_ALL_DOFS
    \n-
    350#endif // FOR_ALL_DOFS
    \n-
    351
    \n-
    352#ifdef FOR_ALL_FREE_DOFS
    \n-
    353 #undef FOR_ALL_FREE_DOFS
    \n-
    354#endif // FOR_ALL_FREE_DOFS
    \n-
    355
    \n-
    356#ifdef DOWBM_FULL
    \n-
    357 #undef DOWBM_FULL
    \n-
    358#endif // DOWBM_FULL
    \n-
    359
    \n-
    360#ifdef DOWBM_SYMM
    \n-
    361 #undef DOWBM_SYMM
    \n-
    362#endif // DOWBM_SYMM
    \n-
    363
    \n-
    364#ifdef DOWBM_DIAG
    \n-
    365 #undef DOWBM_DIAG
    \n-
    366#endif // DOWBM_DIAG
    \n-
    367
    \n-
    368#ifdef ROW_LENGTH
    \n-
    369 #undef ROW_LENGTH
    \n-
    370#endif // ROW_LENGTH
    \n-
    371
    \n-
    372#ifdef ENTRY_USED
    \n-
    373 #undef ENTRY_USED
    \n-
    374#endif // ENTRY_USED
    \n-
    375
    \n-
    376#ifdef ENTRY_NOT_USED
    \n-
    377 #undef ENTRY_NOT_USED
    \n-
    378#endif // ENTRY_NOT_USED
    \n-
    379
    \n-
    380#ifdef UNUSED_ENTRY
    \n-
    381 #undef UNUSED_ENTRY
    \n-
    382#endif // UNUSED_ENTRY
    \n-
    383
    \n-
    384#ifdef NO_MORE_ENTRIES
    \n-
    385 #undef NO_MORE_ENTRIES
    \n-
    386#endif // NO_MORE_ENTRIES
    \n-
    387
    \n-
    388#ifdef LAGRANGE_NODES
    \n-
    389 #undef LAGRANGE_NODES
    \n-
    390#endif // LAGRANGE_NODES
    \n-
    391
    \n-
    392#ifdef MAX_N_QUAD_POINTS
    \n-
    393 #undef MAX_N_QUAD_POINTS
    \n-
    394#endif // MAX_N_QUAD_POINTS
    \n-
    395
    \n-
    396#ifdef INIT_PHI
    \n-
    397 #undef INIT_PHI
    \n-
    398#endif // INIT_PHI
    \n-
    399
    \n-
    400#ifdef INIT_GRD_PHI
    \n-
    401 #undef INIT_GRD_PHI
    \n-
    402#endif // INIT_GRD_PHI
    \n-
    403
    \n-
    404#ifdef INIT_D2_PHI
    \n-
    405 #undef INIT_D2_PHI
    \n-
    406#endif // INIT_D2_PHI
    \n-
    407
    \n-
    408#ifdef MESH_REFINED
    \n-
    409 #undef MESH_REFINED
    \n-
    410#endif // MESH_REFINED
    \n-
    411
    \n-
    412#ifdef MESH_COARSENED
    \n-
    413 #undef MESH_COARSENED
    \n-
    414#endif // MESH_COARSENED
    \n-
    415
    \n-
    416#ifdef H1_NORM
    \n-
    417 #undef H1_NORM
    \n-
    418#endif // H1_NORM
    \n-
    419
    \n-
    420#ifdef L2_NORM
    \n-
    421 #undef L2_NORM
    \n-
    422#endif // L2_NORM
    \n-
    423
    \n-
    424#ifdef GRAPH_MESH_BOUNDARY
    \n-
    425 #undef GRAPH_MESH_BOUNDARY
    \n-
    426#endif // GRAPH_MESH_BOUNDARY
    \n-
    427
    \n-
    428#ifdef GRAPH_MESH_ELEMENT_MARK
    \n-
    429 #undef GRAPH_MESH_ELEMENT_MARK
    \n-
    430#endif // GRAPH_MESH_ELEMENT_MARK
    \n-
    431
    \n-
    432#ifdef GRAPH_MESH_VERTEX_DOF
    \n-
    433 #undef GRAPH_MESH_VERTEX_DOF
    \n-
    434#endif // GRAPH_MESH_VERTEX_DOF
    \n-
    435
    \n-
    436#ifdef GRAPH_MESH_ELEMENT_INDEX
    \n-
    437 #undef GRAPH_MESH_ELEMENT_INDEX
    \n-
    438#endif // GRAPH_MESH_ELEMENT_INDEX
    \n-
    439
    \n-
    440#ifdef GET_MESH
    \n-
    441 #undef GET_MESH
    \n-
    442#endif // GET_MESH
    \n-
    443
    \n-
    444#ifdef GET_DOF_VEC
    \n-
    445 #undef GET_DOF_VEC
    \n-
    446#endif // GET_DOF_VEC
    \n-
    447
    \n-
    448#ifdef CARD_SN_MAX
    \n-
    449 #undef CARD_SN_MAX
    \n-
    450#endif // CARD_SN_MAX
    \n-
    451
    \n-
    452#ifdef INIT_UH
    \n-
    453 #undef INIT_UH
    \n-
    454#endif // INIT_UH
    \n-
    455
    \n-
    456#ifdef INIT_GRD_UH
    \n-
    457 #undef INIT_GRD_UH
    \n-
    458#endif // INIT_GRD_UH
    \n-
    459
    \n-
    460#ifdef TRAVERSE_START
    \n-
    461 #undef TRAVERSE_START
    \n-
    462#endif // TRAVERSE_START
    \n-
    463
    \n-
    464#ifdef TRAVERSE_STOP
    \n-
    465 #undef TRAVERSE_STOP
    \n-
    466#endif // TRAVERSE_STOP
    \n+
    344#endif // DUNE_GRID_YASPGRIDINTERSECTION_HH
    \n+
    STL namespace.
    \n+
    Include standard header files.
    Definition agrid.hh:60
    \n+
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n+
    Definition yaspgridentity.hh:242
    \n+
    int level() const
    level of this element
    Definition yaspgridentity.hh:256
    \n+
    const YGLI & gridlevel() const
    Definition yaspgridentity.hh:394
    \n+
    const I & transformingsubiterator() const
    Definition yaspgridentity.hh:393
    \n+
    bool equals(const YaspEntity &e) const
    Return true when two iterators over the same grid are equal (!).
    Definition yaspgridentity.hh:321
    \n+
    YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
    Definition yaspgridintersectioniterator.hh:22
    \n+
    YaspIntersection provides data about intersection with neighboring codim 0 entities.
    Definition yaspgridintersection.hh:22
    \n+
    FieldVector< ctype, dimworld > centerUnitOuterNormal() const
    return unit outer normal at center of intersection geometry
    Definition yaspgridintersection.hh:177
    \n+
    bool equals(const YaspIntersection &other) const
    Definition yaspgridintersection.hh:327
    \n+
    Entity inside() const
    Definition yaspgridintersection.hh:92
    \n+
    Geometry geometry() const
    Definition yaspgridintersection.hh:232
    \n+
    GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
    Definition yaspgridintersection.hh:38
    \n+
    YaspIntersection()
    Definition yaspgridintersection.hh:290
    \n+
    int indexInOutside() const
    local index of codim 1 entity in neighbor where intersection is contained in
    Definition yaspgridintersection.hh:284
    \n+
    LocalGeometry geometryInInside() const
    Definition yaspgridintersection.hh:195
    \n+
    int boundarySegmentIndex() const
    Definition yaspgridintersection.hh:105
    \n+
    GridImp::template Codim< 1 >::Geometry Geometry
    Definition yaspgridintersection.hh:37
    \n+
    bool conforming() const
    Yasp is always conform.
    Definition yaspgridintersection.hh:85
    \n+
    GridImp::template Codim< 0 >::Entity Entity
    Definition yaspgridintersection.hh:36
    \n+
    bool neighbor() const
    return true if neighbor across intersection exists in this processor
    Definition yaspgridintersection.hh:75
    \n+
    FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &) const
    return unit outer normal, this should be dependent on local coordinates for higher order boundary
    Definition yaspgridintersection.hh:165
    \n+
    YaspIntersection(const YaspEntity< 0, dim, GridImp > &myself, bool toend)
    make intersection iterator from entity, initialize to first neighbor
    Definition yaspgridintersection.hh:297
    \n+
    GeometryType type() const
    obtain the type of reference element for this intersection
    Definition yaspgridintersection.hh:272
    \n+
    void assign(const YaspIntersection &it)
    copy constructor \u2013 use default
    Definition yaspgridintersection.hh:322
    \n+
    int indexInInside() const
    local index of codim 1 entity in self where intersection is contained in
    Definition yaspgridintersection.hh:278
    \n+
    FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
    Definition yaspgridintersection.hh:187
    \n+
    GridImp::YGrid::Iterator I
    Definition yaspgridintersection.hh:35
    \n+
    LocalGeometry geometryInOutside() const
    Definition yaspgridintersection.hh:214
    \n+
    GridImp::YGridLevelIterator YGLI
    Definition yaspgridintersection.hh:34
    \n+
    Entity outside() const
    return Entity on the outside of this intersection
    Definition yaspgridintersection.hh:98
    \n+
    bool boundary() const
    Definition yaspgridintersection.hh:62
    \n+
    FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &) const
    return unit outer normal, this should be dependent on local coordinates for higher order boundary
    Definition yaspgridintersection.hh:171
    \n+
    void update()
    Definition yaspgridintersection.hh:40
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,471 +1,453 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-undefine-2.0.hh\n+ * yaspgrid\n+yaspgridintersection.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-12#ifdef _ALBERTA_H_\n-13 #undef _ALBERTA_H_\n-14#endif // _ALBERTA_H_\n-15\n-16#ifdef ALBERTA_VERSION\n-17 #undef ALBERTA_VERSION\n-18#endif // ALBERTA_VERSION\n-19\n-20#ifdef ALBERTA_DEBUG\n-21 #undef ALBERTA_DEBUG\n-22#endif // ALBERTA_DEBUG\n-23\n-24#ifdef DIM_MAX\n-25 #undef DIM_MAX\n-26#endif // DIM_MAX\n-27\n-28#ifdef N_VERTICES\n-29 #undef N_VERTICES\n-30#endif // N_VERTICES\n+5#ifndef DUNE_GRID_YASPGRIDINTERSECTION_HH\n+6#define DUNE_GRID_YASPGRIDINTERSECTION_HH\n+7\n+15namespace Dune {\n+16\n+20 template\n+21 class YaspIntersection\n+22 {\n+23 constexpr static int dim = GridImp::dimension;\n+24 constexpr static int dimworld = GridImp::dimensionworld;\n+25 typedef typename GridImp::ctype ctype;\n+26\n+27 typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl\n+GeometryImpl;\n+28 typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl\n+LocalGeometryImpl;\n+29\n+30 friend class YaspIntersectionIterator;\n 31\n-32#ifdef N_EDGES\n-33 #undef N_EDGES\n-34#endif // N_EDGES\n-35\n-36#ifdef N_WALLS\n-37 #undef N_WALLS\n-38#endif // N_WALLS\n+32 public:\n+33 // types used from grids\n+34 typedef typename GridImp::YGridLevelIterator YGLI;\n+35 typedef typename GridImp::YGrid::Iterator I;\n+36 typedef typename GridImp::template Codim<0>::Entity Entity;\n+37 typedef typename GridImp::template Codim<1>::Geometry Geometry;\n+38 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;\n 39\n-40#ifdef N_FACES\n-41 #undef N_FACES\n-42#endif // N_FACES\n-43\n-44#ifdef N_NEIGH\n-45 #undef N_NEIGH\n-46#endif // N_NEIGH\n+40 void update() {\n+41\n+42 // vector with per-direction movements\n+43 std::array dist{{0}};\n+44\n+45 // first move: back to center\n+46 dist[_dir] = 1 - 2*_face;\n 47\n-48#ifdef DIM_FAC\n-49 #undef DIM_FAC\n-50#endif // DIM_FAC\n+48 // update face info\n+49 _dir = _count / 2;\n+50 _face = _count % 2;\n 51\n-52#ifdef N_VERTICES_0D\n-53 #undef N_VERTICES_0D\n-54#endif // N_VERTICES_0D\n-55\n-56#ifdef N_EDGES_0D\n-57 #undef N_EDGES_0D\n-58#endif // N_EDGES_0D\n-59\n-60#ifdef N_FACES_0D\n-61 #undef N_FACES_0D\n-62#endif // N_FACES_0D\n-63\n-64#ifdef N_NEIGH_0D\n-65 #undef N_NEIGH_0D\n-66#endif // N_NEIGH_0D\n-67\n-68#ifdef N_WALLS_0D\n-69 #undef N_WALLS_0D\n-70#endif // N_WALLS_0D\n-71\n-72#ifdef N_VERTICES_1D\n-73 #undef N_VERTICES_1D\n-74#endif // N_VERTICES_1D\n-75\n-76#ifdef N_EDGES_1D\n-77 #undef N_EDGES_1D\n-78#endif // N_EDGES_1D\n-79\n-80#ifdef N_FACES_1D\n-81 #undef N_FACES_1D\n-82#endif // N_FACES_1D\n+52 // second move: to new neighbor\n+53 dist[_dir] += -1 + 2*_face;\n+54\n+55 // move transforming iterator\n+56 _outside.transformingsubiterator().move(dist);\n+57 }\n+58\n+62 bool boundary () const\n+63 {\n+64 // Coordinate of intersection in its direction\n+65 int coord = _inside.transformingsubiterator().coord(_dir) + _face;\n+66 if (_inside.gridlevel()->mg->isPeriodic(_dir))\n+67 return false;\n+68 else\n+69 return coord == 0\n+70 ||\n+71 coord == _inside.gridlevel()->mg->levelSize(_inside.gridlevel()->level(),_\n+dir);\n+72 }\n+73\n+75 bool neighbor () const\n+76 {\n+77 // Coordinate of intersection in its direction\n+78 int coord = _inside.transformingsubiterator().coord(_dir) + _face;\n+79 return coord > _inside.gridlevel()->overlap[0].dataBegin()->min(_dir)\n+80 &&\n+81 coord <= _inside.gridlevel()->overlap[0].dataBegin()->max(_dir);\n+82 }\n 83\n-84#ifdef N_NEIGH_1D\n-85 #undef N_NEIGH_1D\n-86#endif // N_NEIGH_1D\n-87\n-88#ifdef N_WALLS_1D\n-89 #undef N_WALLS_1D\n-90#endif // N_WALLS_1D\n-91\n-92#ifdef N_VERTICES_2D\n-93 #undef N_VERTICES_2D\n-94#endif // N_VERTICES_2D\n-95\n-96#ifdef N_EDGES_2D\n-97 #undef N_EDGES_2D\n-98#endif // N_EDGES_2D\n-99\n-100#ifdef N_FACES_2D\n-101 #undef N_FACES_2D\n-102#endif // N_FACES_2D\n-103\n-104#ifdef N_NEIGH_2D\n-105 #undef N_NEIGH_2D\n-106#endif // N_NEIGH_2D\n-107\n-108#ifdef N_WALLS_2D\n-109 #undef N_WALLS_2D\n-110#endif // N_WALLS_2D\n-111\n-112#ifdef N_VERTICES_3D\n-113 #undef N_VERTICES_3D\n-114#endif // N_VERTICES_3D\n-115\n-116#ifdef N_EDGES_3D\n-117 #undef N_EDGES_3D\n-118#endif // N_EDGES_3D\n-119\n-120#ifdef N_FACES_3D\n-121 #undef N_FACES_3D\n-122#endif // N_FACES_3D\n+85 bool conforming () const\n+86 {\n+87 return true;\n+88 }\n+89\n+92 Entity inside() const\n+93 {\n+94 return Entity(_inside);\n+95 }\n+96\n+98 Entity outside() const\n+99 {\n+100 return Entity(_outside);\n+101 }\n+102\n+105 int boundarySegmentIndex() const\n+106 {\n+107 if(! boundary())\n+108 DUNE_THROW(GridError, \"called boundarySegmentIndex while boundary() ==\n+false\");\n+109 // size of local macro grid\n+110 const std::array & size = _inside.gridlevel()->mg->begin()-\n+>overlap[0].dataBegin()->size();\n+111 const std::array & origin = _inside.gridlevel()->mg->begin()-\n+>overlap[0].dataBegin()->origin();\n+112 std::array sides;\n+113 {\n+114 for (int i=0; img->begin()->overlap[0].dataBegin()->origin(i)\n+118 == 0)+\n+119 (_inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->origin(i) +\n+120 _inside.gridlevel()->mg->begin()->overlap[0].dataBegin()->size(i)\n+121 ==\n+122 _inside.gridlevel()->mg->levelSize(0,i)));\n 123\n-124#ifdef N_NEIGH_3D\n-125 #undef N_NEIGH_3D\n-126#endif // N_NEIGH_3D\n-127\n-128#ifdef N_WALLS_3D\n-129 #undef N_WALLS_3D\n-130#endif // N_WALLS_3D\n-131\n-132#ifdef N_VERTICES_MAX\n-133 #undef N_VERTICES_MAX\n-134#endif // N_VERTICES_MAX\n-135\n-136#ifdef N_EDGES_MAX\n-137 #undef N_EDGES_MAX\n-138#endif // N_EDGES_MAX\n-139\n-140#ifdef N_FACES_MAX\n-141 #undef N_FACES_MAX\n-142#endif // N_FACES_MAX\n-143\n-144#ifdef N_NEIGH_MAX\n-145 #undef N_NEIGH_MAX\n-146#endif // N_NEIGH_MAX\n-147\n-148#ifdef N_WALLS_MAX\n-149 #undef N_WALLS_MAX\n-150#endif // N_WALLS_MAX\n-151\n-152#ifdef N_LAMBDA\n-153 #undef N_LAMBDA\n-154#endif // N_LAMBDA\n-155\n-156#ifdef LAMBDA_MAX\n-157 #undef LAMBDA_MAX\n-158#endif // LAMBDA_MAX\n-159\n-160#ifdef INDEX\n-161 #undef INDEX\n-162#endif // INDEX\n+124 }\n+125 }\n+126 // global position of the cell on macro grid\n+127 std::array pos = _inside.transformingsubiterator().coord();\n+128 for(int i=0; i fsize;\n+135 {\n+136 int vol = 1;\n+137 for (int k=0; k=0; k--)\n+147 {\n+148 if (k == _dir) continue;\n+149 index += (pos[k]) * localoffset;\n+150 localoffset *= size[k];\n+151 }\n+152 }\n+153 // add unit-cube-face-offsets\n+154 {\n+155 for (int k=0; k<_dir; k++)\n+156 index += sides[k] * fsize[k];\n+157 // add fsize if we are on the right face and there is a left-face-boundary\n+on this processor\n+158 index += _face * (sides[_dir]>1) * fsize[_dir];\n+159 }\n+160\n+161 return index;\n+162 }\n 163\n-164#ifdef INDEX\n-165 #undef INDEX\n-166#endif // INDEX\n-167\n-168#ifdef IS_LEAF_EL\n-169 #undef IS_LEAF_EL\n-170#endif // IS_LEAF_EL\n-171\n-172#ifdef LEAF_DATA\n-173 #undef LEAF_DATA\n-174#endif // LEAF_DATA\n+165 FieldVector outerNormal (const FieldVector&\n+/* local */) const\n+166 {\n+167 return centerUnitOuterNormal();\n+168 }\n+169\n+171 FieldVector unitOuterNormal (const FieldVector& /* local */) const\n+172 {\n+173 return centerUnitOuterNormal();\n+174 }\n 175\n-176#ifdef INTERIOR\n-177 #undef INTERIOR\n-178#endif // INTERIOR\n-179\n-180#ifdef DIRICHLET\n-181 #undef DIRICHLET\n-182#endif // DIRICHLET\n+177 FieldVector centerUnitOuterNormal () const\n+178 {\n+179 FieldVector normal(0);\n+180 normal[_dir] = (_face==0) ? -1.0 : 1.0;\n+181 return normal;\n+182 }\n 183\n-184#ifdef NEUMANN\n-185 #undef NEUMANN\n-186#endif // NEUMANN\n-187\n-188#ifdef IS_NEUMANN\n-189 #undef IS_NEUMANN\n-190#endif // IS_NEUMANN\n+187 FieldVector integrationOuterNormal ([[maybe_unused]] const\n+FieldVector& local) const\n+188 {\n+189 return geometry().volume() * centerUnitOuterNormal();\n+190 }\n 191\n-192#ifdef IS_DIRICHLET\n-193 #undef IS_DIRICHLET\n-194#endif // IS_DIRICHLET\n-195\n-196#ifdef IS_INTERIOR\n-197 #undef IS_INTERIOR\n-198#endif // IS_INTERIOR\n-199\n-200#ifdef N_NODE_TYPES\n-201 #undef N_NODE_TYPES\n-202#endif // N_NODE_TYPES\n-203\n-204#ifdef VERTEX\n-205 #undef VERTEX\n-206#endif // VERTEX\n+195 LocalGeometry geometryInInside () const\n+196 {\n+197 // set of dimensions that span the intersection\n+198 std::bitset s;\n+199 s.set();\n+200 s[_dir] = false;\n+201\n+202 // lower-left and upper-right corners\n+203 Dune::FieldVector ll(0.0);\n+204 Dune::FieldVector ur(1.0);\n+205\n+206 ll[_dir] = ur[_dir] = (_face==0) ? 0.0 : 1.0;\n 207\n-208#ifdef CENTER\n-209 #undef CENTER\n-210#endif // CENTER\n-211\n-212#ifdef EDGE\n-213 #undef EDGE\n-214#endif // EDGE\n-215\n-216#ifdef FACE\n-217 #undef FACE\n-218#endif // FACE\n-219\n-220#ifdef LIST_ENTRY\n-221 #undef LIST_ENTRY\n-222#endif // LIST_ENTRY\n-223\n-224#ifdef WALL_BOUND\n-225 #undef WALL_BOUND\n-226#endif // WALL_BOUND\n-227\n-228#ifdef FILL_NOTHING\n-229 #undef FILL_NOTHING\n-230#endif // FILL_NOTHING\n-231\n-232#ifdef FILL_COORDS\n-233 #undef FILL_COORDS\n-234#endif // FILL_COORDS\n-235\n-236#ifdef FILL_BOUND\n-237 #undef FILL_BOUND\n-238#endif // FILL_BOUND\n-239\n-240#ifdef FILL_NEIGH\n-241 #undef FILL_NEIGH\n-242#endif // FILL_NEIGH\n+208 return LocalGeometry(LocalGeometryImpl(ll,ur,s));\n+209 }\n+210\n+214 LocalGeometry geometryInOutside () const\n+215 {\n+216 // set of dimensions that span the intersection\n+217 std::bitset s;\n+218 s.set();\n+219 s[_dir] = false;\n+220\n+221 // lower-left and upper-right corners\n+222 Dune::FieldVector ll(0.0);\n+223 Dune::FieldVector ur(1.0);\n+224\n+225 ll[_dir] = ur[_dir] = (_face==1) ? 0.0 : 1.0;\n+226\n+227 return LocalGeometry(LocalGeometryImpl(ll,ur,s));\n+228 }\n+229\n+232 Geometry geometry () const\n+233 {\n+234\n+235 std::bitset shift;\n+236 shift.set();\n+237 shift[_dir] = false;\n+238\n+239 Dune::FieldVector ll, ur;\n+240 for (int i=0; icoordinate(i,coord);\n+248 if (i != _dir)\n+249 coord++;\n+250 ur[i] = _inside.transformingsubiterator().coordCont()->coordinate(i,coord);\n 251\n-252#ifdef FILL_EL_TYPE\n-253 #undef FILL_EL_TYPE\n-254#endif // FILL_EL_TYPE\n-255\n-256#ifdef FILL_PROJECTION\n-257 #undef FILL_PROJECTION\n-258#endif // FILL_PROJECTION\n-259\n-260#ifdef FILL_ANY\n-261 #undef FILL_ANY\n-262#endif // FILL_ANY\n-263\n-264#ifdef HOOK_QUEUE_OFFSET\n-265 #undef HOOK_QUEUE_OFFSET\n-266#endif // HOOK_QUEUE_OFFSET\n-267\n-268#ifdef RUN_HOOKS_0\n-269 #undef RUN_HOOKS_0\n-270#endif // RUN_HOOKS_0\n-271\n-272#ifdef RUN_BAS_FCTS_HOOKS\n-273 #undef RUN_BAS_FCTS_HOOKS\n-274#endif // RUN_BAS_FCTS_HOOKS\n-275\n-276#ifdef RUN_HOOKS_1\n-277 #undef RUN_HOOKS_1\n-278#endif // RUN_HOOKS_1\n-279\n-280#ifdef RUN_HOOKS_2\n-281 #undef RUN_HOOKS_2\n-282#endif // RUN_HOOKS_2\n-283\n-284#ifdef RUN_HOOKS_3\n-285 #undef RUN_HOOKS_3\n-286#endif // RUN_HOOKS_3\n-287\n-288#ifdef RUN_HOOKS_4\n-289 #undef RUN_HOOKS_4\n-290#endif // RUN_HOOKS_4\n-291\n-292#ifdef RUN_HOOKS_5\n-293 #undef RUN_HOOKS_5\n-294#endif // RUN_HOOKS_5\n+252 // If on periodic overlap, transform coordinates by domain size\n+253 if (_inside.gridlevel()->mg->isPeriodic(i)) {\n+254 int coordPeriodic = _inside.transformingsubiterator().coord(i);\n+255 if (coordPeriodic < 0) {\n+256 auto size = _inside.gridlevel()->mg->domainSize()[i];\n+257 ll[i] += size;\n+258 ur[i] += size;\n+259 } else if (coordPeriodic + 1 > _inside.gridlevel()->mg->levelSize(_\n+inside.gridlevel()->level(),i)) {\n+260 auto size = _inside.gridlevel()->mg->domainSize()[i];\n+261 ll[i] -= size;\n+262 ur[i] -= size;\n+263 }\n+264 }\n+265 }\n+266\n+267 GeometryImpl _is_global(ll,ur,shift);\n+268 return Geometry( _is_global );\n+269 }\n+270\n+272 GeometryType type () const\n+273 {\n+274 return GeometryTypes::cube(dim-1);\n+275 }\n+276\n+278 int indexInInside () const\n+279 {\n+280 return _count;\n+281 }\n+282\n+284 int indexInOutside () const\n+285 {\n+286 // flip the last bit\n+287 return _count^1;\n+288 }\n+289\n+290 YaspIntersection()\n+291 : _count(~std::uint8_t(0)) // Use as marker for invalid intersection\n+292 , _dir(0)\n+293 , _face(0)\n+294 {}\n 295\n-296#ifdef RUN_HOOKS_6\n-297 #undef RUN_HOOKS_6\n-298#endif // RUN_HOOKS_6\n-299\n-300#ifdef RUN_HOOKS_7\n-301 #undef RUN_HOOKS_7\n-302#endif // RUN_HOOKS_7\n-303\n-304#ifdef CALL_EVERY_EL_PREORDER\n-305 #undef CALL_EVERY_EL_PREORDER\n-306#endif // CALL_EVERY_EL_PREORDER\n-307\n-308#ifdef CALL_EVERY_EL_INORDER\n-309 #undef CALL_EVERY_EL_INORDER\n-310#endif // CALL_EVERY_EL_INORDER\n-311\n-312#ifdef CALL_EVERY_EL_POSTORDER\n-313 #undef CALL_EVERY_EL_POSTORDER\n-314#endif // CALL_EVERY_EL_POSTORDER\n-315\n-316#ifdef CALL_LEAF_EL\n-317 #undef CALL_LEAF_EL\n-318#endif // CALL_LEAF_EL\n-319\n-320#ifdef CALL_LEAF_EL_LEVEL\n-321 #undef CALL_LEAF_EL_LEVEL\n-322#endif // CALL_LEAF_EL_LEVEL\n-323\n-324#ifdef CALL_EL_LEVEL\n-325 #undef CALL_EL_LEVEL\n-326#endif // CALL_EL_LEVEL\n-327\n-328#ifdef CALL_MG_LEVEL\n-329 #undef CALL_MG_LEVEL\n-330#endif // CALL_MG_LEVEL\n-331\n-332#ifdef TEST_FLAG\n-333 #undef TEST_FLAG\n-334#endif // TEST_FLAG\n-335\n-336#ifdef DOF_ADMIN_DEF\n-337 #undef DOF_ADMIN_DEF\n-338#endif // DOF_ADMIN_DEF\n-339\n-340#ifdef DOF_FREE_SIZE\n-341 #undef DOF_FREE_SIZE\n-342#endif // DOF_FREE_SIZE\n+297 YaspIntersection (const YaspEntity<0,dim,GridImp>& myself, bool toend) :\n+298 _inside(myself.gridlevel(),\n+299 myself.transformingsubiterator()),\n+300 _outside(myself.gridlevel(),\n+301 myself.transformingsubiterator()),\n+302 // initialize to first neighbor\n+303 _count(0),\n+304 _dir(0),\n+305 _face(0)\n+306 {\n+307 if (toend)\n+308 {\n+309 // initialize end iterator\n+310 _count = 2*dim;\n+311 return;\n+312 }\n+313 _count = 0;\n+314\n+315 // move transforming iterator\n+316 _outside.transformingsubiterator().move(_dir,-1);\n+317 }\n+318\n+320\n+322 void assign (const YaspIntersection& it)\n+323 {\n+324 *this = it;\n+325 }\n+326\n+327 bool equals(const YaspIntersection& other) const\n+328 {\n+329 // compare counts first -- that's cheaper if the test fails\n+330 return _count == other._count && _inside.equals(other._inside);\n+331 }\n+332\n+333 private:\n+334 /* The two entities that make up the intersection */\n+335 YaspEntity<0,GridImp::dimension,GridImp> _inside;\n+336 YaspEntity<0,GridImp::dimension,GridImp> _outside;\n+337 /* current position */\n+338 std::uint8_t _count;\n+339 std::uint8_t _dir;\n+340 std::uint8_t _face;\n+341 };\n+342} // namespace Dune\n 343\n-344#ifdef DOF_UNIT_ALL_FREE\n-345 #undef DOF_UNIT_ALL_FREE\n-346#endif // DOF_UNIT_ALL_FREE\n-347\n-348#ifdef FOR_ALL_DOFS\n-349 #undef FOR_ALL_DOFS\n-350#endif // FOR_ALL_DOFS\n-351\n-352#ifdef FOR_ALL_FREE_DOFS\n-353 #undef FOR_ALL_FREE_DOFS\n-354#endif // FOR_ALL_FREE_DOFS\n-355\n-356#ifdef DOWBM_FULL\n-357 #undef DOWBM_FULL\n-358#endif // DOWBM_FULL\n-359\n-360#ifdef DOWBM_SYMM\n-361 #undef DOWBM_SYMM\n-362#endif // DOWBM_SYMM\n-363\n-364#ifdef DOWBM_DIAG\n-365 #undef DOWBM_DIAG\n-366#endif // DOWBM_DIAG\n-367\n-368#ifdef ROW_LENGTH\n-369 #undef ROW_LENGTH\n-370#endif // ROW_LENGTH\n-371\n-372#ifdef ENTRY_USED\n-373 #undef ENTRY_USED\n-374#endif // ENTRY_USED\n-375\n-376#ifdef ENTRY_NOT_USED\n-377 #undef ENTRY_NOT_USED\n-378#endif // ENTRY_NOT_USED\n-379\n-380#ifdef UNUSED_ENTRY\n-381 #undef UNUSED_ENTRY\n-382#endif // UNUSED_ENTRY\n-383\n-384#ifdef NO_MORE_ENTRIES\n-385 #undef NO_MORE_ENTRIES\n-386#endif // NO_MORE_ENTRIES\n-387\n-388#ifdef LAGRANGE_NODES\n-389 #undef LAGRANGE_NODES\n-390#endif // LAGRANGE_NODES\n-391\n-392#ifdef MAX_N_QUAD_POINTS\n-393 #undef MAX_N_QUAD_POINTS\n-394#endif // MAX_N_QUAD_POINTS\n-395\n-396#ifdef INIT_PHI\n-397 #undef INIT_PHI\n-398#endif // INIT_PHI\n-399\n-400#ifdef INIT_GRD_PHI\n-401 #undef INIT_GRD_PHI\n-402#endif // INIT_GRD_PHI\n-403\n-404#ifdef INIT_D2_PHI\n-405 #undef INIT_D2_PHI\n-406#endif // INIT_D2_PHI\n-407\n-408#ifdef MESH_REFINED\n-409 #undef MESH_REFINED\n-410#endif // MESH_REFINED\n-411\n-412#ifdef MESH_COARSENED\n-413 #undef MESH_COARSENED\n-414#endif // MESH_COARSENED\n-415\n-416#ifdef H1_NORM\n-417 #undef H1_NORM\n-418#endif // H1_NORM\n-419\n-420#ifdef L2_NORM\n-421 #undef L2_NORM\n-422#endif // L2_NORM\n-423\n-424#ifdef GRAPH_MESH_BOUNDARY\n-425 #undef GRAPH_MESH_BOUNDARY\n-426#endif // GRAPH_MESH_BOUNDARY\n-427\n-428#ifdef GRAPH_MESH_ELEMENT_MARK\n-429 #undef GRAPH_MESH_ELEMENT_MARK\n-430#endif // GRAPH_MESH_ELEMENT_MARK\n-431\n-432#ifdef GRAPH_MESH_VERTEX_DOF\n-433 #undef GRAPH_MESH_VERTEX_DOF\n-434#endif // GRAPH_MESH_VERTEX_DOF\n-435\n-436#ifdef GRAPH_MESH_ELEMENT_INDEX\n-437 #undef GRAPH_MESH_ELEMENT_INDEX\n-438#endif // GRAPH_MESH_ELEMENT_INDEX\n-439\n-440#ifdef GET_MESH\n-441 #undef GET_MESH\n-442#endif // GET_MESH\n-443\n-444#ifdef GET_DOF_VEC\n-445 #undef GET_DOF_VEC\n-446#endif // GET_DOF_VEC\n-447\n-448#ifdef CARD_SN_MAX\n-449 #undef CARD_SN_MAX\n-450#endif // CARD_SN_MAX\n-451\n-452#ifdef INIT_UH\n-453 #undef INIT_UH\n-454#endif // INIT_UH\n-455\n-456#ifdef INIT_GRD_UH\n-457 #undef INIT_GRD_UH\n-458#endif // INIT_GRD_UH\n-459\n-460#ifdef TRAVERSE_START\n-461 #undef TRAVERSE_START\n-462#endif // TRAVERSE_START\n-463\n-464#ifdef TRAVERSE_STOP\n-465 #undef TRAVERSE_STOP\n-466#endif // TRAVERSE_STOP\n+344#endif // DUNE_GRID_YASPGRIDINTERSECTION_HH\n+std\n+STL namespace.\n+Dune\n+Include standard header files.\n+Definition agrid.hh:60\n+Dune::GridError\n+Base class for exceptions in Dune grid modules.\n+Definition exceptions.hh:20\n+Dune::YaspEntity\n+Definition yaspgridentity.hh:242\n+Dune::YaspEntity::level\n+int level() const\n+level of this element\n+Definition yaspgridentity.hh:256\n+Dune::YaspEntity::gridlevel\n+const YGLI & gridlevel() const\n+Definition yaspgridentity.hh:394\n+Dune::YaspEntity::transformingsubiterator\n+const I & transformingsubiterator() const\n+Definition yaspgridentity.hh:393\n+Dune::YaspEntity::equals\n+bool equals(const YaspEntity &e) const\n+Return true when two iterators over the same grid are equal (!).\n+Definition yaspgridentity.hh:321\n+Dune::YaspIntersectionIterator\n+YaspIntersectionIterator enables iteration over intersections with neighboring\n+codim 0 entities.\n+Definition yaspgridintersectioniterator.hh:22\n+Dune::YaspIntersection\n+YaspIntersection provides data about intersection with neighboring codim 0\n+entities.\n+Definition yaspgridintersection.hh:22\n+Dune::YaspIntersection::centerUnitOuterNormal\n+FieldVector< ctype, dimworld > centerUnitOuterNormal() const\n+return unit outer normal at center of intersection geometry\n+Definition yaspgridintersection.hh:177\n+Dune::YaspIntersection::equals\n+bool equals(const YaspIntersection &other) const\n+Definition yaspgridintersection.hh:327\n+Dune::YaspIntersection::inside\n+Entity inside() const\n+Definition yaspgridintersection.hh:92\n+Dune::YaspIntersection::geometry\n+Geometry geometry() const\n+Definition yaspgridintersection.hh:232\n+Dune::YaspIntersection::LocalGeometry\n+GridImp::template Codim< 1 >::LocalGeometry LocalGeometry\n+Definition yaspgridintersection.hh:38\n+Dune::YaspIntersection::YaspIntersection\n+YaspIntersection()\n+Definition yaspgridintersection.hh:290\n+Dune::YaspIntersection::indexInOutside\n+int indexInOutside() const\n+local index of codim 1 entity in neighbor where intersection is contained in\n+Definition yaspgridintersection.hh:284\n+Dune::YaspIntersection::geometryInInside\n+LocalGeometry geometryInInside() const\n+Definition yaspgridintersection.hh:195\n+Dune::YaspIntersection::boundarySegmentIndex\n+int boundarySegmentIndex() const\n+Definition yaspgridintersection.hh:105\n+Dune::YaspIntersection::Geometry\n+GridImp::template Codim< 1 >::Geometry Geometry\n+Definition yaspgridintersection.hh:37\n+Dune::YaspIntersection::conforming\n+bool conforming() const\n+Yasp is always conform.\n+Definition yaspgridintersection.hh:85\n+Dune::YaspIntersection::Entity\n+GridImp::template Codim< 0 >::Entity Entity\n+Definition yaspgridintersection.hh:36\n+Dune::YaspIntersection::neighbor\n+bool neighbor() const\n+return true if neighbor across intersection exists in this processor\n+Definition yaspgridintersection.hh:75\n+Dune::YaspIntersection::outerNormal\n+FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &)\n+const\n+return unit outer normal, this should be dependent on local coordinates for\n+higher order boundary\n+Definition yaspgridintersection.hh:165\n+Dune::YaspIntersection::YaspIntersection\n+YaspIntersection(const YaspEntity< 0, dim, GridImp > &myself, bool toend)\n+make intersection iterator from entity, initialize to first neighbor\n+Definition yaspgridintersection.hh:297\n+Dune::YaspIntersection::type\n+GeometryType type() const\n+obtain the type of reference element for this intersection\n+Definition yaspgridintersection.hh:272\n+Dune::YaspIntersection::assign\n+void assign(const YaspIntersection &it)\n+copy constructor \u00e2\u0080\u0093 use default\n+Definition yaspgridintersection.hh:322\n+Dune::YaspIntersection::indexInInside\n+int indexInInside() const\n+local index of codim 1 entity in self where intersection is contained in\n+Definition yaspgridintersection.hh:278\n+Dune::YaspIntersection::integrationOuterNormal\n+FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype,\n+dim-1 > &local) const\n+Definition yaspgridintersection.hh:187\n+Dune::YaspIntersection::I\n+GridImp::YGrid::Iterator I\n+Definition yaspgridintersection.hh:35\n+Dune::YaspIntersection::geometryInOutside\n+LocalGeometry geometryInOutside() const\n+Definition yaspgridintersection.hh:214\n+Dune::YaspIntersection::YGLI\n+GridImp::YGridLevelIterator YGLI\n+Definition yaspgridintersection.hh:34\n+Dune::YaspIntersection::outside\n+Entity outside() const\n+return Entity on the outside of this intersection\n+Definition yaspgridintersection.hh:98\n+Dune::YaspIntersection::boundary\n+bool boundary() const\n+Definition yaspgridintersection.hh:62\n+Dune::YaspIntersection::unitOuterNormal\n+FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-\n+1 > &) const\n+return unit outer normal, this should be dependent on local coordinates for\n+higher order boundary\n+Definition yaspgridintersection.hh:171\n+Dune::YaspIntersection::update\n+void update()\n+Definition yaspgridintersection.hh:40\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00719_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00866_source.html", "comments": ["Files 74% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: leveliterator.hh Source File\n+dune-grid: gridparameter.hh Source File\n \n \n \n \n \n \n \n@@ -70,149 +70,151 @@\n
    \n \n \n \n \n \n \n
    \n-
    leveliterator.hh
    \n+
    gridparameter.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_ALBERTA_LEVELITERATOR_HH
    \n-
    6#define DUNE_ALBERTA_LEVELITERATOR_HH
    \n+
    5#ifndef DUNE_DGF_GRIDPARAMETERBLOCK_HH
    \n+
    6#define DUNE_DGF_GRIDPARAMETERBLOCK_HH
    \n
    7
    \n-\n-
    9
    \n-\n-
    11
    \n-
    12#if HAVE_ALBERTA
    \n+
    8#include <iostream>
    \n+
    9#include <string>
    \n+
    10
    \n+\n+
    12
    \n
    13
    \n
    14namespace Dune
    \n
    15{
    \n
    16
    \n-
    17 // AlbertaGridLevelIterator
    \n-
    18 // ------------------------
    \n-
    19
    \n-
    20 template< int codim, PartitionIteratorType pitype, class GridImp >
    \n-
    \n-\n-
    22 : public AlbertaGridTreeIterator< codim, GridImp, false >
    \n-
    23 {
    \n-\n-\n-
    26
    \n-
    27 public:
    \n-
    28 typedef typename Base::Entity Entity;
    \n-\n-
    30
    \n-
    \n-\n-
    32 {}
    \n-
    \n-
    33
    \n-
    \n-
    35 AlbertaGridLevelIterator ( const GridImp &grid, int level )
    \n-
    36 : Base( grid, level )
    \n-
    37 {}
    \n-
    \n+
    17 namespace dgf
    \n+
    18 {
    \n+
    \n+\n+
    34 : public BasicBlock
    \n+
    35 {
    \n+
    36 public:
    \n+
    37 typedef unsigned int Flags;
    \n
    38
    \n-
    \n-\n-
    41 const MarkerVector *vec,
    \n-
    42 int level )
    \n-
    43 : Base( grid, vec, level )
    \n-
    44 {}
    \n-
    \n-
    45
    \n-
    \n-
    47 void increment ()
    \n-
    48 {
    \n-\n-
    50 }
    \n-
    \n-
    51 };
    \n-
    \n-
    52
    \n-
    53
    \n-
    54 template< int codim, class GridImp >
    \n-
    \n-\n-
    56 : public AlbertaGridTreeIterator< codim, GridImp, false >
    \n-
    57 {
    \n-\n-\n-
    60
    \n-
    61 public:
    \n-
    62 typedef typename Base::Entity Entity;
    \n-\n-
    64
    \n-
    \n-\n-
    66 {}
    \n-
    \n-
    67
    \n-
    \n-
    69 AlbertaGridLevelIterator ( const GridImp &grid, int level )
    \n-
    70 : Base( grid, level )
    \n-
    71 {}
    \n-
    \n-
    72
    \n-
    \n-\n-
    75 const MarkerVector *,
    \n-
    76 int level )
    \n-
    77 : Base( grid, level )
    \n-
    78 {}
    \n-
    \n-
    79
    \n-
    \n-
    81 void increment ()
    \n-
    82 {
    \n-\n-
    84 }
    \n-
    \n-
    85 };
    \n-
    \n-
    86}
    \n-
    87
    \n-
    88#endif // #if HAVE_ALBERTA
    \n-
    89
    \n-
    90#endif // #ifndef DUNE_ALBERTA_LEVELITERATOR_HH
    \n-\n-
    @ Ghost_Partition
    only ghost entities
    Definition gridenums.hh:142
    \n+
    39 static const Flags foundName = 1 << 0;
    \n+
    40 static const Flags foundDumpFileName = 1 << 1;
    \n+
    41 static const Flags foundLongestEdge = 1 << 5;
    \n+
    42 static const Flags foundCompatible = 1 << 13;
    \n+
    43
    \n+
    44 protected:
    \n+
    45 Flags foundFlags_; // supportFlags, this block was created with
    \n+
    46 std::string name_; // name of the grid
    \n+
    47 std::string dumpFileName_; // name of the grid
    \n+
    48 bool markLongestEdge_; // Mark longest edge for AlbertaGrid or ALUGrid
    \n+
    49 bool bisectionCompatibility_; // true if grid is compatible (bisection refinement works)
    \n+
    50
    \n+
    51 private:
    \n+
    52 // copy not implemented
    \n+\n+
    54
    \n+
    55 public:
    \n+
    57 GridParameterBlock ( std::istream &in );
    \n+
    58
    \n+
    \n+
    60 const std::string &name ( const std::string &defaultValue ) const
    \n+
    61 {
    \n+
    62 if( (foundFlags_ & foundName) == 0 )
    \n+
    63 {
    \n+
    64 dwarn << "GridParameterBlock: Parameter 'name' not specified, "
    \n+
    65 << "defaulting to '" << defaultValue << "'." << std::endl;
    \n+
    66 return defaultValue;
    \n+
    67 }
    \n+
    68 else
    \n+
    69 return name_;
    \n+
    70 }
    \n+
    \n+
    71
    \n+
    \n+
    72 const std::string &dumpFileName ( ) const
    \n+
    73 {
    \n+
    74 if( (foundFlags_ & foundDumpFileName) != 0 )
    \n+
    75 {
    \n+
    76 dwarn << "GridParameterBlock: found Parameter 'dumpfilename', "
    \n+
    77 << "dumping file to `" << dumpFileName_ << "'" << std::endl;
    \n+
    78 }
    \n+
    79 return dumpFileName_;
    \n+
    80 }
    \n+
    \n+
    81
    \n+
    \n+
    83 bool markLongestEdge () const
    \n+
    84 {
    \n+
    85 if( (foundFlags_ & foundLongestEdge) == 0 )
    \n+
    86 {
    \n+
    87 dwarn << "GridParameterBlock: Parameter 'refinementedge' not specified, "
    \n+
    88 << "defaulting to 'ARBITRARY'." << std::endl;
    \n+
    89 }
    \n+
    90 return markLongestEdge_;
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    \n+\n+
    95 {
    \n+
    96 if( (foundFlags_ & foundCompatible) == 0 )
    \n+
    97 {
    \n+
    98 dwarn << "GridParameterBlock: Parameter 'bisectioncompatibility' not specified, "
    \n+
    99 << "defaulting to '0' (false)." << std::endl;
    \n+
    100 }
    \n+\n+
    102 }
    \n+
    \n+
    103
    \n+
    104 // some information
    \n+
    \n+
    105 bool ok()
    \n+
    106 {
    \n+
    107 return true;
    \n+
    108 }
    \n+
    \n+
    109 };
    \n+
    \n+
    110
    \n+
    111
    \n+
    112 } // end namespace dgf
    \n+
    113
    \n+
    114} // end namespace Dune
    \n+
    115
    \n+
    116#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition treeiterator.hh:189
    \n-
    GridImp::template Codim< codim >::Entity Entity
    Definition treeiterator.hh:207
    \n-
    int level() const
    ask for level of entities
    Definition treeiterator.hh:243
    \n-
    void increment()
    increment
    Definition treeiterator.hh:411
    \n-
    const GridImp & grid() const
    obtain a reference to the grid
    Definition treeiterator.hh:253
    \n-
    Definition leveliterator.hh:23
    \n-
    Base::MarkerVector MarkerVector
    Definition leveliterator.hh:29
    \n-
    AlbertaGridLevelIterator()
    Definition leveliterator.hh:31
    \n-
    AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *vec, int level)
    Constructor making begin iterator.
    Definition leveliterator.hh:40
    \n-
    Base::Entity Entity
    Definition leveliterator.hh:28
    \n-
    AlbertaGridLevelIterator(const GridImp &grid, int level)
    Constructor making end iterator.
    Definition leveliterator.hh:35
    \n-
    void increment()
    increment the iterator
    Definition leveliterator.hh:47
    \n-\n-\n-
    void increment()
    increment the iterator
    Definition leveliterator.hh:81
    \n-
    Base::Entity Entity
    Definition leveliterator.hh:62
    \n-
    Base::MarkerVector MarkerVector
    Definition leveliterator.hh:63
    \n-
    AlbertaGridLevelIterator(const GridImp &grid, int level)
    Constructor making end iterator.
    Definition leveliterator.hh:69
    \n-
    AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *, int level)
    Constructor making begin iterator (which is the end iterator in this case)
    Definition leveliterator.hh:74
    \n-
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n-\n+
    Definition basic.hh:31
    \n+
    Common Grid parameters.
    Definition gridparameter.hh:35
    \n+
    static const Flags foundDumpFileName
    Definition gridparameter.hh:40
    \n+
    const std::string & dumpFileName() const
    Definition gridparameter.hh:72
    \n+
    static const Flags foundName
    Definition gridparameter.hh:39
    \n+
    GridParameterBlock(std::istream &in)
    constructor: read common parameters
    \n+
    static const Flags foundCompatible
    Definition gridparameter.hh:42
    \n+
    unsigned int Flags
    Definition gridparameter.hh:37
    \n+
    bool bisectionCompatibility_
    Definition gridparameter.hh:49
    \n+
    std::string dumpFileName_
    Definition gridparameter.hh:47
    \n+
    bool ok()
    Definition gridparameter.hh:105
    \n+
    Flags foundFlags_
    Definition gridparameter.hh:45
    \n+
    const std::string & name(const std::string &defaultValue) const
    return the name of the grid
    Definition gridparameter.hh:60
    \n+
    std::string name_
    Definition gridparameter.hh:46
    \n+
    bool bisectionCompatibility() const
    returns true if grid is compatible for bisection refinement
    Definition gridparameter.hh:94
    \n+
    bool markLongestEdge() const
    returns true if longest edge should be marked for AlbertaGrid
    Definition gridparameter.hh:83
    \n+
    static const Flags foundLongestEdge
    Definition gridparameter.hh:41
    \n+
    bool markLongestEdge_
    Definition gridparameter.hh:48
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,175 +1,175 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * albertagrid\n-leveliterator.hh\n+ * io\n+ * file\n+ * dgfparser\n+ * blocks\n+gridparameter.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_ALBERTA_LEVELITERATOR_HH\n-6#define DUNE_ALBERTA_LEVELITERATOR_HH\n+5#ifndef DUNE_DGF_GRIDPARAMETERBLOCK_HH\n+6#define DUNE_DGF_GRIDPARAMETERBLOCK_HH\n 7\n-8#include \n-9\n-10#include \n-11\n-12#if HAVE_ALBERTA\n+8#include \n+9#include \n+10\n+11#include \n+12\n 13\n 14namespace Dune\n 15{\n 16\n-17 // AlbertaGridLevelIterator\n-18 // ------------------------\n-19\n-20 template< int codim, PartitionIteratorType pitype, class GridImp >\n-21 class AlbertaGridLevelIterator\n-22 : public AlbertaGridTreeIterator< codim, GridImp, false >\n-23 {\n-24 typedef AlbertaGridLevelIterator<_codim,_pitype,_GridImp_> This;\n-25 typedef AlbertaGridTreeIterator<_codim,_GridImp,_false_> Base;\n-26\n-27 public:\n-28 typedef typename Base::Entity Entity;\n-29 typedef typename Base::MarkerVector MarkerVector;\n-30\n-31 AlbertaGridLevelIterator ()\n-32 {}\n-33\n-35 AlbertaGridLevelIterator ( const GridImp &grid, int level )\n-36 : Base( grid, level )\n-37 {}\n+17 namespace dgf\n+18 {\n+33 class GridParameterBlock\n+34 : public BasicBlock\n+35 {\n+36 public:\n+37 typedef unsigned int Flags;\n 38\n-40 AlbertaGridLevelIterator ( const GridImp &grid,\n-41 const MarkerVector *vec,\n-42 int level )\n-43 : Base( grid, vec, level )\n-44 {}\n-45\n-47 void increment ()\n-48 {\n-49 Base::increment();\n-50 }\n-51 };\n-52\n-53\n-54 template< int codim, class GridImp >\n-55 class AlbertaGridLevelIterator< codim, Ghost_Partition, GridImp >\n-56 : public AlbertaGridTreeIterator< codim, GridImp, false >\n-57 {\n-58 typedef AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_> This;\n-59 typedef AlbertaGridTreeIterator<_codim,_GridImp,_false_> Base;\n-60\n-61 public:\n-62 typedef typename Base::Entity Entity;\n-63 typedef typename Base::MarkerVector MarkerVector;\n-64\n-65 AlbertaGridLevelIterator ()\n-66 {}\n-67\n-69 AlbertaGridLevelIterator ( const GridImp &grid, int level )\n-70 : Base( grid, level )\n-71 {}\n-72\n-74 AlbertaGridLevelIterator ( const GridImp &grid,\n-75 const MarkerVector *,\n-76 int level )\n-77 : Base( grid, level )\n-78 {}\n-79\n-81 void increment ()\n-82 {\n-83 Base::increment();\n-84 }\n-85 };\n-86}\n-87\n-88#endif // #if HAVE_ALBERTA\n-89\n-90#endif // #ifndef DUNE_ALBERTA_LEVELITERATOR_HH\n-treeiterator.hh\n-Dune::Ghost_Partition\n-@ Ghost_Partition\n-only ghost entities\n-Definition gridenums.hh:142\n+39 static const Flags foundName = 1 << 0;\n+40 static const Flags foundDumpFileName = 1 << 1;\n+41 static const Flags foundLongestEdge = 1 << 5;\n+42 static const Flags foundCompatible = 1 << 13;\n+43\n+44 protected:\n+45 Flags foundFlags_; // supportFlags, this block was created with\n+46 std::string name_; // name of the grid\n+47 std::string dumpFileName_; // name of the grid\n+48 bool markLongestEdge_; // Mark longest edge for AlbertaGrid or ALUGrid\n+49 bool bisectionCompatibility_; // true if grid is compatible (bisection\n+refinement works)\n+50\n+51 private:\n+52 // copy not implemented\n+53 GridParameterBlock(const GridParameterBlock&);\n+54\n+55 public:\n+57 GridParameterBlock ( std::istream &in );\n+58\n+60 const std::string &name ( const std::string &defaultValue ) const\n+61 {\n+62 if( (foundFlags_ & foundName) == 0 )\n+63 {\n+64 dwarn << \"GridParameterBlock: Parameter 'name' not specified, \"\n+65 << \"defaulting to '\" << defaultValue << \"'.\" << std::endl;\n+66 return defaultValue;\n+67 }\n+68 else\n+69 return name_;\n+70 }\n+71\n+72 const std::string &dumpFileName ( ) const\n+73 {\n+74 if( (foundFlags_ & foundDumpFileName) != 0 )\n+75 {\n+76 dwarn << \"GridParameterBlock: found Parameter 'dumpfilename', \"\n+77 << \"dumping file to `\" << dumpFileName_ << \"'\" << std::endl;\n+78 }\n+79 return dumpFileName_;\n+80 }\n+81\n+83 bool markLongestEdge () const\n+84 {\n+85 if( (foundFlags_ & foundLongestEdge) == 0 )\n+86 {\n+87 dwarn << \"GridParameterBlock: Parameter 'refinementedge' not specified, \"\n+88 << \"defaulting to 'ARBITRARY'.\" << std::endl;\n+89 }\n+90 return markLongestEdge_;\n+91 }\n+92\n+94 bool bisectionCompatibility() const\n+95 {\n+96 if( (foundFlags_ & foundCompatible) == 0 )\n+97 {\n+98 dwarn << \"GridParameterBlock: Parameter 'bisectioncompatibility' not\n+specified, \"\n+99 << \"defaulting to '0' (false).\" << std::endl;\n+100 }\n+101 return bisectionCompatibility_;\n+102 }\n+103\n+104 // some information\n+105 bool ok()\n+106 {\n+107 return true;\n+108 }\n+109 };\n+110\n+111\n+112 } // end namespace dgf\n+113\n+114} // end namespace Dune\n+115\n+116#endif\n+basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::AlbertaGridTreeIterator\n-Definition treeiterator.hh:189\n-Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::Entity\n-GridImp::template Codim< codim >::Entity Entity\n-Definition treeiterator.hh:207\n-Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::level\n-int level() const\n-ask for level of entities\n-Definition treeiterator.hh:243\n-Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::increment\n-void increment()\n-increment\n-Definition treeiterator.hh:411\n-Dune::AlbertaGridTreeIterator<_codim,_GridImp,_false_>::grid\n-const GridImp & grid() const\n-obtain a reference to the grid\n-Definition treeiterator.hh:253\n-Dune::AlbertaGridLevelIterator\n-Definition leveliterator.hh:23\n-Dune::AlbertaGridLevelIterator::MarkerVector\n-Base::MarkerVector MarkerVector\n-Definition leveliterator.hh:29\n-Dune::AlbertaGridLevelIterator::AlbertaGridLevelIterator\n-AlbertaGridLevelIterator()\n-Definition leveliterator.hh:31\n-Dune::AlbertaGridLevelIterator::AlbertaGridLevelIterator\n-AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *vec, int\n-level)\n-Constructor making begin iterator.\n-Definition leveliterator.hh:40\n-Dune::AlbertaGridLevelIterator::Entity\n-Base::Entity Entity\n-Definition leveliterator.hh:28\n-Dune::AlbertaGridLevelIterator::AlbertaGridLevelIterator\n-AlbertaGridLevelIterator(const GridImp &grid, int level)\n-Constructor making end iterator.\n-Definition leveliterator.hh:35\n-Dune::AlbertaGridLevelIterator::increment\n-void increment()\n-increment the iterator\n-Definition leveliterator.hh:47\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>\n-Definition leveliterator.hh:57\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::\n-AlbertaGridLevelIterator\n-AlbertaGridLevelIterator()\n-Definition leveliterator.hh:65\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::increment\n-void increment()\n-increment the iterator\n-Definition leveliterator.hh:81\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::Entity\n-Base::Entity Entity\n-Definition leveliterator.hh:62\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::MarkerVector\n-Base::MarkerVector MarkerVector\n-Definition leveliterator.hh:63\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::\n-AlbertaGridLevelIterator\n-AlbertaGridLevelIterator(const GridImp &grid, int level)\n-Constructor making end iterator.\n-Definition leveliterator.hh:69\n-Dune::AlbertaGridLevelIterator<_codim,_Ghost_Partition,_GridImp_>::\n-AlbertaGridLevelIterator\n-AlbertaGridLevelIterator(const GridImp &grid, const MarkerVector *, int level)\n-Constructor making begin iterator (which is the end iterator in this case)\n-Definition leveliterator.hh:74\n-Dune::AlbertaMarkerVector\n-marker assigning subentities to one element containing them\n-Definition treeiterator.hh:35\n-entityiterator.hh\n+Dune::dgf::BasicBlock\n+Definition basic.hh:31\n+Dune::dgf::GridParameterBlock\n+Common Grid parameters.\n+Definition gridparameter.hh:35\n+Dune::dgf::GridParameterBlock::foundDumpFileName\n+static const Flags foundDumpFileName\n+Definition gridparameter.hh:40\n+Dune::dgf::GridParameterBlock::dumpFileName\n+const std::string & dumpFileName() const\n+Definition gridparameter.hh:72\n+Dune::dgf::GridParameterBlock::foundName\n+static const Flags foundName\n+Definition gridparameter.hh:39\n+Dune::dgf::GridParameterBlock::GridParameterBlock\n+GridParameterBlock(std::istream &in)\n+constructor: read common parameters\n+Dune::dgf::GridParameterBlock::foundCompatible\n+static const Flags foundCompatible\n+Definition gridparameter.hh:42\n+Dune::dgf::GridParameterBlock::Flags\n+unsigned int Flags\n+Definition gridparameter.hh:37\n+Dune::dgf::GridParameterBlock::bisectionCompatibility_\n+bool bisectionCompatibility_\n+Definition gridparameter.hh:49\n+Dune::dgf::GridParameterBlock::dumpFileName_\n+std::string dumpFileName_\n+Definition gridparameter.hh:47\n+Dune::dgf::GridParameterBlock::ok\n+bool ok()\n+Definition gridparameter.hh:105\n+Dune::dgf::GridParameterBlock::foundFlags_\n+Flags foundFlags_\n+Definition gridparameter.hh:45\n+Dune::dgf::GridParameterBlock::name\n+const std::string & name(const std::string &defaultValue) const\n+return the name of the grid\n+Definition gridparameter.hh:60\n+Dune::dgf::GridParameterBlock::name_\n+std::string name_\n+Definition gridparameter.hh:46\n+Dune::dgf::GridParameterBlock::bisectionCompatibility\n+bool bisectionCompatibility() const\n+returns true if grid is compatible for bisection refinement\n+Definition gridparameter.hh:94\n+Dune::dgf::GridParameterBlock::markLongestEdge\n+bool markLongestEdge() const\n+returns true if longest edge should be marked for AlbertaGrid\n+Definition gridparameter.hh:83\n+Dune::dgf::GridParameterBlock::foundLongestEdge\n+static const Flags foundLongestEdge\n+Definition gridparameter.hh:41\n+Dune::dgf::GridParameterBlock::markLongestEdge_\n+bool markLongestEdge_\n+Definition gridparameter.hh:48\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00851_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00857_source.html", "comments": ["Files 82% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: simplexgeneration.hh Source File\n+dune-grid: simplex.hh Source File\n \n \n \n \n \n \n \n@@ -74,152 +74,98 @@\n \n \n
    \n
    \n-
    simplexgeneration.hh
    \n+
    simplex.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH
    \n-
    6#define DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH
    \n+
    5#ifndef DUNE_DGF_SIMPLEXBLOCK_HH
    \n+
    6#define DUNE_DGF_SIMPLEXBLOCK_HH
    \n
    7
    \n
    8#include <iostream>
    \n-
    9
    \n-\n-
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    15 namespace dgf
    \n-
    16 {
    \n-
    17
    \n-
    \n-\n-
    19 : public BasicBlock
    \n-
    20 {
    \n-
    21 double area_;
    \n-
    22 double angle_;
    \n-
    23 bool display_;
    \n-
    24 std::string path_;
    \n-
    25 bool haspath_;
    \n-
    26 std::string filename_;
    \n-
    27 std::string filetype_;
    \n-
    28 std::string parameter_;
    \n-
    29 std::string dumpfilename_;
    \n-
    30 bool hasfile_;
    \n-
    31 int dimension_;
    \n+
    9#include <vector>
    \n+
    10
    \n+\n+
    12
    \n+
    13namespace Dune
    \n+
    14{
    \n+
    15
    \n+
    16 namespace dgf
    \n+
    17 {
    \n+
    18 // SimplexBlock
    \n+
    19 // ------------
    \n+
    20
    \n+
    \n+\n+
    22 : public BasicBlock
    \n+
    23 {
    \n+
    24 unsigned int nofvtx;
    \n+
    25 int vtxoffset;
    \n+
    26 int dimgrid;
    \n+
    27 bool goodline; // active line describes a vertex
    \n+
    28 int nofparams; // nof parameters
    \n+
    29
    \n+
    30 public:
    \n+
    31 SimplexBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
    \n
    32
    \n-
    33 public:
    \n-
    34 SimplexGenerationBlock ( std :: istream &in );
    \n-
    35
    \n-
    \n-
    36 double maxArea ()
    \n-
    37 {
    \n-
    38 return area_;
    \n-
    39 }
    \n-
    \n-
    40
    \n-
    \n-
    41 double minAngle ()
    \n-
    42 {
    \n-
    43 return angle_;
    \n-
    44 }
    \n-
    \n-
    45
    \n-
    \n-
    46 bool display ()
    \n-
    47 {
    \n-
    48 return display_;
    \n-
    49 }
    \n-
    \n-
    50
    \n-
    \n-
    51 bool haspath ()
    \n-
    52 {
    \n-
    53 return haspath_;
    \n-
    54 }
    \n-
    \n-
    55
    \n-
    \n-
    56 std :: string path ()
    \n-
    57 {
    \n-
    58 return path_;
    \n-
    59 }
    \n-
    \n-
    60
    \n-
    \n-
    61 bool hasfile ()
    \n-
    62 {
    \n-
    63 return hasfile_;
    \n-
    64 }
    \n-
    \n+
    33 int get ( std :: vector< std :: vector< unsigned int > > &simplex,
    \n+
    34 std :: vector< std :: vector< double > > &params,
    \n+
    35 int &nofp );
    \n+
    36
    \n+
    37 // cubes -> simplex
    \n+
    38 static int
    \n+
    39 cube2simplex ( std :: vector< std :: vector< double > > &vtx,
    \n+
    40 std :: vector< std :: vector< unsigned int > > &elements,
    \n+
    41 std :: vector< std :: vector< double > > &params );
    \n+
    42
    \n+
    43 // some information
    \n+
    \n+
    44 bool ok ()
    \n+
    45 {
    \n+
    46 return goodline;
    \n+
    47 }
    \n+
    \n+
    48
    \n+
    \n+\n+
    50 {
    \n+
    51 return noflines();
    \n+
    52 }
    \n+
    \n+
    53
    \n+
    54 private:
    \n+
    55 // get the dimension of the grid
    \n+
    56 int getDimGrid ();
    \n+
    57 // get next simplex
    \n+
    58 bool next ( std :: vector< unsigned int > &simplex,
    \n+
    59 std :: vector< double > &param );
    \n+
    60 };
    \n+
    \n+
    61
    \n+
    62 } // end namespace dgf
    \n+
    63
    \n+
    64} // end namespace Dune
    \n
    65
    \n-
    \n-
    66 std :: string filename ()
    \n-
    67 {
    \n-
    68 return filename_;
    \n-
    69 }
    \n-
    \n-
    70
    \n-
    \n-
    71 std :: string filetype ()
    \n-
    72 {
    \n-
    73 return filetype_;
    \n-
    74 }
    \n-
    \n-
    75
    \n-
    \n-
    76 int dimension ()
    \n-
    77 {
    \n-
    78 return dimension_;
    \n-
    79 }
    \n-
    \n-
    80
    \n-
    \n-
    81 std :: string parameter ()
    \n-
    82 {
    \n-
    83 return parameter_;
    \n-
    84 }
    \n-
    \n-
    85
    \n-
    \n-
    86 const std::string dumpFileName ( ) const
    \n-
    87 {
    \n-
    88 return dumpfilename_;
    \n-
    89 }
    \n-
    \n-
    90 };
    \n-
    \n-
    91
    \n-
    92 } // end namespace dgf
    \n-
    93
    \n-
    94} // end namespace Dune
    \n-
    95
    \n-
    96#endif
    \n-\n+
    66#endif
    \n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Definition basic.hh:31
    \n-
    Definition simplexgeneration.hh:20
    \n-
    std::string filename()
    Definition simplexgeneration.hh:66
    \n-
    double maxArea()
    Definition simplexgeneration.hh:36
    \n-
    bool haspath()
    Definition simplexgeneration.hh:51
    \n-
    std::string parameter()
    Definition simplexgeneration.hh:81
    \n-
    int dimension()
    Definition simplexgeneration.hh:76
    \n-
    std::string path()
    Definition simplexgeneration.hh:56
    \n-
    const std::string dumpFileName() const
    Definition simplexgeneration.hh:86
    \n-
    bool display()
    Definition simplexgeneration.hh:46
    \n-
    double minAngle()
    Definition simplexgeneration.hh:41
    \n-
    bool hasfile()
    Definition simplexgeneration.hh:61
    \n-
    std::string filetype()
    Definition simplexgeneration.hh:71
    \n+
    int & noflines()
    Definition basic.hh:87
    \n+
    Definition simplex.hh:23
    \n+
    static int cube2simplex(std ::vector< std ::vector< double > > &vtx, std ::vector< std ::vector< unsigned int > > &elements, std ::vector< std ::vector< double > > &params)
    Definition simplex.cc:145
    \n+
    int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector< std ::vector< double > > &params, int &nofp)
    Definition simplex.cc:68
    \n+
    int nofsimplex()
    Definition simplex.hh:49
    \n+
    bool ok()
    Definition simplex.hh:44
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,149 +4,105 @@\n No Matches\n * dune\n * grid\n * io\n * file\n * dgfparser\n * blocks\n-simplexgeneration.hh\n+simplex.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH\n-6#define DUNE_DGF_SIMPLEXGENERATIONBLOCK_HH\n+5#ifndef DUNE_DGF_SIMPLEXBLOCK_HH\n+6#define DUNE_DGF_SIMPLEXBLOCK_HH\n 7\n 8#include \n-9\n-10#include \n-11\n-12namespace Dune\n-13{\n-14\n-15 namespace dgf\n-16 {\n-17\n-18 class SimplexGenerationBlock\n-19 : public BasicBlock\n-20 {\n-21 double area_;\n-22 double angle_;\n-23 bool display_;\n-24 std::string path_;\n-25 bool haspath_;\n-26 std::string filename_;\n-27 std::string filetype_;\n-28 std::string parameter_;\n-29 std::string dumpfilename_;\n-30 bool hasfile_;\n-31 int dimension_;\n+9#include \n+10\n+11#include \n+12\n+13namespace Dune\n+14{\n+15\n+16 namespace dgf\n+17 {\n+18 // SimplexBlock\n+19 // ------------\n+20\n+21 class SimplexBlock\n+22 : public BasicBlock\n+23 {\n+24 unsigned int nofvtx;\n+25 int vtxoffset;\n+26 int dimgrid;\n+27 bool goodline; // active line describes a vertex\n+28 int nofparams; // nof parameters\n+29\n+30 public:\n+31 SimplexBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int\n+&pdimgrid );\n 32\n-33 public:\n-34 SimplexGenerationBlock ( std :: istream &in );\n-35\n-36 double maxArea ()\n-37 {\n-38 return area_;\n-39 }\n-40\n-41 double minAngle ()\n-42 {\n-43 return angle_;\n-44 }\n-45\n-46 bool display ()\n-47 {\n-48 return display_;\n-49 }\n-50\n-51 bool haspath ()\n-52 {\n-53 return haspath_;\n-54 }\n-55\n-56 std :: string path ()\n-57 {\n-58 return path_;\n-59 }\n-60\n-61 bool hasfile ()\n-62 {\n-63 return hasfile_;\n-64 }\n+33 int get ( std :: vector< std :: vector< unsigned int > > &simplex,\n+34 std :: vector< std :: vector< double > > ¶ms,\n+35 int &nofp );\n+36\n+37 // cubes -> simplex\n+38 static int\n+39 cube2simplex ( std :: vector< std :: vector< double > > &vtx,\n+40 std :: vector< std :: vector< unsigned int > > &elements,\n+41 std :: vector< std :: vector< double > > ¶ms );\n+42\n+43 // some information\n+44 bool ok ()\n+45 {\n+46 return goodline;\n+47 }\n+48\n+49 int nofsimplex ()\n+50 {\n+51 return noflines();\n+52 }\n+53\n+54 private:\n+55 // get the dimension of the grid\n+56 int getDimGrid ();\n+57 // get next simplex\n+58 bool next ( std :: vector< unsigned int > &simplex,\n+59 std :: vector< double > ¶m );\n+60 };\n+61\n+62 } // end namespace dgf\n+63\n+64} // end namespace Dune\n 65\n-66 std :: string filename ()\n-67 {\n-68 return filename_;\n-69 }\n-70\n-71 std :: string filetype ()\n-72 {\n-73 return filetype_;\n-74 }\n-75\n-76 int dimension ()\n-77 {\n-78 return dimension_;\n-79 }\n-80\n-81 std :: string parameter ()\n-82 {\n-83 return parameter_;\n-84 }\n-85\n-86 const std::string dumpFileName ( ) const\n-87 {\n-88 return dumpfilename_;\n-89 }\n-90 };\n-91\n-92 } // end namespace dgf\n-93\n-94} // end namespace Dune\n-95\n-96#endif\n+66#endif\n basic.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::dgf::BasicBlock\n Definition basic.hh:31\n-Dune::dgf::SimplexGenerationBlock\n-Definition simplexgeneration.hh:20\n-Dune::dgf::SimplexGenerationBlock::filename\n-std::string filename()\n-Definition simplexgeneration.hh:66\n-Dune::dgf::SimplexGenerationBlock::maxArea\n-double maxArea()\n-Definition simplexgeneration.hh:36\n-Dune::dgf::SimplexGenerationBlock::haspath\n-bool haspath()\n-Definition simplexgeneration.hh:51\n-Dune::dgf::SimplexGenerationBlock::parameter\n-std::string parameter()\n-Definition simplexgeneration.hh:81\n-Dune::dgf::SimplexGenerationBlock::dimension\n-int dimension()\n-Definition simplexgeneration.hh:76\n-Dune::dgf::SimplexGenerationBlock::path\n-std::string path()\n-Definition simplexgeneration.hh:56\n-Dune::dgf::SimplexGenerationBlock::dumpFileName\n-const std::string dumpFileName() const\n-Definition simplexgeneration.hh:86\n-Dune::dgf::SimplexGenerationBlock::display\n-bool display()\n-Definition simplexgeneration.hh:46\n-Dune::dgf::SimplexGenerationBlock::minAngle\n-double minAngle()\n-Definition simplexgeneration.hh:41\n-Dune::dgf::SimplexGenerationBlock::hasfile\n-bool hasfile()\n-Definition simplexgeneration.hh:61\n-Dune::dgf::SimplexGenerationBlock::filetype\n-std::string filetype()\n-Definition simplexgeneration.hh:71\n+Dune::dgf::BasicBlock::noflines\n+int & noflines()\n+Definition basic.hh:87\n+Dune::dgf::SimplexBlock\n+Definition simplex.hh:23\n+Dune::dgf::SimplexBlock::cube2simplex\n+static int cube2simplex(std ::vector< std ::vector< double > > &vtx, std ::\n+vector< std ::vector< unsigned int > > &elements, std ::vector< std ::vector<\n+double > > ¶ms)\n+Definition simplex.cc:145\n+Dune::dgf::SimplexBlock::get\n+int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector<\n+std ::vector< double > > ¶ms, int &nofp)\n+Definition simplex.cc:68\n+Dune::dgf::SimplexBlock::nofsimplex\n+int nofsimplex()\n+Definition simplex.hh:49\n+Dune::dgf::SimplexBlock::ok\n+bool ok()\n+Definition simplex.hh:44\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00854_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00572_source.html", "comments": ["Files 88% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: cube.hh Source File\n+dune-grid: hostcorners.hh Source File\n \n \n \n \n \n \n \n@@ -70,96 +70,94 @@\n
    \n \n \n \n \n \n \n
    \n-
    cube.hh
    \n+
    hostcorners.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_CUBEBLOCK_HH
    \n-
    6#define DUNE_DGF_CUBEBLOCK_HH
    \n+
    5#ifndef DUNE_GEOGRID_HOSTCORNERS_HH
    \n+
    6#define DUNE_GEOGRID_HOSTCORNERS_HH
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9#include <iostream>
    \n-
    10#include <vector>
    \n+
    8#include <dune/geometry/type.hh>
    \n+
    9
    \n+\n
    11
    \n-\n-
    13
    \n-
    14
    \n-
    15namespace Dune
    \n-
    16{
    \n-
    17
    \n-
    18 namespace dgf
    \n-
    19 {
    \n-
    20
    \n+
    12namespace Dune
    \n+
    13{
    \n+
    14 namespace GeoGrid
    \n+
    15 {
    \n+
    16
    \n+
    17 // HostCorners
    \n+
    18 // -----------
    \n+
    19
    \n+
    20 template< class HostEntity >
    \n
    \n-\n-
    22 : public BasicBlock
    \n-
    23 {
    \n-
    24 unsigned int nofvtx;
    \n-
    25 int dimgrid;
    \n-
    26 bool goodline; // active line describes a vertex
    \n-
    27 std :: vector< unsigned int > map; // active vertex
    \n-
    28 int nofparams;
    \n-
    29 int vtxoffset;
    \n-
    30
    \n-
    31 public:
    \n-
    32 CubeBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
    \n-
    33
    \n-
    34 int get ( std :: vector< std :: vector< unsigned int> > &simplex,
    \n-
    35 std :: vector< std :: vector< double > > &params,
    \n-
    36 int &nofp );
    \n-
    37
    \n-
    38 // some information
    \n-
    \n-
    39 bool ok ()
    \n-
    40 {
    \n-
    41 return goodline;
    \n-
    42 }
    \n-
    \n-
    43
    \n-
    \n-\n-
    45 {
    \n-
    46 return noflines();
    \n-
    47 }
    \n-
    \n-
    48
    \n-
    49 private:
    \n-
    50 // get the dimension of the grid
    \n-
    51 int getDimGrid ();
    \n-
    52 // get next simplex
    \n-
    53 bool next ( std :: vector< unsigned int > &simplex,
    \n-
    54 std :: vector< double > &param );
    \n-
    55 };
    \n-
    \n-
    56
    \n-
    57 } // end namespace dgf
    \n-
    58
    \n-
    59} // end namespace Dune
    \n-
    60
    \n-
    61#endif
    \n-\n+\n+
    22 {
    \n+
    23 typedef typename HostEntity::Geometry HostGeometry;
    \n+
    24
    \n+
    25 public:
    \n+
    26 typedef typename HostGeometry::GlobalCoordinate Coordinate;
    \n+
    27
    \n+
    \n+
    28 explicit HostCorners ( const HostEntity &hostEntity )
    \n+
    29 : hostGeometry_( hostEntity.geometry() )
    \n+
    30 {}
    \n+
    \n+
    31
    \n+
    \n+
    32 GeometryType type () const
    \n+
    33 {
    \n+
    34 return hostGeometry_.type();
    \n+
    35 }
    \n+
    \n+
    36
    \n+
    \n+
    37 Coordinate operator[] ( int i ) const
    \n+
    38 {
    \n+
    39 return hostGeometry_.corner( i );
    \n+
    40 }
    \n+
    \n+
    41
    \n+
    \n+
    42 std::size_t size () const
    \n+
    43 {
    \n+
    44 return hostGeometry_.corners();
    \n+
    45 }
    \n+
    \n+
    46
    \n+
    47 private:
    \n+
    48 HostGeometry hostGeometry_;
    \n+
    49 };
    \n+
    \n+
    50
    \n+
    51 } // namespace GeoGrid
    \n+
    52
    \n+
    53} // namespace Dune
    \n+
    54
    \n+
    55#endif // #ifndef DUNE_GEOGRID_HOSTCORNERS_HH
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition basic.hh:31
    \n-
    int & noflines()
    Definition basic.hh:87
    \n-
    Definition cube.hh:23
    \n-
    int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector< std ::vector< double > > &params, int &nofp)
    Definition cube.cc:102
    \n-
    int nofsimplex()
    Definition cube.hh:44
    \n-
    bool ok()
    Definition cube.hh:39
    \n+
    Definition hostcorners.hh:22
    \n+
    GeometryType type() const
    Definition hostcorners.hh:32
    \n+
    Coordinate operator[](int i) const
    Definition hostcorners.hh:37
    \n+
    HostCorners(const HostEntity &hostEntity)
    Definition hostcorners.hh:28
    \n+
    HostGeometry::GlobalCoordinate Coordinate
    Definition hostcorners.hh:26
    \n+
    std::size_t size() const
    Definition hostcorners.hh:42
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,98 +1,88 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * dgfparser\n- * blocks\n-cube.hh\n+ * geometrygrid\n+hostcorners.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_CUBEBLOCK_HH\n-6#define DUNE_DGF_CUBEBLOCK_HH\n+5#ifndef DUNE_GEOGRID_HOSTCORNERS_HH\n+6#define DUNE_GEOGRID_HOSTCORNERS_HH\n 7\n-8#include \n-9#include \n-10#include \n+8#include \n+9\n+10#include \n 11\n-12#include \n-13\n-14\n-15namespace Dune\n-16{\n-17\n-18 namespace dgf\n-19 {\n-20\n-21 class CubeBlock\n-22 : public BasicBlock\n-23 {\n-24 unsigned int nofvtx;\n-25 int dimgrid;\n-26 bool goodline; // active line describes a vertex\n-27 std :: vector< unsigned int > map; // active vertex\n-28 int nofparams;\n-29 int vtxoffset;\n-30\n-31 public:\n-32 CubeBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid\n-);\n-33\n-34 int get ( std :: vector< std :: vector< unsigned int> > &simplex,\n-35 std :: vector< std :: vector< double > > ¶ms,\n-36 int &nofp );\n-37\n-38 // some information\n-39 bool ok ()\n-40 {\n-41 return goodline;\n-42 }\n-43\n-44 int nofsimplex ()\n-45 {\n-46 return noflines();\n-47 }\n-48\n-49 private:\n-50 // get the dimension of the grid\n-51 int getDimGrid ();\n-52 // get next simplex\n-53 bool next ( std :: vector< unsigned int > &simplex,\n-54 std :: vector< double > ¶m );\n-55 };\n-56\n-57 } // end namespace dgf\n-58\n-59} // end namespace Dune\n-60\n-61#endif\n-basic.hh\n+12namespace Dune\n+13{\n+14 namespace GeoGrid\n+15 {\n+16\n+17 // HostCorners\n+18 // -----------\n+19\n+20 template< class HostEntity >\n+21 class HostCorners\n+22 {\n+23 typedef typename HostEntity::Geometry HostGeometry;\n+24\n+25 public:\n+26 typedef typename HostGeometry::GlobalCoordinate Coordinate;\n+27\n+28 explicit HostCorners ( const HostEntity &hostEntity )\n+29 : hostGeometry_( hostEntity.geometry() )\n+30 {}\n+31\n+32 GeometryType type () const\n+33 {\n+34 return hostGeometry_.type();\n+35 }\n+36\n+37 Coordinate operator[]_( int i ) const\n+38 {\n+39 return hostGeometry_.corner( i );\n+40 }\n+41\n+42 std::size_t size () const\n+43 {\n+44 return hostGeometry_.corners();\n+45 }\n+46\n+47 private:\n+48 HostGeometry hostGeometry_;\n+49 };\n+50\n+51 } // namespace GeoGrid\n+52\n+53} // namespace Dune\n+54\n+55#endif // #ifndef DUNE_GEOGRID_HOSTCORNERS_HH\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::dgf::BasicBlock\n-Definition basic.hh:31\n-Dune::dgf::BasicBlock::noflines\n-int & noflines()\n-Definition basic.hh:87\n-Dune::dgf::CubeBlock\n-Definition cube.hh:23\n-Dune::dgf::CubeBlock::get\n-int get(std ::vector< std ::vector< unsigned int > > &simplex, std ::vector<\n-std ::vector< double > > ¶ms, int &nofp)\n-Definition cube.cc:102\n-Dune::dgf::CubeBlock::nofsimplex\n-int nofsimplex()\n-Definition cube.hh:44\n-Dune::dgf::CubeBlock::ok\n-bool ok()\n-Definition cube.hh:39\n+Dune::GeoGrid::HostCorners\n+Definition hostcorners.hh:22\n+Dune::GeoGrid::HostCorners::type\n+GeometryType type() const\n+Definition hostcorners.hh:32\n+Dune::GeoGrid::HostCorners::operator[]\n+Coordinate operator[](int i) const\n+Definition hostcorners.hh:37\n+Dune::GeoGrid::HostCorners::HostCorners\n+HostCorners(const HostEntity &hostEntity)\n+Definition hostcorners.hh:28\n+Dune::GeoGrid::HostCorners::Coordinate\n+HostGeometry::GlobalCoordinate Coordinate\n+Definition hostcorners.hh:26\n+Dune::GeoGrid::HostCorners::size\n+std::size_t size() const\n+Definition hostcorners.hh:42\n+entity.hh\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00869_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00647_source.html", "comments": ["Files 93% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfidentitygrid.hh Source File\n+dune-grid: geometrycache.hh Source File\n \n \n \n \n \n \n \n@@ -70,179 +70,191 @@\n \n \n \n \n \n \n \n
    \n-
    dgfidentitygrid.hh
    \n+
    geometrycache.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH
    \n-
    6#define DUNE_DGFPARSER_DGFIDENTITYGRID_HH
    \n+
    5#ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH
    \n+
    6#define DUNE_ALBERTA_GEOMETRYCACHE_HH
    \n
    7
    \n-
    8#include <dune/common/typetraits.hh>
    \n-
    9
    \n-\n-\n-\n-
    13
    \n-
    14namespace Dune
    \n-
    15{
    \n-
    16
    \n-
    17 // DGFGridFactory for IdentityGrid
    \n-
    18 // -------------------------------
    \n-
    19
    \n-
    20 template< class HostGrid >
    \n-
    \n-
    21 struct DGFGridFactory< IdentityGrid< HostGrid > >
    \n-
    22 {
    \n-\n-
    24
    \n-
    25 const static int dimension = Grid::dimension;
    \n-
    26 typedef MPIHelper::MPICommunicator MPICommunicator;
    \n-
    27 typedef typename Grid::template Codim<0>::Entity Element;
    \n-
    28 typedef typename Grid::template Codim<dimension>::Entity Vertex;
    \n-
    29
    \n-
    \n-
    30 explicit DGFGridFactory ( std::istream &input,
    \n-
    31 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n-
    32 : dgfHostFactory_( input, comm ),
    \n-
    33 grid_( 0 )
    \n-
    34 {
    \n-
    35 HostGrid *hostGrid = dgfHostFactory_.grid();
    \n-
    36 assert( hostGrid != 0 );
    \n-
    37 grid_ = new Grid( *hostGrid );
    \n-
    38 }
    \n-
    \n-
    39
    \n-
    \n-
    40 explicit DGFGridFactory ( const std::string &filename,
    \n-
    41 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n-
    42 : dgfHostFactory_( filename, comm ),
    \n-
    43 grid_( 0 )
    \n-
    44 {
    \n-
    45 HostGrid *hostGrid = dgfHostFactory_.grid();
    \n-
    46 assert( hostGrid != 0 );
    \n-
    47 std::ifstream input( filename.c_str() );
    \n-
    48 grid_ = new Grid( *hostGrid );
    \n-
    49 }
    \n-
    \n-
    50
    \n-
    \n-
    51 Grid *grid () const
    \n-
    52 {
    \n-
    53 return grid_;
    \n-
    54 }
    \n-
    \n-
    55
    \n-
    56 template< class Intersection >
    \n-
    \n-
    57 bool wasInserted ( const Intersection &intersection ) const
    \n-
    58 {
    \n-
    59 return dgfHostFactory_.wasInserted( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n-
    60 }
    \n-
    \n-
    61
    \n-
    62 template< class Intersection >
    \n-
    \n-
    63 int boundaryId ( const Intersection &intersection ) const
    \n-
    64 {
    \n-
    65 return dgfHostFactory_.boundaryId( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n-
    66 }
    \n-
    \n-
    67
    \n-
    68 template< int codim >
    \n-
    \n-
    69 int numParameters () const
    \n-
    70 {
    \n-
    71 return dgfHostFactory_.template numParameters< codim >();
    \n-
    72 }
    \n-
    \n-
    73
    \n-
    74 template< class Entity >
    \n-
    \n-
    75 std::vector< double > &parameter ( const Entity &entity )
    \n-
    76 {
    \n-
    77 return dgfHostFactory_.parameter( HostGridAccess< Grid >::hostEntity( entity ) );
    \n-
    78 }
    \n-
    \n-
    79
    \n-
    80 private:
    \n-
    81 DGFGridFactory< HostGrid > dgfHostFactory_;
    \n-
    82 Grid *grid_;
    \n-
    83 };
    \n+\n+\n+
    10
    \n+
    11#if HAVE_ALBERTA
    \n+
    12
    \n+
    13namespace Dune
    \n+
    14{
    \n+
    15
    \n+
    16 namespace Alberta
    \n+
    17 {
    \n+
    18
    \n+
    19 // GeometryCache
    \n+
    20 // -------------
    \n+
    21
    \n+
    22 template< int dim >
    \n+
    \n+\n+
    24 {
    \n+
    25 static const unsigned int flagIntegrationElement = (1 << 0);
    \n+
    26 static const unsigned int flagJacobianTransposed = (1 << 1);
    \n+
    27 static const unsigned int flagJacobianInverseTransposed = (1 << 2);
    \n+
    28
    \n+
    29 public:
    \n+
    30 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;
    \n+
    31 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;
    \n+
    32
    \n+
    \n+\n+
    34 : flags_( 0 )
    \n+
    35 {}
    \n+
    \n+
    36
    \n+
    \n+
    37 const Real &integrationElement ( const ALBERTA EL_INFO &elInfo )
    \n+
    38 {
    \n+
    39 if( (flags_ & flagIntegrationElement) == 0 )
    \n+
    40 {
    \n+
    41 integrationElement_ = std::abs( determinant( jacobianTransposed( elInfo ) ) );
    \n+
    42 assert( integrationElement_ > 1e-14 );
    \n+
    43 flags_ |= flagIntegrationElement;
    \n+
    44 }
    \n+
    45 return integrationElement_;
    \n+
    46 }
    \n+
    \n+
    47
    \n+
    \n+
    48 const JacobianTransposed &jacobianTransposed ( const ALBERTA EL_INFO &elInfo )
    \n+
    49 {
    \n+
    50 if( (flags_ & flagJacobianTransposed) == 0 )
    \n+
    51 {
    \n+
    52 assert( (elInfo.fill_flag & FillFlags< dim >::coords) != 0 );
    \n+
    53 const GlobalVector &x = elInfo.coord[ 0 ];
    \n+
    54 for( int i = 0; i < dim; ++i )
    \n+
    55 {
    \n+
    56 const GlobalVector &y = elInfo.coord[ i+1 ];
    \n+
    57 for( int j = 0; j < dimWorld; ++j )
    \n+
    58 jacobianTransposed_[ i ][ j ] = y[ j ] - x[ j ];
    \n+
    59 }
    \n+
    60 flags_ |= flagJacobianTransposed;
    \n+
    61 }
    \n+
    62 return jacobianTransposed_;
    \n+
    63 }
    \n+
    \n+
    64
    \n+\n+
    \n+
    66 jacobianInverseTransposed ( const ALBERTA EL_INFO &elInfo )
    \n+
    67 {
    \n+
    68 if( (flags_ & flagJacobianInverseTransposed) == 0 )
    \n+
    69 {
    \n+
    70 integrationElement_ = std::abs( invert( jacobianTransposed( elInfo ), jacobianInverseTransposed_ ) );
    \n+
    71 assert( integrationElement_ > 1e-14 );
    \n+
    72 flags_ |= flagIntegrationElement | flagJacobianInverseTransposed;
    \n+
    73 }
    \n+
    74 return jacobianInverseTransposed_;
    \n+
    75 }
    \n+
    \n+
    76
    \n+
    77 private:
    \n+
    78 unsigned int flags_;
    \n+
    79 Real integrationElement_;
    \n+
    80 FieldMatrix< Real, dim, dimWorld > jacobianTransposed_;
    \n+
    81 FieldMatrix< Real, dimWorld, dim > jacobianInverseTransposed_;
    \n+
    82 };
    \n
    \n+
    83
    \n
    84
    \n
    85
    \n-
    86
    \n-
    87 // DGFGridInfo for IdGrid
    \n-
    88 // ----------------------
    \n-
    89
    \n-
    90 template< class HostGrid >
    \n-
    \n-
    91 struct DGFGridInfo< IdentityGrid< HostGrid > >
    \n-
    92 {
    \n-
    \n-
    93 static int refineStepsForHalf ()
    \n-
    94 {
    \n-\n-
    96 }
    \n-
    \n-
    97
    \n-
    \n-
    98 static double refineWeight ()
    \n-
    99 {
    \n-\n-
    101 }
    \n-
    \n-
    102 };
    \n-
    \n-
    103
    \n-
    104}
    \n-
    105
    \n-
    106#endif // #ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH
    \n-
    The IdentityGrid class.
    \n-\n+
    86 // GeometryCacheProxy
    \n+
    87 // ------------------
    \n+
    88
    \n+
    89 template< int dim >
    \n+
    \n+\n+
    91 {
    \n+
    92 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;
    \n+
    93 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;
    \n+
    94
    \n+
    \n+
    95 GeometryCacheProxy ( GeometryCache< dim > &geometryCache, const ALBERTA EL_INFO &elInfo )
    \n+
    96 : geometryCache_( geometryCache ),
    \n+
    97 elInfo_( elInfo )
    \n+
    98 {}
    \n+
    \n+
    99
    \n+
    \n+\n+
    101 {
    \n+
    102 return geometryCache_.integrationElement( elInfo_ );
    \n+
    103 }
    \n+
    \n+
    104
    \n+
    \n+\n+
    106 {
    \n+
    107 return geometryCache_.jacobianTransposed( elInfo_ );
    \n+
    108 }
    \n+
    \n+
    109
    \n+
    \n+\n+
    111 {
    \n+
    112 return geometryCache_.jacobianInverseTransposed( elInfo_ );
    \n+
    113 }
    \n+
    \n+
    114
    \n+
    115 private:
    \n+
    116 GeometryCache< dim > &geometryCache_;
    \n+
    117 const ALBERTA EL_INFO &elInfo_;
    \n+
    118 };
    \n+
    \n+
    119
    \n+
    120 } // namespace Alberta
    \n+
    121
    \n+
    122} // namespace Dune
    \n+
    123
    \n+
    124#endif // #if HAVE_ALBERTA
    \n+
    125
    \n+
    126#endif // #ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH
    \n+\n+\n+
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    G Grid
    Definition dgfgridfactory.hh:39
    \n-
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-
    Provides a meta grid that is identical to its host.
    Definition identitygrid.hh:93
    \n-
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n-
    Grid::template Codim< dimension >::Entity Vertex
    Definition dgfidentitygrid.hh:28
    \n-
    IdentityGrid< HostGrid > Grid
    Definition dgfidentitygrid.hh:23
    \n-
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfidentitygrid.hh:75
    \n-
    int numParameters() const
    Definition dgfidentitygrid.hh:69
    \n-
    Grid * grid() const
    Definition dgfidentitygrid.hh:51
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfidentitygrid.hh:40
    \n-
    DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfidentitygrid.hh:30
    \n-
    int boundaryId(const Intersection &intersection) const
    Definition dgfidentitygrid.hh:63
    \n-
    MPIHelper::MPICommunicator MPICommunicator
    Definition dgfidentitygrid.hh:26
    \n-
    Grid::template Codim< 0 >::Entity Element
    Definition dgfidentitygrid.hh:27
    \n-
    bool wasInserted(const Intersection &intersection) const
    Definition dgfidentitygrid.hh:57
    \n-
    static int refineStepsForHalf()
    Definition dgfidentitygrid.hh:93
    \n-
    static double refineWeight()
    Definition dgfidentitygrid.hh:98
    \n-
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n-
    static double refineWeight()
    \n-
    static int refineStepsForHalf()
    number of globalRefine steps needed to refuce h by 0.5
    \n-\n+
    ALBERTA REAL Real
    Definition misc.hh:48
    \n+
    static K determinant(const FieldMatrix< K, 0, m > &matrix)
    Definition algebra.hh:30
    \n+
    static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 > &inverse)
    Definition algebra.hh:81
    \n+
    static const int dimWorld
    Definition misc.hh:46
    \n+
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n+
    Definition geometrycache.hh:24
    \n+
    GeometryCache()
    Definition geometrycache.hh:33
    \n+
    const Real & integrationElement(const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:37
    \n+
    FieldMatrix< Real, dim, dimWorld > JacobianTransposed
    Definition geometrycache.hh:31
    \n+
    const JacobianTransposed & jacobianTransposed(const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:48
    \n+
    const JacobianInverseTransposed & jacobianInverseTransposed(const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:66
    \n+
    FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed
    Definition geometrycache.hh:30
    \n+
    Definition geometrycache.hh:91
    \n+
    const JacobianTransposed & jacobianTransposed()
    Definition geometrycache.hh:105
    \n+
    FieldMatrix< Real, dim, dimWorld > JacobianTransposed
    Definition geometrycache.hh:93
    \n+
    FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed
    Definition geometrycache.hh:92
    \n+
    const Real & integrationElement()
    Definition geometrycache.hh:100
    \n+
    GeometryCacheProxy(GeometryCache< dim > &geometryCache, const ALBERTA EL_INFO &elInfo)
    Definition geometrycache.hh:95
    \n+
    const JacobianInverseTransposed & jacobianInverseTransposed()
    Definition geometrycache.hh:110
    \n+
    Definition misc.hh:231
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,210 +1,210 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * dgfparser\n-dgfidentitygrid.hh\n+ * albertagrid\n+geometrycache.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH\n-6#define DUNE_DGFPARSER_DGFIDENTITYGRID_HH\n+5#ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH\n+6#define DUNE_ALBERTA_GEOMETRYCACHE_HH\n 7\n-8#include \n-9\n-10#include \n-11#include \n-12#include \n-13\n-14namespace Dune\n-15{\n-16\n-17 // DGFGridFactory for IdentityGrid\n-18 // -------------------------------\n-19\n-20 template< class HostGrid >\n-21 struct DGFGridFactory< IdentityGrid< HostGrid > >\n-22 {\n-23 typedef IdentityGrid<_HostGrid_> Grid;\n-24\n-25 const static int dimension = Grid::dimension;\n-26 typedef MPIHelper::MPICommunicator MPICommunicator;\n-27 typedef typename Grid::template Codim<0>::Entity Element;\n-28 typedef typename Grid::template Codim::Entity Vertex;\n-29\n-30 explicit DGFGridFactory ( std::istream &input,\n-31 MPICommunicator comm = MPIHelper::getCommunicator() )\n-32 : dgfHostFactory_( input, comm ),\n-33 grid_( 0 )\n-34 {\n-35 HostGrid *hostGrid = dgfHostFactory_.grid();\n-36 assert( hostGrid != 0 );\n-37 grid_ = new Grid( *hostGrid );\n-38 }\n-39\n-40 explicit DGFGridFactory ( const std::string &filename,\n-41 MPICommunicator comm = MPIHelper::getCommunicator() )\n-42 : dgfHostFactory_( filename, comm ),\n-43 grid_( 0 )\n-44 {\n-45 HostGrid *hostGrid = dgfHostFactory_.grid();\n-46 assert( hostGrid != 0 );\n-47 std::ifstream input( filename.c_str() );\n-48 grid_ = new Grid( *hostGrid );\n-49 }\n-50\n-51 Grid *grid () const\n-52 {\n-53 return grid_;\n-54 }\n-55\n-56 template< class Intersection >\n-57 bool wasInserted ( const Intersection &intersection ) const\n-58 {\n-59 return dgfHostFactory_.wasInserted( HostGridAccess<_Grid_>::hostIntersection\n-( intersection ) );\n-60 }\n-61\n-62 template< class Intersection >\n-63 int boundaryId ( const Intersection &intersection ) const\n-64 {\n-65 return dgfHostFactory_.boundaryId( HostGridAccess<_Grid_>::hostIntersection\n-( intersection ) );\n-66 }\n-67\n-68 template< int codim >\n-69 int numParameters () const\n-70 {\n-71 return dgfHostFactory_.template numParameters< codim >();\n-72 }\n-73\n-74 template< class Entity >\n-75 std::vector< double > ¶meter ( const Entity &entity )\n-76 {\n-77 return dgfHostFactory_.parameter( HostGridAccess<_Grid_>::hostEntity( entity\n-) );\n-78 }\n-79\n-80 private:\n-81 DGFGridFactory<_HostGrid_> dgfHostFactory_;\n-82 Grid *grid_;\n-83 };\n+8#include \n+9#include \n+10\n+11#if HAVE_ALBERTA\n+12\n+13namespace Dune\n+14{\n+15\n+16 namespace Alberta\n+17 {\n+18\n+19 // GeometryCache\n+20 // -------------\n+21\n+22 template< int dim >\n+23 class GeometryCache\n+24 {\n+25 static const unsigned int flagIntegrationElement = (1 << 0);\n+26 static const unsigned int flagJacobianTransposed = (1 << 1);\n+27 static const unsigned int flagJacobianInverseTransposed = (1 << 2);\n+28\n+29 public:\n+30 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;\n+31 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;\n+32\n+33 GeometryCache ()\n+34 : flags_( 0 )\n+35 {}\n+36\n+37 const Real &integrationElement ( const ALBERTA EL_INFO &elInfo )\n+38 {\n+39 if( (flags_ & flagIntegrationElement) == 0 )\n+40 {\n+41 integrationElement_ = std::abs( determinant( jacobianTransposed( elInfo ) )\n+);\n+42 assert( integrationElement_ > 1e-14 );\n+43 flags_ |= flagIntegrationElement;\n+44 }\n+45 return integrationElement_;\n+46 }\n+47\n+48 const JacobianTransposed &jacobianTransposed ( const ALBERTA EL_INFO &elInfo\n+)\n+49 {\n+50 if( (flags_ & flagJacobianTransposed) == 0 )\n+51 {\n+52 assert( (elInfo.fill_flag & FillFlags<_dim_>::coords) != 0 );\n+53 const GlobalVector &x = elInfo.coord[ 0 ];\n+54 for( int i = 0; i < dim; ++i )\n+55 {\n+56 const GlobalVector &y = elInfo.coord[ i+1 ];\n+57 for( int j = 0; j < dimWorld; ++j )\n+58 jacobianTransposed_[ i ][ j ] = y[ j ] - x[ j ];\n+59 }\n+60 flags_ |= flagJacobianTransposed;\n+61 }\n+62 return jacobianTransposed_;\n+63 }\n+64\n+65 const JacobianInverseTransposed &\n+66 jacobianInverseTransposed ( const ALBERTA EL_INFO &elInfo )\n+67 {\n+68 if( (flags_ & flagJacobianInverseTransposed) == 0 )\n+69 {\n+70 integrationElement_ = std::abs( invert( jacobianTransposed( elInfo ),\n+jacobianInverseTransposed_ ) );\n+71 assert( integrationElement_ > 1e-14 );\n+72 flags_ |= flagIntegrationElement | flagJacobianInverseTransposed;\n+73 }\n+74 return jacobianInverseTransposed_;\n+75 }\n+76\n+77 private:\n+78 unsigned int flags_;\n+79 Real integrationElement_;\n+80 FieldMatrix< Real, dim, dimWorld > jacobianTransposed_;\n+81 FieldMatrix< Real, dimWorld, dim > jacobianInverseTransposed_;\n+82 };\n+83\n 84\n 85\n-86\n-87 // DGFGridInfo for IdGrid\n-88 // ----------------------\n-89\n-90 template< class HostGrid >\n-91 struct DGFGridInfo< IdentityGrid< HostGrid > >\n-92 {\n-93 static int refineStepsForHalf ()\n-94 {\n-95 return DGFGridInfo<_HostGrid_>::refineStepsForHalf();\n-96 }\n-97\n-98 static double refineWeight ()\n-99 {\n-100 return DGFGridInfo<_HostGrid_>::refineWeight();\n-101 }\n-102 };\n-103\n-104}\n-105\n-106#endif // #ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH\n-identitygrid.hh\n-The IdentityGrid class.\n-hostgridaccess.hh\n+86 // GeometryCacheProxy\n+87 // ------------------\n+88\n+89 template< int dim >\n+90 struct GeometryCacheProxy\n+91 {\n+92 typedef FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed;\n+93 typedef FieldMatrix< Real, dim, dimWorld > JacobianTransposed;\n+94\n+95 GeometryCacheProxy ( GeometryCache<_dim_> &geometryCache, const ALBERTA EL_\n+INFO &elInfo )\n+96 : geometryCache_( geometryCache ),\n+97 elInfo_( elInfo )\n+98 {}\n+99\n+100 const Real &integrationElement ()\n+101 {\n+102 return geometryCache_.integrationElement( elInfo_ );\n+103 }\n+104\n+105 const JacobianTransposed &jacobianTransposed ()\n+106 {\n+107 return geometryCache_.jacobianTransposed( elInfo_ );\n+108 }\n+109\n+110 const JacobianInverseTransposed &jacobianInverseTransposed ()\n+111 {\n+112 return geometryCache_.jacobianInverseTransposed( elInfo_ );\n+113 }\n+114\n+115 private:\n+116 GeometryCache<_dim_> &geometryCache_;\n+117 const ALBERTA EL_INFO &elInfo_;\n+118 };\n+119\n+120 } // namespace Alberta\n+121\n+122} // namespace Dune\n+123\n+124#endif // #if HAVE_ALBERTA\n+125\n+126#endif // #ifndef DUNE_ALBERTA_GEOMETRYCACHE_HH\n+algebra.hh\n+misc.hh\n+ALBERTA\n+#define ALBERTA\n+Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::Grid\n-G Grid\n-Definition dgfgridfactory.hh:39\n-Dune::DGFGridFactory::dimension\n-static const int dimension\n-Definition dgfgridfactory.hh:40\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-Dune::IdentityGrid\n-Provides a meta grid that is identical to its host.\n-Definition identitygrid.hh:93\n-Dune::HostGridAccess\n-provides access to host grid objects from GeometryGrid\n-Definition identitygrid.hh:37\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::Vertex\n-Grid::template Codim< dimension >::Entity Vertex\n-Definition dgfidentitygrid.hh:28\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::Grid\n-IdentityGrid< HostGrid > Grid\n-Definition dgfidentitygrid.hh:23\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::parameter\n-std::vector< double > & parameter(const Entity &entity)\n-Definition dgfidentitygrid.hh:75\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::numParameters\n-int numParameters() const\n-Definition dgfidentitygrid.hh:69\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::grid\n-Grid * grid() const\n-Definition dgfidentitygrid.hh:51\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::\n-getCommunicator())\n-Definition dgfidentitygrid.hh:40\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::DGFGridFactory\n-DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::\n-getCommunicator())\n-Definition dgfidentitygrid.hh:30\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::boundaryId\n-int boundaryId(const Intersection &intersection) const\n-Definition dgfidentitygrid.hh:63\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::MPICommunicator\n-MPIHelper::MPICommunicator MPICommunicator\n-Definition dgfidentitygrid.hh:26\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::Element\n-Grid::template Codim< 0 >::Entity Element\n-Definition dgfidentitygrid.hh:27\n-Dune::DGFGridFactory<_IdentityGrid<_HostGrid_>_>::wasInserted\n-bool wasInserted(const Intersection &intersection) const\n-Definition dgfidentitygrid.hh:57\n-Dune::DGFGridInfo<_IdentityGrid<_HostGrid_>_>::refineStepsForHalf\n-static int refineStepsForHalf()\n-Definition dgfidentitygrid.hh:93\n-Dune::DGFGridInfo<_IdentityGrid<_HostGrid_>_>::refineWeight\n-static double refineWeight()\n-Definition dgfidentitygrid.hh:98\n-Dune::DGFGridInfo\n-Some simple static information for a given GridType.\n-Definition io/file/dgfparser/dgfparser.hh:56\n-Dune::DGFGridInfo::refineWeight\n-static double refineWeight()\n-Dune::DGFGridInfo::refineStepsForHalf\n-static int refineStepsForHalf()\n-number of globalRefine steps needed to refuce h by 0.5\n-dgfparser.hh\n+Dune::Alberta::Real\n+ALBERTA REAL Real\n+Definition misc.hh:48\n+Dune::Alberta::determinant\n+static K determinant(const FieldMatrix< K, 0, m > &matrix)\n+Definition algebra.hh:30\n+Dune::Alberta::invert\n+static K invert(const FieldMatrix< K, 0, m > &matrix, FieldMatrix< K, m, 0 >\n+&inverse)\n+Definition algebra.hh:81\n+Dune::Alberta::dimWorld\n+static const int dimWorld\n+Definition misc.hh:46\n+Dune::Alberta::GlobalVector\n+ALBERTA REAL_D GlobalVector\n+Definition misc.hh:50\n+Dune::Alberta::GeometryCache\n+Definition geometrycache.hh:24\n+Dune::Alberta::GeometryCache::GeometryCache\n+GeometryCache()\n+Definition geometrycache.hh:33\n+Dune::Alberta::GeometryCache::integrationElement\n+const Real & integrationElement(const ALBERTA EL_INFO &elInfo)\n+Definition geometrycache.hh:37\n+Dune::Alberta::GeometryCache::JacobianTransposed\n+FieldMatrix< Real, dim, dimWorld > JacobianTransposed\n+Definition geometrycache.hh:31\n+Dune::Alberta::GeometryCache::jacobianTransposed\n+const JacobianTransposed & jacobianTransposed(const ALBERTA EL_INFO &elInfo)\n+Definition geometrycache.hh:48\n+Dune::Alberta::GeometryCache::jacobianInverseTransposed\n+const JacobianInverseTransposed & jacobianInverseTransposed(const ALBERTA EL_\n+INFO &elInfo)\n+Definition geometrycache.hh:66\n+Dune::Alberta::GeometryCache::JacobianInverseTransposed\n+FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed\n+Definition geometrycache.hh:30\n+Dune::Alberta::GeometryCacheProxy\n+Definition geometrycache.hh:91\n+Dune::Alberta::GeometryCacheProxy::jacobianTransposed\n+const JacobianTransposed & jacobianTransposed()\n+Definition geometrycache.hh:105\n+Dune::Alberta::GeometryCacheProxy::JacobianTransposed\n+FieldMatrix< Real, dim, dimWorld > JacobianTransposed\n+Definition geometrycache.hh:93\n+Dune::Alberta::GeometryCacheProxy::JacobianInverseTransposed\n+FieldMatrix< Real, dimWorld, dim > JacobianInverseTransposed\n+Definition geometrycache.hh:92\n+Dune::Alberta::GeometryCacheProxy::integrationElement\n+const Real & integrationElement()\n+Definition geometrycache.hh:100\n+Dune::Alberta::GeometryCacheProxy::GeometryCacheProxy\n+GeometryCacheProxy(GeometryCache< dim > &geometryCache, const ALBERTA EL_INFO\n+&elInfo)\n+Definition geometrycache.hh:95\n+Dune::Alberta::GeometryCacheProxy::jacobianInverseTransposed\n+const JacobianInverseTransposed & jacobianInverseTransposed()\n+Definition geometrycache.hh:110\n+Dune::Alberta::FillFlags\n+Definition misc.hh:231\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00872_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00632_source.html", "comments": ["Files 82% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfwriter.hh Source File\n+dune-grid: entity.cc Source File\n \n \n \n \n \n \n \n@@ -70,466 +70,497 @@\n
    \n
    \n \n \n \n \n \n
    \n-
    dgfwriter.hh
    \n+
    entity.cc
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH
    \n-
    6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH
    \n+
    5#ifndef DUNE_ALBERTA_ENTITY_CC
    \n+
    6#define DUNE_ALBERTA_ENTITY_CC
    \n
    7
    \n-
    13#include <cassert>
    \n-
    14#include <cstddef>
    \n-
    15
    \n-
    16#include <algorithm>
    \n-
    17#include <fstream>
    \n-
    18#include <string>
    \n-
    19#include <type_traits>
    \n-
    20#include <utility>
    \n-
    21#include <vector>
    \n-
    22
    \n-
    23#include <dune/common/rangeutilities.hh>
    \n-
    24#include <dune/common/typeutilities.hh>
    \n-
    25
    \n-
    26#include <dune/geometry/referenceelements.hh>
    \n-
    27#include <dune/geometry/type.hh>
    \n-
    28
    \n-\n-\n-
    31
    \n-
    32namespace Dune
    \n-
    33{
    \n-
    34
    \n-
    44 template< class GV >
    \n-
    \n-\n-
    46 {
    \n-
    47 typedef DGFWriter< GV > This;
    \n-
    48
    \n-
    49 public:
    \n-
    51 typedef GV GridView;
    \n-
    53 typedef typename GridView::Grid Grid;
    \n-
    54
    \n-
    56 static const int dimGrid = GridView::dimension;
    \n-
    57
    \n-
    58 private:
    \n-
    59 typedef typename GridView::IndexSet IndexSet;
    \n-
    60 typedef typename GridView::template Codim< 0 >::Entity Element;
    \n-
    61 typedef typename GridView::Intersection Intersection;
    \n-
    62
    \n-
    63 typedef typename Element::EntitySeed ElementSeed;
    \n-
    64
    \n-
    65 typedef typename IndexSet::IndexType Index;
    \n+
    8namespace Dune
    \n+
    9{
    \n+
    10
    \n+
    11 // AlbertaGridEntity (for codim > 0)
    \n+
    12 // ---------------------------------
    \n+
    13
    \n+
    14 template<int codim, int dim, class Grid>
    \n+
    15 inline AlbertaGridEntity< codim, dim, Grid >
    \n+
    \n+
    16 ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int subEntity )
    \n+
    17 : grid_( &grid ),
    \n+
    18 elementInfo_( elementInfo ),
    \n+
    19 subEntity_( subEntity )
    \n+
    20 {}
    \n+
    \n+
    21
    \n+
    22 template<int codim, int dim, class Grid>
    \n+\n+
    \n+\n+
    25 : grid_( &grid ),
    \n+
    26 elementInfo_(),
    \n+
    27 subEntity_( -1 )
    \n+
    28 {}
    \n+
    \n+
    29
    \n+
    30 template<int codim, int dim, class Grid>
    \n+\n+
    \n+\n+
    33 : grid_( NULL ),
    \n+
    34 elementInfo_(),
    \n+
    35 subEntity_( -1 )
    \n+
    36 {}
    \n+
    \n+
    37
    \n+
    38 template< int codim, int dim, class Grid >
    \n+
    39 inline PartitionType
    \n+
    \n+\n+
    41 {
    \n+
    42 return InteriorEntity;
    \n+
    43 }
    \n+
    \n+
    44
    \n+
    45
    \n+
    46 template< int codim, int dim, class Grid >
    \n+
    47 inline bool
    \n+
    \n+\n+
    49 {
    \n+
    50 const Alberta::Element *e1 = elementInfo().el();
    \n+
    51 const Alberta::Element *e2 = other.elementInfo().el();
    \n+
    52
    \n+
    53 // if both element null then they are equal
    \n+
    54 if( (e1 == NULL) && (e2 == NULL) )
    \n+
    55 return true;
    \n+
    56 return ((e1 == e2) && (subEntity_ == other.subEntity_));
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    59
    \n+
    60 template< int codim, int dim, class Grid >
    \n+
    61 inline ALBERTA EL_INFO *
    \n+
    \n+\n+
    63 {
    \n+
    64 return &(elementInfo_.elInfo());
    \n+
    65 }
    \n+
    \n
    66
    \n-
    67 public:
    \n-
    \n-
    72 DGFWriter ( const GridView &gridView )
    \n-
    73 : gridView_( gridView )
    \n-
    74 {}
    \n+
    67
    \n+
    68 template< int codim, int dim, class Grid >
    \n+
    69 inline void
    \n+
    \n+\n+
    71 {
    \n+
    72 elementInfo_ = ElementInfo();
    \n+
    73 }
    \n
    \n+
    74
    \n
    75
    \n-
    85 template< class BoundaryData >
    \n-
    86 void write ( std::ostream &gridout, const std::vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams = std::stringstream() ) const;
    \n-
    87
    \n-
    96 template< class BoundaryData >
    \n-
    97 void write ( std::ostream &gridout, BoundaryData &&boundaryData, const std::stringstream &addParams = std::stringstream() ) const;
    \n-
    98
    \n-
    \n-
    107 void write ( std::ostream &gridout, const std::vector< Index > &newElemOrder, const std::stringstream &addParams = std::stringstream() ) const
    \n-
    108 {
    \n-
    109 write( gridout, newElemOrder, [] ( const Intersection &i ) -> int { return boundaryId( i ); }, addParams );
    \n-
    110 }
    \n+
    76 template< int codim, int dim, class Grid >
    \n+\n+
    \n+
    78 ::setElement ( const ElementInfo &elementInfo, int subEntity )
    \n+
    79 {
    \n+
    80 elementInfo_ = elementInfo;
    \n+
    81 subEntity_ = subEntity;
    \n+
    82 }
    \n+
    \n+
    83
    \n+
    84
    \n+
    85 template< int codim, int dim, class Grid >
    \n+
    86 inline void
    \n+
    \n+\n+
    88 {
    \n+
    89 setElement( other.elementInfo_, other.subEntity_ );
    \n+
    90 }
    \n+
    \n+
    91
    \n+
    92
    \n+
    93 template< int codim, int dim, class Grid >
    \n+
    \n+\n+
    95 {
    \n+
    96 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );
    \n+
    97 return elementInfo_.level();
    \n+
    98 }
    \n+
    \n+
    99
    \n+
    100
    \n+
    101 template< int codim, int dim, class Grid >
    \n+\n+
    \n+\n+
    104 {
    \n+\n+
    106
    \n+
    107 assert( elementInfo_ );
    \n+
    108 const CoordReader coordReader( grid(), elementInfo_, subEntity_ );
    \n+
    109 return Geometry( GeometryImpl( coordReader ) );
    \n+
    110 }
    \n
    \n
    111
    \n-
    \n-
    119 void write ( std::ostream &gridout, const std::stringstream &addParams = std::stringstream() ) const
    \n-
    120 {
    \n-
    121 write( gridout, [] ( const Intersection &i ) -> int { return boundaryId( i ); }, addParams );
    \n-
    122 }
    \n-
    \n+
    112
    \n+
    113 template< int codim, int dim, class Grid >
    \n+
    \n+\n+
    115 {
    \n+
    116 return GeometryTypes::simplex( mydimension );
    \n+
    117 }
    \n+
    \n+
    118
    \n+
    119
    \n+
    120
    \n+
    121 // AlbertaGridEntity (for codim = 0)
    \n+
    122 // ---------------------------------
    \n
    123
    \n-
    130 template< class... Args >
    \n-
    \n-
    131 auto write ( const std::string &fileName, Args &&... args ) const
    \n-
    132 -> std::void_t< decltype( this->write( std::declval< std::ostream & >(), std::declval< Args >()... ) ) >
    \n-
    133 {
    \n-
    134 std::ofstream gridout( fileName );
    \n-
    135 if( gridout )
    \n-
    136 write( gridout, std::forward< Args >( args )... );
    \n-
    137 else
    \n-
    138 std::cerr << "Couldn't open file `"<< fileName << "'!"<< std::endl;
    \n-
    139 }
    \n-
    \n-
    140
    \n-
    141 protected:
    \n-
    142 auto elementsSeeds ( const std::vector< Index > &newElemOrder ) const
    \n-
    143 -> std::vector< ElementSeed >;
    \n-
    144
    \n-
    145 void writeHeader ( std::ostream &gridout ) const;
    \n-
    146 void writeFooter ( std::ostream &gridout ) const;
    \n+
    124 template< int dim, class Grid >
    \n+\n+
    \n+
    126 ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int subEntity )
    \n+
    127 : grid_( &grid ),
    \n+
    128 elementInfo_( elementInfo )
    \n+
    129 {
    \n+
    130 assert( subEntity == 0 );
    \n+
    131 }
    \n+
    \n+
    132
    \n+
    133 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    136 : grid_( &grid ),
    \n+
    137 elementInfo_()
    \n+
    138 {}
    \n+
    \n+
    139
    \n+
    140 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    143 : grid_( NULL ),
    \n+
    144 elementInfo_()
    \n+
    145 {}
    \n+
    \n+
    146
    \n
    147
    \n-
    148 auto writeVertices ( std::ostream &gridout ) const
    \n-
    149 -> std::vector< Index >;
    \n-
    150
    \n-
    151 void writeElement ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Element &element, const GeometryType &elementType ) const;
    \n-
    152
    \n-
    153 void writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const;
    \n-
    154 void writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;
    \n+
    148 template< int dim, class Grid >
    \n+
    \n+\n+
    150 {
    \n+
    151 // elements are always inside of our Domain
    \n+
    152 return 0;
    \n+
    153 }
    \n+
    \n+
    154
    \n
    155
    \n-
    156 void writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const;
    \n-
    157 void writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;
    \n-
    158
    \n-
    159 template< class... Args >
    \n-
    160 void writeElements ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Args &... args ) const;
    \n+
    156 template< int dim, class Grid >
    \n+
    \n+\n+
    158 {
    \n+
    159 return grid().levelProvider().isNew( elementInfo_ );
    \n+
    160 }
    \n+
    \n
    161
    \n-
    162 private:
    \n-
    163 template< class I >
    \n-
    164 static auto boundaryId ( const I &i, PriorityTag< 1 > )
    \n-
    165 -> std::enable_if_t< std::is_convertible< std::decay_t< decltype( i.impl().boundaryId() ) >, int >::value, int >
    \n-
    166 {
    \n-
    167 return i.impl().boundaryId();
    \n-
    168 }
    \n+
    162
    \n+
    163 template< int dim, class Grid >
    \n+
    \n+\n+
    165 {
    \n+
    166 return elementInfo_.mightVanish();
    \n+
    167 }
    \n+
    \n+
    168
    \n
    169
    \n-
    170 template< class I >
    \n-
    171 static int boundaryId ( const I &i, PriorityTag< 0 > )
    \n-
    172 {
    \n-
    173 return 1;
    \n-
    174 }
    \n-
    175
    \n-
    176 protected:
    \n-
    177 static int boundaryId ( const Intersection &i ) { return boundaryId( i, PriorityTag< 42 >() ); }
    \n-
    178
    \n-
    179 private:
    \n-
    180 static int boundaryId ( const Intersection &, int bndId ) { return bndId; }
    \n-
    181 static int boundaryId ( const Intersection &i, const std::string & ) { return boundaryId( i ); }
    \n-
    182 static int boundaryId ( const Intersection &i, const std::pair< int, std::string > &data ) { return boundrayId( i, data.first ); }
    \n-
    183
    \n-
    184 static void appendBoundaryData ( std::ostream &gridout, int ) { gridout << std::endl; }
    \n-
    185 static void appendBoundaryData ( std::ostream &gridout, std::pair< int, std::string > &data ) { appendBoundaryData( gridout, data.second ); }
    \n-
    186 static void appendBoundaryData ( std::ostream &gridout, const std::string &s ) { gridout << " : " << s << std::endl; }
    \n-
    187
    \n-
    188 protected:
    \n-
    189 template< class BoundaryData >
    \n-
    190 void writeBoundaries ( std::ostream &gridout, const std::vector< Index > &dgfIndices, BoundaryData &&boundaryData ) const;
    \n-
    191
    \n-
    \n-
    192 void writeBoundaries ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const
    \n-
    193 {
    \n-
    194 writeBoundaries( gridout, dgfIndices, [] ( const Intersection &i ) -> int { return boundaryId( i ); } );
    \n-
    195 }
    \n+
    170 template< int dim, class Grid >
    \n+
    171 inline bool
    \n+
    \n+\n+
    173 {
    \n+
    174 assert( elementInfo_ );
    \n+
    175 bool isBoundary = false;
    \n+
    176 for( int i = 0; i < dim+1; ++i )
    \n+
    177 isBoundary |= elementInfo_.isBoundary( i );
    \n+
    178 return isBoundary;
    \n+
    179 }
    \n+
    \n+
    180
    \n+
    181
    \n+
    182 template< int dim, class Grid >
    \n+
    183 inline PartitionType
    \n+
    \n+\n+
    185 {
    \n+
    186 return InteriorEntity;
    \n+
    187 }
    \n+
    \n+
    188
    \n+
    189
    \n+
    190 template< int dim, class Grid >
    \n+
    \n+\n+
    192 {
    \n+
    193 return elementInfo_.isLeaf();
    \n+
    194 }
    \n
    \n+
    195
    \n
    196
    \n-
    197 protected:
    \n-\n-
    199 };
    \n-
    \n-
    200
    \n-
    201
    \n-
    202 template< class GV >
    \n-
    \n-
    203 inline auto DGFWriter< GV >::elementsSeeds ( const std::vector< Index > &newElemOrder ) const
    \n-
    204 -> std::vector< ElementSeed >
    \n-
    205 {
    \n-
    206 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    207
    \n-
    208 const std::size_t orderSize = newElemOrder.size() ;
    \n-
    209 std::vector< ElementSeed > elementSeeds( orderSize );
    \n-
    210
    \n-
    211 for( const Element &element : elements( gridView_ ) )
    \n-
    212 {
    \n-
    213 assert( newElemOrder[ indexSet.index( element ) ] < orderSize );
    \n-
    214 elementSeeds[ newElemOrder[ indexSet.index( element ) ] ] = element.seed();
    \n-
    215 }
    \n-
    216
    \n-
    217 return elementSeeds;
    \n-
    218 }
    \n-
    \n-
    219
    \n-
    220
    \n-
    221 template< class GV >
    \n-
    \n-
    222 inline void DGFWriter< GV >::writeHeader ( std::ostream &gridout ) const
    \n-
    223 {
    \n-
    224 // set the stream to full double precision
    \n-
    225 gridout.setf( std::ios_base::scientific, std::ios_base::floatfield );
    \n-
    226 gridout.precision( 16 );
    \n-
    227
    \n-
    228 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    229
    \n-
    230 // write DGF header
    \n-
    231 gridout << "DGF" << std::endl;
    \n-
    232 gridout << "%" << " Elements = " << indexSet.size( 0 ) << " | Vertices = " << indexSet.size( dimGrid ) << std::endl;
    \n-
    233 }
    \n-
    \n-
    234
    \n-
    235
    \n-
    236 template< class GV >
    \n-
    \n-
    237 inline void DGFWriter< GV >::writeFooter ( std::ostream &gridout ) const
    \n-
    238 {
    \n-
    239 gridout << std::endl << "#" << std::endl;
    \n-
    240 }
    \n-
    \n-
    241
    \n-
    242
    \n-
    243 template< class GV >
    \n-
    \n-
    244 inline auto DGFWriter< GV >::writeVertices ( std::ostream &gridout ) const
    \n-
    245 -> std::vector< Index >
    \n-
    246 {
    \n-
    247 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    248
    \n-
    249 const Index vxSize = indexSet.size( dimGrid );
    \n-
    250 std::vector< Index > dgfIndices( vxSize, vxSize );
    \n-
    251
    \n-
    252 // write all vertices into the "vertex" block
    \n-
    253 gridout << std::endl << "VERTEX" << std::endl;
    \n-
    254 Index vertexCount = 0;
    \n-
    255 for( const Element &element : elements( gridView_ ) )
    \n-
    256 {
    \n-
    257 for( auto i : range( element.subEntities( dimGrid ) ) )
    \n-
    258 {
    \n-
    259 const Index vxIndex = indexSet.subIndex( element, i, dimGrid );
    \n-
    260 assert( vxIndex < vxSize );
    \n-
    261 if( dgfIndices[ vxIndex ] == vxSize )
    \n-
    262 {
    \n-
    263 dgfIndices[ vxIndex ] = vertexCount++;
    \n-
    264 gridout << element.geometry().corner( i ) << std::endl;
    \n-
    265 }
    \n-
    266 }
    \n-
    267 }
    \n-
    268 gridout << "#" << std::endl;
    \n-
    269
    \n-
    270 if( vertexCount != vxSize )
    \n-
    271 DUNE_THROW( GridError, "IndexSet reports wrong number of vertices." );
    \n-
    272 return dgfIndices;
    \n-
    273 }
    \n+
    197 template< int dim, class Grid >
    \n+
    198 inline bool
    \n+
    \n+\n+
    200 {
    \n+
    201 // element pointers are unique
    \n+
    202 return (elementInfo().el() == other.elementInfo().el());
    \n+
    203 }
    \n+
    \n+
    204
    \n+
    205
    \n+
    206 template< int dim, class Grid >
    \n+
    207 template< int codim >
    \n+
    208 inline typename Grid::template Codim< codim >::Entity
    \n+
    \n+\n+
    210 {
    \n+
    211 typedef AlbertaGridEntity< codim, dim, Grid > EntityImpl;
    \n+
    212 return EntityImpl( grid(), elementInfo_, grid().generic2alberta( codim, i ) );
    \n+
    213 }
    \n+
    \n+
    214
    \n+
    215
    \n+
    216 template< int dim, class Grid >
    \n+
    217 inline ALBERTA EL_INFO *
    \n+
    \n+\n+
    219 {
    \n+
    220 return &(elementInfo_.elInfo());
    \n+
    221 }
    \n+
    \n+
    222
    \n+
    223
    \n+
    224 template< int dim, class Grid >
    \n+
    \n+\n+
    226 {
    \n+
    227 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );
    \n+
    228 return elementInfo_.level();
    \n+
    229 }
    \n+
    \n+
    230
    \n+
    231
    \n+
    232 template< int dim, class Grid >
    \n+
    233 inline void
    \n+
    \n+\n+
    235 {
    \n+
    236 elementInfo_ = ElementInfo();
    \n+
    237 }
    \n+
    \n+
    238
    \n+
    239
    \n+
    240 template< int dim, class Grid >
    \n+\n+
    \n+
    242 ::setElement ( const ElementInfo &elementInfo, int /* subEntity */ )
    \n+
    243 {
    \n+
    244 elementInfo_ = elementInfo;
    \n+
    245 }
    \n+
    \n+
    246
    \n+
    247
    \n+
    248 template< int dim, class Grid >
    \n+
    249 inline void
    \n+
    \n+\n+
    251 {
    \n+
    252 setElement( other.elementInfo_, 0 );
    \n+
    253 }
    \n+
    \n+
    254
    \n+
    255
    \n+
    256 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    259 {
    \n+
    260 typedef AlbertaGridCoordinateReader< 0, Grid > CoordReader;
    \n+
    261
    \n+
    262 assert( elementInfo_ );
    \n+
    263 const CoordReader coordReader( grid(), elementInfo_, 0 );
    \n+
    264 return Geometry( GeometryImpl( coordReader ) );
    \n+
    265 }
    \n+
    \n+
    266
    \n+
    267
    \n+
    268 template< int dim, class Grid >
    \n+
    \n+
    269 inline GeometryType AlbertaGridEntity< 0, dim, Grid>::type () const
    \n+
    270 {
    \n+
    271 return GeometryTypes::simplex( mydimension );
    \n+
    272 }
    \n
    \n+
    273
    \n
    274
    \n-
    275
    \n-
    276 template< class GV >
    \n+
    275 template< int dim, class Grid >
    \n+
    276 inline typename Grid::template Codim< 0 >::Entity
    \n
    \n-
    277 inline void DGFWriter< GV >::writeElement ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Element &element, const GeometryType &elementType ) const
    \n+\n
    278 {
    \n-
    279 // if element's type is not the same as the type to write the return
    \n-
    280 if( element.type() != elementType )
    \n-
    281 return;
    \n-
    282
    \n-
    283 // write vertex numbers of the element
    \n-
    284 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    285 for( auto i : range( element.subEntities( Element::dimension ) ) )
    \n-
    286 gridout << (i > 0 ? " " : "") << dgfIndices[ indexSet.subIndex( element, i, dimGrid ) ];
    \n-
    287 gridout << std::endl;
    \n-
    288 }
    \n-
    \n-
    289
    \n-
    290
    \n-
    291 template< class GV >
    \n-
    \n-
    292 inline void DGFWriter< GV >::writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const
    \n-
    293 {
    \n-
    294 // write all simplices to the "simplex" block
    \n-
    295 gridout << std::endl << "SIMPLEX" << std::endl;
    \n-
    296
    \n-
    297 // write all simplex elements
    \n-
    298 for( const Element &element : elements( gridView_ ) )
    \n-
    299 writeElement( gridout, dgfIndices, element, GeometryTypes::simplex( dimGrid ) );
    \n-
    300
    \n-
    301 // write end marker for block
    \n-
    302 gridout << "#" << std::endl;
    \n+
    279 typedef AlbertaGridEntity< 0, dim, Grid > EntityImpl;
    \n+
    280
    \n+
    281 assert( elementInfo_ );
    \n+
    282 const ElementInfo fatherInfo = elementInfo_.father();
    \n+
    283
    \n+
    284 return EntityImpl( grid(), fatherInfo, 0 );
    \n+
    285 }
    \n+
    \n+
    286
    \n+
    287
    \n+
    288 template< int dim, class Grid >
    \n+\n+
    290 {
    \n+
    291 return elementInfo_.indexInFather();
    \n+
    292 }
    \n+
    293
    \n+
    294
    \n+
    295 template< int dim, class Grid >
    \n+
    296 inline typename AlbertaGridEntity< 0, dim, Grid >::LocalGeometry
    \n+
    \n+\n+
    298 {
    \n+
    299 typedef AlbertaGridLocalGeometryProvider< Grid > LocalGeoProvider;
    \n+
    300 const int indexInFather = elementInfo_.indexInFather();
    \n+
    301 const int orientation = (elementInfo_.type() == 1 ? -1 : 1);
    \n+
    302 return LocalGeometry( LocalGeoProvider::instance().geometryInFather( indexInFather, orientation ) );
    \n
    303 }
    \n
    \n
    304
    \n
    305
    \n-
    306 template< class GV >
    \n-
    \n-
    307 inline void DGFWriter< GV >::writeSimplices ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const
    \n-
    308 {
    \n-
    309 // write all simplices to the "simplex" block
    \n-
    310 gridout << std::endl << "SIMPLEX" << std::endl;
    \n-
    311
    \n-
    312 // write all simplex elements
    \n-
    313 for( const ElementSeed &seed : elementSeeds )
    \n-
    314 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ), GeometryTypes::simplex( dimGrid ) );
    \n+
    306 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    309 {
    \n+
    310 assert( elementInfo_ );
    \n+
    311 typedef AlbertaGridHierarchicIterator< Grid > IteratorImp;
    \n+
    312 return IteratorImp( grid(), elementInfo_, maxlevel );
    \n+
    313 }
    \n+
    \n+
    314
    \n
    315
    \n-
    316 // write end marker for block
    \n-
    317 gridout << "#" << std::endl;
    \n-
    318 }
    \n-
    \n-
    319
    \n-
    320
    \n-
    321 template< class GV >
    \n-
    \n-
    322 inline void DGFWriter< GV >::writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices ) const
    \n-
    323 {
    \n-
    324 // write all cubes to the "cube" block
    \n-
    325 gridout << std::endl << "CUBE" << std::endl;
    \n-
    326
    \n-
    327 // write all cube elements
    \n-
    328 for( const Element &element : elements( gridView_ ) )
    \n-
    329 writeElement( gridout, dgfIndices, element, GeometryTypes::cube( dimGrid ) );
    \n-
    330
    \n-
    331 // write end marker for block
    \n-
    332 gridout << "#" << std::endl;
    \n-
    333 }
    \n-
    \n-
    334
    \n-
    335
    \n-
    336 template< class GV >
    \n-
    \n-
    337 inline void DGFWriter< GV >::writeCubes ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const
    \n-
    338 {
    \n-
    339 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    340
    \n-
    341 // write all cubes to the "cube" block
    \n-
    342 gridout << std::endl << "CUBE" << std::endl;
    \n-
    343
    \n-
    344 // write all cube elements
    \n-
    345 for( const ElementSeed &seed : elementSeeds )
    \n-
    346 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ), GeometryTypes::cube( dimGrid ) );
    \n-
    347
    \n-
    348 // write end marker for block
    \n-
    349 gridout << "#" << std::endl;
    \n-
    350 }
    \n-
    \n-
    351
    \n-
    352
    \n-
    353 template< class GV >
    \n-
    354 template< class... Args >
    \n-
    \n-
    355 inline void DGFWriter< GV >::writeElements ( std::ostream &gridout, const std::vector< Index > &dgfIndices, const Args &... args ) const
    \n-
    356 {
    \n-
    357 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    358
    \n-
    359 if( (dimGrid > 1) && (indexSet.size( GeometryTypes::simplex( dimGrid ) ) > 0) )
    \n-
    360 writeSimplices( gridout, dgfIndices, args... );
    \n+
    316 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    319 {
    \n+
    320 assert( elementInfo_ );
    \n+
    321 typedef AlbertaGridHierarchicIterator< Grid > IteratorImp;
    \n+
    322 return IteratorImp( grid(), level(), maxlevel );
    \n+
    323 }
    \n+
    \n+
    324
    \n+
    325
    \n+
    326 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    329 {
    \n+
    330 assert( elementInfo_ );
    \n+
    331
    \n+
    332#ifndef NDEBUG
    \n+
    333 for( int i = 0; i <= dimension; ++i )
    \n+
    334 {
    \n+
    335 // std::cout << "Opposite vertex " << i << ": "
    \n+
    336 // << (int)(getElInfo()->opp_vertex[ i ]) << std::endl;
    \n+
    337 if( getElInfo()->opp_vertex[ i ] == 127 )
    \n+
    338 {
    \n+
    339 assert( false );
    \n+
    340 DUNE_THROW( NotImplemented, "AlbertaGrid: Intersections on outside "
    \n+
    341 "entities are not fully implemented, yet." );
    \n+
    342 }
    \n+
    343 }
    \n+
    344#endif // #ifndef NDEBUG
    \n+
    345
    \n+\n+
    347 return AlbertaGridLeafIntersectionIterator( *this, begin );
    \n+
    348 }
    \n+
    \n+
    349
    \n+
    350
    \n+
    351 template< int dim, class Grid >
    \n+\n+
    \n+\n+
    354 {
    \n+
    355 assert( elementInfo_ );
    \n+\n+
    357 return AlbertaGridLeafIntersectionIterator( *this, end );
    \n+
    358 }
    \n+
    \n+
    359
    \n+
    360} // namespace Dune
    \n
    361
    \n-
    362 if( indexSet.size( GeometryTypes::cube( dimGrid ) ) > 0 )
    \n-
    363 writeCubes( gridout, dgfIndices, args... );
    \n-
    364 }
    \n-
    \n-
    365
    \n-
    366
    \n-
    367 template< class GV >
    \n-
    368 template< class BoundaryData >
    \n-
    \n-
    369 inline void DGFWriter< GV >::writeBoundaries ( std::ostream &gridout, const std::vector< Index > &dgfIndices, BoundaryData &&boundaryData ) const
    \n-
    370 {
    \n-
    371 using std::max;
    \n-
    372
    \n-
    373 const IndexSet &indexSet = gridView_.indexSet();
    \n-
    374
    \n-
    375 // write all boundaries to the "boundarysegments" block
    \n-
    376 gridout << std::endl << "BOUNDARYSEGMENTS" << std::endl;
    \n-
    377
    \n-
    378 for( const Element &element : elements( gridView_ ) )
    \n-
    379 {
    \n-
    380 if( !element.hasBoundaryIntersections() )
    \n-
    381 continue;
    \n-
    382
    \n-
    383 const auto &refElement = ReferenceElements< typename Grid::ctype, dimGrid >::general( element.type() );
    \n-
    384 for( const Intersection &intersection : intersections( gridView_, element ) )
    \n-
    385 {
    \n-
    386 if( !intersection.boundary() )
    \n-
    387 continue;
    \n-
    388
    \n-
    389 const auto data = boundaryData( intersection );
    \n-
    390 const int bndId = max( boundaryId( intersection, data ), 1 );
    \n-
    391
    \n-
    392 const int faceNumber = intersection.indexInInside();
    \n-
    393 const unsigned int faceSize = refElement.size( faceNumber, 1, dimGrid );
    \n-
    394 gridout << bndId << " ";
    \n-
    395 for( auto i : range( faceSize ) )
    \n-
    396 {
    \n-
    397 const int j = refElement.subEntity( faceNumber, 1, i, dimGrid );
    \n-
    398 gridout << " " << dgfIndices[ indexSet.subIndex( element, j, dimGrid ) ];
    \n-
    399 }
    \n-
    400 appendBoundaryData( gridout, data );
    \n-
    401 }
    \n-
    402 }
    \n-
    403 gridout << "#" << std::endl;
    \n-
    404 }
    \n-
    \n-
    405
    \n-
    406
    \n-
    407 template< class GV >
    \n-
    408 template< class BoundaryData >
    \n-
    \n-
    409 inline void DGFWriter< GV >::write ( std::ostream &gridout, const std::vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams ) const
    \n-
    410 {
    \n-
    411 writeHeader( gridout );
    \n-
    412 auto dgfIndices = writeVertices( gridout );
    \n-
    413 writeElements( gridout, dgfIndices, elementSeeds( newElemOrder ) );
    \n-
    414 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >( boundaryData ) );
    \n-
    415 gridout << addParams.str();
    \n-
    416 writeFooter( gridout );
    \n-
    417 }
    \n-
    \n-
    418
    \n-
    419
    \n-
    420 template< class GV >
    \n-
    421 template< class BoundaryData >
    \n-
    \n-
    422 inline void DGFWriter< GV >::write ( std::ostream &gridout, BoundaryData &&boundaryData, const std::stringstream &addParams ) const
    \n-
    423 {
    \n-
    424 writeHeader( gridout );
    \n-
    425 auto dgfIndices = writeVertices( gridout );
    \n-
    426 writeElements( gridout, dgfIndices );
    \n-
    427 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >( boundaryData ) );
    \n-
    428 gridout << addParams.str();
    \n-
    429 writeFooter( gridout );
    \n-
    430 }
    \n-
    \n-
    431
    \n-
    432} // namespace Dune
    \n-
    433
    \n-
    434#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH
    \n-\n-
    Traits::Grid Grid
    type of the grid
    Definition common/gridview.hh:83
    \n-
    Traits::IndexSet IndexSet
    type of the index set
    Definition common/gridview.hh:86
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/gridview.hh:134
    \n-
    Traits::Intersection Intersection
    type of the intersection
    Definition common/gridview.hh:89
    \n+
    362#endif // #ifndef DUNE_ALBERTA_ENTITY_CC
    \n+
    #define ALBERTA
    Definition albertaheader.hh:29
    \n+
    PartitionType
    Attributes used in the generic overlap model.
    Definition gridenums.hh:30
    \n+
    @ InteriorEntity
    all interior entities
    Definition gridenums.hh:31
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Base class for exceptions in Dune grid modules.
    Definition exceptions.hh:20
    \n-
    IndexTypeImp IndexType
    The type used for the indices.
    Definition common/indexidset.hh:92
    \n-
    A struct that collects all associated types of one implementation from the Traits class.
    Definition common/gridview.hh:104
    \n-
    write a GridView to a DGF file
    Definition dgfwriter.hh:46
    \n-
    static const int dimGrid
    dimension of the grid
    Definition dgfwriter.hh:56
    \n-
    DGFWriter(const GridView &gridView)
    constructor
    Definition dgfwriter.hh:72
    \n-
    void write(std::ostream &gridout, const std::stringstream &addParams=std::stringstream()) const
    write the GridView into a std::ostream
    Definition dgfwriter.hh:119
    \n-
    auto write(const std::string &fileName, Args &&... args) const -> std::void_t< decltype(this->write(std::declval< std::ostream & >(), std::declval< Args >()...)) >
    write the GridView to a file
    Definition dgfwriter.hh:131
    \n-
    void writeBoundaries(std::ostream &gridout, const std::vector< Index > &dgfIndices, BoundaryData &&boundaryData) const
    Definition dgfwriter.hh:369
    \n-
    static int boundaryId(const Intersection &i)
    Definition dgfwriter.hh:177
    \n-
    void write(std::ostream &gridout, const std::vector< Index > &newElemOrder, const std::stringstream &addParams=std::stringstream()) const
    write the GridView into a std::ostream
    Definition dgfwriter.hh:107
    \n-
    void write(std::ostream &gridout, const std::vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams=std::stringstream()) const
    write the GridView into a std::ostream
    Definition dgfwriter.hh:409
    \n-
    GridView gridView_
    Definition dgfwriter.hh:198
    \n-
    void writeElement(std::ostream &gridout, const std::vector< Index > &dgfIndices, const Element &element, const GeometryType &elementType) const
    Definition dgfwriter.hh:277
    \n-
    GV GridView
    type of grid view
    Definition dgfwriter.hh:51
    \n-
    void writeFooter(std::ostream &gridout) const
    Definition dgfwriter.hh:237
    \n-
    GridView::Grid Grid
    type of underlying hierarchical grid
    Definition dgfwriter.hh:53
    \n-
    auto writeVertices(std::ostream &gridout) const -> std::vector< Index >
    Definition dgfwriter.hh:244
    \n-
    void writeElements(std::ostream &gridout, const std::vector< Index > &dgfIndices, const Args &... args) const
    Definition dgfwriter.hh:355
    \n-
    void writeBoundaries(std::ostream &gridout, const std::vector< Index > &dgfIndices) const
    Definition dgfwriter.hh:192
    \n-
    void writeCubes(std::ostream &gridout, const std::vector< Index > &dgfIndices) const
    Definition dgfwriter.hh:322
    \n-
    void writeSimplices(std::ostream &gridout, const std::vector< Index > &dgfIndices) const
    Definition dgfwriter.hh:292
    \n-
    void writeHeader(std::ostream &gridout) const
    Definition dgfwriter.hh:222
    \n-
    auto elementsSeeds(const std::vector< Index > &newElemOrder) const -> std::vector< ElementSeed >
    Definition dgfwriter.hh:203
    \n-
    Different resources needed by all grid implementations.
    \n+
    ALBERTA EL Element
    Definition misc.hh:54
    \n+\n+
    int level() const
    Definition elementinfo.hh:533
    \n+
    bool mightVanish() const
    Definition elementinfo.hh:526
    \n+
    ElementInfo father() const
    Definition elementinfo.hh:449
    \n+
    int type() const
    Definition elementinfo.hh:540
    \n+
    bool isBoundary(int face) const
    Definition elementinfo.hh:620
    \n+
    int indexInFather() const
    Definition elementinfo.hh:457
    \n+
    ALBERTA EL_INFO & elInfo() const
    Definition elementinfo.hh:744
    \n+
    Definition hierarchiciterator.hh:29
    \n+
    Definition albertagrid/intersectioniterator.hh:27
    \n+
    Definition albertagrid/entity.hh:46
    \n+
    void clearElement()
    Definition entity.cc:70
    \n+
    ALBERTA EL_INFO * getElInfo() const
    needed for the LevelIterator and LeafIterator
    Definition entity.cc:62
    \n+
    int level() const
    level of this element
    Definition entity.cc:94
    \n+
    void setElement(const ElementInfo &elementInfo, int subEntity)
    Definition entity.cc:78
    \n+
    PartitionType partitionType() const
    return partition type of this entity
    Definition entity.cc:40
    \n+
    Grid::template Codim< codim >::Geometry Geometry
    Definition albertagrid/entity.hh:69
    \n+
    void setEntity(const This &other)
    Definition entity.cc:87
    \n+
    const ElementInfo & elementInfo() const
    Definition albertagrid/entity.hh:130
    \n+
    Geometry geometry() const
    geometry of this entity
    Definition entity.cc:103
    \n+
    static const int dimension
    Definition albertagrid/entity.hh:57
    \n+
    const Grid & grid() const
    obtain a reference to the grid
    Definition albertagrid/entity.hh:142
    \n+
    int subEntity() const
    obtain number of the subentity within the element (in ALBERTA numbering)
    Definition albertagrid/entity.hh:148
    \n+
    Alberta::ElementInfo< dimension > ElementInfo
    Definition albertagrid/entity.hh:71
    \n+
    GeometryType type() const
    type of geometry of this entity
    Definition entity.cc:114
    \n+
    bool equals(const This &other) const
    equality of entities
    Definition entity.cc:48
    \n+
    Definition albertagrid/entity.hh:63
    \n+
    Definition albertagrid/entity.hh:185
    \n+
    Grid::Traits::template Codim< 0 >::GeometryImpl GeometryImpl
    Definition albertagrid/entity.hh:211
    \n+
    const ElementInfo & elementInfo() const
    Definition albertagrid/entity.hh:355
    \n+
    Grid::template Codim< 0 >::LocalGeometry LocalGeometry
    Definition albertagrid/entity.hh:210
    \n+
    Definition albertagrid/geometry.hh:30
    \n+
    Definition albertagrid/geometry.hh:504
    \n+
    Definition albertagrid/intersectioniterator.hh:35
    \n+
    Definition albertagrid/intersectioniterator.hh:36
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,559 +1,505 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * dgfparser\n-dgfwriter.hh\n+ * albertagrid\n+entity.cc\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH\n-6#define DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH\n+5#ifndef DUNE_ALBERTA_ENTITY_CC\n+6#define DUNE_ALBERTA_ENTITY_CC\n 7\n-13#include \n-14#include \n-15\n-16#include \n-17#include \n-18#include \n-19#include \n-20#include \n-21#include \n-22\n-23#include \n-24#include \n-25\n-26#include \n-27#include \n-28\n-29#include \n-30#include \n-31\n-32namespace Dune\n-33{\n-34\n-44 template< class GV >\n-45 class DGFWriter\n-46 {\n-47 typedef DGFWriter<_GV_> This;\n-48\n-49 public:\n-51 typedef GV GridView;\n-53 typedef typename GridView::Grid Grid;\n-54\n-56 static const int dimGrid = GridView::dimension;\n-57\n-58 private:\n-59 typedef typename GridView::IndexSet IndexSet;\n-60 typedef typename GridView::template Codim< 0 >::Entity Element;\n-61 typedef typename GridView::Intersection Intersection;\n-62\n-63 typedef typename Element::EntitySeed ElementSeed;\n-64\n-65 typedef typename IndexSet::IndexType Index;\n+8namespace Dune\n+9{\n+10\n+11 // AlbertaGridEntity (for codim > 0)\n+12 // ---------------------------------\n+13\n+14 template\n+15 inline AlbertaGridEntity< codim, dim, Grid >\n+16 ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int\n+subEntity )\n+17 : grid_( &grid ),\n+18 elementInfo_( elementInfo ),\n+19 subEntity_( subEntity )\n+20 {}\n+21\n+22 template\n+23 inline AlbertaGridEntity<_codim,_dim,_Grid_>\n+24_::AlbertaGridEntity ( const Grid &grid )\n+25 : grid_( &grid ),\n+26 elementInfo_(),\n+27 subEntity_( -1 )\n+28 {}\n+29\n+30 template\n+31 inline AlbertaGridEntity<_codim,_dim,_Grid_>\n+32_::AlbertaGridEntity ()\n+33 : grid_( NULL ),\n+34 elementInfo_(),\n+35 subEntity_( -1 )\n+36 {}\n+37\n+38 template< int codim, int dim, class Grid >\n+39 inline PartitionType\n+40 AlbertaGridEntity<_codim,dim,Grid_>::partitionType () const\n+41 {\n+42 return InteriorEntity;\n+43 }\n+44\n+45\n+46 template< int codim, int dim, class Grid >\n+47 inline bool\n+48 AlbertaGridEntity<_codim,_dim,_Grid_>::equals ( const This &other ) const\n+49 {\n+50 const Alberta::Element *e1 = elementInfo().el();\n+51 const Alberta::Element *e2 = other.elementInfo().el();\n+52\n+53 // if both element null then they are equal\n+54 if( (e1 == NULL) && (e2 == NULL) )\n+55 return true;\n+56 return ((e1 == e2) && (subEntity_ == other.subEntity_));\n+57 }\n+58\n+59\n+60 template< int codim, int dim, class Grid >\n+61 inline ALBERTA EL_INFO *\n+62 AlbertaGridEntity<_codim,_dim,_Grid_>::getElInfo () const\n+63 {\n+64 return &(elementInfo_.elInfo());\n+65 }\n 66\n-67 public:\n-72 DGFWriter ( const GridView &gridView )\n-73 : gridView_( gridView )\n-74 {}\n+67\n+68 template< int codim, int dim, class Grid >\n+69 inline void\n+70 AlbertaGridEntity<_codim,_dim,_Grid_>::clearElement ()\n+71 {\n+72 elementInfo_ = ElementInfo();\n+73 }\n+74\n 75\n-85 template< class BoundaryData >\n-86 void write ( std::ostream &gridout, const std::vector< Index >\n-&newElemOrder, BoundaryData &&boundaryData, const std::stringstream &addParams\n-= std::stringstream() ) const;\n-87\n-96 template< class BoundaryData >\n-97 void write ( std::ostream &gridout, BoundaryData &&boundaryData, const std::\n-stringstream &addParams = std::stringstream() ) const;\n-98\n-107 void write ( std::ostream &gridout, const std::vector< Index >\n-&newElemOrder, const std::stringstream &addParams = std::stringstream() ) const\n-108 {\n-109 write( gridout, newElemOrder, [] ( const Intersection &i ) -> int { return\n-boundaryId( i ); }, addParams );\n+76 template< int codim, int dim, class Grid >\n+77 inline void AlbertaGridEntity<_codim,_dim,_Grid_>\n+78_::setElement ( const ElementInfo &elementInfo, int subEntity )\n+79 {\n+80 elementInfo_ = elementInfo;\n+81 subEntity_ = subEntity;\n+82 }\n+83\n+84\n+85 template< int codim, int dim, class Grid >\n+86 inline void\n+87 AlbertaGridEntity<_codim,_dim,_Grid_>::setEntity ( const This &other )\n+88 {\n+89 setElement( other.elementInfo_, other.subEntity_ );\n+90 }\n+91\n+92\n+93 template< int codim, int dim, class Grid >\n+94 inline int AlbertaGridEntity<_codim,_dim,_Grid_>::level() const\n+95 {\n+96 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );\n+97 return elementInfo_.level();\n+98 }\n+99\n+100\n+101 template< int codim, int dim, class Grid >\n+102 inline typename AlbertaGridEntity<_codim,_dim,_Grid_>::Geometry\n+103 AlbertaGridEntity<_codim,_dim,_Grid_>::geometry () const\n+104 {\n+105 typedef AlbertaGridCoordinateReader<_codim,_Grid_> CoordReader;\n+106\n+107 assert( elementInfo_ );\n+108 const CoordReader coordReader( grid(), elementInfo_, subEntity_ );\n+109 return Geometry( GeometryImpl( coordReader ) );\n 110 }\n 111\n-119 void write ( std::ostream &gridout, const std::stringstream &addParams =\n-std::stringstream() ) const\n-120 {\n-121 write( gridout, [] ( const Intersection &i ) -> int { return boundaryId( i\n-); }, addParams );\n-122 }\n+112\n+113 template< int codim, int dim, class Grid >\n+114 inline GeometryType AlbertaGridEntity<_codim,_dim,_Grid_>::type () const\n+115 {\n+116 return GeometryTypes::simplex( mydimension );\n+117 }\n+118\n+119\n+120\n+121 // AlbertaGridEntity (for codim = 0)\n+122 // ---------------------------------\n 123\n-130 template< class... Args >\n-131 auto write ( const std::string &fileName, Args &&... args ) const\n-132 -> std::void_t< decltype( this->write( std::declval< std::ostream & >(),\n-std::declval< Args >()... ) ) >\n-133 {\n-134 std::ofstream gridout( fileName );\n-135 if( gridout )\n-136 write( gridout, std::forward< Args >( args )... );\n-137 else\n-138 std::cerr << \"Couldn't open file `\"<< fileName << \"'!\"<< std::endl;\n-139 }\n-140\n-141 protected:\n-142 auto elementsSeeds ( const std::vector< Index > &newElemOrder ) const\n-143 -> std::vector< ElementSeed >;\n-144\n-145 void writeHeader ( std::ostream &gridout ) const;\n-146 void writeFooter ( std::ostream &gridout ) const;\n+124 template< int dim, class Grid >\n+125 inline AlbertaGridEntity<_0,_dim,_Grid_>\n+126_::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int\n+subEntity )\n+127 : grid_( &grid ),\n+128 elementInfo_( elementInfo )\n+129 {\n+130 assert( subEntity == 0 );\n+131 }\n+132\n+133 template< int dim, class Grid >\n+134 inline AlbertaGridEntity<_0,_dim,_Grid_>\n+135_::AlbertaGridEntity( const Grid &grid )\n+136 : grid_( &grid ),\n+137 elementInfo_()\n+138 {}\n+139\n+140 template< int dim, class Grid >\n+141 inline AlbertaGridEntity<_0,_dim,_Grid_>\n+142_::AlbertaGridEntity ()\n+143 : grid_( NULL ),\n+144 elementInfo_()\n+145 {}\n+146\n 147\n-148 auto writeVertices ( std::ostream &gridout ) const\n-149 -> std::vector< Index >;\n-150\n-151 void writeElement ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, const Element &element, const GeometryType &elementType ) const;\n-152\n-153 void writeSimplices ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices ) const;\n-154 void writeSimplices ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;\n+148 template< int dim, class Grid >\n+149 inline int AlbertaGridEntity<_0,_dim,_Grid_>::boundaryId() const\n+150 {\n+151 // elements are always inside of our Domain\n+152 return 0;\n+153 }\n+154\n 155\n-156 void writeCubes ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices ) const;\n-157 void writeCubes ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, const std::vector< ElementSeed > &elementSeeds ) const;\n-158\n-159 template< class... Args >\n-160 void writeElements ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, const Args &... args ) const;\n+156 template< int dim, class Grid >\n+157 inline bool AlbertaGridEntity<_0,_dim,_Grid_>::isNew () const\n+158 {\n+159 return grid().levelProvider().isNew( elementInfo_ );\n+160 }\n 161\n-162 private:\n-163 template< class I >\n-164 static auto boundaryId ( const I &i, PriorityTag< 1 > )\n-165 -> std::enable_if_t< std::is_convertible< std::decay_t< decltype( i.impl\n-().boundaryId() ) >, int >::value, int >\n-166 {\n-167 return i.impl().boundaryId();\n-168 }\n+162\n+163 template< int dim, class Grid >\n+164 inline bool AlbertaGridEntity<_0,_dim,_Grid_>::mightVanish () const\n+165 {\n+166 return elementInfo_.mightVanish();\n+167 }\n+168\n 169\n-170 template< class I >\n-171 static int boundaryId ( const I &i, PriorityTag< 0 > )\n-172 {\n-173 return 1;\n-174 }\n-175\n-176 protected:\n-177 static int boundaryId ( const Intersection &i ) { return boundaryId( i,\n-PriorityTag< 42 >() ); }\n-178\n-179 private:\n-180 static int boundaryId ( const Intersection &, int bndId ) { return bndId; }\n-181 static int boundaryId ( const Intersection &i, const std::string & )\n-{ return boundaryId( i ); }\n-182 static int boundaryId ( const Intersection &i, const std::pair< int, std::\n-string > &data ) { return boundrayId( i, data.first ); }\n-183\n-184 static void appendBoundaryData ( std::ostream &gridout, int ) { gridout <<\n-std::endl; }\n-185 static void appendBoundaryData ( std::ostream &gridout, std::pair< int,\n-std::string > &data ) { appendBoundaryData( gridout, data.second ); }\n-186 static void appendBoundaryData ( std::ostream &gridout, const std::string\n-&s ) { gridout << \" : \" << s << std::endl; }\n-187\n-188 protected:\n-189 template< class BoundaryData >\n-190 void writeBoundaries ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, BoundaryData &&boundaryData ) const;\n-191\n-192 void writeBoundaries ( std::ostream &gridout, const std::vector< Index >\n-&dgfIndices ) const\n-193 {\n-194 writeBoundaries( gridout, dgfIndices, [] ( const Intersection &i ) -> int\n-{ return boundaryId( i ); } );\n-195 }\n+170 template< int dim, class Grid >\n+171 inline bool\n+172 AlbertaGridEntity<_0,_dim,_Grid_>::hasBoundaryIntersections () const\n+173 {\n+174 assert( elementInfo_ );\n+175 bool isBoundary = false;\n+176 for( int i = 0; i < dim+1; ++i )\n+177 isBoundary |= elementInfo_.isBoundary( i );\n+178 return isBoundary;\n+179 }\n+180\n+181\n+182 template< int dim, class Grid >\n+183 inline PartitionType\n+184 AlbertaGridEntity<_0,_dim,_Grid_>::partitionType () const\n+185 {\n+186 return InteriorEntity;\n+187 }\n+188\n+189\n+190 template< int dim, class Grid >\n+191 inline bool AlbertaGridEntity<_0,_dim,Grid_>::isLeaf () const\n+192 {\n+193 return elementInfo_.isLeaf();\n+194 }\n+195\n 196\n-197 protected:\n-198 GridView gridView_;\n-199 };\n-200\n-201\n-202 template< class GV >\n-203 inline auto DGFWriter<_GV_>::elementsSeeds ( const std::vector< Index >\n-&newElemOrder ) const\n-204 -> std::vector< ElementSeed >\n-205 {\n-206 const IndexSet &indexSet = gridView_.indexSet();\n-207\n-208 const std::size_t orderSize = newElemOrder.size() ;\n-209 std::vector< ElementSeed > elementSeeds( orderSize );\n-210\n-211 for( const Element &element : elements( gridView_ ) )\n-212 {\n-213 assert( newElemOrder[ indexSet.index( element ) ] < orderSize );\n-214 elementSeeds[ newElemOrder[ indexSet.index( element ) ] ] = element.seed();\n-215 }\n-216\n-217 return elementSeeds;\n-218 }\n-219\n-220\n-221 template< class GV >\n-222 inline void DGFWriter<_GV_>::writeHeader ( std::ostream &gridout ) const\n-223 {\n-224 // set the stream to full double precision\n-225 gridout.setf( std::ios_base::scientific, std::ios_base::floatfield );\n-226 gridout.precision( 16 );\n-227\n-228 const IndexSet &indexSet = gridView_.indexSet();\n-229\n-230 // write DGF header\n-231 gridout << \"DGF\" << std::endl;\n-232 gridout << \"%\" << \" Elements = \" << indexSet.size( 0 ) << \" | Vertices = \"\n-<< indexSet.size( dimGrid ) << std::endl;\n-233 }\n-234\n-235\n-236 template< class GV >\n-237 inline void DGFWriter<_GV_>::writeFooter ( std::ostream &gridout ) const\n-238 {\n-239 gridout << std::endl << \"#\" << std::endl;\n-240 }\n-241\n-242\n-243 template< class GV >\n-244 inline auto DGFWriter<_GV_>::writeVertices ( std::ostream &gridout ) const\n-245 -> std::vector< Index >\n-246 {\n-247 const IndexSet &indexSet = gridView_.indexSet();\n-248\n-249 const Index vxSize = indexSet.size( dimGrid );\n-250 std::vector< Index > dgfIndices( vxSize, vxSize );\n-251\n-252 // write all vertices into the \"vertex\" block\n-253 gridout << std::endl << \"VERTEX\" << std::endl;\n-254 Index vertexCount = 0;\n-255 for( const Element &element : elements( gridView_ ) )\n-256 {\n-257 for( auto i : range( element.subEntities( dimGrid ) ) )\n-258 {\n-259 const Index vxIndex = indexSet.subIndex( element, i, dimGrid );\n-260 assert( vxIndex < vxSize );\n-261 if( dgfIndices[ vxIndex ] == vxSize )\n-262 {\n-263 dgfIndices[ vxIndex ] = vertexCount++;\n-264 gridout << element.geometry().corner( i ) << std::endl;\n+197 template< int dim, class Grid >\n+198 inline bool\n+199 AlbertaGridEntity<_0,_dim,_Grid_>::equals ( const This &other ) const\n+200 {\n+201 // element pointers are unique\n+202 return (elementInfo().el() == other.elementInfo().el());\n+203 }\n+204\n+205\n+206 template< int dim, class Grid >\n+207 template< int codim >\n+208 inline typename Grid::template Codim< codim >::Entity\n+209 AlbertaGridEntity<_0,_dim,_Grid_>::subEntity ( int i ) const\n+210 {\n+211 typedef AlbertaGridEntity<_codim,_dim,_Grid_> EntityImpl;\n+212 return EntityImpl( grid(), elementInfo_, grid().generic2alberta( codim, i )\n+);\n+213 }\n+214\n+215\n+216 template< int dim, class Grid >\n+217 inline ALBERTA EL_INFO *\n+218 AlbertaGridEntity<_0,_dim,_Grid_>::getElInfo () const\n+219 {\n+220 return &(elementInfo_.elInfo());\n+221 }\n+222\n+223\n+224 template< int dim, class Grid >\n+225 inline int AlbertaGridEntity<_0,_dim,_Grid_>::level () const\n+226 {\n+227 assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );\n+228 return elementInfo_.level();\n+229 }\n+230\n+231\n+232 template< int dim, class Grid >\n+233 inline void\n+234 AlbertaGridEntity<_0,_dim,_Grid_>::clearElement ()\n+235 {\n+236 elementInfo_ = ElementInfo();\n+237 }\n+238\n+239\n+240 template< int dim, class Grid >\n+241 inline void AlbertaGridEntity<_0,_dim,_Grid_>\n+242_::setElement ( const ElementInfo &elementInfo, int /* subEntity */ )\n+243 {\n+244 elementInfo_ = elementInfo;\n+245 }\n+246\n+247\n+248 template< int dim, class Grid >\n+249 inline void\n+250 AlbertaGridEntity<_0,_dim,_Grid_>::setEntity( const This &other )\n+251 {\n+252 setElement( other.elementInfo_, 0 );\n+253 }\n+254\n+255\n+256 template< int dim, class Grid >\n+257 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::Geometry\n+258 AlbertaGridEntity<_0,_dim,_Grid_>::geometry () const\n+259 {\n+260 typedef AlbertaGridCoordinateReader<_0,_Grid_> CoordReader;\n+261\n+262 assert( elementInfo_ );\n+263 const CoordReader coordReader( grid(), elementInfo_, 0 );\n+264 return Geometry( GeometryImpl( coordReader ) );\n 265 }\n-266 }\n-267 }\n-268 gridout << \"#\" << std::endl;\n-269\n-270 if( vertexCount != vxSize )\n-271 DUNE_THROW( GridError, \"IndexSet reports wrong number of vertices.\" );\n-272 return dgfIndices;\n-273 }\n+266\n+267\n+268 template< int dim, class Grid >\n+269 inline GeometryType AlbertaGridEntity<_0,_dim,_Grid>::type () const\n+270 {\n+271 return GeometryTypes::simplex( mydimension );\n+272 }\n+273\n 274\n-275\n-276 template< class GV >\n-277 inline void DGFWriter<_GV_>::writeElement ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices, const Element &element, const GeometryType\n-&elementType ) const\n+275 template< int dim, class Grid >\n+276 inline typename Grid::template Codim< 0 >::Entity\n+277 AlbertaGridEntity<_0,_dim,_Grid_>::father () const\n 278 {\n-279 // if element's type is not the same as the type to write the return\n-280 if( element.type() != elementType )\n-281 return;\n-282\n-283 // write vertex numbers of the element\n-284 const IndexSet &indexSet = gridView_.indexSet();\n-285 for( auto i : range( element.subEntities( Element::dimension ) ) )\n-286 gridout << (i > 0 ? \" \" : \"\") << dgfIndices[ indexSet.subIndex( element, i,\n-dimGrid ) ];\n-287 gridout << std::endl;\n-288 }\n-289\n-290\n-291 template< class GV >\n-292 inline void DGFWriter<_GV_>::writeSimplices ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices ) const\n-293 {\n-294 // write all simplices to the \"simplex\" block\n-295 gridout << std::endl << \"SIMPLEX\" << std::endl;\n-296\n-297 // write all simplex elements\n-298 for( const Element &element : elements( gridView_ ) )\n-299 writeElement( gridout, dgfIndices, element, GeometryTypes::simplex( dimGrid\n-) );\n-300\n-301 // write end marker for block\n-302 gridout << \"#\" << std::endl;\n+279 typedef AlbertaGridEntity<_0,_dim,_Grid_> EntityImpl;\n+280\n+281 assert( elementInfo_ );\n+282 const ElementInfo fatherInfo = elementInfo_.father();\n+283\n+284 return EntityImpl( grid(), fatherInfo, 0 );\n+285 }\n+286\n+287\n+288 template< int dim, class Grid >\n+289 inline int AlbertaGridEntity<_0,_dim,_Grid_>::nChild () const\n+290 {\n+291 return elementInfo_.indexInFather();\n+292 }\n+293\n+294\n+295 template< int dim, class Grid >\n+296 inline typename AlbertaGridEntity< 0, dim, Grid >::LocalGeometry\n+297 AlbertaGridEntity<_0,_dim,_Grid_>::geometryInFather() const\n+298 {\n+299 typedef AlbertaGridLocalGeometryProvider<_Grid_> LocalGeoProvider;\n+300 const int indexInFather = elementInfo_.indexInFather();\n+301 const int orientation = (elementInfo_.type() == 1 ? -1 : 1);\n+302 return LocalGeometry( LocalGeoProvider::instance().geometryInFather\n+( indexInFather, orientation ) );\n 303 }\n 304\n 305\n-306 template< class GV >\n-307 inline void DGFWriter<_GV_>::writeSimplices ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices, const std::vector< ElementSeed >\n-&elementSeeds ) const\n-308 {\n-309 // write all simplices to the \"simplex\" block\n-310 gridout << std::endl << \"SIMPLEX\" << std::endl;\n-311\n-312 // write all simplex elements\n-313 for( const ElementSeed &seed : elementSeeds )\n-314 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ),\n-GeometryTypes::simplex( dimGrid ) );\n+306 template< int dim, class Grid >\n+307 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::HierarchicIterator\n+308 AlbertaGridEntity<_0,_dim,_Grid_>::hbegin( int maxlevel ) const\n+309 {\n+310 assert( elementInfo_ );\n+311 typedef AlbertaGridHierarchicIterator<_Grid_> IteratorImp;\n+312 return IteratorImp( grid(), elementInfo_, maxlevel );\n+313 }\n+314\n 315\n-316 // write end marker for block\n-317 gridout << \"#\" << std::endl;\n-318 }\n-319\n-320\n-321 template< class GV >\n-322 inline void DGFWriter<_GV_>::writeCubes ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices ) const\n-323 {\n-324 // write all cubes to the \"cube\" block\n-325 gridout << std::endl << \"CUBE\" << std::endl;\n-326\n-327 // write all cube elements\n-328 for( const Element &element : elements( gridView_ ) )\n-329 writeElement( gridout, dgfIndices, element, GeometryTypes::cube( dimGrid )\n-);\n-330\n-331 // write end marker for block\n-332 gridout << \"#\" << std::endl;\n-333 }\n-334\n-335\n-336 template< class GV >\n-337 inline void DGFWriter<_GV_>::writeCubes ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices, const std::vector< ElementSeed >\n-&elementSeeds ) const\n+316 template< int dim, class Grid >\n+317 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::HierarchicIterator\n+318 AlbertaGridEntity<_0,_dim,_Grid>::hend( int maxlevel ) const\n+319 {\n+320 assert( elementInfo_ );\n+321 typedef AlbertaGridHierarchicIterator<_Grid_> IteratorImp;\n+322 return IteratorImp( grid(), level(), maxlevel );\n+323 }\n+324\n+325\n+326 template< int dim, class Grid >\n+327 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::\n+AlbertaGridLeafIntersectionIterator\n+328 AlbertaGridEntity<_0,_dim,_Grid_>::ileafbegin() const\n+329 {\n+330 assert( elementInfo_ );\n+331\n+332#ifndef NDEBUG\n+333 for( int i = 0; i <= dimension; ++i )\n+334 {\n+335 // std::cout << \"Opposite vertex \" << i << \": \"\n+336 // << (int)(getElInfo()->opp_vertex[ i ]) << std::endl;\n+337 if( getElInfo()->opp_vertex[ i ] == 127 )\n 338 {\n-339 const IndexSet &indexSet = gridView_.indexSet();\n-340\n-341 // write all cubes to the \"cube\" block\n-342 gridout << std::endl << \"CUBE\" << std::endl;\n-343\n-344 // write all cube elements\n-345 for( const ElementSeed &seed : elementSeeds )\n-346 writeElement( gridout, dgfIndices, gridView_.grid().entity( seed ),\n-GeometryTypes::cube( dimGrid ) );\n-347\n-348 // write end marker for block\n-349 gridout << \"#\" << std::endl;\n-350 }\n-351\n-352\n-353 template< class GV >\n-354 template< class... Args >\n-355 inline void DGFWriter<_GV_>::writeElements ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices, const Args &... args ) const\n-356 {\n-357 const IndexSet &indexSet = gridView_.indexSet();\n-358\n-359 if( (dimGrid > 1) && (indexSet.size( GeometryTypes::simplex( dimGrid ) ) >\n-0) )\n-360 writeSimplices( gridout, dgfIndices, args... );\n+339 assert( false );\n+340 DUNE_THROW( NotImplemented, \"AlbertaGrid: Intersections on outside \"\n+341 \"entities are not fully implemented, yet.\" );\n+342 }\n+343 }\n+344#endif // #ifndef NDEBUG\n+345\n+346 typename AlbertaGridLeafIntersectionIterator::Begin begin;\n+347 return AlbertaGridLeafIntersectionIterator( *this, begin );\n+348 }\n+349\n+350\n+351 template< int dim, class Grid >\n+352 inline typename AlbertaGridEntity<_0,_dim,_Grid_>::\n+AlbertaGridLeafIntersectionIterator\n+353 AlbertaGridEntity<_0,_dim,_Grid_>::ileafend() const\n+354 {\n+355 assert( elementInfo_ );\n+356 typename AlbertaGridLeafIntersectionIterator::End end;\n+357 return AlbertaGridLeafIntersectionIterator( *this, end );\n+358 }\n+359\n+360} // namespace Dune\n 361\n-362 if( indexSet.size( GeometryTypes::cube( dimGrid ) ) > 0 )\n-363 writeCubes( gridout, dgfIndices, args... );\n-364 }\n-365\n-366\n-367 template< class GV >\n-368 template< class BoundaryData >\n-369 inline void DGFWriter<_GV_>::writeBoundaries ( std::ostream &gridout, const\n-std::vector< Index > &dgfIndices, BoundaryData &&boundaryData ) const\n-370 {\n-371 using std::max;\n-372\n-373 const IndexSet &indexSet = gridView_.indexSet();\n-374\n-375 // write all boundaries to the \"boundarysegments\" block\n-376 gridout << std::endl << \"BOUNDARYSEGMENTS\" << std::endl;\n-377\n-378 for( const Element &element : elements( gridView_ ) )\n-379 {\n-380 if( !element.hasBoundaryIntersections() )\n-381 continue;\n-382\n-383 const auto &refElement = ReferenceElements< typename Grid::ctype, dimGrid\n->::general( element.type() );\n-384 for( const Intersection &intersection : intersections( gridView_, element )\n-)\n-385 {\n-386 if( !intersection.boundary() )\n-387 continue;\n-388\n-389 const auto data = boundaryData( intersection );\n-390 const int bndId = max( boundaryId( intersection, data ), 1 );\n-391\n-392 const int faceNumber = intersection.indexInInside();\n-393 const unsigned int faceSize = refElement.size( faceNumber, 1, dimGrid );\n-394 gridout << bndId << \" \";\n-395 for( auto i : range( faceSize ) )\n-396 {\n-397 const int j = refElement.subEntity( faceNumber, 1, i, dimGrid );\n-398 gridout << \" \" << dgfIndices[ indexSet.subIndex( element, j, dimGrid ) ];\n-399 }\n-400 appendBoundaryData( gridout, data );\n-401 }\n-402 }\n-403 gridout << \"#\" << std::endl;\n-404 }\n-405\n-406\n-407 template< class GV >\n-408 template< class BoundaryData >\n-409 inline void DGFWriter<_GV_>::write ( std::ostream &gridout, const std::\n-vector< Index > &newElemOrder, BoundaryData &&boundaryData, const std::\n-stringstream &addParams ) const\n-410 {\n-411 writeHeader( gridout );\n-412 auto dgfIndices = writeVertices( gridout );\n-413 writeElements( gridout, dgfIndices, elementSeeds( newElemOrder ) );\n-414 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >\n-( boundaryData ) );\n-415 gridout << addParams.str();\n-416 writeFooter( gridout );\n-417 }\n-418\n-419\n-420 template< class GV >\n-421 template< class BoundaryData >\n-422 inline void DGFWriter<_GV_>::write ( std::ostream &gridout, BoundaryData\n-&&boundaryData, const std::stringstream &addParams ) const\n-423 {\n-424 writeHeader( gridout );\n-425 auto dgfIndices = writeVertices( gridout );\n-426 writeElements( gridout, dgfIndices );\n-427 writeBoundaries( gridout, dgfIndices, std::forward< BoundaryData >\n-( boundaryData ) );\n-428 gridout << addParams.str();\n-429 writeFooter( gridout );\n-430 }\n-431\n-432} // namespace Dune\n-433\n-434#endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_DGFWRITER_HH\n-rangegenerators.hh\n-Dune::GridView::Grid\n-Traits::Grid Grid\n-type of the grid\n-Definition common/gridview.hh:83\n-Dune::GridView::IndexSet\n-Traits::IndexSet IndexSet\n-type of the index set\n-Definition common/gridview.hh:86\n-Dune::GridView::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/gridview.hh:134\n-Dune::GridView::Intersection\n-Traits::Intersection Intersection\n-type of the intersection\n-Definition common/gridview.hh:89\n+362#endif // #ifndef DUNE_ALBERTA_ENTITY_CC\n+ALBERTA\n+#define ALBERTA\n+Definition albertaheader.hh:29\n+Dune::PartitionType\n+PartitionType\n+Attributes used in the generic overlap model.\n+Definition gridenums.hh:30\n+Dune::InteriorEntity\n+@ InteriorEntity\n+all interior entities\n+Definition gridenums.hh:31\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::GridError\n-Base class for exceptions in Dune grid modules.\n-Definition exceptions.hh:20\n-Dune::IndexSet::IndexType\n-IndexTypeImp IndexType\n-The type used for the indices.\n-Definition common/indexidset.hh:92\n-Dune::GridView::Codim\n-A struct that collects all associated types of one implementation from the\n-Traits class.\n-Definition common/gridview.hh:104\n-Dune::DGFWriter\n-write a GridView to a DGF file\n-Definition dgfwriter.hh:46\n-Dune::DGFWriter::dimGrid\n-static const int dimGrid\n-dimension of the grid\n-Definition dgfwriter.hh:56\n-Dune::DGFWriter::DGFWriter\n-DGFWriter(const GridView &gridView)\n-constructor\n-Definition dgfwriter.hh:72\n-Dune::DGFWriter::write\n-void write(std::ostream &gridout, const std::stringstream &addParams=std::\n-stringstream()) const\n-write the GridView into a std::ostream\n-Definition dgfwriter.hh:119\n-Dune::DGFWriter::write\n-auto write(const std::string &fileName, Args &&... args) const -> std::void_t<\n-decltype(this->write(std::declval< std::ostream & >(), std::declval< Args >\n-()...)) >\n-write the GridView to a file\n-Definition dgfwriter.hh:131\n-Dune::DGFWriter::writeBoundaries\n-void writeBoundaries(std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, BoundaryData &&boundaryData) const\n-Definition dgfwriter.hh:369\n-Dune::DGFWriter::boundaryId\n-static int boundaryId(const Intersection &i)\n-Definition dgfwriter.hh:177\n-Dune::DGFWriter::write\n-void write(std::ostream &gridout, const std::vector< Index > &newElemOrder,\n-const std::stringstream &addParams=std::stringstream()) const\n-write the GridView into a std::ostream\n-Definition dgfwriter.hh:107\n-Dune::DGFWriter::write\n-void write(std::ostream &gridout, const std::vector< Index > &newElemOrder,\n-BoundaryData &&boundaryData, const std::stringstream &addParams=std::\n-stringstream()) const\n-write the GridView into a std::ostream\n-Definition dgfwriter.hh:409\n-Dune::DGFWriter::gridView_\n-GridView gridView_\n-Definition dgfwriter.hh:198\n-Dune::DGFWriter::writeElement\n-void writeElement(std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, const Element &element, const GeometryType &elementType) const\n-Definition dgfwriter.hh:277\n-Dune::DGFWriter::GridView\n-GV GridView\n-type of grid view\n-Definition dgfwriter.hh:51\n-Dune::DGFWriter::writeFooter\n-void writeFooter(std::ostream &gridout) const\n-Definition dgfwriter.hh:237\n-Dune::DGFWriter::Grid\n-GridView::Grid Grid\n-type of underlying hierarchical grid\n-Definition dgfwriter.hh:53\n-Dune::DGFWriter::writeVertices\n-auto writeVertices(std::ostream &gridout) const -> std::vector< Index >\n-Definition dgfwriter.hh:244\n-Dune::DGFWriter::writeElements\n-void writeElements(std::ostream &gridout, const std::vector< Index >\n-&dgfIndices, const Args &... args) const\n-Definition dgfwriter.hh:355\n-Dune::DGFWriter::writeBoundaries\n-void writeBoundaries(std::ostream &gridout, const std::vector< Index >\n-&dgfIndices) const\n-Definition dgfwriter.hh:192\n-Dune::DGFWriter::writeCubes\n-void writeCubes(std::ostream &gridout, const std::vector< Index > &dgfIndices)\n-const\n-Definition dgfwriter.hh:322\n-Dune::DGFWriter::writeSimplices\n-void writeSimplices(std::ostream &gridout, const std::vector< Index >\n-&dgfIndices) const\n-Definition dgfwriter.hh:292\n-Dune::DGFWriter::writeHeader\n-void writeHeader(std::ostream &gridout) const\n-Definition dgfwriter.hh:222\n-Dune::DGFWriter::elementsSeeds\n-auto elementsSeeds(const std::vector< Index > &newElemOrder) const -> std::\n-vector< ElementSeed >\n-Definition dgfwriter.hh:203\n-grid.hh\n-Different resources needed by all grid implementations.\n+Dune::Alberta::Element\n+ALBERTA EL Element\n+Definition misc.hh:54\n+Dune::Alberta::ElementInfo<_dimension_>\n+Dune::Alberta::ElementInfo::level\n+int level() const\n+Definition elementinfo.hh:533\n+Dune::Alberta::ElementInfo::mightVanish\n+bool mightVanish() const\n+Definition elementinfo.hh:526\n+Dune::Alberta::ElementInfo::father\n+ElementInfo father() const\n+Definition elementinfo.hh:449\n+Dune::Alberta::ElementInfo::type\n+int type() const\n+Definition elementinfo.hh:540\n+Dune::Alberta::ElementInfo::isBoundary\n+bool isBoundary(int face) const\n+Definition elementinfo.hh:620\n+Dune::Alberta::ElementInfo::indexInFather\n+int indexInFather() const\n+Definition elementinfo.hh:457\n+Dune::Alberta::ElementInfo::elInfo\n+ALBERTA EL_INFO & elInfo() const\n+Definition elementinfo.hh:744\n+Dune::AlbertaGridHierarchicIterator\n+Definition hierarchiciterator.hh:29\n+Dune::AlbertaGridLeafIntersectionIterator\n+Definition albertagrid/intersectioniterator.hh:27\n+Dune::AlbertaGridEntity\n+Definition albertagrid/entity.hh:46\n+Dune::AlbertaGridEntity::clearElement\n+void clearElement()\n+Definition entity.cc:70\n+Dune::AlbertaGridEntity::getElInfo\n+ALBERTA EL_INFO * getElInfo() const\n+needed for the LevelIterator and LeafIterator\n+Definition entity.cc:62\n+Dune::AlbertaGridEntity::level\n+int level() const\n+level of this element\n+Definition entity.cc:94\n+Dune::AlbertaGridEntity::setElement\n+void setElement(const ElementInfo &elementInfo, int subEntity)\n+Definition entity.cc:78\n+Dune::AlbertaGridEntity::partitionType\n+PartitionType partitionType() const\n+return partition type of this entity\n+Definition entity.cc:40\n+Dune::AlbertaGridEntity::Geometry\n+Grid::template Codim< codim >::Geometry Geometry\n+Definition albertagrid/entity.hh:69\n+Dune::AlbertaGridEntity::setEntity\n+void setEntity(const This &other)\n+Definition entity.cc:87\n+Dune::AlbertaGridEntity::elementInfo\n+const ElementInfo & elementInfo() const\n+Definition albertagrid/entity.hh:130\n+Dune::AlbertaGridEntity::geometry\n+Geometry geometry() const\n+geometry of this entity\n+Definition entity.cc:103\n+Dune::AlbertaGridEntity::dimension\n+static const int dimension\n+Definition albertagrid/entity.hh:57\n+Dune::AlbertaGridEntity::grid\n+const Grid & grid() const\n+obtain a reference to the grid\n+Definition albertagrid/entity.hh:142\n+Dune::AlbertaGridEntity::subEntity\n+int subEntity() const\n+obtain number of the subentity within the element (in ALBERTA numbering)\n+Definition albertagrid/entity.hh:148\n+Dune::AlbertaGridEntity::ElementInfo\n+Alberta::ElementInfo< dimension > ElementInfo\n+Definition albertagrid/entity.hh:71\n+Dune::AlbertaGridEntity::type\n+GeometryType type() const\n+type of geometry of this entity\n+Definition entity.cc:114\n+Dune::AlbertaGridEntity::equals\n+bool equals(const This &other) const\n+equality of entities\n+Definition entity.cc:48\n+Dune::AlbertaGridEntity::Codim\n+Definition albertagrid/entity.hh:63\n+Dune::AlbertaGridEntity<_0,_dim,_Grid_>\n+Definition albertagrid/entity.hh:185\n+Dune::AlbertaGridEntity<_0,_dim,_Grid_>::GeometryImpl\n+Grid::Traits::template Codim< 0 >::GeometryImpl GeometryImpl\n+Definition albertagrid/entity.hh:211\n+Dune::AlbertaGridEntity<_0,_dim,_Grid_>::elementInfo\n+const ElementInfo & elementInfo() const\n+Definition albertagrid/entity.hh:355\n+Dune::AlbertaGridEntity<_0,_dim,_Grid_>::LocalGeometry\n+Grid::template Codim< 0 >::LocalGeometry LocalGeometry\n+Definition albertagrid/entity.hh:210\n+Dune::AlbertaGridCoordinateReader\n+Definition albertagrid/geometry.hh:30\n+Dune::AlbertaGridLocalGeometryProvider\n+Definition albertagrid/geometry.hh:504\n+Dune::AlbertaGridLeafIntersectionIterator::Begin\n+Definition albertagrid/intersectioniterator.hh:35\n+Dune::AlbertaGridLeafIntersectionIterator::End\n+Definition albertagrid/intersectioniterator.hh:36\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00881_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00359_source.html", "comments": ["Files 86% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfgridfactory.hh Source File\n+dune-grid: mcmgmapper.hh Source File\n \n \n \n \n \n \n \n@@ -70,271 +70,310 @@\n
    \n
    \n
    \n
    \n \n \n
    \n
    \n-
    dgfgridfactory.hh
    \n+
    mcmgmapper.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_GRIDFACTORY_HH
    \n-
    6#define DUNE_DGF_GRIDFACTORY_HH
    \n-
    7
    \n-
    8#include <iostream>
    \n-
    9#include <string>
    \n-
    10#include <vector>
    \n-
    11#include <map>
    \n-
    12#include <assert.h>
    \n-
    13
    \n-
    14#include <dune/common/parallel/mpihelper.hh>
    \n-\n-\n-
    17
    \n-\n-\n+
    5
    \n+
    6#ifndef DUNE_GRID_COMMON_MCMGMAPPER_HH
    \n+
    7#define DUNE_GRID_COMMON_MCMGMAPPER_HH
    \n+
    8
    \n+
    9#include <functional>
    \n+
    10#include <iostream>
    \n+
    11
    \n+
    12#include <dune/common/exceptions.hh>
    \n+
    13#include <dune/common/rangeutilities.hh>
    \n+
    14#include <dune/geometry/dimension.hh>
    \n+
    15#include <dune/geometry/referenceelements.hh>
    \n+
    16#include <dune/geometry/type.hh>
    \n+
    17#include <dune/geometry/typeindex.hh>
    \n+
    18
    \n+
    19#include "mapper.hh"
    \n
    20
    \n-
    21
    \n-
    22namespace Dune
    \n-
    23{
    \n-
    24
    \n-
    25 // External Forward Declarations
    \n-
    26 // -----------------------------
    \n-
    27
    \n-
    28 template < class GridImp, class IntersectionImp >
    \n-
    29 class Intersection;
    \n-
    30
    \n-
    31
    \n-
    32
    \n-
    33 // DGFGridFactory
    \n-
    34 // --------------
    \n-
    35
    \n-
    36 template < class G >
    \n-
    \n-\n-
    38 {
    \n-
    39 typedef G Grid;
    \n-
    40 const static int dimension = Grid::dimension;
    \n-
    41 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    42
    \n-
    43 private:
    \n-
    44 typedef typename Grid::template Codim< 0 >::Entity Element;
    \n-
    45
    \n-
    46 typedef typename Grid::template Codim< dimension >::Entity Vertex;
    \n-
    47
    \n-
    48 public:
    \n-
    49
    \n-
    \n-
    50 explicit DGFGridFactory ( const std::string &filename,
    \n-
    51 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    52 : macroGrid_( filename.c_str(), comm )
    \n-
    53 {
    \n-
    54 grid_ = macroGrid_.template createGrid< Grid >();
    \n-
    55
    \n-
    56 if( macroGrid_.nofelparams > 0 )
    \n-
    57 {
    \n-
    58 const size_t nofElements = macroGrid_.elements.size();
    \n-
    59 for( size_t i = 0; i < nofElements; ++i )
    \n-
    60 {
    \n-
    61 std::vector< double > coord;
    \n-
    62
    \n-
    63 DomainType p(0);
    \n-
    64 const size_t nofCorners = macroGrid_.elements[i].size();
    \n-
    65 for (size_t k=0; k<nofCorners; ++k)
    \n-
    66 for (int j=0; j<DomainType::dimension; ++j)
    \n-
    67 p[j]+=macroGrid_.vtx[macroGrid_.elements[i][k]][j];
    \n-
    68 p/=double(nofCorners);
    \n-
    69
    \n-
    70 elInsertOrder_.insert( std::make_pair( p, i ) );
    \n-
    71 }
    \n-
    72 }
    \n-
    73
    \n-
    74 if( macroGrid_.nofvtxparams > 0 )
    \n-
    75 {
    \n-
    76 const size_t nofVertices = macroGrid_.vtx.size();
    \n-
    77 for( size_t i = 0; i < nofVertices; ++i )
    \n-
    78 {
    \n-
    79 std::vector< double > coord;
    \n-
    80
    \n-
    81 DomainType p;
    \n-
    82 for( int k = 0; k < DomainType::dimension; ++k )
    \n-
    83 p[ k ] = macroGrid_.vtx[i][k];
    \n-
    84
    \n-
    85 vtxInsertOrder_.insert( std::make_pair( p, i ) );
    \n-
    86 }
    \n-
    87 }
    \n-
    88 }
    \n-
    \n-
    89
    \n-
    \n-\n-
    91 {
    \n-
    92 return grid_;
    \n-
    93 }
    \n-
    \n-
    94
    \n-
    95 template <class Intersection>
    \n-
    \n-
    96 bool wasInserted(const Intersection &intersection) const
    \n-
    97 {
    \n-
    98 return intersection.boundary();
    \n-
    99 }
    \n-
    \n-
    100
    \n-
    101 template <class Intersection>
    \n-
    \n-
    102 int boundaryId(const Intersection &intersection) const
    \n-
    103 {
    \n-
    104 return (intersection.boundary()) ? int(intersection.indexInInside()+1) : int(0);
    \n-
    105 }
    \n-
    \n-
    106
    \n-
    107 template< int codim >
    \n-
    \n-
    108 int numParameters () const
    \n-
    109 {
    \n-
    110 if( codim == 0 )
    \n-
    111 return macroGrid_.nofelparams;
    \n-
    112 else if( codim == dimension )
    \n-
    113 return macroGrid_.nofvtxparams;
    \n-
    114 else
    \n-
    115 return 0;
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    118 template < class Entity >
    \n-
    \n-
    119 int numParameters ( const Entity & ) const
    \n-
    120 {
    \n-
    121 return numParameters< Entity::codimension >();
    \n-
    122 }
    \n-
    \n-
    123
    \n-
    \n-
    124 std::vector<double>& parameter(const Element &element)
    \n-
    125 {
    \n-
    126 const typename Element::Geometry &geo = element.geometry();
    \n-
    127 DomainType coord( geo.corner( 0 ) );
    \n-
    128 for( int i = 1; i < geo.corners(); ++i )
    \n-
    129 coord += geo.corner( i );
    \n-
    130 coord /= double( geo.corners() );
    \n+
    27namespace Dune
    \n+
    28{
    \n+
    36 //
    \n+
    37 // Common Layout templates
    \n+
    38 //
    \n+
    39
    \n+
    64 using MCMGLayout = std::function<size_t(GeometryType, int)>;
    \n+
    65
    \n+
    71 template<int codim>
    \n+
    \n+
    72 MCMGLayout mcmgLayout(Codim<codim>)
    \n+
    73 {
    \n+
    74 return [](GeometryType gt, int dimgrid) {
    \n+
    75 return dimgrid - gt.dim() == codim;
    \n+
    76 };
    \n+
    77 }
    \n+
    \n+
    78
    \n+
    84 template<int dim>
    \n+
    \n+\n+
    86 {
    \n+
    87 return [](GeometryType gt, int) {
    \n+
    88 return gt.dim() == dim;
    \n+
    89 };
    \n+
    90 }
    \n+
    \n+
    91
    \n+
    \n+\n+
    98 {
    \n+
    99 return mcmgLayout(Codim<0>());
    \n+
    100 }
    \n+
    \n+
    101
    \n+
    \n+\n+
    108 {
    \n+
    109 return mcmgLayout(Dim<0>());
    \n+
    110 }
    \n+
    \n+
    111
    \n+
    113 //
    \n+
    114 // MultipleCodimMultipleGeomTypeMapper
    \n+
    115 //
    \n+
    116
    \n+
    126 template <typename GV>
    \n+
    \n+\n+
    128 public Mapper<typename GV::Grid,MultipleCodimMultipleGeomTypeMapper<GV>, typename GV::IndexSet::IndexType >
    \n+
    129 {
    \n+
    130 public:
    \n
    131
    \n-
    132 InsertOrderIterator it = elInsertOrder_.find( coord );
    \n-
    133 if( it != elInsertOrder_.end() )
    \n-
    134 return macroGrid_.elParams[ it->second ];
    \n-
    135 assert(0);
    \n-
    136 return emptyParam;
    \n-
    137 }
    \n-
    \n-
    138
    \n-
    \n-
    139 std::vector<double>& parameter(const Vertex &vertex)
    \n-
    140 {
    \n-
    141 const typename Vertex::Geometry &geo = vertex.geometry();
    \n-
    142 DomainType coord( geo.corner( 0 ) );
    \n+
    133 typedef GV GridView;
    \n+
    134
    \n+
    136 typedef typename GV::IndexSet::IndexType Index;
    \n+
    137
    \n+
    142 using size_type = decltype(std::declval<typename GV::IndexSet>().size(0));
    \n
    143
    \n-
    144 InsertOrderIterator it = vtxInsertOrder_.find( coord );
    \n-
    145 if( it != vtxInsertOrder_.end() )
    \n-
    146 return macroGrid_.vtxParams[ it->second ];
    \n-
    147 return emptyParam;
    \n-
    148 }
    \n-
    \n-
    149
    \n-
    150 // return true if boundary parameters found
    \n-
    \n-\n-
    152 {
    \n-
    153 return false;
    \n-
    154 }
    \n-
    \n-
    155
    \n-
    156 template< class GG, class II >
    \n-
    157 const typename DGFBoundaryParameter::type &
    \n-
    \n-
    158 boundaryParameter ( const Intersection< GG, II > & intersection ) const
    \n-
    159 {
    \n-\n+
    \n+\n+
    156 : gridView_(gridView)
    \n+
    157 , indexSet_(&gridView_.indexSet())
    \n+
    158 , layout_(layout)
    \n+
    159 {
    \n+\n
    161 }
    \n
    \n
    162
    \n-
    163 private:
    \n-
    164 typedef FieldVector<typename Grid::ctype,Grid::dimensionworld> DomainType;
    \n-
    165 struct Compare
    \n-
    166 {
    \n-
    167 bool operator() ( const DomainType &a, const DomainType &b ) const
    \n-
    168 {
    \n-
    169 // returns true, if a < b; c[i] < -eps;
    \n-
    170 const DomainType c = a - b;
    \n-
    171 const double eps = 1e-8;
    \n-
    172
    \n-
    173 for( int i = 0; i < DomainType::dimension; ++i )
    \n-
    174 {
    \n-
    175 if( c[ i ] <= -eps )
    \n-
    176 return true;
    \n-
    177 if( c[ i ] >= eps )
    \n-
    178 return false;
    \n-
    179 }
    \n-
    180 return false;
    \n-
    181 }
    \n-
    182 };
    \n-
    183 typedef std::map< DomainType, size_t, Compare > InsertOrderMap;
    \n-
    184 typedef typename InsertOrderMap::const_iterator InsertOrderIterator;
    \n-
    185
    \n-
    186 MacroGrid macroGrid_;
    \n-
    187 Grid *grid_;
    \n-
    188 InsertOrderMap elInsertOrder_;
    \n-
    189 InsertOrderMap vtxInsertOrder_;
    \n-
    190 std::vector<double> emptyParam;
    \n-
    191 };
    \n-
    \n-
    192
    \n-
    193} // end namespace Dune
    \n-
    194
    \n-
    195#endif
    \n-\n-\n-\n+
    170 template<class EntityType>
    \n+
    \n+
    171 Index index (const EntityType& e) const
    \n+
    172 {
    \n+
    173 const GeometryType gt = e.type();
    \n+
    174 assert(offset(gt) != invalidOffset);
    \n+
    175 return indexSet_->index(e)*blockSize(gt) + offset(gt);
    \n+
    176 }
    \n+
    \n+
    177
    \n+
    \n+
    185 Index subIndex (const typename GV::template Codim<0>::Entity& e, int i, unsigned int codim) const
    \n+
    186 {
    \n+
    187 const GeometryType eType = e.type();
    \n+
    188 GeometryType gt = eType.isNone() ?
    \n+
    189 GeometryTypes::none( GV::dimension - codim ) :
    \n+
    190 ReferenceElements<double,GV::dimension>::general(eType).type(i,codim) ;
    \n+
    191 //GeometryType gt=ReferenceElements<double,GV::dimension>::general(e.type()).type(i,codim);
    \n+
    192 assert(offset(gt) != invalidOffset);
    \n+
    193 return indexSet_->subIndex(e, i, codim)*blockSize(gt) + offset(gt);
    \n+
    194 }
    \n+
    \n+
    195
    \n+
    \n+\n+
    205 {
    \n+
    206 return n;
    \n+
    207 }
    \n+
    \n+
    208
    \n+
    \n+
    210 size_type size(GeometryType gt) const
    \n+
    211 {
    \n+
    212 return blockSize(gt);
    \n+
    213 }
    \n+
    \n+
    214
    \n+
    \n+
    216 const std::vector< GeometryType >& types ( int codim ) const
    \n+
    217 {
    \n+
    218 return myTypes_[ codim ];
    \n+
    219 }
    \n+
    \n+
    220
    \n+
    230 template<class EntityType>
    \n+
    \n+
    231 IntegralRange<Index> indices (const EntityType& e) const
    \n+
    232 {
    \n+
    233 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)
    \n+
    234 return {0,0};
    \n+
    235 Index start = index(e);
    \n+
    236 return {start, start+blockSize(e.type())};
    \n+
    237 }
    \n+
    \n+
    238
    \n+
    \n+
    250 IntegralRange<Index> indices (const typename GV::template Codim<0>::Entity& e, int i, int cc) const
    \n+
    251 {
    \n+
    252 const GeometryType eType = e.type();
    \n+
    253 const GeometryType gt = eType.isNone() ?
    \n+
    254 GeometryTypes::none(GV::dimension - cc) :
    \n+
    255 ReferenceElements<double,GV::dimension>::general(eType).type(i,cc) ;
    \n+
    256 if (offset(gt) == invalidOffset)
    \n+
    257 return {0,0};
    \n+
    258 else
    \n+
    259 {
    \n+
    260 Index start = subIndex(e,i,cc);
    \n+
    261 return {start, start+blockSize(gt)};
    \n+
    262 }
    \n+
    263 }
    \n+
    \n+
    264
    \n+
    271 template<class EntityType>
    \n+
    \n+
    272 bool contains (const EntityType& e, Index& result) const
    \n+
    273 {
    \n+
    274 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)
    \n+
    275 {
    \n+
    276 result = 0;
    \n+
    277 return false;
    \n+
    278 }
    \n+
    279 result = index(e);
    \n+
    280 return true;
    \n+
    281 }
    \n+
    \n+
    282
    \n+
    \n+
    291 bool contains (const typename GV::template Codim<0>::Entity& e, int i, int cc, Index& result) const
    \n+
    292 {
    \n+
    293 const GeometryType eType = e.type();
    \n+
    294 const GeometryType gt = eType.isNone() ?
    \n+
    295 GeometryTypes::none( GV::dimension - cc ) :
    \n+
    296 ReferenceElements<double,GV::dimension>::general(eType).type(i,cc) ;
    \n+
    297 if (offset(gt) == invalidOffset)
    \n+
    298 return false;
    \n+
    299 result = indexSet_->subIndex(e, i, cc)*blockSize(gt) + offset(gt);
    \n+
    300 return true;
    \n+
    301 }
    \n+
    \n+
    302
    \n+
    \n+
    308 void update (const GV& gridView)
    \n+
    309 {
    \n+
    310 gridView_ = gridView;
    \n+
    311 indexSet_ = &gridView_.indexSet();
    \n+
    312 update_();
    \n+
    313 }
    \n+
    \n+
    314
    \n+
    \n+
    320 void update (GV&& gridView)
    \n+
    321 {
    \n+
    322 gridView_ = std::move(gridView);
    \n+
    323 indexSet_ = &gridView_.indexSet();
    \n+
    324 update_();
    \n+
    325 }
    \n+
    \n+
    326
    \n+
    327 const MCMGLayout &layout () const { return layout_; }
    \n+
    328 const GridView &gridView () const { return gridView_; }
    \n+
    329
    \n+
    330 private:
    \n+
    331 void update_()
    \n+
    332 {
    \n+
    333 n = 0;
    \n+
    334
    \n+
    335 std::fill(offsets.begin(),offsets.end(),Index(0));
    \n+
    336 std::fill(blocks.begin(),blocks.end(),Index(0));
    \n+
    337
    \n+
    338 for (unsigned int codim = 0; codim <= GV::dimension; ++codim)
    \n+
    339 {
    \n+
    340 // walk over all geometry types in the codimension
    \n+
    341 for (const GeometryType& gt : indexSet_->types(codim)) {
    \n+
    342 Index offset;
    \n+
    343 size_t block = layout()(gt, GV::Grid::dimension);
    \n+
    344
    \n+
    345 // if the geometry type is contained in the layout, increment offset
    \n+
    346 // and store geometry type
    \n+
    347 if (block) {
    \n+
    348 offset = n;
    \n+
    349 n += indexSet_->size(gt) * block;
    \n+
    350 myTypes_[codim].push_back(gt);
    \n+
    351 }
    \n+
    352 else {
    \n+
    353 offset = invalidOffset;
    \n+
    354 }
    \n+
    355
    \n+
    356 offsets[GlobalGeometryTypeIndex::index(gt)] = offset;
    \n+
    357 blocks[GlobalGeometryTypeIndex::index(gt)] = block;
    \n+
    358 }
    \n+
    359 }
    \n+
    360 }
    \n+
    361
    \n+
    362 Index offset(GeometryType gt) const
    \n+
    363 { return offsets[GlobalGeometryTypeIndex::index(gt)]; }
    \n+
    364 Index blockSize(GeometryType gt) const
    \n+
    365 { return blocks[GlobalGeometryTypeIndex::index(gt)]; }
    \n+
    366
    \n+
    367 static const Index invalidOffset = std::numeric_limits<Index>::max();
    \n+
    368
    \n+
    369 // number of data elements required
    \n+
    370 unsigned int n;
    \n+
    371 // GridView is needed to keep the IndexSet valid
    \n+
    372 GV gridView_;
    \n+
    373 const typename GV::IndexSet* indexSet_;
    \n+
    374 // provide an array for the offsets
    \n+
    375 std::array<Index, GlobalGeometryTypeIndex::size(GV::dimension)> offsets;
    \n+
    376 std::array<Index, GlobalGeometryTypeIndex::size(GV::dimension)> blocks;
    \n+
    377 MCMGLayout layout_; // get layout object
    \n+
    378 std::vector<GeometryType> myTypes_[GV::dimension+1];
    \n+
    379 };
    \n+
    \n+
    380
    \n+
    382}
    \n+
    383#endif
    \n+
    Provides classes with basic mappers which are used to attach data to a grid.
    \n+
    MCMGLayout mcmgLayout(Codim< codim >)
    layout for entities of codimension codim
    Definition mcmgmapper.hh:72
    \n+
    MCMGLayout mcmgElementLayout()
    layout for elements (codim-0 entities)
    Definition mcmgmapper.hh:97
    \n+
    std::function< size_t(GeometryType, int)> MCMGLayout
    layout function for MultipleCodimMultipleGeomTypeMapper
    Definition mcmgmapper.hh:64
    \n+
    MCMGLayout mcmgVertexLayout()
    layout for vertices (dim-0 entities)
    Definition mcmgmapper.hh:107
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    int numParameters() const
    Definition dgfgridfactory.hh:108
    \n-
    int boundaryId(const Intersection &intersection) const
    Definition dgfgridfactory.hh:102
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfgridfactory.hh:158
    \n-
    std::vector< double > & parameter(const Vertex &vertex)
    Definition dgfgridfactory.hh:139
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n-
    int numParameters(const Entity &) const
    Definition dgfgridfactory.hh:119
    \n-
    bool wasInserted(const Intersection &intersection) const
    Definition dgfgridfactory.hh:96
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfgridfactory.hh:50
    \n-
    G Grid
    Definition dgfgridfactory.hh:39
    \n-
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n-
    Grid * grid()
    Definition dgfgridfactory.hh:90
    \n-
    std::vector< double > & parameter(const Element &element)
    Definition dgfgridfactory.hh:124
    \n-
    bool haveBoundaryParameters() const
    Definition dgfgridfactory.hh:151
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    bool boundary() const
    Return true if intersection is with interior or exterior boundary (see the cases above)
    Definition common/intersection.hh:216
    \n-
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n-
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-
    int nofvtxparams
    Definition parser.hh:163
    \n-
    std::vector< std::vector< double > > vtxParams
    Definition parser.hh:165
    \n-
    int nofelparams
    Definition parser.hh:163
    \n-
    std::vector< std::vector< double > > elParams
    Definition parser.hh:165
    \n-
    std::vector< std::vector< double > > vtx
    Definition parser.hh:125
    \n-
    std ::vector< std ::vector< unsigned int > > elements
    Definition parser.hh:134
    \n-\n+
    Mapper interface.
    Definition mapper.hh:110
    \n+
    Implementation class for a multiple codim and multiple geometry type mapper.
    Definition mcmgmapper.hh:129
    \n+
    bool contains(const EntityType &e, Index &result) const
    Returns true if the entity is contained in the index set.
    Definition mcmgmapper.hh:272
    \n+
    size_type size() const
    Return total number of entities in the entity set managed by the mapper.
    Definition mcmgmapper.hh:204
    \n+
    Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
    Map subentity of codim 0 entity to starting index in array for dof block.
    Definition mcmgmapper.hh:185
    \n+
    MultipleCodimMultipleGeomTypeMapper(const GV &gridView, const MCMGLayout &layout)
    construct mapper from grid and layout description
    Definition mcmgmapper.hh:155
    \n+
    bool contains(const typename GV::template Codim< 0 >::Entity &e, int i, int cc, Index &result) const
    Returns true if the entity is contained in the index set.
    Definition mcmgmapper.hh:291
    \n+
    IntegralRange< Index > indices(const EntityType &e) const
    Returns a pair with the starting point in the dof vector and the number of degrees of freedom if the ...
    Definition mcmgmapper.hh:231
    \n+
    decltype(std::declval< typename GV::IndexSet >().size(0)) size_type
    Number type used for the overall size (the return value of the 'size' method)
    Definition mcmgmapper.hh:142
    \n+
    Index index(const EntityType &e) const
    Map entity to starting index in array for dof block.
    Definition mcmgmapper.hh:171
    \n+
    const GridView & gridView() const
    Definition mcmgmapper.hh:328
    \n+
    void update(const GV &gridView)
    Recalculates indices after grid adaptation.
    Definition mcmgmapper.hh:308
    \n+
    GV::IndexSet::IndexType Index
    Number type used for indices.
    Definition mcmgmapper.hh:136
    \n+
    size_type size(GeometryType gt) const
    return number of entries for a given geometry type
    Definition mcmgmapper.hh:210
    \n+
    const MCMGLayout & layout() const
    Definition mcmgmapper.hh:327
    \n+
    IntegralRange< Index > indices(const typename GV::template Codim< 0 >::Entity &e, int i, int cc) const
    Returns a pair with the starting point in the dof vector and the number of degrees of freedom if the ...
    Definition mcmgmapper.hh:250
    \n+
    GV GridView
    Underlying GridView.
    Definition mcmgmapper.hh:133
    \n+
    const std::vector< GeometryType > & types(int codim) const
    return the geometry types with entries
    Definition mcmgmapper.hh:216
    \n+
    void update(GV &&gridView)
    Recalculates indices after grid adaptation.
    Definition mcmgmapper.hh:320
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,310 +1,347 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * dgfparser\n-dgfgridfactory.hh\n+ * common\n+mcmgmapper.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_GRIDFACTORY_HH\n-6#define DUNE_DGF_GRIDFACTORY_HH\n-7\n-8#include \n-9#include \n-10#include \n-11#include \n-12#include \n-13\n-14#include \n-15#include \n-16#include \n-17\n-18#include \n-19#include \n+5\n+6#ifndef DUNE_GRID_COMMON_MCMGMAPPER_HH\n+7#define DUNE_GRID_COMMON_MCMGMAPPER_HH\n+8\n+9#include \n+10#include \n+11\n+12#include \n+13#include \n+14#include \n+15#include \n+16#include \n+17#include \n+18\n+19#include \"mapper.hh\"\n 20\n-21\n-22namespace Dune\n-23{\n-24\n-25 // External Forward Declarations\n-26 // -----------------------------\n-27\n-28 template < class GridImp, class IntersectionImp >\n-29 class Intersection;\n-30\n-31\n-32\n-33 // DGFGridFactory\n-34 // --------------\n-35\n-36 template < class G >\n-37 struct DGFGridFactory\n-38 {\n-39 typedef G Grid;\n-40 const static int dimension = Grid::dimension;\n-41 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-42\n-43 private:\n-44 typedef typename Grid::template Codim< 0 >::Entity Element;\n-45\n-46 typedef typename Grid::template Codim< dimension >::Entity Vertex;\n-47\n-48 public:\n-49\n-50 explicit DGFGridFactory ( const std::string &filename,\n-51 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-52 : macroGrid_( filename.c_str(), comm )\n-53 {\n-54 grid_ = macroGrid_.template createGrid< Grid >();\n-55\n-56 if( macroGrid_.nofelparams > 0 )\n-57 {\n-58 const size_t nofElements = macroGrid_.elements.size();\n-59 for( size_t i = 0; i < nofElements; ++i )\n-60 {\n-61 std::vector< double > coord;\n-62\n-63 DomainType p(0);\n-64 const size_t nofCorners = macroGrid_.elements[i].size();\n-65 for (size_t k=0; k 0 )\n-75 {\n-76 const size_t nofVertices = macroGrid_.vtx.size();\n-77 for( size_t i = 0; i < nofVertices; ++i )\n-78 {\n-79 std::vector< double > coord;\n-80\n-81 DomainType p;\n-82 for( int k = 0; k < DomainType::dimension; ++k )\n-83 p[ k ] = macroGrid_.vtx[i][k];\n-84\n-85 vtxInsertOrder_.insert( std::make_pair( p, i ) );\n-86 }\n-87 }\n-88 }\n-89\n-90 Grid *grid()\n-91 {\n-92 return grid_;\n-93 }\n-94\n-95 template \n-96 bool wasInserted(const Intersection &intersection) const\n-97 {\n-98 return intersection.boundary();\n-99 }\n-100\n-101 template \n-102 int boundaryId(const Intersection &intersection) const\n-103 {\n-104 return (intersection.boundary()) ? int(intersection.indexInInside()+1) :\n-int(0);\n-105 }\n-106\n-107 template< int codim >\n-108 int numParameters () const\n-109 {\n-110 if( codim == 0 )\n-111 return macroGrid_.nofelparams;\n-112 else if( codim == dimension )\n-113 return macroGrid_.nofvtxparams;\n-114 else\n-115 return 0;\n-116 }\n-117\n-118 template < class Entity >\n-119 int numParameters ( const Entity & ) const\n-120 {\n-121 return numParameters< Entity::codimension >();\n-122 }\n-123\n-124 std::vector& parameter(const Element &element)\n-125 {\n-126 const typename Element::Geometry &geo = element.geometry();\n-127 DomainType coord( geo.corner( 0 ) );\n-128 for( int i = 1; i < geo.corners(); ++i )\n-129 coord += geo.corner( i );\n-130 coord /= double( geo.corners() );\n+27namespace Dune\n+28{\n+36 //\n+37 // Common Layout templates\n+38 //\n+39\n+64 using MCMGLayout = std::function;\n+65\n+71 template\n+72 MCMGLayout mcmgLayout(Codim)\n+73 {\n+74 return [](GeometryType gt, int dimgrid) {\n+75 return dimgrid - gt.dim() == codim;\n+76 };\n+77 }\n+78\n+84 template\n+85 MCMGLayout mcmgLayout(Dim)\n+86 {\n+87 return [](GeometryType gt, int) {\n+88 return gt.dim() == dim;\n+89 };\n+90 }\n+91\n+97 inline MCMGLayout mcmgElementLayout()\n+98 {\n+99 return mcmgLayout(Codim<0>());\n+100 }\n+101\n+107 inline MCMGLayout mcmgVertexLayout()\n+108 {\n+109 return mcmgLayout(Dim<0>());\n+110 }\n+111\n+113 //\n+114 // MultipleCodimMultipleGeomTypeMapper\n+115 //\n+116\n+126 template \n+127 class MultipleCodimMultipleGeomTypeMapper :\n+128 public Mapper,\n+typename GV::IndexSet::IndexType >\n+129 {\n+130 public:\n 131\n-132 InsertOrderIterator it = elInsertOrder_.find( coord );\n-133 if( it != elInsertOrder_.end() )\n-134 return macroGrid_.elParams[ it->second ];\n-135 assert(0);\n-136 return emptyParam;\n-137 }\n-138\n-139 std::vector& parameter(const Vertex &vertex)\n-140 {\n-141 const typename Vertex::Geometry &geo = vertex.geometry();\n-142 DomainType coord( geo.corner( 0 ) );\n+133 typedef GV GridView;\n+134\n+136 typedef typename GV::IndexSet::IndexType Index;\n+137\n+142 using size_type = decltype(std::declval().size(0));\n 143\n-144 InsertOrderIterator it = vtxInsertOrder_.find( coord );\n-145 if( it != vtxInsertOrder_.end() )\n-146 return macroGrid_.vtxParams[ it->second ];\n-147 return emptyParam;\n-148 }\n-149\n-150 // return true if boundary parameters found\n-151 bool haveBoundaryParameters () const\n-152 {\n-153 return false;\n-154 }\n-155\n-156 template< class GG, class II >\n-157 const typename DGFBoundaryParameter::type &\n-158 boundaryParameter ( const Intersection<_GG,_II_> & intersection ) const\n+155 MultipleCodimMultipleGeomTypeMapper(const GV& gridView, const MCMGLayout&\n+layout)\n+156 : gridView_(gridView)\n+157 , indexSet_(&gridView_.indexSet())\n+158 , layout_(layout)\n 159 {\n-160 return DGFBoundaryParameter::defaultValue();\n+160 update(gridView);\n 161 }\n 162\n-163 private:\n-164 typedef FieldVector DomainType;\n-165 struct Compare\n-166 {\n-167 bool operator() ( const DomainType &a, const DomainType &b ) const\n-168 {\n-169 // returns true, if a < b; c[i] < -eps;\n-170 const DomainType c = a - b;\n-171 const double eps = 1e-8;\n-172\n-173 for( int i = 0; i < DomainType::dimension; ++i )\n-174 {\n-175 if( c[ i ] <= -eps )\n-176 return true;\n-177 if( c[ i ] >= eps )\n-178 return false;\n-179 }\n-180 return false;\n-181 }\n-182 };\n-183 typedef std::map< DomainType, size_t, Compare > InsertOrderMap;\n-184 typedef typename InsertOrderMap::const_iterator InsertOrderIterator;\n-185\n-186 MacroGrid macroGrid_;\n-187 Grid *grid_;\n-188 InsertOrderMap elInsertOrder_;\n-189 InsertOrderMap vtxInsertOrder_;\n-190 std::vector emptyParam;\n-191 };\n-192\n-193} // end namespace Dune\n-194\n-195#endif\n-parser.hh\n-macrogrid.hh\n-dgfexception.hh\n+170 template\n+171 Index index (const EntityType& e) const\n+172 {\n+173 const GeometryType gt = e.type();\n+174 assert(offset(gt) != invalidOffset);\n+175 return indexSet_->index(e)*blockSize(gt) + offset(gt);\n+176 }\n+177\n+185 Index subIndex (const typename GV::template Codim<0>::Entity& e, int i,\n+unsigned int codim) const\n+186 {\n+187 const GeometryType eType = e.type();\n+188 GeometryType gt = eType.isNone() ?\n+189 GeometryTypes::none( GV::dimension - codim ) :\n+190 ReferenceElements::general(eType).type(i,codim) ;\n+191 //GeometryType gt=ReferenceElements::general(e.type\n+()).type(i,codim);\n+192 assert(offset(gt) != invalidOffset);\n+193 return indexSet_->subIndex(e, i, codim)*blockSize(gt) + offset(gt);\n+194 }\n+195\n+204 size_type size () const\n+205 {\n+206 return n;\n+207 }\n+208\n+210 size_type size(GeometryType gt) const\n+211 {\n+212 return blockSize(gt);\n+213 }\n+214\n+216 const std::vector< GeometryType >& types ( int codim ) const\n+217 {\n+218 return myTypes_[ codim ];\n+219 }\n+220\n+230 template\n+231 IntegralRange indices (const EntityType& e) const\n+232 {\n+233 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)\n+234 return {0,0};\n+235 Index start = index(e);\n+236 return {start, start+blockSize(e.type())};\n+237 }\n+238\n+250 IntegralRange indices (const typename GV::template Codim<0>::Entity&\n+e, int i, int cc) const\n+251 {\n+252 const GeometryType eType = e.type();\n+253 const GeometryType gt = eType.isNone() ?\n+254 GeometryTypes::none(GV::dimension - cc) :\n+255 ReferenceElements::general(eType).type(i,cc) ;\n+256 if (offset(gt) == invalidOffset)\n+257 return {0,0};\n+258 else\n+259 {\n+260 Index start = subIndex(e,i,cc);\n+261 return {start, start+blockSize(gt)};\n+262 }\n+263 }\n+264\n+271 template\n+272 bool contains (const EntityType& e, Index& result) const\n+273 {\n+274 if(!indexSet_->contains(e) || offset(e.type()) == invalidOffset)\n+275 {\n+276 result = 0;\n+277 return false;\n+278 }\n+279 result = index(e);\n+280 return true;\n+281 }\n+282\n+291 bool contains (const typename GV::template Codim<0>::Entity& e, int i, int\n+cc, Index& result) const\n+292 {\n+293 const GeometryType eType = e.type();\n+294 const GeometryType gt = eType.isNone() ?\n+295 GeometryTypes::none( GV::dimension - cc ) :\n+296 ReferenceElements::general(eType).type(i,cc) ;\n+297 if (offset(gt) == invalidOffset)\n+298 return false;\n+299 result = indexSet_->subIndex(e, i, cc)*blockSize(gt) + offset(gt);\n+300 return true;\n+301 }\n+302\n+308 void update (const GV& gridView)\n+309 {\n+310 gridView_ = gridView;\n+311 indexSet_ = &gridView_.indexSet();\n+312 update_();\n+313 }\n+314\n+320 void update (GV&& gridView)\n+321 {\n+322 gridView_ = std::move(gridView);\n+323 indexSet_ = &gridView_.indexSet();\n+324 update_();\n+325 }\n+326\n+327 const MCMGLayout &layout () const { return layout_; }\n+328 const GridView &gridView () const { return gridView_; }\n+329\n+330 private:\n+331 void update_()\n+332 {\n+333 n = 0;\n+334\n+335 std::fill(offsets.begin(),offsets.end(),Index(0));\n+336 std::fill(blocks.begin(),blocks.end(),Index(0));\n+337\n+338 for (unsigned int codim = 0; codim <= GV::dimension; ++codim)\n+339 {\n+340 // walk over all geometry types in the codimension\n+341 for (const GeometryType& gt : indexSet_->types(codim)) {\n+342 Index offset;\n+343 size_t block = layout()(gt, GV::Grid::dimension);\n+344\n+345 // if the geometry type is contained in the layout, increment offset\n+346 // and store geometry type\n+347 if (block) {\n+348 offset = n;\n+349 n += indexSet_->size(gt) * block;\n+350 myTypes_[codim].push_back(gt);\n+351 }\n+352 else {\n+353 offset = invalidOffset;\n+354 }\n+355\n+356 offsets[GlobalGeometryTypeIndex::index(gt)] = offset;\n+357 blocks[GlobalGeometryTypeIndex::index(gt)] = block;\n+358 }\n+359 }\n+360 }\n+361\n+362 Index offset(GeometryType gt) const\n+363 { return offsets[GlobalGeometryTypeIndex::index(gt)]; }\n+364 Index blockSize(GeometryType gt) const\n+365 { return blocks[GlobalGeometryTypeIndex::index(gt)]; }\n+366\n+367 static const Index invalidOffset = std::numeric_limits::max();\n+368\n+369 // number of data elements required\n+370 unsigned int n;\n+371 // GridView is needed to keep the IndexSet valid\n+372 GV gridView_;\n+373 const typename GV::IndexSet* indexSet_;\n+374 // provide an array for the offsets\n+375 std::array offsets;\n+376 std::array blocks;\n+377 MCMGLayout layout_; // get layout object\n+378 std::vector myTypes_[GV::dimension+1];\n+379 };\n+380\n+382}\n+383#endif\n+mapper.hh\n+Provides classes with basic mappers which are used to attach data to a grid.\n+Dune::mcmgLayout\n+MCMGLayout mcmgLayout(Codim< codim >)\n+layout for entities of codimension codim\n+Definition mcmgmapper.hh:72\n+Dune::mcmgElementLayout\n+MCMGLayout mcmgElementLayout()\n+layout for elements (codim-0 entities)\n+Definition mcmgmapper.hh:97\n+Dune::MCMGLayout\n+std::function< size_t(GeometryType, int)> MCMGLayout\n+layout function for MultipleCodimMultipleGeomTypeMapper\n+Definition mcmgmapper.hh:64\n+Dune::mcmgVertexLayout\n+MCMGLayout mcmgVertexLayout()\n+layout for vertices (dim-0 entities)\n+Definition mcmgmapper.hh:107\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::numParameters\n-int numParameters() const\n-Definition dgfgridfactory.hh:108\n-Dune::DGFGridFactory::boundaryId\n-int boundaryId(const Intersection &intersection) const\n-Definition dgfgridfactory.hh:102\n-Dune::DGFGridFactory::boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n-> &intersection) const\n-Definition dgfgridfactory.hh:158\n-Dune::DGFGridFactory::parameter\n-std::vector< double > & parameter(const Vertex &vertex)\n-Definition dgfgridfactory.hh:139\n-Dune::DGFGridFactory::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition dgfgridfactory.hh:41\n-Dune::DGFGridFactory::numParameters\n-int numParameters(const Entity &) const\n-Definition dgfgridfactory.hh:119\n-Dune::DGFGridFactory::wasInserted\n-bool wasInserted(const Intersection &intersection) const\n-Definition dgfgridfactory.hh:96\n-Dune::DGFGridFactory::DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicatorType\n-comm=MPIHelper::getCommunicator())\n-Definition dgfgridfactory.hh:50\n-Dune::DGFGridFactory::Grid\n-G Grid\n-Definition dgfgridfactory.hh:39\n-Dune::DGFGridFactory::dimension\n-static const int dimension\n-Definition dgfgridfactory.hh:40\n-Dune::DGFGridFactory::grid\n-Grid * grid()\n-Definition dgfgridfactory.hh:90\n-Dune::DGFGridFactory::parameter\n-std::vector< double > & parameter(const Element &element)\n-Definition dgfgridfactory.hh:124\n-Dune::DGFGridFactory::haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-Definition dgfgridfactory.hh:151\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::boundary\n-bool boundary() const\n-Return true if intersection is with interior or exterior boundary (see the\n-cases above)\n-Definition common/intersection.hh:216\n-Dune::Intersection::indexInInside\n-int indexInInside() const\n-Local index of codim 1 entity in the inside() entity where intersection is\n-contained in.\n-Definition common/intersection.hh:346\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::Grid::Codim\n-A Traits struct that collects all associated types of one implementation.\n-Definition common/grid.hh:411\n-Dune::DGFBoundaryParameter::defaultValue\n-static const type & defaultValue()\n-default constructor\n-Definition parser.hh:28\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n-Dune::DuneGridFormatParser::nofvtxparams\n-int nofvtxparams\n-Definition parser.hh:163\n-Dune::DuneGridFormatParser::vtxParams\n-std::vector< std::vector< double > > vtxParams\n-Definition parser.hh:165\n-Dune::DuneGridFormatParser::nofelparams\n-int nofelparams\n-Definition parser.hh:163\n-Dune::DuneGridFormatParser::elParams\n-std::vector< std::vector< double > > elParams\n-Definition parser.hh:165\n-Dune::DuneGridFormatParser::vtx\n-std::vector< std::vector< double > > vtx\n-Definition parser.hh:125\n-Dune::DuneGridFormatParser::elements\n-std ::vector< std ::vector< unsigned int > > elements\n-Definition parser.hh:134\n-intersection.hh\n+Dune::Mapper\n+Mapper interface.\n+Definition mapper.hh:110\n+Dune::MultipleCodimMultipleGeomTypeMapper\n+Implementation class for a multiple codim and multiple geometry type mapper.\n+Definition mcmgmapper.hh:129\n+Dune::MultipleCodimMultipleGeomTypeMapper::contains\n+bool contains(const EntityType &e, Index &result) const\n+Returns true if the entity is contained in the index set.\n+Definition mcmgmapper.hh:272\n+Dune::MultipleCodimMultipleGeomTypeMapper::size\n+size_type size() const\n+Return total number of entities in the entity set managed by the mapper.\n+Definition mcmgmapper.hh:204\n+Dune::MultipleCodimMultipleGeomTypeMapper::subIndex\n+Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i,\n+unsigned int codim) const\n+Map subentity of codim 0 entity to starting index in array for dof block.\n+Definition mcmgmapper.hh:185\n+Dune::MultipleCodimMultipleGeomTypeMapper::MultipleCodimMultipleGeomTypeMapper\n+MultipleCodimMultipleGeomTypeMapper(const GV &gridView, const MCMGLayout\n+&layout)\n+construct mapper from grid and layout description\n+Definition mcmgmapper.hh:155\n+Dune::MultipleCodimMultipleGeomTypeMapper::contains\n+bool contains(const typename GV::template Codim< 0 >::Entity &e, int i, int cc,\n+Index &result) const\n+Returns true if the entity is contained in the index set.\n+Definition mcmgmapper.hh:291\n+Dune::MultipleCodimMultipleGeomTypeMapper::indices\n+IntegralRange< Index > indices(const EntityType &e) const\n+Returns a pair with the starting point in the dof vector and the number of\n+degrees of freedom if the ...\n+Definition mcmgmapper.hh:231\n+Dune::MultipleCodimMultipleGeomTypeMapper::size_type\n+decltype(std::declval< typename GV::IndexSet >().size(0)) size_type\n+Number type used for the overall size (the return value of the 'size' method)\n+Definition mcmgmapper.hh:142\n+Dune::MultipleCodimMultipleGeomTypeMapper::index\n+Index index(const EntityType &e) const\n+Map entity to starting index in array for dof block.\n+Definition mcmgmapper.hh:171\n+Dune::MultipleCodimMultipleGeomTypeMapper::gridView\n+const GridView & gridView() const\n+Definition mcmgmapper.hh:328\n+Dune::MultipleCodimMultipleGeomTypeMapper::update\n+void update(const GV &gridView)\n+Recalculates indices after grid adaptation.\n+Definition mcmgmapper.hh:308\n+Dune::MultipleCodimMultipleGeomTypeMapper::Index\n+GV::IndexSet::IndexType Index\n+Number type used for indices.\n+Definition mcmgmapper.hh:136\n+Dune::MultipleCodimMultipleGeomTypeMapper::size\n+size_type size(GeometryType gt) const\n+return number of entries for a given geometry type\n+Definition mcmgmapper.hh:210\n+Dune::MultipleCodimMultipleGeomTypeMapper::layout\n+const MCMGLayout & layout() const\n+Definition mcmgmapper.hh:327\n+Dune::MultipleCodimMultipleGeomTypeMapper::indices\n+IntegralRange< Index > indices(const typename GV::template Codim< 0 >::Entity\n+&e, int i, int cc) const\n+Returns a pair with the starting point in the dof vector and the number of\n+degrees of freedom if the ...\n+Definition mcmgmapper.hh:250\n+Dune::MultipleCodimMultipleGeomTypeMapper::GridView\n+GV GridView\n+Underlying GridView.\n+Definition mcmgmapper.hh:133\n+Dune::MultipleCodimMultipleGeomTypeMapper::types\n+const std::vector< GeometryType > & types(int codim) const\n+return the geometry types with entries\n+Definition mcmgmapper.hh:216\n+Dune::MultipleCodimMultipleGeomTypeMapper::update\n+void update(GV &&gridView)\n+Recalculates indices after grid adaptation.\n+Definition mcmgmapper.hh:320\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00884_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00827_source.html", "comments": ["Files 74% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: macrogrid.hh Source File\n+dune-grid: corner.hh Source File\n \n \n \n \n \n \n \n@@ -70,118 +70,87 @@\n
    \n
    \n \n \n \n \n \n
    \n-
    macrogrid.hh
    \n+
    corner.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGF_MACROGRID_HH
    \n-
    6#define DUNE_DGF_MACROGRID_HH
    \n-
    7
    \n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_CORNER_HH
    \n
    8
    \n-
    9#include <iostream>
    \n+\n
    10
    \n-
    11#include <dune/common/parallel/mpihelper.hh>
    \n-\n-
    13
    \n-
    14
    \n-
    15namespace Dune
    \n-
    16{
    \n-
    17 // forward declarations
    \n-
    18 // --------------------
    \n-
    19 class DuneGridFormatParser;
    \n-
    20
    \n-
    \n-\n-
    22 : protected DuneGridFormatParser
    \n-
    23 {
    \n-
    24 template< class GridType >
    \n-
    25 friend struct DGFGridFactory;
    \n-
    26
    \n-
    27 public:
    \n-
    28 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    29
    \n-
    30 protected:
    \n-
    \n-
    32 MacroGrid(const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())
    \n-
    33 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )
    \n-
    34 , filename_(filename)
    \n-
    35 , MPICOMM_(MPICOMM) {}
    \n-
    \n-
    36
    \n+
    11namespace Dune
    \n+
    12{
    \n+
    15
    \n+
    16 namespace VTK {
    \n+
    17
    \n+
    19
    \n+
    24 template<typename Cell>
    \n+
    \n+
    25 class Corner {
    \n+
    26 // store a pointer to the element
    \n+
    27 const Cell* cell_;
    \n+
    28 // store index of the corner within element (Dune numbering)
    \n+
    29 unsigned index;
    \n+
    30
    \n+
    31 public:
    \n+
    33
    \n
    \n-
    38 MacroGrid(MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())
    \n-
    39 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )
    \n-
    40 , filename_(0)
    \n-
    41 , MPICOMM_(MPICOMM) {}
    \n-
    \n-
    42
    \n-
    44 template <class GridType>
    \n-
    \n-
    45 inline GridType * createGrid ()
    \n-
    46 {
    \n-
    47 return Impl<GridType>::generate(*this,filename_,MPICOMM_);
    \n-
    48 }
    \n-
    \n-
    49 private:
    \n-
    50 static int rank( [[maybe_unused]] MPICommunicatorType MPICOMM )
    \n-
    51 {
    \n-
    52 int rank = 0;
    \n-
    53#if HAVE_MPI
    \n-
    54 MPI_Comm_rank( MPICOMM, &rank );
    \n-
    55#endif
    \n-
    56 return rank;
    \n-
    57 }
    \n-
    58 static int size( [[maybe_unused]] MPICommunicatorType MPICOMM )
    \n-
    59 {
    \n-
    60 int size = 1;
    \n-
    61#if HAVE_MPI
    \n-
    62 MPI_Comm_size( MPICOMM, &size );
    \n-
    63#endif
    \n-
    64 return size;
    \n-
    65 }
    \n-
    77 template< class GridType >
    \n-
    78 struct Impl
    \n-
    79 {
    \n-
    80 static GridType* generate(MacroGrid& mg,
    \n-
    81 const char* filename, MPICommunicatorType MPICOMM = MPIHelper::getCommunicator() )
    \n-
    82 {
    \n-
    83 // make assertion depend on the template argument but always evaluate to false
    \n-
    84 static_assert( GridType::dimension<0,"DGF grid factory missing. Did you forget to add the corresponding dgf header?");
    \n-
    85 }
    \n-
    86 };
    \n-
    87
    \n-
    88 const char* filename_;
    \n-
    89 MPICommunicatorType MPICOMM_;
    \n-
    90 };
    \n-
    \n-
    91
    \n-
    92} // end namespace Dune
    \n-
    93
    \n-
    94#endif
    \n-\n+
    38 Corner(const Cell& cell, unsigned duneIndex)
    \n+
    39 : cell_(&cell), index(duneIndex)
    \n+
    40 { }
    \n+
    \n+
    41
    \n+
    43 Corner() { }
    \n+
    44
    \n+
    46 const Cell& cell() const { return *cell_; }
    \n+
    48
    \n+
    52 void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }
    \n+
    53
    \n+
    55 unsigned duneIndex() const { return index; }
    \n+
    57 void duneIndex(unsigned i) { index = i; }
    \n+
    58
    \n+
    60
    \n+
    63 unsigned vtkIndex() const { return renumber(cell_->type(), index); }
    \n+
    65
    \n+
    68 void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }
    \n+
    69 };
    \n+
    \n+
    70
    \n+
    71 } // namespace VTK
    \n+
    72
    \n+
    74
    \n+
    75} // namespace Dune
    \n+
    76
    \n+
    77#endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH
    \n+
    Common stuff for the VTKWriter.
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    Definition macrogrid.hh:23
    \n-
    MacroGrid(const char *filename, MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
    constructor given the name of a DGF file
    Definition macrogrid.hh:32
    \n-
    MacroGrid(MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())
    constructor given the name of a DGF file
    Definition macrogrid.hh:38
    \n-
    GridType * createGrid()
    returns pointer to a new instance of type GridType created from a DGF file
    Definition macrogrid.hh:45
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition macrogrid.hh:28
    \n-
    The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures us...
    Definition parser.hh:47
    \n+
    int renumber(const Dune::GeometryType &t, int i)
    renumber VTK <-> Dune
    Definition common.hh:186
    \n+
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n+
    unsigned vtkIndex() const
    get the index of the corner within the cell in VTK-numbering
    Definition corner.hh:63
    \n+
    void vtkIndex(unsigned i)
    set the index of the corner within the cell in VTK-numbering
    Definition corner.hh:68
    \n+
    Corner(const Cell &cell, unsigned duneIndex)
    construct a Corner
    Definition corner.hh:38
    \n+
    void cell(const Cell &cell__)
    set a new cell
    Definition corner.hh:52
    \n+
    void duneIndex(unsigned i)
    set the index of the corner within the cell in Dune-numbering
    Definition corner.hh:57
    \n+
    unsigned duneIndex() const
    get the index of the corner within the cell in Dune-numbering
    Definition corner.hh:55
    \n+
    const Cell & cell() const
    get reference to the cell
    Definition corner.hh:46
    \n+
    Corner()
    construct an invalid Corner
    Definition corner.hh:43
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,125 +2,107 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n-macrogrid.hh\n+ * vtk\n+corner.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGF_MACROGRID_HH\n-6#define DUNE_DGF_MACROGRID_HH\n-7\n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH\n+7#define DUNE_GRID_IO_FILE_VTK_CORNER_HH\n 8\n-9#include \n+9#include \n 10\n-11#include \n-12#include \n-13\n-14\n-15namespace Dune\n-16{\n-17 // forward declarations\n-18 // --------------------\n-19 class DuneGridFormatParser;\n-20\n-21 class MacroGrid\n-22 : protected DuneGridFormatParser\n-23 {\n-24 template< class GridType >\n-25 friend struct DGFGridFactory;\n-26\n-27 public:\n-28 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-29\n-30 protected:\n-32 MacroGrid(const char* filename, MPICommunicatorType MPICOMM = MPIHelper::\n-getCommunicator())\n-33 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )\n-34 , filename_(filename)\n-35 , MPICOMM_(MPICOMM) {}\n-36\n-38 MacroGrid(MPICommunicatorType MPICOMM = MPIHelper::getCommunicator())\n-39 : DuneGridFormatParser( rank(MPICOMM), size(MPICOMM) )\n-40 , filename_(0)\n-41 , MPICOMM_(MPICOMM) {}\n-42\n-44 template \n-45 inline GridType * createGrid ()\n-46 {\n-47 return Impl::generate(*this,filename_,MPICOMM_);\n-48 }\n-49 private:\n-50 static int rank( [[maybe_unused]] MPICommunicatorType MPICOMM )\n-51 {\n-52 int rank = 0;\n-53#if HAVE_MPI\n-54 MPI_Comm_rank( MPICOMM, &rank );\n-55#endif\n-56 return rank;\n-57 }\n-58 static int size( [[maybe_unused]] MPICommunicatorType MPICOMM )\n-59 {\n-60 int size = 1;\n-61#if HAVE_MPI\n-62 MPI_Comm_size( MPICOMM, &size );\n-63#endif\n-64 return size;\n-65 }\n-77 template< class GridType >\n-78 struct Impl\n-79 {\n-80 static GridType* generate(MacroGrid& mg,\n-81 const char* filename, MPICommunicatorType MPICOMM = MPIHelper::\n-getCommunicator() )\n-82 {\n-83 // make assertion depend on the template argument but always evaluate to\n-false\n-84 static_assert( GridType::dimension<0,\"DGF grid factory missing. Did you\n-forget to add the corresponding dgf header?\");\n-85 }\n-86 };\n-87\n-88 const char* filename_;\n-89 MPICommunicatorType MPICOMM_;\n-90 };\n-91\n-92} // end namespace Dune\n-93\n-94#endif\n-parser.hh\n+11namespace Dune\n+12{\n+15\n+16 namespace VTK {\n+17\n+19\n+24 template\n+25 class Corner {\n+26 // store a pointer to the element\n+27 const Cell* cell_;\n+28 // store index of the corner within element (Dune numbering)\n+29 unsigned index;\n+30\n+31 public:\n+33\n+38 Corner(const Cell& cell, unsigned duneIndex)\n+39 : cell_(&cell), index(duneIndex)\n+40 { }\n+41\n+43 Corner() { }\n+44\n+46 const Cell& cell() const { return *cell_; }\n+48\n+52 void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }\n+53\n+55 unsigned duneIndex() const { return index; }\n+57 void duneIndex(unsigned i) { index = i; }\n+58\n+60\n+63 unsigned vtkIndex() const { return renumber(cell_->type(), index); }\n+65\n+68 void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }\n+69 };\n+70\n+71 } // namespace VTK\n+72\n+74\n+75} // namespace Dune\n+76\n+77#endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH\n+common.hh\n+Common stuff for the VTKWriter.\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::MacroGrid\n-Definition macrogrid.hh:23\n-Dune::MacroGrid::MacroGrid\n-MacroGrid(const char *filename, MPICommunicatorType MPICOMM=MPIHelper::\n-getCommunicator())\n-constructor given the name of a DGF file\n-Definition macrogrid.hh:32\n-Dune::MacroGrid::MacroGrid\n-MacroGrid(MPICommunicatorType MPICOMM=MPIHelper::getCommunicator())\n-constructor given the name of a DGF file\n-Definition macrogrid.hh:38\n-Dune::MacroGrid::createGrid\n-GridType * createGrid()\n-returns pointer to a new instance of type GridType created from a DGF file\n-Definition macrogrid.hh:45\n-Dune::MacroGrid::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition macrogrid.hh:28\n-Dune::DuneGridFormatParser\n-The DuneGridFormatParser class: reads a DGF file and stores build information\n-in vector structures us...\n-Definition parser.hh:47\n+Dune::VTK::renumber\n+int renumber(const Dune::GeometryType &t, int i)\n+renumber VTK <-> Dune\n+Definition common.hh:186\n+Dune::VTK::Corner\n+simple class representing a corner of a cell\n+Definition corner.hh:25\n+Dune::VTK::Corner::vtkIndex\n+unsigned vtkIndex() const\n+get the index of the corner within the cell in VTK-numbering\n+Definition corner.hh:63\n+Dune::VTK::Corner::vtkIndex\n+void vtkIndex(unsigned i)\n+set the index of the corner within the cell in VTK-numbering\n+Definition corner.hh:68\n+Dune::VTK::Corner::Corner\n+Corner(const Cell &cell, unsigned duneIndex)\n+construct a Corner\n+Definition corner.hh:38\n+Dune::VTK::Corner::cell\n+void cell(const Cell &cell__)\n+set a new cell\n+Definition corner.hh:52\n+Dune::VTK::Corner::duneIndex\n+void duneIndex(unsigned i)\n+set the index of the corner within the cell in Dune-numbering\n+Definition corner.hh:57\n+Dune::VTK::Corner::duneIndex\n+unsigned duneIndex() const\n+get the index of the corner within the cell in Dune-numbering\n+Definition corner.hh:55\n+Dune::VTK::Corner::cell\n+const Cell & cell() const\n+get reference to the cell\n+Definition corner.hh:46\n+Dune::VTK::Corner::Corner\n+Corner()\n+construct an invalid Corner\n+Definition corner.hh:43\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00887_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00815_source.html", "comments": ["Files 74% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfgeogrid.hh Source File\n+dune-grid: volumeiterators.hh Source File\n \n \n \n \n \n \n \n@@ -70,348 +70,240 @@\n \n \n \n \n \n \n \n
    \n-
    dgfgeogrid.hh
    \n+
    volumeiterators.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGFGEOGRID_HH
    \n-
    6#define DUNE_DGFGEOGRID_HH
    \n-
    7
    \n-
    8#include <dune/common/typetraits.hh>
    \n-
    9
    \n-\n-\n-\n-\n-\n+
    5
    \n+
    6#ifndef DUNE_GRID_IO_FILE_VTK_VOLUMEITERATORS_HH
    \n+
    7#define DUNE_GRID_IO_FILE_VTK_VOLUMEITERATORS_HH
    \n+
    8
    \n+\n+
    10
    \n+\n+\n+\n+\n
    15
    \n-\n-
    17
    \n-
    18
    \n-
    19namespace Dune
    \n-
    20{
    \n+
    16namespace Dune {
    \n+
    19
    \n+
    20 namespace VTK {
    \n
    21
    \n-
    22 /************************************************************************
    \n-
    23 * Warning:
    \n-
    24 * Reading DGF files directly into a GeometryGrid is a dirty hack for
    \n-
    25 * two reasons:
    \n-
    26 * 1) The host grid and coordinate function are never deleted (dangling
    \n-
    27 * pointers).
    \n-
    28 * 2) The coordinate function has to provide a default constructor
    \n-
    29 ************************************************************************/
    \n+
    22 template<typename GV>
    \n+
    \n+\n+
    24 const GV& gv;
    \n+
    25
    \n+
    26 typedef typename GV::IndexSet IndexSet;
    \n+
    27 const IndexSet& indexSet() const { return gv.indexSet(); }
    \n+\n+\n
    30
    \n-
    31 // External Forward Declarations
    \n-
    32 // -----------------------------
    \n+
    31 public:
    \n+
    32 static const unsigned dimCell = GV::dimension;
    \n
    33
    \n-
    34 template< class GridImp, class IntersectionImp >
    \n-
    35 class Intersection;
    \n-
    36
    \n+
    34 typedef typename GV::template Codim<0>::Entity Cell;
    \n+
    35 typedef typename GV::template Codim<0>::
    \n+
    36 template Partition<InteriorBorder_Partition>::Iterator CellIterator;
    \n
    37
    \n-
    38
    \n-
    39 // DGFCoordFunction
    \n-
    40 // ----------------
    \n-
    41
    \n-
    42 template< int dimD, int dimR >
    \n-
    \n-\n-
    44 : public AnalyticalCoordFunction< double, dimD, dimR, DGFCoordFunction< dimD, dimR > >
    \n-
    45 {
    \n-\n-\n+\n+\n+
    40
    \n+\n+\n+
    43 typename GV::IndexSet> PointIterator;
    \n+
    44
    \n+\n+\n+
    47 typedef typename GV::Communication Communication;
    \n
    48
    \n-
    49 public:
    \n-\n-\n-
    52
    \n-\n-
    54
    \n-
    \n-
    55 DGFCoordFunction ( const Expression *expression )
    \n-
    56 : expression_( expression )
    \n-
    57 {}
    \n-
    \n-
    58
    \n-
    \n-
    59 void evaluate ( const DomainVector &x, RangeVector &y ) const
    \n-
    60 {
    \n-
    61 std::vector< double > vx( dimD );
    \n-
    62 std::vector< double > vy;
    \n-
    63 for( int i = 0; i < dimD; ++i )
    \n-
    64 vx[ i ] = x[ i ];
    \n-
    65 expression_->evaluate( vx, vy );
    \n-
    66 assert( vy.size() == size_t( dimR ) );
    \n-
    67 for( int i = 0; i < dimR; ++i )
    \n-
    68 y[ i ] = vy[ i ];
    \n-
    69 }
    \n-
    \n-
    70
    \n-
    71 private:
    \n-
    72 const Expression *expression_;
    \n-
    73 };
    \n-
    \n-
    74
    \n-
    75
    \n-
    76
    \n-
    77 // DGFCoordFunctionFactory
    \n-
    78 // -----------------------
    \n-
    79
    \n-
    80 template< class HostGrid, class CoordFunction,
    \n-
    81 bool discrete = GeoGrid::isDiscreteCoordFunctionInterface< typename CoordFunction::Interface >::value >
    \n-\n-
    83
    \n-
    84
    \n-
    85 template< class HostGrid, class CoordFunction >
    \n-
    \n-
    86 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, false >
    \n-
    87 {
    \n-
    \n-
    88 static CoordFunction *create ( std::istream &, const HostGrid & )
    \n-
    89 {
    \n-
    90 return new CoordFunction;
    \n-
    91 }
    \n-
    \n-
    92 };
    \n-
    \n-
    93
    \n-
    94
    \n-
    95 template< class HostGrid, class CoordFunction >
    \n-
    \n-
    96 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, true >
    \n-
    97 {
    \n-
    \n-
    98 static CoordFunction *create ( std::istream &, const HostGrid &hostGrid )
    \n-
    99 {
    \n-
    100 return new CoordFunction( hostGrid );
    \n-
    101 }
    \n-
    \n-
    102 };
    \n-
    \n-
    103
    \n-
    104
    \n-
    105 template< class HostGrid, int dimD, int dimR >
    \n-
    \n-
    106 struct DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >, false >
    \n-
    107 {
    \n-\n-
    109
    \n-
    \n-
    110 static CoordFunction *create ( std::istream &input, const HostGrid &hostGrid )
    \n-
    111 {
    \n-
    112 dgf::ProjectionBlock projectionBlock( input, dimR );
    \n-
    113 const typename CoordFunction::Expression *expression = projectionBlock.function( "coordfunction" );
    \n-
    114 if( expression == 0 )
    \n-
    115 DUNE_THROW( DGFException, "no coordfunction specified in DGF file." );
    \n-
    116 return new CoordFunction( expression );
    \n-
    117 }
    \n+
    \n+
    49 explicit ConformingVolumeIteratorFactory(const GV& gv_)
    \n+
    50 : gv(gv_)
    \n+
    51 { }
    \n
    \n-
    118 };
    \n+
    52
    \n+
    \n+\n+
    54 return gv.template begin<0, InteriorBorder_Partition>();
    \n+
    55 }
    \n+
    \n+
    \n+\n+
    57 return gv.template end<0, InteriorBorder_Partition>();
    \n+
    58 }
    \n+
    \n+
    59
    \n+
    \n+\n+\n+
    62 }
    \n+
    \n+
    \n+\n+
    64 return CornerIterator(endCells());
    \n+
    65 }
    \n+
    \n+
    66
    \n+
    \n+\n+
    68 return PointIterator(beginCells(), endCells(), gv.indexSet());
    \n+
    69 }
    \n+
    \n+
    \n+\n+
    71 return PointIterator(endCells());
    \n+
    72 }
    \n+
    \n+
    73
    \n+
    \n+\n+
    75 return ConnectivityWriter(*this);
    \n+
    76 }
    \n+
    \n+
    \n+
    77 const Communication& comm() const {
    \n+
    78 return gv.comm();
    \n+
    79 }
    \n+
    \n+
    80 };
    \n+
    \n+
    81
    \n+
    82 template<typename GV>
    \n+
    \n+\n+
    84 const GV& gv;
    \n+
    85
    \n+
    86 public:
    \n+
    87 static const unsigned dimCell = GV::dimension;
    \n+
    88
    \n+
    89 typedef typename GV::template Codim<0>::Entity Cell;
    \n+
    90 typedef typename GV::template Codim<0>::
    \n+
    91 template Partition<InteriorBorder_Partition>::Iterator CellIterator;
    \n+
    92
    \n+\n+\n+
    95
    \n+
    96 typedef Corner Point;
    \n+\n+
    98
    \n+\n+
    100 typedef typename GV::Communication Communication;
    \n+
    101
    \n+
    \n+\n+
    103 : gv(gv_)
    \n+
    104 { }
    \n+
    \n+
    105
    \n+
    \n+\n+
    107 return gv.template begin<0, InteriorBorder_Partition>();
    \n+
    108 }
    \n+
    \n+
    \n+\n+
    110 return gv.template end<0, InteriorBorder_Partition>();
    \n+
    111 }
    \n+
    \n+
    112
    \n+
    \n+\n+\n+
    115 }
    \n+
    \n+
    \n+\n+
    117 return CornerIterator(endCells());
    \n+
    118 }
    \n
    \n
    119
    \n-
    120
    \n-
    121
    \n-
    122 // DGFGridFactory for GeometryGrid
    \n-
    123 // -------------------------------
    \n-
    124
    \n-
    125 template< class HostGrid, class CoordFunction, class Allocator >
    \n-
    \n-
    126 struct DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > >
    \n-
    127 {
    \n-\n-
    129
    \n-
    130 const static int dimension = Grid::dimension;
    \n-
    131 typedef MPIHelper::MPICommunicator MPICommunicator;
    \n-
    132 typedef typename Grid::template Codim<0>::Entity Element;
    \n-
    133 typedef typename Grid::template Codim<dimension>::Entity Vertex;
    \n+\n+
    121 PointIterator endPoints() const { return endCorners(); }
    \n+
    122
    \n+
    \n+\n+
    124 return ConnectivityWriter();
    \n+
    125 }
    \n+
    \n+
    \n+
    126 const Communication& comm() const {
    \n+
    127 return gv.comm();
    \n+
    128 }
    \n+
    \n+
    129 };
    \n+
    \n+
    130
    \n+
    131 } // namespace VTK
    \n+
    132
    \n
    134
    \n-\n+
    135} // namespace Dune
    \n
    136
    \n-
    \n-
    137 explicit DGFGridFactory ( std::istream &input,
    \n-
    138 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n-
    139 : dgfHostFactory_( input, comm ),
    \n-
    140 grid_( 0 )
    \n-
    141 {
    \n-
    142 auto hostGrid = std::shared_ptr<HostGrid>(dgfHostFactory_.grid());
    \n-
    143 assert( hostGrid != 0 );
    \n-
    144 auto coordFunction = std::shared_ptr<CoordFunction>(CoordFunctionFactory::create( input, *hostGrid ));
    \n-
    145 grid_ = new Grid( hostGrid, coordFunction );
    \n-
    146 }
    \n-
    \n-
    147
    \n-
    \n-
    148 explicit DGFGridFactory ( const std::string &filename,
    \n-
    149 MPICommunicator comm = MPIHelper::getCommunicator() )
    \n-
    150 : dgfHostFactory_( filename, comm ),
    \n-
    151 grid_( 0 )
    \n-
    152 {
    \n-
    153 auto hostGrid = std::shared_ptr<HostGrid>(dgfHostFactory_.grid());
    \n-
    154 assert( hostGrid != 0 );
    \n-
    155 std::ifstream input( filename.c_str() );
    \n-
    156 auto coordFunction = std::shared_ptr<CoordFunction>(CoordFunctionFactory::create( input, *hostGrid ));
    \n-
    157 grid_ = new Grid( hostGrid, coordFunction );
    \n-
    158 }
    \n-
    \n-
    159
    \n-
    \n-
    160 Grid *grid () const
    \n-
    161 {
    \n-
    162 return grid_;
    \n-
    163 }
    \n-
    \n-
    164
    \n-
    165 template< class Intersection >
    \n-
    \n-
    166 bool wasInserted ( const Intersection &intersection ) const
    \n-
    167 {
    \n-
    168 return dgfHostFactory_.wasInserted( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n-
    169 }
    \n-
    \n-
    170
    \n-
    171 template< class Intersection >
    \n-
    \n-
    172 int boundaryId ( const Intersection &intersection ) const
    \n-
    173 {
    \n-
    174 return dgfHostFactory_.boundaryId( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n-
    175 }
    \n-
    \n-
    176
    \n-
    177 template< int codim >
    \n-
    \n-
    178 int numParameters () const
    \n-
    179 {
    \n-
    180 return dgfHostFactory_.template numParameters< codim >();
    \n-
    181 }
    \n-
    \n-
    182
    \n-
    183 // return true if boundary parameters found
    \n-
    \n-\n-
    185 {
    \n-
    186 return dgfHostFactory_.haveBoundaryParameters();
    \n-
    187 }
    \n-
    \n-
    188
    \n-
    189 template< class GG, class II >
    \n-
    190 const typename DGFBoundaryParameter::type &
    \n-
    \n-
    191 boundaryParameter ( const Dune::Intersection< GG, II > & intersection ) const
    \n-
    192 {
    \n-
    193 return dgfHostFactory_.boundaryParameter( HostGridAccess< Grid >::hostIntersection( intersection ) );
    \n-
    194 }
    \n-
    \n-
    195
    \n-
    196 template< class Entity >
    \n-
    \n-
    197 std::vector< double > &parameter ( const Entity &entity )
    \n-
    198 {
    \n-
    199 return dgfHostFactory_.parameter( HostGridAccess< Grid >::hostEntity( entity ) );
    \n-
    200 }
    \n-
    \n-
    201
    \n-
    202 private:
    \n-
    203 DGFGridFactory< HostGrid > dgfHostFactory_;
    \n-
    204 Grid *grid_;
    \n-
    205 };
    \n-
    \n-
    206
    \n-
    207
    \n-
    208
    \n-
    209 // DGFGridInfo for GeometryGrid
    \n-
    210 // ----------------------------
    \n-
    211
    \n-
    212 template< class HostGrid, class CoordFunction, class Allocator >
    \n-
    \n-
    213 struct DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > >
    \n-
    214 {
    \n-
    \n-
    215 static int refineStepsForHalf ()
    \n-
    216 {
    \n-\n-
    218 }
    \n-
    \n-
    219
    \n-
    \n-
    220 static double refineWeight ()
    \n-
    221 {
    \n-
    222 return -1.0;
    \n-
    223 }
    \n-
    \n-
    224 };
    \n-
    \n-
    225
    \n-
    226}
    \n-
    227
    \n-
    228#endif // #ifndef DUNE_DGFGEOGRID_HH
    \n-\n-\n-\n+
    137#endif // DUNE_GRID_IO_FILE_VTK_VOLUMEITERATORS_HH
    \n+\n+\n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    G Grid
    Definition dgfgridfactory.hh:39
    \n-
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Grid abstract base class.
    Definition common/grid.hh:375
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    Derive an implementation of an analytical coordinate function from this class.
    Definition coordfunction.hh:134
    \n-
    Base::DomainVector DomainVector
    Definition coordfunction.hh:139
    \n-
    Base::RangeVector RangeVector
    Definition coordfunction.hh:140
    \n-
    grid wrapper replacing the geometries
    Definition geometrygrid/grid.hh:86
    \n-
    traits structure containing types for a codimension
    Definition geometrygrid/grid.hh:606
    \n-
    provides access to host grid objects from GeometryGrid
    Definition identitygrid.hh:37
    \n-
    Definition io/file/dgfparser/blocks/projection.hh:24
    \n-
    ExpressionPointer function(const std::string &name) const
    Definition io/file/dgfparser/blocks/projection.hh:100
    \n-
    Definition io/file/dgfparser/blocks/projection.hh:160
    \n-
    virtual void evaluate(const Vector &argument, Vector &result) const =0
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n-
    Definition dgfgeogrid.hh:45
    \n-
    Base::DomainVector DomainVector
    Definition dgfgeogrid.hh:50
    \n-
    void evaluate(const DomainVector &x, RangeVector &y) const
    Definition dgfgeogrid.hh:59
    \n-
    dgf::ProjectionBlock::Expression Expression
    Definition dgfgeogrid.hh:53
    \n-
    DGFCoordFunction(const Expression *expression)
    Definition dgfgeogrid.hh:55
    \n-
    Base::RangeVector RangeVector
    Definition dgfgeogrid.hh:51
    \n-
    Definition dgfgeogrid.hh:82
    \n-
    static CoordFunction * create(std::istream &, const HostGrid &)
    Definition dgfgeogrid.hh:88
    \n-
    static CoordFunction * create(std::istream &, const HostGrid &hostGrid)
    Definition dgfgeogrid.hh:98
    \n-
    static CoordFunction * create(std::istream &input, const HostGrid &hostGrid)
    Definition dgfgeogrid.hh:110
    \n-
    DGFCoordFunction< dimD, dimR > CoordFunction
    Definition dgfgeogrid.hh:108
    \n-
    Grid::template Codim< dimension >::Entity Vertex
    Definition dgfgeogrid.hh:133
    \n-
    int boundaryId(const Intersection &intersection) const
    Definition dgfgeogrid.hh:172
    \n-
    MPIHelper::MPICommunicator MPICommunicator
    Definition dgfgeogrid.hh:131
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
    Definition dgfgeogrid.hh:191
    \n-
    DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfgeogrid.hh:137
    \n-
    Grid::template Codim< 0 >::Entity Element
    Definition dgfgeogrid.hh:132
    \n-\n-
    DGFCoordFunctionFactory< HostGrid, CoordFunction > CoordFunctionFactory
    Definition dgfgeogrid.hh:135
    \n-
    GeometryGrid< HostGrid, CoordFunction, Allocator > Grid
    Definition dgfgeogrid.hh:128
    \n-\n-
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfgeogrid.hh:197
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::getCommunicator())
    Definition dgfgeogrid.hh:148
    \n-
    bool wasInserted(const Intersection &intersection) const
    Definition dgfgeogrid.hh:166
    \n-\n-\n-\n-
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n-
    static int refineStepsForHalf()
    number of globalRefine steps needed to refuce h by 0.5
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-\n-\n-\n+
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n+
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n+
    writer for the connectivity array in conforming mode
    Definition functionwriter.hh:195
    \n+
    writer for the connectivity array in nonconforming mode
    Definition functionwriter.hh:261
    \n+
    iterate over the points of some corner range
    Definition pointiterator.hh:58
    \n+
    Definition volumeiterators.hh:23
    \n+
    CornerIterator endCorners() const
    Definition volumeiterators.hh:63
    \n+
    VTK::CornerIterator< CellIterator > CornerIterator
    Definition volumeiterators.hh:39
    \n+
    VTK::Corner< Cell > Corner
    Definition volumeiterators.hh:38
    \n+
    CellIterator endCells() const
    Definition volumeiterators.hh:56
    \n+
    GV::Communication Communication
    Definition volumeiterators.hh:47
    \n+
    VTK::PointIterator< CellIterator, typename GV::IndexSet > PointIterator
    Definition volumeiterators.hh:43
    \n+
    ConformingConnectivityWriter< ConformingVolumeIteratorFactory< GV > > ConnectivityWriter
    Definition volumeiterators.hh:46
    \n+
    CornerIterator beginCorners() const
    Definition volumeiterators.hh:60
    \n+
    static const unsigned dimCell
    Definition volumeiterators.hh:32
    \n+
    PointIterator endPoints() const
    Definition volumeiterators.hh:70
    \n+
    const Communication & comm() const
    Definition volumeiterators.hh:77
    \n+
    ConformingVolumeIteratorFactory(const GV &gv_)
    Definition volumeiterators.hh:49
    \n+
    VTK::Corner< Cell > Point
    Definition volumeiterators.hh:41
    \n+
    ConnectivityWriter makeConnectivity() const
    Definition volumeiterators.hh:74
    \n+
    CellIterator beginCells() const
    Definition volumeiterators.hh:53
    \n+
    GV::template Codim< 0 >::Entity Cell
    Definition volumeiterators.hh:34
    \n+
    PointIterator beginPoints() const
    Definition volumeiterators.hh:67
    \n+
    GV::template Codim< 0 >::template Partition< InteriorBorder_Partition >::Iterator CellIterator
    Definition volumeiterators.hh:36
    \n+
    Definition volumeiterators.hh:83
    \n+
    const Communication & comm() const
    Definition volumeiterators.hh:126
    \n+
    PointIterator beginPoints() const
    Definition volumeiterators.hh:120
    \n+
    GV::Communication Communication
    Definition volumeiterators.hh:100
    \n+
    CellIterator beginCells() const
    Definition volumeiterators.hh:106
    \n+
    GV::template Codim< 0 >::Entity Cell
    Definition volumeiterators.hh:89
    \n+
    NonConformingVolumeIteratorFactory(const GV &gv_)
    Definition volumeiterators.hh:102
    \n+
    ConnectivityWriter makeConnectivity() const
    Definition volumeiterators.hh:123
    \n+
    NonConformingConnectivityWriter< Cell > ConnectivityWriter
    Definition volumeiterators.hh:99
    \n+
    static const unsigned dimCell
    Definition volumeiterators.hh:87
    \n+
    CellIterator endCells() const
    Definition volumeiterators.hh:109
    \n+
    CornerIterator endCorners() const
    Definition volumeiterators.hh:116
    \n+
    VTK::CornerIterator< CellIterator > CornerIterator
    Definition volumeiterators.hh:94
    \n+
    VTK::Corner< Cell > Corner
    Definition volumeiterators.hh:93
    \n+
    CornerIterator PointIterator
    Definition volumeiterators.hh:97
    \n+
    GV::template Codim< 0 >::template Partition< InteriorBorder_Partition >::Iterator CellIterator
    Definition volumeiterators.hh:91
    \n+
    PointIterator endPoints() const
    Definition volumeiterators.hh:121
    \n+
    Corner Point
    Definition volumeiterators.hh:96
    \n+
    CornerIterator beginCorners() const
    Definition volumeiterators.hh:113
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,425 +2,286 @@\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n * io\n * file\n- * dgfparser\n-dgfgeogrid.hh\n+ * vtk\n+volumeiterators.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGFGEOGRID_HH\n-6#define DUNE_DGFGEOGRID_HH\n-7\n-8#include \n-9\n-10#include \n-11#include \n-12#include \n-13#include \n-14#include \n+5\n+6#ifndef DUNE_GRID_IO_FILE_VTK_VOLUMEITERATORS_HH\n+7#define DUNE_GRID_IO_FILE_VTK_VOLUMEITERATORS_HH\n+8\n+9#include \n+10\n+11#include \n+12#include \n+13#include \n+14#include \n 15\n-16#include \n-17\n-18\n-19namespace Dune\n-20{\n+16namespace Dune {\n+19\n+20 namespace VTK {\n 21\n-22 /************************************************************************\n-23 * Warning:\n-24 * Reading DGF files directly into a GeometryGrid is a dirty hack for\n-25 * two reasons:\n-26 * 1) The host grid and coordinate function are never deleted (dangling\n-27 * pointers).\n-28 * 2) The coordinate function has to provide a default constructor\n-29 ************************************************************************/\n+22 template\n+23 class ConformingVolumeIteratorFactory {\n+24 const GV& gv;\n+25\n+26 typedef typename GV::IndexSet IndexSet;\n+27 const IndexSet& indexSet() const { return gv.indexSet(); }\n+28 friend class ConformingConnectivityWriter<\n+29 ConformingVolumeIteratorFactory >;\n 30\n-31 // External Forward Declarations\n-32 // -----------------------------\n+31 public:\n+32 static const unsigned dimCell = GV::dimension;\n 33\n-34 template< class GridImp, class IntersectionImp >\n-35 class Intersection;\n-36\n+34 typedef typename GV::template Codim<0>::Entity Cell;\n+35 typedef typename GV::template Codim<0>::\n+36 template Partition::Iterator CellIterator;\n 37\n-38\n-39 // DGFCoordFunction\n-40 // ----------------\n-41\n-42 template< int dimD, int dimR >\n-43 class DGFCoordFunction\n-44 : public AnalyticalCoordFunction< double, dimD, dimR, DGFCoordFunction<\n-dimD, dimR > >\n-45 {\n-46 typedef DGFCoordFunction<_dimD,_dimR_> This;\n-47 typedef AnalyticalCoordFunction<_double,_dimD,_dimR,_This_> Base;\n+38 typedef VTK::Corner Corner;\n+39 typedef VTK::CornerIterator CornerIterator;\n+40\n+41 typedef VTK::Corner Point;\n+42 typedef VTK::PointIterator PointIterator;\n+44\n+45 typedef ConformingConnectivityWriter\n+46 > ConnectivityWriter;\n+47 typedef typename GV::Communication Communication;\n 48\n-49 public:\n-50 typedef typename Base::DomainVector DomainVector;\n-51 typedef typename Base::RangeVector RangeVector;\n+49 explicit ConformingVolumeIteratorFactory(const GV& gv_)\n+50 : gv(gv_)\n+51 { }\n 52\n-53 typedef dgf::ProjectionBlock::Expression Expression;\n-54\n-55 DGFCoordFunction ( const Expression *expression )\n-56 : expression_( expression )\n-57 {}\n-58\n-59 void evaluate ( const DomainVector &x, RangeVector &y ) const\n-60 {\n-61 std::vector< double > vx( dimD );\n-62 std::vector< double > vy;\n-63 for( int i = 0; i < dimD; ++i )\n-64 vx[ i ] = x[ i ];\n-65 expression_->evaluate( vx, vy );\n-66 assert( vy.size() == size_t( dimR ) );\n-67 for( int i = 0; i < dimR; ++i )\n-68 y[ i ] = vy[ i ];\n+53 CellIterator beginCells() const {\n+54 return gv.template begin<0, InteriorBorder_Partition>();\n+55 }\n+56 CellIterator endCells() const {\n+57 return gv.template end<0, InteriorBorder_Partition>();\n+58 }\n+59\n+60 CornerIterator beginCorners() const {\n+61 return CornerIterator(beginCells(), endCells());\n+62 }\n+63 CornerIterator endCorners() const {\n+64 return CornerIterator(endCells());\n+65 }\n+66\n+67 PointIterator beginPoints() const {\n+68 return PointIterator(beginCells(), endCells(), gv.indexSet());\n 69 }\n-70\n-71 private:\n-72 const Expression *expression_;\n-73 };\n-74\n-75\n-76\n-77 // DGFCoordFunctionFactory\n-78 // -----------------------\n-79\n-80 template< class HostGrid, class CoordFunction,\n-81 bool discrete = GeoGrid::isDiscreteCoordFunctionInterface< typename\n-CoordFunction::Interface >::value >\n-82 struct DGFCoordFunctionFactory;\n-83\n-84\n-85 template< class HostGrid, class CoordFunction >\n-86 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, false >\n-87 {\n-88 static CoordFunction *create ( std::istream &, const HostGrid & )\n-89 {\n-90 return new CoordFunction;\n-91 }\n-92 };\n-93\n-94\n-95 template< class HostGrid, class CoordFunction >\n-96 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, true >\n-97 {\n-98 static CoordFunction *create ( std::istream &, const HostGrid &hostGrid )\n-99 {\n-100 return new CoordFunction( hostGrid );\n-101 }\n-102 };\n-103\n-104\n-105 template< class HostGrid, int dimD, int dimR >\n-106 struct DGFCoordFunctionFactory< HostGrid, DGFCoordFunction< dimD, dimR >,\n-false >\n-107 {\n-108 typedef DGFCoordFunction<_dimD,_dimR_> CoordFunction;\n-109\n-110 static CoordFunction *create ( std::istream &input, const HostGrid\n-&hostGrid )\n-111 {\n-112 dgf::ProjectionBlock projectionBlock( input, dimR );\n-113 const typename CoordFunction::Expression *expression =\n-projectionBlock.function( \"coordfunction\" );\n-114 if( expression == 0 )\n-115 DUNE_THROW( DGFException, \"no coordfunction specified in DGF file.\" );\n-116 return new CoordFunction( expression );\n-117 }\n-118 };\n+70 PointIterator endPoints() const {\n+71 return PointIterator(endCells());\n+72 }\n+73\n+74 ConnectivityWriter makeConnectivity() const {\n+75 return ConnectivityWriter(*this);\n+76 }\n+77 const Communication& comm() const {\n+78 return gv.comm();\n+79 }\n+80 };\n+81\n+82 template\n+83 class NonConformingVolumeIteratorFactory {\n+84 const GV& gv;\n+85\n+86 public:\n+87 static const unsigned dimCell = GV::dimension;\n+88\n+89 typedef typename GV::template Codim<0>::Entity Cell;\n+90 typedef typename GV::template Codim<0>::\n+91 template Partition::Iterator CellIterator;\n+92\n+93 typedef VTK::Corner Corner;\n+94 typedef VTK::CornerIterator CornerIterator;\n+95\n+96 typedef Corner Point;\n+97 typedef CornerIterator PointIterator;\n+98\n+99 typedef NonConformingConnectivityWriter ConnectivityWriter;\n+100 typedef typename GV::Communication Communication;\n+101\n+102 explicit NonConformingVolumeIteratorFactory(const GV& gv_)\n+103 : gv(gv_)\n+104 { }\n+105\n+106 CellIterator beginCells() const {\n+107 return gv.template begin<0, InteriorBorder_Partition>();\n+108 }\n+109 CellIterator endCells() const {\n+110 return gv.template end<0, InteriorBorder_Partition>();\n+111 }\n+112\n+113 CornerIterator beginCorners() const {\n+114 return CornerIterator(beginCells(), endCells());\n+115 }\n+116 CornerIterator endCorners() const {\n+117 return CornerIterator(endCells());\n+118 }\n 119\n-120\n-121\n-122 // DGFGridFactory for GeometryGrid\n-123 // -------------------------------\n-124\n-125 template< class HostGrid, class CoordFunction, class Allocator >\n-126 struct DGFGridFactory< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n-127 {\n-128 typedef GeometryGrid<_HostGrid,_CoordFunction,_Allocator_> Grid;\n-129\n-130 const static int dimension = Grid::dimension;\n-131 typedef MPIHelper::MPICommunicator MPICommunicator;\n-132 typedef typename Grid::template Codim<0>::Entity Element;\n-133 typedef typename Grid::template Codim::Entity Vertex;\n+120 PointIterator beginPoints() const { return beginCorners(); }\n+121 PointIterator endPoints() const { return endCorners(); }\n+122\n+123 ConnectivityWriter makeConnectivity() const {\n+124 return ConnectivityWriter();\n+125 }\n+126 const Communication& comm() const {\n+127 return gv.comm();\n+128 }\n+129 };\n+130\n+131 } // namespace VTK\n+132\n 134\n-135 typedef DGFCoordFunctionFactory<_HostGrid,_CoordFunction_>\n-CoordFunctionFactory;\n+135} // namespace Dune\n 136\n-137 explicit DGFGridFactory ( std::istream &input,\n-138 MPICommunicator comm = MPIHelper::getCommunicator() )\n-139 : dgfHostFactory_( input, comm ),\n-140 grid_( 0 )\n-141 {\n-142 auto hostGrid = std::shared_ptr(dgfHostFactory_.grid());\n-143 assert( hostGrid != 0 );\n-144 auto coordFunction = std::shared_ptr(CoordFunctionFactory::\n-create( input, *hostGrid ));\n-145 grid_ = new Grid( hostGrid, coordFunction );\n-146 }\n-147\n-148 explicit DGFGridFactory ( const std::string &filename,\n-149 MPICommunicator comm = MPIHelper::getCommunicator() )\n-150 : dgfHostFactory_( filename, comm ),\n-151 grid_( 0 )\n-152 {\n-153 auto hostGrid = std::shared_ptr(dgfHostFactory_.grid());\n-154 assert( hostGrid != 0 );\n-155 std::ifstream input( filename.c_str() );\n-156 auto coordFunction = std::shared_ptr(CoordFunctionFactory::\n-create( input, *hostGrid ));\n-157 grid_ = new Grid( hostGrid, coordFunction );\n-158 }\n-159\n-160 Grid *grid () const\n-161 {\n-162 return grid_;\n-163 }\n-164\n-165 template< class Intersection >\n-166 bool wasInserted ( const Intersection &intersection ) const\n-167 {\n-168 return dgfHostFactory_.wasInserted( HostGridAccess<_Grid_>::\n-hostIntersection( intersection ) );\n-169 }\n-170\n-171 template< class Intersection >\n-172 int boundaryId ( const Intersection &intersection ) const\n-173 {\n-174 return dgfHostFactory_.boundaryId( HostGridAccess<_Grid_>::hostIntersection\n-( intersection ) );\n-175 }\n-176\n-177 template< int codim >\n-178 int numParameters () const\n-179 {\n-180 return dgfHostFactory_.template numParameters< codim >();\n-181 }\n-182\n-183 // return true if boundary parameters found\n-184 bool haveBoundaryParameters () const\n-185 {\n-186 return dgfHostFactory_.haveBoundaryParameters();\n-187 }\n-188\n-189 template< class GG, class II >\n-190 const typename DGFBoundaryParameter::type &\n-191 boundaryParameter ( const Dune::Intersection<_GG,_II_> & intersection )\n-const\n-192 {\n-193 return dgfHostFactory_.boundaryParameter( HostGridAccess<_Grid_>::\n-hostIntersection( intersection ) );\n-194 }\n-195\n-196 template< class Entity >\n-197 std::vector< double > ¶meter ( const Entity &entity )\n-198 {\n-199 return dgfHostFactory_.parameter( HostGridAccess<_Grid_>::hostEntity\n-( entity ) );\n-200 }\n-201\n-202 private:\n-203 DGFGridFactory<_HostGrid_> dgfHostFactory_;\n-204 Grid *grid_;\n-205 };\n-206\n-207\n-208\n-209 // DGFGridInfo for GeometryGrid\n-210 // ----------------------------\n-211\n-212 template< class HostGrid, class CoordFunction, class Allocator >\n-213 struct DGFGridInfo< GeometryGrid< HostGrid, CoordFunction, Allocator > >\n-214 {\n-215 static int refineStepsForHalf ()\n-216 {\n-217 return DGFGridInfo<_HostGrid_>::refineStepsForHalf();\n-218 }\n-219\n-220 static double refineWeight ()\n-221 {\n-222 return -1.0;\n-223 }\n-224 };\n-225\n-226}\n-227\n-228#endif // #ifndef DUNE_DGFGEOGRID_HH\n-geometrygrid.hh\n-parser.hh\n-hostgridaccess.hh\n+137#endif // DUNE_GRID_IO_FILE_VTK_VOLUMEITERATORS_HH\n+gridenums.hh\n+corneriterator.hh\n+pointiterator.hh\n+functionwriter.hh\n+corner.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::Grid\n-G Grid\n-Definition dgfgridfactory.hh:39\n-Dune::DGFGridFactory::dimension\n-static const int dimension\n-Definition dgfgridfactory.hh:40\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Grid\n-Grid abstract base class.\n-Definition common/grid.hh:375\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::AnalyticalCoordFunction\n-Derive an implementation of an analytical coordinate function from this class.\n-Definition coordfunction.hh:134\n-Dune::AnalyticalCoordFunction::DomainVector\n-Base::DomainVector DomainVector\n-Definition coordfunction.hh:139\n-Dune::AnalyticalCoordFunction::RangeVector\n-Base::RangeVector RangeVector\n-Definition coordfunction.hh:140\n-Dune::GeometryGrid\n-grid wrapper replacing the geometries\n-Definition geometrygrid/grid.hh:86\n-Dune::GeometryGrid::Codim\n-traits structure containing types for a codimension\n-Definition geometrygrid/grid.hh:606\n-Dune::HostGridAccess\n-provides access to host grid objects from GeometryGrid\n-Definition identitygrid.hh:37\n-Dune::dgf::ProjectionBlock\n-Definition io/file/dgfparser/blocks/projection.hh:24\n-Dune::dgf::ProjectionBlock::function\n-ExpressionPointer function(const std::string &name) const\n-Definition io/file/dgfparser/blocks/projection.hh:100\n-Dune::dgf::ProjectionBlock::Expression\n-Definition io/file/dgfparser/blocks/projection.hh:160\n-Dune::dgf::ProjectionBlock::Expression::evaluate\n-virtual void evaluate(const Vector &argument, Vector &result) const =0\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n-Dune::DGFCoordFunction\n-Definition dgfgeogrid.hh:45\n-Dune::DGFCoordFunction::DomainVector\n-Base::DomainVector DomainVector\n-Definition dgfgeogrid.hh:50\n-Dune::DGFCoordFunction::evaluate\n-void evaluate(const DomainVector &x, RangeVector &y) const\n-Definition dgfgeogrid.hh:59\n-Dune::DGFCoordFunction::Expression\n-dgf::ProjectionBlock::Expression Expression\n-Definition dgfgeogrid.hh:53\n-Dune::DGFCoordFunction::DGFCoordFunction\n-DGFCoordFunction(const Expression *expression)\n-Definition dgfgeogrid.hh:55\n-Dune::DGFCoordFunction::RangeVector\n-Base::RangeVector RangeVector\n-Definition dgfgeogrid.hh:51\n-Dune::DGFCoordFunctionFactory\n-Definition dgfgeogrid.hh:82\n-Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_false_>::create\n-static CoordFunction * create(std::istream &, const HostGrid &)\n-Definition dgfgeogrid.hh:88\n-Dune::DGFCoordFunctionFactory<_HostGrid,_CoordFunction,_true_>::create\n-static CoordFunction * create(std::istream &, const HostGrid &hostGrid)\n-Definition dgfgeogrid.hh:98\n-Dune::DGFCoordFunctionFactory<_HostGrid,_DGFCoordFunction<_dimD,_dimR_>,_false\n->::create\n-static CoordFunction * create(std::istream &input, const HostGrid &hostGrid)\n-Definition dgfgeogrid.hh:110\n-Dune::DGFCoordFunctionFactory<_HostGrid,_DGFCoordFunction<_dimD,_dimR_>,_false\n->::CoordFunction\n-DGFCoordFunction< dimD, dimR > CoordFunction\n-Definition dgfgeogrid.hh:108\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-Vertex\n-Grid::template Codim< dimension >::Entity Vertex\n-Definition dgfgeogrid.hh:133\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-boundaryId\n-int boundaryId(const Intersection &intersection) const\n-Definition dgfgeogrid.hh:172\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-MPICommunicator\n-MPIHelper::MPICommunicator MPICommunicator\n-Definition dgfgeogrid.hh:131\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection<\n-GG, II > &intersection) const\n-Definition dgfgeogrid.hh:191\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-DGFGridFactory\n-DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::\n-getCommunicator())\n-Definition dgfgeogrid.hh:137\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-Element\n-Grid::template Codim< 0 >::Entity Element\n-Definition dgfgeogrid.hh:132\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-grid\n-Grid * grid() const\n-Definition dgfgeogrid.hh:160\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-CoordFunctionFactory\n-DGFCoordFunctionFactory< HostGrid, CoordFunction > CoordFunctionFactory\n-Definition dgfgeogrid.hh:135\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-Grid\n-GeometryGrid< HostGrid, CoordFunction, Allocator > Grid\n-Definition dgfgeogrid.hh:128\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-numParameters\n-int numParameters() const\n-Definition dgfgeogrid.hh:178\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-parameter\n-std::vector< double > & parameter(const Entity &entity)\n-Definition dgfgeogrid.hh:197\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::\n-getCommunicator())\n-Definition dgfgeogrid.hh:148\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-wasInserted\n-bool wasInserted(const Intersection &intersection) const\n-Definition dgfgeogrid.hh:166\n-Dune::DGFGridFactory<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-Definition dgfgeogrid.hh:184\n-Dune::DGFGridInfo<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-refineWeight\n-static double refineWeight()\n-Definition dgfgeogrid.hh:220\n-Dune::DGFGridInfo<_GeometryGrid<_HostGrid,_CoordFunction,_Allocator_>_>::\n-refineStepsForHalf\n-static int refineStepsForHalf()\n-Definition dgfgeogrid.hh:215\n-Dune::DGFGridInfo\n-Some simple static information for a given GridType.\n-Definition io/file/dgfparser/dgfparser.hh:56\n-Dune::DGFGridInfo::refineStepsForHalf\n-static int refineStepsForHalf()\n-number of globalRefine steps needed to refuce h by 0.5\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n-dgfparser.hh\n-intersection.hh\n-projection.hh\n+Dune::VTK::Corner\n+simple class representing a corner of a cell\n+Definition corner.hh:25\n+Dune::VTK::CornerIterator\n+iterate over the corners of some cell range\n+Definition corneriterator.hh:39\n+Dune::VTK::ConformingConnectivityWriter\n+writer for the connectivity array in conforming mode\n+Definition functionwriter.hh:195\n+Dune::VTK::NonConformingConnectivityWriter\n+writer for the connectivity array in nonconforming mode\n+Definition functionwriter.hh:261\n+Dune::VTK::PointIterator\n+iterate over the points of some corner range\n+Definition pointiterator.hh:58\n+Dune::VTK::ConformingVolumeIteratorFactory\n+Definition volumeiterators.hh:23\n+Dune::VTK::ConformingVolumeIteratorFactory::endCorners\n+CornerIterator endCorners() const\n+Definition volumeiterators.hh:63\n+Dune::VTK::ConformingVolumeIteratorFactory::CornerIterator\n+VTK::CornerIterator< CellIterator > CornerIterator\n+Definition volumeiterators.hh:39\n+Dune::VTK::ConformingVolumeIteratorFactory::Corner\n+VTK::Corner< Cell > Corner\n+Definition volumeiterators.hh:38\n+Dune::VTK::ConformingVolumeIteratorFactory::endCells\n+CellIterator endCells() const\n+Definition volumeiterators.hh:56\n+Dune::VTK::ConformingVolumeIteratorFactory::Communication\n+GV::Communication Communication\n+Definition volumeiterators.hh:47\n+Dune::VTK::ConformingVolumeIteratorFactory::PointIterator\n+VTK::PointIterator< CellIterator, typename GV::IndexSet > PointIterator\n+Definition volumeiterators.hh:43\n+Dune::VTK::ConformingVolumeIteratorFactory::ConnectivityWriter\n+ConformingConnectivityWriter< ConformingVolumeIteratorFactory< GV > >\n+ConnectivityWriter\n+Definition volumeiterators.hh:46\n+Dune::VTK::ConformingVolumeIteratorFactory::beginCorners\n+CornerIterator beginCorners() const\n+Definition volumeiterators.hh:60\n+Dune::VTK::ConformingVolumeIteratorFactory::dimCell\n+static const unsigned dimCell\n+Definition volumeiterators.hh:32\n+Dune::VTK::ConformingVolumeIteratorFactory::endPoints\n+PointIterator endPoints() const\n+Definition volumeiterators.hh:70\n+Dune::VTK::ConformingVolumeIteratorFactory::comm\n+const Communication & comm() const\n+Definition volumeiterators.hh:77\n+Dune::VTK::ConformingVolumeIteratorFactory::ConformingVolumeIteratorFactory\n+ConformingVolumeIteratorFactory(const GV &gv_)\n+Definition volumeiterators.hh:49\n+Dune::VTK::ConformingVolumeIteratorFactory::Point\n+VTK::Corner< Cell > Point\n+Definition volumeiterators.hh:41\n+Dune::VTK::ConformingVolumeIteratorFactory::makeConnectivity\n+ConnectivityWriter makeConnectivity() const\n+Definition volumeiterators.hh:74\n+Dune::VTK::ConformingVolumeIteratorFactory::beginCells\n+CellIterator beginCells() const\n+Definition volumeiterators.hh:53\n+Dune::VTK::ConformingVolumeIteratorFactory::Cell\n+GV::template Codim< 0 >::Entity Cell\n+Definition volumeiterators.hh:34\n+Dune::VTK::ConformingVolumeIteratorFactory::beginPoints\n+PointIterator beginPoints() const\n+Definition volumeiterators.hh:67\n+Dune::VTK::ConformingVolumeIteratorFactory::CellIterator\n+GV::template Codim< 0 >::template Partition< InteriorBorder_Partition >::\n+Iterator CellIterator\n+Definition volumeiterators.hh:36\n+Dune::VTK::NonConformingVolumeIteratorFactory\n+Definition volumeiterators.hh:83\n+Dune::VTK::NonConformingVolumeIteratorFactory::comm\n+const Communication & comm() const\n+Definition volumeiterators.hh:126\n+Dune::VTK::NonConformingVolumeIteratorFactory::beginPoints\n+PointIterator beginPoints() const\n+Definition volumeiterators.hh:120\n+Dune::VTK::NonConformingVolumeIteratorFactory::Communication\n+GV::Communication Communication\n+Definition volumeiterators.hh:100\n+Dune::VTK::NonConformingVolumeIteratorFactory::beginCells\n+CellIterator beginCells() const\n+Definition volumeiterators.hh:106\n+Dune::VTK::NonConformingVolumeIteratorFactory::Cell\n+GV::template Codim< 0 >::Entity Cell\n+Definition volumeiterators.hh:89\n+Dune::VTK::NonConformingVolumeIteratorFactory::\n+NonConformingVolumeIteratorFactory\n+NonConformingVolumeIteratorFactory(const GV &gv_)\n+Definition volumeiterators.hh:102\n+Dune::VTK::NonConformingVolumeIteratorFactory::makeConnectivity\n+ConnectivityWriter makeConnectivity() const\n+Definition volumeiterators.hh:123\n+Dune::VTK::NonConformingVolumeIteratorFactory::ConnectivityWriter\n+NonConformingConnectivityWriter< Cell > ConnectivityWriter\n+Definition volumeiterators.hh:99\n+Dune::VTK::NonConformingVolumeIteratorFactory::dimCell\n+static const unsigned dimCell\n+Definition volumeiterators.hh:87\n+Dune::VTK::NonConformingVolumeIteratorFactory::endCells\n+CellIterator endCells() const\n+Definition volumeiterators.hh:109\n+Dune::VTK::NonConformingVolumeIteratorFactory::endCorners\n+CornerIterator endCorners() const\n+Definition volumeiterators.hh:116\n+Dune::VTK::NonConformingVolumeIteratorFactory::CornerIterator\n+VTK::CornerIterator< CellIterator > CornerIterator\n+Definition volumeiterators.hh:94\n+Dune::VTK::NonConformingVolumeIteratorFactory::Corner\n+VTK::Corner< Cell > Corner\n+Definition volumeiterators.hh:93\n+Dune::VTK::NonConformingVolumeIteratorFactory::PointIterator\n+CornerIterator PointIterator\n+Definition volumeiterators.hh:97\n+Dune::VTK::NonConformingVolumeIteratorFactory::CellIterator\n+GV::template Codim< 0 >::template Partition< InteriorBorder_Partition >::\n+Iterator CellIterator\n+Definition volumeiterators.hh:91\n+Dune::VTK::NonConformingVolumeIteratorFactory::endPoints\n+PointIterator endPoints() const\n+Definition volumeiterators.hh:121\n+Dune::VTK::NonConformingVolumeIteratorFactory::Point\n+Corner Point\n+Definition volumeiterators.hh:96\n+Dune::VTK::NonConformingVolumeIteratorFactory::beginCorners\n+CornerIterator beginCorners() const\n+Definition volumeiterators.hh:113\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00893_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00716_source.html", "comments": ["Files 80% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: dgfyasp.hh Source File\n+dune-grid: albertagrid.cc Source File\n \n \n \n \n \n \n \n@@ -70,619 +70,803 @@\n
    \n
    \n
    \n \n \n \n \n
    \n-
    dgfyasp.hh
    \n+
    albertagrid.cc
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5#ifndef DUNE_DGFPARSERYASP_HH
    \n-
    6#define DUNE_DGFPARSERYASP_HH
    \n+
    5#ifndef DUNE_ALBERTAGRID_CC
    \n+
    6#define DUNE_ALBERTAGRID_CC
    \n
    7
    \n-\n-\n-
    10#include "dgfparser.hh"
    \n-
    11
    \n-
    12namespace Dune
    \n-
    13{
    \n-
    14
    \n-
    15 // External Forward Declarations
    \n-
    16 // -----------------------------
    \n-
    17
    \n-
    18 template< class GridImp, class IntersectionImp >
    \n-
    19 class Intersection;
    \n-
    20
    \n+
    8//************************************************************************
    \n+
    9//
    \n+
    10// implementation of AlbertaGrid
    \n+
    11//
    \n+
    12// namespace Dune
    \n+
    13//
    \n+
    14//************************************************************************
    \n+
    15#include "geometry.cc"
    \n+
    16#include "entity.cc"
    \n+
    17#include "intersection.cc"
    \n+
    18
    \n+
    19namespace Dune
    \n+
    20{
    \n
    21
    \n-
    22 namespace dgf
    \n+
    \n+
    22 namespace Alberta
    \n
    23 {
    \n-
    24
    \n-
    \n-\n-
    39 : public GridParameterBlock
    \n-
    40 {
    \n-
    41 protected:
    \n-
    42 int _overlap; // overlap for YaspGrid
    \n-
    43
    \n-
    44 public:
    \n-
    \n-
    46 YaspGridParameterBlock( std::istream &in )
    \n-
    47 : GridParameterBlock( in ),
    \n-
    48 _overlap( 0 ) // default value
    \n-
    49 {
    \n-
    50 // check overlap
    \n-
    51 if( findtoken( "overlap" ) )
    \n-
    52 {
    \n-
    53 int x;
    \n-
    54 if( getnextentry(x) ) _overlap = x;
    \n-
    55 else
    \n-
    56 {
    \n-
    57 dwarn << "GridParameterBlock: found keyword `overlap' but no value, defaulting to `" << _overlap <<"' !\\n";
    \n-
    58 }
    \n-
    59
    \n-
    60 if (_overlap < 0)
    \n-
    61 {
    \n-
    62 DUNE_THROW(DGFException,"Negative overlap specified!");
    \n-
    63 }
    \n-
    64 }
    \n-
    65 else
    \n-
    66 {
    \n-
    67 dwarn << "YaspGridParameterBlock: Parameter 'overlap' not specified, "
    \n-
    68 << "defaulting to '" << _overlap << "'." << std::endl;
    \n-
    69 }
    \n-
    70
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    \n-
    74 int overlap () const
    \n-
    75 {
    \n-
    76 return _overlap;
    \n-
    77 }
    \n+\n+
    25 }
    \n
    \n-
    78
    \n-
    79 };
    \n-
    \n-
    80
    \n-
    81 }
    \n+
    26
    \n+
    27
    \n+
    28 template< int dim, int dimworld >
    \n+
    \n+\n+
    30 {
    \n+
    31 // If this check fails, define ALBERTA_DIM accordingly
    \n+
    32 static_assert((dimworld == Alberta::dimWorld),
    \n+
    33 "Template Parameter dimworld does not match "
    \n+
    34 "ALBERTA's DIM_OF_WORLD setting.");
    \n+
    35 }
    \n+
    \n+
    36
    \n+
    37
    \n+
    38 // AlbertaGrid
    \n+
    39 // -----------
    \n+
    40
    \n+
    41 template< int dim, int dimworld >
    \n+
    \n+\n+
    43 : mesh_(),
    \n+
    44 maxlevel_( 0 ),
    \n+
    45 numBoundarySegments_( 0 ),
    \n+
    46 hIndexSet_( dofNumbering_ ),
    \n+
    47 idSet_( hIndexSet_ ),
    \n+
    48 levelIndexVec_( (size_t)MAXL, 0 ),
    \n+
    49 leafIndexSet_( 0 ),
    \n+
    50 sizeCache_( *this ),
    \n+
    51 leafMarkerVector_( dofNumbering_ ),
    \n+
    52 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n+
    53 {
    \n+\n+
    55 }
    \n+
    \n+
    56
    \n+
    57
    \n+
    58 template< int dim, int dimworld >
    \n+
    59 template< class Proj, class Impl >
    \n+\n+
    \n+\n+\n+
    63 : mesh_(),
    \n+
    64 maxlevel_( 0 ),
    \n+
    65 numBoundarySegments_( 0 ),
    \n+
    66 hIndexSet_( dofNumbering_ ),
    \n+
    67 idSet_( hIndexSet_ ),
    \n+
    68 levelIndexVec_( (size_t)MAXL, 0 ),
    \n+
    69 leafIndexSet_ ( 0 ),
    \n+
    70 sizeCache_( *this ),
    \n+
    71 leafMarkerVector_( dofNumbering_ ),
    \n+
    72 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n+
    73 {
    \n+\n+
    75
    \n+
    76 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );
    \n+
    77 if( !mesh_ )
    \n+
    78 DUNE_THROW( AlbertaError, "Invalid macro data structure." );
    \n+
    79
    \n+
    80 setup();
    \n+
    81 hIndexSet_.create();
    \n
    82
    \n-
    86 template <typename ctype, int dim>
    \n-
    \n-
    87 struct DGFGridFactory< YaspGrid<dim, EquidistantCoordinates<ctype, dim> > >
    \n-
    88 {
    \n-\n-
    90 const static int dimension = Grid::dimension;
    \n-
    91 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    92
    \n-
    93 private:
    \n-
    94 typedef FieldVector< ctype, dimension > Point;
    \n-\n-
    96
    \n-
    97 public:
    \n-
    \n-
    98 explicit DGFGridFactory ( std::istream &input,
    \n-
    99 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    100 {
    \n-
    101 generate( input, comm );
    \n-
    102 }
    \n+
    83 calcExtras();
    \n+
    84 }
    \n
    \n+
    85
    \n+
    86
    \n+
    87 template< int dim, int dimworld >
    \n+\n+
    \n+\n+
    90 const std::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection )
    \n+
    91 : mesh_(),
    \n+
    92 maxlevel_( 0 ),
    \n+
    93 numBoundarySegments_( 0 ),
    \n+
    94 hIndexSet_( dofNumbering_ ),
    \n+
    95 idSet_( hIndexSet_ ),
    \n+
    96 levelIndexVec_( (size_t)MAXL, 0 ),
    \n+
    97 leafIndexSet_ ( 0 ),
    \n+
    98 sizeCache_( *this ),
    \n+
    99 leafMarkerVector_( dofNumbering_ ),
    \n+
    100 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n+
    101 {
    \n+\n
    103
    \n-
    \n-
    104 explicit DGFGridFactory ( const std::string &filename,
    \n-
    105 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    106 {
    \n-
    107 std::ifstream input( filename.c_str() );
    \n-
    108 if( !input )
    \n-
    109 DUNE_THROW( DGFException, "Error: Macrofile '" << filename << "' not found" );
    \n-
    110 generate( input, comm );
    \n-
    111 }
    \n-
    \n-
    112
    \n-
    \n-\n-
    114 {
    \n-
    115 delete boundaryDomainBlock_;
    \n-
    116 }
    \n-
    \n-
    117
    \n-
    \n-
    118 Grid *grid() const
    \n-
    119 {
    \n-
    120 return grid_;
    \n-
    121 }
    \n-
    \n-
    122
    \n-
    123 template <class Intersection>
    \n-
    \n-
    124 bool wasInserted(const Intersection &intersection) const
    \n-
    125 {
    \n-
    126 return false;
    \n-
    127 }
    \n-
    \n-
    128
    \n-
    129 template <class Intersection>
    \n-
    \n-
    130 int boundaryId(const Intersection &intersection) const
    \n-
    131 {
    \n-
    132 if( boundaryDomainBlock_->isactive() )
    \n-
    133 {
    \n-
    134 std::vector< Point > corners;
    \n-
    135 getCorners( intersection.geometry(), corners );
    \n-
    136 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n-
    137 if( data )
    \n-
    138 return data->id();
    \n-
    139 else
    \n-
    140 return intersection.indexInInside();
    \n-
    141 }
    \n-
    142 else
    \n-
    143 return intersection.indexInInside();
    \n-
    144 }
    \n-
    \n-
    145
    \n-
    146 template< int codim >
    \n-
    \n-
    147 int numParameters () const
    \n-
    148 {
    \n-
    149 return 0;
    \n-
    150 }
    \n-
    \n-
    151
    \n-
    152 // return true if boundary parameters found
    \n-
    \n-\n-
    154 {
    \n-
    155 return boundaryDomainBlock_->hasParameter();
    \n-
    156 }
    \n-
    \n-
    157
    \n-
    158 template< class GG, class II >
    \n-
    159 const typename DGFBoundaryParameter::type &
    \n-
    \n-
    160 boundaryParameter ( const Intersection< GG, II > & intersection ) const
    \n-
    161 {
    \n-\n-
    163 {
    \n-
    164 std::vector< Point > corners;
    \n-
    165 getCorners( intersection.geometry(), corners );
    \n-
    166 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n-
    167 if( data )
    \n-
    168 return data->parameter();
    \n-
    169 else
    \n-\n-
    171 }
    \n-
    172 else
    \n-\n-
    174 }
    \n-
    \n-
    175
    \n-
    176 template< class Entity >
    \n-
    \n-
    177 std::vector<double> &parameter ( const Entity & )
    \n-
    178 {
    \n-
    179 return emptyParam;
    \n-
    180 }
    \n-
    \n-
    181
    \n-
    182 private:
    \n-
    183 void generate( std::istream &gridin, MPICommunicatorType comm );
    \n-
    184
    \n-
    185 template< class Geometry >
    \n-
    186 static void getCorners ( const Geometry &geometry, std::vector< Point > &corners )
    \n-
    187 {
    \n-
    188 corners.resize( geometry.corners() );
    \n-
    189 for( int i = 0; i < geometry.corners(); ++i )
    \n-
    190 {
    \n-
    191 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );
    \n-
    192 for( int j = 0; j < dimension; ++j )
    \n-
    193 corners[ i ][ j ] = corner[ j ];
    \n-
    194 }
    \n-
    195 }
    \n-
    196
    \n-
    197 Grid *grid_;
    \n-
    198 dgf::BoundaryDomBlock *boundaryDomainBlock_;
    \n-
    199 std::vector<double> emptyParam;
    \n-
    200 };
    \n+
    104 if( projection != 0 )
    \n+
    105 {
    \n+
    106 Alberta::DuneGlobalBoundaryProjectionFactory< dimension > projectionFactory( projection );
    \n+
    107 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );
    \n+
    108 }
    \n+
    109 else
    \n+
    110 numBoundarySegments_ = mesh_.create( macroData );
    \n+
    111 if( !mesh_ )
    \n+
    112 DUNE_THROW( AlbertaError, "Invalid macro data structure." );
    \n+
    113
    \n+
    114 setup();
    \n+
    115 hIndexSet_.create();
    \n+
    116
    \n+
    117 calcExtras();
    \n+
    118 }
    \n+
    \n+
    119
    \n+
    120
    \n+
    121 template < int dim, int dimworld >
    \n+\n+
    \n+
    123 ::AlbertaGrid ( const std::string &macroGridFileName )
    \n+
    124 : mesh_(),
    \n+
    125 maxlevel_( 0 ),
    \n+
    126 hIndexSet_( dofNumbering_ ),
    \n+
    127 idSet_( hIndexSet_ ),
    \n+
    128 levelIndexVec_( (size_t)MAXL, 0 ),
    \n+
    129 leafIndexSet_ ( 0 ),
    \n+
    130 sizeCache_( *this ),
    \n+
    131 leafMarkerVector_( dofNumbering_ ),
    \n+
    132 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )
    \n+
    133 {
    \n+\n+
    135
    \n+
    136 numBoundarySegments_ = mesh_.create( macroGridFileName );
    \n+
    137 if( !mesh_ )
    \n+
    138 {
    \n+\n+
    140 "Grid file '" << macroGridFileName
    \n+
    141 << "' is not in ALBERTA macro triangulation format." );
    \n+
    142 }
    \n+
    143
    \n+
    144 setup();
    \n+
    145 hIndexSet_.create();
    \n+
    146
    \n+
    147 calcExtras();
    \n+
    148
    \n+
    149 std::cout << typeName() << " created from macro grid file '"
    \n+
    150 << macroGridFileName << "'." << std::endl;
    \n+
    151 }
    \n+
    \n+
    152
    \n+
    153
    \n+
    154 template< int dim, int dimworld >
    \n+\n+
    156 {
    \n+
    157 dofNumbering_.create( mesh_ );
    \n+
    158
    \n+
    159 levelProvider_.create( dofNumbering_ );
    \n+
    160
    \n+
    161#if DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    162 coordCache_.create( dofNumbering_ );
    \n+
    163#endif
    \n+
    164 }
    \n+
    165
    \n+
    166
    \n+
    167 template< int dim, int dimworld >
    \n+
    168 inline void AlbertaGrid< dim, dimworld >::removeMesh ()
    \n+
    169 {
    \n+
    170 for( size_t i = 0; i < levelIndexVec_.size(); ++i )
    \n+
    171 {
    \n+
    172 if( levelIndexVec_[ i ] != 0 )
    \n+
    173 delete levelIndexVec_[ i ];
    \n+
    174 levelIndexVec_[ i ] = 0;
    \n+
    175 }
    \n+
    176
    \n+
    177 if( leafIndexSet_ != 0 )
    \n+
    178 delete leafIndexSet_;
    \n+
    179 leafIndexSet_ = 0;
    \n+
    180
    \n+
    181 // release dof vectors
    \n+
    182 hIndexSet_.release();
    \n+
    183 levelProvider_.release();
    \n+
    184#if DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    185 coordCache_.release();
    \n+
    186#endif
    \n+
    187 dofNumbering_.release();
    \n+
    188
    \n+
    189 sizeCache_.reset();
    \n+
    190
    \n+
    191 mesh_.release();
    \n+
    192 }
    \n+
    193
    \n+
    194
    \n+
    195 template< int dim, int dimworld >
    \n+
    \n+\n+
    197 {
    \n+
    198 removeMesh();
    \n+
    199 }
    \n
    \n+
    200
    \n
    201
    \n-
    202 // generate YaspGrid from the provided DGF
    \n-
    203 template< typename ctype, int dim >
    \n-
    204 inline void DGFGridFactory< YaspGrid< dim , EquidistantCoordinates<ctype, dim> > >
    \n-
    205 ::generate ( std::istream &gridin, MPICommunicatorType comm )
    \n-
    206 {
    \n-
    207 using std::abs;
    \n-
    208 dgf::IntervalBlock intervalBlock( gridin );
    \n-
    209
    \n-
    210 if( !intervalBlock.isactive() )
    \n-
    211 DUNE_THROW( DGFException, "YaspGrid can only be created from an interval block." );
    \n-
    212
    \n-
    213 if( intervalBlock.numIntervals() != 1 )
    \n-
    214 DUNE_THROW( DGFException, "YaspGrid can only handle 1 interval block." );
    \n-
    215
    \n-
    216 if( intervalBlock.dimw() != dim )
    \n-
    217 {
    \n-
    218 DUNE_THROW( DGFException,
    \n-
    219 "Cannot read an interval of dimension " << intervalBlock.dimw()
    \n-
    220 << " into a YaspGrid< " << dim << " >." );
    \n-
    221 }
    \n-
    222
    \n-
    223 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );
    \n-
    224
    \n-
    225 FieldVector<ctype, dim> lang;
    \n-
    226 std::array<int,dim> anz;
    \n-
    227 for( int i = 0; i < dim; ++i )
    \n-
    228 {
    \n-
    229 // check that start point is 0.0
    \n-
    230 if( abs( interval.p[ 0 ][ i ] ) > 1e-10 )
    \n-
    231 {
    \n-
    232 DUNE_THROW( DGFException,
    \n-
    233 "YaspGrid cannot handle grids with non-zero left lower corner." );
    \n-
    234 }
    \n-
    235
    \n-
    236 lang[ i ] = interval.p[ 1 ][ i ] - interval.p[ 0 ][ i ];
    \n-
    237 anz[ i ] = interval.n[ i ];
    \n-
    238 }
    \n-
    239
    \n-
    240 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation Transformation;
    \n-
    241 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );
    \n-
    242 std::bitset< dim > per;
    \n-
    243 const int numTrafos = trafoBlock.numTransformations();
    \n-
    244 for( int k = 0; k < numTrafos; ++k )
    \n-
    245 {
    \n-
    246 const Transformation &trafo = trafoBlock.transformation( k );
    \n-
    247
    \n-
    248 bool identity = true;
    \n-
    249 for( int i = 0; i < dim; ++i )
    \n-
    250 for( int j = 0; j < dim; ++j )
    \n-
    251 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);
    \n-
    252 if( !identity )
    \n-
    253 DUNE_THROW( DGFException, "YaspGrid can only handle shifts as periodic face transformations." );
    \n+
    202 template< int dim, int dimworld >
    \n+
    203 template< int codim, PartitionIteratorType pitype >
    \n+\n+
    205 ::template Codim< codim >::template Partition<pitype>::LevelIterator
    \n+
    \n+\n+
    207 {
    \n+\n+
    209 assert( level >= 0 );
    \n+
    210
    \n+
    211 if( level > maxlevel_ )
    \n+
    212 return lend< codim, pitype >( level );
    \n+
    213 MarkerVector &markerVector = levelMarkerVector_[ level ];
    \n+
    214
    \n+
    215 if( (codim > 0) && !markerVector.up2Date() )
    \n+
    216 markerVector.template markSubEntities< 1 >( lbegin< 0 >( level ), lend< 0 >( level ) );
    \n+
    217
    \n+
    218 return LevelIteratorImp( *this, &markerVector, level );
    \n+
    219 }
    \n+
    \n+
    220
    \n+
    221
    \n+
    222 template< int dim, int dimworld >
    \n+
    223 template< int codim, PartitionIteratorType pitype >
    \n+\n+
    225 ::template Codim< codim >::template Partition< pitype >::LevelIterator
    \n+
    \n+\n+
    227 {
    \n+\n+
    229 assert( level >= 0 );
    \n+
    230
    \n+
    231 return LevelIteratorImp( *this, level );
    \n+
    232 }
    \n+
    \n+
    233
    \n+
    234
    \n+
    235 template< int dim, int dimworld >
    \n+
    236 template< int codim >
    \n+\n+
    238 ::template Codim< codim >::LevelIterator
    \n+
    \n+\n+
    240 {
    \n+
    241 return lbegin< codim, All_Partition >( level );
    \n+
    242 }
    \n+
    \n+
    243
    \n+
    244
    \n+
    245 template< int dim, int dimworld >
    \n+
    246 template< int codim >
    \n+\n+
    248 ::template Codim< codim >::LevelIterator
    \n+
    \n+\n+
    250 {
    \n+
    251 return lend< codim, All_Partition >( level );
    \n+
    252 }
    \n+
    \n+
    253
    \n
    254
    \n-
    255 int numDirs = 0;
    \n-
    256 int dir = -1;
    \n-
    257 for( int i = 0; i < dim; ++i )
    \n-
    258 {
    \n-
    259 if( abs( trafo.shift[ i ] ) < 1e-10 )
    \n-
    260 continue;
    \n-
    261 dir = i;
    \n-
    262 ++numDirs;
    \n-
    263 }
    \n-
    264 if( (numDirs != 1) || (abs( abs( trafo.shift[ dir ] ) - lang[ dir ] ) >= 1e-10) )
    \n-
    265 {
    \n-
    266 std::cerr << "Transformation '" << trafo
    \n-
    267 << "' does not map boundaries on boundaries." << std::endl;
    \n-
    268 }
    \n-
    269 else
    \n-
    270 per[ dir ] = true;
    \n-
    271 }
    \n-
    272
    \n-
    273 // get grid parameters
    \n-
    274 dgf::YaspGridParameterBlock grdParam( gridin );
    \n-
    275
    \n-
    276 grid_ = new YaspGrid< dim , EquidistantCoordinates<ctype, dim> >( lang, anz, per, grdParam.overlap(), comm );
    \n-
    277
    \n-
    278 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );
    \n-
    279 }
    \n-
    280
    \n-
    284 template <typename ctype, int dim>
    \n-
    \n-\n-
    286 {
    \n-\n-
    288 const static int dimension = Grid::dimension;
    \n-
    289 typedef MPIHelper::MPICommunicator MPICommunicatorType;
    \n-
    290
    \n-
    291 private:
    \n-
    292 typedef FieldVector< ctype, dimension > Point;
    \n-\n-
    294
    \n-
    295 public:
    \n-
    \n-
    296 explicit DGFGridFactory ( std::istream &input,
    \n-
    297 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    298 {
    \n-
    299 generate( input, comm );
    \n-
    300 }
    \n+
    255 template< int dim, int dimworld >
    \n+
    256 template< int codim, PartitionIteratorType pitype >
    \n+\n+
    258 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n+
    \n+\n+
    260 {
    \n+\n+
    262
    \n+
    263 MarkerVector &markerVector = leafMarkerVector_;
    \n+
    \n+
    264 const int firstMarkedCodim = 2;
    \n+
    265 if( (codim >= firstMarkedCodim) && !markerVector.up2Date() )
    \n+\n+
    267
    \n+
    268 return LeafIteratorImp( *this, &markerVector, maxlevel_ );
    \n+
    269 }
    \n+
    270
    \n+
    \n+\n+
    272 template< int dim, int dimworld >
    \n+
    273 template< int codim, PartitionIteratorType pitype >
    \n+\n+
    275 ::template Codim< codim >::template Partition< pitype >::LeafIterator
    \n+
    \n+\n+
    277 {
    \n+\n+
    279 return LeafIteratorImp( *this, maxlevel_ );
    \n+
    280 }
    \n+
    281
    \n+
    282
    \n+
    \n+
    283 template< int dim, int dimworld >
    \n+
    284 template< int codim >
    \n+\n+
    \n+\n+\n+
    291
    \n+
    292
    \n+
    293 template< int dim, int dimworld >
    \n+
    294 template< int codim >
    \n+\n+
    296 ::template Codim< codim >::LeafIterator
    \n+
    \n+\n+
    298 {
    \n+\n+
    300 }
    \n
    \n
    301
    \n-
    \n-
    302 explicit DGFGridFactory ( const std::string &filename,
    \n-
    303 MPICommunicatorType comm = MPIHelper::getCommunicator() )
    \n-
    304 {
    \n-
    305 std::ifstream input( filename.c_str() );
    \n-
    306 generate( input, comm );
    \n-
    307 }
    \n-
    \n-
    308
    \n-
    \n-\n-
    310 {
    \n-
    311 delete boundaryDomainBlock_;
    \n-
    312 }
    \n-
    \n-
    313
    \n-
    \n-
    314 Grid *grid() const
    \n-
    315 {
    \n-
    316 return grid_;
    \n-
    317 }
    \n-
    \n-
    318
    \n-
    319 template <class Intersection>
    \n-
    \n-
    320 bool wasInserted(const Intersection &intersection) const
    \n-
    321 {
    \n-
    322 return false;
    \n-
    323 }
    \n+
    302
    \n+
    303 template< int dim, int dimworld >
    \n+
    \n+\n+
    305 {
    \n+
    306 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
    \n+
    307
    \n+
    308 // only MAXL levels allowed
    \n+
    309 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );
    \n+
    310
    \n+
    311 for( int i = 0; i < refCount; ++i )
    \n+
    312 {
    \n+
    313 // mark all interior elements
    \n+
    314 const LeafIterator endit = leafend< 0 >();
    \n+
    315 for( LeafIterator it = leafbegin< 0 >(); it != endit; ++it )
    \n+
    316 mark( 1, *it );
    \n+
    317
    \n+
    318 preAdapt();
    \n+
    319 adapt();
    \n+
    320 postAdapt();
    \n+
    321 }
    \n+
    322 }
    \n
    \n+
    323
    \n
    324
    \n-
    325 template <class Intersection>
    \n-
    \n-
    326 int boundaryId(const Intersection &intersection) const
    \n-
    327 {
    \n-
    328 if( boundaryDomainBlock_->isactive() )
    \n-
    329 {
    \n-
    330 std::vector< Point > corners;
    \n-
    331 getCorners( intersection.geometry(), corners );
    \n-
    332 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n-
    333 if( data )
    \n-
    334 return data->id();
    \n-
    335 else
    \n-
    336 return intersection.indexInInside();
    \n-
    337 }
    \n-
    338 else
    \n-
    339 return intersection.indexInInside();
    \n-
    340 }
    \n-
    \n-
    341
    \n-
    342 template< int codim >
    \n-
    \n-
    343 int numParameters () const
    \n-
    344 {
    \n-
    345 return 0;
    \n-
    346 }
    \n-
    \n-
    347
    \n-
    348 // return true if boundary parameters found
    \n-
    \n-\n-
    350 {
    \n-
    351 return boundaryDomainBlock_->hasParameter();
    \n-
    352 }
    \n+
    325 template< int dim, int dimworld >
    \n+
    326 template< class DataHandle >
    \n+\n+
    \n+\n+
    329 {
    \n+
    330 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
    \n+
    331
    \n+
    332 // only MAXL levels allowed
    \n+
    333 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );
    \n+
    334
    \n+
    335 for( int i = 0; i < refCount; ++i )
    \n+
    336 {
    \n+
    337 // mark all interior elements
    \n+
    \n+
    338 const LeafIterator endit = leafend< 0 >();
    \n+
    339 for( LeafIterator it = leafbegin< 0 >(); it != endit; ++it )
    \n+
    340 mark( 1, *it );
    \n+
    \n+\n+
    342 adapt( handle );
    \n+
    343 }
    \n+
    \n+\n+
    345
    \n+
    346
    \n+
    \n+
    347 template< int dim, int dimworld >
    \n+
    \n+\n+
    349 {
    \n+
    350 adaptationState_.preAdapt();
    \n+
    351 return adaptationState_.coarsen();
    \n+
    352 }
    \n
    \n
    353
    \n-
    354 template< class GG, class II >
    \n-
    355 const typename DGFBoundaryParameter::type &
    \n+
    354
    \n+
    355 template < int dim, int dimworld >
    \n
    \n-
    356 boundaryParameter ( const Intersection< GG, II > & intersection ) const
    \n-
    357 {
    \n-\n-
    359 {
    \n-
    360 std::vector< Point > corners;
    \n-
    361 getCorners( intersection.geometry(), corners );
    \n-
    362 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
    \n-
    363 if( data )
    \n-
    364 return data->parameter();
    \n-
    365 else
    \n-\n-
    367 }
    \n-
    368 else
    \n-\n-
    370 }
    \n-
    \n-
    371
    \n-
    372 template< class Entity >
    \n-
    \n-
    373 std::vector<double> &parameter ( [[maybe_unused]] const Entity &entity )
    \n-
    374 {
    \n-
    375 return emptyParam;
    \n-
    376 }
    \n-
    \n+\n+
    357 {
    \n+
    358#ifndef NDEBUG
    \n+
    359 if( leafIndexSet_ != 0 )
    \n+
    360 {
    \n+
    361 bool consistent = true;
    \n+
    362 for( int codim = 0; codim <= dimension; ++codim )
    \n+
    363 {
    \n+
    364 if( int(leafIndexSet_->size( codim )) == mesh_.size( codim ) )
    \n+
    365 continue;
    \n+
    366 std::cerr << "Incorrect size of leaf index set for codimension "
    \n+
    367 << codim << "!" << std::endl;
    \n+
    368 std::cerr << "DUNE index set reports: " << leafIndexSet_->size( codim )
    \n+
    369 << std::endl;
    \n+
    370 std::cerr << "ALBERTA mesh reports: " << mesh_.size( codim ) << std::endl;
    \n+
    371 consistent = false;
    \n+
    372 }
    \n+
    373 if( !consistent )
    \n+
    374 abort();
    \n+
    375 }
    \n+
    376#endif
    \n
    377
    \n-
    378 private:
    \n-
    379 void generate( std::istream &gridin, MPICommunicatorType comm );
    \n-
    380
    \n-
    381 template< class Geometry >
    \n-
    382 static void getCorners ( const Geometry &geometry, std::vector< Point > &corners )
    \n-
    383 {
    \n-
    384 corners.resize( geometry.corners() );
    \n-
    385 for( int i = 0; i < geometry.corners(); ++i )
    \n-
    386 {
    \n-
    387 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );
    \n-
    388 for( int j = 0; j < dimension; ++j )
    \n-
    389 corners[ i ][ j ] = corner[ j ];
    \n-
    390 }
    \n-
    391 }
    \n-
    392
    \n-
    393 Grid *grid_;
    \n-
    394 dgf::BoundaryDomBlock *boundaryDomainBlock_;
    \n-
    395 std::vector<double> emptyParam;
    \n-
    396 };
    \n-
    \n+
    378 levelProvider_.markAllOld();
    \n+
    \n+
    379 adaptationState_.postAdapt();
    \n+
    380 }
    \n+
    381
    \n+
    \n+\n+
    383 template< int dim, int dimworld >
    \n+\n+
    \n+
    385 ::mark( int refCount, const typename Traits::template Codim< 0 >::Entity &e )
    \n+
    386 {
    \n+
    387 // if not leaf entity, leave method
    \n+
    \n+
    388 if( !e.isLeaf() )
    \n+
    389 return false;
    \n+
    390
    \n+
    \n+
    391 // don't mark macro elements for coarsening
    \n+
    392 if( refCount < -e.level() )
    \n+
    393 return false;
    \n+
    394
    \n+
    \n+
    395 // take back previous marking
    \n+
    396 adaptationState_.unmark( getMark( e ) );
    \n
    397
    \n-
    398 // generate YaspGrid from the provided DGF
    \n-
    399 template< typename ctype, int dim >
    \n-
    400 inline void DGFGridFactory< YaspGrid<dim, EquidistantOffsetCoordinates<ctype, dim> > >
    \n-
    401 ::generate ( std::istream &gridin, MPICommunicatorType comm )
    \n-
    402 {
    \n-
    403 using std::abs;
    \n-
    404 dgf::IntervalBlock intervalBlock( gridin );
    \n+
    \n+
    398 // set new marking
    \n+
    399 adaptationState_.mark( refCount );
    \n+
    400 e.impl().elementInfo().setMark( refCount );
    \n+
    \n+\n+
    402 return true;
    \n+
    403 }
    \n+
    404
    \n
    405
    \n-
    406 if( !intervalBlock.isactive() )
    \n-
    407 DUNE_THROW( DGFException, "YaspGrid can only be created from an interval block." );
    \n-
    408
    \n-
    409 if( intervalBlock.numIntervals() != 1 )
    \n-
    410 DUNE_THROW( DGFException, "YaspGrid can only handle 1 interval block." );
    \n-
    411
    \n-
    412 if( intervalBlock.dimw() != dim )
    \n-
    413 {
    \n-
    414 DUNE_THROW( DGFException,
    \n-
    415 "Cannot read an interval of dimension "
    \n-
    416 << intervalBlock.dimw()
    \n-
    417 << " into a YaspGrid< " << dim << " >." );
    \n-
    418 }
    \n+
    406 template< int dim, int dimworld >
    \n+\n+
    \n+\n+
    409 {
    \n+
    410 return e.impl().elementInfo().getMark();
    \n+
    411 }
    \n+
    \n+
    412
    \n+
    413
    \n+
    414 template< int dim, int dimworld >
    \n+
    \n+\n+
    416 {
    \n+
    417 // this is already done in postAdapt
    \n+
    418 //levelProvider_.markAllOld();
    \n
    419
    \n-
    420 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );
    \n-
    421
    \n-
    422 FieldVector<ctype, dim> lower;
    \n-
    423 FieldVector<ctype, dim> upper;
    \n-
    424 std::array<int,dim> anz;
    \n-
    425 for( int i = 0; i < dim; ++i )
    \n-
    426 {
    \n-
    427 lower[ i ] = interval.p[ 0 ][ i ];
    \n-
    428 upper[ i ] = interval.p[ 1 ][ i ];
    \n-
    429 anz[ i ] = interval.n[ i ];
    \n-
    430 }
    \n-
    431
    \n-
    432 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation Transformation;
    \n-
    433 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );
    \n-
    434 std::bitset< dim > periodic;
    \n-
    435 const int numTrafos = trafoBlock.numTransformations();
    \n-
    436 for( int k = 0; k < numTrafos; ++k )
    \n-
    437 {
    \n-
    438 const Transformation &trafo = trafoBlock.transformation( k );
    \n-
    439
    \n-
    440 bool identity = true;
    \n-
    441 for( int i = 0; i < dim; ++i )
    \n-
    442 for( int j = 0; j < dim; ++j )
    \n-
    443 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);
    \n-
    444 if( !identity )
    \n-
    445 DUNE_THROW( DGFException, "YaspGrid can only handle shifts as periodic face transformations." );
    \n+
    420 // adapt mesh
    \n+
    421 hIndexSet_.preAdapt();
    \n+
    422 const bool refined = mesh_.refine();
    \n+
    423 const bool coarsened = (adaptationState_.coarsen() ? mesh_.coarsen() : false);
    \n+
    424 adaptationState_.adapt();
    \n+
    425 hIndexSet_.postAdapt();
    \n+
    426
    \n+
    427 if( refined || coarsened )
    \n+
    428 calcExtras();
    \n+
    429
    \n+
    \n+
    430 // return true if elements were created
    \n+
    431 return refined;
    \n+
    432 }
    \n+
    \n+\n+
    434
    \n+
    435 template< int dim, int dimworld >
    \n+
    436 template< class DataHandle >
    \n+\n+
    \n+\n+
    \n+\n+
    440 preAdapt();
    \n+
    441
    \n+
    \n+\n+\n+\n+\n
    446
    \n-
    447 int numDirs = 0;
    \n-
    448 int dir = -1;
    \n-
    449 for( int currentDir = 0; currentDir < dim; ++currentDir )
    \n-
    450 {
    \n-
    451 if( abs( trafo.shift[ currentDir ] ) > 1e-10 )
    \n-
    452 {
    \n-
    453 dir = currentDir;
    \n-
    454 ++numDirs;
    \n-
    455 }
    \n-
    456 }
    \n-
    457 if ( (numDirs != 1)
    \n-
    458 || (abs( abs( trafo.shift[ dir ] ) - abs( upper[ dir ] - lower[ dir ] ) ) >= 1e-10) )
    \n-
    459 {
    \n-
    460 std::cerr << "Transformation '" << trafo
    \n-
    461 << "' does not map boundaries on boundaries." << std::endl;
    \n-
    462 }
    \n-
    463 else
    \n-
    464 {
    \n-
    465 periodic[ dir ] = true;
    \n-
    466 }
    \n-
    467 }
    \n-
    468
    \n-
    469 // get grid parameters
    \n-
    470 dgf::YaspGridParameterBlock grdParam( gridin );
    \n-
    471
    \n-
    472 grid_ = new YaspGrid< dim, EquidistantOffsetCoordinates<ctype, dim> >
    \n-
    473 ( lower, upper, anz, periodic, grdParam.overlap(), comm );
    \n-
    474
    \n-
    475 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );
    \n-
    476 }
    \n-
    477
    \n-
    483 template< class ctype, int dim >
    \n-
    \n-
    484 class DGFGridFactory< Dune::YaspGrid<dim, Dune::TensorProductCoordinates<ctype, dim> > >
    \n-
    485 {
    \n-\n-
    487 public:
    \n-
    488 template< typename In >
    \n-
    489 DGFGridFactory ( const In & ) {}
    \n+\n+
    448 typename Callback::DofVectorPointer callbackVector;
    \n+
    449 callbackVector.create( dofNumbering_.emptyDofSpace(), "Adaptation Callback" );
    \n+\n+\n+
    452 if( Callback::DofVectorPointer::supportsAdaptationData )
    \n+
    453 callbackVector.setAdaptationData( &dataHandler );
    \n+
    454 else
    \n+
    455 Alberta::adaptationDataHandler_ = &dataHandler;
    \n+
    456
    \n+
    457 bool refined = adapt();
    \n+
    458
    \n+
    459 if( !Callback::DofVectorPointer::supportsAdaptationData )
    \n+
    460 Alberta::adaptationDataHandler_ = 0;
    \n+
    461 callbackVector.release();
    \n+
    462
    \n+
    463 postAdapt();
    \n+
    464 return refined;
    \n+
    465 }
    \n+
    466
    \n+
    467
    \n+
    468 template< int dim, int dimworld >
    \n+
    469 inline const Alberta::GlobalVector &
    \n+\n+
    \n+
    471 ::getCoord ( const ElementInfo &elementInfo, int vertex ) const
    \n+
    472 {
    \n+
    473 assert( (vertex >= 0) && (vertex <= dim) );
    \n+
    474#if DUNE_ALBERTA_CACHE_COORDINATES
    \n+
    475 return coordCache_( elementInfo, vertex );
    \n+
    476#else
    \n+
    477 return elementInfo.coordinate( vertex );
    \n+
    478#endif
    \n+
    479 }
    \n+
    \n+
    480
    \n+
    481
    \n+
    482 template < int dim, int dimworld >
    \n+
    \n+\n+
    484 {
    \n+
    485 return maxlevel_;
    \n+
    486 }
    \n+
    \n+
    487
    \n+
    488
    \n+
    489 template< int dim, int dimworld >
    \n
    \n-\n-
    491 {
    \n-
    492 throw std::invalid_argument( "Tensor product coordinates for YaspGrid are currently not supported via the DGFGridFactory" );
    \n-
    493 }
    \n-
    \n-
    494 };
    \n+
    490 inline int AlbertaGrid< dim, dimworld >::size ( int level, int codim ) const
    \n+
    491 {
    \n+
    492 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level, codim ) : 0);
    \n+
    493 }
    \n
    \n+
    494
    \n
    495
    \n-
    496 template <typename Coordinates, int dim>
    \n-
    \n-
    497 struct DGFGridInfo< YaspGrid<dim , Coordinates> > {
    \n-
    498 static int refineStepsForHalf() {return 1;}
    \n-
    499 static double refineWeight() {return std::pow(0.5,dim);}
    \n-
    500 };
    \n+
    496 template< int dim, int dimworld >
    \n+
    \n+
    497 inline int AlbertaGrid< dim, dimworld >::size ( int level, GeometryType type ) const
    \n+
    498 {
    \n+
    499 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level, type ) : 0);
    \n+
    500 }
    \n
    \n
    501
    \n-
    502}
    \n-
    503#endif // #ifndef DUNE_DGFPARSERYASP_HH
    \n-\n+
    502
    \n+
    503 template< int dim, int dimworld >
    \n+
    \n+
    504 inline int AlbertaGrid< dim, dimworld >::size ( int codim ) const
    \n+
    505 {
    \n+
    506 assert( sizeCache_.size( codim ) == mesh_.size( codim ) );
    \n+
    507 return mesh_.size( codim );
    \n+
    508 }
    \n+
    \n+
    509
    \n+
    510
    \n+
    511 template< int dim, int dimworld >
    \n+
    \n+
    512 inline int AlbertaGrid< dim, dimworld >::size ( GeometryType type ) const
    \n+
    513 {
    \n+
    514 return sizeCache_.size( type );
    \n+
    515 }
    \n+
    \n+
    516
    \n+
    517
    \n+
    518 template < int dim, int dimworld >
    \n+
    519 inline const typename AlbertaGrid < dim, dimworld > :: Traits :: LevelIndexSet &
    \n+
    \n+
    520 AlbertaGrid < dim, dimworld > :: levelIndexSet (int level) const
    \n+
    521 {
    \n+
    522 // assert that given level is in range
    \n+
    523 assert( (level >= 0) && (level < (int)levelIndexVec_.size()) );
    \n+
    524
    \n+
    525 if( levelIndexVec_[ level ] == 0 )
    \n+
    526 {
    \n+
    527 levelIndexVec_[ level ] = new typename GridFamily::LevelIndexSetImp ( dofNumbering_ );
    \n+
    528 levelIndexVec_[ level ]->update( lbegin< 0 >( level ), lend< 0 >( level ) );
    \n+
    529 }
    \n+
    530 return *(levelIndexVec_[ level ]);
    \n+
    531 }
    \n+
    \n+
    532
    \n+
    533 template < int dim, int dimworld >
    \n+
    534 inline const typename AlbertaGrid < dim, dimworld > :: Traits :: LeafIndexSet &
    \n+
    \n+
    535 AlbertaGrid < dim, dimworld > :: leafIndexSet () const
    \n+
    536 {
    \n+
    537 if( leafIndexSet_ == 0 )
    \n+
    538 {
    \n+
    539 leafIndexSet_ = new typename GridFamily::LeafIndexSetImp( dofNumbering_ );
    \n+
    540 leafIndexSet_->update( leafbegin< 0 >(), leafend< 0 >() );
    \n+
    541 }
    \n+
    542 return *leafIndexSet_;
    \n+
    543 }
    \n+
    \n+
    \n+
    544
    \n+
    545
    \n+
    546 template < int dim, int dimworld >
    \n+
    547 inline void AlbertaGrid < dim, dimworld >::calcExtras ()
    \n+
    \n+\n+
    549 // determine new maxlevel
    \n+
    550 maxlevel_ = levelProvider_.maxLevel();
    \n+
    551 assert( (maxlevel_ >= 0) && (maxlevel_ < MAXL) );
    \n+
    552
    \n+
    553 // unset up2Dat status, if lbegin is called then this status is updated
    \n+
    554 for( int l = 0; l < MAXL; ++l )
    \n+
    555 levelMarkerVector_[ l ].clear();
    \n+
    556
    \n+
    557 // unset up2Dat status, if leafbegin is called then this status is updated
    \n+
    558 leafMarkerVector_.clear();
    \n+
    559
    \n+
    560 sizeCache_.reset();
    \n+
    561
    \n+
    562 // update index sets (if they exist)
    \n+
    563 if( leafIndexSet_ != 0 )
    \n+
    564 leafIndexSet_->update( leafbegin< 0 >(), leafend< 0 >() );
    \n+
    565 for( unsigned int level = 0; level < levelIndexVec_.size(); ++level )
    \n+
    566 {
    \n+
    567 if( levelIndexVec_[ level ] )
    \n+
    568 levelIndexVec_[ level ]->update( lbegin< 0 >( level ), lend< 0 >( level ) );
    \n+
    569 }
    \n+
    570 }
    \n+
    571
    \n+
    572
    \n+
    573 template< int dim, int dimworld >
    \n+\n+
    \n+
    575 ::writeGrid ( const std::string &filename, ctype time ) const
    \n+
    576 {
    \n+
    577 if( filename.size() <= 0 )
    \n+
    578 DUNE_THROW( AlbertaIOError, "No filename given to writeGridXdr." );
    \n+
    579 return (mesh_.write( filename, time ) && hIndexSet_.write( filename ));
    \n+
    580 }
    \n+
    \n+
    581
    \n+
    582
    \n+
    583 template< int dim, int dimworld >
    \n+\n+
    \n+
    585 ::readGrid ( const std::string &filename, ctype &time )
    \n+
    586 {
    \n+
    587 //removeMesh();
    \n+
    588
    \n+
    589 if( filename.size() <= 0 )
    \n+
    590 return false;
    \n+
    591
    \n+
    592 numBoundarySegments_ = mesh_.read( filename, time );
    \n+
    593 if( !mesh_ )
    \n+
    594 DUNE_THROW( AlbertaIOError, "Could not read grid file: " << filename << "." );
    \n+
    595
    \n+
    596 setup();
    \n+
    597 hIndexSet_.read( filename );
    \n+
    598
    \n+
    599 // calc maxlevel and indexOnLevel and so on
    \n+
    600 calcExtras();
    \n+
    601
    \n+
    602 return true;
    \n+
    603 }
    \n+
    \n+
    604
    \n+
    605
    \n+
    606 // AlbertaGrid::AdaptationCallback
    \n+
    607 // -------------------------------
    \n+
    608
    \n+
    609 template< int dim, int dimworld >
    \n+
    610 template< class DataHandler >
    \n+
    611 struct AlbertaGrid< dim, dimworld >::AdaptationCallback
    \n+
    612 {
    \n+
    613 static const int dimension = dim;
    \n+
    614
    \n+\n+
    616 typedef Alberta::Patch< dimension > Patch;
    \n+
    617
    \n+
    618 static DataHandler &getDataHandler ( const DofVectorPointer &dofVector )
    \n+
    619 {
    \n+
    620 DataHandler *dataHandler;
    \n+
    621 if( DofVectorPointer::supportsAdaptationData )
    \n+
    622 dataHandler = dofVector.getAdaptationData< DataHandler >();
    \n+
    623 else
    \n+
    624 dataHandler = (DataHandler *)Alberta::adaptationDataHandler_;
    \n+
    625 assert( dataHandler != 0 );
    \n+
    626 return *dataHandler;
    \n+
    627 }
    \n+
    628
    \n+
    629 static void interpolateVector ( const DofVectorPointer &dofVector,
    \n+
    630 const Patch &patch )
    \n+
    631 {
    \n+
    632 DataHandler &dataHandler = getDataHandler( dofVector );
    \n+
    633 for( int i = 0; i < patch.count(); ++i )
    \n+
    634 dataHandler.prolongLocal( patch, i );
    \n+
    635 }
    \n+
    636
    \n+
    637 static void restrictVector ( const DofVectorPointer &dofVector,
    \n+
    638 const Patch &patch )
    \n+
    639 {
    \n+
    640 DataHandler &dataHandler = getDataHandler( dofVector );
    \n+
    641 for( int i = 0; i < patch.count(); ++i )
    \n+
    642 dataHandler.restrictLocal( patch, i );
    \n+
    643 }
    \n+
    644 };
    \n+
    645
    \n+
    646} // namespace Dune
    \n+
    647
    \n+
    648#endif
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+
    \n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    void abs(const DofVectorPointer< int > &dofVector)
    Definition dofvector.hh:328
    \n-
    Definition dgfgridfactory.hh:38
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfgridfactory.hh:41
    \n-
    G Grid
    Definition dgfgridfactory.hh:39
    \n-
    static const int dimension
    Definition dgfgridfactory.hh:40
    \n-
    bool haveBoundaryParameters() const
    Definition dgfgridfactory.hh:151
    \n-
    Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
    Definition common/intersection.hh:164
    \n-
    Geometry geometry() const
    geometrical information about the intersection in global coordinates.
    Definition common/intersection.hh:323
    \n-
    int indexInInside() const
    Local index of codim 1 entity in the inside() entity where intersection is contained in.
    Definition common/intersection.hh:346
    \n-
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n-
    Wrapper class for geometries.
    Definition common/geometry.hh:71
    \n-
    FieldVector< ctype, cdim > GlobalCoordinate
    type of the global coordinates
    Definition common/geometry.hh:106
    \n-
    GlobalCoordinate corner(int i) const
    Obtain a corner of the geometry.
    Definition common/geometry.hh:219
    \n-
    int corners() const
    Return the number of corners of the reference element.
    Definition common/geometry.hh:205
    \n-
    static constexpr int dimension
    The dimension of the grid.
    Definition common/grid.hh:387
    \n-
    bool findtoken(std ::string token)
    Definition basic.cc:122
    \n-
    bool getnextentry(ENTRY &entry)
    Definition basic.hh:63
    \n-
    Definition boundarydom.hh:23
    \n-
    int id() const
    Definition boundarydom.hh:42
    \n-
    const BoundaryParameter & parameter() const
    Definition boundarydom.hh:54
    \n-
    Definition boundarydom.hh:195
    \n-
    Common Grid parameters.
    Definition gridparameter.hh:35
    \n-
    exception class for IO errors in the DGF parser
    Definition dgfexception.hh:16
    \n-
    Some simple static information for a given GridType.
    Definition io/file/dgfparser/dgfparser.hh:56
    \n-
    Grid parameters for YaspGrid.
    Definition dgfyasp.hh:40
    \n-
    int _overlap
    Definition dgfyasp.hh:42
    \n-
    YaspGridParameterBlock(std::istream &in)
    constructor taking istream
    Definition dgfyasp.hh:46
    \n-
    int overlap() const
    get dimension of world found in block
    Definition dgfyasp.hh:74
    \n-
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:98
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:104
    \n-
    bool wasInserted(const Intersection &intersection) const
    Definition dgfyasp.hh:124
    \n-\n-
    std::vector< double > & parameter(const Entity &)
    Definition dgfyasp.hh:177
    \n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfyasp.hh:91
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfyasp.hh:160
    \n-\n-\n-\n-
    YaspGrid< dim, EquidistantCoordinates< ctype, dim > > Grid
    Definition dgfyasp.hh:89
    \n-
    int boundaryId(const Intersection &intersection) const
    Definition dgfyasp.hh:130
    \n-
    const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
    Definition dgfyasp.hh:356
    \n-
    DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:302
    \n-\n-
    int boundaryId(const Intersection &intersection) const
    Definition dgfyasp.hh:326
    \n-
    YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > Grid
    Definition dgfyasp.hh:287
    \n-
    bool wasInserted(const Intersection &intersection) const
    Definition dgfyasp.hh:320
    \n-
    std::vector< double > & parameter(const Entity &entity)
    Definition dgfyasp.hh:373
    \n-\n-
    MPIHelper::MPICommunicator MPICommunicatorType
    Definition dgfyasp.hh:289
    \n-
    DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
    Definition dgfyasp.hh:296
    \n-\n-\n-\n-\n-
    static double refineWeight()
    Definition dgfyasp.hh:499
    \n-
    static int refineStepsForHalf()
    Definition dgfyasp.hh:498
    \n-
    static const type & defaultValue()
    default constructor
    Definition parser.hh:28
    \n-
    std::string type
    type of additional boundary parameters
    Definition parser.hh:25
    \n-
    [ provides Dune::Grid ]
    Definition yaspgrid.hh:166
    \n-
    Container for equidistant coordinates in a YaspGrid.
    Definition coordinates.hh:29
    \n-
    Container for equidistant coordinates in a YaspGrid with non-trivial origin.
    Definition coordinates.hh:131
    \n-\n-\n+
    static void checkAlbertaDimensions()
    Definition albertagrid.cc:29
    \n+
    static const int dimWorld
    Definition misc.hh:46
    \n+
    static void * adaptationDataHandler_
    Definition albertagrid.cc:24
    \n+
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n+
    [ provides Dune::Grid ]
    Definition agrid.hh:109
    \n+
    static std::string typeName()
    Definition agrid.hh:410
    \n+
    GridFamily::ctype ctype
    Definition agrid.hh:143
    \n+
    Definition albertagrid/datahandle.hh:27
    \n+
    unsigned int create(const MacroData< dim > &macroData)
    Definition meshpointer.hh:299
    \n+
    Definition dofvector.hh:179
    \n+\n+
    const GlobalVector & coordinate(int vertex) const
    Definition elementinfo.hh:685
    \n+
    void create()
    Definition indexsets.cc:133
    \n+
    Definition albertagrid/indexsets.hh:329
    \n+
    Definition albertagrid/gridfamily.hh:98
    \n+
    Definition albertagrid/gridfamily.hh:117
    \n+
    Definition macrodata.hh:30
    \n+
    Definition misc.hh:32
    \n+
    Definition misc.hh:36
    \n+
    Definition albertagrid/projection.hh:80
    \n+
    Definition albertagrid/projection.hh:163
    \n+
    Definition refinement.hh:40
    \n+
    marker assigning subentities to one element containing them
    Definition treeiterator.hh:35
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,740 +1,748 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * dgfparser\n-dgfyasp.hh\n+ * albertagrid\n+albertagrid.cc\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5#ifndef DUNE_DGFPARSERYASP_HH\n-6#define DUNE_DGFPARSERYASP_HH\n+5#ifndef DUNE_ALBERTAGRID_CC\n+6#define DUNE_ALBERTAGRID_CC\n 7\n-8#include \n-9#include \n-10#include \"dgfparser.hh\"\n-11\n-12namespace Dune\n-13{\n-14\n-15 // External Forward Declarations\n-16 // -----------------------------\n-17\n-18 template< class GridImp, class IntersectionImp >\n-19 class Intersection;\n-20\n+8//************************************************************************\n+9//\n+10// implementation of AlbertaGrid\n+11//\n+12// namespace Dune\n+13//\n+14//************************************************************************\n+15#include \"geometry.cc\"\n+16#include \"entity.cc\"\n+17#include \"intersection.cc\"\n+18\n+19namespace Dune\n+20{\n 21\n-22 namespace dgf\n+22 namespace Alberta\n 23 {\n-24\n-38 class YaspGridParameterBlock\n-39 : public GridParameterBlock\n-40 {\n-41 protected:\n-42 int _overlap; // overlap for YaspGrid\n-43\n-44 public:\n-46 YaspGridParameterBlock( std::istream &in )\n-47 : GridParameterBlock( in ),\n-48 _overlap( 0 ) // default value\n-49 {\n-50 // check overlap\n-51 if( findtoken( \"overlap\" ) )\n-52 {\n-53 int x;\n-54 if( getnextentry(x) ) _overlap = x;\n-55 else\n-56 {\n-57 dwarn << \"GridParameterBlock: found keyword `overlap' but no value,\n-defaulting to `\" << _overlap <<\"' !\\n\";\n-58 }\n-59\n-60 if (_overlap < 0)\n-61 {\n-62 DUNE_THROW(DGFException,\"Negative overlap specified!\");\n-63 }\n-64 }\n-65 else\n-66 {\n-67 dwarn << \"YaspGridParameterBlock: Parameter 'overlap' not specified, \"\n-68 << \"defaulting to '\" << _overlap << \"'.\" << std::endl;\n-69 }\n-70\n-71 }\n-72\n-74 int overlap () const\n-75 {\n-76 return _overlap;\n-77 }\n-78\n-79 };\n-80\n-81 }\n+24 static void *adaptationDataHandler_;\n+25 }\n+26\n+27\n+28 template< int dim, int dimworld >\n+29 static void checkAlbertaDimensions ()\n+30 {\n+31 // If this check fails, define ALBERTA_DIM accordingly\n+32 static_assert((dimworld == Alberta::dimWorld),\n+33 \"Template Parameter dimworld does not match \"\n+34 \"ALBERTA's DIM_OF_WORLD setting.\");\n+35 }\n+36\n+37\n+38 // AlbertaGrid\n+39 // -----------\n+40\n+41 template< int dim, int dimworld >\n+42 inline AlbertaGrid_<_dim,_dimworld_>::AlbertaGrid ()\n+43 : mesh_(),\n+44 maxlevel_( 0 ),\n+45 numBoundarySegments_( 0 ),\n+46 hIndexSet_( dofNumbering_ ),\n+47 idSet_( hIndexSet_ ),\n+48 levelIndexVec_( (size_t)MAXL, 0 ),\n+49 leafIndexSet_( 0 ),\n+50 sizeCache_( *this ),\n+51 leafMarkerVector_( dofNumbering_ ),\n+52 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n+53 {\n+54 checkAlbertaDimensions<_dim,_dimworld>();\n+55 }\n+56\n+57\n+58 template< int dim, int dimworld >\n+59 template< class Proj, class Impl >\n+60 inline AlbertaGrid<_dim,_dimworld_>\n+61_::AlbertaGrid ( const Alberta::MacroData<_dimension> ¯oData,\n+62 const Alberta::ProjectionFactoryInterface<_Proj,_Impl_> &projectionFactory )\n+63 : mesh_(),\n+64 maxlevel_( 0 ),\n+65 numBoundarySegments_( 0 ),\n+66 hIndexSet_( dofNumbering_ ),\n+67 idSet_( hIndexSet_ ),\n+68 levelIndexVec_( (size_t)MAXL, 0 ),\n+69 leafIndexSet_ ( 0 ),\n+70 sizeCache_( *this ),\n+71 leafMarkerVector_( dofNumbering_ ),\n+72 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n+73 {\n+74 checkAlbertaDimensions<_dim,_dimworld_>();\n+75\n+76 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );\n+77 if( !mesh_ )\n+78 DUNE_THROW( AlbertaError, \"Invalid macro data structure.\" );\n+79\n+80 setup();\n+81 hIndexSet_.create();\n 82\n-86 template \n-87 struct DGFGridFactory< YaspGrid > >\n-88 {\n-89 typedef YaspGrid > Grid;\n-90 const static int dimension = Grid::dimension;\n-91 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-92\n-93 private:\n-94 typedef FieldVector< ctype, dimension > Point;\n-95 typedef dgf::BoundaryDomBlock BoundaryDomainBlock;\n-96\n-97 public:\n-98 explicit DGFGridFactory ( std::istream &input,\n-99 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-100 {\n-101 generate( input, comm );\n-102 }\n+83 calcExtras();\n+84 }\n+85\n+86\n+87 template< int dim, int dimworld >\n+88 inline AlbertaGrid<_dim,_dimworld_>\n+89_::AlbertaGrid ( const Alberta::MacroData<_dimension> ¯oData,\n+90 const std::shared_ptr< DuneBoundaryProjection<_dimensionworld_> >\n+&projection )\n+91 : mesh_(),\n+92 maxlevel_( 0 ),\n+93 numBoundarySegments_( 0 ),\n+94 hIndexSet_( dofNumbering_ ),\n+95 idSet_( hIndexSet_ ),\n+96 levelIndexVec_( (size_t)MAXL, 0 ),\n+97 leafIndexSet_ ( 0 ),\n+98 sizeCache_( *this ),\n+99 leafMarkerVector_( dofNumbering_ ),\n+100 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n+101 {\n+102 checkAlbertaDimensions<_dim,_dimworld_>();\n 103\n-104 explicit DGFGridFactory ( const std::string &filename,\n-105 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-106 {\n-107 std::ifstream input( filename.c_str() );\n-108 if( !input )\n-109 DUNE_THROW( DGFException, \"Error: Macrofile '\" << filename << \"' not found\"\n-);\n-110 generate( input, comm );\n-111 }\n-112\n-113 ~DGFGridFactory ()\n-114 {\n-115 delete boundaryDomainBlock_;\n-116 }\n-117\n-118 Grid *grid() const\n-119 {\n-120 return grid_;\n-121 }\n-122\n-123 template \n-124 bool wasInserted(const Intersection &intersection) const\n-125 {\n-126 return false;\n-127 }\n-128\n-129 template \n-130 int boundaryId(const Intersection &intersection) const\n-131 {\n-132 if( boundaryDomainBlock_->isactive() )\n+104 if( projection != 0 )\n+105 {\n+106 Alberta::DuneGlobalBoundaryProjectionFactory<_dimension_> projectionFactory\n+( projection );\n+107 numBoundarySegments_ = mesh_.create( macroData, projectionFactory );\n+108 }\n+109 else\n+110 numBoundarySegments_ = mesh_.create( macroData );\n+111 if( !mesh_ )\n+112 DUNE_THROW( AlbertaError, \"Invalid macro data structure.\" );\n+113\n+114 setup();\n+115 hIndexSet_.create();\n+116\n+117 calcExtras();\n+118 }\n+119\n+120\n+121 template < int dim, int dimworld >\n+122 inline AlbertaGrid<_dim,_dimworld_>\n+123_::AlbertaGrid ( const std::string ¯oGridFileName )\n+124 : mesh_(),\n+125 maxlevel_( 0 ),\n+126 hIndexSet_( dofNumbering_ ),\n+127 idSet_( hIndexSet_ ),\n+128 levelIndexVec_( (size_t)MAXL, 0 ),\n+129 leafIndexSet_ ( 0 ),\n+130 sizeCache_( *this ),\n+131 leafMarkerVector_( dofNumbering_ ),\n+132 levelMarkerVector_( (size_t)MAXL, MarkerVector( dofNumbering_ ) )\n 133 {\n-134 std::vector< Point > corners;\n-135 getCorners( intersection.geometry(), corners );\n-136 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n-137 if( data )\n-138 return data->id();\n-139 else\n-140 return intersection.indexInInside();\n-141 }\n-142 else\n-143 return intersection.indexInInside();\n-144 }\n-145\n-146 template< int codim >\n-147 int numParameters () const\n-148 {\n-149 return 0;\n-150 }\n-151\n-152 // return true if boundary parameters found\n-153 bool haveBoundaryParameters () const\n-154 {\n-155 return boundaryDomainBlock_->hasParameter();\n-156 }\n-157\n-158 template< class GG, class II >\n-159 const typename DGFBoundaryParameter::type &\n-160 boundaryParameter ( const Intersection<_GG,_II_> & intersection ) const\n-161 {\n-162 if( haveBoundaryParameters() )\n-163 {\n-164 std::vector< Point > corners;\n-165 getCorners( intersection.geometry(), corners );\n-166 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n-167 if( data )\n-168 return data->parameter();\n-169 else\n-170 return DGFBoundaryParameter::defaultValue();\n-171 }\n-172 else\n-173 return DGFBoundaryParameter::defaultValue();\n-174 }\n-175\n-176 template< class Entity >\n-177 std::vector ¶meter ( const Entity & )\n-178 {\n-179 return emptyParam;\n-180 }\n-181\n-182 private:\n-183 void generate( std::istream &gridin, MPICommunicatorType comm );\n-184\n-185 template< class Geometry >\n-186 static void getCorners ( const Geometry &geometry, std::vector< Point >\n-&corners )\n-187 {\n-188 corners.resize( geometry.corners() );\n-189 for( int i = 0; i < geometry.corners(); ++i )\n-190 {\n-191 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );\n-192 for( int j = 0; j < dimension; ++j )\n-193 corners[ i ][ j ] = corner[ j ];\n-194 }\n-195 }\n-196\n-197 Grid *grid_;\n-198 dgf::BoundaryDomBlock *boundaryDomainBlock_;\n-199 std::vector emptyParam;\n-200 };\n+134 checkAlbertaDimensions<_dim,_dimworld_>();\n+135\n+136 numBoundarySegments_ = mesh_.create( macroGridFileName );\n+137 if( !mesh_ )\n+138 {\n+139 DUNE_THROW( AlbertaIOError,\n+140 \"Grid file '\" << macroGridFileName\n+141 << \"' is not in ALBERTA macro triangulation format.\" );\n+142 }\n+143\n+144 setup();\n+145 hIndexSet_.create();\n+146\n+147 calcExtras();\n+148\n+149 std::cout << typeName() << \" created from macro grid file '\"\n+150 << macroGridFileName << \"'.\" << std::endl;\n+151 }\n+152\n+153\n+154 template< int dim, int dimworld >\n+155 inline void AlbertaGrid<_dim,_dimworld_>::setup ()\n+156 {\n+157 dofNumbering_.create( mesh_ );\n+158\n+159 levelProvider_.create( dofNumbering_ );\n+160\n+161#if DUNE_ALBERTA_CACHE_COORDINATES\n+162 coordCache_.create( dofNumbering_ );\n+163#endif\n+164 }\n+165\n+166\n+167 template< int dim, int dimworld >\n+168 inline void AlbertaGrid< dim, dimworld >::removeMesh ()\n+169 {\n+170 for( size_t i = 0; i < levelIndexVec_.size(); ++i )\n+171 {\n+172 if( levelIndexVec_[ i ] != 0 )\n+173 delete levelIndexVec_[ i ];\n+174 levelIndexVec_[ i ] = 0;\n+175 }\n+176\n+177 if( leafIndexSet_ != 0 )\n+178 delete leafIndexSet_;\n+179 leafIndexSet_ = 0;\n+180\n+181 // release dof vectors\n+182 hIndexSet_.release();\n+183 levelProvider_.release();\n+184#if DUNE_ALBERTA_CACHE_COORDINATES\n+185 coordCache_.release();\n+186#endif\n+187 dofNumbering_.release();\n+188\n+189 sizeCache_.reset();\n+190\n+191 mesh_.release();\n+192 }\n+193\n+194\n+195 template< int dim, int dimworld >\n+196 inline AlbertaGrid<_dim,_dimworld_>::~AlbertaGrid ()\n+197 {\n+198 removeMesh();\n+199 }\n+200\n 201\n-202 // generate YaspGrid from the provided DGF\n-203 template< typename ctype, int dim >\n-204 inline void DGFGridFactory< YaspGrid< dim , EquidistantCoordinates > >\n-205 ::generate ( std::istream &gridin, MPICommunicatorType comm )\n-206 {\n-207 using std::abs;\n-208 dgf::IntervalBlock intervalBlock( gridin );\n-209\n-210 if( !intervalBlock.isactive() )\n-211 DUNE_THROW( DGFException, \"YaspGrid can only be created from an interval\n-block.\" );\n-212\n-213 if( intervalBlock.numIntervals() != 1 )\n-214 DUNE_THROW( DGFException, \"YaspGrid can only handle 1 interval block.\" );\n-215\n-216 if( intervalBlock.dimw() != dim )\n-217 {\n-218 DUNE_THROW( DGFException,\n-219 \"Cannot read an interval of dimension \" << intervalBlock.dimw()\n-220 << \" into a YaspGrid< \" << dim << \" >.\" );\n-221 }\n-222\n-223 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );\n-224\n-225 FieldVector lang;\n-226 std::array anz;\n-227 for( int i = 0; i < dim; ++i )\n-228 {\n-229 // check that start point is 0.0\n-230 if( abs( interval.p[ 0 ][ i ] ) > 1e-10 )\n-231 {\n-232 DUNE_THROW( DGFException,\n-233 \"YaspGrid cannot handle grids with non-zero left lower corner.\" );\n-234 }\n-235\n-236 lang[ i ] = interval.p[ 1 ][ i ] - interval.p[ 0 ][ i ];\n-237 anz[ i ] = interval.n[ i ];\n-238 }\n-239\n-240 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation\n-Transformation;\n-241 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );\n-242 std::bitset< dim > per;\n-243 const int numTrafos = trafoBlock.numTransformations();\n-244 for( int k = 0; k < numTrafos; ++k )\n-245 {\n-246 const Transformation &trafo = trafoBlock.transformation( k );\n-247\n-248 bool identity = true;\n-249 for( int i = 0; i < dim; ++i )\n-250 for( int j = 0; j < dim; ++j )\n-251 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);\n-252 if( !identity )\n-253 DUNE_THROW( DGFException, \"YaspGrid can only handle shifts as periodic face\n-transformations.\" );\n+202 template< int dim, int dimworld >\n+203 template< int codim, PartitionIteratorType pitype >\n+204 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+205 ::template Codim< codim >::template Partition::LevelIterator\n+206 AlbertaGrid<_dim,_dimworld_>::lbegin ( int level ) const\n+207 {\n+208 typedef AlbertaGridLevelIterator<_codim,_pitype,_const_This_>\n+LevelIteratorImp;\n+209 assert( level >= 0 );\n+210\n+211 if( level > maxlevel_ )\n+212 return lend<_codim,_pitype_>( level );\n+213 MarkerVector &markerVector = levelMarkerVector_[ level ];\n+214\n+215 if( (codim > 0) && !markerVector.up2Date() )\n+216 markerVector.template markSubEntities<_1_>( lbegin<_0_>( level ), lend<_0_>\n+( level ) );\n+217\n+218 return LevelIteratorImp( *this, &markerVector, level );\n+219 }\n+220\n+221\n+222 template< int dim, int dimworld >\n+223 template< int codim, PartitionIteratorType pitype >\n+224 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+225 ::template Codim< codim >::template Partition< pitype >::LevelIterator\n+226 AlbertaGrid_<_dim,_dimworld_>::lend ( int level ) const\n+227 {\n+228 typedef AlbertaGridLevelIterator<_codim,_pitype,_const_This_>\n+LevelIteratorImp;\n+229 assert( level >= 0 );\n+230\n+231 return LevelIteratorImp( *this, level );\n+232 }\n+233\n+234\n+235 template< int dim, int dimworld >\n+236 template< int codim >\n+237 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+238 ::template Codim< codim >::LevelIterator\n+239 AlbertaGrid_<_dim,_dimworld_>::lbegin ( int level ) const\n+240 {\n+241 return lbegin<_codim,_All_Partition_>( level );\n+242 }\n+243\n+244\n+245 template< int dim, int dimworld >\n+246 template< int codim >\n+247 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+248 ::template Codim< codim >::LevelIterator\n+249 AlbertaGrid<_dim,_dimworld_>::lend ( int level ) const\n+250 {\n+251 return lend<_codim,_All_Partition_>( level );\n+252 }\n+253\n 254\n-255 int numDirs = 0;\n-256 int dir = -1;\n-257 for( int i = 0; i < dim; ++i )\n-258 {\n-259 if( abs( trafo.shift[ i ] ) < 1e-10 )\n-260 continue;\n-261 dir = i;\n-262 ++numDirs;\n-263 }\n-264 if( (numDirs != 1) || (abs( abs( trafo.shift[ dir ] ) - lang[ dir ] ) >=\n-1e-10) )\n-265 {\n-266 std::cerr << \"Transformation '\" << trafo\n-267 << \"' does not map boundaries on boundaries.\" << std::endl;\n-268 }\n-269 else\n-270 per[ dir ] = true;\n-271 }\n-272\n-273 // get grid parameters\n-274 dgf::YaspGridParameterBlock grdParam( gridin );\n-275\n-276 grid_ = new YaspGrid< dim , EquidistantCoordinates >( lang,\n-anz, per, grdParam.overlap(), comm );\n-277\n-278 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );\n-279 }\n-280\n-284 template \n-285 struct DGFGridFactory< YaspGrid > >\n-286 {\n-287 typedef YaspGrid > Grid;\n-288 const static int dimension = Grid::dimension;\n-289 typedef MPIHelper::MPICommunicator MPICommunicatorType;\n-290\n-291 private:\n-292 typedef FieldVector< ctype, dimension > Point;\n-293 typedef dgf::BoundaryDomBlock BoundaryDomainBlock;\n-294\n-295 public:\n-296 explicit DGFGridFactory ( std::istream &input,\n-297 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n+255 template< int dim, int dimworld >\n+256 template< int codim, PartitionIteratorType pitype >\n+257 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+258 ::template Codim< codim >::template Partition< pitype >::LeafIterator\n+259 AlbertaGrid<_dim,_dimworld_>::leafbegin () const\n+260 {\n+261 typedef AlbertaGridLeafIterator<_codim,_pitype,_const_This_>\n+LeafIteratorImp;\n+262\n+263 MarkerVector &markerVector = leafMarkerVector_;\n+264 const int firstMarkedCodim = 2;\n+265 if( (codim >= firstMarkedCodim) && !markerVector.up2Date() )\n+266 markerVector.template markSubEntities<_firstMarkedCodim_>( leafbegin<_0_>\n+(), leafend<_0_>() );\n+267\n+268 return LeafIteratorImp( *this, &markerVector, maxlevel_ );\n+269 }\n+270\n+271\n+272 template< int dim, int dimworld >\n+273 template< int codim, PartitionIteratorType pitype >\n+274 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+275 ::template Codim<_codim_>::template Partition< pitype >::LeafIterator\n+276 AlbertaGrid<_dim,_dimworld_>::leafend () const\n+277 {\n+278 typedef AlbertaGridLeafIterator<_codim,_pitype,_const_This_>\n+LeafIteratorImp;\n+279 return LeafIteratorImp( *this, maxlevel_ );\n+280 }\n+281\n+282\n+283 template< int dim, int dimworld >\n+284 template< int codim >\n+285 inline typename AlbertaGrid::Traits\n+286 ::template Codim<_codim_>::LeafIterator\n+287 AlbertaGrid<_dim,_dimworld_>::leafbegin () const\n+288 {\n+289 return leafbegin<_codim,_All_Partition_>();\n+290 }\n+291\n+292\n+293 template< int dim, int dimworld >\n+294 template< int codim >\n+295 inline typename AlbertaGrid<_dim,_dimworld_>::Traits\n+296 ::template Codim< codim >::LeafIterator\n+297 AlbertaGrid_<_dim,_dimworld_>::leafend () const\n 298 {\n-299 generate( input, comm );\n+299 return leafend<_codim,_All_Partition_>();\n 300 }\n 301\n-302 explicit DGFGridFactory ( const std::string &filename,\n-303 MPICommunicatorType comm = MPIHelper::getCommunicator() )\n-304 {\n-305 std::ifstream input( filename.c_str() );\n-306 generate( input, comm );\n-307 }\n-308\n-309 ~DGFGridFactory ()\n-310 {\n-311 delete boundaryDomainBlock_;\n-312 }\n-313\n-314 Grid *grid() const\n-315 {\n-316 return grid_;\n-317 }\n-318\n-319 template \n-320 bool wasInserted(const Intersection &intersection) const\n-321 {\n-322 return false;\n-323 }\n+302\n+303 template< int dim, int dimworld >\n+304 inline void AlbertaGrid<_dim,_dimworld_>::globalRefine ( int refCount )\n+305 {\n+306 typedef typename Traits::template Codim<_0_>::LeafIterator LeafIterator;\n+307\n+308 // only MAXL levels allowed\n+309 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );\n+310\n+311 for( int i = 0; i < refCount; ++i )\n+312 {\n+313 // mark all interior elements\n+314 const LeafIterator endit = leafend<_0_>();\n+315 for( LeafIterator it = leafbegin<_0_>(); it != endit; ++it )\n+316 mark( 1, *it );\n+317\n+318 preAdapt();\n+319 adapt();\n+320 postAdapt();\n+321 }\n+322 }\n+323\n 324\n-325 template \n-326 int boundaryId(const Intersection &intersection) const\n-327 {\n-328 if( boundaryDomainBlock_->isactive() )\n+325 template< int dim, int dimworld >\n+326 template< class DataHandle >\n+327 inline void AlbertaGrid<_dim,_dimworld_>\n+328_::globalRefine ( int refCount, AdaptDataHandleInterface<_This,_DataHandle_>\n+&handle )\n 329 {\n-330 std::vector< Point > corners;\n-331 getCorners( intersection.geometry(), corners );\n-332 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n-333 if( data )\n-334 return data->id();\n-335 else\n-336 return intersection.indexInInside();\n-337 }\n-338 else\n-339 return intersection.indexInInside();\n-340 }\n+330 typedef typename Traits::template Codim<_0_>::LeafIterator LeafIterator;\n+331\n+332 // only MAXL levels allowed\n+333 assert( (refCount >= 0) && (refCount + maxlevel_ < MAXL) );\n+334\n+335 for( int i = 0; i < refCount; ++i )\n+336 {\n+337 // mark all interior elements\n+338 const LeafIterator endit = leafend<_0_>();\n+339 for( LeafIterator it = leafbegin<_0_>(); it != endit; ++it )\n+340 mark( 1, *it );\n 341\n-342 template< int codim >\n-343 int numParameters () const\n-344 {\n-345 return 0;\n-346 }\n-347\n-348 // return true if boundary parameters found\n-349 bool haveBoundaryParameters () const\n-350 {\n-351 return boundaryDomainBlock_->hasParameter();\n+342 adapt( handle );\n+343 }\n+344 }\n+345\n+346\n+347 template< int dim, int dimworld >\n+348 inline bool AlbertaGrid<_dim,_dimworld_>::preAdapt ()\n+349 {\n+350 adaptationState_.preAdapt();\n+351 return adaptationState_.coarsen();\n 352 }\n 353\n-354 template< class GG, class II >\n-355 const typename DGFBoundaryParameter::type &\n-356 boundaryParameter ( const Intersection<_GG,_II_> & intersection ) const\n+354\n+355 template < int dim, int dimworld >\n+356 inline void AlbertaGrid_<_dim,_dimworld_>::postAdapt ()\n 357 {\n-358 if( haveBoundaryParameters() )\n-359 {\n-360 std::vector< Point > corners;\n-361 getCorners( intersection.geometry(), corners );\n-362 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );\n-363 if( data )\n-364 return data->parameter();\n-365 else\n-366 return DGFBoundaryParameter::defaultValue();\n-367 }\n-368 else\n-369 return DGFBoundaryParameter::defaultValue();\n-370 }\n-371\n-372 template< class Entity >\n-373 std::vector ¶meter ( [[maybe_unused]] const Entity &entity )\n-374 {\n-375 return emptyParam;\n-376 }\n+358#ifndef NDEBUG\n+359 if( leafIndexSet_ != 0 )\n+360 {\n+361 bool consistent = true;\n+362 for( int codim = 0; codim <= dimension; ++codim )\n+363 {\n+364 if( int(leafIndexSet_->size( codim )) == mesh_.size( codim ) )\n+365 continue;\n+366 std::cerr << \"Incorrect size of leaf index set for codimension \"\n+367 << codim << \"!\" << std::endl;\n+368 std::cerr << \"DUNE index set reports: \" << leafIndexSet_->size( codim )\n+369 << std::endl;\n+370 std::cerr << \"ALBERTA mesh reports: \" << mesh_.size( codim ) << std::endl;\n+371 consistent = false;\n+372 }\n+373 if( !consistent )\n+374 abort();\n+375 }\n+376#endif\n 377\n-378 private:\n-379 void generate( std::istream &gridin, MPICommunicatorType comm );\n-380\n-381 template< class Geometry >\n-382 static void getCorners ( const Geometry &geometry, std::vector< Point >\n-&corners )\n-383 {\n-384 corners.resize( geometry.corners() );\n-385 for( int i = 0; i < geometry.corners(); ++i )\n+378 levelProvider_.markAllOld();\n+379 adaptationState_.postAdapt();\n+380 }\n+381\n+382\n+383 template< int dim, int dimworld >\n+384 inline bool AlbertaGrid<_dim,_dimworld_>\n+385_::mark( int refCount, const typename Traits::template Codim<_0_>::Entity &e\n+)\n 386 {\n-387 const typename Geometry::GlobalCoordinate corner = geometry.corner( i );\n-388 for( int j = 0; j < dimension; ++j )\n-389 corners[ i ][ j ] = corner[ j ];\n-390 }\n-391 }\n-392\n-393 Grid *grid_;\n-394 dgf::BoundaryDomBlock *boundaryDomainBlock_;\n-395 std::vector emptyParam;\n-396 };\n+387 // if not leaf entity, leave method\n+388 if( !e.isLeaf() )\n+389 return false;\n+390\n+391 // don't mark macro elements for coarsening\n+392 if( refCount < -e.level() )\n+393 return false;\n+394\n+395 // take back previous marking\n+396 adaptationState_.unmark( getMark( e ) );\n 397\n-398 // generate YaspGrid from the provided DGF\n-399 template< typename ctype, int dim >\n-400 inline void DGFGridFactory< YaspGrid > >\n-401 ::generate ( std::istream &gridin, MPICommunicatorType comm )\n-402 {\n-403 using std::abs;\n-404 dgf::IntervalBlock intervalBlock( gridin );\n+398 // set new marking\n+399 adaptationState_.mark( refCount );\n+400 e.impl().elementInfo().setMark( refCount );\n+401\n+402 return true;\n+403 }\n+404\n 405\n-406 if( !intervalBlock.isactive() )\n-407 DUNE_THROW( DGFException, \"YaspGrid can only be created from an interval\n-block.\" );\n-408\n-409 if( intervalBlock.numIntervals() != 1 )\n-410 DUNE_THROW( DGFException, \"YaspGrid can only handle 1 interval block.\" );\n-411\n-412 if( intervalBlock.dimw() != dim )\n-413 {\n-414 DUNE_THROW( DGFException,\n-415 \"Cannot read an interval of dimension \"\n-416 << intervalBlock.dimw()\n-417 << \" into a YaspGrid< \" << dim << \" >.\" );\n-418 }\n+406 template< int dim, int dimworld >\n+407 inline int AlbertaGrid<_dim,_dimworld_>\n+408_::getMark( const typename Traits::template Codim<_0_>::Entity &e ) const\n+409 {\n+410 return e.impl().elementInfo().getMark();\n+411 }\n+412\n+413\n+414 template< int dim, int dimworld >\n+415 inline bool AlbertaGrid<_dim,_dimworld_>::adapt ()\n+416 {\n+417 // this is already done in postAdapt\n+418 //levelProvider_.markAllOld();\n 419\n-420 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );\n-421\n-422 FieldVector lower;\n-423 FieldVector upper;\n-424 std::array anz;\n-425 for( int i = 0; i < dim; ++i )\n-426 {\n-427 lower[ i ] = interval.p[ 0 ][ i ];\n-428 upper[ i ] = interval.p[ 1 ][ i ];\n-429 anz[ i ] = interval.n[ i ];\n-430 }\n-431\n-432 typedef dgf::PeriodicFaceTransformationBlock::AffineTransformation\n-Transformation;\n-433 dgf::PeriodicFaceTransformationBlock trafoBlock( gridin, dim );\n-434 std::bitset< dim > periodic;\n-435 const int numTrafos = trafoBlock.numTransformations();\n-436 for( int k = 0; k < numTrafos; ++k )\n-437 {\n-438 const Transformation &trafo = trafoBlock.transformation( k );\n-439\n-440 bool identity = true;\n-441 for( int i = 0; i < dim; ++i )\n-442 for( int j = 0; j < dim; ++j )\n-443 identity &= (abs( (i == j ? 1.0 : 0.0) - trafo.matrix( i, j ) ) < 1e-10);\n-444 if( !identity )\n-445 DUNE_THROW( DGFException, \"YaspGrid can only handle shifts as periodic face\n-transformations.\" );\n+420 // adapt mesh\n+421 hIndexSet_.preAdapt();\n+422 const bool refined = mesh_.refine();\n+423 const bool coarsened = (adaptationState_.coarsen() ? mesh_.coarsen() :\n+false);\n+424 adaptationState_.adapt();\n+425 hIndexSet_.postAdapt();\n+426\n+427 if( refined || coarsened )\n+428 calcExtras();\n+429\n+430 // return true if elements were created\n+431 return refined;\n+432 }\n+433\n+434\n+435 template< int dim, int dimworld >\n+436 template< class DataHandle >\n+437 inline bool AlbertaGrid_<_dim,_dimworld_>\n+438 ::adapt ( AdaptDataHandleInterface<_This,_DataHandle_> &handle )\n+439 {\n+440 preAdapt();\n+441\n+442 typedef Alberta::AdaptRestrictProlongHandler\n+443 < This, AdaptDataHandleInterface<_This,_DataHandle_> >\n+444 DataHandler;\n+445 DataHandler dataHandler( *this, handle );\n 446\n-447 int numDirs = 0;\n-448 int dir = -1;\n-449 for( int currentDir = 0; currentDir < dim; ++currentDir )\n-450 {\n-451 if( abs( trafo.shift[ currentDir ] ) > 1e-10 )\n-452 {\n-453 dir = currentDir;\n-454 ++numDirs;\n-455 }\n-456 }\n-457 if ( (numDirs != 1)\n-458 || (abs( abs( trafo.shift[ dir ] ) - abs( upper[ dir ] - lower[ dir ] ) )\n->= 1e-10) )\n-459 {\n-460 std::cerr << \"Transformation '\" << trafo\n-461 << \"' does not map boundaries on boundaries.\" << std::endl;\n-462 }\n-463 else\n-464 {\n-465 periodic[ dir ] = true;\n-466 }\n-467 }\n-468\n-469 // get grid parameters\n-470 dgf::YaspGridParameterBlock grdParam( gridin );\n-471\n-472 grid_ = new YaspGrid< dim, EquidistantOffsetCoordinates >\n-473 ( lower, upper, anz, periodic, grdParam.overlap(), comm );\n-474\n-475 boundaryDomainBlock_ = new dgf::BoundaryDomBlock( gridin, dimension );\n-476 }\n-477\n-483 template< class ctype, int dim >\n-484 class DGFGridFactory< Dune::YaspGrid > >\n-485 {\n-486 using Grid = Dune::YaspGrid\n->;\n-487 public:\n-488 template< typename In >\n-489 DGFGridFactory ( const In & ) {}\n-490 Grid *grid()\n+447 typedef AdaptationCallback<_DataHandler_> Callback;\n+448 typename Callback::DofVectorPointer callbackVector;\n+449 callbackVector.create( dofNumbering_.emptyDofSpace(), \"Adaptation Callback\"\n+);\n+450 callbackVector.template setupInterpolation<_Callback_>();\n+451 callbackVector.template setupRestriction<_Callback_>();\n+452 if( Callback::DofVectorPointer::supportsAdaptationData )\n+453 callbackVector.setAdaptationData( &dataHandler );\n+454 else\n+455 Alberta::adaptationDataHandler_ = &dataHandler;\n+456\n+457 bool refined = adapt();\n+458\n+459 if( !Callback::DofVectorPointer::supportsAdaptationData )\n+460 Alberta::adaptationDataHandler_ = 0;\n+461 callbackVector.release();\n+462\n+463 postAdapt();\n+464 return refined;\n+465 }\n+466\n+467\n+468 template< int dim, int dimworld >\n+469 inline const Alberta::GlobalVector &\n+470 AlbertaGrid<_dim,_dimworld_>\n+471_::getCoord ( const ElementInfo &elementInfo, int vertex ) const\n+472 {\n+473 assert( (vertex >= 0) && (vertex <= dim) );\n+474#if DUNE_ALBERTA_CACHE_COORDINATES\n+475 return coordCache_( elementInfo, vertex );\n+476#else\n+477 return elementInfo.coordinate( vertex );\n+478#endif\n+479 }\n+480\n+481\n+482 template < int dim, int dimworld >\n+483 inline int AlbertaGrid_<_dim,_dimworld_>::maxLevel() const\n+484 {\n+485 return maxlevel_;\n+486 }\n+487\n+488\n+489 template< int dim, int dimworld >\n+490 inline int AlbertaGrid<_dim,_dimworld_>::size ( int level, int codim )\n+const\n 491 {\n-492 throw std::invalid_argument( \"Tensor product coordinates for YaspGrid are\n-currently not supported via the DGFGridFactory\" );\n+492 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level,\n+codim ) : 0);\n 493 }\n-494 };\n+494\n 495\n-496 template \n-497 struct DGFGridInfo< YaspGrid > {\n-498 static int refineStepsForHalf() {return 1;}\n-499 static double refineWeight() {return std::pow(0.5,dim);}\n-500 };\n+496 template< int dim, int dimworld >\n+497 inline int AlbertaGrid<_dim,_dimworld_>::size ( int level, GeometryType\n+type ) const\n+498 {\n+499 return ((level >= 0) && (level <= maxlevel_) ? sizeCache_.size( level, type\n+) : 0);\n+500 }\n 501\n-502}\n-503#endif // #ifndef DUNE_DGFPARSERYASP_HH\n-yaspgrid.hh\n+502\n+503 template< int dim, int dimworld >\n+504 inline int AlbertaGrid<_dim,_dimworld_>::size ( int codim ) const\n+505 {\n+506 assert( sizeCache_.size( codim ) == mesh_.size( codim ) );\n+507 return mesh_.size( codim );\n+508 }\n+509\n+510\n+511 template< int dim, int dimworld >\n+512 inline int AlbertaGrid<_dim,_dimworld_>::size ( GeometryType type ) const\n+513 {\n+514 return sizeCache_.size( type );\n+515 }\n+516\n+517\n+518 template < int dim, int dimworld >\n+519 inline const typename AlbertaGrid < dim, dimworld > :: Traits ::\n+LevelIndexSet &\n+520 AlbertaGrid_<_dim,_dimworld_> :: levelIndexSet (int level) const\n+521 {\n+522 // assert that given level is in range\n+523 assert( (level >= 0) && (level < (int)levelIndexVec_.size()) );\n+524\n+525 if( levelIndexVec_[ level ] == 0 )\n+526 {\n+527 levelIndexVec_[ level ] = new typename GridFamily::LevelIndexSetImp\n+( dofNumbering_ );\n+528 levelIndexVec_[ level ]->update( lbegin<_0_>( level ), lend<_0_>( level )\n+);\n+529 }\n+530 return *(levelIndexVec_[ level ]);\n+531 }\n+532\n+533 template < int dim, int dimworld >\n+534 inline const typename AlbertaGrid < dim, dimworld > :: Traits ::\n+LeafIndexSet &\n+535 AlbertaGrid_<_dim,_dimworld_> :: leafIndexSet () const\n+536 {\n+537 if( leafIndexSet_ == 0 )\n+538 {\n+539 leafIndexSet_ = new typename GridFamily::LeafIndexSetImp( dofNumbering_ );\n+540 leafIndexSet_->update( leafbegin<_0_>(), leafend<_0_>() );\n+541 }\n+542 return *leafIndexSet_;\n+543 }\n+544\n+545\n+546 template < int dim, int dimworld >\n+547 inline void AlbertaGrid < dim, dimworld >::calcExtras ()\n+548 {\n+549 // determine new maxlevel\n+550 maxlevel_ = levelProvider_.maxLevel();\n+551 assert( (maxlevel_ >= 0) && (maxlevel_ < MAXL) );\n+552\n+553 // unset up2Dat status, if lbegin is called then this status is updated\n+554 for( int l = 0; l < MAXL; ++l )\n+555 levelMarkerVector_[ l ].clear();\n+556\n+557 // unset up2Dat status, if leafbegin is called then this status is updated\n+558 leafMarkerVector_.clear();\n+559\n+560 sizeCache_.reset();\n+561\n+562 // update index sets (if they exist)\n+563 if( leafIndexSet_ != 0 )\n+564 leafIndexSet_->update( leafbegin<_0_>(), leafend<_0_>() );\n+565 for( unsigned int level = 0; level < levelIndexVec_.size(); ++level )\n+566 {\n+567 if( levelIndexVec_[ level ] )\n+568 levelIndexVec_[ level ]->update( lbegin<_0_>( level ), lend<_0_>( level )\n+);\n+569 }\n+570 }\n+571\n+572\n+573 template< int dim, int dimworld >\n+574 inline bool AlbertaGrid<_dim,_dimworld_>\n+575_::writeGrid ( const std::string &filename, ctype time ) const\n+576 {\n+577 if( filename.size() <= 0 )\n+578 DUNE_THROW( AlbertaIOError, \"No filename given to writeGridXdr.\" );\n+579 return (mesh_.write( filename, time ) && hIndexSet_.write( filename ));\n+580 }\n+581\n+582\n+583 template< int dim, int dimworld >\n+584 inline bool AlbertaGrid<_dim,_dimworld_>\n+585_::readGrid ( const std::string &filename, ctype &time )\n+586 {\n+587 //removeMesh();\n+588\n+589 if( filename.size() <= 0 )\n+590 return false;\n+591\n+592 numBoundarySegments_ = mesh_.read( filename, time );\n+593 if( !mesh_ )\n+594 DUNE_THROW( AlbertaIOError, \"Could not read grid file: \" << filename << \".\"\n+);\n+595\n+596 setup();\n+597 hIndexSet_.read( filename );\n+598\n+599 // calc maxlevel and indexOnLevel and so on\n+600 calcExtras();\n+601\n+602 return true;\n+603 }\n+604\n+605\n+606 // AlbertaGrid::AdaptationCallback\n+607 // -------------------------------\n+608\n+609 template< int dim, int dimworld >\n+610 template< class DataHandler >\n+611 struct AlbertaGrid< dim, dimworld >::AdaptationCallback\n+612 {\n+613 static const int dimension = dim;\n+614\n+615 typedef Alberta::DofVectorPointer<_Alberta::GlobalVector_>\n+DofVectorPointer;\n+616 typedef Alberta::Patch<_dimension_> Patch;\n+617\n+618 static DataHandler &getDataHandler ( const DofVectorPointer &dofVector )\n+619 {\n+620 DataHandler *dataHandler;\n+621 if( DofVectorPointer::supportsAdaptationData )\n+622 dataHandler = dofVector.getAdaptationData< DataHandler >();\n+623 else\n+624 dataHandler = (DataHandler *)Alberta::adaptationDataHandler_;\n+625 assert( dataHandler != 0 );\n+626 return *dataHandler;\n+627 }\n+628\n+629 static void interpolateVector ( const DofVectorPointer &dofVector,\n+630 const Patch &patch )\n+631 {\n+632 DataHandler &dataHandler = getDataHandler( dofVector );\n+633 for( int i = 0; i < patch.count(); ++i )\n+634 dataHandler.prolongLocal( patch, i );\n+635 }\n+636\n+637 static void restrictVector ( const DofVectorPointer &dofVector,\n+638 const Patch &patch )\n+639 {\n+640 DataHandler &dataHandler = getDataHandler( dofVector );\n+641 for( int i = 0; i < patch.count(); ++i )\n+642 dataHandler.restrictLocal( patch, i );\n+643 }\n+644 };\n+645\n+646} // namespace Dune\n+647\n+648#endif\n+entity.cc\n+geometry.cc\n+intersection.cc\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::Alberta::abs\n-void abs(const DofVectorPointer< int > &dofVector)\n-Definition dofvector.hh:328\n-Dune::DGFGridFactory\n-Definition dgfgridfactory.hh:38\n-Dune::DGFGridFactory::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition dgfgridfactory.hh:41\n-Dune::DGFGridFactory::Grid\n-G Grid\n-Definition dgfgridfactory.hh:39\n-Dune::DGFGridFactory::dimension\n-static const int dimension\n-Definition dgfgridfactory.hh:40\n-Dune::DGFGridFactory::haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-Definition dgfgridfactory.hh:151\n-Dune::Intersection\n-Intersection of a mesh entity of codimension 0 (\"element\") with a \"neighboring\"\n-element or with the d...\n-Definition common/intersection.hh:164\n-Dune::Intersection::geometry\n-Geometry geometry() const\n-geometrical information about the intersection in global coordinates.\n-Definition common/intersection.hh:323\n-Dune::Intersection::indexInInside\n-int indexInInside() const\n-Local index of codim 1 entity in the inside() entity where intersection is\n-contained in.\n-Definition common/intersection.hh:346\n-Dune::Entity\n-Wrapper class for entities.\n-Definition common/entity.hh:66\n-Dune::Geometry\n-Wrapper class for geometries.\n-Definition common/geometry.hh:71\n-Dune::Geometry::GlobalCoordinate\n-FieldVector< ctype, cdim > GlobalCoordinate\n-type of the global coordinates\n-Definition common/geometry.hh:106\n-Dune::Geometry::corner\n-GlobalCoordinate corner(int i) const\n-Obtain a corner of the geometry.\n-Definition common/geometry.hh:219\n-Dune::Geometry::corners\n-int corners() const\n-Return the number of corners of the reference element.\n-Definition common/geometry.hh:205\n-Dune::Grid::dimension\n-static constexpr int dimension\n-The dimension of the grid.\n-Definition common/grid.hh:387\n-Dune::dgf::BasicBlock::findtoken\n-bool findtoken(std ::string token)\n-Definition basic.cc:122\n-Dune::dgf::BasicBlock::getnextentry\n-bool getnextentry(ENTRY &entry)\n-Definition basic.hh:63\n-Dune::dgf::DomainData\n-Definition boundarydom.hh:23\n-Dune::dgf::DomainData::id\n-int id() const\n-Definition boundarydom.hh:42\n-Dune::dgf::DomainData::parameter\n-const BoundaryParameter & parameter() const\n-Definition boundarydom.hh:54\n-Dune::dgf::BoundaryDomBlock\n-Definition boundarydom.hh:195\n-Dune::dgf::GridParameterBlock\n-Common Grid parameters.\n-Definition gridparameter.hh:35\n-Dune::DGFException\n-exception class for IO errors in the DGF parser\n-Definition dgfexception.hh:16\n-Dune::DGFGridInfo\n-Some simple static information for a given GridType.\n-Definition io/file/dgfparser/dgfparser.hh:56\n-Dune::dgf::YaspGridParameterBlock\n-Grid parameters for YaspGrid.\n-Definition dgfyasp.hh:40\n-Dune::dgf::YaspGridParameterBlock::_overlap\n-int _overlap\n-Definition dgfyasp.hh:42\n-Dune::dgf::YaspGridParameterBlock::YaspGridParameterBlock\n-YaspGridParameterBlock(std::istream &in)\n-constructor taking istream\n-Definition dgfyasp.hh:46\n-Dune::dgf::YaspGridParameterBlock::overlap\n-int overlap() const\n-get dimension of world found in block\n-Definition dgfyasp.hh:74\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-DGFGridFactory\n-DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n-getCommunicator())\n-Definition dgfyasp.hh:98\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicatorType\n-comm=MPIHelper::getCommunicator())\n-Definition dgfyasp.hh:104\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-wasInserted\n-bool wasInserted(const Intersection &intersection) const\n-Definition dgfyasp.hh:124\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-numParameters\n-int numParameters() const\n-Definition dgfyasp.hh:147\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-parameter\n-std::vector< double > & parameter(const Entity &)\n-Definition dgfyasp.hh:177\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition dgfyasp.hh:91\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n-> &intersection) const\n-Definition dgfyasp.hh:160\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-~DGFGridFactory\n-~DGFGridFactory()\n-Definition dgfyasp.hh:113\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-Definition dgfyasp.hh:153\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-grid\n-Grid * grid() const\n-Definition dgfyasp.hh:118\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-Grid\n-YaspGrid< dim, EquidistantCoordinates< ctype, dim > > Grid\n-Definition dgfyasp.hh:89\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantCoordinates<_ctype,_dim_>_>_>::\n-boundaryId\n-int boundaryId(const Intersection &intersection) const\n-Definition dgfyasp.hh:130\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::boundaryParameter\n-const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II\n-> &intersection) const\n-Definition dgfyasp.hh:356\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::DGFGridFactory\n-DGFGridFactory(const std::string &filename, MPICommunicatorType\n-comm=MPIHelper::getCommunicator())\n-Definition dgfyasp.hh:302\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::grid\n-Grid * grid() const\n-Definition dgfyasp.hh:314\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::boundaryId\n-int boundaryId(const Intersection &intersection) const\n-Definition dgfyasp.hh:326\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::Grid\n-YaspGrid< dim, EquidistantOffsetCoordinates< ctype, dim > > Grid\n-Definition dgfyasp.hh:287\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::wasInserted\n-bool wasInserted(const Intersection &intersection) const\n-Definition dgfyasp.hh:320\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::parameter\n-std::vector< double > & parameter(const Entity &entity)\n-Definition dgfyasp.hh:373\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::haveBoundaryParameters\n-bool haveBoundaryParameters() const\n-Definition dgfyasp.hh:349\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::MPICommunicatorType\n-MPIHelper::MPICommunicator MPICommunicatorType\n-Definition dgfyasp.hh:289\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::DGFGridFactory\n-DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::\n-getCommunicator())\n-Definition dgfyasp.hh:296\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::~DGFGridFactory\n-~DGFGridFactory()\n-Definition dgfyasp.hh:309\n-Dune::DGFGridFactory<_YaspGrid<_dim,_EquidistantOffsetCoordinates<_ctype,_dim_>\n->_>::numParameters\n-int numParameters() const\n-Definition dgfyasp.hh:343\n-Dune::DGFGridFactory<_Dune::YaspGrid<_dim,_Dune::TensorProductCoordinates<\n-ctype,_dim_>_>_>::grid\n-Grid * grid()\n-Definition dgfyasp.hh:490\n-Dune::DGFGridFactory<_Dune::YaspGrid<_dim,_Dune::TensorProductCoordinates<\n-ctype,_dim_>_>_>::DGFGridFactory\n-DGFGridFactory(const In &)\n-Definition dgfyasp.hh:489\n-Dune::DGFGridInfo<_YaspGrid<_dim,_Coordinates_>_>::refineWeight\n-static double refineWeight()\n-Definition dgfyasp.hh:499\n-Dune::DGFGridInfo<_YaspGrid<_dim,_Coordinates_>_>::refineStepsForHalf\n-static int refineStepsForHalf()\n-Definition dgfyasp.hh:498\n-Dune::DGFBoundaryParameter::defaultValue\n-static const type & defaultValue()\n-default constructor\n-Definition parser.hh:28\n-Dune::DGFBoundaryParameter::type\n-std::string type\n-type of additional boundary parameters\n-Definition parser.hh:25\n-Dune::YaspGrid\n+Dune::checkAlbertaDimensions\n+static void checkAlbertaDimensions()\n+Definition albertagrid.cc:29\n+Dune::Alberta::dimWorld\n+static const int dimWorld\n+Definition misc.hh:46\n+Dune::Alberta::adaptationDataHandler_\n+static void * adaptationDataHandler_\n+Definition albertagrid.cc:24\n+Dune::Alberta::GlobalVector\n+ALBERTA REAL_D GlobalVector\n+Definition misc.hh:50\n+Dune::AlbertaGrid\n [ provides Dune::Grid ]\n-Definition yaspgrid.hh:166\n-Dune::EquidistantCoordinates\n-Container for equidistant coordinates in a YaspGrid.\n-Definition coordinates.hh:29\n-Dune::EquidistantOffsetCoordinates\n-Container for equidistant coordinates in a YaspGrid with non-trivial origin.\n-Definition coordinates.hh:131\n-dgfparser.hh\n-intersection.hh\n+Definition agrid.hh:109\n+Dune::AlbertaGrid::typeName\n+static std::string typeName()\n+Definition agrid.hh:410\n+Dune::AlbertaGrid::ctype\n+GridFamily::ctype ctype\n+Definition agrid.hh:143\n+Dune::Alberta::AdaptRestrictProlongHandler\n+Definition albertagrid/datahandle.hh:27\n+Dune::Alberta::MeshPointer::create\n+unsigned int create(const MacroData< dim > ¯oData)\n+Definition meshpointer.hh:299\n+Dune::Alberta::DofVectorPointer\n+Definition dofvector.hh:179\n+Dune::Alberta::ElementInfo<_dimension_>\n+Dune::Alberta::ElementInfo::coordinate\n+const GlobalVector & coordinate(int vertex) const\n+Definition elementinfo.hh:685\n+Dune::AlbertaGridHierarchicIndexSet::create\n+void create()\n+Definition indexsets.cc:133\n+Dune::AlbertaGridIndexSet\n+Definition albertagrid/indexsets.hh:329\n+Dune::AlbertaGridFamily::Traits\n+Definition albertagrid/gridfamily.hh:98\n+Dune::AlbertaGridFamily::Traits::Codim\n+Definition albertagrid/gridfamily.hh:117\n+Dune::Alberta::MacroData\n+Definition macrodata.hh:30\n+Dune::AlbertaError\n+Definition misc.hh:32\n+Dune::AlbertaIOError\n+Definition misc.hh:36\n+Dune::Alberta::ProjectionFactoryInterface\n+Definition albertagrid/projection.hh:80\n+Dune::Alberta::DuneGlobalBoundaryProjectionFactory\n+Definition albertagrid/projection.hh:163\n+Dune::Alberta::Patch\n+Definition refinement.hh:40\n+Dune::AlbertaMarkerVector\n+marker assigning subentities to one element containing them\n+Definition treeiterator.hh:35\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00911_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00818_source.html", "comments": ["Files 99% similar despite different names"], "unified_diff": "@@ -77,28 +77,28 @@\n
  • dune
  • grid
  • io
  • file
  • vtk
  • \n
    \n
    \n
    \n
    volumewriter.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n
    5
    \n
    6#ifndef DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
    \n
    7#define DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
    \n
    8
    \n
    9#include <memory>
    \n
    10
    \n-\n-\n-\n-\n+\n+\n+\n+\n
    15
    \n
    16namespace Dune {
    \n
    19
    \n
    20 namespace VTK {
    \n
    21
    \n
    22 template<typename GV>
    \n
    \n@@ -168,18 +168,18 @@\n
    71
    \n
    72 } // namespace VTK
    \n
    73
    \n
    75
    \n
    76} // namespace Dune
    \n
    77
    \n
    78#endif // DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
    \n-\n-
    Functions for VTK output.
    \n-\n-\n+
    Functions for VTK output.
    \n+\n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n
    Definition basicwriter.hh:35
    \n
    void addCellData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:76
    \n
    void addPointData(const std::shared_ptr< FunctionWriter > &writer)
    Definition basicwriter.hh:80
    \n \n
    Take a vector and interpret it as cell data for the VTKWriter.
    Definition function.hh:97
    \n
    Take a vector and interpret it as point data for the VTKWriter.
    Definition function.hh:205
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -81,19 +81,19 @@\n 71\n 72 } // namespace VTK\n 73\n 75\n 76} // namespace Dune\n 77\n 78#endif // DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH\n-volumeiterators.hh\n function.hh\n Functions for VTK output.\n-functionwriter.hh\n basicwriter.hh\n+functionwriter.hh\n+volumeiterators.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n Dune::VTK::BasicWriter\n Definition basicwriter.hh:35\n Dune::VTK::BasicWriter::addCellData\n void addCellData(const std::shared_ptr< FunctionWriter > &writer)\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00926_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00701_source.html", "comments": ["Files 76% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: streams.hh Source File\n+dune-grid: macroelement.hh Source File\n \n \n \n \n \n \n \n@@ -70,132 +70,109 @@\n
    \n
    \n
    \n
    \n \n \n
    \n
    \n-
    streams.hh
    \n+
    macroelement.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_STREAMS_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_STREAMS_HH
    \n-
    8
    \n-
    9#include <ostream>
    \n-
    10
    \n-\n-
    12
    \n-
    13namespace Dune {
    \n+
    5#ifndef DUNE_ALBERTA_MACROELEMENT_HH
    \n+
    6#define DUNE_ALBERTA_MACROELEMENT_HH
    \n+
    7
    \n+\n+
    9
    \n+
    10#if HAVE_ALBERTA
    \n+
    11
    \n+
    12namespace Dune
    \n+
    13{
    \n
    14
    \n-
    \n-\n-
    17 std::ostream& s;
    \n-
    18 b64chunk chunk;
    \n-
    19 char obuf[4];
    \n+
    15 namespace Alberta
    \n+
    16 {
    \n+
    17
    \n+
    18 // MacroElement
    \n+
    19 // ------------
    \n
    20
    \n-
    21 public:
    \n-
    23
    \n-
    \n-
    27 Base64Stream(std::ostream& s_)
    \n-
    28 : s(s_)
    \n-
    29 {
    \n-
    30 // reset chunk
    \n-
    31 chunk.reset();
    \n-
    32 }
    \n-
    \n-
    33
    \n-
    35
    \n-
    41 template <class X>
    \n+
    21 template< int dim >
    \n+
    \n+\n+
    23 : public ALBERTA MACRO_EL
    \n+
    24 {
    \n+
    25 const GlobalVector &coordinate ( const int vertex ) const;
    \n+
    26
    \n+
    27 int boundaryId ( const int face ) const;
    \n+
    28 bool isBoundary ( const int face ) const;
    \n+
    29 const MacroElement< dim > *neighbor ( const int face ) const;
    \n+
    30 };
    \n+
    \n+
    31
    \n+
    32
    \n+
    33 template< int dim >
    \n+
    \n+
    34 inline const GlobalVector &MacroElement< dim >::coordinate ( const int vertex ) const
    \n+
    35 {
    \n+
    36 assert( (vertex >= 0) && (vertex < N_VERTICES_MAX) );
    \n+
    37 return *coord[ vertex ];
    \n+
    38 }
    \n+
    \n+
    39
    \n+
    40
    \n+
    41 template< int dim >
    \n
    \n-
    42 void write(X & data)
    \n-
    43 {
    \n-
    44 char* p = reinterpret_cast<char*>(&data);
    \n-
    45 for (size_t len = sizeof(X); len > 0; len--,p++)
    \n-
    46 {
    \n-
    47 chunk.put(*p);
    \n-
    48 if (chunk.size == 3)
    \n-
    49 {
    \n-
    50 chunk.write(obuf);
    \n-
    51 s.write(obuf,4);
    \n-
    52 }
    \n-
    53 }
    \n-
    54 }
    \n-
    \n-
    55
    \n-
    57
    \n-
    \n-
    64 void flush()
    \n-
    65 {
    \n-
    66 if (chunk.size > 0)
    \n-
    67 {
    \n-
    68 chunk.write(obuf);
    \n-
    69 s.write(obuf,4);
    \n-
    70 }
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    74
    \n-
    \n-\n-
    78 flush();
    \n-
    79 }
    \n-
    \n-
    80 };
    \n-
    \n-
    81
    \n-
    \n-\n-
    84 {
    \n-
    85 public:
    \n-
    \n-
    87 inline RawStream (std::ostream& theStream)
    \n-
    88 : s(theStream)
    \n-
    89 {}
    \n-
    \n-
    90
    \n-
    92 template<class T>
    \n-
    \n-
    93 void write (T data)
    \n-
    94 {
    \n-
    95 char* p = reinterpret_cast<char*>(&data);
    \n-
    96 s.write(p,sizeof(T));
    \n-
    97 }
    \n-
    \n-
    98 private:
    \n-
    99 std::ostream& s;
    \n-
    100 };
    \n-
    \n-
    101
    \n-
    102} // namespace Dune
    \n-
    103
    \n-
    104#endif // DUNE_GRID_IO_FILE_VTK_STREAMS_HH
    \n-
    Simple base64 encode.
    \n+
    42 inline bool MacroElement< dim >::isBoundary ( const int face ) const
    \n+
    43 {
    \n+
    44 return (boundaryId( face ) != InteriorBoundary);
    \n+
    45 }
    \n+
    \n+
    46
    \n+
    47
    \n+
    48 template< int dim >
    \n+
    \n+
    49 inline int MacroElement< dim >::boundaryId ( const int face ) const
    \n+
    50 {
    \n+
    51 return wall_bound[ face ];
    \n+
    52 }
    \n+
    \n+
    53
    \n+
    54
    \n+
    55 template< int dim >
    \n+
    \n+
    56 const MacroElement< dim > *MacroElement< dim >::neighbor ( const int face ) const
    \n+
    57 {
    \n+
    58 assert( (face >= 0) && (face < N_NEIGH_MAX) );
    \n+
    59 return static_cast< const MacroElement * >( neigh[ face ] );
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    62 }
    \n+
    63
    \n+
    64}
    \n+
    65
    \n+
    66#endif // #if HAVE_ALBERTA
    \n+
    67
    \n+
    68#endif // #ifndef DUNE_ALBERTA_MACROELEMENT_HH
    \n+\n+
    #define ALBERTA
    Definition albertaheader.hh:29
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    struct representing the three byte text as well as the four 6 bit chunks
    Definition b64enc.hh:34
    \n-
    void write(char *t)
    Definition b64enc.hh:60
    \n-
    size_type size
    Definition b64enc.hh:36
    \n-
    void put(const char c)
    Definition b64enc.hh:54
    \n-
    void reset()
    Definition b64enc.hh:39
    \n-
    class to base64 encode a stream of data
    Definition streams.hh:16
    \n-
    void write(X &data)
    encode a data item
    Definition streams.hh:42
    \n-
    void flush()
    flush the current unwritten data to the stream.
    Definition streams.hh:64
    \n-
    Base64Stream(std::ostream &s_)
    Construct a Base64Stream.
    Definition streams.hh:27
    \n-
    ~Base64Stream()
    destroy the object
    Definition streams.hh:77
    \n-
    write out data in binary
    Definition streams.hh:84
    \n-
    void write(T data)
    write data to stream
    Definition streams.hh:93
    \n-
    RawStream(std::ostream &theStream)
    make a new stream
    Definition streams.hh:87
    \n+
    static const int InteriorBoundary
    Definition misc.hh:59
    \n+
    ALBERTA REAL_D GlobalVector
    Definition misc.hh:50
    \n+
    Definition macroelement.hh:24
    \n+
    bool isBoundary(const int face) const
    Definition macroelement.hh:42
    \n+
    const MacroElement< dim > * neighbor(const int face) const
    Definition macroelement.hh:56
    \n+
    int boundaryId(const int face) const
    Definition macroelement.hh:49
    \n+
    const GlobalVector & coordinate(const int vertex) const
    Definition macroelement.hh:34
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,144 +1,109 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * vtk\n-streams.hh\n+ * albertagrid\n+macroelement.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_STREAMS_HH\n-7#define DUNE_GRID_IO_FILE_VTK_STREAMS_HH\n-8\n-9#include \n-10\n-11#include \n-12\n-13namespace Dune {\n+5#ifndef DUNE_ALBERTA_MACROELEMENT_HH\n+6#define DUNE_ALBERTA_MACROELEMENT_HH\n+7\n+8#include \n+9\n+10#if HAVE_ALBERTA\n+11\n+12namespace Dune\n+13{\n 14\n-16 class Base64Stream {\n-17 std::ostream& s;\n-18 b64chunk chunk;\n-19 char obuf[4];\n+15 namespace Alberta\n+16 {\n+17\n+18 // MacroElement\n+19 // ------------\n 20\n-21 public:\n-23\n-27 Base64Stream(std::ostream& s_)\n-28 : s(s_)\n-29 {\n-30 // reset chunk\n-31 chunk.reset();\n-32 }\n-33\n-35\n-41 template \n-42 void write(X & data)\n+21 template< int dim >\n+22 struct MacroElement\n+23 : public ALBERTA MACRO_EL\n+24 {\n+25 const GlobalVector &coordinate ( const int vertex ) const;\n+26\n+27 int boundaryId ( const int face ) const;\n+28 bool isBoundary ( const int face ) const;\n+29 const MacroElement<_dim_> *neighbor ( const int face ) const;\n+30 };\n+31\n+32\n+33 template< int dim >\n+34 inline const GlobalVector &MacroElement<_dim_>::coordinate ( const int\n+vertex ) const\n+35 {\n+36 assert( (vertex >= 0) && (vertex < N_VERTICES_MAX) );\n+37 return *coord[ vertex ];\n+38 }\n+39\n+40\n+41 template< int dim >\n+42 inline bool MacroElement<_dim_>::isBoundary ( const int face ) const\n 43 {\n-44 char* p = reinterpret_cast(&data);\n-45 for (size_t len = sizeof(X); len > 0; len--,p++)\n-46 {\n-47 chunk.put(*p);\n-48 if (chunk.size == 3)\n-49 {\n-50 chunk.write(obuf);\n-51 s.write(obuf,4);\n+44 return (boundaryId( face ) != InteriorBoundary);\n+45 }\n+46\n+47\n+48 template< int dim >\n+49 inline int MacroElement<_dim_>::boundaryId ( const int face ) const\n+50 {\n+51 return wall_bound[ face ];\n 52 }\n-53 }\n-54 }\n-55\n-57\n-64 void flush()\n-65 {\n-66 if (chunk.size > 0)\n-67 {\n-68 chunk.write(obuf);\n-69 s.write(obuf,4);\n-70 }\n-71 }\n-72\n-74\n-77 ~Base64Stream() {\n-78 flush();\n-79 }\n-80 };\n-81\n-83 class RawStream\n-84 {\n-85 public:\n-87 inline RawStream (std::ostream& theStream)\n-88 : s(theStream)\n-89 {}\n-90\n-92 template\n-93 void write (T data)\n-94 {\n-95 char* p = reinterpret_cast(&data);\n-96 s.write(p,sizeof(T));\n-97 }\n-98 private:\n-99 std::ostream& s;\n-100 };\n-101\n-102} // namespace Dune\n-103\n-104#endif // DUNE_GRID_IO_FILE_VTK_STREAMS_HH\n-b64enc.hh\n-Simple base64 encode.\n+53\n+54\n+55 template< int dim >\n+56 const MacroElement<_dim_> *MacroElement<_dim_>::neighbor ( const int face )\n+const\n+57 {\n+58 assert( (face >= 0) && (face < N_NEIGH_MAX) );\n+59 return static_cast< const MacroElement * >( neigh[ face ] );\n+60 }\n+61\n+62 }\n+63\n+64}\n+65\n+66#endif // #if HAVE_ALBERTA\n+67\n+68#endif // #ifndef DUNE_ALBERTA_MACROELEMENT_HH\n+misc.hh\n+ALBERTA\n+#define ALBERTA\n+Definition albertaheader.hh:29\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::b64chunk\n-struct representing the three byte text as well as the four 6 bit chunks\n-Definition b64enc.hh:34\n-Dune::b64chunk::write\n-void write(char *t)\n-Definition b64enc.hh:60\n-Dune::b64chunk::size\n-size_type size\n-Definition b64enc.hh:36\n-Dune::b64chunk::put\n-void put(const char c)\n-Definition b64enc.hh:54\n-Dune::b64chunk::reset\n-void reset()\n-Definition b64enc.hh:39\n-Dune::Base64Stream\n-class to base64 encode a stream of data\n-Definition streams.hh:16\n-Dune::Base64Stream::write\n-void write(X &data)\n-encode a data item\n-Definition streams.hh:42\n-Dune::Base64Stream::flush\n-void flush()\n-flush the current unwritten data to the stream.\n-Definition streams.hh:64\n-Dune::Base64Stream::Base64Stream\n-Base64Stream(std::ostream &s_)\n-Construct a Base64Stream.\n-Definition streams.hh:27\n-Dune::Base64Stream::~Base64Stream\n-~Base64Stream()\n-destroy the object\n-Definition streams.hh:77\n-Dune::RawStream\n-write out data in binary\n-Definition streams.hh:84\n-Dune::RawStream::write\n-void write(T data)\n-write data to stream\n-Definition streams.hh:93\n-Dune::RawStream::RawStream\n-RawStream(std::ostream &theStream)\n-make a new stream\n-Definition streams.hh:87\n+Dune::Alberta::InteriorBoundary\n+static const int InteriorBoundary\n+Definition misc.hh:59\n+Dune::Alberta::GlobalVector\n+ALBERTA REAL_D GlobalVector\n+Definition misc.hh:50\n+Dune::Alberta::MacroElement\n+Definition macroelement.hh:24\n+Dune::Alberta::MacroElement::isBoundary\n+bool isBoundary(const int face) const\n+Definition macroelement.hh:42\n+Dune::Alberta::MacroElement::neighbor\n+const MacroElement< dim > * neighbor(const int face) const\n+Definition macroelement.hh:56\n+Dune::Alberta::MacroElement::boundaryId\n+int boundaryId(const int face) const\n+Definition macroelement.hh:49\n+Dune::Alberta::MacroElement::coordinate\n+const GlobalVector & coordinate(const int vertex) const\n+Definition macroelement.hh:34\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00932_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00236_source.html", "comments": ["Files 92% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: corneriterator.hh Source File\n+dune-grid: adaptcallback.hh Source File\n \n \n \n \n \n \n \n@@ -70,170 +70,184 @@\n
    \n
    \n
    \n
    \n \n \n \n
    \n-
    corneriterator.hh
    \n+
    adaptcallback.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
    \n-
    8
    \n-
    9#include <iterator>
    \n-
    10
    \n-
    11#include <dune/common/iteratorfacades.hh>
    \n-
    12#include <dune/common/typetraits.hh>
    \n-
    13
    \n-
    14#include <dune/geometry/referenceelements.hh>
    \n-
    15
    \n-\n-
    17
    \n-
    18namespace Dune
    \n-
    19{
    \n+
    5#ifndef DUNE_GRID_COMMON_ADAPTCALLBACK_HH
    \n+
    6#define DUNE_GRID_COMMON_ADAPTCALLBACK_HH
    \n+
    7
    \n+
    14namespace Dune
    \n+
    15{
    \n+
    16
    \n+
    17 // Internal Forward Declarations
    \n+
    18 // -----------------------------
    \n+
    19
    \n+
    20 template< class Grid, class Impl >
    \n+
    21 class AdaptDataHandle;
    \n
    22
    \n-
    23 namespace VTK {
    \n+
    23
    \n
    24
    \n-
    26
    \n-
    30 template<typename CellIterator>
    \n-
    \n-\n-
    32 : public ForwardIteratorFacade
    \n-
    33 < CornerIterator<CellIterator>,
    \n-
    34 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n-
    35 CellIterator>::value_type>::type>,
    \n-
    36 const Corner<typename std::remove_const<typename std::iterator_traits<
    \n-
    37 CellIterator>::value_type>::type>&,
    \n-
    38 typename std::iterator_traits<CellIterator>::difference_type>
    \n-
    39 {
    \n-
    40 public:
    \n-
    41 // reiterate the facades typedefs here
    \n-\n-
    43 typedef VTK::Corner<typename std::remove_const<typename std::iterator_traits<
    \n-
    44 CellIterator>::value_type>::type> Corner;
    \n-
    45 typedef const Corner Value;
    \n-
    46 typedef Value& Reference;
    \n-
    47 typedef typename std::iterator_traits<CellIterator>::difference_type
    \n-\n-
    49
    \n-
    50 typedef typename std::iterator_traits<CellIterator>::value_type::Geometry::ctype
    \n-\n-
    52 static const unsigned dim = std::iterator_traits<CellIterator>::
    \n-
    53 value_type::mydimension;
    \n-
    54 typedef ReferenceElements<ctype, dim> Refelems;
    \n-
    55
    \n-
    56 private:
    \n-
    57 typedef ForwardIteratorFacade<DerivedType, Value, Reference,
    \n-
    58 DifferenceType> Facade;
    \n-
    59
    \n-
    60 CellIterator cellit;
    \n-
    61 CellIterator cellend;
    \n-
    62 Corner corner;
    \n-
    63
    \n-
    64 public:
    \n-
    \n-\n-
    66 return corner;
    \n-
    67 }
    \n+
    25 // AdaptDataHandleInterface
    \n+
    26 // ------------------------
    \n+
    27
    \n+
    31 template< class Grid, class Impl >
    \n+
    \n+\n+
    33 {
    \n+\n+
    35
    \n+
    36 friend class AdaptDataHandle< Grid, Impl >;
    \n+
    37
    \n+
    38 public:
    \n+
    39 typedef typename Grid::template Codim< 0 >::Entity Entity;
    \n+
    40
    \n+
    41 private:
    \n+\n+
    43 {}
    \n+
    44
    \n+
    45 AdaptDataHandleInterface ( const This & );
    \n+
    46 This &operator= ( const This & );
    \n+
    47
    \n+
    48 public:
    \n+
    \n+
    54 void preCoarsening ( const Entity &father )
    \n+
    55 {
    \n+
    56 asImp().preCoarsening( father );
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    \n+
    64 void postRefinement ( const Entity &father )
    \n+
    65 {
    \n+
    66 asImp().postRefinement( father );
    \n+
    67 }
    \n
    \n
    68
    \n
    \n-
    69 bool isDereferencable() const {
    \n-
    70 return cellit != cellend;
    \n-
    71 }
    \n-
    \n-
    72
    \n-
    \n-
    73 bool equals(const DerivedType& other) const {
    \n-
    74 bool mePassedTheEnd = !isDereferencable();
    \n-
    75 bool otherPassedTheEnd = !other.isDereferencable();
    \n-
    76 // both are passed the end => return true
    \n-
    77 if(mePassedTheEnd && otherPassedTheEnd) return true;
    \n-
    78 // one is passed the end => return false
    \n-
    79 if(mePassedTheEnd || otherPassedTheEnd) return false;
    \n-
    80 // none is passed the end, do their iterators and indices match?
    \n-
    81 return cellit == other.cellit &&
    \n-
    82 corner.duneIndex() == other.corner.duneIndex();
    \n-
    83 }
    \n+
    69 void restrictLocal( const Entity &father, const Entity& son, bool initialize )
    \n+
    70 {
    \n+
    71 asImp().restrictLocal( father, son, initialize );
    \n+
    72 }
    \n+
    \n+
    73
    \n+
    \n+
    74 void prolongLocal( const Entity &father, const Entity& son, bool initialize )
    \n+
    75 {
    \n+
    76 asImp().prolongLocal( father, son, initialize );
    \n+
    77 }
    \n+
    \n+
    78
    \n+
    79 protected:
    \n+
    80 const Impl &asImp () const { return static_cast< const Impl & >( *this ); }
    \n+
    81 Impl &asImp () { return static_cast< Impl & >( *this ); }
    \n+
    82 };
    \n
    \n+
    83
    \n
    84
    \n-
    \n-
    85 void increment() {
    \n-
    86 int index = corner.vtkIndex();
    \n-
    87 ++index;
    \n-
    88 if(index == Refelems::general(cellit->type()).size(dim)) {
    \n-
    89 ++cellit;
    \n-
    90 if(cellit != cellend) {
    \n-
    91 corner.cell(*cellit);
    \n-
    92 corner.vtkIndex(0);
    \n-
    93 }
    \n-
    94 }
    \n-
    95 else
    \n-
    96 corner.vtkIndex(index);
    \n-
    97 }
    \n-
    \n+
    85
    \n+
    86 // AdaptDataHandle
    \n+
    87 // ---------------
    \n+
    88
    \n+
    89 template< class Grid, class Impl >
    \n+
    \n+\n+
    91 : public AdaptDataHandleInterface< Grid, Impl >
    \n+
    92 {
    \n+\n+\n+
    95
    \n+
    96 public:
    \n+
    97 typedef typename Base::Entity Entity;
    \n
    98
    \n-
    100
    \n-
    \n-
    105 CornerIterator(const CellIterator& cellit_, const CellIterator& cellend_,
    \n-
    106 unsigned vtkIndex = 0)
    \n-
    107 : cellit(cellit_), cellend(cellend_)
    \n-
    108 {
    \n-
    109 if(cellit != cellend) {
    \n-
    110 corner.cell(*cellit);
    \n-
    111 corner.vtkIndex(vtkIndex);
    \n-
    112 }
    \n-
    113 }
    \n-
    \n-
    115
    \n-
    \n-
    118 CornerIterator(const CellIterator& cellend_)
    \n-
    119 : cellit(cellend_), cellend(cellend_)
    \n-
    120 { }
    \n-
    \n-
    121 };
    \n-
    \n-
    122
    \n-
    123 } // namespace VTK
    \n-
    124
    \n+
    99 protected:
    \n+
    \n+\n+
    101 {}
    \n+
    \n+
    102
    \n+
    103 private:
    \n+
    104 AdaptDataHandle ( const This & );
    \n+
    105 This &operator= ( const This & );
    \n+
    106
    \n+
    107 void preCoarsening ( const Entity &father );
    \n+
    108 void postRefinement ( const Entity &father );
    \n+
    109 };
    \n+
    \n+
    110
    \n+
    111
    \n+
    112 // CombinedAdaptProlongRestrict
    \n+
    113 // ----------------------------
    \n+
    114
    \n+
    116 template <class A, class B >
    \n+
    \n+\n+
    118 {
    \n+
    120 A& _a;
    \n+
    121 B& _b;
    \n+
    122 public:
    \n+
    \n+
    124 CombinedAdaptProlongRestrict ( A& a, B& b ) : _a ( a ) , _b ( b )
    \n+
    125 {}
    \n+
    \n
    126
    \n-
    127} // namespace Dune
    \n-
    128
    \n-
    129#endif // DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
    \n-\n+
    128 template <class Entity>
    \n+
    \n+
    129 void restrictLocal ( const Entity &father, const Entity &son, bool initialize )
    \n+
    130 {
    \n+
    131 _a.restrictLocal(father,son,initialize);
    \n+
    132 _b.restrictLocal(father,son,initialize);
    \n+
    133 }
    \n+
    \n+
    134
    \n+
    136 template <class Entity>
    \n+
    \n+
    137 void prolongLocal ( const Entity &father, const Entity &son, bool initialize )
    \n+
    138 {
    \n+
    139 _a.prolongLocal(father,son,initialize);
    \n+
    140 _b.prolongLocal(father,son,initialize);
    \n+
    141 }
    \n+
    \n+
    142 };
    \n+
    \n+
    143
    \n+
    144} // end namespace Dune
    \n+
    145
    \n+
    146#endif
    \n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    simple class representing a corner of a cell
    Definition corner.hh:25
    \n-
    unsigned vtkIndex() const
    get the index of the corner within the cell in VTK-numbering
    Definition corner.hh:63
    \n-
    unsigned duneIndex() const
    get the index of the corner within the cell in Dune-numbering
    Definition corner.hh:55
    \n-
    const Cell & cell() const
    get reference to the cell
    Definition corner.hh:46
    \n-
    iterate over the corners of some cell range
    Definition corneriterator.hh:39
    \n-
    Value & Reference
    Definition corneriterator.hh:46
    \n-
    VTK::Corner< typename std::remove_const< typename std::iterator_traits< CellIterator >::value_type >::type > Corner
    Definition corneriterator.hh:44
    \n-
    void increment()
    Definition corneriterator.hh:85
    \n-
    Reference dereference() const
    Definition corneriterator.hh:65
    \n-
    std::iterator_traits< CellIterator >::difference_type DifferenceType
    Definition corneriterator.hh:48
    \n-
    static const unsigned dim
    Definition corneriterator.hh:52
    \n-
    ReferenceElements< ctype, dim > Refelems
    Definition corneriterator.hh:54
    \n-
    const Corner Value
    Definition corneriterator.hh:45
    \n-
    CornerIterator(const CellIterator &cellit_, const CellIterator &cellend_, unsigned vtkIndex=0)
    construct a CornerIterator
    Definition corneriterator.hh:105
    \n-
    CornerIterator(const CellIterator &cellend_)
    construct a CornerIterator
    Definition corneriterator.hh:118
    \n-
    bool equals(const DerivedType &other) const
    Definition corneriterator.hh:73
    \n-
    CornerIterator< CellIterator > DerivedType
    Definition corneriterator.hh:42
    \n-
    std::iterator_traits< CellIterator >::value_type::Geometry::ctype ctype
    Definition corneriterator.hh:51
    \n-
    bool isDereferencable() const
    Definition corneriterator.hh:69
    \n+
    Definition adaptcallback.hh:92
    \n+
    Base::Entity Entity
    Definition adaptcallback.hh:97
    \n+
    AdaptDataHandle()
    Definition adaptcallback.hh:100
    \n+
    Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
    Definition adaptcallback.hh:33
    \n+
    void prolongLocal(const Entity &father, const Entity &son, bool initialize)
    Definition adaptcallback.hh:74
    \n+
    void postRefinement(const Entity &father)
    call back for activity to take place on newly created elements below the father element.
    Definition adaptcallback.hh:64
    \n+
    Grid::template Codim< 0 >::Entity Entity
    Definition adaptcallback.hh:39
    \n+
    Impl & asImp()
    Definition adaptcallback.hh:81
    \n+
    const Impl & asImp() const
    Definition adaptcallback.hh:80
    \n+
    void restrictLocal(const Entity &father, const Entity &son, bool initialize)
    Definition adaptcallback.hh:69
    \n+
    void preCoarsening(const Entity &father)
    call back for activity to take place on father and all descendants before the descendants are removed
    Definition adaptcallback.hh:54
    \n+
    class for combining 2 index sets together for adaptation process
    Definition adaptcallback.hh:118
    \n+
    CombinedAdaptProlongRestrict(A &a, B &b)
    constructor storing the two references
    Definition adaptcallback.hh:124
    \n+
    void restrictLocal(const Entity &father, const Entity &son, bool initialize)
    restrict data to father
    Definition adaptcallback.hh:129
    \n+
    void prolongLocal(const Entity &father, const Entity &son, bool initialize)
    prolong data to children
    Definition adaptcallback.hh:137
    \n+
    Wrapper class for entities.
    Definition common/entity.hh:66
    \n+
    Grid abstract base class.
    Definition common/grid.hh:375
    \n+
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,198 +1,202 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * vtk\n-corneriterator.hh\n+ * common\n+adaptcallback.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH\n-7#define DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH\n-8\n-9#include \n-10\n-11#include \n-12#include \n-13\n-14#include \n-15\n-16#include \n-17\n-18namespace Dune\n-19{\n+5#ifndef DUNE_GRID_COMMON_ADAPTCALLBACK_HH\n+6#define DUNE_GRID_COMMON_ADAPTCALLBACK_HH\n+7\n+14namespace Dune\n+15{\n+16\n+17 // Internal Forward Declarations\n+18 // -----------------------------\n+19\n+20 template< class Grid, class Impl >\n+21 class AdaptDataHandle;\n 22\n-23 namespace VTK {\n+23\n 24\n-26\n-30 template\n-31 class CornerIterator\n-32 : public ForwardIteratorFacade\n-33 < CornerIterator,\n-34 const Corner::value_type>::type>,\n-36 const Corner::value_type>::type>&,\n-38 typename std::iterator_traits::difference_type>\n-39 {\n-40 public:\n-41 // reiterate the facades typedefs here\n-42 typedef CornerIterator DerivedType;\n-43 typedef VTK::Corner::value_type>::type> Corner;\n-45 typedef const Corner Value;\n-46 typedef Value& Reference;\n-47 typedef typename std::iterator_traits::difference_type\n-48 DifferenceType;\n-49\n-50 typedef typename std::iterator_traits::value_type::Geometry::\n-ctype\n-51 ctype;\n-52 static const unsigned dim = std::iterator_traits::\n-53 value_type::mydimension;\n-54 typedef ReferenceElements Refelems;\n-55\n-56 private:\n-57 typedef ForwardIteratorFacade Facade;\n-59\n-60 CellIterator cellit;\n-61 CellIterator cellend;\n-62 Corner corner;\n-63\n-64 public:\n-65 Reference dereference() const {\n-66 return corner;\n+25 // AdaptDataHandleInterface\n+26 // ------------------------\n+27\n+31 template< class Grid, class Impl >\n+32 class AdaptDataHandleInterface\n+33 {\n+34 typedef AdaptDataHandleInterface<_Grid,_Impl_> This;\n+35\n+36 friend class AdaptDataHandle< Grid, Impl >;\n+37\n+38 public:\n+39 typedef typename Grid::template Codim< 0 >::Entity Entity;\n+40\n+41 private:\n+42 AdaptDataHandleInterface ()\n+43 {}\n+44\n+45 AdaptDataHandleInterface ( const This & );\n+46 This &operator= ( const This & );\n+47\n+48 public:\n+54 void preCoarsening ( const Entity &father )\n+55 {\n+56 asImp().preCoarsening( father );\n+57 }\n+58\n+64 void postRefinement ( const Entity &father )\n+65 {\n+66 asImp().postRefinement( father );\n 67 }\n 68\n-69 bool isDereferencable() const {\n-70 return cellit != cellend;\n-71 }\n-72\n-73 bool equals(const DerivedType& other) const {\n-74 bool mePassedTheEnd = !isDereferencable();\n-75 bool otherPassedTheEnd = !other.isDereferencable();\n-76 // both are passed the end => return true\n-77 if(mePassedTheEnd && otherPassedTheEnd) return true;\n-78 // one is passed the end => return false\n-79 if(mePassedTheEnd || otherPassedTheEnd) return false;\n-80 // none is passed the end, do their iterators and indices match?\n-81 return cellit == other.cellit &&\n-82 corner.duneIndex() == other.corner.duneIndex();\n-83 }\n+69 void restrictLocal( const Entity &father, const Entity& son, bool initialize\n+)\n+70 {\n+71 asImp().restrictLocal( father, son, initialize );\n+72 }\n+73\n+74 void prolongLocal( const Entity &father, const Entity& son, bool initialize\n+)\n+75 {\n+76 asImp().prolongLocal( father, son, initialize );\n+77 }\n+78\n+79 protected:\n+80 const Impl &asImp () const { return static_cast< const Impl & >( *this ); }\n+81 Impl &asImp () { return static_cast< Impl & >( *this ); }\n+82 };\n+83\n 84\n-85 void increment() {\n-86 int index = corner.vtkIndex();\n-87 ++index;\n-88 if(index == Refelems::general(cellit->type()).size(dim)) {\n-89 ++cellit;\n-90 if(cellit != cellend) {\n-91 corner.cell(*cellit);\n-92 corner.vtkIndex(0);\n-93 }\n-94 }\n-95 else\n-96 corner.vtkIndex(index);\n-97 }\n+85\n+86 // AdaptDataHandle\n+87 // ---------------\n+88\n+89 template< class Grid, class Impl >\n+90 class AdaptDataHandle\n+91 : public AdaptDataHandleInterface< Grid, Impl >\n+92 {\n+93 typedef AdaptDataHandle<_Grid,_Impl_> This;\n+94 typedef AdaptDataHandleInterface<_Grid,_Impl_> Base;\n+95\n+96 public:\n+97 typedef typename Base::Entity Entity;\n 98\n-100\n-105 CornerIterator(const CellIterator& cellit_, const CellIterator& cellend_,\n-106 unsigned vtkIndex = 0)\n-107 : cellit(cellit_), cellend(cellend_)\n-108 {\n-109 if(cellit != cellend) {\n-110 corner.cell(*cellit);\n-111 corner.vtkIndex(vtkIndex);\n-112 }\n-113 }\n-115\n-118 CornerIterator(const CellIterator& cellend_)\n-119 : cellit(cellend_), cellend(cellend_)\n-120 { }\n-121 };\n-122\n-123 } // namespace VTK\n-124\n+99 protected:\n+100 AdaptDataHandle ()\n+101 {}\n+102\n+103 private:\n+104 AdaptDataHandle ( const This & );\n+105 This &operator= ( const This & );\n+106\n+107 void preCoarsening ( const Entity &father );\n+108 void postRefinement ( const Entity &father );\n+109 };\n+110\n+111\n+112 // CombinedAdaptProlongRestrict\n+113 // ----------------------------\n+114\n+116 template \n+117 class CombinedAdaptProlongRestrict\n+118 {\n+120 A& _a;\n+121 B& _b;\n+122 public:\n+124 CombinedAdaptProlongRestrict ( A& a, B& b ) : _a ( a ) , _b ( b )\n+125 {}\n 126\n-127} // namespace Dune\n-128\n-129#endif // DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH\n-corner.hh\n+128 template \n+129 void restrictLocal ( const Entity &father, const Entity &son, bool\n+initialize )\n+130 {\n+131 _a.restrictLocal(father,son,initialize);\n+132 _b.restrictLocal(father,son,initialize);\n+133 }\n+134\n+136 template \n+137 void prolongLocal ( const Entity &father, const Entity &son, bool\n+initialize )\n+138 {\n+139 _a.prolongLocal(father,son,initialize);\n+140 _b.prolongLocal(father,son,initialize);\n+141 }\n+142 };\n+143\n+144} // end namespace Dune\n+145\n+146#endif\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Corner\n-simple class representing a corner of a cell\n-Definition corner.hh:25\n-Dune::VTK::Corner::vtkIndex\n-unsigned vtkIndex() const\n-get the index of the corner within the cell in VTK-numbering\n-Definition corner.hh:63\n-Dune::VTK::Corner::duneIndex\n-unsigned duneIndex() const\n-get the index of the corner within the cell in Dune-numbering\n-Definition corner.hh:55\n-Dune::VTK::Corner::cell\n-const Cell & cell() const\n-get reference to the cell\n-Definition corner.hh:46\n-Dune::VTK::CornerIterator\n-iterate over the corners of some cell range\n-Definition corneriterator.hh:39\n-Dune::VTK::CornerIterator::Reference\n-Value & Reference\n-Definition corneriterator.hh:46\n-Dune::VTK::CornerIterator::Corner\n-VTK::Corner< typename std::remove_const< typename std::iterator_traits<\n-CellIterator >::value_type >::type > Corner\n-Definition corneriterator.hh:44\n-Dune::VTK::CornerIterator::increment\n-void increment()\n-Definition corneriterator.hh:85\n-Dune::VTK::CornerIterator::dereference\n-Reference dereference() const\n-Definition corneriterator.hh:65\n-Dune::VTK::CornerIterator::DifferenceType\n-std::iterator_traits< CellIterator >::difference_type DifferenceType\n-Definition corneriterator.hh:48\n-Dune::VTK::CornerIterator::dim\n-static const unsigned dim\n-Definition corneriterator.hh:52\n-Dune::VTK::CornerIterator::Refelems\n-ReferenceElements< ctype, dim > Refelems\n-Definition corneriterator.hh:54\n-Dune::VTK::CornerIterator::Value\n-const Corner Value\n-Definition corneriterator.hh:45\n-Dune::VTK::CornerIterator::CornerIterator\n-CornerIterator(const CellIterator &cellit_, const CellIterator &cellend_,\n-unsigned vtkIndex=0)\n-construct a CornerIterator\n-Definition corneriterator.hh:105\n-Dune::VTK::CornerIterator::CornerIterator\n-CornerIterator(const CellIterator &cellend_)\n-construct a CornerIterator\n-Definition corneriterator.hh:118\n-Dune::VTK::CornerIterator::equals\n-bool equals(const DerivedType &other) const\n-Definition corneriterator.hh:73\n-Dune::VTK::CornerIterator::DerivedType\n-CornerIterator< CellIterator > DerivedType\n-Definition corneriterator.hh:42\n-Dune::VTK::CornerIterator::ctype\n-std::iterator_traits< CellIterator >::value_type::Geometry::ctype ctype\n-Definition corneriterator.hh:51\n-Dune::VTK::CornerIterator::isDereferencable\n-bool isDereferencable() const\n-Definition corneriterator.hh:69\n+Dune::AdaptDataHandle\n+Definition adaptcallback.hh:92\n+Dune::AdaptDataHandle::Entity\n+Base::Entity Entity\n+Definition adaptcallback.hh:97\n+Dune::AdaptDataHandle::AdaptDataHandle\n+AdaptDataHandle()\n+Definition adaptcallback.hh:100\n+Dune::AdaptDataHandleInterface\n+Interface class for the Grid's adapt method where the parameter is a\n+AdaptDataHandleInterface.\n+Definition adaptcallback.hh:33\n+Dune::AdaptDataHandleInterface::prolongLocal\n+void prolongLocal(const Entity &father, const Entity &son, bool initialize)\n+Definition adaptcallback.hh:74\n+Dune::AdaptDataHandleInterface::postRefinement\n+void postRefinement(const Entity &father)\n+call back for activity to take place on newly created elements below the father\n+element.\n+Definition adaptcallback.hh:64\n+Dune::AdaptDataHandleInterface::Entity\n+Grid::template Codim< 0 >::Entity Entity\n+Definition adaptcallback.hh:39\n+Dune::AdaptDataHandleInterface::asImp\n+Impl & asImp()\n+Definition adaptcallback.hh:81\n+Dune::AdaptDataHandleInterface::asImp\n+const Impl & asImp() const\n+Definition adaptcallback.hh:80\n+Dune::AdaptDataHandleInterface::restrictLocal\n+void restrictLocal(const Entity &father, const Entity &son, bool initialize)\n+Definition adaptcallback.hh:69\n+Dune::AdaptDataHandleInterface::preCoarsening\n+void preCoarsening(const Entity &father)\n+call back for activity to take place on father and all descendants before the\n+descendants are removed\n+Definition adaptcallback.hh:54\n+Dune::CombinedAdaptProlongRestrict\n+class for combining 2 index sets together for adaptation process\n+Definition adaptcallback.hh:118\n+Dune::CombinedAdaptProlongRestrict::CombinedAdaptProlongRestrict\n+CombinedAdaptProlongRestrict(A &a, B &b)\n+constructor storing the two references\n+Definition adaptcallback.hh:124\n+Dune::CombinedAdaptProlongRestrict::restrictLocal\n+void restrictLocal(const Entity &father, const Entity &son, bool initialize)\n+restrict data to father\n+Definition adaptcallback.hh:129\n+Dune::CombinedAdaptProlongRestrict::prolongLocal\n+void prolongLocal(const Entity &father, const Entity &son, bool initialize)\n+prolong data to children\n+Definition adaptcallback.hh:137\n+Dune::Entity\n+Wrapper class for entities.\n+Definition common/entity.hh:66\n+Dune::Grid\n+Grid abstract base class.\n+Definition common/grid.hh:375\n+Dune::Grid::Codim\n+A Traits struct that collects all associated types of one implementation.\n+Definition common/grid.hh:411\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-grid-doc/doxygen/a00947_source.html", "source2": "./usr/share/doc/libdune-grid-doc/doxygen/a00707_source.html", "comments": ["Files 82% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid: vtuwriter.hh Source File\n+dune-grid: level.hh Source File\n \n \n \n \n \n \n \n@@ -70,308 +70,331 @@\n
    \n
    \n \n \n \n \n \n
    \n-
    vtuwriter.hh
    \n+
    level.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightText: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n
    2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    4// vi: set et ts=4 sw=2 sts=2:
    \n-
    5
    \n-
    6#ifndef DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH
    \n-
    7#define DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH
    \n-
    8
    \n-
    9#include <ostream>
    \n-
    10#include <string>
    \n-
    11
    \n-
    12#include <dune/common/exceptions.hh>
    \n-
    13#include <dune/common/indent.hh>
    \n+
    5#ifndef DUNE_ALBERTA_LEVEL_HH
    \n+
    6#define DUNE_ALBERTA_LEVEL_HH
    \n+
    7
    \n+
    8#include <cassert>
    \n+
    9#include <cstdlib>
    \n+
    10
    \n+\n+\n+\n
    14
    \n-\n-\n-
    17
    \n-
    18namespace Dune {
    \n+
    15#if HAVE_ALBERTA
    \n+
    16
    \n+
    17namespace Dune
    \n+
    18{
    \n
    19
    \n+
    20 // AlbertaGridLevelProvider
    \n+
    21 // ------------------------
    \n
    22
    \n-
    23 namespace VTK {
    \n-
    24
    \n-
    26
    \n-
    \n-
    98 class VTUWriter {
    \n-
    99 public:
    \n-
    100 std::ostream& stream;
    \n-\n-
    102
    \n-
    103 private:
    \n-\n-
    105 Indent indent;
    \n-
    106
    \n-
    107 std::string fileType;
    \n-
    108 std::string cellName;
    \n-
    109
    \n-
    110 bool doAppended;
    \n-
    111
    \n-
    112 public:
    \n-
    114
    \n-
    \n-
    122 inline VTUWriter(std::ostream& stream_, OutputType outputType,
    \n-
    123 FileType fileType_)
    \n-
    124 : stream(stream_), factory(outputType, stream)
    \n-
    125 {
    \n-
    126 switch(fileType_) {
    \n-
    127 case polyData :
    \n-
    128 fileType = "PolyData";
    \n-
    129 cellName = "Lines";
    \n-
    130 break;
    \n-
    131 case unstructuredGrid :
    \n-
    132 fileType = "UnstructuredGrid";
    \n-
    133 cellName = "Cells";
    \n-
    134 break;
    \n-
    135 default :
    \n-
    136 DUNE_THROW(IOError, "VTUWriter: Unknown fileType: " << fileType_);
    \n-
    137 }
    \n-
    138 const std::string& byteOrder = getEndiannessString();
    \n-
    139
    \n-
    140 stream << indent << "<?xml version=\\"1.0\\"?>\\n";
    \n-
    141 stream << indent << "<VTKFile"
    \n-
    142 << " type=\\"" << fileType << "\\""
    \n-
    143 << " version=\\"0.1\\""
    \n-
    144 << " byte_order=\\"" << byteOrder << "\\">\\n";
    \n-
    145 ++indent;
    \n-
    146 }
    \n-
    \n-
    147
    \n-
    \n-
    149 inline ~VTUWriter() {
    \n-
    150 --indent;
    \n-
    151 stream << indent << "</VTKFile>\\n"
    \n-
    152 << std::flush;
    \n-
    153 }
    \n-
    \n-
    154
    \n-
    156
    \n-
    \n-
    167 inline void beginPointData(const std::string& scalars = "",
    \n-
    168 const std::string& vectors = "") {
    \n-
    169 switch(phase) {
    \n-
    170 case main :
    \n-
    171 stream << indent << "<PointData";
    \n-
    172 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n-
    173 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n-
    174 stream << ">\\n";
    \n-
    175 ++indent;
    \n-
    176 break;
    \n-
    177 case appended :
    \n-
    178 break;
    \n-
    179 }
    \n-
    180 }
    \n-
    \n-
    \n-
    182 inline void endPointData() {
    \n-
    183 switch(phase) {
    \n-
    184 case main :
    \n-
    185 --indent;
    \n-
    186 stream << indent << "</PointData>\\n";
    \n-
    187 break;
    \n-
    188 case appended :
    \n-
    189 break;
    \n-
    190 }
    \n-
    191 }
    \n+
    23 template< int dim >
    \n+
    \n+\n+
    25 {
    \n+\n+
    27
    \n+
    28 typedef unsigned char Level;
    \n+
    29
    \n+\n+\n+
    32
    \n+\n+
    34
    \n+
    35 static const Level isNewFlag = (1 << 7);
    \n+
    36 static const Level levelMask = (1 << 7) - 1;
    \n+
    37
    \n+
    38 class SetLocal;
    \n+
    39 class CalcMaxLevel;
    \n+
    40
    \n+
    41 template< Level flags >
    \n+
    42 struct ClearFlags;
    \n+
    43
    \n+
    44 struct Interpolation;
    \n+
    45
    \n+
    46 public:
    \n+\n+\n+\n+
    50
    \n+
    \n+
    51 Level operator() ( const Alberta::Element *element ) const
    \n+
    52 {
    \n+
    53 const Level *array = (Level *)level_;
    \n+
    54 return array[ dofAccess_( element, 0 ) ] & levelMask;
    \n+
    55 }
    \n+
    \n+
    56
    \n+
    \n+
    57 Level operator() ( const ElementInfo &elementInfo ) const
    \n+
    58 {
    \n+
    59 return (*this)( elementInfo.el() );
    \n+
    60 }
    \n+
    \n+
    61
    \n+
    \n+
    62 bool isNew ( const Alberta::Element *element ) const
    \n+
    63 {
    \n+
    64 const Level *array = (Level *)level_;
    \n+
    65 return ((array[ dofAccess_( element, 0 ) ] & isNewFlag) != 0);
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    \n+
    68 bool isNew ( const ElementInfo &elementInfo ) const
    \n+
    69 {
    \n+
    70 return isNew( elementInfo.el() );
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    \n+
    73 Level maxLevel () const
    \n+
    74 {
    \n+
    75 CalcMaxLevel calcFromCache;
    \n+
    76 level_.forEach( calcFromCache );
    \n+
    77#ifndef NDEBUG
    \n+
    78 CalcMaxLevel calcFromGrid;
    \n+
    79 mesh().leafTraverse( calcFromGrid, FillFlags::nothing );
    \n+
    80 assert( calcFromCache.maxLevel() == calcFromGrid.maxLevel() );
    \n+
    81#endif
    \n+
    82 return calcFromCache.maxLevel();;
    \n+
    83 }
    \n+
    \n+
    84
    \n+
    \n+\n+
    86 {
    \n+
    87 return MeshPointer( level_.dofSpace()->mesh );
    \n+
    88 }
    \n+
    \n+
    89
    \n+
    \n+
    90 void markAllOld ()
    \n+
    91 {
    \n+
    92 ClearFlags< isNewFlag > clearIsNew;
    \n+
    93 level_.forEach( clearIsNew );
    \n+
    94 }
    \n+
    \n+
    95
    \n+
    \n+
    96 void create ( const DofNumbering &dofNumbering )
    \n+
    97 {
    \n+
    98 const Alberta::DofSpace *const dofSpace = dofNumbering.dofSpace( 0 );
    \n+
    99 dofAccess_ = DofAccess( dofSpace );
    \n+
    100
    \n+
    101 level_.create( dofSpace, "Element level" );
    \n+
    102 assert( level_ );
    \n+
    103 level_.template setupInterpolation< Interpolation >();
    \n+
    104
    \n+
    105 SetLocal setLocal( level_ );
    \n+\n+
    107 }
    \n+
    \n+
    108
    \n+
    \n+
    109 void release ()
    \n+
    110 {
    \n+
    111 level_.release();
    \n+
    112 dofAccess_ = DofAccess();
    \n+
    113 }
    \n
    \n-
    192
    \n+
    114
    \n+
    115 private:
    \n+
    116 DofVectorPointer level_;
    \n+
    117 DofAccess dofAccess_;
    \n+
    118 };
    \n+
    \n+
    119
    \n+
    120
    \n+
    121
    \n+
    122 // AlbertaGridLevelProvider::SetLocal
    \n+
    123 // ----------------------------------
    \n+
    124
    \n+
    125 template< int dim >
    \n+
    \n+\n+
    127 {
    \n+
    128 DofVectorPointer level_;
    \n+
    129 DofAccess dofAccess_;
    \n+
    130
    \n+
    131 public:
    \n+
    \n+
    132 explicit SetLocal ( const DofVectorPointer &level )
    \n+
    133 : level_( level ),
    \n+
    134 dofAccess_( level.dofSpace() )
    \n+
    135 {}
    \n+
    \n+
    136
    \n+
    \n+
    137 void operator() ( const Alberta::ElementInfo< dim > &elementInfo ) const
    \n+
    138 {
    \n+
    139 Level *const array = (Level *)level_;
    \n+
    140 array[ dofAccess_( elementInfo, 0 ) ] = elementInfo.level();
    \n+
    141 }
    \n+
    \n+
    142 };
    \n+
    \n+
    143
    \n+
    144
    \n+
    145
    \n+
    146 // AlbertaGridLevelProvider::CalcMaxLevel
    \n+
    147 // --------------------------------------
    \n+
    148
    \n+
    149 template< int dim >
    \n+
    \n+\n+
    151 {
    \n+
    152 Level maxLevel_;
    \n+
    153
    \n+
    154 public:
    \n+
    \n+\n+
    156 : maxLevel_( 0 )
    \n+
    157 {}
    \n+
    \n+
    158
    \n+
    \n+
    159 void operator() ( const Level &dof )
    \n+
    160 {
    \n+
    161 maxLevel_ = std::max( maxLevel_, Level( dof & levelMask ) );
    \n+
    162 }
    \n+
    \n+
    163
    \n+
    \n+
    164 void operator() ( const Alberta::ElementInfo< dim > &elementInfo )
    \n+
    165 {
    \n+
    166 maxLevel_ = std::max( maxLevel_, Level( elementInfo.level() ) );
    \n+
    167 }
    \n+
    \n+
    168
    \n+
    \n+
    169 Level maxLevel () const
    \n+
    170 {
    \n+
    171 return maxLevel_;
    \n+
    172 }
    \n+
    \n+
    173 };
    \n+
    \n+
    174
    \n+
    175
    \n+
    176
    \n+
    177 // AlbertaGridLevelProvider::ClearFlags
    \n+
    178 // ------------------------------------
    \n+
    179
    \n+
    180 template< int dim >
    \n+
    181 template< typename AlbertaGridLevelProvider< dim >::Level flags >
    \n+
    182 struct AlbertaGridLevelProvider< dim >::ClearFlags
    \n+
    183 {
    \n+
    184 void operator() ( Level &dof ) const
    \n+
    185 {
    \n+
    186 dof &= ~flags;
    \n+
    187 }
    \n+
    188 };
    \n+
    189
    \n+
    190
    \n+
    191
    \n+
    192 // AlbertaGridLevelProvider::Interpolation
    \n+
    193 // ---------------------------------------
    \n
    194
    \n-
    \n-
    205 inline void beginCellData(const std::string& scalars = "",
    \n-
    206 const std::string& vectors = "") {
    \n-
    207 switch(phase) {
    \n-
    208 case main :
    \n-
    209 stream << indent << "<CellData";
    \n-
    210 if(scalars != "") stream << " Scalars=\\"" << scalars << "\\"";
    \n-
    211 if(vectors != "") stream << " Vectors=\\"" << vectors << "\\"";
    \n-
    212 stream << ">\\n";
    \n-
    213 ++indent;
    \n-
    214 break;
    \n-
    215 case appended :
    \n-
    216 break;
    \n+
    195 template< int dim >
    \n+
    \n+\n+
    197 {
    \n+
    198 static const int dimension = dim;
    \n+
    199
    \n+\n+
    201
    \n+
    \n+
    202 static void interpolateVector ( const DofVectorPointer &dofVector,
    \n+
    203 const Patch &patch )
    \n+
    204 {
    \n+
    205 const DofAccess dofAccess( dofVector.dofSpace() );
    \n+
    206 Level *array = (Level *)dofVector;
    \n+
    207
    \n+
    208 for( int i = 0; i < patch.count(); ++i )
    \n+
    209 {
    \n+
    210 const Alberta::Element *const father = patch[ i ];
    \n+
    211 assert( (array[ dofAccess( father, 0 ) ] & levelMask) < levelMask );
    \n+
    212 const Level childLevel = (array[ dofAccess( father, 0 ) ] + 1) | isNewFlag;
    \n+
    213 for( int i = 0; i < 2; ++i )
    \n+
    214 {
    \n+
    215 const Alberta::Element *child = father->child[ i ];
    \n+
    216 array[ dofAccess( child, 0 ) ] = childLevel;
    \n
    217 }
    \n
    218 }
    \n+
    219 }
    \n+
    \n+
    220 };
    \n
    \n-
    \n-
    220 inline void endCellData() {
    \n-
    221 switch(phase) {
    \n-
    222 case main :
    \n-
    223 --indent;
    \n-
    224 stream << indent << "</CellData>\\n";
    \n-
    225 break;
    \n-
    226 case appended :
    \n-
    227 break;
    \n-
    228 }
    \n-
    229 }
    \n-
    \n-
    230
    \n-
    232
    \n-
    \n-
    238 inline void beginPoints() {
    \n-
    239 switch(phase) {
    \n-
    240 case main :
    \n-
    241 stream << indent << "<Points>\\n";
    \n-
    242 ++indent;
    \n-
    243 break;
    \n-
    244 case appended :
    \n-
    245 break;
    \n-
    246 }
    \n-
    247 }
    \n-
    \n-
    \n-
    249 inline void endPoints() {
    \n-
    250 switch(phase) {
    \n-
    251 case main :
    \n-
    252 --indent;
    \n-
    253 stream << indent << "</Points>\\n";
    \n-
    254 break;
    \n-
    255 case appended :
    \n-
    256 break;
    \n-
    257 }
    \n-
    258 }
    \n-
    \n-
    259
    \n-
    261
    \n-
    \n-
    274 inline void beginCells() {
    \n-
    275 switch(phase) {
    \n-
    276 case main :
    \n-
    277 stream << indent << "<" << cellName << ">\\n";
    \n-
    278 ++indent;
    \n-
    279 break;
    \n-
    280 case appended :
    \n-
    281 break;
    \n-
    282 }
    \n-
    283 }
    \n-
    \n-
    \n-
    285 inline void endCells() {
    \n-
    286 switch(phase) {
    \n-
    287 case main :
    \n-
    288 --indent;
    \n-
    289 stream << indent << "</" << cellName << ">\\n";
    \n-
    290 break;
    \n-
    291 case appended :
    \n-
    292 break;
    \n-
    293 }
    \n-
    294 }
    \n-
    \n-
    295
    \n-
    297
    \n-
    \n-
    310 inline void beginMain(unsigned ncells, unsigned npoints) {
    \n-
    311 stream << indent << "<" << fileType << ">\\n";
    \n-
    312 ++indent;
    \n-
    313 stream << indent << "<Piece"
    \n-
    314 << " NumberOf" << cellName << "=\\"" << ncells << "\\""
    \n-
    315 << " NumberOfPoints=\\"" << npoints << "\\">\\n";
    \n-
    316 ++indent;
    \n-
    317 phase = main;
    \n-
    318 }
    \n-
    \n-
    \n-
    320 inline void endMain() {
    \n-
    321 --indent;
    \n-
    322 stream << indent << "</Piece>\\n";
    \n-
    323 --indent;
    \n-
    324 stream << indent << "</" << fileType << ">\\n";
    \n-
    325 }
    \n-
    \n-
    326
    \n-
    328
    \n-
    \n-
    345 inline bool beginAppended() {
    \n-
    346 doAppended = factory.beginAppended();
    \n-
    347 if(doAppended) {
    \n-
    348 const std::string& encoding = factory.appendedEncoding();
    \n-
    349 stream << indent << "<AppendedData"
    \n-
    350 << " encoding=\\"" << encoding << "\\">\\n";
    \n-
    351 ++indent;
    \n-
    352 // mark begin of data
    \n-
    353 stream << indent << "_";
    \n-
    354 }
    \n-
    355 phase = appended;
    \n-
    356 return doAppended;
    \n-
    357 }
    \n-
    \n-
    \n-
    359 inline void endAppended() {
    \n-
    360 if(doAppended) {
    \n-
    361 stream << "\\n";
    \n-
    362 --indent;
    \n-
    363 stream << indent << "</AppendedData>\\n";
    \n-
    364 }
    \n-
    365 }
    \n-
    \n-
    366
    \n-
    368
    \n-
    \n-
    380 DataArrayWriter* makeArrayWriter(const std::string& name,
    \n-
    381 unsigned ncomps, unsigned nitems,
    \n-
    382 Precision prec) {
    \n-
    383 return factory.make(name, ncomps, nitems, indent, prec);
    \n-
    384 }
    \n-
    \n-
    385 };
    \n-
    \n-
    386
    \n-
    387 } // namespace VTK
    \n-
    388
    \n-
    390
    \n-
    391} // namespace Dune
    \n-
    392
    \n-
    393#endif // DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH
    \n-
    Common stuff for the VTKWriter.
    \n-
    Data array writers for the VTKWriter.
    \n+
    221
    \n+
    222}
    \n+
    223
    \n+
    224#endif // #if HAVE_ALBERTA
    \n+
    225
    \n+
    226#endif
    \n+
    provides a wrapper for ALBERTA's mesh structure
    \n+\n+\n
    Include standard header files.
    Definition agrid.hh:60
    \n-
    Precision
    which precision to use when writing out data to vtk files
    Definition common.hh:271
    \n-
    OutputType
    How the bulk data should be stored in the file.
    Definition common.hh:43
    \n-
    FileType
    which type of VTK file to write
    Definition common.hh:252
    \n-
    @ polyData
    for .vtp files (PolyData)
    Definition common.hh:254
    \n-
    @ unstructuredGrid
    for .vtu files (UnstructuredGrid)
    Definition common.hh:256
    \n-
    std::string getEndiannessString()
    determine endianness of this C++ implementation
    Definition common.hh:232
    \n-
    base class for data array writers
    Definition dataarraywriter.hh:56
    \n-
    a factory for DataArrayWriters
    Definition dataarraywriter.hh:462
    \n-
    bool beginAppended()
    signal start of the appended section
    Definition dataarraywriter.hh:497
    \n-
    DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned nitems, const Indent &indent, Precision prec)
    create a DataArrayWriter
    Definition dataarraywriter.hh:541
    \n-
    const std::string & appendedEncoding() const
    query encoding string for appended data
    Definition dataarraywriter.hh:510
    \n-
    Dump a .vtu/.vtp files contents to a stream.
    Definition vtuwriter.hh:98
    \n-
    DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps, unsigned nitems, Precision prec)
    acquire a DataArrayWriter
    Definition vtuwriter.hh:380
    \n-
    bool beginAppended()
    start the appended data section
    Definition vtuwriter.hh:345
    \n-
    void endAppended()
    finish the appended data section
    Definition vtuwriter.hh:359
    \n-
    VTUWriter(std::ostream &stream_, OutputType outputType, FileType fileType_)
    create a VTUWriter object
    Definition vtuwriter.hh:122
    \n-
    std::ostream & stream
    Definition vtuwriter.hh:100
    \n-
    void endCellData()
    finish CellData section
    Definition vtuwriter.hh:220
    \n-
    void beginMain(unsigned ncells, unsigned npoints)
    start the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:310
    \n-
    void beginCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:274
    \n-
    void endPointData()
    finish PointData section
    Definition vtuwriter.hh:182
    \n-
    Phase
    Definition vtuwriter.hh:101
    \n-
    @ appended
    Definition vtuwriter.hh:101
    \n-
    @ main
    Definition vtuwriter.hh:101
    \n-
    void beginCellData(const std::string &scalars="", const std::string &vectors="")
    start CellData section
    Definition vtuwriter.hh:205
    \n-
    void beginPointData(const std::string &scalars="", const std::string &vectors="")
    start PointData section
    Definition vtuwriter.hh:167
    \n-
    void endPoints()
    finish section for the point coordinates
    Definition vtuwriter.hh:249
    \n-
    ~VTUWriter()
    write footer
    Definition vtuwriter.hh:149
    \n-
    void endCells()
    start section for the grid cells/PolyData lines
    Definition vtuwriter.hh:285
    \n-
    void beginPoints()
    start section for the point coordinates
    Definition vtuwriter.hh:238
    \n-
    void endMain()
    finish the main PolyData/UnstructuredGrid section
    Definition vtuwriter.hh:320
    \n-
    enum Dune::VTK::VTUWriter::Phase phase
    \n+
    ALBERTA EL Element
    Definition misc.hh:54
    \n+
    ALBERTA FE_SPACE DofSpace
    Definition misc.hh:65
    \n+
    Definition meshpointer.hh:40
    \n+
    void leafTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:385
    \n+
    void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
    Definition meshpointer.hh:370
    \n+\n+
    Definition dofadmin.hh:93
    \n+
    const DofSpace * dofSpace(int codim) const
    Definition dofadmin.hh:145
    \n+\n+
    void create(const DofSpace *dofSpace, const std::string &name="")
    Definition dofvector.hh:236
    \n+
    void release()
    Definition dofvector.hh:254
    \n+
    const DofSpace * dofSpace() const
    Definition dofvector.hh:223
    \n+
    void forEach(Functor &functor) const
    Definition dofvector.hh:264
    \n+
    Definition elementinfo.hh:43
    \n+
    int level() const
    Definition elementinfo.hh:533
    \n+
    Element * el() const
    Definition elementinfo.hh:737
    \n+
    Definition level.hh:25
    \n+
    bool isNew(const Alberta::Element *element) const
    Definition level.hh:62
    \n+
    bool isNew(const ElementInfo &elementInfo) const
    Definition level.hh:68
    \n+
    Alberta::MeshPointer< dim > MeshPointer
    Definition level.hh:48
    \n+
    MeshPointer mesh() const
    Definition level.hh:85
    \n+
    void create(const DofNumbering &dofNumbering)
    Definition level.hh:96
    \n+
    Level maxLevel() const
    Definition level.hh:73
    \n+
    Alberta::HierarchyDofNumbering< dim > DofNumbering
    Definition level.hh:49
    \n+
    void release()
    Definition level.hh:109
    \n+
    Level operator()(const Alberta::Element *element) const
    Definition level.hh:51
    \n+
    void markAllOld()
    Definition level.hh:90
    \n+
    Alberta::ElementInfo< dim > ElementInfo
    Definition level.hh:47
    \n+\n+
    SetLocal(const DofVectorPointer &level)
    Definition level.hh:132
    \n+\n+\n+
    Level maxLevel() const
    Definition level.hh:169
    \n+\n+
    Alberta::Patch< dimension > Patch
    Definition level.hh:200
    \n+
    static void interpolateVector(const DofVectorPointer &dofVector, const Patch &patch)
    Definition level.hh:202
    \n+
    Definition misc.hh:231
    \n+
    static const Flags nothing
    Definition misc.hh:234
    \n+
    Definition refinement.hh:40
    \n+
    int count() const
    Definition refinement.hh:67
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,364 +1,355 @@\n dune-grid\u00a02.10\n Loading...\n Searching...\n No Matches\n * dune\n * grid\n- * io\n- * file\n- * vtk\n-vtuwriter.hh\n+ * albertagrid\n+level.hh\n Go_to_the_documentation_of_this_file.\n 1// SPDX-FileCopyrightText: Copyright \u00c2\u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n 2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 4// vi: set et ts=4 sw=2 sts=2:\n-5\n-6#ifndef DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH\n-7#define DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH\n-8\n-9#include \n-10#include \n-11\n-12#include \n-13#include \n+5#ifndef DUNE_ALBERTA_LEVEL_HH\n+6#define DUNE_ALBERTA_LEVEL_HH\n+7\n+8#include \n+9#include \n+10\n+11#include \n+12#include \n+13#include \n 14\n-15#include \n-16#include \n-17\n-18namespace Dune {\n+15#if HAVE_ALBERTA\n+16\n+17namespace Dune\n+18{\n 19\n+20 // AlbertaGridLevelProvider\n+21 // ------------------------\n 22\n-23 namespace VTK {\n-24\n-26\n-98 class VTUWriter {\n-99 public:\n-100 std::ostream& stream;\n-101 enum Phase { main, appended } phase;\n-102\n-103 private:\n-104 DataArrayWriterFactory factory;\n-105 Indent indent;\n-106\n-107 std::string fileType;\n-108 std::string cellName;\n-109\n-110 bool doAppended;\n-111\n-112 public:\n+23 template< int dim >\n+24 class AlbertaGridLevelProvider\n+25 {\n+26 typedef AlbertaGridLevelProvider<_dim_> This;\n+27\n+28 typedef unsigned char Level;\n+29\n+30 typedef Alberta::DofVectorPointer<_Level_> DofVectorPointer;\n+31 typedef Alberta::DofAccess<_dim,_0_> DofAccess;\n+32\n+33 typedef Alberta::FillFlags<_dim_> FillFlags;\n+34\n+35 static const Level isNewFlag = (1 << 7);\n+36 static const Level levelMask = (1 << 7) - 1;\n+37\n+38 class SetLocal;\n+39 class CalcMaxLevel;\n+40\n+41 template< Level flags >\n+42 struct ClearFlags;\n+43\n+44 struct Interpolation;\n+45\n+46 public:\n+47 typedef Alberta::ElementInfo<_dim_> ElementInfo;\n+48 typedef Alberta::MeshPointer<_dim_> MeshPointer;\n+49 typedef Alberta::HierarchyDofNumbering<_dim_> DofNumbering;\n+50\n+51 Level operator()_( const Alberta::Element *element ) const\n+52 {\n+53 const Level *array = (Level *)level_;\n+54 return array[ dofAccess_( element, 0 ) ] & levelMask;\n+55 }\n+56\n+57 Level operator()_( const ElementInfo &elementInfo ) const\n+58 {\n+59 return (*this)( elementInfo.el() );\n+60 }\n+61\n+62 bool isNew ( const Alberta::Element *element ) const\n+63 {\n+64 const Level *array = (Level *)level_;\n+65 return ((array[ dofAccess_( element, 0 ) ] & isNewFlag) != 0);\n+66 }\n+67\n+68 bool isNew ( const ElementInfo &elementInfo ) const\n+69 {\n+70 return isNew( elementInfo.el() );\n+71 }\n+72\n+73 Level maxLevel () const\n+74 {\n+75 CalcMaxLevel calcFromCache;\n+76 level_.forEach( calcFromCache );\n+77#ifndef NDEBUG\n+78 CalcMaxLevel calcFromGrid;\n+79 mesh().leafTraverse( calcFromGrid, FillFlags::nothing );\n+80 assert( calcFromCache.maxLevel() == calcFromGrid.maxLevel() );\n+81#endif\n+82 return calcFromCache.maxLevel();;\n+83 }\n+84\n+85 MeshPointer mesh () const\n+86 {\n+87 return MeshPointer( level_.dofSpace()->mesh );\n+88 }\n+89\n+90 void markAllOld ()\n+91 {\n+92 ClearFlags< isNewFlag > clearIsNew;\n+93 level_.forEach( clearIsNew );\n+94 }\n+95\n+96 void create ( const DofNumbering &dofNumbering )\n+97 {\n+98 const Alberta::DofSpace *const dofSpace = dofNumbering.dofSpace( 0 );\n+99 dofAccess_ = DofAccess( dofSpace );\n+100\n+101 level_.create( dofSpace, \"Element level\" );\n+102 assert( level_ );\n+103 level_.template setupInterpolation< Interpolation >();\n+104\n+105 SetLocal setLocal( level_ );\n+106 mesh().hierarchicTraverse( setLocal, FillFlags::nothing );\n+107 }\n+108\n+109 void release ()\n+110 {\n+111 level_.release();\n+112 dofAccess_ = DofAccess();\n+113 }\n 114\n-122 inline VTUWriter(std::ostream& stream_, OutputType outputType,\n-123 FileType fileType_)\n-124 : stream(stream_), factory(outputType, stream)\n-125 {\n-126 switch(fileType_) {\n-127 case polyData :\n-128 fileType = \"PolyData\";\n-129 cellName = \"Lines\";\n-130 break;\n-131 case unstructuredGrid :\n-132 fileType = \"UnstructuredGrid\";\n-133 cellName = \"Cells\";\n-134 break;\n-135 default :\n-136 DUNE_THROW(IOError, \"VTUWriter: Unknown fileType: \" << fileType_);\n-137 }\n-138 const std::string& byteOrder = getEndiannessString();\n-139\n-140 stream << indent << \"\\n\";\n-141 stream << indent << \"\\n\";\n-145 ++indent;\n-146 }\n-147\n-149 inline ~VTUWriter() {\n-150 --indent;\n-151 stream << indent << \"\\n\"\n-152 << std::flush;\n-153 }\n-154\n-156\n-167 inline void beginPointData(const std::string& scalars = \"\",\n-168 const std::string& vectors = \"\") {\n-169 switch(phase) {\n-170 case main :\n-171 stream << indent << \"\\n\";\n-175 ++indent;\n-176 break;\n-177 case appended :\n-178 break;\n-179 }\n-180 }\n-182 inline void endPointData() {\n-183 switch(phase) {\n-184 case main :\n-185 --indent;\n-186 stream << indent << \"\\n\";\n-187 break;\n-188 case appended :\n-189 break;\n-190 }\n-191 }\n-192\n+115 private:\n+116 DofVectorPointer level_;\n+117 DofAccess dofAccess_;\n+118 };\n+119\n+120\n+121\n+122 // AlbertaGridLevelProvider::SetLocal\n+123 // ----------------------------------\n+124\n+125 template< int dim >\n+126 class AlbertaGridLevelProvider< dim >::SetLocal\n+127 {\n+128 DofVectorPointer level_;\n+129 DofAccess dofAccess_;\n+130\n+131 public:\n+132 explicit SetLocal ( const DofVectorPointer &level )\n+133 : level_( level ),\n+134 dofAccess_( level.dofSpace() )\n+135 {}\n+136\n+137 void operator()_( const Alberta::ElementInfo<_dim_> &elementInfo ) const\n+138 {\n+139 Level *const array = (Level *)level_;\n+140 array[ dofAccess_( elementInfo, 0 ) ] = elementInfo.level();\n+141 }\n+142 };\n+143\n+144\n+145\n+146 // AlbertaGridLevelProvider::CalcMaxLevel\n+147 // --------------------------------------\n+148\n+149 template< int dim >\n+150 class AlbertaGridLevelProvider< dim >::CalcMaxLevel\n+151 {\n+152 Level maxLevel_;\n+153\n+154 public:\n+155 CalcMaxLevel ()\n+156 : maxLevel_( 0 )\n+157 {}\n+158\n+159 void operator()_( const Level &dof )\n+160 {\n+161 maxLevel_ = std::max( maxLevel_, Level( dof & levelMask ) );\n+162 }\n+163\n+164 void operator()_( const Alberta::ElementInfo<_dim_> &elementInfo )\n+165 {\n+166 maxLevel_ = std::max( maxLevel_, Level( elementInfo.level() ) );\n+167 }\n+168\n+169 Level maxLevel () const\n+170 {\n+171 return maxLevel_;\n+172 }\n+173 };\n+174\n+175\n+176\n+177 // AlbertaGridLevelProvider::ClearFlags\n+178 // ------------------------------------\n+179\n+180 template< int dim >\n+181 template< typename AlbertaGridLevelProvider< dim >::Level flags >\n+182 struct AlbertaGridLevelProvider< dim >::ClearFlags\n+183 {\n+184 void operator()_( Level &dof ) const\n+185 {\n+186 dof &= ~flags;\n+187 }\n+188 };\n+189\n+190\n+191\n+192 // AlbertaGridLevelProvider::Interpolation\n+193 // ---------------------------------------\n 194\n-205 inline void beginCellData(const std::string& scalars = \"\",\n-206 const std::string& vectors = \"\") {\n-207 switch(phase) {\n-208 case main :\n-209 stream << indent << \"\\n\";\n-213 ++indent;\n-214 break;\n-215 case appended :\n-216 break;\n+195 template< int dim >\n+196 struct AlbertaGridLevelProvider< dim >::Interpolation\n+197 {\n+198 static const int dimension = dim;\n+199\n+200 typedef Alberta::Patch<_dimension_> Patch;\n+201\n+202 static void interpolateVector ( const DofVectorPointer &dofVector,\n+203 const Patch &patch )\n+204 {\n+205 const DofAccess dofAccess( dofVector.dofSpace() );\n+206 Level *array = (Level *)dofVector;\n+207\n+208 for( int i = 0; i < patch.count(); ++i )\n+209 {\n+210 const Alberta::Element *const father = patch[ i ];\n+211 assert( (array[ dofAccess( father, 0 ) ] & levelMask) < levelMask );\n+212 const Level childLevel = (array[ dofAccess( father, 0 ) ] + 1) | isNewFlag;\n+213 for( int i = 0; i < 2; ++i )\n+214 {\n+215 const Alberta::Element *child = father->child[ i ];\n+216 array[ dofAccess( child, 0 ) ] = childLevel;\n 217 }\n 218 }\n-220 inline void endCellData() {\n-221 switch(phase) {\n-222 case main :\n-223 --indent;\n-224 stream << indent << \"\\n\";\n-225 break;\n-226 case appended :\n-227 break;\n-228 }\n-229 }\n-230\n-232\n-238 inline void beginPoints() {\n-239 switch(phase) {\n-240 case main :\n-241 stream << indent << \"\\n\";\n-242 ++indent;\n-243 break;\n-244 case appended :\n-245 break;\n-246 }\n-247 }\n-249 inline void endPoints() {\n-250 switch(phase) {\n-251 case main :\n-252 --indent;\n-253 stream << indent << \"\\n\";\n-254 break;\n-255 case appended :\n-256 break;\n-257 }\n-258 }\n-259\n-261\n-274 inline void beginCells() {\n-275 switch(phase) {\n-276 case main :\n-277 stream << indent << \"<\" << cellName << \">\\n\";\n-278 ++indent;\n-279 break;\n-280 case appended :\n-281 break;\n-282 }\n-283 }\n-285 inline void endCells() {\n-286 switch(phase) {\n-287 case main :\n-288 --indent;\n-289 stream << indent << \"\\n\";\n-290 break;\n-291 case appended :\n-292 break;\n-293 }\n-294 }\n-295\n-297\n-310 inline void beginMain(unsigned ncells, unsigned npoints) {\n-311 stream << indent << \"<\" << fileType << \">\\n\";\n-312 ++indent;\n-313 stream << indent << \"\\n\";\n-316 ++indent;\n-317 phase = main;\n-318 }\n-320 inline void endMain() {\n-321 --indent;\n-322 stream << indent << \"\\n\";\n-323 --indent;\n-324 stream << indent << \"\\n\";\n-325 }\n-326\n-328\n-345 inline bool beginAppended() {\n-346 doAppended = factory.beginAppended();\n-347 if(doAppended) {\n-348 const std::string& encoding = factory.appendedEncoding();\n-349 stream << indent << \"\\n\";\n-351 ++indent;\n-352 // mark begin of data\n-353 stream << indent << \"_\";\n-354 }\n-355 phase = appended;\n-356 return doAppended;\n-357 }\n-359 inline void endAppended() {\n-360 if(doAppended) {\n-361 stream << \"\\n\";\n-362 --indent;\n-363 stream << indent << \"\\n\";\n-364 }\n-365 }\n-366\n-368\n-380 DataArrayWriter* makeArrayWriter(const std::string& name,\n-381 unsigned ncomps, unsigned nitems,\n-382 Precision prec) {\n-383 return factory.make(name, ncomps, nitems, indent, prec);\n-384 }\n-385 };\n-386\n-387 } // namespace VTK\n-388\n-390\n-391} // namespace Dune\n-392\n-393#endif // DUNE_GRID_IO_FILE_VTK_VTUWRITER_HH\n-common.hh\n-Common stuff for the VTKWriter.\n-dataarraywriter.hh\n-Data array writers for the VTKWriter.\n+219 }\n+220 };\n+221\n+222}\n+223\n+224#endif // #if HAVE_ALBERTA\n+225\n+226#endif\n+meshpointer.hh\n+provides a wrapper for ALBERTA's mesh structure\n+dofadmin.hh\n+dofvector.hh\n Dune\n Include standard header files.\n Definition agrid.hh:60\n-Dune::VTK::Precision\n-Precision\n-which precision to use when writing out data to vtk files\n-Definition common.hh:271\n-Dune::VTK::OutputType\n-OutputType\n-How the bulk data should be stored in the file.\n-Definition common.hh:43\n-Dune::VTK::FileType\n-FileType\n-which type of VTK file to write\n-Definition common.hh:252\n-Dune::VTK::polyData\n-@ polyData\n-for .vtp files (PolyData)\n-Definition common.hh:254\n-Dune::VTK::unstructuredGrid\n-@ unstructuredGrid\n-for .vtu files (UnstructuredGrid)\n-Definition common.hh:256\n-Dune::VTK::getEndiannessString\n-std::string getEndiannessString()\n-determine endianness of this C++ implementation\n-Definition common.hh:232\n-Dune::VTK::DataArrayWriter\n-base class for data array writers\n-Definition dataarraywriter.hh:56\n-Dune::VTK::DataArrayWriterFactory\n-a factory for DataArrayWriters\n-Definition dataarraywriter.hh:462\n-Dune::VTK::DataArrayWriterFactory::beginAppended\n-bool beginAppended()\n-signal start of the appended section\n-Definition dataarraywriter.hh:497\n-Dune::VTK::DataArrayWriterFactory::make\n-DataArrayWriter * make(const std::string &name, unsigned ncomps, unsigned\n-nitems, const Indent &indent, Precision prec)\n-create a DataArrayWriter\n-Definition dataarraywriter.hh:541\n-Dune::VTK::DataArrayWriterFactory::appendedEncoding\n-const std::string & appendedEncoding() const\n-query encoding string for appended data\n-Definition dataarraywriter.hh:510\n-Dune::VTK::VTUWriter\n-Dump a .vtu/.vtp files contents to a stream.\n-Definition vtuwriter.hh:98\n-Dune::VTK::VTUWriter::makeArrayWriter\n-DataArrayWriter * makeArrayWriter(const std::string &name, unsigned ncomps,\n-unsigned nitems, Precision prec)\n-acquire a DataArrayWriter\n-Definition vtuwriter.hh:380\n-Dune::VTK::VTUWriter::beginAppended\n-bool beginAppended()\n-start the appended data section\n-Definition vtuwriter.hh:345\n-Dune::VTK::VTUWriter::endAppended\n-void endAppended()\n-finish the appended data section\n-Definition vtuwriter.hh:359\n-Dune::VTK::VTUWriter::VTUWriter\n-VTUWriter(std::ostream &stream_, OutputType outputType, FileType fileType_)\n-create a VTUWriter object\n-Definition vtuwriter.hh:122\n-Dune::VTK::VTUWriter::stream\n-std::ostream & stream\n-Definition vtuwriter.hh:100\n-Dune::VTK::VTUWriter::endCellData\n-void endCellData()\n-finish CellData section\n-Definition vtuwriter.hh:220\n-Dune::VTK::VTUWriter::beginMain\n-void beginMain(unsigned ncells, unsigned npoints)\n-start the main PolyData/UnstructuredGrid section\n-Definition vtuwriter.hh:310\n-Dune::VTK::VTUWriter::beginCells\n-void beginCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:274\n-Dune::VTK::VTUWriter::endPointData\n-void endPointData()\n-finish PointData section\n-Definition vtuwriter.hh:182\n-Dune::VTK::VTUWriter::Phase\n-Phase\n-Definition vtuwriter.hh:101\n-Dune::VTK::VTUWriter::appended\n-@ appended\n-Definition vtuwriter.hh:101\n-Dune::VTK::VTUWriter::main\n-@ main\n-Definition vtuwriter.hh:101\n-Dune::VTK::VTUWriter::beginCellData\n-void beginCellData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start CellData section\n-Definition vtuwriter.hh:205\n-Dune::VTK::VTUWriter::beginPointData\n-void beginPointData(const std::string &scalars=\"\", const std::string\n-&vectors=\"\")\n-start PointData section\n-Definition vtuwriter.hh:167\n-Dune::VTK::VTUWriter::endPoints\n-void endPoints()\n-finish section for the point coordinates\n-Definition vtuwriter.hh:249\n-Dune::VTK::VTUWriter::~VTUWriter\n-~VTUWriter()\n-write footer\n-Definition vtuwriter.hh:149\n-Dune::VTK::VTUWriter::endCells\n-void endCells()\n-start section for the grid cells/PolyData lines\n-Definition vtuwriter.hh:285\n-Dune::VTK::VTUWriter::beginPoints\n-void beginPoints()\n-start section for the point coordinates\n-Definition vtuwriter.hh:238\n-Dune::VTK::VTUWriter::endMain\n-void endMain()\n-finish the main PolyData/UnstructuredGrid section\n-Definition vtuwriter.hh:320\n-Dune::VTK::VTUWriter::phase\n-enum Dune::VTK::VTUWriter::Phase phase\n+Dune::Alberta::Element\n+ALBERTA EL Element\n+Definition misc.hh:54\n+Dune::Alberta::DofSpace\n+ALBERTA FE_SPACE DofSpace\n+Definition misc.hh:65\n+Dune::Alberta::MeshPointer\n+Definition meshpointer.hh:40\n+Dune::Alberta::MeshPointer::leafTraverse\n+void leafTraverse(Functor &functor, typename FillFlags::Flags\n+fillFlags=FillFlags::standard) const\n+Definition meshpointer.hh:385\n+Dune::Alberta::MeshPointer::hierarchicTraverse\n+void hierarchicTraverse(Functor &functor, typename FillFlags::Flags\n+fillFlags=FillFlags::standard) const\n+Definition meshpointer.hh:370\n+Dune::Alberta::DofAccess<_dim,_0_>\n+Dune::Alberta::HierarchyDofNumbering\n+Definition dofadmin.hh:93\n+Dune::Alberta::HierarchyDofNumbering::dofSpace\n+const DofSpace * dofSpace(int codim) const\n+Definition dofadmin.hh:145\n+Dune::Alberta::DofVectorPointer<_Level_>\n+Dune::Alberta::DofVectorPointer::create\n+void create(const DofSpace *dofSpace, const std::string &name=\"\")\n+Definition dofvector.hh:236\n+Dune::Alberta::DofVectorPointer::release\n+void release()\n+Definition dofvector.hh:254\n+Dune::Alberta::DofVectorPointer::dofSpace\n+const DofSpace * dofSpace() const\n+Definition dofvector.hh:223\n+Dune::Alberta::DofVectorPointer::forEach\n+void forEach(Functor &functor) const\n+Definition dofvector.hh:264\n+Dune::Alberta::ElementInfo\n+Definition elementinfo.hh:43\n+Dune::Alberta::ElementInfo::level\n+int level() const\n+Definition elementinfo.hh:533\n+Dune::Alberta::ElementInfo::el\n+Element * el() const\n+Definition elementinfo.hh:737\n+Dune::AlbertaGridLevelProvider\n+Definition level.hh:25\n+Dune::AlbertaGridLevelProvider::isNew\n+bool isNew(const Alberta::Element *element) const\n+Definition level.hh:62\n+Dune::AlbertaGridLevelProvider::isNew\n+bool isNew(const ElementInfo &elementInfo) const\n+Definition level.hh:68\n+Dune::AlbertaGridLevelProvider::MeshPointer\n+Alberta::MeshPointer< dim > MeshPointer\n+Definition level.hh:48\n+Dune::AlbertaGridLevelProvider::mesh\n+MeshPointer mesh() const\n+Definition level.hh:85\n+Dune::AlbertaGridLevelProvider::create\n+void create(const DofNumbering &dofNumbering)\n+Definition level.hh:96\n+Dune::AlbertaGridLevelProvider::maxLevel\n+Level maxLevel() const\n+Definition level.hh:73\n+Dune::AlbertaGridLevelProvider::DofNumbering\n+Alberta::HierarchyDofNumbering< dim > DofNumbering\n+Definition level.hh:49\n+Dune::AlbertaGridLevelProvider::release\n+void release()\n+Definition level.hh:109\n+Dune::AlbertaGridLevelProvider::operator()\n+Level operator()(const Alberta::Element *element) const\n+Definition level.hh:51\n+Dune::AlbertaGridLevelProvider::markAllOld\n+void markAllOld()\n+Definition level.hh:90\n+Dune::AlbertaGridLevelProvider::ElementInfo\n+Alberta::ElementInfo< dim > ElementInfo\n+Definition level.hh:47\n+Dune::AlbertaGridLevelProvider::SetLocal\n+Definition level.hh:127\n+Dune::AlbertaGridLevelProvider::SetLocal::SetLocal\n+SetLocal(const DofVectorPointer &level)\n+Definition level.hh:132\n+Dune::AlbertaGridLevelProvider::CalcMaxLevel\n+Definition level.hh:151\n+Dune::AlbertaGridLevelProvider::CalcMaxLevel::CalcMaxLevel\n+CalcMaxLevel()\n+Definition level.hh:155\n+Dune::AlbertaGridLevelProvider::CalcMaxLevel::maxLevel\n+Level maxLevel() const\n+Definition level.hh:169\n+Dune::AlbertaGridLevelProvider::Interpolation\n+Definition level.hh:197\n+Dune::AlbertaGridLevelProvider::Interpolation::Patch\n+Alberta::Patch< dimension > Patch\n+Definition level.hh:200\n+Dune::AlbertaGridLevelProvider::Interpolation::interpolateVector\n+static void interpolateVector(const DofVectorPointer &dofVector, const Patch\n+&patch)\n+Definition level.hh:202\n+Dune::Alberta::FillFlags\n+Definition misc.hh:231\n+Dune::Alberta::FillFlags::nothing\n+static const Flags nothing\n+Definition misc.hh:234\n+Dune::Alberta::Patch\n+Definition refinement.hh:40\n+Dune::Alberta::Patch::count\n+int count() const\n+Definition refinement.hh:67\n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}]}]}]}]}